Skip to content

build(web): migrate to TypeScript 7 (retire tsgo bridge) - #681

Merged
aray12 merged 4 commits into
mainfrom
ts-7-official
Jul 14, 2026
Merged

build(web): migrate to TypeScript 7 (retire tsgo bridge)#681
aray12 merged 4 commits into
mainfrom
ts-7-official

Conversation

@aray12

@aray12 aray12 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

What

Migrates the web/ workspace to the official TypeScript 7 (native/Go) compiler and retires the @typescript/native-preview (tsgo) bridge. Now that TS 7's tsc is the native compiler, the old dual typecheck / typecheck:go setup collapses onto one engine and local pre-push runs the identical compiler as CI.

  • Catalog: typescript ^6.0.0~7.0.0 (pin the minor — a compiler minor can shift diagnostics); drop @typescript/native-preview
  • studio / common / testing / scripts: remove the native-preview dep and the typecheck:go scripts
  • .pre-commit-config.yaml: point the studio-typecheck pre-push hook at typecheck (now native), matching CI
  • Second commit: stop reading retired SpanEvaluationContext keys in intakeTelemetry.ts (unblocks the studio typecheck gate — see below)

Why the typescript override in web/package.json

This is the non-obvious part. web/package.json gains:

"typescript": "npm:@typescript/[email protected]",

