uninstall.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. function _cliTools() {
  7. const data = require("@react-native-community/cli-tools");
  8. _cliTools = function () {
  9. return data;
  10. };
  11. return data;
  12. }
  13. var PackageManager = _interopRequireWildcard(require("../../tools/packageManager"));
  14. var _unlink = _interopRequireDefault(require("../link/unlink"));
  15. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  16. function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
  17. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
  18. /**
  19. * Copyright (c) Facebook, Inc. and its affiliates.
  20. *
  21. * This source code is licensed under the MIT license found in the
  22. * LICENSE file in the root directory of this source tree.
  23. *
  24. */
  25. async function uninstall(args, ctx) {
  26. const name = args[0];
  27. _cliTools().logger.info(`Unlinking "${name}"...`);
  28. await _unlink.default.func([name], ctx, {});
  29. _cliTools().logger.info(`Uninstalling "${name}"...`);
  30. await PackageManager.uninstall([name], {
  31. root: ctx.root
  32. });
  33. _cliTools().logger.success(`Successfully uninstalled and unlinked "${name}"`);
  34. }
  35. var _default = {
  36. func: uninstall,
  37. description: 'uninstall and unlink native dependencies',
  38. name: 'uninstall <packageName>'
  39. };
  40. exports.default = _default;
  41. //# sourceMappingURL=uninstall.js.map