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
Always run postversion lifecycle method #7154
Merged
Merged
Conversation
This file contains 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
Runs postversion even if no git commit is made.
i hope someone can take care of this |
|
@arcanis Mind taking a look at this? 🙂 |
Any change to have it merged? |
Seems acceptable - thanks @hampustagerud! 🙂 |
VincentBailly
pushed a commit
to VincentBailly/yarn
that referenced
this pull request
Jun 10, 2020
* Always run postversion lifecycle method Runs postversion even if no git commit is made. * Update CHANGELOG.md * Improve logic, add tests, update CHANGELOG.md * Update CHANGELOG.md * Update CHANGELOG.md
VincentBailly
pushed a commit
to VincentBailly/yarn
that referenced
this pull request
Jun 10, 2020
* Always run postversion lifecycle method Runs postversion even if no git commit is made. * Update CHANGELOG.md * Improve logic, add tests, update CHANGELOG.md * Update CHANGELOG.md * Update CHANGELOG.md
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
After battling
yarn
for a while, trying to get thepostversion
lifecycle method to run without committing the new version, I found #5358 which indicated that it actually doesn't run when opting out committing the changes. The documentation doesn't indicate that a commit is needed forpostversion
to run so at least I assumed that I wouldn't need to commit in order forpostversion
to run. According to the previously mentioned issue there seems to be some people sharing my confusing around this. My use case for wantingpostversion
to run without committing is that I need to update other files before creating a commit.Test plan
I tested using the following steps:
Edited the
scripts
section ofpackage.json
and addedpreversion
andpostversion
:Ran
yarn version --no-git-tag-version --new-version 1.17.0
with a fresh install from homebrew, result:Reset
package.json
version field.Ran
yarn build && node ./lib/cli/index.js version --no-git-tag-version --new-version 1.17.0
with the change from this PR, result:Final notes
I realise that
version
can be used to achieve this since it also passes$npm_package_version
but since there is some confusion (once again referencing #5358, latest post from about a month ago), and the docs doesn't really mention it, makingpostversion
always run would be more consistent with both its name and the docs (in my opinion).If the current behaviour is desired I'd accept that but right now it is pretty ambiguous so I thought a at least a discussion would be good since #5358 has been open for over a year now 🙂
If accepted this will fix #5358.