Expected Behavior
Running lerna version --conventional-commits should work, and generate the next version based on conventional commits.
Current Behavior
The positional bump is required, even though the official docs say it's not required

Possible Solution
The code in question is located here: https://github.com/lerna/lerna/blob/main/commands/version/command.js#L290.
If I pass anything, even prerelease, as a positional argument, it will hit this condition, and the conventionalCommits condition will never execute, thus skipping the desired version generation.
The changelog for 3.0.2 states: Positional bump supersedes "--conventional-commits". Ok, but how can I not specify the bump argument then?
Probably the simplest solution is to check whether the bump was sent before validating it in this block of code:
https://github.com/lerna/lerna/blob/main/commands/version/command.js#L289-L291. If the value is empty, don't validate it.
Steps to Reproduce (for bugs)
Run: lerna version --conventional-commits
{
"packages": [
"packages/*",
"packages-v6/*"
],
"version": "5.26.0",
"npmClient": "yarn",
"command": {
"version": {
"preid": "next",
"ignoreChanges": [
"scripts/**",
",**/__fixtures__/**",
"**/__tests__/**",
"**/*.md",
"lerna.json",
"api/**",
"apps/**"
],
"conventionalCommits": true,
"createRelease": "github",
"commitHooks": false,
"message": "chore(release): publish %s :tada: :rocket:"
},
"publish": {
"conventionalCommits": true
}
}
}
Context
I'm trying to version packages using conventional commits, and not explicit version bumps.
| Executable |
Version |
lerna --version |
3.22.1 |
npm --version |
6.14.17 |
yarn --version |
3.1.0 |
node --version |
14.19.3 |
Willing to open a PR to fix this, but want to hear from the maintainer first to be on the same page about the solution.
Thanks!
Expected Behavior
Running
lerna version --conventional-commitsshould work, and generate the next version based on conventional commits.Current Behavior
The positional
bumpis required, even though the official docs say it's not requiredPossible Solution
The code in question is located here: https://github.com/lerna/lerna/blob/main/commands/version/command.js#L290.
If I pass anything, even
prerelease, as a positional argument, it will hit this condition, and theconventionalCommitscondition will never execute, thus skipping the desired version generation.The changelog for 3.0.2 states:
Positional bump supersedes "--conventional-commits". Ok, but how can I not specify thebumpargument then?Probably the simplest solution is to check whether the
bumpwas sent before validating it in this block of code:https://github.com/lerna/lerna/blob/main/commands/version/command.js#L289-L291. If the value is empty, don't validate it.
Steps to Reproduce (for bugs)
Run:
lerna version --conventional-commits{ "packages": [ "packages/*", "packages-v6/*" ], "version": "5.26.0", "npmClient": "yarn", "command": { "version": { "preid": "next", "ignoreChanges": [ "scripts/**", ",**/__fixtures__/**", "**/__tests__/**", "**/*.md", "lerna.json", "api/**", "apps/**" ], "conventionalCommits": true, "createRelease": "github", "commitHooks": false, "message": "chore(release): publish %s :tada: :rocket:" }, "publish": { "conventionalCommits": true } } }Context
I'm trying to version packages using conventional commits, and not explicit version bumps.
lerna --versionnpm --versionyarn --versionnode --versionWilling to open a PR to fix this, but want to hear from the maintainer first to be on the same page about the solution.
Thanks!