After the ship-compiled-dist change (PR to come), all five @davstack/* packages compile JS via tsup but ship no .d.ts — dts: true was disabled because dts generation runs a full typecheck and the existing source has unresolved type errors.
Why blocked
packages/cli-utils/src/cli.ts surfaces these on dts:
Property 'error' does not exist on type '{ ok: true; value: FlagValue }' — discriminated-union narrowing not threading through to several call sites (lines 171, 188, 208, 260).
Cannot find name 'process' (lines 203, 204) — @types/node not installed at any level.
Dynamic imports are only supported when 'module' is es2020/esnext/nodenext/etc + An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled (lines 259, 265, 271) — bun-style await import("./foo.ts") with explicit extension.
These cascade into vitest-server / playwright-server / logs-server / open-agents (all depend on cli-utils types).
Fix plan
- Add
@types/node at workspace root.
- Add a
tooling/typescript/node-esm.json preset: module: esnext, moduleResolution: bundler, allowImportingTsExtensions: true, noEmit: true, target: es2022, strict: true.
- Per-package
tsconfig.json extending that preset.
- Fix the
.error narrowing in cli.ts (likely a missing if (!result.ok) guard before reading .error).
- Flip
dts: false → dts: true in every tsup.config.ts and restore the "types" conditions in each package.json exports block.
Acceptance
pnpm exec turbo run build passes including dts for all 5 packages.
- Tarballs contain
dist/*.d.ts next to dist/*.js.
- A consumer's
tsc resolves @davstack/vitest-server/config etc.
After the ship-compiled-dist change (PR to come), all five
@davstack/*packages compile JS via tsup but ship no.d.ts—dts: truewas disabled because dts generation runs a full typecheck and the existing source has unresolved type errors.Why blocked
packages/cli-utils/src/cli.tssurfaces these on dts:Property 'error' does not exist on type '{ ok: true; value: FlagValue }'— discriminated-union narrowing not threading through to several call sites (lines 171, 188, 208, 260).Cannot find name 'process'(lines 203, 204) —@types/nodenot installed at any level.Dynamic imports are only supported when 'module' is es2020/esnext/nodenext/etc+An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled(lines 259, 265, 271) — bun-styleawait import("./foo.ts")with explicit extension.These cascade into vitest-server / playwright-server / logs-server / open-agents (all depend on cli-utils types).
Fix plan
@types/nodeat workspace root.tooling/typescript/node-esm.jsonpreset:module: esnext,moduleResolution: bundler,allowImportingTsExtensions: true,noEmit: true,target: es2022,strict: true.tsconfig.jsonextending that preset..errornarrowing in cli.ts (likely a missingif (!result.ok)guard before reading.error).dts: false→dts: truein everytsup.config.tsand restore the"types"conditions in each package.jsonexportsblock.Acceptance
pnpm exec turbo run buildpasses including dts for all 5 packages.dist/*.d.tsnext todist/*.js.tscresolves@davstack/vitest-server/configetc.