@angular/cli 17.2.0-rc.0 → 17.2.1

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.
@@ -2310,11 +2310,11 @@
2310
2310
  "properties": {
2311
2311
  "replace": {
2312
2312
  "type": "string",
2313
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
2313
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
2314
2314
  },
2315
2315
  "with": {
2316
2316
  "type": "string",
2317
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
2317
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
2318
2318
  }
2319
2319
  },
2320
2320
  "additionalProperties": false
@@ -2896,11 +2896,11 @@
2896
2896
  "properties": {
2897
2897
  "src": {
2898
2898
  "type": "string",
2899
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
2899
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
2900
2900
  },
2901
2901
  "replaceWith": {
2902
2902
  "type": "string",
2903
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
2903
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
2904
2904
  }
2905
2905
  },
2906
2906
  "additionalProperties": false
@@ -2910,11 +2910,11 @@
2910
2910
  "properties": {
2911
2911
  "replace": {
2912
2912
  "type": "string",
2913
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
2913
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
2914
2914
  },
2915
2915
  "with": {
2916
2916
  "type": "string",
2917
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
2917
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
2918
2918
  }
2919
2919
  },
2920
2920
  "additionalProperties": false
@@ -3473,11 +3473,11 @@
3473
3473
  "properties": {
3474
3474
  "replace": {
3475
3475
  "type": "string",
3476
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
3476
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
3477
3477
  },
3478
3478
  "with": {
3479
3479
  "type": "string",
3480
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
3480
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
3481
3481
  }
3482
3482
  },
3483
3483
  "additionalProperties": false
@@ -4819,11 +4819,11 @@
4819
4819
  "properties": {
4820
4820
  "src": {
4821
4821
  "type": "string",
4822
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
4822
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
4823
4823
  },
4824
4824
  "replaceWith": {
4825
4825
  "type": "string",
4826
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
4826
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
4827
4827
  }
4828
4828
  },
4829
4829
  "additionalProperties": false
@@ -4833,11 +4833,11 @@
4833
4833
  "properties": {
4834
4834
  "replace": {
4835
4835
  "type": "string",
4836
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
4836
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
4837
4837
  },
4838
4838
  "with": {
4839
4839
  "type": "string",
4840
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
4840
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
4841
4841
  }
4842
4842
  },
4843
4843
  "additionalProperties": false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "17.2.0-rc.0",
3
+ "version": "17.2.1",
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.1702.0-rc.0",
29
- "@angular-devkit/core": "17.2.0-rc.0",
30
- "@angular-devkit/schematics": "17.2.0-rc.0",
31
- "@schematics/angular": "17.2.0-rc.0",
28
+ "@angular-devkit/architect": "0.1702.1",
29
+ "@angular-devkit/core": "17.2.1",
30
+ "@angular-devkit/schematics": "17.2.1",
31
+ "@schematics/angular": "17.2.1",
32
32
  "@yarnpkg/lockfile": "1.1.0",
33
33
  "ansi-colors": "4.1.3",
34
34
  "ini": "4.1.1",
@@ -47,13 +47,13 @@
47
47
  "ng-update": {
48
48
  "migrations": "@schematics/angular/migrations/migration-collection.json",
49
49
  "packageGroup": {
50
- "@angular/cli": "17.2.0-rc.0",
51
- "@angular/ssr": "17.2.0-rc.0",
52
- "@angular-devkit/architect": "0.1702.0-rc.0",
53
- "@angular-devkit/build-angular": "17.2.0-rc.0",
54
- "@angular-devkit/build-webpack": "0.1702.0-rc.0",
55
- "@angular-devkit/core": "17.2.0-rc.0",
56
- "@angular-devkit/schematics": "17.2.0-rc.0"
50
+ "@angular/cli": "17.2.1",
51
+ "@angular/ssr": "17.2.1",
52
+ "@angular-devkit/architect": "0.1702.1",
53
+ "@angular-devkit/build-angular": "17.2.1",
54
+ "@angular-devkit/build-webpack": "0.1702.1",
55
+ "@angular-devkit/core": "17.2.1",
56
+ "@angular-devkit/schematics": "17.2.1"
57
57
  }
58
58
  },
59
59
  "engines": {
@@ -35,7 +35,6 @@ const core_1 = require("@angular-devkit/core");
35
35
  const schematics_1 = require("@angular-devkit/schematics");
36
36
  const npa = __importStar(require("npm-package-arg"));
37
37
  const semver = __importStar(require("semver"));
38
- const error_1 = require("../../../utilities/error");
39
38
  const package_metadata_1 = require("../../../utilities/package-metadata");
40
39
  // Angular guarantees that a major is compatible with its following major (so packages that depend
41
40
  // on Angular 5 are also compatible with Angular 6). This is, in code, represented by verifying
@@ -196,14 +195,7 @@ function _performUpdate(tree, context, infoMap, logger, migrateOnly) {
196
195
  if (!packageJsonContent) {
197
196
  throw new schematics_1.SchematicsException('Could not find a package.json. Are you in a Node project?');
198
197
  }
199
- let packageJson;
200
- try {
201
- packageJson = JSON.parse(packageJsonContent.toString());
202
- }
203
- catch (e) {
204
- (0, error_1.assertIsError)(e);
205
- throw new schematics_1.SchematicsException('package.json could not be parsed: ' + e.message);
206
- }
198
+ const packageJson = tree.readJson('/package.json');
207
199
  const updateDependency = (deps, name, newVersion) => {
208
200
  const oldVersion = deps[name];
209
201
  // We only respect caret and tilde ranges on update.
@@ -423,11 +415,12 @@ function _buildPackageInfo(tree, packages, allDependencies, npmPackageJson, logg
423
415
  }
424
416
  // Find out the currently installed version. Either from the package.json or the node_modules/
425
417
  // TODO: figure out a way to read package-lock.json and/or yarn.lock.
418
+ const pkgJsonPath = `/node_modules/${name}/package.json`;
419
+ const pkgJsonExists = tree.exists(pkgJsonPath);
426
420
  let installedVersion;
427
- const packageContent = tree.read(`/node_modules/${name}/package.json`);
428
- if (packageContent) {
429
- const content = JSON.parse(packageContent.toString());
430
- installedVersion = content.version;
421
+ if (pkgJsonExists) {
422
+ const { version } = tree.readJson(pkgJsonPath);
423
+ installedVersion = version;
431
424
  }
432
425
  const packageVersionsNonDeprecated = [];
433
426
  const packageVersionsDeprecated = [];
@@ -449,7 +442,7 @@ function _buildPackageInfo(tree, packages, allDependencies, npmPackageJson, logg
449
442
  if (!installedVersion) {
450
443
  throw new schematics_1.SchematicsException(`An unexpected error happened; could not determine version for package ${name}.`);
451
444
  }
452
- const installedPackageJson = npmPackageJson.versions[installedVersion] || packageContent;
445
+ const installedPackageJson = npmPackageJson.versions[installedVersion] || pkgJsonExists;
453
446
  if (!installedPackageJson) {
454
447
  throw new schematics_1.SchematicsException(`An unexpected error happened; package ${name} has no version ${installedVersion}.`);
455
448
  }
@@ -593,22 +586,11 @@ function _addPeerDependencies(tree, packages, allDependencies, npmPackageJson, n
593
586
  }
594
587
  }
595
588
  function _getAllDependencies(tree) {
596
- const packageJsonContent = tree.read('/package.json');
597
- if (!packageJsonContent) {
598
- throw new schematics_1.SchematicsException('Could not find a package.json. Are you in a Node project?');
599
- }
600
- let packageJson;
601
- try {
602
- packageJson = JSON.parse(packageJsonContent.toString());
603
- }
604
- catch (e) {
605
- (0, error_1.assertIsError)(e);
606
- throw new schematics_1.SchematicsException('package.json could not be parsed: ' + e.message);
607
- }
589
+ const { dependencies, devDependencies, peerDependencies } = tree.readJson('/package.json');
608
590
  return [
609
- ...Object.entries(packageJson.peerDependencies || {}),
610
- ...Object.entries(packageJson.devDependencies || {}),
611
- ...Object.entries(packageJson.dependencies || {}),
591
+ ...Object.entries(peerDependencies || {}),
592
+ ...Object.entries(devDependencies || {}),
593
+ ...Object.entries(dependencies || {}),
612
594
  ];
613
595
  }
614
596
  function _formatVersion(version) {
@@ -25,5 +25,5 @@ class Version {
25
25
  }
26
26
  }
27
27
  // TODO(bazel): Convert this to use build-time version stamping after flipping the build script to use bazel
28
- // export const VERSION = new Version('17.2.0-rc.0');
28
+ // export const VERSION = new Version('17.2.1');
29
29
  exports.VERSION = new Version(JSON.parse((0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '../../package.json'), 'utf-8')).version);