I've been manually managing my package versions and changelog.md
file up to the 5.2.0. Now I'm trying to integrate Lerna to manage my package but facing an issue while doing that.
Issue: lerna version --conventional-commits
,
Lerna is treating it as a first-time version update. As a result, it's including all the commit messages in the changelog as breaking changes and bug fixes, even though I have already maintained a manual changelog.md
file up to the version 5.2.0 with all the commit messages already present there.
How can I use Lerna in a way that it will not generate the old commit messages as breaking changes and instead expect Lerna to update version as a patch version only 5.2.0 -> 5.2.1 and expect it to only generate commit message after 5.2.0 only. In my case commit message is
fix(styles): Automating the versioning using lerna.
Files present in commit messages are
package.json, package-lock.json, lerna.json,
Any assistance in achieving this would be greatly appreciated. Thank you
It's a known problem and was also mentioned in the
lerna version
docs, however in the new Lerna these commands docs are hidden away (you can open the command docs from their website) or if you use Lerna-Lite then all docs are available from the main page.In the case of your problem, this is the part of the docs that you need,
lerna version
Tips - conventional-changelogGenerating Initial Changelogs If you start using the
--conventional-commits
option after the monorepo has been active for awhile, you can still generate changelogs for previous releases usingconventional-changelog-cli
andlerna exec
: