Fix concurrent-publish race in package build scripts#1268
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR streamlines npm build scripts across the core and hardhat plugin packages by removing redundant build steps and optimizing TypeScript compilation invocation. The ChangesBuild script lifecycle optimization
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 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)
Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring alerts on:
|
|
@SocketSecurity ignore-all |
Problem
changeset publishruns each package'sprepareconcurrently. core'spreparedeletedcore/dist(viayarn clean) while plugin-hardhat'sprepareranhardhat compile, which loadscore/dist— so co-releases intermittently failed withCannot find package …/upgrades-core/dist/index.js.Root cause
In plugin-hardhat,
preparedelegated tocompile, so the publishable build inherited a dev/test step —hardhat compile, which loadscore/dist. Run concurrently bychangeset publish, that load raced core'sprepare, which cleanscore/dist.Fix — separate
prepare(the publishable build) fromcompile(the dev/test build)preparenow does only the TypeScript build, so the publishable build no longer runshardhat compileand never loadscore/dist.prepareno longer cleans, so it no longer deletescore/distmid-publish.compilestill runshardhat compileto build the plugin's test contracts — that step is just no longer pulled into the publishableprepare.With each entry point owning its purpose, the concurrent prepares no longer touch each other's output.
publish.shis unchanged, and published artifacts are identical (verified vianpm packfile lists).Summary by CodeRabbit
preparescript now compiles before copying build artifacts instead of just cleaning.compilescript adjusted to use TypeScript build without force flag, andpreparescript now runs TypeScript compilation directly.