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

[RRFC] include context that a module is overridden in npm ls #622

Closed
bnb opened this issue Aug 5, 2022 · 7 comments
Closed

[RRFC] include context that a module is overridden in npm ls #622

bnb opened this issue Aug 5, 2022 · 7 comments

Comments

@bnb
Copy link

bnb commented Aug 5, 2022

Motivation ("The Why")

I recently spoke with someone who was trying out overrides for the first time in their product and didn't have any signal as to whether or not an override was being applied.

In them showing me, it was explained that npm ls didn't tell them anything about overrides and that feels like a large missed opportunity.

Example

  • git clone https://github.com/bnb/repro-overrides-output
  • npm install
  • npm ls --depth=3
  • find "@types/prettier" which will show 2.6.0 without any indication that it was overridden.

How

Current Behaviour

When you npm ls, no overrides contextual information is shown.

Desired Behaviour

When you npm ls, note which modules were overridden as npm currently does with dedupes. Potentially also worth noting direct overrides vs. indirect overrides.

References

  • N/A
@ljharb
Copy link
Contributor

ljharb commented Aug 5, 2022

Does npm explain provide this context, at least?

@bnb
Copy link
Author

bnb commented Aug 5, 2022

as far as I can tell it doesn't. Here's a gist: https://gist.github.com/bnb/109d0429dd33824415e0671679ff46fb

@ljharb
Copy link
Contributor

ljharb commented Aug 5, 2022

While it seems like npm ls could be an RFC (a very necessary one that probably should have been part of overrides from the start), npm explain not showing that seems like a bug.

@ruyadorno
Copy link
Contributor

ruyadorno commented Aug 5, 2022

+1 to have some sort of info added to npm ls

not even sure if it needs a full RFC, probably useful to have a light RFC since it would be nice to have a few examples and set expectations on how things are supposed to look like / work (particularly the other visualization modes: parseable and json)

@bnb
Copy link
Author

bnb commented Aug 8, 2022

@darcyclarke any shot we can get this included in the next meeting?

@darcyclarke darcyclarke added the Agenda will be discussed at the Open RFC call label Aug 10, 2022
@nlf
Copy link
Contributor

nlf commented Aug 16, 2022

this work has been done here: npm/cli#5306

@bnb
Copy link
Author

bnb commented Aug 17, 2022

sick, tysm @nlf <3

I'm not sure if you're waiting to close this until it ships, but that does solve my request. I'll close this now but feel free to reopen if that's part of your workflow.

@bnb bnb closed this as completed Aug 17, 2022
@darcyclarke darcyclarke added ratify and removed Agenda will be discussed at the Open RFC call ratify labels Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants