1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.updateTscExecutorLocation = void 0;
|
4 | const tslib_1 = require("tslib");
|
5 | const devkit_1 = require("@nrwl/devkit");
|
6 | const versions_1 = require("../../utils/versions");
|
7 | function updateTscExecutorLocation(host) {
|
8 | return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
9 | const projects = (0, devkit_1.getProjects)(host);
|
10 | let used = false;
|
11 | for (const [project, projectConfig] of projects.entries()) {
|
12 | for (const [target, targetConfig] of Object.entries(projectConfig.targets || {})) {
|
13 | if (targetConfig.executor === '@nrwl/workspace:tsc') {
|
14 | projectConfig.targets[target].executor = '@nrwl/js:tsc';
|
15 | (0, devkit_1.updateProjectConfiguration)(host, project, projectConfig);
|
16 | used = true;
|
17 | }
|
18 | }
|
19 | }
|
20 | if (used) {
|
21 | (0, devkit_1.addDependenciesToPackageJson)(host, {}, {
|
22 | '@nrwl/js': versions_1.nxVersion,
|
23 | });
|
24 | }
|
25 | yield (0, devkit_1.formatFiles)(host);
|
26 | return () => (0, devkit_1.installPackagesTask)(host);
|
27 | });
|
28 | }
|
29 | exports.updateTscExecutorLocation = updateTscExecutorLocation;
|
30 | exports.default = updateTscExecutorLocation;
|
31 |
|
\ | No newline at end of file |