berry icon indicating copy to clipboard operation
berry copied to clipboard

[Feature] Add support to list only production dependencies

Open hpedrorodrigues opened this issue 4 years ago • 3 comments

  • [x] I'd be willing to implement this feature (contributing guide)
  • [x] This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

As a developer, I'd like to list only production dependencies.

Describe the solution you'd like

I've thought I could use some flag from command info, but it doesn't have any flag for this.

We can add a new flag, something like --production, to the command info.

Describe the drawbacks of your solution

No drawbacks.

Describe alternatives you've considered

I think it doesn't make sense as a plugin because it would be mostly duplicated code.

Additional Comments:

Idk if I'm missing something here, so please let me know.

If you think this feature makes sense, I can start working on the PR.

hpedrorodrigues avatar Jun 02 '21 21:06 hpedrorodrigues

+1 I am trying to find this feature. I'm comparing Yarn v1 yarn list --production with yarn info, but it's hard to filter what's production and what's not.

kinow avatar Dec 04 '21 05:12 kinow

This is how my current workaround looks like:

  1. Delete nodules_modules directory
  2. Remove devDependencies property from package.json.
  3. Install dependencies, via yarn install --immutable-cache
  4. Print all dependencies, via yarn info -A --recursive --json > product.dependencies.json

I am open for better ideas, of course ;)

benjaminr-ps avatar Oct 18 '22 07:10 benjaminr-ps

https://github.com/yarnpkg/berry/issues/5117 is a dupe of this.

neoncube2 avatar Apr 25 '25 07:04 neoncube2