Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
264 changes: 21 additions & 243 deletions doc/node-config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,12 @@
}
]
},
"allow-inspector": {
"type": "boolean"
},
"allow-net": {
"type": "boolean"
},
"allow-wasi": {
"type": "boolean"
},
"allow-worker": {
"type": "boolean"
},
"async-context-frame": {
"type": "boolean"
},
"conditions": {
"oneOf": [
{
Expand Down Expand Up @@ -133,15 +124,30 @@
"experimental-addon-modules": {
"type": "boolean"
},
"experimental-async-context-frame": {
"type": "boolean"
},
"experimental-default-type": {
"type": "string"
},
"experimental-detect-module": {
"type": "boolean"
},
"experimental-eventsource": {
"type": "boolean"
},
"experimental-fetch": {
"type": "boolean"
},
"experimental-global-customevent": {
"type": "boolean"
},
"experimental-global-navigator": {
"type": "boolean"
},
"experimental-global-webcrypto": {
"type": "boolean"
},
"experimental-import-meta-resolve": {
"type": "boolean"
},
Expand All @@ -162,9 +168,6 @@
"experimental-print-required-tla": {
"type": "boolean"
},
"experimental-quic": {
"type": "boolean"
},
"experimental-repl-await": {
"type": "boolean"
},
Expand All @@ -177,6 +180,9 @@
"experimental-sqlite": {
"type": "boolean"
},
"experimental-strip-types": {
"type": "boolean"
},
"experimental-transform-types": {
"type": "boolean"
},
Expand Down Expand Up @@ -361,9 +367,6 @@
"stack-trace-limit": {
"type": "number"
},
"strip-types": {
"type": "boolean"
},
"test-coverage-branches": {
"type": "number"
},
Expand Down Expand Up @@ -401,12 +404,6 @@
"test-coverage-lines": {
"type": "number"
},
"test-global-setup": {
"type": "string"
},
"test-isolation": {
"type": "string"
},
"test-name-pattern": {
"oneOf": [
{
Expand Down Expand Up @@ -452,9 +449,6 @@
}
]
},
"test-rerun-failures": {
"type": "string"
},
"test-shard": {
"type": "string"
},
Expand Down Expand Up @@ -502,6 +496,9 @@
"tls-min-v1.3": {
"type": "boolean"
},
"trace-atomics-wait": {
"type": "boolean"
},
"trace-deprecation": {
"type": "boolean"
},
Expand Down Expand Up @@ -602,225 +599,6 @@
}
},
"type": "object"
},
"permission": {
"type": "object",
"additionalProperties": false,
"properties": {
"allow-addons": {
"type": "boolean"
},
"allow-child-process": {
"type": "boolean"
},
"allow-fs-read": {
"oneOf": [
{
"type": "string"
},
{
"items": {
"type": "string",
"minItems": 1
},
"type": "array"
}
]
},
"allow-fs-write": {
"oneOf": [
{
"type": "string"
},
{
"items": {
"type": "string",
"minItems": 1
},
"type": "array"
}
]
},
"allow-inspector": {
"type": "boolean"
},
"allow-net": {
"type": "boolean"
},
"allow-wasi": {
"type": "boolean"
},
"allow-worker": {
"type": "boolean"
},
"permission": {
"type": "boolean"
}
}
},
"test": {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we supposed to remove the prefix instead of the whole namespace no?

"type": "object",
"additionalProperties": false,
"properties": {
"experimental-test-coverage": {
"type": "boolean"
},
"experimental-test-module-mocks": {
"type": "boolean"
},
"test": {
"type": "boolean"
},
"test-concurrency": {
"type": "number"
},
"test-coverage-branches": {
"type": "number"
},
"test-coverage-exclude": {
"oneOf": [
{
"type": "string"
},
{
"items": {
"type": "string",
"minItems": 1
},
"type": "array"
}
]
},
"test-coverage-functions": {
"type": "number"
},
"test-coverage-include": {
"oneOf": [
{
"type": "string"
},
{
"items": {
"type": "string",
"minItems": 1
},
"type": "array"
}
]
},
"test-coverage-lines": {
"type": "number"
},
"test-force-exit": {
"type": "boolean"
},
"test-global-setup": {
"type": "string"
},
"test-isolation": {
"type": "string"
},
"test-name-pattern": {
"oneOf": [
{
"type": "string"
},
{
"items": {
"type": "string",
"minItems": 1
},
"type": "array"
}
]
},
"test-only": {
"type": "boolean"
},
"test-reporter": {
"oneOf": [
{
"type": "string"
},
{
"items": {
"type": "string",
"minItems": 1
},
"type": "array"
}
]
},
"test-reporter-destination": {
"oneOf": [
{
"type": "string"
},
{
"items": {
"type": "string",
"minItems": 1
},
"type": "array"
}
]
},
"test-rerun-failures": {
"type": "string"
},
"test-shard": {
"type": "string"
},
"test-skip-pattern": {
"oneOf": [
{
"type": "string"
},
{
"items": {
"type": "string",
"minItems": 1
},
"type": "array"
}
]
},
"test-timeout": {
"type": "number"
},
"test-update-snapshots": {
"type": "boolean"
}
}
},
"watch": {
"type": "object",
"additionalProperties": false,
"properties": {
"watch": {
"type": "boolean"
},
"watch-kill-signal": {
"type": "string"
},
"watch-path": {
"oneOf": [
{
"type": "string"
},
{
"items": {
"type": "string",
"minItems": 1
},
"type": "array"
}
]
},
"watch-preserve-output": {
"type": "boolean"
}
}
}
},
"type": "object"
Expand Down
11 changes: 11 additions & 0 deletions lib/internal/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,17 @@ function generateConfigJsonSchema() {
ArrayPrototypeMap(sortedNamespaceKeys, (key) => [key, namespaceProperties[key]]),
);
rootProperties[namespace].properties = sortedNamespaceProperties;

// For `test` and `watch` namespaces, avoid duplicating their options
// under `nodeOptions`. These namespaces already have dedicated sections
// at the root level.
if (namespace === 'test' || namespace === 'watch') {
for (const key of sortedNamespaceKeys) {
if (key in nodeOptions) {
delete nodeOptions[key];
}
}
}
}

// Sort the top-level properties by key alphabetically
Expand Down