Description
🚀 Feature request
Command (mark with an x
)
- [ ] new
- [x] build
- [ ] serve
- [x] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Description
Angular CLI nowadays supports multiple projects per single workspace. This was an important improvement, however, I am still missing a smarter build command that would build
all the projects in a correct sequence. And the same is applicable to test
command.
What does the correct sequence mean
Usually in a bigger monorepo workspaces developed packages can have dependencies on one another, which means that simple alphabetical order of build/test will not work.
Example
Libraries & dependencies
├── Library 1
│ ├── Library 3
├── Library 2
│ ├── Library 3
├── Library3
In the example above current sequence of ng test
would be Library 1 - Library 2 - Library 3
, but the correct sequence would be Library 3 - Library 1 - Library 2
Describe the solution you'd like
Every project in a workspace already contains package.json
(obviously). We could use peerDependencies
to declare the dependencies between projects of the workspace. Then build
and test
commands would be able to detect the dependencies and build the libraries in the correct sequence.
I have written myself a node executable that does exactly that. Follows the dependency tree and builds the libraries in the correct sequence.
If that is something you see as a valuable addition to Angular CLI I would be more than happy to contribute.
Describe alternatives you've considered
Currently, the only alternative is to write ng build
commands in an npm script, which is practically unmaintainable in bigger workspaces.