Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lerna Repo, not recognising git tags / versions

See original GitHub issue

See this minimal example repo:

Attempting to generate a changelog from the initial commits with release count = 0.

Try running yarn install and then yarn changes. You’ll see that the generated changelog puts all commits under the version from the package.json file.

Tried all manner of cli options, tried multiple console.log() and seems to have the correct array of git tags but couldn’t get it to work. Wasn’t sure how to write a failing test but I hope this minimal repo does enough to demonstrate the problem.

If this isn’t a config option problem then I’m happy to help out with some PR but could do with some advice of where to start.



Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

swernerxcommented, Feb 12, 2020

I’m just wondering if this tip works for you guys so far. After running it, I see only one version with all changes in the new changelog. But my expectation was to get a real changelog where every version is listed with all changes. Wouldn’t that be more correct?

evocateurcommented, Jan 31, 2019

Lerna is just passing significant pieces of config to conventional-changelog APIs. You should be able to do the same with the conventional-changelog CLI and some judicious lerna exec from the root of your monorepo:

# Lerna does not actually use conventional-changelog-cli, so you need to install it temporarily
npm i -D conventional-changelog-cli

# fixed versioning (default)
# run in root, then leaves
npx conventional-changelog --preset angular --release-count 0 --outfile $PWD/ --verbose
npx lerna exec --concurrency 1 --stream -- 'conventional-changelog --preset angular --release-count 0 --commit-path $PWD --pkg $PWD/package.json --outfile $PWD/ --verbose'

# independent versioning
npx lerna exec --concurrency 1 --stream -- 'conventional-changelog --preset angular --release-count 0 --commit-path $PWD --pkg $PWD/package.json --outfile $PWD/ --verbose --lerna-package $LERNA_PACKAGE_NAME'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | Lerna
Solution:​ If possible, use lerna publish over manual releases. For new manual releases, use git tag -a -m <version> instead of using the...
Read more >
lerna/version -
A whitelist of globs that match git branches where lerna version is enabled. ... Include tags from merged branches when detecting changed packages....
Read more >
JavaScript Monorepos with Lerna - Semaphore CI
First, Lerna pushes all the changes to the remote repository and creates a Git tag. Then, it deploys the update to NPM. Lerna...
Read more >
Lerna monorepos with fewer tags | All about Ken Hawkins
Make a reference git tag for Lerna · Run Lerna publish and skip git tags: lerna publish --no-git-tag-version --no-push · Lerna publishes to...
Read more >
How To Set Up GitHub Actions to Publish a Lerna Monorepo
Error: Command failed: git push --follow-tags --no-verify origin master lerna ERR! fatal: could not read Username for '': ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found