Skip to content

Commit 0922a03

Browse files
committed
fix(@angular/cli): improve JSON schema parsing for command options
The JSON schema parsing for command options has been refactored to be more robust and handle more complex schemas. This includes better support for arrays, enums within 'oneOf' and 'anyOf'. The schema definitions in packages/angular/build/src/builders/unit-test/schema.json have been removed as these are not resolved at this stage of schema processing.
1 parent ef2779d commit 0922a03

File tree

3 files changed

+361
-144
lines changed

3 files changed

+361
-144
lines changed

packages/angular/build/src/builders/unit-test/schema.json

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,33 @@
7272
"items": {
7373
"oneOf": [
7474
{
75-
"$ref": "#/definitions/coverage-reporters"
75+
"enum": [
76+
"html",
77+
"lcov",
78+
"lcovonly",
79+
"text",
80+
"text-summary",
81+
"cobertura",
82+
"json",
83+
"json-summary"
84+
]
7685
},
7786
{
7887
"type": "array",
7988
"minItems": 1,
8089
"maxItems": 2,
8190
"items": [
8291
{
83-
"$ref": "#/definitions/coverage-reporters"
92+
"enum": [
93+
"html",
94+
"lcov",
95+
"lcovonly",
96+
"text",
97+
"text-summary",
98+
"cobertura",
99+
"json",
100+
"json-summary"
101+
]
84102
},
85103
{
86104
"type": "object"
@@ -98,10 +116,10 @@
98116
{
99117
"anyOf": [
100118
{
101-
"$ref": "#/definitions/reporters-enum"
119+
"type": "string"
102120
},
103121
{
104-
"type": "string"
122+
"enum": ["default", "verbose", "dots", "json", "junit", "tap", "tap-flat", "html"]
105123
}
106124
]
107125
},
@@ -113,10 +131,19 @@
113131
{
114132
"anyOf": [
115133
{
116-
"$ref": "#/definitions/reporters-enum"
134+
"type": "string"
117135
},
118136
{
119-
"type": "string"
137+
"enum": [
138+
"default",
139+
"verbose",
140+
"dots",
141+
"json",
142+
"junit",
143+
"tap",
144+
"tap-flat",
145+
"html"
146+
]
120147
}
121148
]
122149
},
@@ -161,23 +188,5 @@
161188
}
162189
},
163190
"additionalProperties": false,
164-
"required": ["buildTarget", "tsConfig", "runner"],
165-
"definitions": {
166-
"coverage-reporters": {
167-
"enum": [
168-
"html",
169-
"lcov",
170-
"lcovonly",
171-
"text",
172-
"text-summary",
173-
"cobertura",
174-
"json",
175-
"json-summary"
176-
]
177-
},
178-
"reporters-enum": {
179-
"type": "string",
180-
"enum": ["default", "verbose", "dots", "json", "junit", "tap", "tap-flat", "html"]
181-
}
182-
}
191+
"required": ["buildTarget", "tsConfig", "runner"]
183192
}

0 commit comments

Comments
 (0)