Build packages in dependency order in pnpm build#287
Conversation
The root "build" script never built @wafflebase/docs and ran every package build concurrently with no ordering. Since cross-package type resolution reads each dependency's built dist/*.d.ts (gitignored, often stale) rather than its source, consumers compiled against outdated declarations: slides failed on missing docs ruler exports and backend failed on the slides Guide/guides symbols added in #285. Build in topological order instead: (docs, sheets) -> slides -> (frontend, backend, cli), so every package compiles against freshly built dependency declarations. Verified from a clean dist state.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR documents and fixes a ChangesBuild Dependency Order Fix and Task Archival
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ 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. Comment |
Verification: verify:selfResult: ✅ PASS in 166.4s
Verification: verify:integrationResult: ✅ PASS |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
The rebase auto-resolution overwrote the topological build order introduced in #287 (concurrent docs+sheets, then slides, then concurrent frontend+backend+cli) with the simpler all-concurrent form this branch had branched from. Restore the topological flow and keep `pnpm tokens build` as the first step so tokens compile before any consumer that imports them. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Summary
pnpm buildfailed with exit code 1: theslidesandbackendpackagebuilds errored on missing exports.
Root cause — these symbols were added in #285 (slides ruler + guides) and
are correctly exported from source, but cross-package type resolution reads each
dependency's built
dist/*.d.ts(gitignored, often stale), not its source. Theroot
buildscript (a) never built@wafflebase/docsat all, and (b) ran everypackage build concurrently with no dependency ordering, so
slidescompiledagainst
docs' stale dist andbackendagainstslides' stale dist.Dependency graph:
Fix — build in topological order:
(docs, sheets) -> slides -> (frontend, backend, cli), so every package compiles against freshly builtdependency declarations.
Test plan
rm -rf packages/*/dist && pnpm build→ exit 0 (was exit 1 before, from a clean dist state)pnpm verify:fast→ exit 0 (792 tests pass)🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
Documentation