1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var schematics_1 = require("@angular-devkit/schematics");
|
4 | var schematics_core_1 = require("../../schematics-core");
|
5 | function updateSchematicCollections(host) {
|
6 | var workspace = (0, schematics_core_1.getWorkspace)(host);
|
7 | var path = (0, schematics_core_1.getWorkspacePath)(host);
|
8 | workspace.cli = workspace.cli || {};
|
9 | workspace.cli.schematicCollections = workspace.cli.schematicCollections || [];
|
10 | if (workspace.cli.defaultCollection) {
|
11 | workspace.cli.schematicCollections.push(workspace.cli.defaultCollection);
|
12 | delete workspace.cli.defaultCollection;
|
13 | }
|
14 | workspace.cli.schematicCollections.push('@ngrx/schematics');
|
15 | host.overwrite(path, JSON.stringify(workspace, null, 2));
|
16 | }
|
17 | function updateWorkspaceCli() {
|
18 | return function (host) {
|
19 | updateSchematicCollections(host);
|
20 | return host;
|
21 | };
|
22 | }
|
23 | function default_1() {
|
24 | return function (host, context) {
|
25 | return (0, schematics_1.chain)([updateWorkspaceCli()])(host, context);
|
26 | };
|
27 | }
|
28 | exports.default = default_1;
|
29 |
|
\ | No newline at end of file |