1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.replaceTaoWithNx = void 0;
|
4 | const devkit_1 = require("@nrwl/devkit");
|
5 | function replaceTaoWithNx(host) {
|
6 | (0, devkit_1.updateJson)(host, 'package.json', (json) => {
|
7 | var _a, _b;
|
8 | if ((_a = json.dependencies) === null || _a === void 0 ? void 0 : _a['@nrwl/workspace']) {
|
9 | json.dependencies['nx'] = json.dependencies['@nrwl/workspace'];
|
10 | }
|
11 | else if ((_b = json.devDependencies) === null || _b === void 0 ? void 0 : _b['@nrwl/workspace']) {
|
12 | json.devDependencies['nx'] = json.devDependencies['@nrwl/workspace'];
|
13 | }
|
14 | removeTao(json.dependencies);
|
15 | removeTao(json.devDependencies);
|
16 | return json;
|
17 | });
|
18 | const pmc = (0, devkit_1.getPackageManagerCommand)();
|
19 | devkit_1.logger.info(`Please run ${pmc.install} to ensure the correct version of Nx is installed.`);
|
20 | }
|
21 | exports.replaceTaoWithNx = replaceTaoWithNx;
|
22 | function removeTao(json) {
|
23 | if (!json)
|
24 | return;
|
25 | json['@nrwl/tao'] = undefined;
|
26 | }
|
27 | exports.default = replaceTaoWithNx;
|
28 |
|
\ | No newline at end of file |