@angular/cli 17.1.3 → 17.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cli",
3
- "version": "17.1.3",
3
+ "version": "17.1.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.1701.3",
29
- "@angular-devkit/core": "17.1.3",
30
- "@angular-devkit/schematics": "17.1.3",
31
- "@schematics/angular": "17.1.3",
28
+ "@angular-devkit/architect": "0.1701.4",
29
+ "@angular-devkit/core": "17.1.4",
30
+ "@angular-devkit/schematics": "17.1.4",
31
+ "@schematics/angular": "17.1.4",
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.1.3",
51
- "@angular/ssr": "17.1.3",
52
- "@angular-devkit/architect": "0.1701.3",
53
- "@angular-devkit/build-angular": "17.1.3",
54
- "@angular-devkit/build-webpack": "0.1701.3",
55
- "@angular-devkit/core": "17.1.3",
56
- "@angular-devkit/schematics": "17.1.3"
50
+ "@angular/cli": "17.1.4",
51
+ "@angular/ssr": "17.1.4",
52
+ "@angular-devkit/architect": "0.1701.4",
53
+ "@angular-devkit/build-angular": "17.1.4",
54
+ "@angular-devkit/build-webpack": "0.1701.4",
55
+ "@angular-devkit/core": "17.1.4",
56
+ "@angular-devkit/schematics": "17.1.4"
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.1.3');
28
+ // export const VERSION = new Version('17.1.4');
29
29
  exports.VERSION = new Version(JSON.parse((0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '../../package.json'), 'utf-8')).version);