UNPKG

1.3 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const tslib_1 = require("tslib");
4const devkit_1 = require("@nrwl/devkit");
5function update(host) {
6 return tslib_1.__awaiter(this, void 0, void 0, function* () {
7 const nxJson = (0, devkit_1.readJson)(host, 'nx.json');
8 // updateProjectConfiguration automatically saves the project opts into workspace/project.json
9 if (nxJson.projects) {
10 Object.entries(nxJson.projects).forEach(([p, nxJsonConfig]) => {
11 var _a, _b;
12 const configuration = (0, devkit_1.readProjectConfiguration)(host, p);
13 (_a = configuration.tags) !== null && _a !== void 0 ? _a : (configuration.tags = nxJsonConfig.tags);
14 (_b = configuration.implicitDependencies) !== null && _b !== void 0 ? _b : (configuration.implicitDependencies = nxJsonConfig.implicitDependencies);
15 (0, devkit_1.updateProjectConfiguration)(host, p, configuration);
16 });
17 delete nxJson.projects;
18 }
19 (0, devkit_1.writeJson)(host, 'nx.json', nxJson);
20 yield (0, devkit_1.formatFiles)(host); // format files handles moving config options to new spots.
21 });
22}
23exports.default = update;
24//# sourceMappingURL=config-locations.js.map
\No newline at end of file