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
This inconsistency becomes more confusing when comparing with yarn workspaces foreach, which has different behavior depending on whether --since is used with --recursive:
When both --recursive and --since are set in yarn workspaces foreach, it traverses dependents (like yarn workspaces list). But when only --recursive is set, it traverses dependencies instead.
This can be misleading for yarn newcomers(I am) who expect consistent behavior across commands. We should improve consistency and documentation to clearly reflect the actual behavior of each command.
While looking for previous discussions, I noticed this was mentioned in a yarn v4 issue, but I couldn't find any follow-up PRs or resolution.
It would be helpful to either update the documentation to correctly reflect the current behavior, or adjust the implementation to match the documented behavior.
The text was updated successfully, but these errors were encountered:
WooWan
changed the title
[Docs] Discrepency yarn workspaces list between docs and behaivor
[Docs] Inconsistency in yarn workspaces list --recursive documentation vs. actual behavior
Mar 7, 2025
According to the documentation, --recursive option is described as:
Find packages via dependencies/devDependencies instead of using the workspaces field
However, based on code examination, it actually lists package dependents (packages that depend on the workspace), not its dependencies:
berry/packages/plugin-essentials/sources/commands/workspaces/list.ts
Lines 63 to 66 in 3c8a90a
This inconsistency becomes more confusing when comparing with yarn workspaces foreach, which has different behavior depending on whether
--since
is used with--recursive
:berry/packages/plugin-workspace-tools/sources/commands/foreach.ts
Lines 200 to 207 in 3c8a90a
When both
--recursive
and--since
are set in yarn workspaces foreach, it traverses dependents (like yarn workspaces list). But when only --recursive is set, it traverses dependencies instead.This can be misleading for yarn newcomers(I am) who expect consistent behavior across commands. We should improve consistency and documentation to clearly reflect the actual behavior of each command.
While looking for previous discussions, I noticed this was mentioned in a yarn v4 issue, but I couldn't find any follow-up PRs or resolution.
It would be helpful to either update the documentation to correctly reflect the current behavior, or adjust the implementation to match the documented behavior.
The text was updated successfully, but these errors were encountered: