Skip to content

yarn list show dependencies of all packages in the workspace #5174

Open

Description

@simonrelet

Do you want to request a feature or report a bug?

Bug, I think.

What is the current behavior?

When you run yarn list, yarn list --production, or NODE_ENV=production yarn list (not sure which one is recommended BTW) in a package, the output is the list of dependencies of all the packages in the workspace.

If the current behavior is a bug, please provide the steps to reproduce.

Github sample: https://github.com/simonrelet/yarn-workspace-issue
In a terminal run:

git clone https://github.com/simonrelet/yarn-workspace-issue
cd yarn-workspace-issue
yarn install
cd packages/ccc
yarn list

Output:

yarn list v1.3.2
warning package.json: No license field
├─ [email protected]
│  └─ chalk@^2.3.0
├─ [email protected]
│  └─ color-convert@^1.9.0
├─ [email protected]
│  └─ fs-extra@^5.0.0
├─ [email protected]
├─ [email protected]
│  ├─ ansi-styles@^3.1.0
│  ├─ escape-string-regexp@^1.0.5
│  └─ supports-color@^4.0.0
├─ [email protected]
│  └─ color-name@^1.1.1
├─ [email protected]
├─ [email protected]
├─ [email protected]
│  ├─ graceful-fs@^4.1.2
│  ├─ jsonfile@^4.0.0
│  └─ universalify@^0.1.0
├─ [email protected]
├─ [email protected]
├─ [email protected]
│  └─ graceful-fs@^4.1.6
├─ [email protected]
│  └─ has-flag@^2.0.0
└─ [email protected]

What is the expected behavior?

I would expect yarn to list the dependencies of the current package.

Output:

yarn list v1.3.2

Please mention your node.js, yarn and operating system version.

Node: 9.3.0
Yarn: 1.3.2
OS: OS X 10.12.6

Activity

  1. bestander commented on Jan 8, 2018

    @bestander
    Member

    Should be covered by yarnpkg/rfcs#83.
    Your participation is welcome.

  2. simonrelet commented on Feb 15, 2018

    @simonrelet
    Author

    Sorry for the late answer, I'll have a look at the RFC.
    Thank you!

  3. NickHeiner commented on Mar 27, 2019

    @NickHeiner

    I would also like the ability to run yarn list on a single workspace. It appears that the workspace docs are inaccurate.

    image

    yarn list and yarn workspace package-name list produce the same output, even when truly running yarn list in package-name would produce different output.

  4. chaitan94 commented on Oct 6, 2019

    @chaitan94

    I went through the code and I feel that the ideal way to implement this would be to have separate lockfiles for each workspace package. In other words, I would say that #5428 needs to be solved before this can be tackled (without complicating it too much).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions