You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**What's the problem this PR addresses?**
The command default's behavior was "worktree" (ie to only run on the
current workspace and whatever it listed in its own `workspaces` field),
but it was rarely what users expected (since very few people use nested
workspace setups).
**How did you fix it?**
The main functional change is that one of `--all`, `--worktree`,
`--since`, or `--recursive` is now required. The `--since` flag doesn't
automatically imply `--worktree` anymore.
Using `--all` with one of `--worktree`, `--from`, `--since`, or
`--recursive` doesn't work anymore, since they have incompatible
meanings (it still accept `--include` and `--exclude` to further refine
the list).
**Checklist**
<!--- Don't worry if you miss something, chores are automatically
tested. -->
<!--- This checklist exists to help you remember doing the chores when
you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
<!-- See
https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released
for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check
-i` -->
- [x] I have set the packages that need to be released for my changes to
be effective.
<!-- The "Testing chores" workflow validates that your PR follows our
guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR
might be missing. -->
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ Features in `master` can be tried out by running `yarn set version from sources`
15
15
- Some important defaults have changed:
16
16
-`yarn set version` will prefer using `packageManager` rather than `yarnPath` when possible.
17
17
-`yarn init` will no longer use zero-install by default. You still can enable it, but it should make it easier to start one-of projects without having to rewrite the configuration afterwards.
18
+
-`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.
18
19
19
20
- All official Yarn plugins are now included by default in the bundle we provide. You no longer need to run `yarn plugin import` for *official* plugins (you still need to do it for third-party plugins, of course).
20
21
- This doesn't change anything to the plugin API we provide, which will keep being maintained.
Copy file name to clipboardExpand all lines: packages/docusaurus/docs/features/workspaces.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ To declare a workspace, all you have to do is add a `workspaces` array to the ro
49
49
50
50
Constraints are to monorepos what Eslint is to your source code. They let you declare rules that must apply to specific workspaces in your project. For example, you can use constraints to enforce that all dependencies in your project are synchronized, to prevent some dependencies from being used, or to enforce that some fields such as `license` or `engines.node` are properly set everywhere.
51
51
52
-
For more information and examples about constraints, check the [dedicated article](/).
52
+
For more information and examples about constraints, check the [dedicated article](/features/constraints).
53
53
54
54
### Cross-references
55
55
@@ -99,10 +99,10 @@ Global scripts are characterized by at least one colon (`:`) in the script name.
99
99
Scripts from multiple workspaces can be run in parallel if they share the same name, by using `yarn workspaces foreach`. The following example shows you how to publish all packages in your project in parallel, but respecting topological order (so that a workspace only gets published once all other workspaces it depends on did):
100
100
101
101
```
102
-
yarn workspaces foreach -pt npm publish
102
+
yarn workspaces foreach --all -pt npm publish
103
103
```
104
104
105
-
By default `yarn workspaces foreach`will run the commands on every workspace in the project, but it can be tweaked. In this example we use the `yarn workspaces foreach ! --since` flag to instead only select workspaces that were modified in the current branch compared to the [main branch](/):
105
+
The `yarn workspaces foreach ! --all` flag will run the provided command on every workspace in the project, but it can be tweaked. In this example we use the `yarn workspaces foreach ! --since` flag to instead only select workspaces that were modified in the current branch compared to the [main branch](/):
0 commit comments