-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: add fix method #43
Conversation
typo fix commit is in this PR 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.
Looks good. Left some minor non-blocking comments.
'devDependencies', | ||
'scriptpath', | ||
]) | ||
|
||
static prepareSteps = Object.freeze([ |
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 would be good to have a comment that prepare
's behavior is well-defined at this point and shouldn't grow or change beyond bug fixes.
}), | ||
}) | ||
const { content } = await PackageJson.fix(path) | ||
t.strictSame(content.name, '@npmcli/test-package') |
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.
Consider adding a fix then prepare
test and confirming prepare
is a noop with regard to fixed fields.
t.strictSame(content.version, '1.0.0') | ||
t.strictSame(content.bin, { 'test-package': '@npmcli/test-package' }) | ||
t.strictSame(content.dependencies, { lodash: '' }) | ||
t.strictSame(content.repository, { type: 'git', url: 'github.com/npm/test-package' }) |
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'm probably opening a big can of worms, but should the repository url be prefixed with https://
or git+https://
?
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's a https://github.com/npm/hosted-git-info/ problem
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.
if (hosted) {
r = data.repository.url
= hosted.getDefaultRepresentation() === 'shortcut' ? hosted.https() : hosted.toString()
}
We rely on that module to know if this was a "shortcut" or not, and change our representation accordingly.
No description provided.