-
Notifications
You must be signed in to change notification settings - Fork 240
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
rfc: Don't add metadata to package.json #38
Conversation
a73f413
to
c35c78b
Compare
|
||
## Motivation | ||
|
||
These fields are only relevant to npm, and as of version 6, npm relies on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect; the requiredBy
field has been incredibly invaluable when debugging dep graph issues. Could we find a way to have a simple answer to "what package(s) required package x"?
Perhaps a v6 minor that adds a CLI command that can show this info; then you could change the behind the scenes source of that info without breaking anyone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack! I forgot _requiredBy
, yeah, that's one of the most interesting ones. I'll get to it tomorrow.
Could we find a way to have a simple answer to "what package(s) required package x"?
How would that differ from npm ls x
today?
And don't worry, there is no way we're gonna land this before v7, it's definitely a breaking change :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you're suggesting something where you can specify a single instance of a package folder in the tree, and it'd show all the cases where a dependency deduped to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like what I'm asking for - essentially, I want the answer to the question "why is this dependency here".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated this PR to include _requiredBy
and note the intention to create npm ls <location>
, where <location>
can be either a logical path, like /tap/react
or a physical path like ./node_modules/tap/node_modules/react
.
c35c78b
to
90613e9
Compare
Edit: add note about _requiredBy and `npm ls <location>`, prompted by @ljharb in #38 (comment)
90613e9
to
5bac23c
Compare
Edit: add note about _requiredBy and `npm ls <location>`, prompted by @ljharb in #38 (comment) Edit: add _shrinkwrap field.
5bac23c
to
d9615e5
Compare
@isaacs When is this expected to land in npm? It will break |
#38 (comment) Finish the sentence that was incompl
@vweevers npm version 7 will have this change. It's breaking, for the reason you mention, basically -- anything depending on those fields, including Time-wise, probably some time around end of year? Still a bit hard to say. |
Could npm, via The RFC states "These fields are only relevant to npm". However, tools like |
@vweevers Exposing .arborist-metadata.json data to lifecycle scripts is a good idea. For what it's worth, relying on some of those fields is really hazardous. They can be misleading, incorrect, or missing, even in normal operations. (And they're always missing for users who use yarn or pnpm.) |
@isaacs Great! How do we achieve that? Us prebuild folks are willing to help (if you could give us some pointers on where to start, i.e. how do we get the metadata to
Roger. |
Lol, ok, great. Well, I've warned you about the hazards so my conscience is clear, but it sounds like you're aware.
Let's start in this repo with a short RFC that references this one. tl;dr would be: when running any lifecycle script for package Is |
We currently use
In order to answer question 1, we currently detect the absence of For question 2, exposing /cc @lovell Could you confirm we're not using any other fields? I did a search across |
I think the absence of |
SGTM! |
|
@lovell I scanned |
No description provided.