Repository navigation
Reorganize js sdk wrappers - #1011
Conversation
| "watch": "tsup --watch", | ||
| "clean": "rm -r dist/* && rm -r dev/dist/*", | ||
| "docs": "npx typedoc --options typedoc.json src/index.ts", | ||
| "test": "vitest run --exclude src/wrappers/anthropic.test.ts --exclude src/wrappers/oai.test.ts --exclude src/otel.test.ts --exclude src/otel-no-deps.test.ts --exclude src/wrappers/ai-sdk-v1.test.ts --exclude src/wrappers/ai-sdk-v2.test.ts --exclude src/wrappers/ai-sdk-v3.test.ts --exclude src/wrappers/mastra.test.ts --exclude src/wrappers/claude-agent-sdk.test.ts --exclude src/wrappers/google-genai.test.ts", |
There was a problem hiding this comment.
the main win from this is we are now always running all the wrapper tests with conflicting deps in CI now. I've also moved the code around to be more understandable.
| expect(taskSpan!.output).toBeDefined(); | ||
|
|
||
| // Verify task span metrics match the result message usage | ||
| // Verify result message has usage data |
There was a problem hiding this comment.
this test was broken lol, fixing now that we run in CI
|
Codex (@codex) review |
Olmo Maldonado (ibolmo)
left a comment
There was a problem hiding this comment.
TIL! This is going to be a great improvement
| "**/cypress/**", | ||
| "**/.{idea,git,cache,output,temp}/**", | ||
| "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*", | ||
| "src/wrappers/ai-sdk-4/**", |
There was a problem hiding this comment.
i suppose if we moved every wrapper to this pattern we might eventually just do src/wrappers/**
| # ------------------------------------------------------------------------------------------------- | ||
|
|
||
| test-ai-sdk-4: | ||
| cd src/wrappers/ai-sdk-4 && pnpm install && pnpm test |
There was a problem hiding this comment.
i wonder if we could just have the main package.json delegate to the underlying ones.
i.e.
"test": "pnpm test:ai-sdk-v4 && ...",
"test:ai-sdk-v4": "cd src/wrappers/ai-sdk-v4 && pnpm test",tl;dr i wonder if there's a nice way to get this without each of these make targets (always seemed odd)
There was a problem hiding this comment.
yeah, i'd be fine with just moving all of this in package.json. I'll make a ticket
…1012) I tried prereleasing #1011 but didn't specify a prerelease suffix so ended up releasing `0.4.7` on beta tag 🤦 https://www.npmjs.com/package/braintrust/v/0.4.6?activeTab=versions new github flow: <img width="1160" height="1000" alt="image" src="https://github.com/user-attachments/assets/c0a13f61-35e8-4c1d-ad86-48471dd268fb" /> new package release (github run number used for uniqueness): `0.4.7-rc.8` https://www.npmjs.com/package/braintrust/v/0.4.7-rc.8
This PR reorganizes js sdk wrappers and runs via

pnpm-workspace:example:
the
package.jsonfiles are mainly to run tests/golden tests and are private submodules. this is to make sure we don't accidentally introduce "real" dependencies to the actual package.