-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix: remove lib/utils/read-package-name.js #4757
Conversation
c7b8b71
to
6f2b996
Compare
no statistically significant performance changes detected timing results
|
lib/commands/diff.js
Outdated
@@ -7,6 +7,7 @@ const pacote = require('pacote') | |||
const pickManifest = require('npm-pick-manifest') | |||
const log = require('../utils/log-shim') | |||
const readPackageName = require('../utils/read-package-name.js') |
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.
It seems like this is used a few other places in this file. Can it be removed from those too?
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 thought i got them all. It's very concerning that tests still pass 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.
also i think the actual util file didn't get deleted, only the test
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 why we review. Removed.
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.
at least that explains why the tests passed previously 😅
This code wasn't doing anything special, just dereferencing `name` from a packument. There is no need for this to exist. Most of the tests were able to handle having this go away, except for `npm owner` which had to have its tests rewritten to be real, which of course surfaced bugs along the way of behavior that was incorrectly being tested. `npm owner` needs some love to clean up its UX, it throws or returns inconsistently. I did fix it so that if there is no package.json in cwd it errored as expected instead of throwing `ENOENT` which is what it did before.
6f2b996
to
a2b0c94
Compare
This code wasn't doing anything special, just dereferencing
name
froma packument. There is no need for this to exist.
Most of the tests were able to handle having this go away, except for
npm owner
which had to have its tests rewritten to be real, which ofcourse surfaced bugs along the way of behavior that was incorrectly
being tested.
npm owner
needs some love to clean up its UX, it throwsor returns inconsistently. I did fix it so that if there is no
package.json in cwd it errored as expected instead of throwing
ENOENT
which is what it did before.