request a feature
What is the current behavior?
calling yarn version will prompt for new version - cannot be used by automated builds
What is the expected behavior?
ability to auto-increase version without prompt:
package.json version before -> after
yarn version --major 1.0.0 -> 2.0.0
yarn version --minor 1.0.0 -> 1.1.0
yarn version --patch 1.0.0 -> 1.0.1
yarn version --pre 1.0.0 -> 1.0.0-next (not sure about this one ...)
Please mention your node.js, yarn and operating system version.
npm -v 5.6.0
node -v v9.4.0
yarn -v 1.3.2
ver Microsoft Windows [Version 10.0.16299.248]
Will something like --pre be supported in the future?
NPM has npm version [premajor | preminor | prepatch | prerelease] for pre-releases, which are useful sometimes.
I think we can combine --pre with other flags to bump pre-releases.
yarn version --pre --major 1.0.0 -> 2.0.0-0
yarn version --pre --minor 1.0.0 -> 1.1.0-0
yarn version --pre --patch 1.0.0 -> 1.0.1-0
yarn version --pre 1.0.0-alpha.0 -> 1.0.0-alpha.1
I've implemented this behaviour similar to how it works on npm. Be free to comment or contrbute on the pull request: https://github.com/yarnpkg/yarn/pull/7336
I guess this one is already implementd and may be closed
https://classic.yarnpkg.com/en/docs/cli/version
This does not seem to exist in Yarn v1.21.1. I remember using this and suddenly I get error Use the "--new-version [version]" flag to create a new version.
Edit: I think you need yarn 2.0 or more
Most helpful comment
Will something like
--prebe supported in the future?NPM has
npm version [premajor | preminor | prepatch | prerelease]for pre-releases, which are useful sometimes.I think we can combine
--prewith other flags to bump pre-releases.Ref: https://docs.npmjs.com/cli/version