Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
- After a subsequent search, I found also related [BUG] npm pkg fix repository.url updates don't match documentation #6891
This is a CLI Docs Problem, not another kind of Docs Problem.
- This is a CLI Docs Problem.
Description of Problem
The Repository documentation example shows:
{
"repository": {
"type": "git",
"url": "https://github.com/npm/cli.git"
}
}
- PR fix: update repository.url in package.json #7418 changed many urls from
https
togit+https
includingLine 30 in 2273183
The same section (Repository) also shows a similar example:
{
"repository": {
"type": "git",
"url": "https://github.com/facebook/react.git",
"directory": "packages/react-dom"
}
}
npm pkg fix
changes the protocol fromhttps
togit+https
If npm pkg fix
is set up so that https
is not accepted as correct, then no examples should be showing https
.
The Repository section should provide examples:
- which are not found to be invalid by
npm pkg fix
- are consistent with the live contents of any example repo it refers to.
Potential Solution
Change to
"url": "git+https://github.com/npm/cli.git"
Instead of the (incorrect?) Facebook example (using only https
) use one of the npm/cli examples with a directory. For example
"repository": {
"type": "git",
"url": "git+https://github.com/npm/cli.git",
"directory": "workspaces/libnpmpublish"
},
Affected URL
https://docs.npmjs.com/cli/v10/configuring-npm/package-json#repository