"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

function _defineProperty2() {
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

  _defineProperty2 = function () {
    return data;
  };

  return data;
}

function _command() {
  const data = _interopRequireDefault(require("../../command"));

  _command = function () {
    return data;
  };

  return data;
}

function _consumer() {
  const data = require("../../../api/consumer");

  _consumer = function () {
    return data;
  };

  return data;
}

class Isolate extends _command().default {
  constructor(...args) {
    super(...args);
    (0, _defineProperty2().default)(this, "name", 'isolate <id> [scopePath]');
    (0, _defineProperty2().default)(this, "description", 'isolate component');
    (0, _defineProperty2().default)(this, "alias", '');
    (0, _defineProperty2().default)(this, "opts", [['d', 'directory [directory] ', 'path to store isolated component'], ['w', 'write-bit-dependencies [boolean] ', 'write bit components dependencies to package.json file'], ['l', 'npm-links [boolean]', 'point dependencies link files to npm package'], ['i', 'install-packages [boolean]', 'install npm package dependencies'], ['', 'install-peer-dependencies [boolean]', 'install peer npm package dependencies'], ['', 'dist', 'write dist files (when exist) to the configured directory'], ['', 'conf', 'write the configuration file (bit.json)'], ['', 'no-package-json [boolean]', 'do not generate package.json for the isolated component'], ['o', 'override [boolean]', 'override existing isolated component'], ['', 'save-dependencies-as-components [boolean]', 'import the dependencies as bit components instead of as npm packages'], ['', 'exclude-registry-prefix [boolean]', "exclude the registry prefix from the component's name in the package.json"], ['v', 'verbose [boolean]', 'print more logs'], ['', 'silent-client-result [boolean]', 'print environment install result'], ['', 'use-capsule [boolean]', 'use capsule with fs-container']]);
    (0, _defineProperty2().default)(this, "loader", true);
  }

  action([id, scopePath], opts) {
    opts.writeToPath = opts.directory;
    return (0, _consumer().isolate)(id, scopePath || process.cwd(), opts);
  }

  report(directory) {
    return directory;
  }

}

exports.default = Isolate;