@angular-devkit/schematics-cli 14.0.0-next.8 → 14.0.0-rc.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.
- package/blank/factory.js +7 -14
- package/package.json +4 -4
- package/schematic/files/package.json +1 -1
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
|
|
16
|
-
if (!
|
|
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
|
|
38
|
-
if (
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
41
|
-
|
|
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-
|
|
3
|
+
"version": "14.0.0-rc.1",
|
|
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-
|
|
25
|
-
"@angular-devkit/schematics": "14.0.0-
|
|
24
|
+
"@angular-devkit/core": "14.0.0-rc.1",
|
|
25
|
+
"@angular-devkit/schematics": "14.0.0-rc.1",
|
|
26
26
|
"ansi-colors": "4.1.1",
|
|
27
|
-
"inquirer": "8.2.
|
|
27
|
+
"inquirer": "8.2.4",
|
|
28
28
|
"symbol-observable": "4.0.0",
|
|
29
29
|
"yargs-parser": "21.0.1"
|
|
30
30
|
},
|