fix: build via prepack so dist is always published - #46
Merged
Conversation
The release workflow previously relied solely on a CI build step running before `npx semantic-release`. When that step was missing (v0.8.0), npm published without dist since it is git-ignored and never built, leaving the files:["dist"] whitelist matching nothing. Adding a prepack script makes the build run automatically before pack/publish, so dist can never be omitted regardless of CI. This fix commit also triggers a patch re-release. Co-authored-by: Cursor <cursoragent@cursor.com>
|
🎉 This PR is included in version 0.8.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This was referenced Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
prepackscript (npm run build) topackage.jsonso the build runs automatically beforenpm pack/npm publish, guaranteeing thedistfolder is always present at publish time.Background
@worldware/msg@0.8.0was published to npm with only 3 files (LICENSE,README.md,package.json) — nodist. Root cause: thereleasejob at that tag had no build step beforenpx semantic-release. Sincedistis git-ignored and only produced by the build,npm publishran withdistabsent, so thefiles: ["dist"]whitelist matched nothing.PR #45 already re-added a build step to the release job. This
prepackscript is a belt-and-suspenders guarantee so publishing can never omitdistagain, regardless of future CI changes.Because this is a
fix:commit, merging will trigger a semantic-release patch release (0.8.1) that includes a workingdist.Test plan
dist/, rannpm pack --dry-run, confirmedprepackrebuilt it and the tarball contained all 32 files includingdist/index.mjs,dist/index.cjs, and type declarations.0.8.1is published to npm withdistpresent (npm pack @worldware/msg --dry-run).npm deprecate @worldware/msg@0.8.0 "broken build - missing dist, use >=0.8.1"Made with Cursor