Context
As a maintainer for formatjs & react-intl, I use lerna to manage the monorepo, which includes several tasks:
- Manage npm dependencies installation
- Run npm scripts in a topologically-sorted order such as
build
or test
- Create new GitHub releases
- Generate CHANGELOGs
- Publish to npm
Lerna is pretty good at doing all of those 5 tasks but with the growth of the monorepo and the increasing amount of build
time I figure we might need something that’s better suited for selective build. In the blog post I’ll walk you through my decision to drop lerna as a build system in favor of bazel.
First, the result
We now have a GitHub Action workflow with cache:
- CI: we’re on par with the older system with more correctness & reproducibility (~14 minutes).
- Selective Build (local): our build step went from 9 minutes to 50s — 10 minutes (depending on what changed).
- Selective Test (local): our build step went from 4 minutes to 20s — 5 minutes (depending on what changed).
- A lot less “works on my machine” issues.
#javascript #npm #bazel #lerna #node