Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: yarn licenses generate-disclaimer wrong description #3797

Open
Narven opened this issue Jul 2, 2017 · 5 comments
Open

Documentation: yarn licenses generate-disclaimer wrong description #3797

Narven opened this issue Jul 2, 2017 · 5 comments

Comments

@Narven
Copy link

Narven commented Jul 2, 2017

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

What is the current behavior?
https://yarnpkg.com/en/docs/cli/licenses#toc-yarn-licenses-generate-disclaimer shows in the description:

Running this command will return a sorted list of licenses from all the packages you have installed to the stdout

If the current behavior is a bug, please provide the steps to reproduce.
Go to https://yarnpkg.com/en/docs/cli/licenses#toc-yarn-licenses-generate-disclaimer and read the description of the command.

What is the expected behavior?
It should read something like: It outputs license template to stdout or similar.

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

@nicobarray
Copy link
Contributor

Hi @Narven and @bestander! I would like to help on that, looks quick to fix. Yet I cannot understand where the documentation is falsy.

When running yarn licenses generate disclaimer it effectively outputs on stdout the list of all package licenses and the documentation says so.

Is the expected behaviour in your Issue is to group deps by licences OR just changing the wording of the documentation? (Although it looks like it says what it does).

Have a nice week-end!

@bestander
Copy link
Member

@nbarray, thanks for stepping in

@tibbes
Copy link

tibbes commented Aug 15, 2019

@nicobarray, @Narven, I'm not sure if this is what the original reporter had in mind, but the inaccuracy is the phrase "packages you have installed" (and a similar inaccuracy for the documentation of yarn licenses list, which says "packages that were installed by yarn or yarn install").

The problem is that if I do yarn install --prod, a subsequent yarn licenses list or yarn licenses generate-disclaimer includes all dependencies including dev-dependencies — so not the ones that were just installed. If I want to list just the production dependencies I can use the command yarn --prod true licenses list.

I don't think there is anything wrong with the current behaviour, but it is definitely independent of the modules that have actually been installed in node_modules.

@Sly777
Copy link

Sly777 commented Dec 3, 2019

Hey @nicobarray @Narven, I tested this feature on yarn as well but It still just exports all dependencies, not prod only.

yarn: 1.19.2
node: 12.12.0
macOSX

is there any way to get prod only packages for creating a license file? or @tibbes did you find another solution for this?

It was also related to this issue

@kinow
Copy link

kinow commented Dec 4, 2021

It's generating production licenses for me alright.

kinow@ranma:~/Development/java/jena/jena/jena-fuseki2/jena-fuseki-ui$ yarn licenses generate-disclaimer | wc -l
18871
kinow@ranma:~/Development/java/jena/jena/jena-fuseki2/jena-fuseki-ui$ yarn licenses generate-disclaimer --prod | wc -l
2095
kinow@ranma:~/Development/java/jena/jena/jena-fuseki2/jena-fuseki-ui$ yarn -version
1.22.5

I wish I had a parameter to specify the output file though, since I'm using a Maven plug-in that is capturing the command output, not giving me a way to redirect the output (i.e. > NOTICE doesn't work since the output is captured by the Maven plug-in). But that's a different issue.

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

No branches or pull requests

6 participants