Skip to content

chore(deps): typecheck the API and the plain packages with tsgo - #1544

Merged
hrustalq merged 1 commit into
devfrom
chore/tsgo-typecheck
Dec 2, 2026
Merged

hrustalq merged 1 commit into
devfrom
chore/tsgo-typecheck

Conversation

@hrustalq

@hrustalq hrustalq commented Dec 2, 2026

Copy link
Copy Markdown
Owner

What

typescript in apps/api and the five buildless packages (api-client, contracts, editor-schema, observability, workflow) now resolves to @typescript/typescript6 — the compatibility package Microsoft publishes for the 7.0 transition — and a second alias, typescript7, installs TypeScript 7.0. The compat package's binary is tsc6, so the plain tsc on PATH is 7.0 and the typecheck script in all six runs on tsgo.

Why

TypeScript 7.0 is the native compiler and nothing else: require('typescript') returns { version, versionMajorMinor }, lib/ has no tsserverlibrary, and the programmatic API is expected back in 7.1. Three gates load that API — typescript-eslint throws on versionMajor >= 7, vue-tsc imports typescript/lib/tsserverlibrary, and the Nest CLI compiles through it — so #1533 cannot be made green by editing code. Side-by-side is Microsoft's documented arrangement for exactly this window: https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/#running-side-by-side-with-typescript-6-0

Measurements (this machine; full runs, *.tsbuildinfo removed)

  • apps/api typecheck: 8.5s → 2.0s
  • api-client / contracts / editor-schema / observability / workflow: 0.4–0.6s each
  • apps/api build (nest build, TS 6 API): unchanged, 11.8s
  • Full API emit, TS 6 vs TS 7: same 3240 files, same layout; the only differences are app.get((ConfigService)) → app.get(ConfigService) and quote style in .d.ts

Honest scope: the whole pnpm typecheck gate also runs vue-tsc over web (17.5s), which cannot load TS 7 — so today's repo-wide gain is roughly a fifth. The rest arrives with vue-tsc.

Untouched

  • web, admin, ui stay on real TypeScript 6 with vue-tsc and typescript-eslint.
  • apps/api build and dev still go through the Nest CLI on the TS 6 API.
  • No runtime dependency and no meaningful emitted artifact changes.

Verification

  • All six typecheck tasks exit 0.
  • apps/api nest build exits 0.
  • pnpm install --frozen-lockfile is consistent with the committed lock.

The alias is named typescript7, not the blog's @typescript/native, so that name stays free for the 7.1 package typescript-eslint's own tsgo backend resolves (@typescript-eslint/typescript-estree/dist/native/checkNativeVersion.js pins it to >=7.1.0-dev).

Refs #1533 — it stays open until vue-tsc and typescript-eslint can load 7.

TypeScript 7.0 ships the compiler only: require('typescript') returns a version
string, and lib/ carries no tsserverlibrary — the file typescript-eslint,
vue-tsc and the Nest CLI all load. That is why the 7.0.2 bump (#1533) turns
every gate red, and why no code change can land it.

Microsoft's side-by-side arrangement separates the compiler from the API:
`typescript` resolves to @typescript/typescript6 (bin tsc6, the TS 6 API), and
the `typescript7` alias brings 7's tsc binary. The six packages whose typecheck
is a bare `tsc --noEmit` then check with tsgo — apps/api 8.5s to 2.0s, each
plain package about 0.5s — with no emit and no behaviour change: a full API
build emits the same 3240 files, differing only in redundant parentheses and
quote style.

apps/api's build still goes through the Nest CLI on the TS 6 API, and
web/admin/ui are untouched: vue-tsc cannot load TypeScript 7 at all, so their
typecheck stays on 6 until it can. The alias is named `typescript7` rather than
the blog's `@typescript/native` so that name stays free for the 7.1 package
typescript-eslint's own tsgo backend resolves.
@hrustalq
hrustalq merged commit 3bf2afb into dev Dec 2, 2026
2 checks passed
@hrustalq
hrustalq deleted the chore/tsgo-typecheck branch December 2, 2026 21:32
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