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
41 changes: 41 additions & 0 deletions src/schemas/json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,33 @@
"description": "What action to take if validation fails"
}
}
},
"runtimeEngineDependency": {
"description": "Specifies a supported JavaScript runtime.",
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

should this mention that runtime management is currently only supported by pnpm?

"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "The runtime name"
},
"version": {
"type": "string",
"description": "The version range for the runtime"
},
"onFail": {
"type": "string",
"enum": [
"ignore",
"warn",
"error",
"download"
],
"description": "What action to take if runtime validation fails"
}
}
}
},
"type": "object",
Expand Down Expand Up @@ -811,6 +838,20 @@
"properties": {
"node": {
"type": "string"
},
"runtime": {
"oneOf": [
{
"$ref": "#/definitions/runtimeEngineDependency"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/runtimeEngineDependency"
}
}
],
"description": "Specifies which JavaScript runtimes (like Node.js, Deno, Bun) are supported. Values should use WinterCG Runtime Keys (see https://runtime-keys.proposal.wintercg.org/)."
}
},
"additionalProperties": {
Expand Down
14 changes: 14 additions & 0 deletions src/test/package/pnpm-fields.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"$schema": "../../schemas/json/package.json",
"engines": {
"runtime": [
{
"name": "deno",
"onFail": "warn",
"version": "^2.0.0"
},
{
"name": "node",
"onFail": "download",
"version": ">=24"
}
]
},
"name": "pnpm-fields",
"pnpm": {
"allowNonAppliedPatches": true,
Expand Down
Loading