Repository navigation
chore: Upgrade TypeScript to 7.0 and enable isolatedDeclarations - #990
Merged
Merged
Conversation
With TypeScript 7.0, tsdown generates the declarations with the tsgo binary instead of the TypeScript API. The build output is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Up to standards ✅🟢 Issues
|
4 tasks done
With isolatedDeclarations, tsdown generates the declarations with Oxc instead of TypeScript, so the build no longer depends on the TypeScript API or the tsgo binary. The generated declarations are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Upgrades
typescriptfrom 6.0.3 to 7.0.2 and enablesisolatedDeclarations.TypeScript 7.0
TypeScript 7.0 has no stable JS API. Without
isolatedDeclarations, tsdown (throughrolldown-plugin-dts) would generate the declarations by running thetsgobinary, with a "TypeScript 7.0 does not yet have a stable API" warning. Also,rolldown-plugin-dtsonly supports~7.0.0, so a 7.1 bump would break the build.No tsconfig change is needed for TypeScript 7.
isolatedDeclarations
With
isolatedDeclarations, tsdown generatesdist/index.d.tswith Oxc instead of TypeScript. The build no longer depends on the TypeScript API or thetsgobinary: no warning, future TypeScript upgrades can't break it, and the declarations are generated faster.tscstill enforces the rule, so code that Oxc can't handle is reported bypnpm run typecheckand in the editor.Changes:
createPropFilter: explicit return type.defaultOptions: typed asOptions.tsdown.config.ts/vitest.config.ts: the default export is a typed constant, because these files are part of the tsconfig andisolatedDeclarationscan't infer default exports.dist/index.jsanddist/index.d.tsare byte-identical to the current build.Checks
pnpm run typecheckpnpm run test(215 tests)pnpm run build(attw and publint pass, declarations generated by Oxc, no warning)pnpm run lint/pnpm run format🤖 Generated with Claude Code