Skip to content
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

[Feature] topological from root #2046

Closed
xenoterracide opened this issue Oct 26, 2020 · 7 comments
Closed

[Feature] topological from root #2046

xenoterracide opened this issue Oct 26, 2020 · 7 comments
Labels
enhancement New feature or request waiting for feedback Will autoclose in a while unless more data are provided

Comments

@xenoterracide
Copy link

so my problem is that I have multiple applications in my workspaces, I don't necessarily want to build all of them and their full deps all the time. I tried yarn workspaces foreach --topological --include myworkspace run build but that only built myworkspace what I need is to be able to build myworkspace and all of its dependencies in topological order.

@xenoterracide xenoterracide added the enhancement New feature or request label Oct 26, 2020
@merceyz
Copy link
Member

merceyz commented Oct 26, 2020

You're most likely after #1986, which you can install using

yarn plugin import from sources workspace-tools

@xenoterracide
Copy link
Author

these do nothing

> yarn workspaces foreach --parallel --verbose --recursive --include @bb/service-graph run build 
yarn workspaces foreach --parallel --topological --verbose --recursive --include @bb/service-graph run build

@merceyz
Copy link
Member

merceyz commented Oct 26, 2020

--include is applied after the --recursive flag (implementation wise) so you're running include on the current workspace only, cd into the workspace and run it from there

yarn packages/service-graph/ workspaces foreach --parallel --topological --verbose --recursive run build

@xenoterracide
Copy link
Author

yeah, that works, a bit non obvious though, documentation examples should probably be added.

@arcanis arcanis added the waiting for feedback Will autoclose in a while unless more data are provided label Oct 27, 2020
@merceyz
Copy link
Member

merceyz commented Oct 27, 2020

PRs are welcome :)

@skoging
Copy link

skoging commented Nov 26, 2020

I have a similar issue.

I'm looking to transition away from using lerna, but I'm currently relying on the --include-dependencies flag.

Include all transitive dependencies when running a command regardless of --scope, --ignore, or --since.

I can currently emulate this somewhat using the yarn workspace project-web to scope the command:

yarn workspace project-web workspaces foreach --recursive --verbose --topological-dev run build

This does not work in the cases where I use wildcard/glob to target multiple projects and all their common dependencies.
Using yarn workspaces foreach --include project-* to run a recursive build in the projects will result in common dependencies being built multiple times, once per project, which is exactly what I want to avoid.

yarn workspaces foreach --include project-* workspaces foreach --recursive --verbose --topological-dev run build

@arcanis
Copy link
Member

arcanis commented Nov 26, 2020

to run a recursive build in the projects will result in common dependencies being built multiple times, once per project

That seems like a bug, can you open a new issue about that? I'll close this one since --recursive is the solution to the original problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request waiting for feedback Will autoclose in a while unless more data are provided
Projects
None yet
Development

No branches or pull requests

4 participants