question-mark
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.

Can Lerna base the version off git tag history vs. package.json?

See original GitHub issue

Sorry, this might not be the right place for this question since it’s not a bug but more of a feature request.

I’m trying to figure out the best way to use lerna in a full CI system. Ideally, in a CI system you want the build to be isolated from the release phase. The normal flow for a CI is

PullRequest --> Trigger Build --> Build/Unit Test --> Publish Artifacts

When semantic versioning with lerna is introduced the process becomes

Pull Request --> Trigger Build --> Build/Unit Test --> Read Package.json & Generate Next Semantic Version -> Commit new package.json --> Publish Artifacts

The problem with the second flow is that you are actually modifying the code your building by updating the package.json and commiting it again which in some ways invalidates your original build. You can build it again, but you would have to have some logic to by pass the whole versioning and publishing again. In this case, Lerna just won’t publish it again since there is no major/minor/patch change since only the package.json got updated

Question For a CI system, you don’t want to be modifying code that you are building and publishing. Is there a way for lerna to not depend on the package.json but on the git tags that are generated for the release. It can just grab the latest git tag and increment the major,minor, patch accordingly.

Let me know what your thoughts on this or any suggestions? Thanks, Derek

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8

github_iconTop GitHub Comments

1reaction
darewreck54commented, Jan 23, 2020

I don’t believe you can. The main issue is that the logic is based off the package.json which needs to be checked in. So versioning is based off a file that then needs to be updated and committed. If git tags were used for the last version, this wouldn’t be an issue.

Sent from my iPhone

On Jan 22, 2020, at 6:43 PM, Joe Bowbeer notifications@github.com wrote:

Can you compare and contrast what you are looking for with the from-package option added for #1648https://github.com/lerna/lerna/issues/1648?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/lerna/lerna/issues/2419?email_source=notifications&email_token=AD3MFTT4G2ICXYVGKP22JWDQ7D76BA5CNFSM4KIQ5EZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJV2HXI#issuecomment-577479645, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD3MFTSR6C363HBJV5D4VDLQ7D76BANCNFSM4KIQ5EZA.

0reactions
github-actions[bot]commented, Jun 17, 2022

Hi Folks 👋

You will have seen in our message above that we at Nrwl are working really hard to bring the lerna repo up to date with what matters most to its community in June 2022.

As previously stated in that message, because we have not heard from the original author of this issue within the last 14 days, we are now automatically closing it.

If any users, including the original author, are still impacted by this issue then we still want to hear from you!

All we ask is that you first update to the latest lerna (5.1.4 at the time of writing) to make sure it is still reproducible, and then fill out one of our new issue templates, providing all the requested details which apply to your situation:

https://github.com/lerna/lerna/issues/new/choose

Many thanks again! 🙏


P.S. Over and above getting to grips with the repo, we have also been hard at work launching a new website, resolving all vulnerabilities, merging exciting new features and reigniting community PR contributions! 🚀

You can read our recent blog post to learn more about what we’ve been up to: https://blog.nrwl.io/lerna-5-1-new-website-new-guides-new-lerna-example-repo-distributed-caching-support-and-speed-64d66410bec7

Read more comments on GitHub >

github_iconTop Results From Across the Web

Depend on a branch or tag using a git URL in a package.json?
Say I've forked a node module with a bugfix and I want to use my fixed version, on a ...
Read more >
JavaScript Monorepos with Lerna - Semaphore CI
Publishing a package is a two-step process. First, Lerna pushes all the changes to the remote repository and creates a Git tag. Then,...
Read more >
Troubleshooting | Lerna
Github and Github Enterprise use lightweight Git tags when a release is created through the web ui, while Lerna uses annotated tags. This...
Read more >
Lerna from a DevOps point of view - LinkedIn
ls lerna.json package.json packages cd packages mkdir ... microservices (like a docker build or a node command) The typical way to do this ......
Read more >
npm packages in the Package Registry - GitLab Docs
In the GitLab project that houses your .npmrc and package.json , edit or create a ... When you install a package without specifying...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found