lazyrepo is a zero-config caching task runner for npm/pnpm/yarn monorepos.
It fits right into the niche that turborepo carved out: making package.json "scripts" scale without adopting a big industrial-strength build system like nx, bazel, rush, or buck.
lazyrepo is scary fast, despite being written in TypeScript rather than some young handsome clever funny systems language.
Aside from perf, lazyrepo comes with some big quality-of-life improvements:
A human-friendly config format.
Concise and timely feedback to help you tweak and debug your build pipelines.
You can pass arguments to the task script after a --
lazy run test -- --runInBand
The default behavior is optimized for "test" scripts, where the order of execution matters if your packages depend on each other.
Let’s say you have three packages: core, utils, and primitives. The core package depends on both utils and primitives, and they all have "test" scripts in their package.json files.
With no config, when you run lazy run test in the project root:
The tests for utils and primitives will begin concurrently. The tests for core will only be started if both utils and primitives finish successfully.
If you change a source file in core and run lazy run test again, only core's tests will be executed.
If you change a source file in utils and run lazy run test again, both utils and core's tests will be executed, in that order.
You can create lazy.config.ts file by running the below command in your project’s root folder.
lazy init
This will automatically create the lazy.config.ts file with the default configuration shown below:
export default { scripts: { test: { cache: { // by default we consider all files in the package directory inputs: ['**/*'], // there are no outputs outputs: [], // a test invocation depends on the input files of any upstream packages inheritsInputFromDependencies: true, }, }, },}