Skip to content

fix(build): make tsgo-dts packages depend on //#build#2546

Merged
HuJean merged 3 commits intomainfrom
fix-turbo-tsc-deps
Apr 30, 2026
Merged

fix(build): make tsgo-dts packages depend on //#build#2546
HuJean merged 3 commits intomainfrom
fix-turbo-tsc-deps

Conversation

@upupming
Copy link
Copy Markdown
Collaborator

@upupming upupming commented Apr 29, 2026

Summary

#2538 dropped //#build from build.dependsOn to reduce cache fanout. //#build runs the root tsc --build, which produces the composite-project lib/ outputs that several workspace packages declare as their public types:

  • @lynx-js/rspeedy"types": "./lib/index.d.ts"
  • @lynx-js/template-webpack-plugin, @lynx-js/web-rsbuild-server-middleware, etc.

//#build still runs as part of pnpm turbo build (no filter), but now in parallel with package builds. Two packages whose tsgo dts generation imports types from those lib/ outputs race against //#build:

  • @lynx-js/config-rsbuild-plugin (imports @lynx-js/rspeedy, @lynx-js/template-webpack-plugin in LynxConfigWebpackPlugin.ts / pluginLynxConfig.ts)
  • @lynx-js/reactlynx-testing-library (imports @lynx-js/rspeedy in rstest-config.ts)

When the race is lost, those builds fail with TS2307: Cannot find module …. This was hit on PR #2543 (build / Build (Ubuntu) — same failure on Windows).

Fix

Add //#build to the dependsOn of just the two affected packages (not to the global build.dependsOn) so they wait for tsc --build without re-introducing the cache fanout #2538 was avoiding.

Test plan

  • ```bash
    find packages -name "*.tsbuildinfo" -delete
    find packages -type d -name lib -exec rm -rf {} +
    pnpm turbo build --force
    succeeds end-to-end (49/49 tasks). On `main` (without this fix) the same command fails on `@lynx-js/config-rsbuild-plugin#build` and `@lynx-js/reactlynx-testing-library#build`.
    
    

Summary by CodeRabbit

  • Bug Fixes

    • Resolved TypeScript type resolution failures in clean CI/build environments.
  • Chores

    • Ensured root composite build runs before package builds to enforce correct build ordering and artifact availability.
    • Added build configuration for a new extractor package and updated package build dependencies.
  • Documentation

    • Clarified maintenance guidance for produced/generated build artifacts and cache outputs.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 29, 2026

⚠️ No Changeset found

Latest commit: 80436e9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 287f8740-404d-4fdc-a90b-ec4a4f10b290

📥 Commits

Reviewing files that changed from the base of the PR and between 9358815 and dc1e01e.

📒 Files selected for processing (2)
  • .github/a2ui-catalog.instructions.md
  • packages/genui/a2ui-catalog-extractor/turbo.json
✅ Files skipped from review due to trivial changes (2)
  • .github/a2ui-catalog.instructions.md
  • packages/genui/a2ui-catalog-extractor/turbo.json

📝 Walkthrough

Walkthrough

