Hello, I’m looking into creating a Lerna project and I’m looking a lot at the Aurelia 2 project for arranging my own project. I want to move Aurelia-Slickgrid as a package, and move all the common code into a Common package and finally an Aurelia demo as a 3rd and last package.
So in short, the packages have to be executed in the following order
- build Common into a
dist
folder with"main": "dist/es2020/index"
set in thepackage.json
- build Aurelia package with again
main
configured similar to step 1 - finally run the Dev demo (but only after step 1 and 2 are ready or have dist code)
In other words, if C requires B and B requires A, it should build A then build B then C.
If I look at Aurelia 2 setup with Lerna, the script to run Dev with a Watch is on this line, the argument --parallel
is used
"scripts": {
"dev": "lerna run dev --parallel"
}
then if I go in any of the packages under Aurelia, for example the aurelia
package, they have few dependencies that are packages, like this (most of the Aurelia packages follow the same pattern)
"scripts": {
"dev": "tsc -b -w"
},
"dependencies": {
"@aurelia/debug": "0.6.0",
"@aurelia/fetch-client": "0.6.0",
}
but in Lerna docs, they mention that the Parallel flag doesn’t follow any order…
Similar to
--stream
, but completely disregards concurrency and topological sorting, running a given command or script immediately in all matching packages with prefixed streaming output. This is the preferred flag for long-running processes such asbabel src -d lib -w
run over many packages.
So my question is this, how can the Aurelia 2 project even work with the Dev setup when the Parallel flag completely ignores the order of the packages?
If I run the npm run dev
the first time, I get an error saying that the Common package is not found because the Aurelia package tries to use it without waiting or caring about the dependencies order… now of course if I run it the command a second time, it’s all good but it’s not exactly good for other users who might want to contribute to my project. Isn’t Aurelia 2 having the same issue?