Skip to content

Conversation

@ijlee2
Copy link
Owner

@ijlee2 ijlee2 commented Dec 15, 2025

Why?

By specifying repository.directory, we can redirect people from a package's npm page to the correct file location in this monorepo.

https://docs.npmjs.com/cli/v11/configuring-npm/package-json#repository

If the package.json for your package is not in the root directory (for example if it is part of a monorepo), you can specify the directory in which it lives:

{
  "repository": {
    "type": "git",
    "url": "git+https://github.com/npm/cli.git",
    "directory": "workspaces/libnpmpublish"
  }
}

@ijlee2 ijlee2 added the enhance: documentation Issue asks for better documentation (e.g. README, code, tests) label Dec 15, 2025
@ijlee2 ijlee2 marked this pull request as ready for review December 15, 2025 05:50
@ijlee2 ijlee2 merged commit dbe7306 into main Dec 15, 2025
3 checks passed
@ijlee2 ijlee2 deleted the add-repository-directory branch December 15, 2025 05:51
@ijlee2 ijlee2 mentioned this pull request Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhance: documentation Issue asks for better documentation (e.g. README, code, tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant