UNPKG

@teambit/workspace

Version:
42 lines (40 loc) 1.95 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UnuseCmd = void 0; function _chalk() { const data = _interopRequireDefault(require("chalk")); _chalk = function () { return data; }; return data; } function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } class UnuseCmd { constructor(workspace) { this.workspace = workspace; _defineProperty(this, "name", 'unuse <component-id>'); _defineProperty(this, "group", 'workspace-setup'); _defineProperty(this, "description", 'unset aspects in the workspace config (opposite of "use" command)'); _defineProperty(this, "arguments", [{ name: 'component-id', description: 'the component ID of the aspect' }]); _defineProperty(this, "alias", ''); _defineProperty(this, "options", []); _defineProperty(this, "loader", true); _defineProperty(this, "remoteOp", true); _defineProperty(this, "private", true); } async report([id]) { const result = await this.workspace.unuse(id); if (!result) return _chalk().default.yellow(`"${id}" was not found in the workspace.jsonc file.`); return _chalk().default.green(`workspace.jsonc updated successfully! the aspect "${id}" has been removed.`); } } exports.UnuseCmd = UnuseCmd; //# sourceMappingURL=unuse.cmd.js.map