Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Managing packages with Lerna? #21

Closed
mayurkale22 opened this issue Jun 6, 2019 · 5 comments
Closed

Managing packages with Lerna? #21

mayurkale22 opened this issue Jun 6, 2019 · 5 comments

Comments

@mayurkale22
Copy link
Member

Background: OpenCensus Node uses Lerna to organize codebase into multi-package repositories. Lerna give us the ability to build libraries and apps in a single repo without forcing us to publish to npm or other registries. This results in faster code-test-debug cycles by sharing components locally.

https://hackernoon.com/the-highs-and-lows-of-using-lerna-to-manage-your-javascript-projects-ff5c5cd82a99 -> mentioned some highs and lows of using lerna.

@draffensperger shared below article with me (offline).
https://gist.github.com/nolanlawson/457cdb309c9ec5b39f0d420266a9faa4

@mayurkale22 mayurkale22 added the Discussion Issue or PR that needs/is extended discussion. label Jun 6, 2019
@draffensperger
Copy link
Contributor

I'm definitely open to Lerna, but in my limited experience with it for OpenCensus Web, it often felt like onre more dependency to have to manage (upgrade for security fixes, etc.) and that a lot of its functionality might be able to be replaced using simple scripts or tricks as explained in the gist above.

@rochdev
Copy link
Member

rochdev commented Jun 7, 2019

In my experience using it in a few large projects, it's really a must-have for monorepos. Using scripts is possible, but it becomes very cumbersome very quickly, and in the end you end up pretty much rewriting Lerna but as a less feature complete, more difficult to use, and with more bugs implementation since it's not an external project that can be contributed to easily.

I'd say this is a general rule for using scripts in general. For example why use npm or yarn at all? They are just downloading files and resolving dependencies using semver which can be done with scripts.

To be honest, I would even go as far as to say not using Lerna might end up preventing a lot of users from contributing due to how complex the project will become. This is especially true for instrumentation repos where many different library versions have to be tested at the same time.

Let's focus on our domain (telemetry) and not on managing monorepos.

@rochdev
Copy link
Member

rochdev commented Jun 7, 2019

Most of the downsides mentioned in the articles are also mitigated by combining Lerna with TypeScript and Yarn.

@draffensperger
Copy link
Contributor

I'm fine with use of Lerna, just wanted to make sure including it is worth the extra weight of an extra dependency, sounds like in this case it is worth it!

@mayurkale22
Copy link
Member Author

All agreed to use Lerna in today's meeting.

  • It has its shortcomings (extra dependency) but it’s worth using it.
  • OpenCensus uses it and worked well.
  • It doesn't have the overhead on end users.

@mayurkale22 mayurkale22 added Agreed and removed Discussion Issue or PR that needs/is extended discussion. labels Jun 24, 2019
dyladan referenced this issue in dyladan/opentelemetry-js Sep 9, 2022
dyladan referenced this issue in dyladan/opentelemetry-js Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants