berry
berry copied to clipboard
[Bug?]: `yarn workspaces list` shows folder names, not workspace names
Self-service
- [X] I'd be willing to implement a fix
Describe the bug
Given a yarn workspace setup where the package names are different from the folder's they are in
When a user enters the yarn workspaces list
command
Then we expect the workspace names to be returned.
Actual result: the folder names are returned.
To reproduce
- Create a new yarn project following these instructions https://classic.yarnpkg.com/lang/en/docs/workspaces/
- In the
workspace-a
folder, modify thename
property of the package.json file to: "a-workspace" - At the command prompt enter:
yarn workspaces list
Expected result: a-workspace workspace-b
Actual result: workspace-a workspace b
Environment
System:
1. Zorin OS 16 (5.13.0-52-generic 20.04.1-Ubuntu)
2. Windows 10.0.19044
Binaries:
machine: /home/xxx/.nvm/versions/node/v16.13.0/bin/yarn version 1.22.15
project: <proj folder>/.yarn/yarn-3.2.1.cjs
Additional context
No response
you probably need to run yarn
at the root for these changes to take effect.
Also, isn't this yarn1.x
? https://github.com/yarnpkg/yarn/issues
Looks like only yarn berry (2.x) issues are tracked here
Also, isn't this
yarn1.x
? https://github.com/yarnpkg/yarn/issues Looks like only yarn berry (2.x) issues are tracked here
No, as you can see I'm running yarn CLI 1.22.15 globally but using 3.2.1 for the project.
you probably need to run
yarn
at the root for these changes to take effect.
This doesn't change the behavior.
Hi! 👋
This issue looks stale, and doesn't feature the reproducible
label - which implies that you didn't provide a working reproduction using Sherlock. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it or you edit your first post to include a formal reproduction (you can use the playground for that).
Note that we require Sherlock reproductions for long-lived issues (rather than standalone git repositories or similar) because we're a small team. Sherlock gives us the ability to check which bugs are still affecting the master branch at any given point, and decreases the amount of code we need to run on our own machines (thus leading to faster bug resolutions). It helps us help you! 😃
If you absolutely cannot reproduce a bug on Sherlock (for example because it's a Windows-only issue), a maintainer will have to manually add the upholded
label. Thanks for helping us triaging our repository! 🌟
This is still the issue.
For comparison -- when you run yarn workspaces list --json
, you get the list of JSON objects with location
and name
, for example {"location":"packages/backend", "name": "@org/secret-project"}
.
But when you run yarn workspaces list
, you don't get:
@org/secret-project
You get:
packages/backend
IMO this is wrong, because all the yarn commands that acknowledge the concept of workspaces work on their names, not locations. And the need of using --json
output (which BTW is not a valid JSON), just to get the names of the workspaces feels wrong. Names should be the default output of yarn workspaces list
.