New to lerna and monorepo, my understanding is with lerna, we put all shared packages and all consumer packages in a single repo. Then after 'lerna bootstrap', consumer1 and consumer2 will both have a local link to shared1 (symllink). So whenever I make changes in shared1, both consumer1 and consumer2 are affected.
Is there a way to make consumer1 and consumer2 point to different versions of shared1? so that when I make changes in shared1, only consumer1 is affected and consumer2 is not.
Lerna detects by itself which packages have changed since the last release and publishes only the new versions. But this feature only works for publishing, not testing. While Lerna doesn't support change-based testing, Semaphore does. And it's pretty easy to configure.
But surprisingly many still haven't heard that Lerna is back, far from obsolete or deprecated and is getting brand new features. We from Nrwl are the creators of Nx and given our long history in the monorepo space, we offered to take over stewardship of Lerna when it was declared “dead” in April 2022.
One of the big benefits of using lerna is the fact that your code within the monorepo is always building and testing with the latest versions of their child dependencies. If your consumers need to use different versions of shared code, then those consumers probably do not belong within this monorepo and should be installing the shared code independently. Here is a closed github thread covering this also.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With