Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
},
"dependencies": {
"@ai-sdk/provider": "^1.1.3",
"@apm-js-collab/code-transformer": "^0.9.0",
"@apm-js-collab/code-transformer": "^0.12.0",
"@next/env": "^14.2.3",
"@vercel/functions": "^1.0.2",
"ajv": "^8.17.1",
Expand All @@ -209,7 +209,7 @@
"cli-progress": "^3.12.0",
"cli-table3": "^0.6.5",
"cors": "^2.8.5",
"dc-browser": "^1.0.3",
"dc-browser": "^1.0.4",
"dotenv": "^16.4.5",
"esbuild": "^0.27.0",
"eventsource-parser": "^1.1.2",
Expand Down
8 changes: 7 additions & 1 deletion js/src/auto-instrumentations/loader/esm-hook.mts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,15 @@ export async function load(url: string, context: any, nextLoad: Function) {
if (code) {
const transformer = transformers.get(url);
try {
const moduleType =
result.format === "module"
? "esm"
: result.format === "commonjs"
? "cjs"
: "unknown";
const transformedCode = transformer.transform(
code.toString("utf8"),
"unknown",
moduleType,
);
result.source = transformedCode?.code;
result.shortCircuit = true;
Expand Down
5 changes: 0 additions & 5 deletions js/tests/auto-instrumentations/transformation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ describe("Orchestrion Transformation Tests", () => {
// Verify orchestrion transformed the code
expect(output).toContain("tracingChannel");
expect(output).toContain("orchestrion:openai:chat.completions.create");
expect(output).toContain("tracePromise");
});

it("should bundle dc-browser module when browser: true", async () => {
Expand Down Expand Up @@ -149,7 +148,6 @@ describe("Orchestrion Transformation Tests", () => {
// Verify orchestrion transformed the code
expect(output).toContain("tracingChannel");
expect(output).toContain("orchestrion:openai:chat.completions.create");
expect(output).toContain("tracePromise");
});

it("should bundle dc-browser module when browser: true", async () => {
Expand Down Expand Up @@ -244,7 +242,6 @@ describe("Orchestrion Transformation Tests", () => {
expect(errors).toHaveLength(0);
expect(output).toContain("tracingChannel");
expect(output).toContain("orchestrion:openai:chat.completions.create");
expect(output).toContain("tracePromise");
});

it("should bundle dc-browser module when browser: true", async () => {
Expand Down Expand Up @@ -334,7 +331,6 @@ describe("Orchestrion Transformation Tests", () => {
expect(errors).toHaveLength(0);
expect(output).toContain("tracingChannel");
expect(output).toContain("orchestrion:openai:chat.completions.create");
expect(output).toContain("tracePromise");
});

it("should bundle dc-browser polyfill when browser: true (turbopack loader-only mode)", async () => {
Expand Down Expand Up @@ -418,7 +414,6 @@ describe("Orchestrion Transformation Tests", () => {
// Verify orchestrion transformed the code
expect(output).toContain("tracingChannel");
expect(output).toContain("orchestrion:openai:chat.completions.create");
expect(output).toContain("tracePromise");
});

it("should bundle dc-browser module when browser: true", async () => {
Expand Down
Loading
Loading