Skip to content

[DOCS] Inconsistent package.json repository example use of https and git+https #7614

Closed
@MikeMcC399

Description

@MikeMcC399

Is there an existing issue for this?

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"
  }
}

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 from https to git+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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Documentationdocumentation related issueNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions