Working with Rush for larger repositories
While Lerna provided a lot of the utility that made monorepos possible at all, its configuration and flexibility also posed some challenges. Furthermore, finding best practices proved to be difficult. Consequently, plenty of quite opinionated alternatives to using Lerna have been born. One of the most successful ones is Rush from Microsoft.
Rush allows a variety of npm clients to be used. Classically, Rush used to be npm-only. Today, Rush recommends using pnpm, which is also the default client when setting up a monorepo with Rush.
To work efficiently with Rush, a global installation of the tool is recommended:
$ npm install -g @microsoft/rush
After a successful installation, the rush
command-line utility can be used. As with npm
, an init
subcommand to actually initialize a new project exists:
$ rush init
This will create and update a couple of files. Most notably, you’ll find a rush.json
file in the current folder....