Commit 55639ef
authored
docs: use git+https in package.com url examples (#7615)
- closes #7614
## Issue
Examples in the
[repository](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#repository)
section of the [npm CI > Configuring npm >
package.json](https://docs.npmjs.com/cli/v10/configuring-npm/package-json)
reference page use the protocol `https`. The examples are:
```json
"url": "https://github.com/npm/cli.git"
```
```json
"url": "https://github.com/facebook/react.git"
```
Executing `npm pkg fix` in a repo with a `url` definition and `protocol`
using `https` normalizes the protocol to `git+https`.
Examples should be aligned with what `npm pkg fix` considers correct and
should also be aligned to the list of valid protocols in the [Git URLs
as
Dependencies](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#git-urls-as-dependencies)
section, which states:
> `<protocol>` is one of `git`, `git+ssh`, `git+http`, `git+https`, or
`git+file`.
## Change
1. `npm/cli.git`
Change to
```json
"url": "git+https://github.com/npm/cli.git"
```
2. `facebook/react.git`
Since the source example of
https://github.com/facebook/react/blob/main/packages/react-dom/package.json
does not use the correct `git+https` protocol, use instead
```json
"url": "git+https://github.com/npm/cli.git",
"directory": "workspaces/libnpmpublish"
```1 parent 2273183 commit 55639ef
1 file changed
+9
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
| 370 | + | |
371 | 371 | | |
372 | | - | |
| 372 | + | |
373 | 373 | | |
374 | | - | |
| 374 | + | |
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
389 | | - | |
| 388 | + | |
| 389 | + | |
390 | 390 | | |
391 | | - | |
| 391 | + | |
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
521 | | - | |
| 521 | + | |
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
| |||
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
556 | | - | |
557 | | - | |
| 556 | + | |
| 557 | + | |
558 | 558 | | |
559 | 559 | | |
560 | 560 | | |
| |||
0 commit comments