Lerna links different projects within the repo so they can import each other without having to publish anything to NPM. To show how Lerna does it, we will take this repository as an example.
📄️ Run Tasks
Monorepos can have hundreds or even thousands of projects, so being able to run npm scripts against all (or some) of
📄️ Cache Task Results
When it comes to running tasks, caching etc., Lerna and Nx can be used interchangeably. When we say "Lerna can cache
📄️ Explore the Project Graph
For Lerna (and Nx) to run tasks quickly and correctly, it creates a graph of the dependencies between all the projects in the repository. Exploring this graph visually can be useful to understand why Lerna is behaving in a certain way and to get a high level view of your code architecture.
📄️ Distribute Task Execution
Lerna (via Nx) supports running commands across multiple machines. You can either set it up by hand (by using batching or binning) or use Nx Cloud.
📄️ Version and Publish
Lerna can increment your package's versions as well as publish your packages to NPM, and it provides a variety of options to make sure any workflow can be accommodated.
📄️ Editor Integrations
Nx Console displays the npm scripts for all your projects in the VS Code sidebar and allows you to run them with a single click or open the script definition in your editor.