yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.45k stars 2.73k forks source link

yarn licenses in package with workspaces provides dependencies of all packages in hierarchy #5300

Open scriptjs opened 6 years ago

scriptjs commented 6 years ago

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

What is the current behavior? Using yarn in lerna with workspaces to manage dependencies. Running the following

yarn licenses list

within a package in the monorepo, lists dependent packages of entire monorepo as opposed to dependencies of the package I am requesting license list from.

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

What is the expected behavior? The license list should contain only list dependents of the package requested.

Please mention your node.js, yarn and operating system version. node@8.9.4 yarn@1.3.2 macos@10.12.6

rally25rs commented 6 years ago

Confirmed. Even the command yarn workspace {package_name} licenses list prints unexpected results, and oddly includes licenses for other packages and a bogus "workspace-aggregator"

$ yarn workspace @my-org/my-package-1 licenses list

...output omitted...

└─ UNLICENSED
   ├─ @my-org/my-package-1@0.0.0
   ├─ @my-org/my-package-2@0.0.0
   └─ workspace-aggregator-ca77e394-2679-4c2b-a214-61f1cdcf3055@0.0.0
matzeeable commented 4 years ago

Any news on this? 🙂 I am currently creating a license checker for monorepos and can not continue because yarn licenses always returns all packages of complete monorepo.

konsalex commented 2 years ago

Any updates? Using workspaces with Lerna monorepo and cannot find an elegant way of solving this.

JosXa commented 2 years ago

Any news on this? 🙂 I am currently creating a license checker for monorepos and can not continue because yarn licenses always returns all packages of complete monorepo.

Hi @matzeeable, have you had any success looking into this? We appear to have the same problem here.

matzeeable commented 2 years ago

@JosXa unfortunately no :-(

JosXa commented 2 years ago

I'm wondering whether this is specifically a problem for yarn workspaces, or one that occurs with monorepos of all kind because the tooling can't handle it yet 🤔 Using yarn 3, the monorepo-license-checker also doesn't produce any more sane output. Clearly all those tools aren't able to resolve packages due to the hoisted node_modules in the repository root...

Bracciata commented 9 months ago

Has anybody discovered how to get around this?