Reputation: 593
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.
Upvotes: 6
Views: 2636
Reputation: 10667
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.
Upvotes: 3