New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run prepublish build after versioning #12028
Run prepublish build after versioning #12028
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/28230/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 6305cf4:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -8,7 +8,8 @@ | |||
"build": "make build", | |||
"fix": "make fix", | |||
"lint": "make lint", | |||
"test": "make test" | |||
"test": "make test", | |||
"version": "yarn --immutable-cache && git add yarn.lock" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--immutable-cache
is used here to bail when new dep needs to be fetched from network, which can happen when people edit external deps in package.json
but forget to checkout the updated yarn.lock, and if that happens it should be addressed in separate commits instead of the version commit. In all, the version commit should include the following changes only:
- Updated version in related package.json
- Updated
workspace@new-version
resolution in yarn.lock
make new-version
is run,make publish
will fail because committed changes ofyarn.lock
.This PR reorders workflows in publish-test to align with our actual workflow. I added a
"version"
lifecycle event: So when we runlerna version
, it will invoke theversion
lifecycle event after package.json is updated but before it is committed: See also https://github.com/lerna/lerna/tree/master/commands/version#lifecycle-scripts