Skip to content

feat(typescript): support TypeScript 7#110

Merged
chenjiahan merged 5 commits into
mainfrom
david/feat-typescript-7-tsgo
Jun 25, 2026
Merged

feat(typescript): support TypeScript 7#110
chenjiahan merged 5 commits into
mainfrom
david/feat-typescript-7-tsgo

Conversation

@Timeless0911

@Timeless0911 Timeless0911 commented Jun 24, 2026

Copy link
Copy Markdown
Member

Summary

This PR adds TypeScript 7+ support for the tsgo checker path now that the TypeScript 7 RC ships the Go-based compiler through the typescript package. It auto-enables typescript.tsgo when a configured or default installed typescript package has major version 7 or higher, keeps @typescript/native-preview as the explicit fallback when no custom typescriptPath is provided, and updates docs/tests for the new package resolution behavior.

Related Links

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Timeless0911, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 55 minutes and 38 seconds. Learn how PR review limits work.

To continue reviewing without waiting, enable usage-based billing in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 65e25079-af38-4bad-aac0-17bcadb67648

📥 Commits

Reviewing files that changed from the base of the PR and between c1ee83f and e339397.

📒 Files selected for processing (1)
  • README.md
📝 Walkthrough

Walkthrough

The PR extends tsgo support from only @typescript/native-preview to also include typescript 7+ as a recognized backend. It adds package classification helpers, updates worker config selection to infer tsgo and tsgoPackage, changes executable resolution to use a structured command/args descriptor, updates support validation and error messages, expands tests with on-disk fixtures, and revises the README options table and limitation note.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: TypeScript 7 support for tsgo.
Description check ✅ Passed The description clearly matches the changeset and explains the TypeScript 7 tsgo support and fallback behavior.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch david/feat-typescript-7-tsgo

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
test/unit/typescript/type-script-go-runner.spec.ts (1)

31-55: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

createTypeScriptPackage is duplicated across three spec files.

This helper (and the tempDirs/afterEach cleanup) is copy-pasted in type-script-go-runner.spec.ts, type-script-support.spec.ts, and type-script-worker-config.spec.ts with only the temp-dir prefix differing. Consider extracting to a shared test utility to keep the fixtures consistent as the package shape evolves.

🤖 Prompt for 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.

In `@test/unit/typescript/type-script-go-runner.spec.ts` around lines 31 - 55,
`createTypeScriptPackage`, along with the shared `tempDirs` cleanup and
`afterEach` teardown, is duplicated across multiple TypeScript spec files.
Extract this fixture setup into a common test utility and reuse it from
`type-script-go-runner.spec.ts`, `type-script-support.spec.ts`, and
`type-script-worker-config.spec.ts`, keeping only any truly file-specific
differences such as the temp-dir prefix in one place.
🤖 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 `@README.md`:
- Line 114: Fix the malformed default expression for the `mode` option in the
README table: the `mode` row currently shows an invalid nested ternary (`build
=== true ? 'write-tsbuildinfo' ? 'readonly'`). Update that documentation entry
so the default logic is expressed with the correct ternary syntax, using `build`
to choose `write-tsbuildinfo` when true and `readonly` otherwise, matching the
behavior described by the `mode` option.

---

Nitpick comments:
In `@test/unit/typescript/type-script-go-runner.spec.ts`:
- Around line 31-55: `createTypeScriptPackage`, along with the shared `tempDirs`
cleanup and `afterEach` teardown, is duplicated across multiple TypeScript spec
files. Extract this fixture setup into a common test utility and reuse it from
`type-script-go-runner.spec.ts`, `type-script-support.spec.ts`, and
`type-script-worker-config.spec.ts`, keeping only any truly file-specific
differences such as the temp-dir prefix in one place.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 72efb387-3c5e-4cd9-b525-e522574939b0

📥 Commits

Reviewing files that changed from the base of the PR and between 5b8d6ec and 2731d4c.

📒 Files selected for processing (9)
  • README.md
  • src/typescript/type-script-go-constants.ts
  • src/typescript/type-script-go-package.ts
  • src/typescript/type-script-go-runner.ts
  • src/typescript/type-script-support.ts
  • src/typescript/type-script-worker-config.ts
  • test/unit/typescript/type-script-go-runner.spec.ts
  • test/unit/typescript/type-script-support.spec.ts
  • test/unit/typescript/type-script-worker-config.spec.ts

Comment thread README.md

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2731d4c9c4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/typescript/type-script-go-runner.ts Outdated
@Timeless0911 Timeless0911 changed the title feat(typescript): support TypeScript 7 tsgo feat(typescript): support TypeScript 7 Jun 24, 2026
Comment thread test/unit/typescript/type-script-go-runner.spec.ts Fixed
Comment thread test/unit/typescript/type-script-support.spec.ts Fixed

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
test/unit/typescript/type-script-go-runner.spec.ts (1)

31-59: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Consider extracting the duplicated createTypeScriptPackage fixture into a shared test helper.

This helper is nearly identical to the one in test/unit/typescript/type-script-support.spec.ts (only the temp-dir prefix and return shape differ). Extracting it to a shared test utility would avoid the two copies drifting apart as the package layout evolves.

Note: the ast-grep/CodeQL path-traversal and sanitization warnings on Lines 50-52 are false positives here — the paths derive from mkdtempSync and controlled path.join values, not external input.

🤖 Prompt for 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.

In `@test/unit/typescript/type-script-go-runner.spec.ts` around lines 31 - 59, The
`createTypeScriptPackage` fixture in `type-script-go-runner.spec.ts` is
duplicated in another TypeScript test and should be extracted into a shared
helper to prevent drift. Move the common setup into a reusable test utility,
then update `createTypeScriptPackage` in this spec and the matching helper in
`type-script-support.spec.ts` to call the shared implementation while preserving
each test’s temp-dir prefix and return shape. Keep the existing `package.json`,
`getExePath.js`, and `nativeTscPath` setup behavior unchanged.
🤖 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.

Nitpick comments:
In `@test/unit/typescript/type-script-go-runner.spec.ts`:
- Around line 31-59: The `createTypeScriptPackage` fixture in
`type-script-go-runner.spec.ts` is duplicated in another TypeScript test and
should be extracted into a shared helper to prevent drift. Move the common setup
into a reusable test utility, then update `createTypeScriptPackage` in this spec
and the matching helper in `type-script-support.spec.ts` to call the shared
implementation while preserving each test’s temp-dir prefix and return shape.
Keep the existing `package.json`, `getExePath.js`, and `nativeTscPath` setup
behavior unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 180f77cf-56d2-42d8-8db7-00c73f8991b6

📥 Commits

Reviewing files that changed from the base of the PR and between 2731d4c and fb73933.

📒 Files selected for processing (5)
  • README.md
  • src/typescript/type-script-go-runner.ts
  • src/typescript/type-script-support.ts
  • test/unit/typescript/type-script-go-runner.spec.ts
  • test/unit/typescript/type-script-support.spec.ts
✅ Files skipped from review due to trivial changes (1)
  • README.md

@Timeless0911

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 79a0dd379b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/typescript/type-script-worker-config.ts
Comment thread README.md
@chenjiahan chenjiahan merged commit e666b77 into main Jun 25, 2026
6 checks passed
@chenjiahan chenjiahan deleted the david/feat-typescript-7-tsgo branch June 25, 2026 03:57
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.

3 participants