Add prepublishOnly script to build dist before publishing - #46
Conversation
…publishing (#1) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
📝 WalkthroughWalkthroughAdds a Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 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 |
There was a problem hiding this comment.
Pull request overview
This PR updates the @chonkiejs/token package’s publish lifecycle so that dist/ is generated automatically during npm publish, preventing publishes that omit compiled output.
Changes:
- Add a
prepublishOnlyscript inpackages/token/package.jsonto run the existing build step before publishing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/token/package.json (1)
23-28: Good fix:prepublishOnlywill build before publish (but considerprepackfor completeness).
prepublishOnly: "npm run build"is correctly placed inscriptsand aligns withfiles: ["dist"]+main/types/exportspointing atdist/index.*, so publishing should now include compiled artifacts.Optional hardening: if your workflow uses
npm pack(or otherwise relies on the tarball being built even outsidenpm publish), consider usingprepack(or adding it in addition toprepublishOnly) so the same build happens for packing too.♻️ Optional diff
"scripts": { "clean": "rimraf dist", "build": "npm run clean && tsc && tsc-alias -p tsconfig.json --resolve-full-paths", "prepublishOnly": "npm run build", + "prepack": "npm run build", "test": "echo 'No tests for `@chonkiejs/token` yet'" },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/token/package.json` around lines 23 - 28, The package.json currently uses "prepublishOnly": "npm run build" which ensures build before publish but doesn't run when creating a tarball with npm pack; add a "prepack": "npm run build" script (or add it alongside "prepublishOnly") so npm pack and other workflows also produce the compiled dist artifacts; update the scripts block to include "prepack" pointing to the same build command so "build" runs for both pack and publish operations.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/token/package.json`:
- Around line 23-28: The package.json currently uses "prepublishOnly": "npm run
build" which ensures build before publish but doesn't run when creating a
tarball with npm pack; add a "prepack": "npm run build" script (or add it
alongside "prepublishOnly") so npm pack and other workflows also produce the
compiled dist artifacts; update the scripts block to include "prepack" pointing
to the same build command so "build" runs for both pack and publish operations.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f67472a9-7fbb-45a7-a5d4-b8c30e5d59be
📒 Files selected for processing (1)
packages/token/package.json
This pull request fixes a bug in the package publishing workflow by ensuring the build process runs automatically before publishing. Currently dist for
tokendoesn't end up in the published npm package. This PR should fix that.prepublishOnlyscript topackage.jsonto automatically run the build before publishing the package.…publishingSummary by CodeRabbit