website icon indicating copy to clipboard operation
website copied to clipboard

Clarify what' yarn ls' is showing

Open swang opened this issue 9 years ago • 6 comments
trafficstars

Reposting from yarnkpkg/yarn

yarn ls has no clear documentation. I would like to add some but it I want to be clear what is going on.

modules From the screenshot, it looks like zip-stream requires a versioning of lodash@~3.2.0 in grey, while the bolded [email protected] is the actual version of lodash that was installed.

But.. looking into the code, the grey/"dim" npm modules that don't have a bold equivalent (ex: compress-commons) means that they have been hoisted up to the main node_modules/ folder. So anything that is bolded, is actually dependencies that yarn decided it couldn't hoist out to the main folder. Is this mostly correct? Is there something else that should be known in the documentation?

swang avatar Oct 14 '16 21:10 swang

It's also not clear what yarn ls --depth 0 is showing. I would expect it to list the same dependencies seen in package.json, but it lists many more. I suspect it's listing nested dependencies which got flattened to the top level, even though they are not top-level dependencies. This behavior should be documented.

markstos avatar Dec 06 '16 15:12 markstos

This should be re-opened, it's still not clear what yarn list --depth 0 is showing. See: https://github.com/yarnpkg/website/pull/251#pullrequestreview-75150705

markstos avatar Nov 08 '17 16:11 markstos

@markstos I'll provide a detail explanation of what is being displayed here later today.

olingern avatar Nov 08 '17 17:11 olingern

I suspect it's listing nested dependencies which got flattened to the top level, even though they are not top-level dependencies.

@markstos At a glance from the work a year ago, this seems to be correct. I implemented the depth relative to the existing tree output that @kittens had put together, and not something that mirrors npm.

If there's a desire to mirror npm, perhaps, that conversation is better moved to an RFC.

cc: @BYK @bestander

olingern avatar Nov 10 '17 03:11 olingern

@olingern It does seem like yarn list --depth 0 is showing flattened dependencies. I guess if you want the un-flattened dependencies, you can just open up package.json. If the current behavior is considered desired, then appropriate mentions of flattening should be added to the yarn list docs.

markstos avatar Nov 10 '17 15:11 markstos

@markstos package.json doesn't actually show you what's installed, though.

What does bold mean in the yarn ls output?

hgezim avatar Dec 29 '20 22:12 hgezim