Repository navigation
Fix published package missing its build output - #49
Merged
Merged
Conversation
1.2.2 was published without `build/`, so `main.js` fails immediately with "Cannot find module './build/handler.js'". The build output came from `prepublishOnly`, which only npm implements. Since the upgrade to changesets 3, publishing goes through `yarn npm publish` (changesets 3 detects the package manager, where changesets 2 always shelled out to `npm publish`), and Yarn Berry does not run `prepublishOnly`. Nothing built `build/` during the release job, and the `files: ["build"]` entry matched nothing. `prepack` runs for both `yarn npm publish`/`yarn pack` and `npm publish`/`npm pack`, so the build output is produced regardless of which tool changesets picks.
Owner
|
Thank you. Sorry for the breakage. |
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.
neogrok@1.2.2on npm ships 5 files and nobuild/directory, so running it fails right away:For comparison, 1.2.1 contains 1152
build/entries, including thebuild/handler.jsandbuild/env.jsthatmain.jsimports.Cause: the build output was produced by
prepublishOnly, which is an npm-only lifecycle script. changesets 2 always published vianpm publish, so it ran. changesets 3 (#0076168) detects the package manager and usesyarn npm publishfor this repo'spackageManager: yarn@4.18.0, and Yarn Berry implements onlyprepublish/prepack/postpack. The release job runs justyarn install, sobuild/never existed andfiles: ["build"]matched nothing.Fix: use
prepack, which both Yarn Berry and npm run when packing or publishing.