@angular-devkit/schematics 15.1.0-next.2 → 15.1.0-next.3
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-devkit/schematics",
|
|
3
|
-
"version": "15.1.0-next.
|
|
3
|
+
"version": "15.1.0-next.3",
|
|
4
4
|
"description": "Angular Schematics - Library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"typings": "src/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"schematics"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@angular-devkit/core": "15.1.0-next.
|
|
21
|
+
"@angular-devkit/core": "15.1.0-next.3",
|
|
22
22
|
"jsonc-parser": "3.2.0",
|
|
23
23
|
"magic-string": "0.27.0",
|
|
24
24
|
"ora": "5.4.1",
|
|
@@ -23,7 +23,15 @@ export declare class SchematicTestRunner {
|
|
|
23
23
|
get logger(): logging.Logger;
|
|
24
24
|
get tasks(): TaskConfiguration[];
|
|
25
25
|
registerCollection(collectionName: string, collectionPath: string): void;
|
|
26
|
+
runSchematic<SchematicSchemaT extends object>(schematicName: string, opts?: SchematicSchemaT, tree?: Tree): Promise<UnitTestTree>;
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated since version 15.1. Use `runSchematic` instead.
|
|
29
|
+
*/
|
|
26
30
|
runSchematicAsync<SchematicSchemaT extends object>(schematicName: string, opts?: SchematicSchemaT, tree?: Tree): Observable<UnitTestTree>;
|
|
31
|
+
runExternalSchematic<SchematicSchemaT extends object>(collectionName: string, schematicName: string, opts?: SchematicSchemaT, tree?: Tree): Promise<UnitTestTree>;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated since version 15.1. Use `runExternalSchematic` instead.
|
|
34
|
+
*/
|
|
27
35
|
runExternalSchematicAsync<SchematicSchemaT extends object>(collectionName: string, schematicName: string, opts?: SchematicSchemaT, tree?: Tree): Observable<UnitTestTree>;
|
|
28
36
|
callRule(rule: Rule, tree: Tree, parentContext?: Partial<SchematicContext>): Observable<Tree>;
|
|
29
37
|
}
|
|
@@ -10,7 +10,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.SchematicTestRunner = exports.UnitTestTree = void 0;
|
|
11
11
|
const core_1 = require("@angular-devkit/core");
|
|
12
12
|
const rxjs_1 = require("rxjs");
|
|
13
|
-
const operators_1 = require("rxjs/operators");
|
|
14
13
|
const src_1 = require("../src");
|
|
15
14
|
const call_1 = require("../src/rules/call");
|
|
16
15
|
const node_1 = require("../tasks/node");
|
|
@@ -57,22 +56,32 @@ class SchematicTestRunner {
|
|
|
57
56
|
registerCollection(collectionName, collectionPath) {
|
|
58
57
|
this._engineHost.registerCollection(collectionName, collectionPath);
|
|
59
58
|
}
|
|
60
|
-
|
|
59
|
+
async runSchematic(schematicName, opts, tree) {
|
|
61
60
|
const schematic = this._collection.createSchematic(schematicName, true);
|
|
62
61
|
const host = (0, rxjs_1.of)(tree || new src_1.HostTree());
|
|
63
62
|
this._engineHost.clearTasks();
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
.pipe((0, operators_1.map)((tree) => new UnitTestTree(tree)));
|
|
63
|
+
const newTree = await schematic.call(opts || {}, host, { logger: this._logger }).toPromise();
|
|
64
|
+
return new UnitTestTree(newTree);
|
|
67
65
|
}
|
|
68
|
-
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated since version 15.1. Use `runSchematic` instead.
|
|
68
|
+
*/
|
|
69
|
+
runSchematicAsync(schematicName, opts, tree) {
|
|
70
|
+
return (0, rxjs_1.from)(this.runSchematic(schematicName, opts, tree));
|
|
71
|
+
}
|
|
72
|
+
async runExternalSchematic(collectionName, schematicName, opts, tree) {
|
|
69
73
|
const externalCollection = this._engine.createCollection(collectionName);
|
|
70
74
|
const schematic = externalCollection.createSchematic(schematicName, true);
|
|
71
75
|
const host = (0, rxjs_1.of)(tree || new src_1.HostTree());
|
|
72
76
|
this._engineHost.clearTasks();
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
const newTree = await schematic.call(opts || {}, host, { logger: this._logger }).toPromise();
|
|
78
|
+
return new UnitTestTree(newTree);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated since version 15.1. Use `runExternalSchematic` instead.
|
|
82
|
+
*/
|
|
83
|
+
runExternalSchematicAsync(collectionName, schematicName, opts, tree) {
|
|
84
|
+
return (0, rxjs_1.from)(this.runExternalSchematic(collectionName, schematicName, opts, tree));
|
|
76
85
|
}
|
|
77
86
|
callRule(rule, tree, parentContext) {
|
|
78
87
|
const context = this._engine.createContext({}, parentContext);
|