Skip to content

[DOCS] package.json#repository should clarify normalization steps and future plans. #7299

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

My repo's package.json file has a "repository" field set to "JoshuaKGoldberg/emojipedia" as a shorthand. npm publish still works, but gives this complaint:

ERROR npm WARN publish npm auto-corrected some errors in your package.json when publishing.  Please run "npm pkg fix" to address these errors.
npm WARN publish errors corrected:
npm WARN publish "repository" was changed from a string to an object
npm WARN publish "repository.url" was normalized to "git+https://github.com/JoshuaKGoldberg/emojipedia.git"

https://github.com/JoshuaKGoldberg/emojipedia/blob/7b67fe1986852fb271c2eab59fe536ee3476322f/package.json#L5

Expected Behavior

Per npm/npm#3783 -> https://docs.npmjs.com/cli/v10/configuring-npm/package-json#repository, using a repository shorthand like "JoshuaKGoldberg/emojipedia" should be allowed.

Steps To Reproduce

  1. Create a project whose package.json's "repository" value is a GitHub string shorthand
  2. npm publish

Environment

  • npm: 10.2.4 and 10.5.0
  • Node.js: v20.11.0
  • OS Name: macOS
  • System Model Name: Mac Studio
  • npm config:
//registry.npmjs.org/:_authToken = (protected) 
provenance = true

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingDocumentationdocumentation related issuePriority 2secondary priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions