chore: build packages via prepack instead of a separate build script - #140
Conversation
Every package's `build` script is renamed to `prepack`, so unbuild runs automatically whenever a package is packed or published. The explicit build steps in the CI preview and release workflows are removed, since `pnpm pack` (used by pkg-pr-new) and `pnpm publish` both trigger the hook themselves.
@standard-server/aws-lambda
@standard-server/core
@standard-server/fastify
@standard-server/fetch
@standard-server/node
@standard-server/peer
@standard-server/shared
commit: |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — this run reviewed the full 9-file diff at head 1793182: the build → prepack script rename across all 7 publishable packages and the removal of the explicit build step from both CI workflows.
- Per-package
prepackhook —"build": "unbuild"becomes"prepack": "unbuild"inshared,core,peer,node,fetch,fastify, andaws-lambda, so packing/publishing builds automatically. - CI preview workflow — the standalone
pnpm --filter='./packages/*' run -r buildstep is dropped; pkg-pr-new now relies onprepackduring its per-packagepnpm pack. - Release workflow — the same build step is dropped before
pnpm publish;prepackcovers the publish path.
I verified the load-bearing external contract directly against the installed source: pkg-pr-new@0.0.87 runs pnpm pack --pack-destination <dir> with no --ignore-scripts (node_modules/pkg-pr-new/dist/index.js:32901), so previews still build. pnpm pack/pnpm publish both run prepack, and no other reference to a build npm script exists anywhere in the repo (no workflow, doc, or root script invokes it; pnpm-workspace.yaml sets no ignore-scripts). Cross-package type resolution during each package's own build uses the source exports (./src/index.ts), not dist, so per-package prepack ordering is not a concern.
The only observable side effect is DX: pnpm run build no longer exists locally (use pnpm pack or pnpm exec unbuild), which is the intended trade-off.
DeepSeek Flash (default — pick a model for stronger reviews) | 𝕏
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
|

Packages now build through a
prepackscript instead of a separatebuildscript, matching oRPC. unbuild runs automatically on everypnpm packandpnpm publish, so a package can no longer be published without itsdistbecause a step was forgotten.Changes
"build": "unbuild"→"prepack": "unbuild".Testing
pnpm packinpackages/sharedbuilds first; the tarball containsdist/index.mjs,dist/index.d.mtsanddist/index.d.ts.pnpm --filter='./packages/*' publish -r --dry-run --no-git-checksbuilds all 7 packages, covering the release path.pnpm pack --pack-destination <dir>without--ignore-scripts, so previews still build.