Skip to content

Instantly share code, notes, and snippets.

@m7kvqbe1
Created December 11, 2020 11:39
Show Gist options
  • Select an option

  • Save m7kvqbe1/ecdbdd0d658d0af593b447e9d0a09976 to your computer and use it in GitHub Desktop.

Select an option

Save m7kvqbe1/ecdbdd0d658d0af593b447e9d0a09976 to your computer and use it in GitHub Desktop.
lerna-changelog-regenerate
Tips
Generating 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 using conventional-changelog-cli and lerna exec:
# Lerna does not actually use conventional-changelog-cli, so you need to install it temporarily
npm i -D conventional-changelog-cli
# Documentation: `npx conventional-changelog --help`
# fixed versioning (default)
# run in root, then leaves
npx conventional-changelog --preset angular --release-count 0 --outfile ./CHANGELOG.md --verbose
npx lerna exec --concurrency 1 --stream -- 'conventional-changelog --preset angular --release-count 0 --commit-path $PWD --pkg $PWD/package.json --outfile $PWD/CHANGELOG.md --verbose'
# independent versioning
# (no root changelog)
npx lerna exec --concurrency 1 --stream -- 'conventional-changelog --preset angular --release-count 0 --commit-path $PWD --pkg $PWD/package.json --outfile $PWD/CHANGELOG.md --verbose --lerna-package $LERNA_PACKAGE_NAME'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment