chore: Upgrade TypeScript to 7.0.2 (#13713)
## Summary
Moves the repository from the TypeScript 7 release candidate to the
stable `7.0.2` release, and brings the remaining stragglers onto it.
- Bump `typescript-7` from `npm:typescript@7.0.1-rc` to
`npm:typescript@7.0.2` in the root and every workspace package that
declares it. `tsc` (used by the shared `check-types` command) is now the
stable compiler.
- Bump the `@typescript/typescript6` compatibility shim from `^6.0.1` to
`^6.0.2`. This is the package the bare `typescript` specifier still
aliases to, so tooling that consumes the TypeScript JS API (`ts-jest`,
`ts-json-schema-generator`, `tsdown`, `bunchee`) keeps working.
- The two Next.js apps, `apps/docs` and `apps/agents`, stay on the
stable `typescript` package rather than the shim — Next.js type
generation rejects the shim
([#13659](https://github.com/vercel/turborepo/pull/13659)) — and move
from `^6.0.1` to `^6.0.3`.
- `apps/agents` drops `@typescript/native-preview@7.0.0-dev.20260523.1`
for `typescript-7`. The preview package existed to get `tsgo` before the
native compiler shipped; the `tsgo --noEmit` script goes with it, so the
app type checks through the repository-wide `pnpm exec tsc --noEmit`
like every other workspace.
- `@repo/docs-link-checker` was the last workspace package on TypeScript
5.5.4. It now uses `typescript-7`, which required switching
`moduleResolution` from the removed `node10` mode to `nodenext` and
adding the `node` types and `skipLibCheck` that its dependency type
declarations need.
### One thing to know about `apps/agents`
In `apps/docs` and `apps/agents`, `pnpm exec tsc` is **6.0.3**, not
7.0.2. Both apps depend on the real `typescript` package for Next.js,
and because their `typescript-7` matches the root's, pnpm dedupes it and
links only `typescript` into the app — whose `tsc` bin then shadows the
root's 7.0.2. For `apps/docs` that is already the behaviour on `main`;
for `apps/agents` it is a change from `tsgo` (7.0.0-dev), which this PR
removes.
I left it that way so both Next.js apps behave the same and neither
needs a bespoke task command. `apps/agents` type checks clean under both
compilers (I ran each). If you'd rather pin it to 7.x, a scoped override
in the root `turbo.json` does it:
```jsonc
"examples-agent#check-types": {
"command": ["pnpm", "-w", "exec", "tsc", "--noEmit", "-p", "apps/agents"]
}
```
### Out of scope
- `examples/**` and `lockfile-tests/fixtures/**` are untouched. Examples
are maintained by their own update flow with per-package-manager
lockfiles, and the fixture lockfiles are semantic test data.
- The `@repo/docs-link-checker#check-types` opt-out in the root
`turbo.json` is left in place, though the package now type checks
cleanly under `7.0.2`. Removing the opt-out is a reasonable follow-up.
## Testing
Re-run after rebasing onto `main` (which added the Eve operator
dashboard to `apps/agents`):
- `corepack pnpm@10.28.0 install --ignore-scripts` (lockfile reported up
to date against the resolved `package.json` files)
- `turbo run check-types --filter='./packages/*' --filter='./apps/*'
--filter='./docs/*' --filter='!turbo-vsc'` (20 tasks passed, including
`docs` and `examples-agent`)
- `turbo run check-types --only --filter=turbo-vsc` (passed; excluded
from the run above only because its `^build` needs the Rust LSP
toolchain, which this environment lacks)
- `apps/agents` type checked explicitly with both compilers: `tsc@7.0.2
--noEmit -p apps/agents` and the app-local `tsc@6.0.3 --noEmit`
- `cd docs/link-checker && tsc --noEmit` (7.0.2)
- `pnpm exec oxfmt --check`
- `turbo run test --filter='./packages/*' --filter='!turbo-vsc'` — all
pass except `eslint-plugin-turbo#test`, which shells out to `npm install
eslint` inside its fixtures and fails on `SELF_SIGNED_CERT_IN_CHAIN`
behind this sandbox's TLS-inspecting proxy. Unrelated to the change.
Not run here: `docs#build` and the Rust workspace builds, which need Zig
and a full Cargo toolchain this environment does not have. `pnpm exec
oxlint --deny-warnings .` reports 4 pre-existing errors in
`apps/agents/agent/**` that are identical on `main` and untouched by
this PR.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>