@angular-devkit/schematics-cli 14.0.0-next.9 → 14.0.0-rc.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.
Files changed (2) hide show
  1. package/blank/factory.js +7 -14
  2. package/package.json +4 -4
package/blank/factory.js CHANGED
@@ -12,12 +12,8 @@ const schematics_1 = require("@angular-devkit/schematics");
12
12
  const tasks_1 = require("@angular-devkit/schematics/tasks");
13
13
  function addSchematicToCollectionJson(collectionPath, schematicName, description) {
14
14
  return (tree) => {
15
- const collectionJsonContent = tree.read(collectionPath);
16
- if (!collectionJsonContent) {
17
- throw new Error('Invalid collection path: ' + collectionPath);
18
- }
19
- const collectionJson = JSON.parse(collectionJsonContent.toString());
20
- if (!(0, core_1.isJsonObject)(collectionJson.schematics)) {
15
+ const collectionJson = tree.readJson(collectionPath);
16
+ if (!(0, core_1.isJsonObject)(collectionJson) || !(0, core_1.isJsonObject)(collectionJson.schematics)) {
21
17
  throw new Error('Invalid collection.json; schematics needs to be an object.');
22
18
  }
23
19
  collectionJson['schematics'][schematicName] = description;
@@ -34,14 +30,11 @@ function default_1(options) {
34
30
  }
35
31
  let collectionPath;
36
32
  try {
37
- const packageJsonContent = tree.read('/package.json');
38
- if (packageJsonContent) {
39
- const packageJson = JSON.parse(packageJsonContent.toString());
40
- if (typeof packageJson.schematics === 'string') {
41
- const p = (0, core_1.normalize)(packageJson.schematics);
42
- if (tree.exists(p)) {
43
- collectionPath = p;
44
- }
33
+ const packageJson = tree.readJson('/package.json');
34
+ if (typeof packageJson.schematics === 'string') {
35
+ const p = (0, core_1.normalize)(packageJson.schematics);
36
+ if (tree.exists(p)) {
37
+ collectionPath = p;
45
38
  }
46
39
  }
47
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-devkit/schematics-cli",
3
- "version": "14.0.0-next.9",
3
+ "version": "14.0.0-rc.0",
4
4
  "description": "Angular Schematics - CLI",
5
5
  "homepage": "https://github.com/angular/angular-cli",
6
6
  "bin": {
@@ -21,10 +21,10 @@
21
21
  ],
22
22
  "schematics": "./collection.json",
23
23
  "dependencies": {
24
- "@angular-devkit/core": "14.0.0-next.9",
25
- "@angular-devkit/schematics": "14.0.0-next.9",
24
+ "@angular-devkit/core": "14.0.0-rc.0",
25
+ "@angular-devkit/schematics": "14.0.0-rc.0",
26
26
  "ansi-colors": "4.1.1",
27
- "inquirer": "8.2.2",
27
+ "inquirer": "8.2.4",
28
28
  "symbol-observable": "4.0.0",
29
29
  "yargs-parser": "21.0.1"
30
30
  },