Skip to content

Commit 443ec83

Browse files
author
Aakash
committed
Remove redundancy in node.config schema keys for test and watch
1 parent 4ea921b commit 443ec83

File tree

2 files changed

+32
-243
lines changed

2 files changed

+32
-243
lines changed

doc/node-config-schema.json

Lines changed: 21 additions & 243 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,12 @@
4545
}
4646
]
4747
},
48-
"allow-inspector": {
49-
"type": "boolean"
50-
},
51-
"allow-net": {
52-
"type": "boolean"
53-
},
5448
"allow-wasi": {
5549
"type": "boolean"
5650
},
5751
"allow-worker": {
5852
"type": "boolean"
5953
},
60-
"async-context-frame": {
61-
"type": "boolean"
62-
},
6354
"conditions": {
6455
"oneOf": [
6556
{
@@ -133,15 +124,30 @@
133124
"experimental-addon-modules": {
134125
"type": "boolean"
135126
},
127+
"experimental-async-context-frame": {
128+
"type": "boolean"
129+
},
130+
"experimental-default-type": {
131+
"type": "string"
132+
},
136133
"experimental-detect-module": {
137134
"type": "boolean"
138135
},
139136
"experimental-eventsource": {
140137
"type": "boolean"
141138
},
139+
"experimental-fetch": {
140+
"type": "boolean"
141+
},
142+
"experimental-global-customevent": {
143+
"type": "boolean"
144+
},
142145
"experimental-global-navigator": {
143146
"type": "boolean"
144147
},
148+
"experimental-global-webcrypto": {
149+
"type": "boolean"
150+
},
145151
"experimental-import-meta-resolve": {
146152
"type": "boolean"
147153
},
@@ -162,9 +168,6 @@
162168
"experimental-print-required-tla": {
163169
"type": "boolean"
164170
},
165-
"experimental-quic": {
166-
"type": "boolean"
167-
},
168171
"experimental-repl-await": {
169172
"type": "boolean"
170173
},
@@ -177,6 +180,9 @@
177180
"experimental-sqlite": {
178181
"type": "boolean"
179182
},
183+
"experimental-strip-types": {
184+
"type": "boolean"
185+
},
180186
"experimental-transform-types": {
181187
"type": "boolean"
182188
},
@@ -361,9 +367,6 @@
361367
"stack-trace-limit": {
362368
"type": "number"
363369
},
364-
"strip-types": {
365-
"type": "boolean"
366-
},
367370
"test-coverage-branches": {
368371
"type": "number"
369372
},
@@ -401,12 +404,6 @@
401404
"test-coverage-lines": {
402405
"type": "number"
403406
},
404-
"test-global-setup": {
405-
"type": "string"
406-
},
407-
"test-isolation": {
408-
"type": "string"
409-
},
410407
"test-name-pattern": {
411408
"oneOf": [
412409
{
@@ -452,9 +449,6 @@
452449
}
453450
]
454451
},
455-
"test-rerun-failures": {
456-
"type": "string"
457-
},
458452
"test-shard": {
459453
"type": "string"
460454
},
@@ -502,6 +496,9 @@
502496
"tls-min-v1.3": {
503497
"type": "boolean"
504498
},
499+
"trace-atomics-wait": {
500+
"type": "boolean"
501+
},
505502
"trace-deprecation": {
506503
"type": "boolean"
507504
},
@@ -602,225 +599,6 @@
602599
}
603600
},
604601
"type": "object"
605-
},
606-
"permission": {
607-
"type": "object",
608-
"additionalProperties": false,
609-
"properties": {
610-
"allow-addons": {
611-
"type": "boolean"
612-
},
613-
"allow-child-process": {
614-
"type": "boolean"
615-
},
616-
"allow-fs-read": {
617-
"oneOf": [
618-
{
619-
"type": "string"
620-
},
621-
{
622-
"items": {
623-
"type": "string",
624-
"minItems": 1
625-
},
626-
"type": "array"
627-
}
628-
]
629-
},
630-
"allow-fs-write": {
631-
"oneOf": [
632-
{
633-
"type": "string"
634-
},
635-
{
636-
"items": {
637-
"type": "string",
638-
"minItems": 1
639-
},
640-
"type": "array"
641-
}
642-
]
643-
},
644-
"allow-inspector": {
645-
"type": "boolean"
646-
},
647-
"allow-net": {
648-
"type": "boolean"
649-
},
650-
"allow-wasi": {
651-
"type": "boolean"
652-
},
653-
"allow-worker": {
654-
"type": "boolean"
655-
},
656-
"permission": {
657-
"type": "boolean"
658-
}
659-
}
660-
},
661-
"test": {
662-
"type": "object",
663-
"additionalProperties": false,
664-
"properties": {
665-
"experimental-test-coverage": {
666-
"type": "boolean"
667-
},
668-
"experimental-test-module-mocks": {
669-
"type": "boolean"
670-
},
671-
"test": {
672-
"type": "boolean"
673-
},
674-
"test-concurrency": {
675-
"type": "number"
676-
},
677-
"test-coverage-branches": {
678-
"type": "number"
679-
},
680-
"test-coverage-exclude": {
681-
"oneOf": [
682-
{
683-
"type": "string"
684-
},
685-
{
686-
"items": {
687-
"type": "string",
688-
"minItems": 1
689-
},
690-
"type": "array"
691-
}
692-
]
693-
},
694-
"test-coverage-functions": {
695-
"type": "number"
696-
},
697-
"test-coverage-include": {
698-
"oneOf": [
699-
{
700-
"type": "string"
701-
},
702-
{
703-
"items": {
704-
"type": "string",
705-
"minItems": 1
706-
},
707-
"type": "array"
708-
}
709-
]
710-
},
711-
"test-coverage-lines": {
712-
"type": "number"
713-
},
714-
"test-force-exit": {
715-
"type": "boolean"
716-
},
717-
"test-global-setup": {
718-
"type": "string"
719-
},
720-
"test-isolation": {
721-
"type": "string"
722-
},
723-
"test-name-pattern": {
724-
"oneOf": [
725-
{
726-
"type": "string"
727-
},
728-
{
729-
"items": {
730-
"type": "string",
731-
"minItems": 1
732-
},
733-
"type": "array"
734-
}
735-
]
736-
},
737-
"test-only": {
738-
"type": "boolean"
739-
},
740-
"test-reporter": {
741-
"oneOf": [
742-
{
743-
"type": "string"
744-
},
745-
{
746-
"items": {
747-
"type": "string",
748-
"minItems": 1
749-
},
750-
"type": "array"
751-
}
752-
]
753-
},
754-
"test-reporter-destination": {
755-
"oneOf": [
756-
{
757-
"type": "string"
758-
},
759-
{
760-
"items": {
761-
"type": "string",
762-
"minItems": 1
763-
},
764-
"type": "array"
765-
}
766-
]
767-
},
768-
"test-rerun-failures": {
769-
"type": "string"
770-
},
771-
"test-shard": {
772-
"type": "string"
773-
},
774-
"test-skip-pattern": {
775-
"oneOf": [
776-
{
777-
"type": "string"
778-
},
779-
{
780-
"items": {
781-
"type": "string",
782-
"minItems": 1
783-
},
784-
"type": "array"
785-
}
786-
]
787-
},
788-
"test-timeout": {
789-
"type": "number"
790-
},
791-
"test-update-snapshots": {
792-
"type": "boolean"
793-
}
794-
}
795-
},
796-
"watch": {
797-
"type": "object",
798-
"additionalProperties": false,
799-
"properties": {
800-
"watch": {
801-
"type": "boolean"
802-
},
803-
"watch-kill-signal": {
804-
"type": "string"
805-
},
806-
"watch-path": {
807-
"oneOf": [
808-
{
809-
"type": "string"
810-
},
811-
{
812-
"items": {
813-
"type": "string",
814-
"minItems": 1
815-
},
816-
"type": "array"
817-
}
818-
]
819-
},
820-
"watch-preserve-output": {
821-
"type": "boolean"
822-
}
823-
}
824602
}
825603
},
826604
"type": "object"

lib/internal/options.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,17 @@ function generateConfigJsonSchema() {
116116
ArrayPrototypeMap(sortedNamespaceKeys, (key) => [key, namespaceProperties[key]]),
117117
);
118118
rootProperties[namespace].properties = sortedNamespaceProperties;
119+
120+
// For `test` and `watch` namespaces, avoid duplicating their options
121+
// under `nodeOptions`. These namespaces already have dedicated sections
122+
// at the root level.
123+
if (namespace === 'test' || namespace === 'watch') {
124+
for (const key of sortedNamespaceKeys) {
125+
if (key in nodeOptions) {
126+
delete nodeOptions[key];
127+
}
128+
}
129+
}
119130
}
120131

121132
// Sort the top-level properties by key alphabetically

0 commit comments

Comments
 (0)