Skip to content

chore: add TypeScript 7 side-by-side via @typescript/native alias and detect it in the LSP resolver - #153

Merged
amondnet merged 2 commits into
mainfrom
chore/typescript-7
Nov 22, 2026
Merged

amondnet merged 2 commits into
mainfrom
chore/typescript-7

Conversation

@amondnet

@amondnet amondnet commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add TypeScript 7 next to TypeScript 6 and teach the LSP resolver to use it. typescript@7.0.2 ships only lib/version.cjs (no classic JS API, no tsserver.js), and typescript-eslint 8.73 peers on typescript >=4.8.4 <6.1.0. Swapping typescript to 7 would therefore break eslint . and the lint-staged pre-commit hook. So typescript moves to ^6.0.3 and TS 7 is installed under the @typescript/native alias, the name the typescript-estree canary already declares as a peer.

What changed

  • typescript ^5.7.0 → ^6.0.3 in the root, packages/{logger,dora,code,lsp,binaries,format} and hooks/scripts; new root devDependency "@typescript/native": "npm:typescript@^7.0.2".
  • resolveNativeTypeScriptServer (packages/lsp/src/server/typescript.ts) detects a TS 7+ tsc under @typescript/native. It ranks after a native typescript and before @typescript/native-preview tsgo, and skips an alias that is a classic build.
  • Two unit tests in packages/lsp/test/unit/typescript-native.test.ts; docs in apps/docs/content/docs/3.configuration/1.overview.md and packages/lsp/CLAUDE.md.

Scope

