Is your feature request related to a problem? Please describe. Currently, It seems that ship.js support only conventional commits to get Next version.
I want to custom the logic of getNextVersion
.
For example, I want to implement label based version management:
Calculate Next version from labels If these includes only
Version: patch
, next version is patch If these includesVersion: patch
andVersion: minor
, next version is minor If any one isVersion: major
label, next version is major
Describe the solution you'd like
Add new lifecyle hook like updateVersion
before shouldPrepare
module.exports = {
updateVersion: async ({revisionRange,
currentVersion,
dir}) => {
// user defined logic
const nextVersion = await calculateNextVersion();
return { nextVersion }
}
};
Describe alternatives you've considered
- Add
{ versionStrategy: "conventional-commits" | customFunction }
- it looks like mergeStrategy
Additional context
Customization for updateVersion
logic may be used for independent mode.