Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 43 additions & 5 deletions src/schemas/json/pnpm-workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -1191,11 +1191,49 @@
"type": "boolean"
},
"registries": {
"description": "Configure registries for scoped packages in `pnpm-workspace.yaml`. The `default` key sets the main registry (equivalent to the `registry` `.npmrc` setting). Scoped keys configure registries for specific package scopes.",
"type": "object",
"additionalProperties": {
"type": "string"
}
"description": "Configures the registries packages resolve from, in one of two shapes. The declaration shape keys each registry by its URL and states everything about it in one place: which scopes and bare-specifier prefix are routed to it, how it lays out tarball URLs, and whether its abbreviated metadata carries the `time` field. The older shape maps the `default` registry and `@`-prefixed scopes straight to registry URLs. The two shapes cannot be mixed.\nhttps://pnpm.io/settings#registries",
"anyOf": [
{
"description": "Registries keyed by URL, each declaring the routes that reach it and how it serves packages.",
"type": "object",
"additionalProperties": {
"type": "object",
"description": "Declares one registry: the routes that reach it and how it serves packages.",
"properties": {
"scopes": {
"description": "The `@`-prefixed scopes routed to this registry. A bare `@` makes this the default registry — the one packages resolve from when no scope matches.",
"type": "array",
"items": {
"type": "string",
"pattern": "^@"
}
},
"prefix": {
"description": "The bare-specifier prefix this registry answers to, as in `pnpm add work:^1.0.0`.",
"type": "string"
},
"serverType": {
"description": "The software serving this registry: `npm` behaves like registry.npmjs.org, which serves a scoped package from the percent-encoded path as well as the unencoded one; `artifactory` repeats the scope in a scoped package's tarball filename.",
"type": "string",
"enum": ["npm", "artifactory"]
},
"supportsTimeField": {
"description": "Whether this registry's abbreviated metadata carries the `time` field. registry.npmjs.org does not; Verdaccio and several proxies do.",
"type": "boolean"
}
},
"additionalProperties": false
}
},
{
"description": "The older `scope: url` shape. The `default` key sets the main registry (equivalent to the `registry` `.npmrc` setting); each other key routes a scope to a registry URL.",
"type": "object",
"additionalProperties": {
"type": "string",
"format": "uri"
}
}
]
},
"namedRegistries": {
"description": "Defines named registry aliases that can be used as a prefix when installing packages, e.g. `pnpm add work:@corp/lib@^2.0.0` resolves `@corp/lib@^2.0.0` against the configured URL. Built-in aliases `gh:` (https://npm.pkg.github.com/) and `npmjs:` (https://registry.npmjs.org/) work without any configuration and can be overridden. An alias must start with a letter and contain only letters, digits, `.`, `_`, and `-`. Added in pnpm 11.1.0.",
Expand Down
11 changes: 11 additions & 0 deletions src/test/pnpm-workspace/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ namedRegistries:
gh: https://npm.pkg.github.example.com/
work: https://npm.work.example.com/

# https://pnpm.io/settings#registries
registries:
https://npm.work.example.com/:
prefix: work
supportsTimeField: true
https://npm.artifactory.example.com/:
scopes:
- '@example'
- '@'
serverType: artifactory

# https://pnpm.io/settings/node-modules#virtualstoretype
virtualStoreType: global

Expand Down