It does not downgrade the compiler. It exists solely to keep ESLint working under TS 7:

  • typescript-eslint — and every ESLint plugin that transitively pulls @typescript-eslint/typescript-estree (@eslint-react/*, @tanstack/eslint-plugin-query, @vitest/eslint-plugin, eslint-plugin-testing-library) — declares a typescript >=4.8.4 <6.1.0 peer and reads ts.Extension.Cjs at import time.
  • TS 7.0 does not expose that programmatic compiler API (a stable one is slated for TS 7.1), so linting crashes on load with TypeError: Cannot read properties of undefined (reading 'Cjs').
  • No published typescript-eslint supports TS 7 yetlatest (8.63.0) and even the canary channel all cap at <6.1.0, and the upstream tracking issue (typescript-eslint#12518) is closed as not planned. A version bump cannot fix this.

Per the TS 7.0 release guidance, the fix is to hand the linter the TS-6 compiler API only via a root typescript@typescript/typescript6 alias (a package that re-exports the full TS-6 library API, resolving to [email protected]):

  • Root-level ESLint plugins (direct deps of nemo-studio) resolve their typescript peer to the in-range 6.x API.
  • Each sub-package keeps its own typescript@7, so tsc typecheck and CI run native TS 7, unchanged.
  • Only observable side effect: pnpm -C web exec tsc at the root reports 6.0.3 — nothing uses root-level tsc; all typecheck is per-package on 7.

Scoped pnpm parent>child overrides were tried first and do not work here — they target dependency edges, not peer resolution, and leave [email protected] peer-variants that still crash. The root-provider alias is the mechanism that actually steers peer resolution.

This alias is a temporary bridge — remove it once typescript-eslint ships TS 7.1 support.

Second commit — retired SpanEvaluationContext keys

intakeTelemetry.ts (+ its test) still read evaluation_run_id / evaluation_sha / metadata, which the OpenAPI schema retired and the generated SDK dropped — so studio typecheck failed with TS2339/2551/2353 independently of the compiler swap. Ingest endpoints still accept those keys via extra="ignore"; the UI just stops reading them. Included here so the studio typecheck gate (pre-push + CI) is green.

Verification (from web/)

Gate Result
pnpm lint (CI web-lint) ✅ exit 0
pnpm run -r --if-present lint ✅ exit 0
pnpm install --frozen-lockfile (CI install) ✅ exit 0
pnpm run -r --parallel typecheck ✅ exit 0 (per-pkg tsc = 7.0.2)
pre-push studio-typecheck hook ✅ passed

CI (.github/workflows/ci.yaml) is untouched — it already calls typecheck, now transparently native.

Summary by CodeRabbit

  • Improvements
    • Standardized type checking across affected packages using the primary TypeScript check.
    • Updated pre-push validation to align with CI and check only packages affected by recent changes.
  • Documentation
    • Updated development guidance to describe the revised pre-push type-checking workflow.

aray12 added 2 commits July 14, 2026 11:02
…pescript/typescript6

Bump the web workspace to the official TS 7 (native/Go) compiler and
retire the @typescript/native-preview (tsgo) bridge: now that TS 7's
`tsc` IS the native compiler, the dual typecheck/typecheck:go setup
collapses onto one engine, and local pre-push matches CI.

- pnpm-workspace catalog: typescript ^6.0.0 -> ~7.0.0 (pin minor: a
  compiler minor can shift diagnostics); drop @typescript/native-preview
- studio/common/testing/scripts: remove native-preview dep and the
  typecheck:go scripts
- .pre-commit-config: point the studio-typecheck pre-push hook at
  `typecheck` (now native), identical to CI

Why the `typescript` override in web/package.json:
typescript-eslint -- and every ESLint plugin that transitively pulls
@typescript-eslint/typescript-estree (@eslint-react/*, @TanStack,
@vitest, testing-library) -- declares a `typescript >=4.8.4 <6.1.0`
peer and reads `ts.Extension.Cjs` at import time. TS 7.0 does not
expose that programmatic API (a stable one lands in TS 7.1), so lint
crashes on load with "Cannot read properties of undefined (reading
'Cjs')". No published typescript-eslint (incl. canary) supports TS 7
yet -- upstream tracking issue #12518 is closed as not-planned -- so a
version bump cannot fix this.

Bridge per the TS 7.0 release guidance: give the linter the TS-6
compiler API only, via a root `typescript` -> npm:@typescript/typescript6
alias. Root-level ESLint plugins (direct deps of nemo-studio) resolve
their peer to the in-range 6.x API, while each sub-package keeps its own
typescript@7 for `tsc` -- so typecheck and CI run native TS 7 unchanged.
Scoped pnpm `parent>child` overrides do NOT work here (they target
dependency edges, not peer resolution). Remove this alias once
typescript-eslint ships TS 7.1 support.

Signed-off-by: Alex Ray <[email protected]>
intakeTelemetry.ts and its test still read evaluation_run_id,
evaluation_sha, and metadata from SpanEvaluationContext. The OpenAPI
source of truth retired those keys (ingest endpoints keep accepting
them via extra="ignore", but they are no longer part of the canonical
shape), and the generated SDK dropped them -- so the studio typecheck
failed with TS2339/2551/2353. Read only the current keys
(evaluation_id, test_case_id), unblocking the studio `typecheck` gate
alongside the TypeScript 7 migration.

Signed-off-by: Alex Ray <[email protected]>
@aray12
aray12 requested review from a team as code owners July 14, 2026 18:05
@github-actions github-actions Bot added the build conventional-commit type label Jul 14, 2026
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2263dc5e-6ec7-4d20-8fd5-4b448a19539d

📥 Commits

Reviewing files that changed from the base of the PR and between 7bdb553 and ad687af.

⛔ Files ignored due to path filters (1)
  • web/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • web/package.json

📝 Walkthrough

Walkthrough

The web workspace replaces typecheck:go with the standard typecheck command, removes native preview TypeScript tooling, updates the TypeScript catalog, and aligns pre-push and development guidance with native tsc.

Changes

TypeScript typecheck standardization

Layer / File(s) Summary
Update TypeScript toolchain and package scripts
web/package.json, web/pnpm-workspace.yaml, web/packages/*/package.json
The workspace adds the aliased TypeScript dependency, updates its catalog version, removes native preview tooling, and removes typecheck:go scripts.
Align typecheck execution and guidance
.pre-commit-config.yaml, web/.agents/skills/test-coverage-improvement/SKILL.md, web/DEVELOPMENT.md
Pre-push hooks, coverage instructions, and development documentation now use the standard typecheck command and native tsc.

Suggested reviewers: mckornfield

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: migrating the web workspace to TypeScript 7 and removing the tsgo/native-preview bridge.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ts-7-official

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.pre-commit-config.yaml:
- Line 126: Update the pre-push instructions in DEVELOPMENT.md to replace the
retired typecheck:go command and native-port reference with the current
typecheck command, matching the command used by the pre-commit configuration
entry.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f7272a5b-cd40-4a4e-bdf1-9bf7a806c501

📥 Commits

Reviewing files that changed from the base of the PR and between 8cedbd4 and 08637ee.

⛔ Files ignored due to path filters (1)
  • web/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • .pre-commit-config.yaml
  • web/package.json
  • web/packages/common/package.json
  • web/packages/scripts/package.json
  • web/packages/studio/package.json
  • web/packages/studio/src/components/IntakeDetail/IntakeComponents/spanKeyValues.test.tsx
  • web/packages/studio/src/util/intakeTelemetry.ts
  • web/packages/testing/package.json
  • web/pnpm-workspace.yaml
💤 Files with no reviewable changes (2)
  • web/packages/scripts/package.json
  • web/packages/studio/package.json

Comment thread .pre-commit-config.yaml
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 24401/31577 77.3% 62.0%
Integration Tests 14024/30226 46.4% 19.3%

aray12 added 2 commits July 14, 2026 13:43
Follow-up to the TypeScript 7 migration, which removed the
typecheck:go scripts. Update the docs that still referenced them:

- DEVELOPMENT.md pre-push section: describe the actual hook command
  (pnpm --filter="...[origin/main]" run --parallel --if-present
  typecheck) and drop the obsolete "TypeScript native port" link --
  TS 7's tsc is the native compiler.
- test-coverage-improvement skill: remove the "typecheck:go (if
  present)" hedges now that the script no longer exists.

Signed-off-by: Alex Ray <[email protected]>
Only conflict was web/pnpm-lock.yaml (vitest peer-resolution keys):
main uses plain [email protected], our branch uses the
@typescript/typescript6 eslint bridge alias. Resolved by regenerating
the lockfile from the merged web/package.json, which retains both our
`typescript` alias and main's new brace-expansion override.

Validated: pnpm install --frozen-lockfile, pnpm lint, and recursive
typecheck (tsc 7.0.2) all green.

Signed-off-by: Alex Ray <[email protected]>
@aray12
aray12 added this pull request to the merge queue Jul 14, 2026
Merged via the queue into main with commit 58d5a12 Jul 14, 2026
57 checks passed
@aray12
aray12 deleted the ts-7-official branch July 14, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build conventional-commit type

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants