Summary
dtsx drives the TypeScript compiler API (ts.createSourceFile, used in packages/dtsx/src/parallel-processor.ts, utils.ts, circular.ts). TypeScript 7 is a Go port whose npm package no longer exposes that API — it exports only version and versionMajorMinor. So dtsx cannot run at all against TS 7.
Reproduction
Any invocation, in an environment where typescript@7 resolves:
SyntaxError: Export named 'createSourceFile' not found in module
~/.bun/install/cache/typescript@7.0.2@@@1/lib/version.cjsconst ts = await import('typescript')
;(ts.default ?? ts).version // '7.0.2'
;(ts.default ?? ts).createSourceFile // undefined
Object.keys(ts.default ?? ts) // ['version', 'versionMajorMinor']Why it bites even though the range says ^6.0.2
packages/dtsx/package.json declares "typescript": "^6.0.2", which 7.0.2 does not satisfy. But in a workspace that also depends on TypeScript, the hoisted copy is what an unscoped import('typescript') resolves to — in stacksjs/stx that is 7.0.2, and dtsx picks it up. The declared range does not protect the import.
Downstream effect
stacksjs/stx ships declarations generated by dtsx, and two of them are currently syntactically invalid — truncated mid-signature:
// dist/composables.d.ts
export declare const RouterKey: (createInjectionKey<{
currentRoute: string
navigate: (path: string)) => unknown;dist/composables.d.ts has 4 parse errors and dist/story/cli.d.ts has 10. dist/ is published, and a syntax error in a .d.ts is not suppressible with skipLibCheck (that only silences semantic diagnostics), so tsc aborts on any consumer program that pulls the file in — reporting nothing about the consumer's own code. Filed as stacksjs/stx#1888; stx now detects and re-emits these at build time.
I want to be precise about attribution: I could not confirm which dtsx code path produced that truncation, because dtsx does not run in this environment at all (the error above). The affected shape is consistent — a function-typed property nested inside a type argument:
// truncates
export const RouterKey = createInjectionKey<{
currentRoute: string
navigate: (path: string) => void
}>('router')
// same call, no function-typed property — emits correctly
export const ThemeKey = createInjectionKey<{
mode: 'light' | 'dark'
}>('theme')That may be a pre-existing bug from an older run rather than a TS-7 symptom. Both are worth checking.
Ask
- Decide dtsx's stance on TypeScript 7. It removed the JS compiler API, so this is not a version bump — it needs either a pinned TS ≤6 that dtsx resolves itself rather than through hoisting, or a different parser.
oxc-parseris already a declared dependency but is not imported anywhere underpackages/dtsx/src. - Fail loudly on an incompatible TypeScript instead of throwing
Export named 'createSourceFile' not foundfrom deep inside a module load. - Check the truncation shape above independently of (1) — a function type nested in a type argument, emitted as
(param: T)) => unknown;.