简体   繁体   中英

tools to Manage NodeJS external/internal npm dependencies

We have several applications for which we've developed helpers, utilities which we've packaged in separate private npm modules.

Contributing to these separate npm modules is cumbersome ( pre-releasing, testing, releasing, publishing, semver management ) as well as the overhead of managing an external Git Repository, so we were wondering if there's a better and easier way to do this? (we saw lerna but it feels even more complex)

Putting all these common helpers and tools together is a great first step.

You can put them all in a monorepo, using your favourite monorepo tool like:

  • yarn workspaces
  • NX
  • Lerna , although it hasn't seen much development and traction in the last couple of years. Interesting enough, they recently announced that the company behind NX will be taking over Lerna here and here

For a not very complex use case, I would just go with yarn workspaces which is enough for many use cases. NX has more advanced and nice features, but has a bit steeper learning curve IMO.

Monorepos in general work great for this exact use case, where you have to maintain common packages with interdependencies and / or synergies.

The next step would be to analyze if putting these common tools and your application makes sense. If for instance, you have related applications (Backend, Frontend, common libraries, tools), putting them all in a monorepo would make sense and make your team life easier. There are of course, drawbacks to this approach, but in many cases, has more benefits than disadvantages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM