This repo contains a monorepo built using lage. It contains two packages a
and b
. This utilizes npm workspaces
.
You can create a similar repo by executing the following command on your terminal:
npm init
npm init -w ./packages/a
npm init -w ./packages/b
npm install
npm install lage
npx lage init
lage
generates a default config file lage.config.js
which looks like the following:
module.exports = {
"pipeline": {
"build": ["^build"],
"test": ["build"],
"lint": []
}
};
Modify the package.json
to use lage scripts.
{
"name": "getting-started-with-lage",
"scripts": {
"build": "lage build",
"lint": "lage lint",
"test": "lage test"
},
"workspaces": [
"packages/a",
"packages/b"
]
}
Install Jest
to run the tests.
npm install --save-dev jest -w a
npm install --save-dev jest -w b
Now add some testable code within both packages. Invoking npm test
should now execute the the pipeline, and cache the results of the individual tasks.