Skip to content

build: type-check via tsgo project references, decoupled from bundler#795

Open
lukecotter wants to merge 1 commit into
certinia:mainfrom
lukecotter:chore-typecheck-tsgo-project-refs
Open

build: type-check via tsgo project references, decoupled from bundler#795
lukecotter wants to merge 1 commit into
certinia:mainfrom
lukecotter:chore-typecheck-tsgo-project-refs

Conversation

@lukecotter
Copy link
Copy Markdown
Collaborator

@lukecotter lukecotter commented Jun 1, 2026

📝 PR Overview

The bundlers we use are type-blind — rollup (via swc) and rolldown only transpile, they never type-check. Today three identical tsc --noemit calls are copy-pasted into build:dev, build:dev:fast, and lint, welding type-checking into the bundler step, and composite: true was set on two projects with no references (dead config). This makes type-checking a single, separate step over TypeScript project references, run by the Go-native tsgo for speed.

🛠️ Changes made

  • Replace the three inline tsc --noemit -p … calls with one project-references build: bundlers (build:dev/build:dev:fast) are now transpile-only; type-checking is the typecheck script.
  • Wire real project references: apex-log-parser becomes composite (emitDeclarationOnly), log-viewer/lana reference it, and a new root solution tsconfig.json orchestrates the graph — enabling incremental .tsbuildinfo caching (skip unchanged projects).
  • Add typecheck (tsgo -b) and typecheck:tsc (tsc -b, fallback/parity). @typescript/native-preview (tsgo) is ~7.7× faster on cold runs (~0.3s vs ~2.3s); warm/incremental runs are sub-150ms for both.
  • Gate the production build on typecheck, and run it inside lint — preserving the existing CI PR gate (ci.yml's Verify Files job runs pnpm run lint). Dev watch stays check-free (IDE/LSP handles it).
  • .gitignore: add *.tsbuildinfo.

🧩 Type of change (check all applicable)

  • 🐛 Bug fix - something not working as expected
  • ✨ New feature – adds new functionality
  • ♻️ Refactor - internal changes with no user impact
  • ⚡ Performance Improvement
  • 📝 Documentation - README or documentation site changes
  • 🔧 Chore - dev tooling, CI, config
  • 💥 Breaking change

🔗 Related Issues

✅ Tests added?

  • 👍 yes
  • 🙅 no, not needed
  • 🙋 no, I need help

📚 Docs updated?

  • 🙅 not needed

Test plan

  • pnpm lint (eslint + prettier + tsgo -b) — green
  • pnpm test — 886/886 pass
  • pnpm run typecheck cold/incremental verified; typecheck:tsc parity (same diagnostics)
  • Decoupling: injected type error fails typecheck/build/lint but build:dev still bundles; prod build + build:dev:fast green

Anything else we need to know? [optional]

tsgo is a TypeScript 7 preview; it agreed with stock tsc -b here, and typecheck:tsc is a one-word fallback if the preview ever drifts. Consumers resolve apex-log-parser via source paths (shared with the swc bundler config), so the reference provides build ordering + incremental caching rather than cross-project dedup — a deliberate trade to avoid bundler-config changes.

- replace the three inline `tsc --noemit` calls (build:dev, build:dev:fast, lint) with one `tsgo -b` over project references; swc/rolldown stay transpile-only
- wire references: apex-log-parser becomes composite (emitDeclarationOnly), log-viewer/lana reference it, new root solution tsconfig — enables incremental caching
- gate prod `build` on `typecheck` and run it in `lint` (preserves CI PR gate); add @typescript/native-preview (tsgo), ~7.7x faster cold than tsc
@lukecotter lukecotter changed the title build: type-check via tsgo project references, decoupled from bundler build: tsgo type-check + copy package docs at vsix time Jun 1, 2026
@lukecotter lukecotter force-pushed the chore-typecheck-tsgo-project-refs branch from b5597ad to 3cc693c Compare June 1, 2026 11:12
@lukecotter lukecotter changed the title build: tsgo type-check + copy package docs at vsix time build: type-check via tsgo project references, decoupled from bundler Jun 1, 2026
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