Goal
Wish to know how with Lerna to run packages in sequential mode.
Approach
This is learn.json with its packages declaration:
{
"npmClient": "npm",
"npmClientArgs": [
"--registry",
"https://npm.foo.com"
],
"command": {
"publish": {
"ignoreChanges": [
"**/.spec.*",
"**/*.md",
"**/tsconfig*.*"
],
"registry": "https://npm.foo.com"
}
},
"packages": [
"packages/commands/*",
"packages/specs/*",
"packages/support/*",
"packages/tasks/*",
"packages/tools/*"
],
"version": "independent"
}
And in package.json, the following is a sampling of its scripts making lerna run
requests:
"audit": "lerna run audit --stream",
"build": "lerna run build --stream",
"clean": "lerna clean",
"postinstall": "lerna bootstrap",
"upgrade": "lerna run npm:upgrade --stream",
"test": "lerna run coverage --stream"
The goal is to modify the package.json script "test" so that lerna runs each of the packages' test sequentially over each of the packages and not in parallel.
And if possible, run tests in a specific order.
How should this "test"
script be modified?:
"test": "lerna run test --stream"
lerna run
does have a command option --parallel
, however, I am experiencing that without this option set, execution is happening asynchronously (parallel):
--parallel Run script with unlimited concurrency, streaming prefixed output.
lerna run --concurrency 1
Global Options:
--concurrency How many processes to use when lerna parallelizes tasks. [number] [default: 10]