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

[Bug?]: yarn 4.x yarn workspaces foreach does not take --all by default #5817

Closed
1 task done
indooorsman opened this issue Oct 23, 2023 · 2 comments · Fixed by #5784
Closed
1 task done

[Bug?]: yarn 4.x yarn workspaces foreach does not take --all by default #5817

indooorsman opened this issue Oct 23, 2023 · 2 comments · Fixed by #5784
Labels
bug Something isn't working

Comments

@indooorsman
Copy link
Contributor

Self-service

  • I'd be willing to implement a fix

Describe the bug

Per information in https://yarnpkg.com/cli/workspaces/foreach#options :

If -A,--all is set, Yarn will run the command on all the workspaces of a project. This is the default behavior.

But in fact yarn 4.x would throw error by running yarn workspaces foreach run build :

$ yarn workspaces foreach run build
Usage Error: Invalid option schema: missing at least one property from "all", "recursive", "since", or "worktree"

To reproduce

In any workpace with yarn 4.x:

$ yarn workspaces foreach run build
Usage Error: Invalid option schema: missing at least one property from "all", "recursive", "since", or "worktree"

Environment

System:
    OS: macOS 13.2.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  Binaries:
    Node: 20.8.0 - /private/var/folders/qd/qpdt2c0s2yn3cgyy8zww0w240000gn/T/xfs-38e424bb/node
    Yarn: 4.0.0 - /private/var/folders/qd/qpdt2c0s2yn3cgyy8zww0w240000gn/T/xfs-38e424bb/yarn
    npm: 10.1.0 - ~/Library/Caches/fnm_multishells/14343_1698027514115/bin/npm

Additional context

No response

@indooorsman indooorsman added the bug Something isn't working label Oct 23, 2023
@indooorsman
Copy link
Contributor Author

Just open a pull request for this issue: #5818

@wojtekmaj
Copy link
Contributor

This is actually a doc issue. In CHANGELOG.md, we can read:

yarn workspaces foreach now requires one of --all, --recursive, --since, or --worktree to be explicitly specified; the previous default was --worktree, but it was rarely what users expected.

arcanis added a commit that referenced this issue Oct 23, 2023
**What's the problem this PR addresses?**

In preparation for the 4.0 release, this diff adds a blog section to the
website, port the old article, and amorce the writing of the 4.0 release
post.

Fixes #5817
Fixes #5818
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants