RaghavBang
Published in

RaghavBang

Lerna is not Dead!! MonoRepos are still there.

Photo from Lerna

A monorepo tool called Lerna is used to handle several projects in a single repository. The monorepo strategy is an excellent way to preserve separate projects with clear ties between them while managing all the dependencies. It allows us to exchange configurations for tools like ESLint, Prettier, TypeScript, and others across projects, assuring consistency.

Multiple repositories are used when developing a large application. Making changes to them can be challenging as it becomes difficult to manage and complicates the process. Lerna steps in to help in this situation. By taking care of things like versioning, code deployment, project dependency management, and many other things, Lerna streamlines things for developers.

Although in April 2020, creator of lerna annouced that lerna is now not supported and no further updates will be done to it.

But here comes the twist, in May 2022, The creator of lerna handed the project to Nrwl 🚀🚀.

After 1 month of taking over the project, Lerna 5.0 was released followed by Lerna 5.1 with many features, fixes, etc.

Let’s look at the significant improvements and additions made with Lerna 5.1

  1. In Lerna, third open source package “Nx” was added that can be used to schedule a task. It increases speed of Lerna workspace by range of 2x to 10x. As Nx has the caching ability.
  2. Having Nx integrated, makes build faster and also we get some features of Nx for free.
  • Nx Project Graph: It visualises our workspace and the connections between the packages.
  • Distributed task execution: It divides the task in subtask to improve the speed.
  • Distributed caching: The output of every previously executed command, such as testing and building, is cached by Nx so that it may replay the results rather than re-running them.

3. Security fix and packages were upgraded.

4. Many open PR’s were merged that fixed many issues and documentation was improved.

5. One significant improvement is that Lerna now checks cyclic dependencies in big workspaces more quickly.

6. Approximately 84 issues have already been resolved.

If you like this post and find it helpful you can give me claps 😍!!

References:

How Lerna just got 10x faster!. TL;DR: We released a new beta version… | by Juri Strumpflohner | Nrwl

Lerna 5.1 — New website, new guides, new Lerna example repo, distributed caching support and speed! | by Juri Strumpflohner | Nrwl

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store