apps/docs is bumped to typescript ^6.0.3 as well. Out of scope: plugins/*, examples/* and test fixtures are not workspaces and were not touched.

Blast radius

With bun's hoisted linker, node_modules/.bin/tsc now links to TS 7, so any script that calls tsc gets 7. tsserver and the JS API stay on 6.0.3. Repo typecheck uses bun check, which is independent of both.

Verification

  • bun run typecheck (7/7 tasks), bun run lint and bun run test (7/7 tasks; lsp 209 pass, code 100 pass) all pass.
  • tsc --noEmit -p packages/lsp/tsconfig.json is clean under TS 7.0.2 and TS 6.0.3.
  • End to end, code lsp on a file with a deliberate type error logged Using native tsc (@typescript/native) language server (--lsp --stdio) and reported [2322] Type 'string' is not assignable to type 'number'.

Related issue

None.

Checklist

  • PR title follows Conventional Commits
  • Tests added or updated, and the suite passes (bun run test)
  • Lint/format pass (bun run lint)
  • Documentation updated if behavior changed
  • No breaking change, or a BREAKING CHANGE: note is included

Summary by cubic

Installs TypeScript 7 side-by-side with TypeScript 6 under the @typescript/native alias, since TS 7 ships no classic JS API and typescript-eslint 8.x requires typescript below 6.1.0. The LSP resolver now detects the aliased TS 7 tsc and uses it for native language server mode.

  • Bumps typescript from ^5.7.0 to ^6.0.3 across the root package, packages/{logger,dora,code,lsp,binaries,format}, hooks/scripts, and apps/docs; adds @typescript/native as a root devDependency.
  • resolveNativeTypeScriptServer picks a TS 7+ tsc under @typescript/native, ranking after a native typescript and before the @typescript/native-preview tsgo, and skips aliases that point at classic builds.
  • With bun's hoisted linker, node_modules/.bin/tsc now links to TS 7 for any repo script; tsserver, the JS API, and bun check unaffected.
  • plugins/*, examples/*, and test fixtures were not touched; apps/docs keeps a classic build it still needs, now aligned to ^6.0.3.

Written for commit 7734bbc. Summary will update on new commits.

Turn on auto-fix

… detect it in the LSP resolver

Bump typescript ^5.7.0 to ^6.0.3 in the root package, packages/{logger,dora,code,lsp,
binaries,format} and hooks/scripts. typescript-eslint 8.x requires typescript below
6.1.0, and TypeScript 7 ships no classic JS API, so the classic line stays for tooling.

Add the root devDependency "@typescript/native": "npm:typescript@^7.0.2" and update
bun.lock.

In packages/lsp/src/server/typescript.ts, resolveNativeTypeScriptServer now detects a
TypeScript 7+ tsc under @typescript/native. It checks after a native typescript and
before the @typescript/native-preview tsgo.

Add two unit tests in packages/lsp/test/unit/typescript-native.test.ts, and document
the behavior in the apps/docs configuration overview and packages/lsp/CLAUDE.md.
@socket-security

socket-security Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​types/​bun@​1.4.51001004894100
Addedtypescript@​7.0.29910089100100
Addedtypescript@​6.0.31001009010090

View full report

@codecov

codecov Bot commented Nov 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/lsp/src/server/typescript.ts 66.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request upgrades the workspace-wide TypeScript version from ^5.7.0 to ^6.0.3 and introduces support for Native TypeScript 7+ via the @typescript/native alias. It updates the LSP server resolution logic in packages/lsp/src/server/typescript.ts to detect and use this aliased binary, adds corresponding unit tests, and updates the documentation in overview.md and CLAUDE.md. There are no review comments to evaluate, and we have no further feedback to provide.

Aligns the docs site with the classic TypeScript line used by the rest of the
workspace. The docs build fails the same way before and after this change
(@vue/compiler-sfc cannot resolve NuxtLinkProps in docs-please UButton.vue).
@sonarqubecloud

Copy link
Copy Markdown

@amondnet
amondnet marked this pull request as ready for review November 22, 2026 03:07
@amondnet
amondnet merged commit c961853 into main Nov 22, 2026
11 checks passed
@amondnet
amondnet deleted the chore/typescript-7 branch November 22, 2026 03:07
@greptile-apps

greptile-apps Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change reaches workspace TypeScript tooling and projects using the TypeScript language server.

Fix alias selection before merging so it works when classic TypeScript owns the shared tsc command.

Fix All in Claude CodeFindings

  1. P1 Installed native compiler is skipped ▶
Fix with agent prompt
### Issue 1
packages/lsp/src/server/typescript.ts:172-173
If the shared `node_modules/.bin/tsc` points to classic `typescript`, this lookup skips the installed `@typescript/native` alias. Both packages declare `tsc`, but `findPackageBin` accepts the alias only when the shared command points to its own executable. Users can therefore install both packages correctly and still get the classic language server.

Resolve the alias's declared executable without depending on which package owns the shared command. Add a test where classic `typescript` owns it.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds TypeScript 7 beside classic TypeScript 6 and lets the language server look for the @typescript/native alias.

  • The TypeScript language server can use a native compiler installed under an alias.
  • The workspace keeps TypeScript 6 and 7 available side by side.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Choose TypeScript server] --> B{Project tsrs available?}
  B -->|Yes| N[Native server]
  B -->|No| C{Native typescript available?}
  C -->|Yes| N
  C -->|No| D{Native alias owns shared tsc?}
  D -->|Yes| N
  D -->|No| E{Native preview available?}
  E -->|Yes| N
  E -->|No| F{Global tsrs available?}
  F -->|Yes| N
  F -->|No| G[Classic server]
Loading

Reviews (1) · Last reviewed commit: "chore(docs): bump apps/docs typescript t..." · Reviewed by Greptile

Comment on lines +172 to +173
const nativeAlias = findPackageBin(root, '@typescript/native', 'tsc', isNativeTypeScriptPackage)
if (nativeAlias) { return { command: nativeAlias, label: 'native tsc (@typescript/native)' } }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Installed native compiler is skipped

If the shared node_modules/.bin/tsc points to classic typescript, this lookup skips the installed @typescript/native alias. Both packages declare tsc, but findPackageBin accepts the alias only when the shared command points to its own executable. Users can therefore install both packages correctly and still get the classic language server.

Resolve the alias's declared executable without depending on which package owns the shared command. Add a test where classic typescript owns it.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/lsp/src/server/typescript.ts
Line: 172-173

Comment:
**Installed native compiler is skipped**

If the shared `node_modules/.bin/tsc` points to classic `typescript`, this lookup skips the installed `@typescript/native` alias. Both packages declare `tsc`, but `findPackageBin` accepts the alias only when the shared command points to its own executable. Users can therefore install both packages correctly and still get the classic language server.

Resolve the alias's declared executable without depending on which package owns the shared command. Add a test where classic `typescript` owns it.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code

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