build: support TypeScript 6 (typescript 6.0.3, tsup ^7.3.0, ts-jest ^29.4.11)#55
Merged
Merged
Conversation
…29.4.11) - tsconfig: drop deprecated baseUrl (unused), set ignoreDeprecations '6.0' (tsup's dts build injects baseUrl internally, a hard error TS5101 under TS6), make pre-6.0 defaults explicit (strict: false) and declare types [node, jest] since TS6 no longer auto-includes @types packages - transpiler.ts: narrow the CompilerHost override key type to the three methods actually overridden - since TS 5.3 CompilerHost includes the non-function jsDocParsingMode member, so keyof-wide assignment cannot satisfy the intersection - devDeps: tsup ^7.3.0 (typescript peer >=4.5.0, fixes ERESOLVE vs typescript@6), ts-jest ^29.4.11 (supports typescript <7) tsc --noEmit clean; 359/359 tests pass; lint 0 errors; ESM/CJS/DTS build verified
tsconfig.json no longer sets ignoreDeprecations: our own deprecated option (baseUrl) was already removed in the TypeScript 6 migration, and tsc --noEmit, ts-jest (359 tests) and eslint are all clean without the flag. The flag was only load-bearing for tsup --dts: tsup unconditionally injects baseUrl into the compiler options it passes to its bundled rollup-plugin-dts (node_modules/tsup/dist/rollup.js: baseUrl: compilerOptions.baseUrl || ".", still present as of tsup 8.5.1), which TypeScript 6 rejects with TS5101. The suppression now lives in tsup.config.ts under dts.compilerOptions, scoped to that one generated program. Build flags moved from the build script into tsup.config.ts unchanged; dist output verified byte-identical.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Upgrades the pinned
typescript4.9.5 to 6.0.3 and makes the toolchain compatible:baseUrl(unused — all imports are relative; hard error TS5101 under TS 6); make pre-6.0 defaults explicit ("strict": false) and declare"types": ["node", "jest"]since TS 6 no longer auto-includes@types/*packages.tsconfig.jsonis fully deprecation-free — noignoreDeprecationsanywhere in it.buildscript CLI into config. The TS6 deprecation suppression is scoped here to tsup's dts program only (dts.compilerOptions.ignoreDeprecations: "6.0"): tsup unconditionally injectsbaseUrlinto the compiler options it hands to its bundled rollup-plugin-dts (node_modules/tsup/dist/rollup.js:baseUrl: compilerOptions.baseUrl || ".", still present as of tsup 8.5.1), which TS 6 rejects with TS5101.tsc --noEmit, ts-jest (359 tests) and eslint all run with no suppression; dist output verified byte-identical.CompilerHostoverride key type to the three methods actually overridden (getSourceFile/readFile/fileExists) — since TS 5.3CompilerHostincludes the non-functionjsDocParsingModemember, so an assignment throughkeyof ts.CompilerHostcan no longer satisfy the resulting intersection typetsup6.4.0 →^7.3.0(itstypescript@"^4.1.0"optional peer conflicted with typescript@6; 7.x allows>=4.5.0),ts-jest→^29.4.11(supports typescript<7)Verification
npx tsc --noEmit— cleannpm test— 359/359 tests, 8/8 suites passnpm run build— lint 0 errors; ESM + CJS + DTS emit succeeddist/andtests/integration/outputs intentionally left untouched