Repository navigation
feat(deps): upgrade to TypeScript 7 via the official alias pair - #67
Merged
Merged
Conversation
TypeScript 7.0 ships no programmatic API -- the package root exports lib/version.cjs and nothing else, and the API is planned for 7.1. Seven files here use the compiler API, typescript-eslint reads ts.versionMajorMinor and refuses major >= 7, and knip does the same kind of thing, so a bare bump to 7 breaks all of them. The upgrade is the configuration TypeScript documents for exactly this gap: "@typescript/native": "npm:typescript@^7.0.2" "typescript": "npm:@typescript/typescript6@^6.0.2" `typescript` resolves to the TypeScript 6 compatibility package, which carries the full compiler API, and TypeScript 7 arrives under an alias that owns the `tsc` bin (TS 6 names its own bin tsc6, so they do not collide). Typechecking runs on 7; everything that needs the API runs on 6, the JS implementation of the same language version. Nothing that consumes the compiler API changes. find-casts.ts, provider-host-boundary.ts, the maximal-electron test helpers and scripts, typescript-eslint and knip 5 all keep working untouched, and typescript-eslint lands inside its supported peer range rather than being refused. Two real migrations were needed: types: ["bun"] in maximal and maximal-core. TypeScript 6/7 no longer include it automatically. Without it every node:* import and every process/console reference fails to resolve in maximal, and maximal-core's declaration build fails on RequestInit, Response, AbortController and setTimeout. maximal-core's downstream tsconfigs keep types: [] and are unaffected -- they do not extend it. ignoreDeprecations: "6.0" in the six packages that generate declarations with tsup. tsup injects baseUrl, which TypeScript 7 drops; none of these configs sets baseUrl themselves. Removable once tsup stops emitting it. An earlier attempt aliased TypeScript 5 for the API instead. It reached zero typecheck errors and every lint passed, and it was wrong: pnpm gave typescript-eslint the 5.9.3 copy, so tsc checked with 7 while the type-aware lint rules checked with 5. verify-workspace.mjs's one-major guard did not catch it, because the alias installed under a different package name -- the same class of failure its own comment records from the last time this workspace ran two majors. Verified: all nine packages typecheck and lint, maximal-core check:deep:host passes end to end, every tsup declaration build passes, the container suite is 15/15, and verify:workspace passes with the lockfile re-resolved and stripped of rotating shard hosts.
stuffbucket
force-pushed
the
feat/typescript-7
branch
from
September 7, 2026 04:18
8b2290a to
213ceb4
Compare
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.
The other half of the language group from #37. Depends on nothing else; #60
carries
@types/nodeseparately.Why a bare bump does not work
TypeScript 7.0 ships no programmatic API. The package root exports
lib/version.cjsand nothing else —typeof ts.createProgramisundefined.The API is planned for 7.1.
That breaks three things at once here:
find-casts.ts,provider-host-boundary.ts, maximal-electron's test helpers and scripts);ts.versionMajorMinorand refuses major ≥ 7;The typescript-eslint failure is the dangerous one: install succeeds,
tscgetsfaster, and lint silently stops running rules.
The fix is the configuration TypeScript documents for this gap
typescriptresolves to the TS 6 compatibility package, which carries the fullcompiler API; TS 7 arrives under an alias owning the
tscbin (TS 6 names itsown bin
tsc6, so no collision). Typechecking runs on 7, everything needing theAPI runs on 6 — the JS implementation of the same language version.
Nothing that consumes the compiler API changes. All seven files are
untouched, knip stays on 5, and typescript-eslint lands inside its peer range
instead of being refused.
Two real migrations
types: ["bun"]inmaximal,maximal-corenode:*import andprocess/consolefails inmaximal, andmaximal-core's declaration build fails onRequestInit,Response,AbortController,setTimeout.maximal-core's downstream tsconfigs keeptypes: []and are unaffected — they do not extend it.ignoreDeprecations: "6.0"in the six tsup-dts packagesbaseUrl, which TS 7 drops. None of these configs sets it themselves. Removable once tsup stops emitting it.A wrong turn worth recording
My first attempt aliased TypeScript 5 for the API instead. It reached zero
typecheck errors and every lint passed — and it was wrong. pnpm gave
typescript-eslint the 5.9.3 copy, so
tscchecked with 7 while the type-awarelint rules checked with 5: two type systems judging the same code.
verify-workspace.mjs's "one typescript major" guard did not catch it,because the alias installed under a different package name. That guard's own
comment records this exact class of failure from the last time this workspace
ran two majors — "made eslint-plugin-perfectionist call a TS 5 API on the TS 7
module". Under the official pair the guard is honest again:
typescriptresolves to one major everywhere.
Verification
not silently skipped).
maximal-corecheck:deep:hostpasses end to end — including knip 5, casts,deps, dupes, build, and the downstream contract typecheck.
had missed by running only
tsc --noEmitlocally instead of the builds.)verify:workspaceclean; lockfilere-resolved and stripped of rotating shard hosts.