UNPKG

nx-mesh

Version:
26 lines 1.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setDefaults = void 0; const devkit_1 = require("@nrwl/devkit"); function setDefaults(host, options) { const workspace = (0, devkit_1.readWorkspaceConfiguration)(host); if (!workspace.defaultProject) { workspace.defaultProject = options.projectName; } if (workspace.targetDefaults) { workspace.targetDefaults = Object.assign(Object.assign({}, workspace.targetDefaults), { validate: { dependsOn: ['build'], } }); } workspace.generators = workspace.generators || {}; workspace.generators['nx-mesh'] = workspace.generators['nx-mesh'] || {}; const prev = workspace.generators['nx-mesh']; workspace.generators = Object.assign(Object.assign({}, workspace.generators), { 'nx-mesh': Object.assign(Object.assign({}, prev), { [options.isApp ? 'application' : 'sdk']: Object.assign({ meshConfig: options.meshConfigExt, linter: options.linter }, prev[options.isApp ? 'application' : 'sdk']) }) }); if (!workspace.defaultProject) { workspace.defaultProject = options.name; } (0, devkit_1.updateWorkspaceConfiguration)(host, workspace); } exports.setDefaults = setDefaults; exports.default = setDefaults; //# sourceMappingURL=set-defaults.js.map