yarnpkg / yarnpkg/berry

[Feature] Earlier dependency cycles check in `foreach`

Open
#830 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.