Skip to content
Open
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
49 changes: 49 additions & 0 deletions src/schemas/json/pnpm-workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,38 @@
"description": "Define dependency version ranges as reusable constants,\nfor later reference in package.json files.\nThis (singular) field creates a catalog named default.\n",
"type": "object",
"minProperties": 1
},
"packageConfig": {
"description": "Per-package pnpm configuration applied to workspace projects matched by package name or selector.",
"type": "object",
"additionalProperties": true,
"properties": {
"match": {
"description": "Workspace project names or selectors matched by this package configuration.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string"
}
},
"modulesDir": {
"description": "The directory in which dependencies will be installed.",
"type": "string"
},
"saveExact": {
"description": "Saved dependencies will be configured with an exact version rather than using pnpm's default semver range operator.",
"type": "boolean"
},
"savePrefix": {
"description": "Configure how versions of packages installed to a package.json file get prefixed.",
"oneOf": [
{
"type": "string",
"enum": ["^", "~", ""]
}
]
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}
},
"properties": {
Expand Down Expand Up @@ -136,6 +168,23 @@
},
"additionalProperties": false
},
"packageConfigs": {
"description": "Per-workspace-project pnpm settings that replace project-specific .npmrc files.",
"oneOf": [
{
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/packageConfig"
}
},
{
"type": "array",
"items": {
"$ref": "#/definitions/packageConfig"
}
}
]
},
"peerDependencyRules": {
"type": "object",
"properties": {
Expand Down
9 changes: 9 additions & 0 deletions src/test/pnpm-workspace/package-configs-array.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# yaml-language-server: $schema=../../schemas/json/pnpm-workspace.json
# https://pnpm.io/pnpm-workspace_yaml
packages:
- packages/*

packageConfigs:
- match: ['project-1', 'project-2']
modulesDir: node_modules
saveExact: true
6 changes: 6 additions & 0 deletions src/test/pnpm-workspace/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
packages:
- packages/*

packageConfigs:
project-1:
saveExact: true
project-2:
savePrefix: '~'

catalog:
chalk: ^4.1.2

Expand Down
Loading