Skip to content

Commit 6dd651b

Browse files
Qardclaude
andcommitted
fix: use vitest aliases for @braintrust/browser bundler plugins instead of workspace dep
Adding @braintrust/browser as a devDep of braintrust created a circular dependency detected by Turborepo. Instead, alias the three bundler subpaths directly to their TypeScript source files in integrations/browser-js/src/bundler/ within vitest.config.js. Also alias braintrust/auto-instrumentation-configs to the workspace source to bypass the stale npm v3.0.0-rc.29 copy in integrations/browser-js/node_modules. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 143eab9 commit 6dd651b

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

js/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@
153153
"ai": "^6.0.0",
154154
"async": "^3.2.5",
155155
"autoevals": "^0.0.131",
156-
"@braintrust/browser": "workspace:*",
157156
"cross-env": "^7.0.3",
158157
"dc-browser": "^1.0.3",
159158
"eslint-plugin-node-import": "^1.0.5",

js/vitest.config.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,23 @@ const config = {
1515
alias: {
1616
// Prevent resolution into vendor directories
1717
vendor: false,
18-
// Force braintrust subpath imports to resolve to the workspace source,
19-
// not the stale npm version pinned in integrations/browser-js/node_modules.
18+
// Alias @braintrust/browser bundler subpaths to source files to avoid a
19+
// circular workspace dependency (braintrust -> @braintrust/browser -> braintrust).
20+
"@braintrust/browser/esbuild": path.resolve(
21+
__dirname,
22+
"../integrations/browser-js/src/bundler/esbuild.ts",
23+
),
24+
"@braintrust/browser/vite": path.resolve(
25+
__dirname,
26+
"../integrations/browser-js/src/bundler/vite.ts",
27+
),
28+
"@braintrust/browser/rollup": path.resolve(
29+
__dirname,
30+
"../integrations/browser-js/src/bundler/rollup.ts",
31+
),
32+
// Redirect braintrust subpath import used by the browser bundler plugin to the
33+
// workspace source, bypassing the stale npm v3.0.0-rc.29 copy in
34+
// integrations/browser-js/node_modules (which predates this export).
2035
"braintrust/auto-instrumentation-configs": path.resolve(
2136
__dirname,
2237
"src/auto-instrumentations/index.ts",

pnpm-lock.yaml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)