UNPKG

@nrwl/workspace

Version:

The Workspace plugin contains executors and generators that are useful for any Nx workspace. It should be present in every Nx workspace and other plugins build on it.

34 lines 1.59 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const devkit_1 = require("@nrwl/devkit"); function update(tree) { return tslib_1.__awaiter(this, void 0, void 0, function* () { const nxJson = (0, devkit_1.readJson)(tree, 'nx.json'); // updateProjectConfiguration automatically saves the project opts into workspace/project.json if (nxJson.projects) { Object.entries(nxJson.projects).forEach(([p, nxJsonConfiguration]) => { var _a, _b; const configuration = (0, devkit_1.readProjectConfiguration)(tree, p); (_a = configuration.tags) !== null && _a !== void 0 ? _a : (configuration.tags = nxJsonConfiguration.tags); (_b = configuration.implicitDependencies) !== null && _b !== void 0 ? _b : (configuration.implicitDependencies = nxJsonConfiguration.implicitDependencies); (0, devkit_1.updateProjectConfiguration)(tree, p, configuration); }); delete nxJson.projects; } (0, devkit_1.writeJson)(tree, 'nx.json', nxJson); movePropertiesAreInNewLocations(tree); // move config options to new spots. yield (0, devkit_1.formatFiles)(tree); }); } exports.default = update; /** * `updateWorkspaceConfiguration` already handles * placing properties in their new locations, so * reading + updating it ensures that props are placed * correctly. */ function movePropertiesAreInNewLocations(tree) { return; } //# sourceMappingURL=config-locations.js.map