diff --git a/docs/span-customization-hooks-design.md b/docs/span-customization-hooks-design.md index 473f435f7..25a1ac620 100644 --- a/docs/span-customization-hooks-design.md +++ b/docs/span-customization-hooks-design.md @@ -1241,31 +1241,26 @@ span := braintrust.StartSpan(SpanConfig{ ## Next Steps 1. **Requirements Validation** - - Validate with users across different languages - Confirm use cases are addressed - Gather feedback on API ergonomics 2. **Prototype Implementation** - - Build prototypes in JavaScript, Python, and Go - Test with real auto-instrumentation scenarios - Measure performance impact 3. **API Refinement** - - Finalize hook interface signatures - Define error handling behavior - Document edge cases 4. **Documentation** - - Write comprehensive guides with examples - Create cookbook of common hook patterns - Document best practices per language 5. **Implementation Rollout** - - Implement in priority languages first - Gather early feedback - Iterate and expand to remaining languages diff --git a/integrations/otel-js/examples/otel-v1/otel_compat.ts b/integrations/otel-js/examples/otel-v1/otel_compat.ts index 08dd196e8..92dee434f 100644 --- a/integrations/otel-js/examples/otel-v1/otel_compat.ts +++ b/integrations/otel-js/examples/otel-v1/otel_compat.ts @@ -35,9 +35,8 @@ async function main() { // Try to import AsyncHooksContextManager - it's optional but required for context propagation let AsyncHooksContextManager: any; try { - const contextAsyncHooks = await import( - "@opentelemetry/context-async-hooks" - ); + const contextAsyncHooks = + await import("@opentelemetry/context-async-hooks"); AsyncHooksContextManager = contextAsyncHooks.AsyncHooksContextManager; } catch (e) { console.error("⚠️ @opentelemetry/context-async-hooks not found."); diff --git a/integrations/otel-js/src/otel-compat.test.ts b/integrations/otel-js/src/otel-compat.test.ts index 784c3c8e9..166249fbe 100644 --- a/integrations/otel-js/src/otel-compat.test.ts +++ b/integrations/otel-js/src/otel-compat.test.ts @@ -708,9 +708,8 @@ describe("Distributed Tracing (BT → OTEL)", () => { }); test("otelContextFromSpanExport parses BT span and creates OTEL context", async () => { - const { contextFromSpanExport: otelContextFromSpanExport } = await import( - "./" - ); + const { contextFromSpanExport: otelContextFromSpanExport } = + await import("./"); const { SpanComponentsV4 } = await import("braintrust/util"); const { SpanObjectTypeV3 } = await import("braintrust/util"); @@ -755,9 +754,8 @@ describe("Distributed Tracing (BT → OTEL)", () => { test("BT span in Service A can be parent of OTEL span in Service B", async () => { const { tracer, exporter, processor } = setupOtelFixture("service-a-project"); - const { contextFromSpanExport: otelContextFromSpanExport } = await import( - "./" - ); + const { contextFromSpanExport: otelContextFromSpanExport } = + await import("./"); const projectName = "service-a-project"; const logger = initLogger({ projectName }); diff --git a/integrations/temporal-js/src/workflow-interceptors.ts b/integrations/temporal-js/src/workflow-interceptors.ts index a1dd2bf70..914dcc154 100644 --- a/integrations/temporal-js/src/workflow-interceptors.ts +++ b/integrations/temporal-js/src/workflow-interceptors.ts @@ -41,9 +41,7 @@ interface WorkflowSpanState { spanId: string | undefined; } -class BraintrustWorkflowInboundInterceptor - implements WorkflowInboundCallsInterceptor -{ +class BraintrustWorkflowInboundInterceptor implements WorkflowInboundCallsInterceptor { constructor(private state: WorkflowSpanState) {} async execute( @@ -76,9 +74,7 @@ class BraintrustWorkflowInboundInterceptor } } -class BraintrustWorkflowOutboundInterceptor - implements WorkflowOutboundCallsInterceptor -{ +class BraintrustWorkflowOutboundInterceptor implements WorkflowOutboundCallsInterceptor { constructor(private state: WorkflowSpanState) {} private getHeaders(): Record { diff --git a/js/smoke/README.md b/js/smoke/README.md index 89b725452..ff060a0f2 100644 --- a/js/smoke/README.md +++ b/js/smoke/README.md @@ -210,15 +210,12 @@ Scenarios automatically create tarballs if they're not provided via environment ### Environment Variables - **`BRAINTRUST_TAR`**: Path to braintrust tarball (auto-created if not set) - - Example: `../artifacts/braintrust-latest.tgz` - **`BRAINTRUST_OTEL_TAR`**: Path to @braintrust/otel tarball (auto-created for scenarios that need it) - - Example: `../artifacts/braintrust-otel-latest.tgz` - **`BRAINTRUST_TEMPLATES_NUNJUCKS_JS_TAR`**: Path to @braintrust/templates-nunjucks-js tarball - - Example: `../artifacts/braintrust-templates-nunjucks-js-latest.tgz` - **`SMOKE_V2_SHARED_DIST`**: Path to shared test utilities (auto-built if not set) diff --git a/js/src/auto-instrumentations/README.md b/js/src/auto-instrumentations/README.md index 8a6c3836e..b55624222 100644 --- a/js/src/auto-instrumentations/README.md +++ b/js/src/auto-instrumentations/README.md @@ -112,19 +112,16 @@ The bundler plugins (Vite, Webpack, esbuild, Rollup) apply transformations durin The plugin system follows the OpenTelemetry pattern: - **Core Infrastructure**: `js/src/instrumentation/core/` in the main `braintrust` package - - `BasePlugin` - Abstract base class for plugins - Channel utilities (`createChannelName`, `parseChannelName`, etc.) - Event type definitions - **Braintrust Implementation**: `js/src/instrumentation/braintrust-plugin.ts` in the main `braintrust` package - - `BraintrustPlugin` - Converts diagnostics_channel events into Braintrust spans - Automatically enabled when the Braintrust SDK is loaded - Supports configuration to disable specific integrations - **Plugin Registry**: `js/src/instrumentation/registry.ts` in the main `braintrust` package - - `PluginRegistry` - Manages plugin lifecycle - Automatically enables `BraintrustPlugin` on SDK initialization - Reads configuration from `configureInstrumentation()` API and `BRAINTRUST_DISABLE_INSTRUMENTATION` environment variable diff --git a/js/src/logger.ts b/js/src/logger.ts index 6035a75d0..f37855a47 100644 --- a/js/src/logger.ts +++ b/js/src/logger.ts @@ -5488,9 +5488,9 @@ export type WithTransactionId = R & { export const DEFAULT_FETCH_BATCH_SIZE = 1000; export const MAX_BTQL_ITERATIONS = 10000; -export class ObjectFetcher - implements AsyncIterable> -{ +export class ObjectFetcher implements AsyncIterable< + WithTransactionId +> { private _fetchedData: WithTransactionId[] | undefined = undefined; constructor( diff --git a/js/tests/auto-instrumentations/error-handling.test.ts b/js/tests/auto-instrumentations/error-handling.test.ts index a2a73a976..52eb876f3 100644 --- a/js/tests/auto-instrumentations/error-handling.test.ts +++ b/js/tests/auto-instrumentations/error-handling.test.ts @@ -76,9 +76,8 @@ describe("Error Handling", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -137,9 +136,8 @@ describe("Error Handling", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -189,9 +187,8 @@ describe("Error Handling", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -234,9 +231,8 @@ describe("Error Handling", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -288,9 +284,8 @@ describe("Error Handling", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -344,9 +339,8 @@ describe("Error Handling", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -409,9 +403,8 @@ describe("Error Handling", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], diff --git a/js/tests/auto-instrumentations/event-content.test.ts b/js/tests/auto-instrumentations/event-content.test.ts index bdca7428a..40e426a97 100644 --- a/js/tests/auto-instrumentations/event-content.test.ts +++ b/js/tests/auto-instrumentations/event-content.test.ts @@ -77,9 +77,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -152,9 +151,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -220,9 +218,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -301,9 +298,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -363,9 +359,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -418,9 +413,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -475,9 +469,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -534,9 +527,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -662,9 +654,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -738,9 +729,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -843,9 +833,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -951,9 +940,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -1059,9 +1047,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -1147,9 +1134,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -1249,9 +1235,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -1357,9 +1342,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -1434,9 +1418,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -1533,9 +1516,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -1623,9 +1605,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -1720,9 +1701,8 @@ describe("Event Content Validation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], diff --git a/js/tests/auto-instrumentations/function-behavior.test.ts b/js/tests/auto-instrumentations/function-behavior.test.ts index 2f97f8013..8f2fd32b5 100644 --- a/js/tests/auto-instrumentations/function-behavior.test.ts +++ b/js/tests/auto-instrumentations/function-behavior.test.ts @@ -66,9 +66,8 @@ describe("Function Behavior Preservation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -135,9 +134,8 @@ describe("Function Behavior Preservation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -183,9 +181,8 @@ describe("Function Behavior Preservation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -236,9 +233,8 @@ describe("Function Behavior Preservation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -291,9 +287,8 @@ describe("Function Behavior Preservation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -346,9 +341,8 @@ describe("Function Behavior Preservation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -401,9 +395,8 @@ describe("Function Behavior Preservation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -448,9 +441,8 @@ describe("Function Behavior Preservation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -500,9 +492,8 @@ describe("Function Behavior Preservation", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], diff --git a/js/tests/auto-instrumentations/multiple-instrumentations.test.ts b/js/tests/auto-instrumentations/multiple-instrumentations.test.ts index 5516876c7..eabe2b0cd 100644 --- a/js/tests/auto-instrumentations/multiple-instrumentations.test.ts +++ b/js/tests/auto-instrumentations/multiple-instrumentations.test.ts @@ -103,9 +103,8 @@ describe("Multiple Instrumentations", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -172,9 +171,8 @@ describe("Multiple Instrumentations", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -238,9 +236,8 @@ describe("Multiple Instrumentations", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -319,9 +316,8 @@ describe("Multiple Instrumentations", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -408,9 +404,8 @@ describe("Multiple Instrumentations", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); // Add custom instrumentation config const customConfig = { @@ -495,9 +490,8 @@ describe("Multiple Instrumentations", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], diff --git a/js/tests/auto-instrumentations/runtime-execution.test.ts b/js/tests/auto-instrumentations/runtime-execution.test.ts index c027335a9..f8641611b 100644 --- a/js/tests/auto-instrumentations/runtime-execution.test.ts +++ b/js/tests/auto-instrumentations/runtime-execution.test.ts @@ -66,9 +66,8 @@ describe("Runtime Execution of Bundled Code", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -126,9 +125,8 @@ describe("Runtime Execution of Bundled Code", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -193,9 +191,8 @@ describe("Runtime Execution of Bundled Code", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -239,9 +236,8 @@ describe("Runtime Execution of Bundled Code", () => { fs.writeFileSync(entryPoint, testCode); - const { vitePlugin } = await import( - "../../src/auto-instrumentations/bundler/vite.js" - ); + const { vitePlugin } = + await import("../../src/auto-instrumentations/bundler/vite.js"); await viteBuild({ root: fixturesDir, @@ -302,9 +298,8 @@ describe("Runtime Execution of Bundled Code", () => { fs.writeFileSync(entryPoint, testCode); - const { vitePlugin } = await import( - "../../src/auto-instrumentations/bundler/vite.js" - ); + const { vitePlugin } = + await import("../../src/auto-instrumentations/bundler/vite.js"); await viteBuild({ root: fixturesDir, @@ -358,9 +353,8 @@ describe("Runtime Execution of Bundled Code", () => { fs.writeFileSync(entryPoint, testCode); - const { rollupPlugin } = await import( - "../../src/auto-instrumentations/bundler/rollup.js" - ); + const { rollupPlugin } = + await import("../../src/auto-instrumentations/bundler/rollup.js"); // Simple resolver plugin const resolverPlugin = { @@ -428,9 +422,8 @@ describe("Runtime Execution of Bundled Code", () => { fs.writeFileSync(entryPoint, testCode); - const { rollupPlugin } = await import( - "../../src/auto-instrumentations/bundler/rollup.js" - ); + const { rollupPlugin } = + await import("../../src/auto-instrumentations/bundler/rollup.js"); const resolverPlugin = { name: "resolver", @@ -492,9 +485,8 @@ describe("Runtime Execution of Bundled Code", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -547,9 +539,8 @@ describe("Runtime Execution of Bundled Code", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], diff --git a/js/tests/auto-instrumentations/streaming-and-responses.test.ts b/js/tests/auto-instrumentations/streaming-and-responses.test.ts index 58bfe57f9..8d4a40ff5 100644 --- a/js/tests/auto-instrumentations/streaming-and-responses.test.ts +++ b/js/tests/auto-instrumentations/streaming-and-responses.test.ts @@ -155,9 +155,8 @@ describe("Streaming Methods and Responses API", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -217,9 +216,8 @@ describe("Streaming Methods and Responses API", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -312,9 +310,8 @@ describe("Streaming Methods and Responses API", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -403,9 +400,8 @@ describe("Streaming Methods and Responses API", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -465,9 +461,8 @@ describe("Streaming Methods and Responses API", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], @@ -559,9 +554,8 @@ describe("Streaming Methods and Responses API", () => { fs.writeFileSync(entryPoint, testCode); - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); await esbuild.build({ entryPoints: [entryPoint], diff --git a/js/tests/auto-instrumentations/transformation.test.ts b/js/tests/auto-instrumentations/transformation.test.ts index 71885c18b..96f2eb64a 100644 --- a/js/tests/auto-instrumentations/transformation.test.ts +++ b/js/tests/auto-instrumentations/transformation.test.ts @@ -39,9 +39,8 @@ describe("Orchestrion Transformation Tests", () => { describe("esbuild", () => { it("should transform OpenAI SDK code with tracingChannel", async () => { - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); const entryPoint = path.join(fixturesDir, "test-app.js"); const outfile = path.join(outputDir, "esbuild-bundle.js"); @@ -73,9 +72,8 @@ describe("Orchestrion Transformation Tests", () => { }); it("should bundle dc-browser module when browser: true", async () => { - const { esbuildPlugin } = await import( - "../../src/auto-instrumentations/bundler/esbuild.js" - ); + const { esbuildPlugin } = + await import("../../src/auto-instrumentations/bundler/esbuild.js"); const entryPoint = path.join(fixturesDir, "test-app.js"); const outfile = path.join(outputDir, "esbuild-browser-bundle.js"); @@ -113,9 +111,8 @@ describe("Orchestrion Transformation Tests", () => { describe("vite", () => { it("should transform OpenAI SDK code with tracingChannel", async () => { - const { vitePlugin } = await import( - "../../src/auto-instrumentations/bundler/vite.js" - ); + const { vitePlugin } = + await import("../../src/auto-instrumentations/bundler/vite.js"); const entryPoint = path.join(fixturesDir, "test-app.js"); const outDir = path.join(outputDir, "vite-dist"); @@ -156,9 +153,8 @@ describe("Orchestrion Transformation Tests", () => { }); it("should bundle dc-browser module when browser: true", async () => { - const { vitePlugin } = await import( - "../../src/auto-instrumentations/bundler/vite.js" - ); + const { vitePlugin } = + await import("../../src/auto-instrumentations/bundler/vite.js"); const entryPoint = path.join(fixturesDir, "test-app.js"); const outDir = path.join(outputDir, "vite-browser-dist"); @@ -203,9 +199,8 @@ describe("Orchestrion Transformation Tests", () => { describe("rollup", () => { it("should transform OpenAI SDK code with tracingChannel", async () => { const { rollup } = await import("rollup"); - const { rollupPlugin } = await import( - "../../src/auto-instrumentations/bundler/rollup.js" - ); + const { rollupPlugin } = + await import("../../src/auto-instrumentations/bundler/rollup.js"); const entryPoint = path.join(fixturesDir, "test-app.js"); const outfile = path.join(outputDir, "rollup-bundle.js"); @@ -253,9 +248,8 @@ describe("Orchestrion Transformation Tests", () => { it("should bundle dc-browser module when browser: true", async () => { const { rollup } = await import("rollup"); - const { rollupPlugin } = await import( - "../../src/auto-instrumentations/bundler/rollup.js" - ); + const { rollupPlugin } = + await import("../../src/auto-instrumentations/bundler/rollup.js"); const entryPoint = path.join(fixturesDir, "test-app.js"); const outfile = path.join(outputDir, "rollup-browser-bundle.js"); diff --git a/package.json b/package.json index 15eb89de0..8d559cd99 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "eslint": "^9.39.2", "husky": "^9.1.7", "lint-staged": "^16.2.7", - "prettier": "^3.5.3", + "prettier": "^3.8.1", "turbo": "^2.5.6", "dotenv-cli": "11.0.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1e435b662..78f01d233 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,8 +21,8 @@ importers: specifier: ^16.2.7 version: 16.2.7 prettier: - specifier: ^3.5.3 - version: 3.5.3 + specifier: ^3.8.1 + version: 3.8.1 turbo: specifier: ^2.5.6 version: 2.5.6 @@ -44,7 +44,7 @@ importers: version: 20.19.16 tsup: specifier: ^8.3.5 - version: 8.5.1(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.6)(typescript@5.5.4)(yaml@2.8.2) + version: 8.5.1(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.8)(typescript@5.5.4)(yaml@2.8.2) typescript: specifier: ^5.3.3 version: 5.5.4 @@ -77,7 +77,7 @@ importers: version: 2.6.6(@types/node@20.10.5)(typescript@5.3.3) tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.6)(typescript@5.3.3)(yaml@2.8.2) + version: 8.3.5(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.8)(typescript@5.3.3)(yaml@2.8.2) typedoc: specifier: ^0.25.13 version: 0.25.13(typescript@5.3.3) @@ -107,7 +107,7 @@ importers: version: link:../../js tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.6)(tsx@3.14.0)(typescript@5.4.4)(yaml@2.8.2) + version: 8.3.5(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.8)(tsx@3.14.0)(typescript@5.4.4)(yaml@2.8.2) tsx: specifier: ^3.14.0 version: 3.14.0 @@ -147,7 +147,7 @@ importers: version: link:../../js tsup: specifier: ^8.5.0 - version: 8.5.1(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.6)(typescript@5.5.4)(yaml@2.8.2) + version: 8.5.1(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.8)(typescript@5.5.4)(yaml@2.8.2) typedoc: specifier: ^0.28.15 version: 0.28.15(typescript@5.5.4) @@ -172,7 +172,7 @@ importers: version: link:../../js tsup: specifier: ^8.5.1 - version: 8.5.1(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.6)(typescript@5.5.4)(yaml@2.8.2) + version: 8.5.1(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.8)(typescript@5.5.4)(yaml@2.8.2) typescript: specifier: 5.5.4 version: 5.5.4 @@ -205,7 +205,7 @@ importers: version: link:../../js tsup: specifier: ^8.5.0 - version: 8.5.1(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.6)(typescript@5.5.4)(yaml@2.8.2) + version: 8.5.1(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.8)(typescript@5.5.4)(yaml@2.8.2) typescript: specifier: 5.5.4 version: 5.5.4 @@ -230,7 +230,7 @@ importers: version: 20.10.5 tsup: specifier: ^8.3.5 - version: 8.3.5(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.6)(typescript@5.3.3)(yaml@2.8.2) + version: 8.3.5(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.8)(typescript@5.3.3)(yaml@2.8.2) typescript: specifier: ^5.3.3 version: 5.3.3 @@ -432,7 +432,7 @@ importers: version: 29.1.4(@babel/core@7.28.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.28.0))(esbuild@0.27.0)(jest@29.7.0(@types/node@20.10.5)(ts-node@10.9.2(@swc/core@1.15.8)(@types/node@20.10.5)(typescript@5.4.4)))(typescript@5.4.4) tsup: specifier: ^8.5.1 - version: 8.5.1(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.6)(tsx@3.14.0)(typescript@5.4.4)(yaml@2.8.2) + version: 8.5.1(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.8)(tsx@3.14.0)(typescript@5.4.4)(yaml@2.8.2) tsx: specifier: ^3.14.0 version: 3.14.0 @@ -3267,8 +3267,8 @@ packages: resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} engines: {node: '>=0.10.0'} - dedent@1.7.1: - resolution: {integrity: sha512-9JmrhGZpOlEgOLdQgSm0zxFaYoQon408V1v49aqTWuXENVlnCuY9JBZcXZiCsZQWDjTm5Qf/nIvAy77mXDAjEg==} + dedent@1.7.2: + resolution: {integrity: sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA==} peerDependencies: babel-plugin-macros: ^3.1.0 peerDependenciesMeta: @@ -4819,6 +4819,10 @@ packages: resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} engines: {node: ^10 || ^12 || >=14} + postcss@8.5.8: + resolution: {integrity: sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==} + engines: {node: ^10 || ^12 || >=14} + prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -4828,8 +4832,8 @@ packages: engines: {node: '>=10.13.0'} hasBin: true - prettier@3.5.3: - resolution: {integrity: sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==} + prettier@3.8.1: + resolution: {integrity: sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==} engines: {node: '>=14'} hasBin: true @@ -8408,7 +8412,7 @@ snapshots: '@vue/shared': 3.5.21 estree-walker: 2.0.2 magic-string: 0.30.21 - postcss: 8.5.6 + postcss: 8.5.8 source-map-js: 1.2.1 '@vue/compiler-ssr@3.5.21': @@ -9193,7 +9197,7 @@ snapshots: decamelize@1.2.0: {} - dedent@1.7.1: {} + dedent@1.7.2: {} deep-eql@5.0.2: {} @@ -10097,7 +10101,7 @@ snapshots: '@types/node': 22.19.1 chalk: 4.1.2 co: 4.6.0 - dedent: 1.7.1 + dedent: 1.7.2 is-generator-fn: 2.1.0 jest-each: 29.7.0 jest-matcher-utils: 29.7.0 @@ -11180,12 +11184,12 @@ snapshots: pluralize@8.0.0: {} - postcss-load-config@6.0.1(jiti@2.6.1)(postcss@8.5.6)(tsx@3.14.0)(yaml@2.8.2): + postcss-load-config@6.0.1(jiti@2.6.1)(postcss@8.5.8)(tsx@3.14.0)(yaml@2.8.2): dependencies: lilconfig: 3.1.3 optionalDependencies: jiti: 2.6.1 - postcss: 8.5.6 + postcss: 8.5.8 tsx: 3.14.0 yaml: 2.8.2 @@ -11195,11 +11199,17 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 + postcss@8.5.8: + dependencies: + nanoid: 3.3.11 + picocolors: 1.1.1 + source-map-js: 1.2.1 + prelude-ls@1.2.1: {} prettier@2.8.8: {} - prettier@3.5.3: {} + prettier@3.8.1: {} pretty-format@29.7.0: dependencies: @@ -11841,7 +11851,7 @@ snapshots: tslib@2.8.1: {} - tsup@8.3.5(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.6)(tsx@3.14.0)(typescript@5.4.4)(yaml@2.8.2): + tsup@8.3.5(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.8)(tsx@3.14.0)(typescript@5.4.4)(yaml@2.8.2): dependencies: bundle-require: 5.1.0(esbuild@0.24.2) cac: 6.7.14 @@ -11851,7 +11861,7 @@ snapshots: esbuild: 0.24.2 joycon: 3.1.1 picocolors: 1.1.1 - postcss-load-config: 6.0.1(jiti@2.6.1)(postcss@8.5.6)(tsx@3.14.0)(yaml@2.8.2) + postcss-load-config: 6.0.1(jiti@2.6.1)(postcss@8.5.8)(tsx@3.14.0)(yaml@2.8.2) resolve-from: 5.0.0 rollup: 4.35.0 source-map: 0.8.0-beta.0 @@ -11861,7 +11871,7 @@ snapshots: tree-kill: 1.2.2 optionalDependencies: '@swc/core': 1.15.8 - postcss: 8.5.6 + postcss: 8.5.8 typescript: 5.4.4 transitivePeerDependencies: - jiti @@ -11869,7 +11879,7 @@ snapshots: - tsx - yaml - tsup@8.3.5(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.6)(typescript@5.3.3)(yaml@2.8.2): + tsup@8.3.5(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.8)(typescript@5.3.3)(yaml@2.8.2): dependencies: bundle-require: 5.1.0(esbuild@0.24.2) cac: 6.7.14 @@ -11879,7 +11889,7 @@ snapshots: esbuild: 0.24.2 joycon: 3.1.1 picocolors: 1.1.1 - postcss-load-config: 6.0.1(jiti@2.6.1)(postcss@8.5.6)(tsx@3.14.0)(yaml@2.8.2) + postcss-load-config: 6.0.1(jiti@2.6.1)(postcss@8.5.8)(tsx@3.14.0)(yaml@2.8.2) resolve-from: 5.0.0 rollup: 4.35.0 source-map: 0.8.0-beta.0 @@ -11889,7 +11899,7 @@ snapshots: tree-kill: 1.2.2 optionalDependencies: '@swc/core': 1.15.8 - postcss: 8.5.6 + postcss: 8.5.8 typescript: 5.3.3 transitivePeerDependencies: - jiti @@ -11897,7 +11907,7 @@ snapshots: - tsx - yaml - tsup@8.5.1(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.6)(tsx@3.14.0)(typescript@5.4.4)(yaml@2.8.2): + tsup@8.5.1(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.8)(tsx@3.14.0)(typescript@5.4.4)(yaml@2.8.2): dependencies: bundle-require: 5.1.0(esbuild@0.27.0) cac: 6.7.14 @@ -11908,7 +11918,7 @@ snapshots: fix-dts-default-cjs-exports: 1.0.1 joycon: 3.1.1 picocolors: 1.1.1 - postcss-load-config: 6.0.1(jiti@2.6.1)(postcss@8.5.6)(tsx@3.14.0)(yaml@2.8.2) + postcss-load-config: 6.0.1(jiti@2.6.1)(postcss@8.5.8)(tsx@3.14.0)(yaml@2.8.2) resolve-from: 5.0.0 rollup: 4.35.0 source-map: 0.7.6 @@ -11918,7 +11928,7 @@ snapshots: tree-kill: 1.2.2 optionalDependencies: '@swc/core': 1.15.8 - postcss: 8.5.6 + postcss: 8.5.8 typescript: 5.4.4 transitivePeerDependencies: - jiti @@ -11926,7 +11936,7 @@ snapshots: - tsx - yaml - tsup@8.5.1(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.6)(typescript@5.5.4)(yaml@2.8.2): + tsup@8.5.1(@swc/core@1.15.8)(jiti@2.6.1)(postcss@8.5.8)(typescript@5.5.4)(yaml@2.8.2): dependencies: bundle-require: 5.1.0(esbuild@0.27.0) cac: 6.7.14 @@ -11937,7 +11947,7 @@ snapshots: fix-dts-default-cjs-exports: 1.0.1 joycon: 3.1.1 picocolors: 1.1.1 - postcss-load-config: 6.0.1(jiti@2.6.1)(postcss@8.5.6)(tsx@3.14.0)(yaml@2.8.2) + postcss-load-config: 6.0.1(jiti@2.6.1)(postcss@8.5.8)(tsx@3.14.0)(yaml@2.8.2) resolve-from: 5.0.0 rollup: 4.35.0 source-map: 0.7.6 @@ -11947,7 +11957,7 @@ snapshots: tree-kill: 1.2.2 optionalDependencies: '@swc/core': 1.15.8 - postcss: 8.5.6 + postcss: 8.5.8 typescript: 5.5.4 transitivePeerDependencies: - jiti