[Feature] Earlier dependency cycles check in `foreach`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 8.1k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the user story
I'm publishing the Yarn packages, and I noticed that the publishing aborted midway because of a (valid) dependency cycle between plugin-node-modules and yarnpkg-cli (some deps in the plugin should have been peer deps). It's not ideal, because it means that the releases may be half-published.
Describe the solution you'd like
The yarn workspaces foreach command should make a first quick sanity check to ensure that there is no dependency cycle given the command arguments.
Describe the drawbacks of your solution
It adds a bit of delay before the commands run, but I think it's acceptable to assume that foreach will be somewhat slow anyway.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the implementation of the Yarn workspaces foreach command and reading how its command arguments determine the workspace set and dependency graph. Add a preflight cycle check that runs before any foreach commands execute; done means a cycle is rejected early rather than allowing a partial publish.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100