Adds the root composite TypeScript build (//#build) as an explicit upstream dependency to package build tasks, adds a Changeset entry, introduces a Turbo config for a2ui-catalog-extractor, and documents Turbo outputs for generated artifacts. (47 words)

Changes

Cohort / File(s) Summary
Changeset metadata
\.changeset/fix-turbo-tsc-deps.md
Adds a Changeset describing the fix that ensures the root composite TypeScript build runs before package builds.
Turbo task dependency updates
packages/react/testing-library/turbo.json, packages/rspeedy/plugin-config/turbo.json
Adds //#build to the build.dependsOn lists to force the root composite tsc --build to run upstream.
New package Turbo config
packages/genui/a2ui-catalog-extractor/turbo.json
Adds a build task with ^build dependency, inputs, and dist/** outputs for the new extractor package.
Docs / maintenance guidance
.github/a2ui-catalog.instructions.md
Documents requirement to declare generated artifact directories (e.g., dist/**) as Turbo build.outputs when other packages consume those artifacts.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • HuJean
  • Yradex
  • hzy
  • colinaaa
  • luhc228

Poem

🐰 I hop through configs, tidy and spry,
//#build leads the dance before packages fly.
Dist and lib now wait in their place,
CI smiles back with a tidy embrace.
✨🥕

🚥 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 accurately reflects the main change: adding //#build as a dependency for tsgo-based packages to fix a build race condition, which is the core objective of this PR.
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.

✏️ 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 fix-turbo-tsc-deps

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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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

PR #2538 dropped `//#build` from `build.dependsOn`. `//#build` runs
`tsc --build`, which produces composite-project `lib/` outputs that
several workspace packages declare as their public types
(`@lynx-js/rspeedy` → `./lib/index.d.ts`, etc.).

`//#build` still runs as part of `pnpm turbo build` (no filter), but
now in parallel with package builds. Two packages whose `tsgo` dts
generation imports types from `lib/` race against `//#build`:

- `@lynx-js/config-rsbuild-plugin` → imports `@lynx-js/rspeedy`,
  `@lynx-js/template-webpack-plugin`
- `@lynx-js/reactlynx-testing-library` → imports `@lynx-js/rspeedy`

When the race is lost, builds fail with `TS2307: Cannot find module …`.
Add `//#build` to those two packages' own `dependsOn` (rather than the
global `build.dependsOn`) so they wait for `tsc --build` without
re-introducing the cache fanout #2538 was avoiding.

Verified: `find packages -name "*.tsbuildinfo" -delete && find packages
-type d -name lib -exec rm -rf {} + && pnpm turbo build --force`
succeeds end-to-end (49/49 tasks).
@upupming upupming force-pushed the fix-turbo-tsc-deps branch from e712dcc to 9358815 Compare April 29, 2026 12:30
@upupming upupming changed the title fix(build): re-add //#build as dependency of build task fix(build): make tsgo-dts packages depend on //#build Apr 29, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 29, 2026

Merging this PR will not alter performance

✅ 81 untouched benchmarks
⏩ 26 skipped benchmarks1


Comparing fix-turbo-tsc-deps (80436e9) with main (caadd3b)2

Open in CodSpeed

Footnotes

  1. 26 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (eb46fea) during the generation of this report, so caadd3b was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Apr 29, 2026

React External

#838 Bundle Size — 680.41KiB (0%).

80436e9(current) vs 29ba9ba main#830(baseline)

Bundle metrics  no changes
                 Current
#838
     Baseline
#830
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 17 17
No change  Duplicate Modules 5 5
No change  Duplicate Code 8.59% 8.59%
No change  Packages 0 0
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#838
     Baseline
#830
No change  Other 680.41KiB 680.41KiB

Bundle analysis reportBranch fix-turbo-tsc-depsProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Apr 29, 2026

Web Explorer

#9296 Bundle Size — 900.03KiB (~+0.01%).

80436e9(current) vs 29ba9ba main#9288(baseline)

Bundle metrics  Change 1 change
                 Current
#9296
     Baseline
#9288
No change  Initial JS 44.46KiB 44.46KiB
No change  Initial CSS 2.22KiB 2.22KiB
Change  Cache Invalidation 16.16% 0%
No change  Chunks 9 9
No change  Assets 11 11
No change  Modules 229 229
No change  Duplicate Modules 11 11
No change  Duplicate Code 27.28% 27.28%
No change  Packages 10 10
No change  Duplicate Packages 0 0
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#9296
     Baseline
#9288
Regression  JS 495.9KiB (~+0.01%) 495.88KiB
No change  Other 401.92KiB 401.92KiB
No change  CSS 2.22KiB 2.22KiB

Bundle analysis reportBranch fix-turbo-tsc-depsProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Apr 29, 2026

React MTF Example

#855 Bundle Size — 196.58KiB (0%).

80436e9(current) vs 29ba9ba main#847(baseline)

Bundle metrics  no changes
                 Current
#855
     Baseline
#847
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 174 174
No change  Duplicate Modules 66 66
No change  Duplicate Code 44.04% 44.04%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#855
     Baseline
#847
No change  IMG 111.23KiB 111.23KiB
No change  Other 85.35KiB 85.35KiB

Bundle analysis reportBranch fix-turbo-tsc-depsProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Apr 29, 2026

React Example

#7723 Bundle Size — 225.43KiB (0%).

80436e9(current) vs 29ba9ba main#7715(baseline)

Bundle metrics  no changes
                 Current
#7723
     Baseline
#7715
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 180 180
No change  Duplicate Modules 69 69
No change  Duplicate Code 44.54% 44.54%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#7723
     Baseline
#7715
No change  IMG 145.76KiB 145.76KiB
No change  Other 79.67KiB 79.67KiB

Bundle analysis reportBranch fix-turbo-tsc-depsProject dashboard


Generated by RelativeCIDocumentationReport issue

@HuJean HuJean enabled auto-merge (squash) April 30, 2026 02:25
@HuJean HuJean merged commit 3841ffe into main Apr 30, 2026
77 of 80 checks passed
@HuJean HuJean deleted the fix-turbo-tsc-deps branch April 30, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants