yarn list show dependencies of all packages in the workspace

Created on 8 Jan 2018  ยท  4Comments  ยท  Source: yarnpkg/yarn

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

cat-feature good first issue help wanted triaged

Most helpful comment

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.

All 4 comments

Should be covered by https://github.com/yarnpkg/rfcs/pull/83.
Your participation is welcome.

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

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.

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 https://github.com/yarnpkg/yarn/issues/5428 needs to be solved before this can be tackled (without complicating it too much).

Was this page helpful?
0 / 5 - 0 ratings