Skip to content

chore: upgrade to TypeScript 7 - #1119

Merged
Astro-Han merged 3 commits into
mainfrom
chore/ts7-upgrade
Jul 16, 2026
Merged

Astro-Han merged 3 commits into
mainfrom
chore/ts7-upgrade

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Upgrade TypeScript from 5.9.3 to 7.0.2 (native Go compiler). Closes #1113.

TypeScript 7 changed two defaults that required small adjustments in our setup:

  • The types compiler option now defaults to [] instead of auto-including @types packages. We add "types": ["node"] to tsconfig.base.json so node:* builtins resolve under moduleResolution: "Bundler".
  • The typescript package no longer exports ./bin/tsc in its exports field. One test that shells out to tsc is updated to resolve typescript/package.json and derive the binary path from there.

No product code changes.

Verification

  • npm run typecheck passes: ~10.6s (TS5) → ~3.4s (TS7)
  • npm run build passes: ~16s (TS5) → ~7s (TS7)
  • npm run test --workspaces --if-present passes: 2571 tests
  • npm run lint passes

Note: full root npm test (which includes real-model E2E contracts) was not run because it requires provider API keys.

Breaking change / Migration

None for users. This is an internal toolchain upgrade. The change to types in tsconfig.base.json narrows ambient types to Node only for packages that do not override types; this matches the behavior we already relied on in practice.

- Bump typescript to ^7.0.2 (native Go compiler)

- Add "types": ["node"] to tsconfig.base.json to resolve node:* builtins under moduleResolution: Bundler

- typecheck ~10.6s -> ~3.4s wall; clean build ~16s -> ~7s wall
…striction

TypeScript 7's package.json no longer exports ./bin/tsc via the exports field, so require.resolve('typescript/bin/tsc') fails. Replace with an upward search for node_modules/typescript/bin/tsc, which still works for borrowed worktree dependencies.
Replace the manual node_modules walk with createRequire + resolve('typescript/package.json') and join to bin/tsc, which is shorter and follows Node's module resolution semantics. Add a fake package.json to the borrowed-dependency test fixture so the new resolver can still find the mocked tsc.
@Astro-Han
Astro-Han merged commit 766b8a9 into main Jul 16, 2026
3 checks passed
@Astro-Han
Astro-Han deleted the chore/ts7-upgrade branch July 25, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: evaluate upgrading to TypeScript 7

1 participant