UNPKG

1.14 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var schematics_1 = require("@angular-devkit/schematics");
4var schematics_core_1 = require("../../schematics-core");
5function 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}
17function updateWorkspaceCli() {
18 return function (host) {
19 updateSchematicCollections(host);
20 return host;
21 };
22}
23function default_1() {
24 return function (host, context) {
25 return (0, schematics_1.chain)([updateWorkspaceCli()])(host, context);
26 };
27}
28exports.default = default_1;
29//# sourceMappingURL=index.js.map
\No newline at end of file