Skip to content

Upgrade to TypeScript 7 #628

Description

@lmorchard

Context

typescript is currently pinned to ^6.0.3 across all five manifests by #627, after #617 bumped it to ^7.0.2 and broke pnpm run build on main, blocking releases.

This issue tracks doing the TS7 upgrade properly.

Why the pin exists

TypeScript 7.0 (GA 2026-07-08) is the Go port of the compiler — Project Corsa. The relevant consequence is not a bug in any one package:

TypeScript 7.0 does not ship a public programmatic compiler API. Microsoft has said 7.1 will introduce a new — and different — API. Until then, any tool that consumes the TypeScript API programmatically cannot run on TS7.

Visible in the package itself: typescript@6.0.3 ships bin: { tsc, tsserver }; typescript@7.0.2 ships bin: { tsc } only.

The concrete failure we hit:

TypeError: Cannot read properties of undefined (reading 'useCaseSensitiveFileNames')
  at node_modules/.pnpm/rollup-plugin-dts@6.1.1_.../rollup-plugin-dts.cjs
  in tsup/dist/rollup.js

tsup runs declaration emit through rollup-plugin-dts, which reads ts.sys.useCaseSensitiveFileNames from the programmatic API. Under TS7 that API isn't there.

This affects a broad set of ecosystem tools (typescript-eslint, ts-jest, ts-morph, and others), not just us.

What actually blocks us

# Blocker Status
1 tsup DTS pass via rollup-plugin-dts Hard blocker. rollup-plugin-dts@6.4.1 (latest) declares peerDependencies.typescript: ^4.5 || ^5.0 || ^6.0. tsup is already at latest 8.5.1. No upgrade path exists today.
2 ts-json-schema-generator@2.9.0 Not currently blocking — it depends on typescript: ^5.9.3 and resolves its own copy (TS 5.9.3 is in the lockfile alongside the root version), so check:schemas is insulated from the root bump. Worth confirming that stays true.

What is not blocked

The codebase itself already typechecks clean under TS7. Between #617 and #627, main was on ^7.0.2 and every PR's Typecheck core / Typecheck CLI / Typecheck server step passed — the tsc CLI works fine. The blocker is narrowly the programmatic-API consumers in the build pipeline.

So this is a tooling upgrade, not a source-code migration.

What needs to happen

  1. Wait for TypeScript 7.1, which is expected to introduce the replacement programmatic API. Historical cadence puts that around October 2026.
  2. Wait for rollup-plugin-dts to port to that API, and for tsup to pick up the new version. Track:
  3. Then bump typescript in all five manifests together — root, packages/cli, packages/core, packages/server, packages/extension. They must move as a unit or scripts/check-dep-versions.mjs fails. (build(deps): pin typescript below 7 to unbreak the release build #627 initially missed extension and server; CI caught it.)
  4. Verify against the release path, not just tests. ci: guard the release build on PRs #614 adds a Release build job that runs the root pnpm run build, executes the built binary, and checks tarball completeness. That job is what turns this class of breakage from silent into loud — it's how the TS7 break was found. Confirm it's green before merging any future TS bump.

Alternative worth evaluating

If we want TS7's speed before the API lands, the side-by-side approach used elsewhere in the ecosystem:

  • keep typescript at 6.x for the build pipeline
  • add @typescript/native-preview (currently 7.0.0-dev.20260707.2, "Preview CLI and JS API for the native TypeScript compiler port") purely for fast typechecking, e.g. a tsgo --noEmit CI step

That gets the ~10x typecheck speedup without touching declaration emit. Worth a spike if CI typecheck time becomes a pain point; not urgent otherwise.

Guardrail in the meantime

Dependabot will keep proposing typescript@7. Options:

The second is strictly better than today's silent-merge behaviour, but the first avoids the churn. Doing both is reasonable.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions