1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
10 | exports.externalSchematic = externalSchematic;
|
11 | exports.schematic = schematic;
|
12 | const rxjs_1 = require("rxjs");
|
13 | const interface_1 = require("../tree/interface");
|
14 | const static_1 = require("../tree/static");
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | function externalSchematic(collectionName, schematicName, options, executionOptions) {
|
23 | return (input, context) => {
|
24 | const collection = context.engine.createCollection(collectionName, context.schematic.collection);
|
25 | const schematic = collection.createSchematic(schematicName);
|
26 | return schematic.call(options, (0, rxjs_1.of)((0, static_1.branch)(input)), context, executionOptions).pipe((0, rxjs_1.last)(), (0, rxjs_1.map)((x) => {
|
27 | input.merge(x, interface_1.MergeStrategy.AllowOverwriteConflict);
|
28 | return input;
|
29 | }));
|
30 | };
|
31 | }
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | function schematic(schematicName, options, executionOptions) {
|
39 | return (input, context) => {
|
40 | const collection = context.schematic.collection;
|
41 | const schematic = collection.createSchematic(schematicName, true);
|
42 | return schematic.call(options, (0, rxjs_1.of)((0, static_1.branch)(input)), context, executionOptions).pipe((0, rxjs_1.last)(), (0, rxjs_1.map)((x) => {
|
43 |
|
44 |
|
45 | input.merge(x, interface_1.MergeStrategy.AllowOverwriteConflict);
|
46 | return input;
|
47 | }));
|
48 | };
|
49 | }
|