[rush] Add support for premajor and prepatch bump types#4994
[rush] Add support for premajor and prepatch bump types#4994witcher112 wants to merge 3 commits intomicrosoft:mainfrom
Conversation
| * | ||
| * TODO: Consider supporting `premajor` and `prepatch` in the future. | ||
| */ | ||
| export enum BumpType { |
There was a problem hiding this comment.
Do the numeric values of these need to be updated to reflect the order of increasing severity? These may be used to ensure that the most severe bump type wins if multiple are specified in a package's changefiles.
There was a problem hiding this comment.
However, we need to confirm that doing that as a breaking API change won't cause issues.
Maybe we make premajor be 4.5 and prepatch be 1.5? When preminor was added, was that also a breaking reordering of values? It that's the case, then reshuffling these and using integers is probably fine.
There was a problem hiding this comment.
@iclanton IMHO it makes sense for them to be ordered in more natural way, but as you mentioned it could be a breaking API change.
I'll wait for other maintainers to comment on this before making changes here.
…on-bump-type_2024-11-07-06-42.json Co-authored-by: Ian Clanton-Thuon <iclanton@users.noreply.github.com>
Summary
Simple change to allow premajor and prepatch bump types.
These are directly supported by the
semverlibrary.Details
How it was tested
I've added unit tests for "premajor" and "prepatch" as well as additional ones that make sure using bump type "patch" gets rid of any prerelease identifier.
PS. There was a bug in
VersionPolicy.test.tswhich caused tests to use the same instances ofversionPolicyNobjects. I've moved creation ofVersionPolicyConfigurationintobeforeEachhook to make sure that each test gets a clean environment.Impacted documentation
https://rushjs.io/pages/commands/rush_version/
https://rushjs.io/pages/configs/version-policies_json/