Skip to content

Commit 6b5b0b0

Browse files
committed
fix: use dts-bundle-generator for SDK type generation in typecheck
The SDK build:types script was using plain tsc which generated nested type files (sdk/dist/sdk/src/*.d.ts) instead of a bundled index.d.ts. This caused TypeScript module resolution failures in CI when packages tried to import @codebuff/sdk. Changes: - Updated SDK build:types to use dts-bundle-generator for bundled types - Added pretypecheck hooks to npm-app and evals packages - This ensures SDK types are properly built before dependent packages typecheck The bundled approach matches the SDK's actual build script and correctly outputs dist/index.d.ts as expected by package.json types field.
1 parent 94844b6 commit 6b5b0b0

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

evals/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
}
1212
},
1313
"scripts": {
14+
"pretypecheck": "cd ../sdk && bun run build:types",
1415
"typecheck": "tsc --noEmit -p .",
1516
"test": "bun test",
1617
"test:manifold": "bun test manifold.test.ts",

npm-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"codebuff": "dist/index.js"
2020
},
2121
"scripts": {
22+
"pretypecheck": "cd ../sdk && bun run build:types",
2223
"typecheck": "tsc --noEmit -p .",
2324
"build": "bun run scripts/build-binary.js codebuff $(node -p \"require('./release/package.json').version\")",
2425
"release": "bun run scripts/release.js",

sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
],
2424
"scripts": {
2525
"build": "bun run scripts/build.ts",
26-
"build:types": "tsc -p tsconfig.build.json",
26+
"build:types": "bunx dts-bundle-generator -o dist/index.d.ts --no-check --export-referenced-types=false src/index.ts",
2727
"build:verify": "bun run build && bun run smoke-test:dist && bun run test:cjs && bun run test:esm && bun run test:ripgrep && bun run test:tree-sitter-queries",
2828
"test:typecheck-strict": "tsc --noEmit --strict dist/index.d.ts",
2929
"smoke-test:dist": "bun run smoke-test-dist.ts",

0 commit comments

Comments
 (0)