You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
🚀 Feature request
Command (mark with an
x
)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 totest
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 beLibrary 1 - Library 2 - Library 3
, but the correct sequence would beLibrary 3 - Library 1 - Library 2
Describe the solution you'd like
Every project in a workspace already contains
package.json
(obviously). We could usepeerDependencies
to declare the dependencies between projects of the workspace. Thenbuild
andtest
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.The text was updated successfully, but these errors were encountered: