UNPKG

1.05 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.setDefaultCollection = void 0;
4const workspace_1 = require("../workspace");
5/**
6 * Sets the default collection to the provided collection name
7 * The collection name is only set in case the current defaultCollection is undefined or set to '@nrwl/workspace'
8 * @param collectionName Name of the collection to be set as defaultCollection
9 * @deprecated nxJson defaultCollection will be removed
10 */
11function setDefaultCollection(collectionName) {
12 return (0, workspace_1.updateWorkspace)((workspace) => {
13 workspace.extensions.cli = workspace.extensions.cli || {};
14 const defaultCollection = workspace.extensions.cli &&
15 workspace.extensions.cli.defaultCollection;
16 if (!defaultCollection || defaultCollection === '@nrwl/workspace') {
17 workspace.extensions.cli.defaultCollection =
18 collectionName;
19 }
20 });
21}
22exports.setDefaultCollection = setDefaultCollection;
23//# sourceMappingURL=workspace.js.map
\No newline at end of file