yarnpkg / berry

📦🐈 Active development trunk for Yarn ⚒
https://yarnpkg.com
BSD 2-Clause "Simplified" License
7.42k stars 1.11k forks source link

[Feature] Add support to list only production dependencies #2976

Open hpedrorodrigues opened 3 years ago

hpedrorodrigues commented 3 years ago

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.

kinow commented 2 years ago

+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.

benjaminr-ps commented 2 years ago

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 ;)