Lerna always using a patch version when using conventional commits
See original GitHub issueWe recently integrated automatic releases with Lerna by using execa, --yes
, and a combination of other args. This is the gist of our script.
First we version:
execa('lerna', [
'version',
'--yes',
// Only run on master
'--allow-branch',
'master',
// Use the ESLint conventional commit preset
'--conventional-commits',
'--changelog-preset',
'eslint',
// Create a GitHub release
'--github-release',
// Push changes to git
'--push',
// Alter commit message to skip CI
'--message',
'Release [ci skip]',
])
And then publish later on:
execa('lerna', [
'publish',
'from-git',
'--yes',
// Run pre and post scripts in each package if available
'--require-scripts',
])
We’re using the ESLint conventional commit preset, but no matter what our commit messages look like, the release is always a patch version. For example, our latest commit message was “New: Add util to handle render props”, which should be a minor release, but was a patch.
Expected Behavior
It determines the correct version.
Current Behavior
It’s always a patch version.
Possible Solution
Not sure. I’m digging into execa to see if that’s the cause, but I have yet to find anything. Looking for any information that may help here as it’s blocking our releases.
Steps to Reproduce (for bugs)
Try running those example scripts above I suppose.
lerna.json
{
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
"publish": {
"ignoreChanges": ["*.md"]
}
}
}
Context
Your Environment
Executable | Version |
---|---|
lerna --version |
3.11.1 |
npm --version |
6.5.0 |
yarn --version |
1.13.0 |
node --version |
10.14 |
Issue Analytics
- State:
- Created 5 years ago
- Comments:16 (13 by maintainers)
Top Results From Across the Web
javascript - Can Lerna bump prerelease version according to ...
It doesn't seem that Lerna 3.20. 2 is able to bump prerelease versions (e.g. 1.0. 0-alpha. 0 ) according to the Conventional Commits...
Read more >@lerna/version - npm
Releases all unreleased changes as pre(patch/minor/major/release) by prefixing the version recommendation from conventional-commits with pre , ...
Read more >@lerna/conventional-commits | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >Monorepo using Lerna, Conventional commits, and Github ...
We will now publish the very first version of the package to the Github Packages npm registry, so we can install it from...
Read more >Automating package publishing in JavaScript projects
This post shows you how to automate package versioning and publishing to the registry, using some helpful tools like Lerna and Commitizen.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was having this issue, but only when trying to use
--conventional-commits
in a github action. I was able to get it to work by configuringactions/checkout@v2
to fetch my repo’s entire history (docs). By default only the latest commit is fetched, so I assume the empty commit history was the cause of my problem.Hopefully this can help someone else:
FOUND IT! I threw some console logs in here:
Since we try without the prefix,
eslint
loads the actualeslint
package instead ofconventional-changelog-eslint
.It should probably be updated to try with the prefix before trying without the prefix.