Skip to content

Include peerDependencies in forEach #6856

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stevecrozz
Copy link

What's the problem this PR addresses?

Address missing dependencies when using foreach --topological with peerDependencies.

It is my understanding that a peer dependency is no less of a dependency than a regular one. Workspace seems to be supported in peer dependencies, so I believe we should support them in foreach.

Resolves #3594

...

How did you fix it?

This change should allow us to include peerDependencies when using foreach --topological.

...

Checklist

I have read this, but I'm going to pause here for feedback before I pour more energy into docs, tests, etc.

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@arcanis
Copy link
Member

arcanis commented Jul 22, 2025

That's a breaking change, since it'll break any project where two workspaces have peer dependencies on one another (and more generally it'll change the iteration order in hard-to-predict ways).

@stevecrozz stevecrozz force-pushed the foreach-include-peer-dependencies branch from 0336d01 to b9cd734 Compare July 22, 2025 20:59
@stevecrozz
Copy link
Author

That's a breaking change, since it'll break any project where two workspaces have peer dependencies on one another (and more generally it'll change the iteration order in hard-to-predict ways).

I don't understand the two workspaces scenario you pose. Isn't it the same as two workspaces that have regular dependencies on one another? But either way, I agree that it will be a breaking change for anyone who relied on the current behavior of not traversing peer dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Add an option --topological-peer for worspace foreach
2 participants