Skip to content
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

feat(version): Added semver versioning flags for convenience #5670

Merged
merged 1 commit into from
Apr 15, 2018

Conversation

faazshift
Copy link
Contributor

@faazshift faazshift commented Apr 15, 2018

fixes #5670

Summary

Currently, it's possible (although undocumented) to automatically bump the version by running something like yarn version --loose-semver --new-version minor. To me, this seems less convenient and less intuitive than something like yarn version --minor (closely comparable to npm version minor). I've added the ability to automatically increment the version with one of the flags: --major, --minor, or --patch. This will also satisfy feature request #5367.

Test plan

I've included Jest test cases for each of the new versioning flags.

@rally25rs
Copy link
Contributor

Would you mind also making a PR to the yarnpkg/website repo where the help docs are stored, adding these flags to the docs? https://github.com/yarnpkg/website/blob/master/lang/en/docs/cli/version.md

@rally25rs rally25rs changed the title Added semver versioning flags for convenience feat(version): Added semver versioning flags for convenience Apr 15, 2018
Copy link
Contributor

@rally25rs rally25rs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for the contribution! 👍

I'd like to hold off on the merge until we get a PR for the docs added as well, so that we can merge both and keep the code and docs in sync.

@faazshift
Copy link
Contributor Author

@rally25rs Sounds good. I was initially thinking I'd make the PR on the website repo right after this was merged, but I'll go ahead and put that together first.

@rally25rs
Copy link
Contributor

Thanks @faazshift I'll go ahead and merge this now then with the expectation of getting a PR on the docs side soon. Thanks again for the contribution, we really appreciate it!

@faazshift
Copy link
Contributor Author

@rally25rs Thanks! I've added the PR for the website.

@sshadmand
Copy link

sshadmand commented Apr 21, 2018

FYI: when adding to precommit hook

// package.json
...
"bump": "yarn version --loose-semver --new-version patch"
  },
  "pre-commit": [
    "lint",
    "bump"
  ],
...

Not sure if that is a design flaw or not, so posting here as a potential bug.
goes into an infinite loop.

@pkyeck
Copy link

pkyeck commented May 7, 2018

should this be working for 1.6.0? It is not - at least not for me.

$ yarn version --patch
yarn version v1.6.0
info Current version: 1.7.0
question New version: █

I expect to not be asked what the new version should be 🙁

PS: asking b/c it is already in the docs on the website: https://yarnpkg.com/lang/en/docs/cli/version/#toc-yarn-version-major

@faazshift
Copy link
Contributor Author

@pkyeck The PR for the docs on the site was unintentionally merged/released along with the 1.6.0 release. However, the feature will actually be released in the next version of yarn.

@cache-rules
Copy link

Hey @faazshift this is super confusing and annoying, can the docs have this feature removed until it's actually released, or can the docs be updated to say that it is not yet released?

@faazshift
Copy link
Contributor Author

@cache-rules This was shipped a couple days ago, in yarn@1.7.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants