Skip to content

fix: support ts7 project reference builds - #128

Draft
Timeless0911 wants to merge 1 commit into
mainfrom
david/fix-tsgo-project-references
Draft

fix: support ts7 project reference builds#128
Timeless0911 wants to merge 1 commit into
mainfrom
david/fix-tsgo-project-references

Conversation

@Timeless0911

Copy link
Copy Markdown
Member

TypeScript 7's native checker always received --noEmit, so build mode could not rebuild unbuilt project references and write-references was ineffective.

This change lets write-references explicitly enable native build output while keeping read-only modes unchanged, and adds actionable TS6310 guidance. Unit and Rspack/Webpack end-to-end coverage verify clean project-reference builds.

Closes #127.

@Timeless0911
Timeless0911 marked this pull request as ready for review July 21, 2026 05:15
@Timeless0911 Timeless0911 changed the title fix: support tsgo project reference builds fix: support ts7 project reference builds Jul 21, 2026
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4d6f178e-b261-4711-98b3-845653d06a45

📥 Commits

Reviewing files that changed from the base of the PR and between d909ae0 and 5e24e67.

📒 Files selected for processing (8)
  • README.md
  • src/typescript/type-script-go-runner.ts
  • test/e2e/with-rsbuild/__fixtures__/tsgo-references/app/index.ts
  • test/e2e/with-rsbuild/__fixtures__/tsgo-references/src/index.ts
  • test/e2e/with-rsbuild/__fixtures__/tsgo-references/tsconfig.json
  • test/e2e/with-rsbuild/index.test.ts
  • test/e2e/with-rsbuild/tsconfig.tsgo.references.json
  • test/unit/typescript/type-script-go-runner.spec.ts

📝 Walkthrough

Walkthrough

TypeScript-Go argument generation now passes --noEmit false for build-mode write-references runs. TS6310 diagnostics receive guidance to use write-references when rebuilding referenced projects in readonly or write-tsbuildinfo modes. Unit tests cover argument and diagnostic behavior. New reference-project fixtures and an end-to-end test verify generated JavaScript and declaration outputs. README documentation now lists typescript.mode and describes the related limitations.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding support for tsgo project-reference builds.
Description check ✅ Passed The description is directly about the tsgo project-reference build fix and related coverage.
Linked Issues check ✅ Passed The changes add write-references build support and TS6310 guidance, matching the linked issue's objectives.
Out of Scope Changes check ✅ Passed All changes are documentation, runner logic, fixtures, and tests tied to the project-reference build fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch david/fix-tsgo-project-references

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.

@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: 5e24e67e9c

ℹ️ 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 on lines +90 to +91
if (config.build && config.mode === 'write-references') {
args.push('--noEmit', 'false');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exclude tsgo-emitted reference outputs from watch deps

When dev/watch mode runs with typescript.build: true, mode: 'write-references', and clean referenced projects, this starts writing .js/.d.ts files into each TypeScript outDir. The tsgo dependency provider still watches the whole context and only excludes node_modules (plus Rspack's own output.path later), while InclusiveNodeWatchFileSystem treats added .js/.d.ts files as changes, so referenced-package output directories that are not the Rspack output directory will retrigger Rspack compilations from the checker’s own emit. Please exclude the TypeScript build artifact dirs/files when enabling emit here.

Useful? React with 👍 / 👎.

@Timeless0911
Timeless0911 marked this pull request as draft July 21, 2026 12:27
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.

TypeScript 7: build mode fails with unbuilt project references

2 participants