Repository navigation
build(deps-dev): upgrade TypeScript to 7 and replace ts-node with tsx - #163
Merged
Merged
Conversation
tsdown can emit declarations with the native compiler; ts-node cannot, because TypeScript 7 no longer ships the compiler API it loads. • Bump `typescript` to `^7.0.2`; declarations are generated through tsdown's `rolldown-plugin-dts` tsgo backend. • Replace `ts-node` with `tsx` for the `dev` script; tsx transpiles with esbuild and does not depend on the TypeScript compiler API. • Rename `scripts/gh-pages-publish.js` to `.cjs` and run it with `node`, since the script is CommonJS inside a `type: module` package; this removes the last ts-node usage. • Re-add `esbuild` to `allowScripts` for tsx's install script.
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.
Adopt TypeScript 7 (the native compiler) and replace the one tool that cannot follow it.
tsdownemits declarations throughrolldown-plugin-dts;ts-nodeloads the TypeScript compiler API, which TypeScript 7 no longer exposes.• Bump
typescriptfrom5.9.3to^7.0.2.• Replace
ts-nodewithtsxfornpm run dev. tsx transpiles with esbuild and does not touch the TypeScript API, so it keeps working with TS 7.• Rename
scripts/gh-pages-publish.jsto.cjsand run it with plainnode. The script usesrequire()inside atype: modulepackage, so.cjsis the correct extension; this removes the last ts-node usage.• Re-add
esbuildtoallowScripts, since tsx installs it and its postinstall is reviewed.• No source changes: the upgrade is entirely toolchain.
Verification
On Node.js 26.13.0:
npm run build— produces the same 26 files as before;npm test -- test/build-artifacts.spec.ts— 21/21 passed (CJS/ESM interop, IIFE global, declarations, shebang).npm test— 1,380 tests passed;npm run coverageunchanged at statements 95.66%, branches 91.93%, functions 95.83%, lines 95.54%.npm run lint:ci— passes.npm run dev -- --help— the CLI starts under tsx.node --check scripts/gh-pages-publish.cjs— syntax valid.npm auditandosv-scanner— 0 findings.The CI matrix (22.x/24.x/26.x), OSV workflows, and
verify-lockfilerun on this pull request.Note
npx tsc --noEmitstill reportsCannot find name 'process'/'console'insrc/cli.ts. That predates this change: the project has no@types/node, and the check is not part of CI. Adding@types/nodeplus atsc --noEmitstep would make a real typecheck available; left as a separate change to keep this one about the compiler upgrade.