@angular/cli 14.0.3 → 14.0.4

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.
@@ -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
@@ -585,14 +662,13 @@
585
662
  "type": "object",
586
663
  "properties": {
587
664
  "$schema": {
588
- "type": "string",
589
- "format": "uri"
665
+ "type": "string"
590
666
  },
591
667
  "version": {
592
668
  "$ref": "#/definitions/fileVersion"
593
669
  },
594
670
  "cli": {
595
- "$ref": "#/definitions/cliOptions"
671
+ "$ref": "#/definitions/cliGlobalOptions"
596
672
  },
597
673
  "schematics": {
598
674
  "$ref": "#/definitions/schematicOptions"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "14.0.3",
3
+ "version": "14.0.4",
4
4
  "description": "CLI tool for Angular",
5
5
  "main": "lib/cli/index.js",
6
6
  "bin": {
@@ -25,10 +25,10 @@
25
25
  },
26
26
  "homepage": "https://github.com/angular/angular-cli",
27
27
  "dependencies": {
28
- "@angular-devkit/architect": "0.1400.3",
29
- "@angular-devkit/core": "14.0.3",
30
- "@angular-devkit/schematics": "14.0.3",
31
- "@schematics/angular": "14.0.3",
28
+ "@angular-devkit/architect": "0.1400.4",
29
+ "@angular-devkit/core": "14.0.4",
30
+ "@angular-devkit/schematics": "14.0.4",
31
+ "@schematics/angular": "14.0.4",
32
32
  "@yarnpkg/lockfile": "1.1.0",
33
33
  "ansi-colors": "4.1.1",
34
34
  "debug": "4.3.4",
@@ -49,12 +49,12 @@
49
49
  "ng-update": {
50
50
  "migrations": "@schematics/angular/migrations/migration-collection.json",
51
51
  "packageGroup": {
52
- "@angular/cli": "14.0.3",
53
- "@angular-devkit/architect": "0.1400.3",
54
- "@angular-devkit/build-angular": "14.0.3",
55
- "@angular-devkit/build-webpack": "0.1400.3",
56
- "@angular-devkit/core": "14.0.3",
57
- "@angular-devkit/schematics": "14.0.3"
52
+ "@angular/cli": "14.0.4",
53
+ "@angular-devkit/architect": "0.1400.4",
54
+ "@angular-devkit/build-angular": "14.0.4",
55
+ "@angular-devkit/build-webpack": "0.1400.4",
56
+ "@angular-devkit/core": "14.0.4",
57
+ "@angular-devkit/schematics": "14.0.4"
58
58
  }
59
59
  },
60
60
  "engines": {
@@ -136,7 +136,7 @@ async function runCommand(args, logger) {
136
136
  'deprecated: %s': color_1.colors.yellow('deprecated:') + ' %s',
137
137
  'Did you mean %s?': 'Unknown command. Did you mean %s?',
138
138
  })
139
- .epilogue(color_1.colors.gray('For more information, see https://angular.io/cli/.\n'))
139
+ .epilogue('For more information, see https://angular.io/cli/.\n')
140
140
  .demandCommand(1, command_1.demandCommandFailureMessage)
141
141
  .recommendCommands()
142
142
  .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
  }
@@ -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();
@@ -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<{}>;
@@ -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(schema).toPromise();
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);