fix(build): make tsgo-dts packages depend on //#build#2546
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughAdds the root composite TypeScript build ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
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).
e712dcc to
9358815
Compare
//#build as dependency of build task//#build
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will not alter performance
Comparing Footnotes
|
React External#838 Bundle Size — 680.41KiB (0%).80436e9(current) vs 29ba9ba main#830(baseline) Bundle metrics
|
| Current #838 |
Baseline #830 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
3 |
3 |
|
17 |
17 |
|
5 |
5 |
|
8.59% |
8.59% |
|
0 |
0 |
|
0 |
0 |
Bundle analysis report Branch fix-turbo-tsc-deps Project dashboard
Generated by RelativeCI Documentation Report issue
Web Explorer#9296 Bundle Size — 900.03KiB (~+0.01%).80436e9(current) vs 29ba9ba main#9288(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch fix-turbo-tsc-deps Project dashboard Generated by RelativeCI Documentation Report issue |
React MTF Example#855 Bundle Size — 196.58KiB (0%).80436e9(current) vs 29ba9ba main#847(baseline) Bundle metrics
|
| Current #855 |
Baseline #847 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
3 |
3 |
|
174 |
174 |
|
66 |
66 |
|
44.04% |
44.04% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #855 |
Baseline #847 |
|
|---|---|---|
111.23KiB |
111.23KiB |
|
85.35KiB |
85.35KiB |
Bundle analysis report Branch fix-turbo-tsc-deps Project dashboard
Generated by RelativeCI Documentation Report issue
React Example#7723 Bundle Size — 225.43KiB (0%).80436e9(current) vs 29ba9ba main#7715(baseline) Bundle metrics
|
| Current #7723 |
Baseline #7715 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
180 |
180 |
|
69 |
69 |
|
44.54% |
44.54% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #7723 |
Baseline #7715 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
79.67KiB |
79.67KiB |
Bundle analysis report Branch fix-turbo-tsc-deps Project dashboard
Generated by RelativeCI Documentation Report issue
Summary
#2538 dropped
//#buildfrombuild.dependsOnto reduce cache fanout.//#buildruns the roottsc --build, which produces the composite-projectlib/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.//#buildstill runs as part ofpnpm turbo build(no filter), but now in parallel with package builds. Two packages whosetsgodts generation imports types from thoselib/outputs race against//#build:@lynx-js/config-rsbuild-plugin(imports@lynx-js/rspeedy,@lynx-js/template-webpack-plugininLynxConfigWebpackPlugin.ts/pluginLynxConfig.ts)@lynx-js/reactlynx-testing-library(imports@lynx-js/rspeedyinrstest-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
//#buildto thedependsOnof just the two affected packages (not to the globalbuild.dependsOn) so they wait fortsc --buildwithout re-introducing the cache fanout #2538 was avoiding.Test plan
find packages -name "*.tsbuildinfo" -delete
find packages -type d -name lib -exec rm -rf {} +
pnpm turbo build --force
Summary by CodeRabbit
Bug Fixes
Chores
Documentation