@angular/cli 15.0.0 → 15.1.0-next.0

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.
@@ -1097,9 +1097,14 @@
1097
1097
  "$source": "projectName"
1098
1098
  }
1099
1099
  },
1100
+ "functional": {
1101
+ "type": "boolean",
1102
+ "description": "Specifies whether to generate a guard as a function.",
1103
+ "default": false
1104
+ },
1100
1105
  "implements": {
1101
1106
  "type": "array",
1102
- "description": "Specifies which interfaces to implement.",
1107
+ "description": "Specifies which type of guard to create.",
1103
1108
  "uniqueItems": true,
1104
1109
  "minItems": 1,
1105
1110
  "items": {
@@ -1485,6 +1490,11 @@
1485
1490
  "description": "When true (the default), creates the new files at the top level of the current project.",
1486
1491
  "default": true
1487
1492
  },
1493
+ "functional": {
1494
+ "type": "boolean",
1495
+ "description": "Creates the resolver as a `ResolveFn`.",
1496
+ "default": false
1497
+ },
1488
1498
  "path": {
1489
1499
  "type": "string",
1490
1500
  "format": "path",
@@ -3236,6 +3246,14 @@
3236
3246
  "title": "Universal Target",
3237
3247
  "type": "object",
3238
3248
  "properties": {
3249
+ "assets": {
3250
+ "type": "array",
3251
+ "description": "List of static application assets.",
3252
+ "default": [],
3253
+ "items": {
3254
+ "$ref": "#/definitions/AngularDevkitBuildAngularBuildersServerSchema/definitions/assetPattern"
3255
+ }
3256
+ },
3239
3257
  "main": {
3240
3258
  "type": "string",
3241
3259
  "description": "The name of the main entry-point file."
@@ -3460,6 +3478,43 @@
3460
3478
  },
3461
3479
  "additionalProperties": false,
3462
3480
  "definitions": {
3481
+ "assetPattern": {
3482
+ "oneOf": [
3483
+ {
3484
+ "type": "object",
3485
+ "properties": {
3486
+ "followSymlinks": {
3487
+ "type": "boolean",
3488
+ "default": false,
3489
+ "description": "Allow glob patterns to follow symlink directories. This allows subdirectories of the symlink to be searched."
3490
+ },
3491
+ "glob": {
3492
+ "type": "string",
3493
+ "description": "The pattern to match."
3494
+ },
3495
+ "input": {
3496
+ "type": "string",
3497
+ "description": "The input directory path in which to apply 'glob'. Defaults to the project root."
3498
+ },
3499
+ "ignore": {
3500
+ "description": "An array of globs to ignore.",
3501
+ "type": "array",
3502
+ "items": {
3503
+ "type": "string"
3504
+ }
3505
+ },
3506
+ "output": {
3507
+ "type": "string",
3508
+ "description": "Absolute path within the output."
3509
+ }
3510
+ },
3511
+ "additionalProperties": false
3512
+ },
3513
+ {
3514
+ "type": "string"
3515
+ }
3516
+ ]
3517
+ },
3463
3518
  "fileReplacement": {
3464
3519
  "oneOf": [
3465
3520
  {
@@ -398,7 +398,11 @@ export interface AngularGuardOptionsSchema {
398
398
  */
399
399
  flat?: boolean;
400
400
  /**
401
- * Specifies which interfaces to implement.
401
+ * Specifies whether to generate a guard as a function.
402
+ */
403
+ functional?: boolean;
404
+ /**
405
+ * Specifies which type of guard to create.
402
406
  */
403
407
  implements?: Implement[];
404
408
  /**
@@ -655,6 +659,10 @@ export interface AngularResolverOptionsSchema {
655
659
  * When true (the default), creates the new files at the top level of the current project.
656
660
  */
657
661
  flat?: boolean;
662
+ /**
663
+ * Creates the resolver as a `ResolveFn`.
664
+ */
665
+ functional?: boolean;
658
666
  /**
659
667
  * The name of the new resolver.
660
668
  */
package/lib/init.js CHANGED
@@ -56,15 +56,19 @@ let forceExit = false;
56
56
  * See: https://github.com/browserslist/browserslist/blob/819c4337456996d19db6ba953014579329e9c6e1/node.js#L324
57
57
  */
58
58
  process.env.BROWSERSLIST_IGNORE_OLD_DATA = '1';
59
+ const rawCommandName = process.argv[2];
59
60
  /**
60
61
  * Disable CLI version mismatch checks and forces usage of the invoked CLI
61
62
  * instead of invoking the local installed version.
63
+ *
64
+ * When running `ng new` always favor the global version. As in some
65
+ * cases orphan `node_modules` would cause the non global CLI to be used.
66
+ * @see: https://github.com/angular/angular-cli/issues/14603
62
67
  */
63
- if (environment_options_1.disableVersionCheck) {
68
+ if (environment_options_1.disableVersionCheck || rawCommandName === 'new') {
64
69
  return (await Promise.resolve().then(() => __importStar(require('./cli')))).default;
65
70
  }
66
71
  let cli;
67
- const rawCommandName = process.argv[2];
68
72
  try {
69
73
  // No error implies a projectLocalCli, which will load whatever
70
74
  // version of ng-cli you have installed in a local package.json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "15.0.0",
3
+ "version": "15.1.0-next.0",
4
4
  "description": "CLI tool for Angular",
5
5
  "main": "lib/cli/index.js",
6
6
  "bin": {
@@ -25,16 +25,16 @@
25
25
  },
26
26
  "homepage": "https://github.com/angular/angular-cli",
27
27
  "dependencies": {
28
- "@angular-devkit/architect": "0.1500.0",
29
- "@angular-devkit/core": "15.0.0",
30
- "@angular-devkit/schematics": "15.0.0",
31
- "@schematics/angular": "15.0.0",
28
+ "@angular-devkit/architect": "0.1501.0-next.0",
29
+ "@angular-devkit/core": "15.1.0-next.0",
30
+ "@angular-devkit/schematics": "15.1.0-next.0",
31
+ "@schematics/angular": "15.1.0-next.0",
32
32
  "@yarnpkg/lockfile": "1.1.0",
33
33
  "ansi-colors": "4.1.3",
34
34
  "ini": "3.0.1",
35
35
  "inquirer": "8.2.4",
36
36
  "jsonc-parser": "3.2.0",
37
- "npm-package-arg": "9.1.2",
37
+ "npm-package-arg": "10.0.0",
38
38
  "npm-pick-manifest": "8.0.1",
39
39
  "open": "8.4.0",
40
40
  "ora": "5.4.1",
@@ -47,12 +47,12 @@
47
47
  "ng-update": {
48
48
  "migrations": "@schematics/angular/migrations/migration-collection.json",
49
49
  "packageGroup": {
50
- "@angular/cli": "15.0.0",
51
- "@angular-devkit/architect": "0.1500.0",
52
- "@angular-devkit/build-angular": "15.0.0",
53
- "@angular-devkit/build-webpack": "0.1500.0",
54
- "@angular-devkit/core": "15.0.0",
55
- "@angular-devkit/schematics": "15.0.0"
50
+ "@angular/cli": "15.1.0-next.0",
51
+ "@angular-devkit/architect": "0.1501.0-next.0",
52
+ "@angular-devkit/build-angular": "15.1.0-next.0",
53
+ "@angular-devkit/build-webpack": "0.1501.0-next.0",
54
+ "@angular-devkit/core": "15.1.0-next.0",
55
+ "@angular-devkit/schematics": "15.1.0-next.0"
56
56
  }
57
57
  },
58
58
  "engines": {
@@ -113,7 +113,9 @@ class AddCommandModule extends schematics_command_module_1.SchematicsCommandModu
113
113
  spinner.start('Determining package manager...');
114
114
  const usingYarn = packageManager.name === workspace_schema_1.PackageManager.Yarn;
115
115
  spinner.info(`Using package manager: ${color_1.colors.grey(packageManager.name)}`);
116
- if (packageIdentifier.name && packageIdentifier.type === 'tag' && !packageIdentifier.rawSpec) {
116
+ if (packageIdentifier.name &&
117
+ packageIdentifier.type === 'range' &&
118
+ packageIdentifier.rawSpec === '*') {
117
119
  // only package name provided; search for viable version
118
120
  // plus special cases for packages that did not have peer deps setup
119
121
  spinner.start('Searching for compatible package version...');
@@ -241,22 +243,24 @@ class AddCommandModule extends schematics_command_module_1.SchematicsCommandModu
241
243
  if (!packageIdentifier.name) {
242
244
  return false;
243
245
  }
244
- let validVersion = false;
245
246
  const installedVersion = await this.findProjectVersion(packageIdentifier.name);
246
- if (installedVersion) {
247
- if (packageIdentifier.type === 'range' && packageIdentifier.fetchSpec) {
248
- validVersion = (0, semver_1.satisfies)(installedVersion, packageIdentifier.fetchSpec);
249
- }
250
- else if (packageIdentifier.type === 'version') {
251
- const v1 = (0, semver_1.valid)(packageIdentifier.fetchSpec);
252
- const v2 = (0, semver_1.valid)(installedVersion);
253
- validVersion = v1 !== null && v1 === v2;
254
- }
255
- else if (!packageIdentifier.rawSpec) {
256
- validVersion = true;
257
- }
247
+ if (!installedVersion) {
248
+ return false;
258
249
  }
259
- return validVersion;
250
+ if (packageIdentifier.rawSpec === '*') {
251
+ return true;
252
+ }
253
+ if (packageIdentifier.type === 'range' &&
254
+ packageIdentifier.fetchSpec &&
255
+ packageIdentifier.fetchSpec !== '*') {
256
+ return (0, semver_1.satisfies)(installedVersion, packageIdentifier.fetchSpec);
257
+ }
258
+ if (packageIdentifier.type === 'version') {
259
+ const v1 = (0, semver_1.valid)(packageIdentifier.fetchSpec);
260
+ const v2 = (0, semver_1.valid)(installedVersion);
261
+ return v1 !== null && v1 === v2;
262
+ }
263
+ return false;
260
264
  }
261
265
  async getCollectionName() {
262
266
  const [, collectionName] = this.context.args.positional;
@@ -171,11 +171,11 @@ class UpdateCommandModule extends command_module_1.CommandModule {
171
171
  logger.error(`Duplicate package '${packageIdentifier.name}' specified.`);
172
172
  return 1;
173
173
  }
174
- if (options.migrateOnly && packageIdentifier.rawSpec) {
174
+ if (options.migrateOnly && packageIdentifier.rawSpec !== '*') {
175
175
  logger.warn('Package specifier has no effect when using "migrate-only" option.');
176
176
  }
177
177
  // If next option is used and no specifier supplied, use next tag
178
- if (options.next && !packageIdentifier.rawSpec) {
178
+ if (options.next && packageIdentifier.rawSpec === '*') {
179
179
  packageIdentifier.fetchSpec = 'next';
180
180
  }
181
181
  packages.push(packageIdentifier);