Skip to content

Upgrade to TypeScript 7 - #440

Merged
timotheeguerin merged 2 commits into
alloy-framework:mainfrom
timotheeguerin:timotheeguerin/typescript-7
Jul 15, 2026
Merged

Upgrade to TypeScript 7#440
timotheeguerin merged 2 commits into
alloy-framework:mainfrom
timotheeguerin:timotheeguerin/typescript-7

Conversation

@timotheeguerin

Copy link
Copy Markdown
Collaborator

Upgrades the repo to TypeScript 7 (the native Go compiler, now published as typescript@7).

Background

TypeScript 7's typescript package only ships the tsc binary plus a version export and a new unstable/* API — the classic programmatic compiler API (ts.createProgram, ts.sys, getParsedCommandLineOfConfigFile, watch host, formatDiagnostics…) is gone. The only place using it was @alloy-js/cli.

Changes

  • Catalog: typescript ^6.0.3^7.0.2.
  • @alloy-js/cli alloy build rewritten to use the project's native tsc binary:
    • Config parsed via tsc --showConfig (child process).
    • Type-check + declaration emit via tsc -p <config>; error count parsed to preserve the Build completed with N errors. message. JS emit still via babel.
    • Watch mode uses Node's built-in recursive fs.watch (node:fs/promises) + tsc --watch — no more chokidar dependency.
    • Engine raised to Node ≥22.
    • Bonus: the CLI no longer imports a version-specific TS API, so it works with whatever tsc the consuming project has installed.
  • @alloy-js/typescript: silenced api-extractor ae-unresolved-link. api-extractor (bundles TS 5.9.3) can't resolve @link references to namespace members that TS 7 emits as re-exports (export { FunctionParameters as Parameters }). Scoped to the only affected package.

Validation

  • pnpm build (full workspace) ✔
  • pnpm test — 1717/1717 ✔
  • pnpm lint (oxlint --type-aware) ✔ · pnpm format:check ✔ · chronus verify
  • alloy build --watch smoke-tested: edits, new files (incl. new subdirectories), and deletions all handled.

- Bump the typescript catalog to ^7.0.2 (native Go compiler).
- Rewrite @alloy-js/cli 'alloy build' to shell out to the native tsc binary for
  type-checking and declaration emit, replacing the removed programmatic API.
- Watch mode now uses Node's built-in recursive fs.watch instead of chokidar.
- Silence api-extractor ae-unresolved-link in @alloy-js/typescript: it cannot
  resolve @link to namespace members TS7 emits as re-exports.
- Raise @alloy-js/cli engines to Node >=22.
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @alloy-js/cli
  • @alloy-js/typescript
Show changes

@alloy-js/cli - feature ✏️

alloy build now uses the native TypeScript compiler binary, adding support for TypeScript 7. Type-checking and declaration emit shell out to the project's tsc instead of the (now removed) programmatic compiler API, and watch mode uses Node's built-in recursive file watcher. Requires Node.js >=22.

@alloy-js/typescript - internal ✏️

Silence API Extractor ae-unresolved-link warnings for @link references to namespace members that TypeScript 7 emits as re-exports.

@timotheeguerin
timotheeguerin marked this pull request as ready for review July 15, 2026 20:04
@timotheeguerin
timotheeguerin merged commit ba33347 into alloy-framework:main Jul 15, 2026
5 checks passed
@timotheeguerin
timotheeguerin deleted the timotheeguerin/typescript-7 branch July 15, 2026 20:05
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.

1 participant