You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix behavior for yarn version pre* to match the docs (#6879)
## What's the problem this PR addresses?
<!-- Describe the rationale of your PR. -->
<!-- Link all issues that it closes. (Closes/Resolves #xxxx.) -->
Resolves#5902
The behavior for `yarn version prepatch/preminor/premajor` and `yarn
version prerelease` did not match [the
documentation](https://yarnpkg.com/cli/version).
Respectively, `preminor` errored, and `prerelease` did not bump the
prerelease number if used more than once.
...
## How did you fix it?
<!-- A detailed description of your implementation. -->
- `prepatch/preminor/premajor` were added to the accepted CLI arguments
- In case of `prerelease` on an already pre-release version, the semver
bump was adapted to bump the current prerelease version instead of the
`stableVersion`
...
## Checklist
<!--- Don't worry if you miss something, chores are automatically
tested. -->
<!--- This checklist exists to help you remember doing the chores when
you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
<!-- See
https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released
for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check
-i` -->
- [x] I have set the packages that need to be released for my changes to
be effective.
<!-- The "Testing chores" workflow validates that your PR follows our
guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR
might be missing. -->
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.
awaitexpect(run(`version`,`patch`)).rejects.toThrow(`Usage Error: Can't bump the version if there wasn't a version to begin with - use 0.0.0 as initial version then run the command again.`);
awaitexpect(run(`version`,`1.0.1`)).rejects.toThrow(`Usage Error: Can't bump the version to one that would be lower than the current deferred one (1.1.0)`);
awaitexpect(run(`version`,`patch`)).rejects.toThrow(`Usage Error: Can't bump the version to one that would be lower than the current deferred one (1.1.0)`);
29
29
}),
30
30
);
31
31
@@ -99,7 +99,33 @@ describe(`Commands`, () => {
99
99
);
100
100
101
101
test(
102
-
`it shouldn't immediatly increase the version number for a workspace when using --deferred`,
102
+
`it should bump then append a prerelease version number to a release version`,
0 commit comments