diff --git a/doc/node-config-schema.json b/doc/node-config-schema.json index 22f52952af54d4..6e92ba3e03f89d 100644 --- a/doc/node-config-schema.json +++ b/doc/node-config-schema.json @@ -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": [ { @@ -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" }, @@ -162,9 +168,6 @@ "experimental-print-required-tla": { "type": "boolean" }, - "experimental-quic": { - "type": "boolean" - }, "experimental-repl-await": { "type": "boolean" }, @@ -177,6 +180,9 @@ "experimental-sqlite": { "type": "boolean" }, + "experimental-strip-types": { + "type": "boolean" + }, "experimental-transform-types": { "type": "boolean" }, @@ -361,9 +367,6 @@ "stack-trace-limit": { "type": "number" }, - "strip-types": { - "type": "boolean" - }, "test-coverage-branches": { "type": "number" }, @@ -401,12 +404,6 @@ "test-coverage-lines": { "type": "number" }, - "test-global-setup": { - "type": "string" - }, - "test-isolation": { - "type": "string" - }, "test-name-pattern": { "oneOf": [ { @@ -452,9 +449,6 @@ } ] }, - "test-rerun-failures": { - "type": "string" - }, "test-shard": { "type": "string" }, @@ -502,6 +496,9 @@ "tls-min-v1.3": { "type": "boolean" }, + "trace-atomics-wait": { + "type": "boolean" + }, "trace-deprecation": { "type": "boolean" }, @@ -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": { - "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" diff --git a/lib/internal/options.js b/lib/internal/options.js index be1dc6a842c526..486a6098494fde 100644 --- a/lib/internal/options.js +++ b/lib/internal/options.js @@ -106,8 +106,27 @@ function generateConfigJsonSchema() { // Add all options for this namespace for (const { 0: optionName, 1: optionType } of optionsMap) { - const keyWithoutPrefix = StringPrototypeReplace(optionName, '--', ''); - namespaceProperties[keyWithoutPrefix] = createPropertyForType(optionType); + let keyWithoutPrefix = StringPrototypeReplace(optionName, '--', ''); + const originalKey = keyWithoutPrefix; + const propertySchema = createPropertyForType(optionType); + + // For `test` and `watch` namespaces, remove the namespace prefix + // from keys to avoid redundancy (e.g., `test-concurrency` -> `concurrency`) + // Also add the prefixed version as an alias for backward compatibility + if (namespace === 'test' && keyWithoutPrefix.startsWith('test-')) { + keyWithoutPrefix = StringPrototypeReplace(keyWithoutPrefix, 'test-', ''); + // Add alias: both `concurrency` and `test-concurrency` are valid + namespaceProperties[originalKey] = propertySchema; + namespaceProperties[keyWithoutPrefix] = propertySchema; + } else if (namespace === 'watch' && keyWithoutPrefix.startsWith('watch-')) { + keyWithoutPrefix = StringPrototypeReplace(keyWithoutPrefix, 'watch-', ''); + // Add alias: both `path` and `watch-path` are valid + namespaceProperties[originalKey] = propertySchema; + namespaceProperties[keyWithoutPrefix] = propertySchema; + } else { + // For other namespaces or keys without prefix, add normally + namespaceProperties[keyWithoutPrefix] = propertySchema; + } } // Sort the namespace properties alphabetically