@angular/cli 14.1.0-next.2 → 14.1.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/config/schema.json +81 -5
- package/package.json +14 -14
- package/src/command-builder/command-runner.js +1 -1
- package/src/commands/config/cli.js +2 -17
- package/src/commands/new/cli.js +1 -1
- package/src/utilities/color.js +0 -1
- package/src/utilities/config.d.ts +1 -1
- package/src/utilities/config.js +9 -2
package/lib/config/schema.json
CHANGED
|
@@ -74,7 +74,8 @@
|
|
|
74
74
|
"description": "Show a warning when the global version is newer than the local one.",
|
|
75
75
|
"type": "boolean"
|
|
76
76
|
}
|
|
77
|
-
}
|
|
77
|
+
},
|
|
78
|
+
"additionalProperties": false
|
|
78
79
|
},
|
|
79
80
|
"analytics": {
|
|
80
81
|
"type": [
|
|
@@ -96,7 +97,8 @@
|
|
|
96
97
|
"type": "string",
|
|
97
98
|
"format": "uuid"
|
|
98
99
|
}
|
|
99
|
-
}
|
|
100
|
+
},
|
|
101
|
+
"additionalProperties": false
|
|
100
102
|
},
|
|
101
103
|
"cache": {
|
|
102
104
|
"description": "Control disk cache.",
|
|
@@ -119,7 +121,82 @@
|
|
|
119
121
|
"description": "Cache base path.",
|
|
120
122
|
"type": "string"
|
|
121
123
|
}
|
|
124
|
+
},
|
|
125
|
+
"additionalProperties": false
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"additionalProperties": false
|
|
129
|
+
},
|
|
130
|
+
"cliGlobalOptions": {
|
|
131
|
+
"type": "object",
|
|
132
|
+
"properties": {
|
|
133
|
+
"defaultCollection": {
|
|
134
|
+
"description": "The default schematics collection to use.",
|
|
135
|
+
"type": "string",
|
|
136
|
+
"x-deprecated": "Use 'schematicCollections' instead."
|
|
137
|
+
},
|
|
138
|
+
"schematicCollections": {
|
|
139
|
+
"type": "array",
|
|
140
|
+
"description": "The list of schematic collections to use.",
|
|
141
|
+
"items": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"uniqueItems": true
|
|
122
144
|
}
|
|
145
|
+
},
|
|
146
|
+
"packageManager": {
|
|
147
|
+
"description": "Specify which package manager tool to use.",
|
|
148
|
+
"type": "string",
|
|
149
|
+
"enum": [
|
|
150
|
+
"npm",
|
|
151
|
+
"cnpm",
|
|
152
|
+
"yarn",
|
|
153
|
+
"pnpm"
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
"warnings": {
|
|
157
|
+
"description": "Control CLI specific console warnings",
|
|
158
|
+
"type": "object",
|
|
159
|
+
"properties": {
|
|
160
|
+
"versionMismatch": {
|
|
161
|
+
"description": "Show a warning when the global version is newer than the local one.",
|
|
162
|
+
"type": "boolean"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"additionalProperties": false
|
|
166
|
+
},
|
|
167
|
+
"analytics": {
|
|
168
|
+
"type": [
|
|
169
|
+
"boolean",
|
|
170
|
+
"string"
|
|
171
|
+
],
|
|
172
|
+
"description": "Share anonymous usage data with the Angular Team at Google."
|
|
173
|
+
},
|
|
174
|
+
"analyticsSharing": {
|
|
175
|
+
"type": "object",
|
|
176
|
+
"properties": {
|
|
177
|
+
"tracking": {
|
|
178
|
+
"description": "Analytics sharing info tracking ID.",
|
|
179
|
+
"type": "string",
|
|
180
|
+
"pattern": "^(GA|UA)?-\\d+-\\d+$"
|
|
181
|
+
},
|
|
182
|
+
"uuid": {
|
|
183
|
+
"description": "Analytics sharing info universally unique identifier.",
|
|
184
|
+
"type": "string",
|
|
185
|
+
"format": "uuid"
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"additionalProperties": false
|
|
189
|
+
},
|
|
190
|
+
"completion": {
|
|
191
|
+
"type": "object",
|
|
192
|
+
"description": "Angular CLI completion settings.",
|
|
193
|
+
"properties": {
|
|
194
|
+
"prompted": {
|
|
195
|
+
"type": "boolean",
|
|
196
|
+
"description": "Whether the user has been prompted to add completion command prompt."
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"additionalProperties": false
|
|
123
200
|
}
|
|
124
201
|
},
|
|
125
202
|
"additionalProperties": false
|
|
@@ -608,14 +685,13 @@
|
|
|
608
685
|
"type": "object",
|
|
609
686
|
"properties": {
|
|
610
687
|
"$schema": {
|
|
611
|
-
"type": "string"
|
|
612
|
-
"format": "uri"
|
|
688
|
+
"type": "string"
|
|
613
689
|
},
|
|
614
690
|
"version": {
|
|
615
691
|
"$ref": "#/definitions/fileVersion"
|
|
616
692
|
},
|
|
617
693
|
"cli": {
|
|
618
|
-
"$ref": "#/definitions/
|
|
694
|
+
"$ref": "#/definitions/cliGlobalOptions"
|
|
619
695
|
},
|
|
620
696
|
"schematics": {
|
|
621
697
|
"$ref": "#/definitions/schematicOptions"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cli",
|
|
3
|
-
"version": "14.1.0-next.
|
|
3
|
+
"version": "14.1.0-next.3",
|
|
4
4
|
"description": "CLI tool for Angular",
|
|
5
5
|
"main": "lib/cli/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -25,22 +25,22 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/angular/angular-cli",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@angular-devkit/architect": "0.1401.0-next.
|
|
29
|
-
"@angular-devkit/core": "14.1.0-next.
|
|
30
|
-
"@angular-devkit/schematics": "14.1.0-next.
|
|
31
|
-
"@schematics/angular": "14.1.0-next.
|
|
28
|
+
"@angular-devkit/architect": "0.1401.0-next.3",
|
|
29
|
+
"@angular-devkit/core": "14.1.0-next.3",
|
|
30
|
+
"@angular-devkit/schematics": "14.1.0-next.3",
|
|
31
|
+
"@schematics/angular": "14.1.0-next.3",
|
|
32
32
|
"@yarnpkg/lockfile": "1.1.0",
|
|
33
33
|
"ansi-colors": "4.1.3",
|
|
34
34
|
"debug": "4.3.4",
|
|
35
35
|
"ini": "3.0.0",
|
|
36
36
|
"inquirer": "8.2.4",
|
|
37
37
|
"jsonc-parser": "3.0.0",
|
|
38
|
-
"npm-package-arg": "9.0
|
|
38
|
+
"npm-package-arg": "9.1.0",
|
|
39
39
|
"npm-pick-manifest": "7.0.1",
|
|
40
40
|
"open": "8.4.0",
|
|
41
41
|
"ora": "5.4.1",
|
|
42
|
-
"pacote": "13.6.
|
|
43
|
-
"resolve": "1.22.
|
|
42
|
+
"pacote": "13.6.1",
|
|
43
|
+
"resolve": "1.22.1",
|
|
44
44
|
"semver": "7.3.7",
|
|
45
45
|
"symbol-observable": "4.0.0",
|
|
46
46
|
"uuid": "8.3.2",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"ng-update": {
|
|
50
50
|
"migrations": "@schematics/angular/migrations/migration-collection.json",
|
|
51
51
|
"packageGroup": {
|
|
52
|
-
"@angular/cli": "14.1.0-next.
|
|
53
|
-
"@angular-devkit/architect": "0.1401.0-next.
|
|
54
|
-
"@angular-devkit/build-angular": "14.1.0-next.
|
|
55
|
-
"@angular-devkit/build-webpack": "0.1401.0-next.
|
|
56
|
-
"@angular-devkit/core": "14.1.0-next.
|
|
57
|
-
"@angular-devkit/schematics": "14.1.0-next.
|
|
52
|
+
"@angular/cli": "14.1.0-next.3",
|
|
53
|
+
"@angular-devkit/architect": "0.1401.0-next.3",
|
|
54
|
+
"@angular-devkit/build-angular": "14.1.0-next.3",
|
|
55
|
+
"@angular-devkit/build-webpack": "0.1401.0-next.3",
|
|
56
|
+
"@angular-devkit/core": "14.1.0-next.3",
|
|
57
|
+
"@angular-devkit/schematics": "14.1.0-next.3"
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|
|
@@ -138,7 +138,7 @@ async function runCommand(args, logger) {
|
|
|
138
138
|
'deprecated: %s': color_1.colors.yellow('deprecated:') + ' %s',
|
|
139
139
|
'Did you mean %s?': 'Unknown command. Did you mean %s?',
|
|
140
140
|
})
|
|
141
|
-
.epilogue(
|
|
141
|
+
.epilogue('For more information, see https://angular.io/cli/.\n')
|
|
142
142
|
.demandCommand(1, command_1.demandCommandFailureMessage)
|
|
143
143
|
.recommendCommands()
|
|
144
144
|
.middleware(normalize_options_middleware_1.normalizeOptionsMiddleware)
|
|
@@ -71,25 +71,10 @@ class ConfigCommandModule extends command_module_1.CommandModule {
|
|
|
71
71
|
return 0;
|
|
72
72
|
}
|
|
73
73
|
async set(options) {
|
|
74
|
-
var _a;
|
|
74
|
+
var _a, _b;
|
|
75
75
|
if (!((_a = options.jsonPath) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
76
76
|
throw new command_module_1.CommandModuleError('Invalid Path.');
|
|
77
77
|
}
|
|
78
|
-
const validGlobalCliPaths = new Set([
|
|
79
|
-
'cli.warnings.versionMismatch',
|
|
80
|
-
'cli.defaultCollection',
|
|
81
|
-
'cli.schematicCollections',
|
|
82
|
-
'cli.packageManager',
|
|
83
|
-
'cli.analytics',
|
|
84
|
-
'cli.analyticsSharing.tracking',
|
|
85
|
-
'cli.analyticsSharing.uuid',
|
|
86
|
-
'cli.completion.prompted',
|
|
87
|
-
]);
|
|
88
|
-
if (options.global &&
|
|
89
|
-
!options.jsonPath.startsWith('schematics.') &&
|
|
90
|
-
!validGlobalCliPaths.has(options.jsonPath)) {
|
|
91
|
-
throw new command_module_1.CommandModuleError('Invalid Path.');
|
|
92
|
-
}
|
|
93
78
|
const [config, configPath] = await (0, config_1.getWorkspaceRaw)(options.global ? 'global' : 'local');
|
|
94
79
|
const { logger } = this.context;
|
|
95
80
|
if (!config || !configPath) {
|
|
@@ -104,7 +89,7 @@ class ConfigCommandModule extends command_module_1.CommandModule {
|
|
|
104
89
|
logger.error('Value cannot be found.');
|
|
105
90
|
return 1;
|
|
106
91
|
}
|
|
107
|
-
await (0, config_1.validateWorkspace)((0, json_file_1.parseJson)(config.content));
|
|
92
|
+
await (0, config_1.validateWorkspace)((0, json_file_1.parseJson)(config.content), (_b = options.global) !== null && _b !== void 0 ? _b : false);
|
|
108
93
|
config.save();
|
|
109
94
|
return 0;
|
|
110
95
|
}
|
package/src/commands/new/cli.js
CHANGED
|
@@ -27,7 +27,7 @@ class NewCommandModule extends schematics_command_module_1.SchematicsCommandModu
|
|
|
27
27
|
describe: 'A collection of schematics to use in generating the initial application.',
|
|
28
28
|
type: 'string',
|
|
29
29
|
});
|
|
30
|
-
const { options: { collectionNameFromArgs }, } = this.context.args;
|
|
30
|
+
const { options: { collection: collectionNameFromArgs }, } = this.context.args;
|
|
31
31
|
const collectionName = typeof collectionNameFromArgs === 'string'
|
|
32
32
|
? collectionNameFromArgs
|
|
33
33
|
: await this.getCollectionFromConfig();
|
package/src/utilities/color.js
CHANGED
|
@@ -64,7 +64,6 @@ function removeColor(text) {
|
|
|
64
64
|
}
|
|
65
65
|
exports.removeColor = removeColor;
|
|
66
66
|
// Create a separate instance to prevent unintended global changes to the color configuration
|
|
67
|
-
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44
|
|
68
67
|
const colors = ansiColors.create();
|
|
69
68
|
exports.colors = colors;
|
|
70
69
|
colors.enabled = supportColor();
|
|
@@ -31,7 +31,7 @@ export declare function getWorkspace(level: 'local' | 'global'): Promise<Angular
|
|
|
31
31
|
* NB: This method is intended to be used only for `ng config`.
|
|
32
32
|
*/
|
|
33
33
|
export declare function getWorkspaceRaw(level?: 'local' | 'global'): Promise<[JSONFile | null, string | null]>;
|
|
34
|
-
export declare function validateWorkspace(data: json.JsonObject): Promise<void>;
|
|
34
|
+
export declare function validateWorkspace(data: json.JsonObject, isGlobal: boolean): Promise<void>;
|
|
35
35
|
export declare function getProjectByCwd(workspace: AngularWorkspace): string | null;
|
|
36
36
|
export declare function getConfiguredPackageManager(): Promise<PackageManager | null>;
|
|
37
37
|
export declare function getSchematicDefaults(collection: string, schematic: string, project?: string | null): Promise<{}>;
|
package/src/utilities/config.js
CHANGED
|
@@ -200,11 +200,18 @@ async function getWorkspaceRaw(level = 'local') {
|
|
|
200
200
|
return [new json_file_1.JSONFile(configPath), configPath];
|
|
201
201
|
}
|
|
202
202
|
exports.getWorkspaceRaw = getWorkspaceRaw;
|
|
203
|
-
async function validateWorkspace(data) {
|
|
203
|
+
async function validateWorkspace(data, isGlobal) {
|
|
204
204
|
const schema = (0, json_file_1.readAndParseJson)(exports.workspaceSchemaPath);
|
|
205
|
+
// We should eventually have a dedicated global config schema and use that to validate.
|
|
206
|
+
const schemaToValidate = isGlobal
|
|
207
|
+
? {
|
|
208
|
+
'$ref': '#/definitions/global',
|
|
209
|
+
definitions: schema['definitions'],
|
|
210
|
+
}
|
|
211
|
+
: schema;
|
|
205
212
|
const { formats } = await Promise.resolve().then(() => __importStar(require('@angular-devkit/schematics')));
|
|
206
213
|
const registry = new core_1.json.schema.CoreSchemaRegistry(formats.standardFormats);
|
|
207
|
-
const validator = await registry.compile(
|
|
214
|
+
const validator = await registry.compile(schemaToValidate).toPromise();
|
|
208
215
|
const { success, errors } = await validator(data).toPromise();
|
|
209
216
|
if (!success) {
|
|
210
217
|
throw new core_1.json.schema.SchemaValidationException(errors);
|