Skip to content

Build and test all projects in the correct sequence following dependencies. #13722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
klemenoslaj opened this issue Feb 20, 2019 · 2 comments
Closed

Comments

@klemenoslaj
Copy link

klemenoslaj commented Feb 20, 2019

🚀 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.

@alan-agius4
Copy link
Collaborator

Duplicate of #11002

@alan-agius4 alan-agius4 marked this as a duplicate of #11002 Feb 20, 2019
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants