1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const tslib_1 = require("tslib");
|
4 | const devkit_1 = require("@nrwl/devkit");
|
5 | const versions_1 = require("../../utils/versions");
|
6 | function default_1(host, schema) {
|
7 | return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
8 | const options = normalizeOptions(schema);
|
9 | (0, devkit_1.generateFiles)(host, (0, devkit_1.joinPathFragments)(__dirname, 'files'), (0, devkit_1.joinPathFragments)('tools/generators', schema.name), options);
|
10 | const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, {}, {
|
11 | '@nrwl/devkit': versions_1.nxVersion,
|
12 |
|
13 |
|
14 | '@types/node': 'latest',
|
15 | });
|
16 | if (!schema.skipFormat) {
|
17 | yield (0, devkit_1.formatFiles)(host);
|
18 | }
|
19 | return installTask;
|
20 | });
|
21 | }
|
22 | exports.default = default_1;
|
23 | function normalizeOptions(options) {
|
24 | const name = (0, devkit_1.names)(options.name).fileName;
|
25 | return Object.assign(Object.assign({}, options), { name, tmpl: '' });
|
26 | }
|
27 |
|
\ | No newline at end of file |