"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.UseCmd = 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 UseCmd {
  constructor(workspace) {
    this.workspace = workspace;
    _defineProperty(this, "name", 'use <component-id>');
    _defineProperty(this, "group", 'collaborate');
    _defineProperty(this, "description", 'set aspects in the workspace/scope config to make them loadable by the workspace/scope');
    _defineProperty(this, "helpUrl", 'reference/workspace/workspace-json#adding-an-aspect-to-the-workspace');
    _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);
  }
  async report([id]) {
    const aspectIdAdded = await this.workspace.use(id);
    return _chalk().default.green(`workspace.jsonc updated successfully! features and extensions from "${aspectIdAdded}" are now available.`);
  }
}
exports.UseCmd = UseCmd;

//# sourceMappingURL=use.cmd.js.map