Investigate tools for build orchestration in monorepo
pastelmind opened this issue · comments
Currently, packages in our monorepo have the following dependency graph:
psd-decoder psd <-- benchmark, example-browser, example-node, benchmark
When building a package, we must ensure that its dependencies are built first, and in order. Furthermore, when building a package in watch mode, we must launch watchers for the dependencies as well. Managing this with NPM scripts is tricky and error-prone, and I already had to push fixes such as #26 and #27.
List of tools
- Small, independent tools that work with NPM:
npm-run-all*, npm-run-all2, concurrently, lerna-lite, wireit- I'm inclined to try the smaller ones first.
- Alternative package managers: Yarn, Pnpm
- These are possible but I'm not too keen on switching tools yet.
- Large-scale build orchestration: Nx, Bit, Rush, Turborepo,
Lerna†- These feel too powerful for our project
* npm-run-all has been abandoned for some time. npm-run-all2 seems to be the most well-maintained fork.
† Since version 5, Lerna bundles and is powered by Nx, so there's little point in installing it for new projects--we should use Nx directly.