@teambit/remove 0.0.313 → 0.0.315

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,32 @@
1
+ import { Command, CommandOptions } from '@teambit/cli';
2
+ import { Workspace } from '@teambit/workspace';
3
+ import { RemoveMain } from './remove.main.runtime';
4
+ export declare class DeleteCmd implements Command {
5
+ private remove;
6
+ private workspace?;
7
+ name: string;
8
+ description: string;
9
+ extendedDescription: string;
10
+ arguments: {
11
+ name: string;
12
+ description: string;
13
+ }[];
14
+ group: string;
15
+ helpUrl: string;
16
+ skipWorkspace: boolean;
17
+ alias: string;
18
+ options: CommandOptions;
19
+ loader: boolean;
20
+ migration: boolean;
21
+ remoteOp: boolean;
22
+ constructor(remove: RemoveMain, workspace?: Workspace | undefined);
23
+ report([componentsPattern]: [string], { force, lane, updateMain, hard, silent, }: {
24
+ force?: boolean;
25
+ lane?: boolean;
26
+ updateMain?: boolean;
27
+ hard?: boolean;
28
+ silent?: boolean;
29
+ }): Promise<string>;
30
+ private paintArray;
31
+ private removePrompt;
32
+ }
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ require("core-js/modules/es.array.iterator.js");
5
+ require("core-js/modules/es.promise.js");
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.DeleteCmd = void 0;
10
+ function _defineProperty2() {
11
+ const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
+ _defineProperty2 = function () {
13
+ return data;
14
+ };
15
+ return data;
16
+ }
17
+ function _chalk() {
18
+ const data = _interopRequireDefault(require("chalk"));
19
+ _chalk = function () {
20
+ return data;
21
+ };
22
+ return data;
23
+ }
24
+ function _yesno() {
25
+ const data = _interopRequireDefault(require("yesno"));
26
+ _yesno = function () {
27
+ return data;
28
+ };
29
+ return data;
30
+ }
31
+ function _bitError() {
32
+ const data = require("@teambit/bit-error");
33
+ _bitError = function () {
34
+ return data;
35
+ };
36
+ return data;
37
+ }
38
+ function _constants() {
39
+ const data = require("@teambit/legacy/dist/constants");
40
+ _constants = function () {
41
+ return data;
42
+ };
43
+ return data;
44
+ }
45
+ function _removeTemplate() {
46
+ const data = require("./remove-template");
47
+ _removeTemplate = function () {
48
+ return data;
49
+ };
50
+ return data;
51
+ }
52
+ class DeleteCmd {
53
+ constructor(remove, workspace) {
54
+ this.remove = remove;
55
+ this.workspace = workspace;
56
+ (0, _defineProperty2().default)(this, "name", 'delete <component-pattern>');
57
+ (0, _defineProperty2().default)(this, "description", 'mark components as deleted on the remote');
58
+ (0, _defineProperty2().default)(this, "extendedDescription", `to remove components from your local workspace only, use "bit remove" command.
59
+ this command marks the components as deleted, and after snap/tag and export they will be marked as deleted from the remote scope as well.
60
+ `);
61
+ (0, _defineProperty2().default)(this, "arguments", [{
62
+ name: 'component-pattern',
63
+ description: _constants().COMPONENT_PATTERN_HELP
64
+ }]);
65
+ (0, _defineProperty2().default)(this, "group", 'collaborate');
66
+ (0, _defineProperty2().default)(this, "helpUrl", 'docs/components/removing-components');
67
+ (0, _defineProperty2().default)(this, "skipWorkspace", true);
68
+ (0, _defineProperty2().default)(this, "alias", '');
69
+ (0, _defineProperty2().default)(this, "options", [['', 'lane', 'when on a lane, delete the component from this lane only. avoid merging it to main or other lanes'], ['', 'update-main', 'EXPERIMENTAL. delete component/s on the main lane after merging this lane into main'], ['f', 'force', 'removes the component from the scope, even if used as a dependency. WARNING: components that depend on this component will corrupt'], ['s', 'silent', 'skip confirmation'], ['', 'hard', 'NOT-RECOMMENDED. delete a component completely from a remote scope. careful! this is a permanent change that could corrupt dependents.']]);
70
+ (0, _defineProperty2().default)(this, "loader", true);
71
+ (0, _defineProperty2().default)(this, "migration", true);
72
+ (0, _defineProperty2().default)(this, "remoteOp", true);
73
+ }
74
+ async report([componentsPattern], {
75
+ force = false,
76
+ lane = false,
77
+ updateMain = false,
78
+ hard = false,
79
+ silent = false
80
+ }) {
81
+ var _this$workspace, _this$workspace2;
82
+ if ((_this$workspace = this.workspace) !== null && _this$workspace !== void 0 && _this$workspace.isOnLane() && !hard && !lane && !updateMain) {
83
+ throw new (_bitError().BitError)(`error: to delete components when on a lane, use --lane flag`);
84
+ }
85
+ if ((_this$workspace2 = this.workspace) !== null && _this$workspace2 !== void 0 && _this$workspace2.isOnMain() && updateMain) {
86
+ throw new (_bitError().BitError)(`--update-main is relevant only when on a lane`);
87
+ }
88
+ if (!silent) {
89
+ await this.removePrompt(hard);
90
+ }
91
+ if (hard) {
92
+ const {
93
+ localResult,
94
+ remoteResult = []
95
+ } = await this.remove.remove({
96
+ componentsPattern,
97
+ remote: true,
98
+ force
99
+ });
100
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
101
+ let localMessage = (0, _removeTemplate().removeTemplate)(localResult, false);
102
+ if (localMessage !== '') localMessage += '\n';
103
+ return `${localMessage}${this.paintArray(remoteResult)}`;
104
+ }
105
+ const removedCompIds = await this.remove.deleteComps(componentsPattern, {
106
+ updateMain
107
+ });
108
+ return `${_chalk().default.green('successfully deleted the following components:')}
109
+ ${removedCompIds.join('\n')}
110
+
111
+ ${_chalk().default.bold('to update the remote, please tag/snap and then export. to revert, please use "bit recover"')}`;
112
+ }
113
+ paintArray(removedObjectsArray) {
114
+ return removedObjectsArray.map(item => (0, _removeTemplate().removeTemplate)(item, true));
115
+ }
116
+ async removePrompt(hard) {
117
+ this.remove.logger.clearStatusLine();
118
+ const remoteOrLocalOutput = hard ? `WARNING: the component(s) will be permanently deleted from the remote with no option to recover. prefer omitting --hard to only mark the component as deleted` : `this command will mark the component as deleted, and it won’t be shown on the remote scope after tag/snap and export.
119
+ if your intent, is to remove the component only from your local workspace, refer to bit remove.`;
120
+ const ok = await (0, _yesno().default)({
121
+ question: `${remoteOrLocalOutput}
122
+ ${_chalk().default.bold('Would you like to proceed? [yes(y)/no(n)]')}`
123
+ });
124
+ if (!ok) {
125
+ throw new (_bitError().BitError)('the operation has been canceled');
126
+ }
127
+ }
128
+ }
129
+ exports.DeleteCmd = DeleteCmd;
130
+
131
+ //# sourceMappingURL=delete-cmd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_constants","_removeTemplate","DeleteCmd","constructor","remove","workspace","_defineProperty2","default","name","description","COMPONENT_PATTERN_HELP","report","componentsPattern","force","lane","updateMain","hard","silent","_this$workspace","_this$workspace2","isOnLane","BitError","isOnMain","removePrompt","localResult","remoteResult","remote","localMessage","removeTemplate","paintArray","removedCompIds","deleteComps","chalk","green","join","bold","removedObjectsArray","map","item","logger","clearStatusLine","remoteOrLocalOutput","ok","yesno","question","exports"],"sources":["delete-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport yesno from 'yesno';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport RemovedObjects from '@teambit/legacy/dist/scope/removed-components';\nimport RemovedLocalObjects from '@teambit/legacy/dist/scope/removed-local-objects';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { RemoveMain } from './remove.main.runtime';\nimport { removeTemplate } from './remove-template';\n\nexport class DeleteCmd implements Command {\n name = 'delete <component-pattern>';\n description = 'mark components as deleted on the remote';\n extendedDescription = `to remove components from your local workspace only, use \"bit remove\" command.\nthis command marks the components as deleted, and after snap/tag and export they will be marked as deleted from the remote scope as well.\n`;\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n group = 'collaborate';\n helpUrl = 'docs/components/removing-components';\n skipWorkspace = true;\n alias = '';\n options = [\n ['', 'lane', 'when on a lane, delete the component from this lane only. avoid merging it to main or other lanes'],\n ['', 'update-main', 'EXPERIMENTAL. delete component/s on the main lane after merging this lane into main'],\n [\n 'f',\n 'force',\n 'removes the component from the scope, even if used as a dependency. WARNING: components that depend on this component will corrupt',\n ],\n ['s', 'silent', 'skip confirmation'],\n [\n '',\n 'hard',\n 'NOT-RECOMMENDED. delete a component completely from a remote scope. careful! this is a permanent change that could corrupt dependents.',\n ],\n ] as CommandOptions;\n loader = true;\n migration = true;\n remoteOp = true;\n\n constructor(private remove: RemoveMain, private workspace?: Workspace) {}\n\n async report(\n [componentsPattern]: [string],\n {\n force = false,\n lane = false,\n updateMain = false,\n hard = false,\n silent = false,\n }: {\n force?: boolean;\n lane?: boolean;\n updateMain?: boolean;\n hard?: boolean;\n silent?: boolean;\n }\n ) {\n if (this.workspace?.isOnLane() && !hard && !lane && !updateMain) {\n throw new BitError(`error: to delete components when on a lane, use --lane flag`);\n }\n if (this.workspace?.isOnMain() && updateMain) {\n throw new BitError(`--update-main is relevant only when on a lane`);\n }\n\n if (!silent) {\n await this.removePrompt(hard);\n }\n\n if (hard) {\n const {\n localResult,\n remoteResult = [],\n }: {\n localResult: RemovedLocalObjects;\n remoteResult: RemovedObjects[];\n } = await this.remove.remove({ componentsPattern, remote: true, force });\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n let localMessage = removeTemplate(localResult, false);\n if (localMessage !== '') localMessage += '\\n';\n return `${localMessage}${this.paintArray(remoteResult)}`;\n }\n\n const removedCompIds = await this.remove.deleteComps(componentsPattern, { updateMain });\n return `${chalk.green('successfully deleted the following components:')}\n${removedCompIds.join('\\n')}\n\n${chalk.bold('to update the remote, please tag/snap and then export. to revert, please use \"bit recover\"')}`;\n }\n\n private paintArray(removedObjectsArray: RemovedObjects[]) {\n return removedObjectsArray.map((item) => removeTemplate(item, true));\n }\n\n private async removePrompt(hard?: boolean) {\n this.remove.logger.clearStatusLine();\n const remoteOrLocalOutput = hard\n ? `WARNING: the component(s) will be permanently deleted from the remote with no option to recover. prefer omitting --hard to only mark the component as deleted`\n : `this command will mark the component as deleted, and it won’t be shown on the remote scope after tag/snap and export.\nif your intent, is to remove the component only from your local workspace, refer to bit remove.`;\n\n const ok = await yesno({\n question: `${remoteOrLocalOutput}\n${chalk.bold('Would you like to proceed? [yes(y)/no(n)]')}`,\n });\n if (!ok) {\n throw new BitError('the operation has been canceled');\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,gBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,eAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMO,SAAS,CAAoB;EAmCxCC,WAAWA,CAASC,MAAkB,EAAUC,SAAqB,EAAE;IAAA,KAAnDD,MAAkB,GAAlBA,MAAkB;IAAA,KAAUC,SAAqB,GAArBA,SAAqB;IAAA,IAAAC,gBAAA,GAAAC,OAAA,gBAlC9D,4BAA4B;IAAA,IAAAD,gBAAA,GAAAC,OAAA,uBACrB,0CAA0C;IAAA,IAAAD,gBAAA,GAAAC,OAAA,+BACjC;AACzB;AACA,CAAC;IAAA,IAAAD,gBAAA,GAAAC,OAAA,qBACa,CACV;MACEC,IAAI,EAAE,mBAAmB;MACzBC,WAAW,EAAEC;IACf,CA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CAACG,IAAI,CAAC,2CAA2C,CAAE;IACtD,CAAC,CAAC;IACF,IAAI,CAACO,EAAE,EAAE;MACP,MAAM,KAAIrB,oBAAQ,EAAC,iCAAiC,CAAC;IACvD;EACF;AACF;AAACwB,OAAA,CAAA3C,SAAA,GAAAA,SAAA"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { RemoveAspect } from './remove.aspect';
2
2
  export type { RemoveMain, RemoveInfo } from './remove.main.runtime';
3
+ export { removeTemplate } from './remove-template';
3
4
  export default RemoveAspect;
4
5
  export { RemoveAspect };
package/dist/index.js CHANGED
@@ -10,6 +10,12 @@ Object.defineProperty(exports, "RemoveAspect", {
10
10
  }
11
11
  });
12
12
  exports.default = void 0;
13
+ Object.defineProperty(exports, "removeTemplate", {
14
+ enumerable: true,
15
+ get: function () {
16
+ return _removeTemplate().removeTemplate;
17
+ }
18
+ });
13
19
  function _remove() {
14
20
  const data = require("./remove.aspect");
15
21
  _remove = function () {
@@ -17,6 +23,13 @@ function _remove() {
17
23
  };
18
24
  return data;
19
25
  }
26
+ function _removeTemplate() {
27
+ const data = require("./remove-template");
28
+ _removeTemplate = function () {
29
+ return data;
30
+ };
31
+ return data;
32
+ }
20
33
  var _default = _remove().RemoveAspect;
21
34
  exports.default = _default;
22
35
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_remove","data","require","_default","RemoveAspect","exports","default"],"sources":["index.ts"],"sourcesContent":["import { RemoveAspect } from './remove.aspect';\n\nexport type { RemoveMain, RemoveInfo } from './remove.main.runtime';\nexport default RemoveAspect;\nexport { RemoveAspect };\n"],"mappings":";;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA+C,IAAAE,QAAA,GAGhCC,sBAAY;AAAAC,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
1
+ {"version":3,"names":["_remove","data","require","_removeTemplate","_default","RemoveAspect","exports","default"],"sources":["index.ts"],"sourcesContent":["import { RemoveAspect } from './remove.aspect';\n\nexport type { RemoveMain, RemoveInfo } from './remove.main.runtime';\nexport { removeTemplate } from './remove-template';\nexport default RemoveAspect;\nexport { RemoveAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAmD,IAAAG,QAAA,GACpCC,sBAAY;AAAAC,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
@@ -1,6 +1,5 @@
1
1
  import { Command, CommandOptions } from '@teambit/cli';
2
2
  import { Workspace } from '@teambit/workspace';
3
- import RemovedObjects from '@teambit/legacy/dist/scope/removed-components';
4
3
  import { RemoveMain } from './remove.main.runtime';
5
4
  export declare class RemoveCmd implements Command {
6
5
  private remove;
@@ -21,14 +20,12 @@ export declare class RemoveCmd implements Command {
21
20
  migration: boolean;
22
21
  remoteOp: boolean;
23
22
  constructor(remove: RemoveMain, workspace?: Workspace | undefined);
24
- report([componentsPattern]: [string], { delete: softDelete, force, hard, fromLane, track, silent, keepFiles, }: {
25
- delete?: boolean;
23
+ report([componentsPattern]: [string], { force, fromLane, track, silent, keepFiles, }: {
26
24
  force?: boolean;
27
- hard?: boolean;
28
25
  track?: boolean;
29
26
  fromLane?: boolean;
30
27
  silent?: boolean;
31
28
  keepFiles?: boolean;
32
29
  }): Promise<string>;
33
- paintArray(removedObjectsArray: RemovedObjects[]): string[];
30
+ private removePrompt;
34
31
  }
@@ -21,9 +21,9 @@ function _chalk() {
21
21
  };
22
22
  return data;
23
23
  }
24
- function _yn() {
25
- const data = _interopRequireDefault(require("yn"));
26
- _yn = function () {
24
+ function _yesno() {
25
+ const data = _interopRequireDefault(require("yesno"));
26
+ _yesno = function () {
27
27
  return data;
28
28
  };
29
29
  return data;
@@ -35,40 +35,27 @@ function _bitError() {
35
35
  };
36
36
  return data;
37
37
  }
38
- function _prompts() {
39
- const data = require("@teambit/legacy/dist/prompts");
40
- _prompts = function () {
38
+ function _constants() {
39
+ const data = require("@teambit/legacy/dist/constants");
40
+ _constants = function () {
41
41
  return data;
42
42
  };
43
43
  return data;
44
44
  }
45
45
  function _removeTemplate() {
46
- const data = _interopRequireDefault(require("@teambit/legacy/dist/cli/templates/remove-template"));
46
+ const data = require("./remove-template");
47
47
  _removeTemplate = function () {
48
48
  return data;
49
49
  };
50
50
  return data;
51
51
  }
52
- function _constants() {
53
- const data = require("@teambit/legacy/dist/constants");
54
- _constants = function () {
55
- return data;
56
- };
57
- return data;
58
- }
59
52
  class RemoveCmd {
60
53
  constructor(remove, workspace) {
61
54
  this.remove = remove;
62
55
  this.workspace = workspace;
63
56
  (0, _defineProperty2().default)(this, "name", 'remove <component-pattern>');
64
- (0, _defineProperty2().default)(this, "description", 'remove component(s) from the workspace, or a remote scope (with a flag)');
65
- (0, _defineProperty2().default)(this, "extendedDescription", `to remove components from your local workspace only, use "bit remove" (with no flags).
66
-
67
- to remove a component from the remote scope, use "bit remove --delete", to mark the components as deleted.
68
- once tagged/snapped and exported, the remote scope will be updated and it'll be marked as deleted there as well.
69
-
70
- to remove components from a lane, use "bit lane remove-comp".
71
- `);
57
+ (0, _defineProperty2().default)(this, "description", 'remove component(s) from the local workspace');
58
+ (0, _defineProperty2().default)(this, "extendedDescription", `to mark components as deleted on the remote scope, use "bit delete".`);
72
59
  (0, _defineProperty2().default)(this, "arguments", [{
73
60
  name: 'component-pattern',
74
61
  description: _constants().COMPONENT_PATTERN_HELP
@@ -77,64 +64,51 @@ to remove components from a lane, use "bit lane remove-comp".
77
64
  (0, _defineProperty2().default)(this, "helpUrl", 'docs/components/removing-components');
78
65
  (0, _defineProperty2().default)(this, "skipWorkspace", true);
79
66
  (0, _defineProperty2().default)(this, "alias", 'rm');
80
- (0, _defineProperty2().default)(this, "options", [['', 'delete', 'mark the component as deleted. after tag/snap and export the remote will be updated'], ['', 'hard', 'remove a component completely from a remote scope. careful! this is a permanent change that could corrupt dependents. prefer --delete'],
67
+ (0, _defineProperty2().default)(this, "options", [
81
68
  // this option is confusing and probably not in use. if needed, move this to "bit lane remove-comp" command.
82
69
  // ['', 'from-lane', 'revert to main if exists on currently checked out lane, otherwise, remove it'],
83
- ['t', 'track', 'keep tracking component in .bitmap (default = false), helps transform a tagged-component to new'], ['', 'keep-files', 'keep component files (just untrack the component)'], ['f', 'force', 'removes the component from the scope, even if used as a dependency. WARNING: components that depend on this component will corrupt'], ['s', 'silent', 'skip confirmation']]);
70
+ ['t', 'track', 'keep tracking component in .bitmap (default = false), helps transform a tagged-component to new'], ['', 'keep-files', 'keep component files (just untrack the component)'], ['f', 'force', 'removes the component from the scope, even if used as a dependency. WARNING: you will need to fix the components that depend on this component'], ['s', 'silent', 'skip confirmation']]);
84
71
  (0, _defineProperty2().default)(this, "loader", true);
85
72
  (0, _defineProperty2().default)(this, "migration", true);
86
73
  (0, _defineProperty2().default)(this, "remoteOp", true);
87
74
  }
88
75
  async report([componentsPattern], {
89
- delete: softDelete = false,
90
76
  force = false,
91
- hard = false,
92
77
  fromLane = false,
93
78
  track = false,
94
79
  silent = false,
95
80
  keepFiles = false
96
81
  }) {
97
- var _this$workspace;
98
- if (!hard && (_this$workspace = this.workspace) !== null && _this$workspace !== void 0 && _this$workspace.isOnLane()) {
99
- throw new (_bitError().BitError)(`error: unable to remove components when on a lane, please run "bit lane remove-comp" instead`);
100
- }
101
- if (softDelete) {
102
- if (hard) throw new (_bitError().BitError)(`error: --hard and --delete cannot be used together. soft delete can only be done locally, after tag/snap and export it updates the remote`);
103
- if (track) throw new (_bitError().BitError)(`error: please use either --delete or --track, not both`);
104
- if (keepFiles) throw new (_bitError().BitError)(`error: please use either --delete or --keep-files, not both`);
105
- if (fromLane) throw new (_bitError().BitError)(`error: please use either --delete or --from-lane, not both`);
106
- const removedCompIds = await this.remove.markRemoveOnMain(componentsPattern);
107
- return `${_chalk().default.green('successfully soft-removed the following components:')}
108
- ${removedCompIds.join('\n')}
109
-
110
- ${_chalk().default.bold('to update the remote, please tag/snap and then export. to revert, please use "bit recover"')}`;
111
- }
112
82
  if (!silent) {
113
- const willDeleteFiles = !hard && !keepFiles;
114
- const removePromptResult = await (0, _prompts().removePrompt)(willDeleteFiles, hard)();
115
- // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
116
- if (!(0, _yn().default)(removePromptResult.shouldRemove)) {
117
- throw new (_bitError().BitError)('the operation has been canceled');
118
- }
83
+ await this.removePrompt(!keepFiles);
119
84
  }
120
85
  const {
121
- localResult,
122
- remoteResult = []
86
+ localResult
123
87
  } = await this.remove.remove({
124
88
  componentsPattern,
125
- remote: hard,
126
89
  force,
127
90
  track,
128
91
  deleteFiles: !keepFiles,
129
92
  fromLane
130
93
  });
131
94
  // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
132
- let localMessage = (0, _removeTemplate().default)(localResult, false);
133
- if (localMessage !== '') localMessage += '. Note: these components were not deleted from the remote - if you want to delete components use --delete\n';
134
- return `${localMessage}${this.paintArray(remoteResult)}`;
95
+ const localMessage = (0, _removeTemplate().removeTemplate)(localResult, false);
96
+ // if (localMessage !== '')
97
+ // localMessage +=
98
+ // '. Note: these components were not deleted from the remote - if you want to delete components run "bit delete"\n';
99
+ return localMessage;
135
100
  }
136
- paintArray(removedObjectsArray) {
137
- return removedObjectsArray.map(item => (0, _removeTemplate().default)(item, true));
101
+ async removePrompt(deleteFiles) {
102
+ this.remove.logger.clearStatusLine();
103
+ const filesDeletionStr = deleteFiles ? ' and the files will be deleted from the filesystem (can be avoided by entering --keep-files)' : '';
104
+ const ok = await (0, _yesno().default)({
105
+ question: `this command will remove the component/s only from your local workspace. if your intent is to delete the component/s also from the remote scope, refer to "bit delete".
106
+ the component(s) will be untracked${filesDeletionStr}.
107
+ ${_chalk().default.bold('Would you like to proceed? [yes(y)/no(n)]')}`
108
+ });
109
+ if (!ok) {
110
+ throw new (_bitError().BitError)('the operation has been canceled');
111
+ }
138
112
  }
139
113
  }
140
114
  exports.RemoveCmd = RemoveCmd;
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yn","_bitError","_prompts","_removeTemplate","_constants","RemoveCmd","constructor","remove","workspace","_defineProperty2","default","name","description","COMPONENT_PATTERN_HELP","report","componentsPattern","delete","softDelete","force","hard","fromLane","track","silent","keepFiles","_this$workspace","isOnLane","BitError","removedCompIds","markRemoveOnMain","chalk","green","join","bold","willDeleteFiles","removePromptResult","removePrompt","yn","shouldRemove","localResult","remoteResult","remote","deleteFiles","localMessage","paintRemoved","paintArray","removedObjectsArray","map","item","exports"],"sources":["remove-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport yn from 'yn';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport { removePrompt } from '@teambit/legacy/dist/prompts';\nimport RemovedObjects from '@teambit/legacy/dist/scope/removed-components';\nimport RemovedLocalObjects from '@teambit/legacy/dist/scope/removed-local-objects';\nimport paintRemoved from '@teambit/legacy/dist/cli/templates/remove-template';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { RemoveMain } from './remove.main.runtime';\n\nexport class RemoveCmd implements Command {\n name = 'remove <component-pattern>';\n description = 'remove component(s) from the workspace, or a remote scope (with a flag)';\n extendedDescription = `to remove components from your local workspace only, use \"bit remove\" (with no flags).\n\nto remove a component from the remote scope, use \"bit remove --delete\", to mark the components as deleted.\nonce tagged/snapped and exported, the remote scope will be updated and it'll be marked as deleted there as well.\n\nto remove components from a lane, use \"bit lane remove-comp\".\n`;\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n group = 'collaborate';\n helpUrl = 'docs/components/removing-components';\n skipWorkspace = true;\n alias = 'rm';\n options = [\n ['', 'delete', 'mark the component as deleted. after tag/snap and export the remote will be updated'],\n [\n '',\n 'hard',\n 'remove a component completely from a remote scope. careful! this is a permanent change that could corrupt dependents. prefer --delete',\n ],\n // this option is confusing and probably not in use. if needed, move this to \"bit lane remove-comp\" command.\n // ['', 'from-lane', 'revert to main if exists on currently checked out lane, otherwise, remove it'],\n ['t', 'track', 'keep tracking component in .bitmap (default = false), helps transform a tagged-component to new'],\n ['', 'keep-files', 'keep component files (just untrack the component)'],\n [\n 'f',\n 'force',\n 'removes the component from the scope, even if used as a dependency. WARNING: components that depend on this component will corrupt',\n ],\n ['s', 'silent', 'skip confirmation'],\n ] as CommandOptions;\n loader = true;\n migration = true;\n remoteOp = true;\n\n constructor(private remove: RemoveMain, private workspace?: Workspace) {}\n\n async report(\n [componentsPattern]: [string],\n {\n delete: softDelete = false,\n force = false,\n hard = false,\n fromLane = false,\n track = false,\n silent = false,\n keepFiles = false,\n }: {\n delete?: boolean;\n force?: boolean;\n hard?: boolean;\n track?: boolean;\n fromLane?: boolean;\n silent?: boolean;\n keepFiles?: boolean;\n }\n ) {\n if (!hard && this.workspace?.isOnLane()) {\n throw new BitError(\n `error: unable to remove components when on a lane, please run \"bit lane remove-comp\" instead`\n );\n }\n\n if (softDelete) {\n if (hard)\n throw new BitError(\n `error: --hard and --delete cannot be used together. soft delete can only be done locally, after tag/snap and export it updates the remote`\n );\n if (track) throw new BitError(`error: please use either --delete or --track, not both`);\n if (keepFiles) throw new BitError(`error: please use either --delete or --keep-files, not both`);\n if (fromLane) throw new BitError(`error: please use either --delete or --from-lane, not both`);\n const removedCompIds = await this.remove.markRemoveOnMain(componentsPattern);\n return `${chalk.green('successfully soft-removed the following components:')}\n${removedCompIds.join('\\n')}\n\n${chalk.bold('to update the remote, please tag/snap and then export. to revert, please use \"bit recover\"')}`;\n }\n\n if (!silent) {\n const willDeleteFiles = !hard && !keepFiles;\n const removePromptResult = await removePrompt(willDeleteFiles, hard)();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n if (!yn(removePromptResult.shouldRemove)) {\n throw new BitError('the operation has been canceled');\n }\n }\n const {\n localResult,\n remoteResult = [],\n }: {\n localResult: RemovedLocalObjects;\n remoteResult: RemovedObjects[];\n } = await this.remove.remove({ componentsPattern, remote: hard, force, track, deleteFiles: !keepFiles, fromLane });\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n let localMessage = paintRemoved(localResult, false);\n if (localMessage !== '')\n localMessage +=\n '. Note: these components were not deleted from the remote - if you want to delete components use --delete\\n';\n return `${localMessage}${this.paintArray(remoteResult)}`;\n }\n paintArray(removedObjectsArray: RemovedObjects[]) {\n return removedObjectsArray.map((item) => paintRemoved(item, true));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,IAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,GAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,SAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAM,gBAAA;EAAA,MAAAN,IAAA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G,MAAM,IAAAC,uBAAY,EAACF,eAAe,EAAEd,IAAI,CAAC,CAAC,CAAC;MACtE;MACA,IAAI,CAAC,IAAAiB,aAAE,EAACF,kBAAkB,CAACG,YAAY,CAAC,EAAE;QACxC,MAAM,KAAIX,oBAAQ,EAAC,iCAAiC,CAAC;MACvD;IACF;IACA,MAAM;MACJY,WAAW;MACXC,YAAY,GAAG;IAIjB,CAAC,GAAG,MAAM,IAAI,CAAChC,MAAM,CAACA,MAAM,CAAC;MAAEQ,iBAAiB;MAAEyB,MAAM,EAAErB,IAAI;MAAED,KAAK;MAAEG,KAAK;MAAEoB,WAAW,EAAE,CAAClB,SAAS;MAAEH;IAAS,CAAC,CAAC;IAClH;IACA,IAAIsB,YAAY,GAAG,IAAAC,yBAAY,EAACL,WAAW,EAAE,KAAK,CAAC;IACnD,IAAII,YAAY,KAAK,EAAE,EACrBA,YAAY,IACV,6GAA6G;IACjH,OAAQ,GAAEA,YAAa,GAAE,IAAI,CAACE,UAAU,CAACL,YAAY,CAAE,EAAC;EAC1D;EACAK,UAAUA,CAACC,mBAAqC,EAAE;IAChD,OAAOA,mBAAmB,CAACC,GAAG,CAAEC,IAAI,IAAK,IAAAJ,yBAAY,EAACI,IAAI,EAAE,IAAI,CAAC,CAAC;EACpE;AACF;AAACC,OAAA,CAAA3C,SAAA,GAAAA,SAAA"}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_constants","_removeTemplate","RemoveCmd","constructor","remove","workspace","_defineProperty2","default","name","description","COMPONENT_PATTERN_HELP","report","componentsPattern","force","fromLane","track","silent","keepFiles","removePrompt","localResult","deleteFiles","localMessage","removeTemplate","logger","clearStatusLine","filesDeletionStr","ok","yesno","question","chalk","bold","BitError","exports"],"sources":["remove-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport yesno from 'yesno';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport RemovedLocalObjects from '@teambit/legacy/dist/scope/removed-local-objects';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { RemoveMain } from './remove.main.runtime';\nimport { removeTemplate } from './remove-template';\n\nexport class RemoveCmd implements Command {\n name = 'remove <component-pattern>';\n description = 'remove component(s) from the local workspace';\n extendedDescription = `to mark components as deleted on the remote scope, use \"bit delete\".`;\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n group = 'collaborate';\n helpUrl = 'docs/components/removing-components';\n skipWorkspace = true;\n alias = 'rm';\n options = [\n // this option is confusing and probably not in use. if needed, move this to \"bit lane remove-comp\" command.\n // ['', 'from-lane', 'revert to main if exists on currently checked out lane, otherwise, remove it'],\n ['t', 'track', 'keep tracking component in .bitmap (default = false), helps transform a tagged-component to new'],\n ['', 'keep-files', 'keep component files (just untrack the component)'],\n [\n 'f',\n 'force',\n 'removes the component from the scope, even if used as a dependency. WARNING: you will need to fix the components that depend on this component',\n ],\n ['s', 'silent', 'skip confirmation'],\n ] as CommandOptions;\n loader = true;\n migration = true;\n remoteOp = true;\n\n constructor(private remove: RemoveMain, private workspace?: Workspace) {}\n\n async report(\n [componentsPattern]: [string],\n {\n force = false,\n fromLane = false,\n track = false,\n silent = false,\n keepFiles = false,\n }: {\n force?: boolean;\n track?: boolean;\n fromLane?: boolean;\n silent?: boolean;\n keepFiles?: boolean;\n }\n ) {\n if (!silent) {\n await this.removePrompt(!keepFiles);\n }\n const {\n localResult,\n }: {\n localResult: RemovedLocalObjects;\n } = await this.remove.remove({ componentsPattern, force, track, deleteFiles: !keepFiles, fromLane });\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const localMessage = removeTemplate(localResult, false);\n // if (localMessage !== '')\n // localMessage +=\n // '. Note: these components were not deleted from the remote - if you want to delete components run \"bit delete\"\\n';\n return localMessage;\n }\n\n private async removePrompt(deleteFiles?: boolean) {\n this.remove.logger.clearStatusLine();\n const filesDeletionStr = deleteFiles\n ? ' and the files will be deleted from the filesystem (can be avoided by entering --keep-files)'\n : '';\n const ok = await yesno({\n question: `this command will remove the component/s only from your local workspace. if your intent is to delete the component/s also from the remote scope, refer to \"bit delete\".\nthe component(s) will be untracked${filesDeletionStr}.\n${chalk.bold('Would you like to proceed? [yes(y)/no(n)]')}`,\n });\n if (!ok) {\n throw new BitError('the operation has been canceled');\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,gBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,eAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMO,SAAS,CAAoB;EA8BxCC,WAAWA,CAASC,MAAkB,EAAUC,SAAqB,EAAE;IAAA,KAAnDD,MAAkB,GAAlBA,MAAkB;IAAA,KAAUC,SAAqB,GAArBA,SAAqB;IAAA,IAAAC,gBAAA,GAAAC,OAAA,gBA7B9D,4BAA4B;IAAA,IAAAD,gBAAA,GAAAC,OAAA,uBACrB,8CAA8C;IAAA,IA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Ac,EAACH,WAAW,EAAE,KAAK,CAAC;IACvD;IACA;IACA;IACA,OAAOE,YAAY;EACrB;EAEA,MAAcH,YAAYA,CAACE,WAAqB,EAAE;IAChD,IAAI,CAAChB,MAAM,CAACmB,MAAM,CAACC,eAAe,CAAC,CAAC;IACpC,MAAMC,gBAAgB,GAAGL,WAAW,GAChC,8FAA8F,GAC9F,EAAE;IACN,MAAMM,EAAE,GAAG,MAAM,IAAAC,gBAAK,EAAC;MACrBC,QAAQ,EAAG;AACjB,oCAAoCH,gBAAiB;AACrD,EAAEI,gBAAK,CAACC,IAAI,CAAC,2CAA2C,CAAE;IACtD,CAAC,CAAC;IACF,IAAI,CAACJ,EAAE,EAAE;MACP,MAAM,KAAIK,oBAAQ,EAAC,iCAAiC,CAAC;IACvD;EACF;AACF;AAACC,OAAA,CAAA9B,SAAA,GAAAA,SAAA"}
@@ -0,0 +1,7 @@
1
+ export declare function removeTemplate({ dependentBits, modifiedComponents, removedComponentIds, missingComponents, removedFromLane }: {
2
+ dependentBits: any;
3
+ modifiedComponents?: never[] | undefined;
4
+ removedComponentIds: any;
5
+ missingComponents: any;
6
+ removedFromLane: any;
7
+ }, isRemote: any): string;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.removeTemplate = removeTemplate;
8
+ function _legacyBitId() {
9
+ const data = require("@teambit/legacy-bit-id");
10
+ _legacyBitId = function () {
11
+ return data;
12
+ };
13
+ return data;
14
+ }
15
+ function _chalk() {
16
+ const data = _interopRequireDefault(require("chalk"));
17
+ _chalk = function () {
18
+ return data;
19
+ };
20
+ return data;
21
+ }
22
+ function _ramda() {
23
+ const data = _interopRequireDefault(require("ramda"));
24
+ _ramda = function () {
25
+ return data;
26
+ };
27
+ return data;
28
+ }
29
+ function removeTemplate({
30
+ dependentBits,
31
+ modifiedComponents = [],
32
+ removedComponentIds,
33
+ missingComponents,
34
+ removedFromLane
35
+ }, isRemote) {
36
+ const paintMissingComponents = () => {
37
+ if (_ramda().default.isEmpty(missingComponents)) return '';
38
+ return _chalk().default.red('missing components:') + (0, _chalk().default)(` ${missingComponents.map(id => {
39
+ if (!(id instanceof _legacyBitId().BitId)) id = new (_legacyBitId().BitId)(id); // when the id was received from a remote it's not an instance of BitId
40
+ return id.version === 'latest' ? id.toStringWithoutVersion() : id.toString();
41
+ })}\n`);
42
+ };
43
+ const paintRemoved = () => {
44
+ if (_ramda().default.isEmpty(removedComponentIds) && _ramda().default.isEmpty(removedFromLane)) return '';
45
+ const compToStr = comps => (0, _chalk().default)(` ${comps.map(id => id.version === 'latest' ? id.toStringWithoutVersion() : id.toString())}\n`);
46
+ const getMsg = (isLane = false) => {
47
+ const removedFrom = isLane ? 'lane' : 'scope';
48
+ const msg = isRemote ? `successfully removed components from the remote ${removedFrom}:` : `successfully removed components from the local ${removedFrom}:`;
49
+ return _chalk().default.green(msg);
50
+ };
51
+ const newLine = '\n';
52
+ const compOutput = _ramda().default.isEmpty(removedComponentIds) ? '' : getMsg(false) + compToStr(removedComponentIds) + newLine;
53
+ const laneOutput = _ramda().default.isEmpty(removedFromLane) ? '' : getMsg(true) + compToStr(removedFromLane);
54
+ return `${compOutput}${laneOutput}`;
55
+ };
56
+ const paintUnRemovedComponents = () => {
57
+ if (_ramda().default.isEmpty(dependentBits)) return '';
58
+ return Object.keys(dependentBits).map(key => {
59
+ const header = _chalk().default.underline.red(`error: unable to delete ${key}, because the following components depend on it:`);
60
+ const body = dependentBits[key].join('\n');
61
+ return `${header}\n${body}`;
62
+ }).join('\n\n');
63
+ };
64
+ const paintModifiedComponents = () => {
65
+ if (_ramda().default.isEmpty(modifiedComponents)) return '';
66
+ const modifiedStr = modifiedComponents.map(id => id.version === 'latest' ? id.toStringWithoutVersion() : id.toString());
67
+ return `${_chalk().default.red('error: unable to remove modified components (please use --force to remove modified components)\n') + (0, _chalk().default)(`- ${modifiedStr}`)}`;
68
+ };
69
+ return (
70
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
71
+ paintUnRemovedComponents(dependentBits) +
72
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
73
+ paintRemoved(removedComponentIds) +
74
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
75
+ paintMissingComponents(missingComponents) +
76
+ // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
77
+ paintModifiedComponents(modifiedComponents)
78
+ );
79
+ }
80
+
81
+ //# sourceMappingURL=remove-template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_legacyBitId","data","require","_chalk","_interopRequireDefault","_ramda","removeTemplate","dependentBits","modifiedComponents","removedComponentIds","missingComponents","removedFromLane","isRemote","paintMissingComponents","R","isEmpty","chalk","red","map","id","BitId","version","toStringWithoutVersion","toString","paintRemoved","compToStr","comps","getMsg","isLane","removedFrom","msg","green","newLine","compOutput","laneOutput","paintUnRemovedComponents","Object","keys","key","header","underline","body","join","paintModifiedComponents","modifiedStr"],"sources":["remove-template.ts"],"sourcesContent":["import { BitId } from '@teambit/legacy-bit-id';\nimport chalk from 'chalk';\nimport R from 'ramda';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\n\nexport function removeTemplate(\n { dependentBits, modifiedComponents = [], removedComponentIds, missingComponents, removedFromLane },\n isRemote\n) {\n const paintMissingComponents = () => {\n if (R.isEmpty(missingComponents)) return '';\n return (\n chalk.red('missing components:') +\n chalk(\n ` ${missingComponents.map((id) => {\n if (!(id instanceof BitId)) id = new BitId(id); // when the id was received from a remote it's not an instance of BitId\n return id.version === 'latest' ? id.toStringWithoutVersion() : id.toString();\n })}\\n`\n )\n );\n };\n const paintRemoved = () => {\n if (R.isEmpty(removedComponentIds) && R.isEmpty(removedFromLane)) return '';\n const compToStr = (comps: BitIds) =>\n chalk(` ${comps.map((id) => (id.version === 'latest' ? id.toStringWithoutVersion() : id.toString()))}\\n`);\n const getMsg = (isLane = false) => {\n const removedFrom = isLane ? 'lane' : 'scope';\n const msg = isRemote\n ? `successfully removed components from the remote ${removedFrom}:`\n : `successfully removed components from the local ${removedFrom}:`;\n return chalk.green(msg);\n };\n const newLine = '\\n';\n const compOutput = R.isEmpty(removedComponentIds) ? '' : getMsg(false) + compToStr(removedComponentIds) + newLine;\n const laneOutput = R.isEmpty(removedFromLane) ? '' : getMsg(true) + compToStr(removedFromLane);\n\n return `${compOutput}${laneOutput}`;\n };\n\n const paintUnRemovedComponents = () => {\n if (R.isEmpty(dependentBits)) return '';\n return Object.keys(dependentBits)\n .map((key) => {\n const header = chalk.underline.red(\n `error: unable to delete ${key}, because the following components depend on it:`\n );\n const body = dependentBits[key].join('\\n');\n return `${header}\\n${body}`;\n })\n .join('\\n\\n');\n };\n\n const paintModifiedComponents = () => {\n if (R.isEmpty(modifiedComponents)) return '';\n const modifiedStr = modifiedComponents.map((id: BitId) =>\n id.version === 'latest' ? id.toStringWithoutVersion() : id.toString()\n );\n return `${\n chalk.red('error: unable to remove modified components (please use --force to remove modified components)\\n') +\n chalk(`- ${modifiedStr}`)\n }`;\n };\n\n return (\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n paintUnRemovedComponents(dependentBits) +\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n paintRemoved(removedComponentIds) +\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n paintMissingComponents(missingComponents) +\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n paintModifiedComponents(modifiedComponents)\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,aAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,YAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IA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AAA,KAAM;IACpC,IAAI7B,gBAAC,CAACC,OAAO,CAACP,kBAAkB,CAAC,EAAE,OAAO,EAAE;IAC5C,MAAMoC,WAAW,GAAGpC,kBAAkB,CAACU,GAAG,CAAEC,EAAS,IACnDA,EAAE,CAACE,OAAO,KAAK,QAAQ,GAAGF,EAAE,CAACG,sBAAsB,CAAC,CAAC,GAAGH,EAAE,CAACI,QAAQ,CAAC,CACtE,CAAC;IACD,OAAQ,GACNP,gBAAK,CAACC,GAAG,CAAC,kGAAkG,CAAC,GAC7G,IAAAD,gBAAK,EAAE,KAAI4B,WAAY,EAAC,CACzB,EAAC;EACJ,CAAC;EAED;IACE;IACAT,wBAAwB,CAAC5B,aAAa,CAAC;IACvC;IACAiB,YAAY,CAACf,mBAAmB,CAAC;IACjC;IACAI,sBAAsB,CAACH,iBAAiB,CAAC;IACzC;IACAiC,uBAAuB,CAACnC,kBAAkB;EAAC;AAE/C"}
@@ -39,7 +39,9 @@ export declare class RemoveMain {
39
39
  remoteResult: Record<string, any>[];
40
40
  }>;
41
41
  markRemoveComps(componentIds: ComponentID[], shouldUpdateMain?: boolean): Promise<ComponentID[]>;
42
- markRemoveOnMain(componentsPattern: string): Promise<ComponentID[]>;
42
+ deleteComps(componentsPattern: string, opts?: {
43
+ updateMain?: boolean;
44
+ }): Promise<ComponentID[]>;
43
45
  /**
44
46
  * recover a soft-removed component.
45
47
  * there are 4 different scenarios.
@@ -182,6 +182,13 @@ function _recoverCmd() {
182
182
  };
183
183
  return data;
184
184
  }
185
+ function _deleteCmd() {
186
+ const data = require("./delete-cmd");
187
+ _deleteCmd = function () {
188
+ return data;
189
+ };
190
+ return data;
191
+ }
185
192
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
186
193
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
187
194
  const BEFORE_REMOVE = 'removing components';
@@ -252,17 +259,21 @@ class RemoveMain {
252
259
  await (0, _deleteComponentFiles().default)(this.workspace.consumer, bitIds);
253
260
  return componentIds;
254
261
  }
255
- async markRemoveOnMain(componentsPattern) {
262
+ async deleteComps(componentsPattern, opts = {}) {
256
263
  if (!this.workspace) throw new (_exceptions().ConsumerNotFound)();
257
- if (!this.workspace.isOnMain()) {
258
- throw new Error(`markRemoveOnMain expects to get called when on main`);
259
- }
260
264
  const componentIds = await this.workspace.idsByPattern(componentsPattern);
261
265
  const newComps = componentIds.filter(id => !id.hasVersion());
262
266
  if (newComps.length) {
263
- throw new (_bitError().BitError)(`unable to mark-remove the following new component(s), please remove them without --delete\n${newComps.map(id => id.toString()).join('\n')}`);
267
+ throw new (_bitError().BitError)(`no need to delete the following new component(s), please remove them by "bit remove"\n${newComps.map(id => id.toString()).join('\n')}`);
268
+ }
269
+ const currentLane = await this.workspace.getCurrentLaneObject();
270
+ const {
271
+ updateMain
272
+ } = opts;
273
+ if (!updateMain && currentLane !== null && currentLane !== void 0 && currentLane.isNew) {
274
+ throw new Error('no need to delete components from an un-exported lane, you can remove them by running "bit remove"');
264
275
  }
265
- return this.markRemoveComps(componentIds);
276
+ return this.markRemoveComps(componentIds, updateMain);
266
277
  }
267
278
 
268
279
  /**
@@ -443,7 +454,7 @@ ${mainComps.map(c => c.id.toString()).join('\n')}`);
443
454
  const removeMain = new RemoveMain(workspace, logger, importerMain, depResolver);
444
455
  issues.registerAddComponentsIssues(removeMain.addRemovedDependenciesIssues.bind(removeMain));
445
456
  componentAspect.registerShowFragments([new (_remove2().RemoveFragment)(removeMain)]);
446
- cli.register(new (_removeCmd().RemoveCmd)(removeMain, workspace), new (_recoverCmd().RecoverCmd)(removeMain));
457
+ cli.register(new (_removeCmd().RemoveCmd)(removeMain, workspace), new (_deleteCmd().DeleteCmd)(removeMain, workspace), new (_recoverCmd().RecoverCmd)(removeMain));
447
458
  return removeMain;
448
459
  }
449
460
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_logger","_workspace","_interopRequireWildcard","_legacyBitId","_bitId","_exceptions","_importer","_interopRequireDefault","_lodash","_hasWildcard","_listScope","_bitError","_deleteComponentFiles","_dependencyResolver","_componentIssues","_issues","_pMapSeries","_component","_exceptions2","_packageJsonUtils","_removeCmd","_removeComponents","_remove","_remove2","_recoverCmd","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","BEFORE_REMOVE","RemoveMain","constructor","workspace","logger","importer","depResolver","remove","componentsPattern","force","remote","track","deleteFiles","fromLane","_this$workspace","setStatusLine","bitIds","getRemoteBitIdsToRemove","getLocalBitIdsToRemove","consumer","removeResults","removeComponents","ids","BitIds","fromArray","onDestroy","removeLocallyByIds","OutsideWorkspaceError","results","bitMap","write","markRemoveComps","componentIds","shouldUpdateMain","components","getMany","removeComponentsFromNodeModules","map","c","state","_consumer","config","removed","removeOnMain","compId","addComponentConfig","RemoveAspect","id","_legacy","deleteComponentsFiles","markRemoveOnMain","ConsumerNotFound","isOnMain","Error","idsByPattern","newComps","filter","hasVersion","length","BitError","toString","join","recover","compIdStr","options","bitMapEntry","find","compMap","name","toStringWithoutVersion","importComp","idStr","import","installNpmPackages","skipDependencyInstallation","override","setAsRemovedFalse","addSpecificComponentConfig","_bitMapEntry$config","_bitMapEntry$config2","resolveComponentId","comp","isRemoved","scope","currentLane","getCurrentLaneObject","idOnLane","getComponent","compIdWithPossibleVer","changeVersion","head","compFromScope","err","VersionNotFound","version","getRemoteComponent","throwForMainComponentWhenOnLane","laneComps","toBitIds","mainComps","hasWithoutVersion","getRemoveInfo","component","_component$config$ext","extensions","findExtension","isRemovedByIdWithoutLoadingComponent","componentId","bitmapEntry","getBitmapEntryIfExist","isRecovered","modelComp","getBitObjectModelComponent","versionObj","getBitObjectVersion","getRemovedStaged","getRemovedStagedFromMain","getRemovedStagedFromLane","addRemovedDependenciesIssues","pMapSeries","addRemovedDepIssue","dependencies","getComponentDependencies","removedWithUndefined","Promise","all","dep","undefined","compact","issues","getOrCreate","IssuesClasses","RemovedDependencies","stagedConfig","getStagedConfig","getAll","compConfig","_compConfig$config","_compConfig$config$Re","laneIds","workspaceIds","listIds","laneIdsNotInWorkspace","wId","isEqualWithoutVersion","laneCompIdsNotInWorkspace","resolveMultipleComponentIds","comps","staged","snapDistance","getSnapDistance","warn","isSourceAhead","hasWildcard","getRemoteBitIdsByWildcards","BitId","parse","provider","cli","loggerMain","componentAspect","importerMain","createLogger","removeMain","registerAddComponentsIssues","bind","registerShowFragments","RemoveFragment","register","RemoveCmd","RecoverCmd","exports","_defineProperty2","WorkspaceAspect","CLIAspect","LoggerAspect","ComponentAspect","ImporterAspect","DependencyResolverAspect","IssuesAspect","MainRuntime","addRuntime","_default"],"sources":["remove.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport ImporterAspect, { ImporterMain } from '@teambit/importer';\nimport { compact } from 'lodash';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport { getRemoteBitIdsByWildcards } from '@teambit/legacy/dist/api/consumer/lib/list-scope';\nimport { ComponentID } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport deleteComponentsFiles from '@teambit/legacy/dist/consumer/component-ops/delete-component-files';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport IssuesAspect, { IssuesMain } from '@teambit/issues';\nimport pMapSeries from 'p-map-series';\nimport ComponentAspect, { Component, ComponentMain } from '@teambit/component';\nimport { VersionNotFound } from '@teambit/legacy/dist/scope/exceptions';\nimport { removeComponentsFromNodeModules } from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport { RemoveCmd } from './remove-cmd';\nimport { removeComponents } from './remove-components';\nimport { RemoveAspect } from './remove.aspect';\nimport { RemoveFragment } from './remove.fragment';\nimport { RecoverCmd, RecoverOptions } from './recover-cmd';\n\nconst BEFORE_REMOVE = 'removing components';\n\nexport type RemoveInfo = {\n removed: boolean;\n /**\n * whether to remove the component from default lane once merged\n */\n removeOnMain?: boolean;\n};\n\nexport class RemoveMain {\n constructor(\n private workspace: Workspace,\n public logger: Logger,\n private importer: ImporterMain,\n private depResolver: DependencyResolverMain\n ) {}\n\n async remove({\n componentsPattern,\n force = false,\n remote = false,\n track = false,\n deleteFiles = true,\n fromLane = false,\n }: {\n componentsPattern: string;\n force?: boolean;\n remote?: boolean;\n track?: boolean;\n deleteFiles?: boolean;\n fromLane?: boolean;\n }): Promise<any> {\n this.logger.setStatusLine(BEFORE_REMOVE);\n const bitIds = remote\n ? await this.getRemoteBitIdsToRemove(componentsPattern)\n : await this.getLocalBitIdsToRemove(componentsPattern);\n this.logger.setStatusLine(BEFORE_REMOVE); // again because the loader might changed when talking to the remote\n const consumer = this.workspace?.consumer;\n const removeResults = await removeComponents({\n consumer,\n ids: BitIds.fromArray(bitIds),\n force,\n remote,\n track,\n deleteFiles,\n fromLane,\n });\n if (consumer) await consumer.onDestroy();\n return removeResults;\n }\n\n /**\n * remove components from the workspace.\n */\n async removeLocallyByIds(ids: BitId[], { force = false }: { force?: boolean } = {}) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const results = await removeComponents({\n consumer: this.workspace.consumer,\n ids: BitIds.fromArray(ids),\n force,\n remote: false,\n track: false,\n deleteFiles: true,\n fromLane: false,\n });\n await this.workspace.bitMap.write();\n\n return results;\n }\n\n async markRemoveComps(componentIds: ComponentID[], shouldUpdateMain = false) {\n const components = await this.workspace.getMany(componentIds);\n await removeComponentsFromNodeModules(\n this.workspace.consumer,\n components.map((c) => c.state._consumer)\n );\n // don't use `this.workspace.addSpecificComponentConfig`, if the component has component.json it will be deleted\n // during this removal along with the entire component dir.\n const config: RemoveInfo = { removed: true };\n if (shouldUpdateMain) config.removeOnMain = true;\n componentIds.map((compId) => this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, config));\n await this.workspace.bitMap.write();\n const bitIds = BitIds.fromArray(componentIds.map((id) => id._legacy));\n await deleteComponentsFiles(this.workspace.consumer, bitIds);\n\n return componentIds;\n }\n\n async markRemoveOnMain(componentsPattern: string): Promise<ComponentID[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n if (!this.workspace.isOnMain()) {\n throw new Error(`markRemoveOnMain expects to get called when on main`);\n }\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n\n const newComps = componentIds.filter((id) => !id.hasVersion());\n if (newComps.length) {\n throw new BitError(\n `unable to mark-remove the following new component(s), please remove them without --delete\\n${newComps\n .map((id) => id.toString())\n .join('\\n')}`\n );\n }\n\n return this.markRemoveComps(componentIds);\n }\n\n /**\n * recover a soft-removed component.\n * there are 4 different scenarios.\n * 1. a component was just soft-removed, it wasn't snapped yet. so it's now in .bitmap with the \"removed\" aspect entry.\n * 2. soft-removed and then snapped. It's not in .bitmap now.\n * 3. soft-removed, snapped, exported. it's not in .bitmap now.\n * 4. a soft-removed components was imported, so it's now in .bitmap without the \"removed\" aspect entry.\n * 5. workspace is empty. the soft-removed component is on the remote.\n * returns `true` if it was recovered. `false` if the component wasn't soft-removed, so nothing to recover from.\n */\n async recover(compIdStr: string, options: RecoverOptions): Promise<boolean> {\n if (!this.workspace) throw new ConsumerNotFound();\n const bitMapEntry = this.workspace.consumer.bitMap.components.find((compMap) => {\n return compMap.id.name === compIdStr || compMap.id.toStringWithoutVersion() === compIdStr;\n });\n const importComp = async (idStr: string) => {\n await this.importer.import({\n ids: [idStr],\n installNpmPackages: !options.skipDependencyInstallation,\n override: true,\n });\n };\n const setAsRemovedFalse = async (compId: ComponentID) => {\n await this.workspace.addSpecificComponentConfig(compId, RemoveAspect.id, { removed: false });\n await this.workspace.bitMap.write();\n };\n if (bitMapEntry) {\n if (bitMapEntry.config?.[RemoveAspect.id]) {\n // case #1\n delete bitMapEntry.config?.[RemoveAspect.id];\n await importComp(bitMapEntry.id.toString());\n return true;\n }\n // case #4\n const compId = await this.workspace.resolveComponentId(bitMapEntry.id);\n const comp = await this.workspace.get(compId);\n if (!this.isRemoved(comp)) {\n return false;\n }\n await setAsRemovedFalse(compId);\n return true;\n }\n const compId = await this.workspace.scope.resolveComponentId(compIdStr);\n const currentLane = await this.workspace.getCurrentLaneObject();\n const idOnLane = currentLane?.getComponent(compId._legacy);\n const compIdWithPossibleVer = idOnLane ? compId.changeVersion(idOnLane.head.toString()) : compId;\n let compFromScope: Component | undefined;\n try {\n compFromScope = await this.workspace.scope.get(compIdWithPossibleVer);\n } catch (err: any) {\n if (err instanceof VersionNotFound && err.version === '0.0.0') {\n throw new BitError(\n `unable to find the component ${compIdWithPossibleVer.toString()} in the current lane or main`\n );\n }\n throw err;\n }\n if (compFromScope && this.isRemoved(compFromScope)) {\n // case #2 and #3\n await importComp(compIdWithPossibleVer._legacy.toString());\n await setAsRemovedFalse(compIdWithPossibleVer);\n return true;\n }\n // case #5\n const comp = await this.workspace.scope.getRemoteComponent(compId);\n if (!this.isRemoved(comp)) {\n return false;\n }\n await importComp(compId._legacy.toString());\n await setAsRemovedFalse(compId);\n\n return true;\n }\n\n private async throwForMainComponentWhenOnLane(components: Component[]) {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return; // user on main\n const laneComps = currentLane.toBitIds();\n const mainComps = components.filter((comp) => !laneComps.hasWithoutVersion(comp.id._legacy));\n if (mainComps.length) {\n throw new BitError(`the following components belong to main, they cannot be soft-removed when on a lane. consider removing them without --soft.\n${mainComps.map((c) => c.id.toString()).join('\\n')}`);\n }\n }\n\n getRemoveInfo(component: Component): RemoveInfo {\n const data = component.config.extensions.findExtension(RemoveAspect.id)?.config as RemoveInfo | undefined;\n return {\n removed: data?.removed || false,\n };\n }\n\n isRemoved(component: Component): boolean {\n return this.getRemoveInfo(component).removed;\n }\n\n /**\n * performant version of isRemoved() in case the component object is not available and loading it is expensive.\n */\n async isRemovedByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n if (!componentId.hasVersion()) return false;\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId);\n if (bitmapEntry && bitmapEntry.isRemoved()) return true;\n if (bitmapEntry && bitmapEntry.isRecovered()) return false;\n const modelComp = await this.workspace.scope.getBitObjectModelComponent(componentId);\n if (!modelComp) return false;\n const versionObj = await this.workspace.scope.getBitObjectVersion(modelComp, componentId.version);\n if (!versionObj) return false;\n return versionObj.isRemoved();\n }\n\n /**\n * get components that were soft-removed and tagged/snapped/merged but not exported yet.\n */\n async getRemovedStaged(): Promise<ComponentID[]> {\n return this.workspace.isOnMain() ? this.getRemovedStagedFromMain() : this.getRemovedStagedFromLane();\n }\n\n async addRemovedDependenciesIssues(components: Component[]) {\n await pMapSeries(components, async (component) => {\n await this.addRemovedDepIssue(component);\n });\n }\n\n private async addRemovedDepIssue(component: Component) {\n const dependencies = await this.depResolver.getComponentDependencies(component);\n const removedWithUndefined = await Promise.all(\n dependencies.map(async (dep) => {\n const isRemoved = await this.isRemovedByIdWithoutLoadingComponent(dep.componentId);\n if (isRemoved) return dep.componentId;\n return undefined;\n })\n );\n const removed = compact(removedWithUndefined).map((id) => id.toString());\n if (removed.length) {\n component.state.issues.getOrCreate(IssuesClasses.RemovedDependencies).data = removed;\n }\n }\n\n private async getRemovedStagedFromMain(): Promise<ComponentID[]> {\n const stagedConfig = await this.workspace.scope.getStagedConfig();\n return stagedConfig\n .getAll()\n .filter((compConfig) => compConfig.config?.[RemoveAspect.id]?.removed)\n .map((compConfig) => compConfig.id);\n }\n\n private async getRemovedStagedFromLane(): Promise<ComponentID[]> {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return [];\n const laneIds = currentLane.toBitIds();\n const workspaceIds = await this.workspace.listIds();\n const laneIdsNotInWorkspace = laneIds.filter(\n (id) => !workspaceIds.find((wId) => wId._legacy.isEqualWithoutVersion(id))\n );\n if (!laneIdsNotInWorkspace.length) return [];\n const laneCompIdsNotInWorkspace = await this.workspace.scope.resolveMultipleComponentIds(laneIdsNotInWorkspace);\n const comps = await this.workspace.scope.getMany(laneCompIdsNotInWorkspace);\n const removed = comps.filter((c) => this.isRemoved(c));\n const staged = await Promise.all(\n removed.map(async (c) => {\n const snapDistance = await this.workspace.scope.getSnapDistance(c.id, false);\n if (snapDistance.err) {\n this.logger.warn(\n `getRemovedStagedFromLane unable to get snapDistance for ${c.id.toString()} due to ${snapDistance.err.name}`\n );\n // todo: not clear what should be done here. should we consider it as removed-staged or not.\n }\n if (snapDistance.isSourceAhead()) return c.id;\n return undefined;\n })\n );\n return compact(staged);\n }\n\n private async getLocalBitIdsToRemove(componentsPattern: string): Promise<BitId[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n return componentIds.map((id) => id._legacy);\n }\n\n private async getRemoteBitIdsToRemove(componentsPattern: string): Promise<BitId[]> {\n if (hasWildcard(componentsPattern)) {\n return getRemoteBitIdsByWildcards(componentsPattern);\n }\n return [BitId.parse(componentsPattern, true)];\n }\n\n static slots = [];\n static dependencies = [\n WorkspaceAspect,\n CLIAspect,\n LoggerAspect,\n ComponentAspect,\n ImporterAspect,\n DependencyResolverAspect,\n IssuesAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([workspace, cli, loggerMain, componentAspect, importerMain, depResolver, issues]: [\n Workspace,\n CLIMain,\n LoggerMain,\n ComponentMain,\n ImporterMain,\n DependencyResolverMain,\n IssuesMain\n ]) {\n const logger = loggerMain.createLogger(RemoveAspect.id);\n const removeMain = new RemoveMain(workspace, logger, importerMain, depResolver);\n issues.registerAddComponentsIssues(removeMain.addRemovedDependenciesIssues.bind(removeMain));\n componentAspect.registerShowFragments([new RemoveFragment(removeMain)]);\n cli.register(new RemoveCmd(removeMain, workspace), new RecoverCmd(removeMain));\n return removeMain;\n }\n}\n\nRemoveAspect.addRuntime(RemoveMain);\n\nexport default RemoveMain;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAH,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,aAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,OAAA;EAAA,MAAAN,I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,CAAC,CAAC,CAAC;IACvEL,GAAG,CAACU,QAAQ,CAAC,KAAIC,sBAAS,EAACN,UAAU,EAAEhK,SAAS,CAAC,EAAE,KAAIuK,wBAAU,EAACP,UAAU,CAAC,CAAC;IAC9E,OAAOA,UAAU;EACnB;AACF;AAACQ,OAAA,CAAA1K,UAAA,GAAAA,UAAA;AAAA,IAAA2K,gBAAA,GAAA3L,OAAA,EA1TYgB,UAAU,WA8RN,EAAE;AAAA,IAAA2K,gBAAA,GAAA3L,OAAA,EA9RNgB,UAAU,kBA+RC,CACpB4K,oBAAe,EACfC,gBAAS,EACTC,sBAAY,EACZC,oBAAe,EACfC,mBAAc,EACdC,8CAAwB,EACxBC,iBAAY,CACb;AAAA,IAAAP,gBAAA,GAAA3L,OAAA,EAvSUgB,UAAU,aAwSJmL,kBAAW;AAoB9BtI,sBAAY,CAACuI,UAAU,CAACpL,UAAU,CAAC;AAAC,IAAAqL,QAAA,GAErBrL,UAAU;AAAA0K,OAAA,CAAA1L,OAAA,GAAAqM,QAAA"}
1
+ {"version":3,"names":["_cli","data","require","_logger","_workspace","_interopRequireWildcard","_legacyBitId","_bitId","_exceptions","_importer","_interopRequireDefault","_lodash","_hasWildcard","_listScope","_bitError","_deleteComponentFiles","_dependencyResolver","_componentIssues","_issues","_pMapSeries","_component","_exceptions2","_packageJsonUtils","_removeCmd","_removeComponents","_remove","_remove2","_recoverCmd","_deleteCmd","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","BEFORE_REMOVE","RemoveMain","constructor","workspace","logger","importer","depResolver","remove","componentsPattern","force","remote","track","deleteFiles","fromLane","_this$workspace","setStatusLine","bitIds","getRemoteBitIdsToRemove","getLocalBitIdsToRemove","consumer","removeResults","removeComponents","ids","BitIds","fromArray","onDestroy","removeLocallyByIds","OutsideWorkspaceError","results","bitMap","write","markRemoveComps","componentIds","shouldUpdateMain","components","getMany","removeComponentsFromNodeModules","map","c","state","_consumer","config","removed","removeOnMain","compId","addComponentConfig","RemoveAspect","id","_legacy","deleteComponentsFiles","deleteComps","opts","ConsumerNotFound","idsByPattern","newComps","filter","hasVersion","length","BitError","toString","join","currentLane","getCurrentLaneObject","updateMain","isNew","Error","recover","compIdStr","options","bitMapEntry","find","compMap","name","toStringWithoutVersion","importComp","idStr","import","installNpmPackages","skipDependencyInstallation","override","setAsRemovedFalse","addSpecificComponentConfig","_bitMapEntry$config","_bitMapEntry$config2","resolveComponentId","comp","isRemoved","scope","idOnLane","getComponent","compIdWithPossibleVer","changeVersion","head","compFromScope","err","VersionNotFound","version","getRemoteComponent","throwForMainComponentWhenOnLane","laneComps","toBitIds","mainComps","hasWithoutVersion","getRemoveInfo","component","_component$config$ext","extensions","findExtension","isRemovedByIdWithoutLoadingComponent","componentId","bitmapEntry","getBitmapEntryIfExist","isRecovered","modelComp","getBitObjectModelComponent","versionObj","getBitObjectVersion","getRemovedStaged","isOnMain","getRemovedStagedFromMain","getRemovedStagedFromLane","addRemovedDependenciesIssues","pMapSeries","addRemovedDepIssue","dependencies","getComponentDependencies","removedWithUndefined","Promise","all","dep","undefined","compact","issues","getOrCreate","IssuesClasses","RemovedDependencies","stagedConfig","getStagedConfig","getAll","compConfig","_compConfig$config","_compConfig$config$Re","laneIds","workspaceIds","listIds","laneIdsNotInWorkspace","wId","isEqualWithoutVersion","laneCompIdsNotInWorkspace","resolveMultipleComponentIds","comps","staged","snapDistance","getSnapDistance","warn","isSourceAhead","hasWildcard","getRemoteBitIdsByWildcards","BitId","parse","provider","cli","loggerMain","componentAspect","importerMain","createLogger","removeMain","registerAddComponentsIssues","bind","registerShowFragments","RemoveFragment","register","RemoveCmd","DeleteCmd","RecoverCmd","exports","_defineProperty2","WorkspaceAspect","CLIAspect","LoggerAspect","ComponentAspect","ImporterAspect","DependencyResolverAspect","IssuesAspect","MainRuntime","addRuntime","_default"],"sources":["remove.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport ImporterAspect, { ImporterMain } from '@teambit/importer';\nimport { compact } from 'lodash';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport { getRemoteBitIdsByWildcards } from '@teambit/legacy/dist/api/consumer/lib/list-scope';\nimport { ComponentID } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport deleteComponentsFiles from '@teambit/legacy/dist/consumer/component-ops/delete-component-files';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport IssuesAspect, { IssuesMain } from '@teambit/issues';\nimport pMapSeries from 'p-map-series';\nimport ComponentAspect, { Component, ComponentMain } from '@teambit/component';\nimport { VersionNotFound } from '@teambit/legacy/dist/scope/exceptions';\nimport { removeComponentsFromNodeModules } from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport { RemoveCmd } from './remove-cmd';\nimport { removeComponents } from './remove-components';\nimport { RemoveAspect } from './remove.aspect';\nimport { RemoveFragment } from './remove.fragment';\nimport { RecoverCmd, RecoverOptions } from './recover-cmd';\nimport { DeleteCmd } from './delete-cmd';\n\nconst BEFORE_REMOVE = 'removing components';\n\nexport type RemoveInfo = {\n removed: boolean;\n /**\n * whether to remove the component from default lane once merged\n */\n removeOnMain?: boolean;\n};\n\nexport class RemoveMain {\n constructor(\n private workspace: Workspace,\n public logger: Logger,\n private importer: ImporterMain,\n private depResolver: DependencyResolverMain\n ) {}\n\n async remove({\n componentsPattern,\n force = false,\n remote = false,\n track = false,\n deleteFiles = true,\n fromLane = false,\n }: {\n componentsPattern: string;\n force?: boolean;\n remote?: boolean;\n track?: boolean;\n deleteFiles?: boolean;\n fromLane?: boolean;\n }): Promise<any> {\n this.logger.setStatusLine(BEFORE_REMOVE);\n const bitIds = remote\n ? await this.getRemoteBitIdsToRemove(componentsPattern)\n : await this.getLocalBitIdsToRemove(componentsPattern);\n this.logger.setStatusLine(BEFORE_REMOVE); // again because the loader might changed when talking to the remote\n const consumer = this.workspace?.consumer;\n const removeResults = await removeComponents({\n consumer,\n ids: BitIds.fromArray(bitIds),\n force,\n remote,\n track,\n deleteFiles,\n fromLane,\n });\n if (consumer) await consumer.onDestroy();\n return removeResults;\n }\n\n /**\n * remove components from the workspace.\n */\n async removeLocallyByIds(ids: BitId[], { force = false }: { force?: boolean } = {}) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const results = await removeComponents({\n consumer: this.workspace.consumer,\n ids: BitIds.fromArray(ids),\n force,\n remote: false,\n track: false,\n deleteFiles: true,\n fromLane: false,\n });\n await this.workspace.bitMap.write();\n\n return results;\n }\n\n async markRemoveComps(componentIds: ComponentID[], shouldUpdateMain = false) {\n const components = await this.workspace.getMany(componentIds);\n await removeComponentsFromNodeModules(\n this.workspace.consumer,\n components.map((c) => c.state._consumer)\n );\n // don't use `this.workspace.addSpecificComponentConfig`, if the component has component.json it will be deleted\n // during this removal along with the entire component dir.\n const config: RemoveInfo = { removed: true };\n if (shouldUpdateMain) config.removeOnMain = true;\n componentIds.map((compId) => this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, config));\n await this.workspace.bitMap.write();\n const bitIds = BitIds.fromArray(componentIds.map((id) => id._legacy));\n await deleteComponentsFiles(this.workspace.consumer, bitIds);\n\n return componentIds;\n }\n\n async deleteComps(componentsPattern: string, opts: { updateMain?: boolean } = {}): Promise<ComponentID[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n const newComps = componentIds.filter((id) => !id.hasVersion());\n if (newComps.length) {\n throw new BitError(\n `no need to delete the following new component(s), please remove them by \"bit remove\"\\n${newComps\n .map((id) => id.toString())\n .join('\\n')}`\n );\n }\n const currentLane = await this.workspace.getCurrentLaneObject();\n const { updateMain } = opts;\n if (!updateMain && currentLane?.isNew) {\n throw new Error(\n 'no need to delete components from an un-exported lane, you can remove them by running \"bit remove\"'\n );\n }\n\n return this.markRemoveComps(componentIds, updateMain);\n }\n\n /**\n * recover a soft-removed component.\n * there are 4 different scenarios.\n * 1. a component was just soft-removed, it wasn't snapped yet. so it's now in .bitmap with the \"removed\" aspect entry.\n * 2. soft-removed and then snapped. It's not in .bitmap now.\n * 3. soft-removed, snapped, exported. it's not in .bitmap now.\n * 4. a soft-removed components was imported, so it's now in .bitmap without the \"removed\" aspect entry.\n * 5. workspace is empty. the soft-removed component is on the remote.\n * returns `true` if it was recovered. `false` if the component wasn't soft-removed, so nothing to recover from.\n */\n async recover(compIdStr: string, options: RecoverOptions): Promise<boolean> {\n if (!this.workspace) throw new ConsumerNotFound();\n const bitMapEntry = this.workspace.consumer.bitMap.components.find((compMap) => {\n return compMap.id.name === compIdStr || compMap.id.toStringWithoutVersion() === compIdStr;\n });\n const importComp = async (idStr: string) => {\n await this.importer.import({\n ids: [idStr],\n installNpmPackages: !options.skipDependencyInstallation,\n override: true,\n });\n };\n const setAsRemovedFalse = async (compId: ComponentID) => {\n await this.workspace.addSpecificComponentConfig(compId, RemoveAspect.id, { removed: false });\n await this.workspace.bitMap.write();\n };\n if (bitMapEntry) {\n if (bitMapEntry.config?.[RemoveAspect.id]) {\n // case #1\n delete bitMapEntry.config?.[RemoveAspect.id];\n await importComp(bitMapEntry.id.toString());\n return true;\n }\n // case #4\n const compId = await this.workspace.resolveComponentId(bitMapEntry.id);\n const comp = await this.workspace.get(compId);\n if (!this.isRemoved(comp)) {\n return false;\n }\n await setAsRemovedFalse(compId);\n return true;\n }\n const compId = await this.workspace.scope.resolveComponentId(compIdStr);\n const currentLane = await this.workspace.getCurrentLaneObject();\n const idOnLane = currentLane?.getComponent(compId._legacy);\n const compIdWithPossibleVer = idOnLane ? compId.changeVersion(idOnLane.head.toString()) : compId;\n let compFromScope: Component | undefined;\n try {\n compFromScope = await this.workspace.scope.get(compIdWithPossibleVer);\n } catch (err: any) {\n if (err instanceof VersionNotFound && err.version === '0.0.0') {\n throw new BitError(\n `unable to find the component ${compIdWithPossibleVer.toString()} in the current lane or main`\n );\n }\n throw err;\n }\n if (compFromScope && this.isRemoved(compFromScope)) {\n // case #2 and #3\n await importComp(compIdWithPossibleVer._legacy.toString());\n await setAsRemovedFalse(compIdWithPossibleVer);\n return true;\n }\n // case #5\n const comp = await this.workspace.scope.getRemoteComponent(compId);\n if (!this.isRemoved(comp)) {\n return false;\n }\n await importComp(compId._legacy.toString());\n await setAsRemovedFalse(compId);\n\n return true;\n }\n\n private async throwForMainComponentWhenOnLane(components: Component[]) {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return; // user on main\n const laneComps = currentLane.toBitIds();\n const mainComps = components.filter((comp) => !laneComps.hasWithoutVersion(comp.id._legacy));\n if (mainComps.length) {\n throw new BitError(`the following components belong to main, they cannot be soft-removed when on a lane. consider removing them without --soft.\n${mainComps.map((c) => c.id.toString()).join('\\n')}`);\n }\n }\n\n getRemoveInfo(component: Component): RemoveInfo {\n const data = component.config.extensions.findExtension(RemoveAspect.id)?.config as RemoveInfo | undefined;\n return {\n removed: data?.removed || false,\n };\n }\n\n isRemoved(component: Component): boolean {\n return this.getRemoveInfo(component).removed;\n }\n\n /**\n * performant version of isRemoved() in case the component object is not available and loading it is expensive.\n */\n async isRemovedByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n if (!componentId.hasVersion()) return false;\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId);\n if (bitmapEntry && bitmapEntry.isRemoved()) return true;\n if (bitmapEntry && bitmapEntry.isRecovered()) return false;\n const modelComp = await this.workspace.scope.getBitObjectModelComponent(componentId);\n if (!modelComp) return false;\n const versionObj = await this.workspace.scope.getBitObjectVersion(modelComp, componentId.version);\n if (!versionObj) return false;\n return versionObj.isRemoved();\n }\n\n /**\n * get components that were soft-removed and tagged/snapped/merged but not exported yet.\n */\n async getRemovedStaged(): Promise<ComponentID[]> {\n return this.workspace.isOnMain() ? this.getRemovedStagedFromMain() : this.getRemovedStagedFromLane();\n }\n\n async addRemovedDependenciesIssues(components: Component[]) {\n await pMapSeries(components, async (component) => {\n await this.addRemovedDepIssue(component);\n });\n }\n\n private async addRemovedDepIssue(component: Component) {\n const dependencies = await this.depResolver.getComponentDependencies(component);\n const removedWithUndefined = await Promise.all(\n dependencies.map(async (dep) => {\n const isRemoved = await this.isRemovedByIdWithoutLoadingComponent(dep.componentId);\n if (isRemoved) return dep.componentId;\n return undefined;\n })\n );\n const removed = compact(removedWithUndefined).map((id) => id.toString());\n if (removed.length) {\n component.state.issues.getOrCreate(IssuesClasses.RemovedDependencies).data = removed;\n }\n }\n\n private async getRemovedStagedFromMain(): Promise<ComponentID[]> {\n const stagedConfig = await this.workspace.scope.getStagedConfig();\n return stagedConfig\n .getAll()\n .filter((compConfig) => compConfig.config?.[RemoveAspect.id]?.removed)\n .map((compConfig) => compConfig.id);\n }\n\n private async getRemovedStagedFromLane(): Promise<ComponentID[]> {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return [];\n const laneIds = currentLane.toBitIds();\n const workspaceIds = await this.workspace.listIds();\n const laneIdsNotInWorkspace = laneIds.filter(\n (id) => !workspaceIds.find((wId) => wId._legacy.isEqualWithoutVersion(id))\n );\n if (!laneIdsNotInWorkspace.length) return [];\n const laneCompIdsNotInWorkspace = await this.workspace.scope.resolveMultipleComponentIds(laneIdsNotInWorkspace);\n const comps = await this.workspace.scope.getMany(laneCompIdsNotInWorkspace);\n const removed = comps.filter((c) => this.isRemoved(c));\n const staged = await Promise.all(\n removed.map(async (c) => {\n const snapDistance = await this.workspace.scope.getSnapDistance(c.id, false);\n if (snapDistance.err) {\n this.logger.warn(\n `getRemovedStagedFromLane unable to get snapDistance for ${c.id.toString()} due to ${snapDistance.err.name}`\n );\n // todo: not clear what should be done here. should we consider it as removed-staged or not.\n }\n if (snapDistance.isSourceAhead()) return c.id;\n return undefined;\n })\n );\n return compact(staged);\n }\n\n private async getLocalBitIdsToRemove(componentsPattern: string): Promise<BitId[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n return componentIds.map((id) => id._legacy);\n }\n\n private async getRemoteBitIdsToRemove(componentsPattern: string): Promise<BitId[]> {\n if (hasWildcard(componentsPattern)) {\n return getRemoteBitIdsByWildcards(componentsPattern);\n }\n return [BitId.parse(componentsPattern, true)];\n }\n\n static slots = [];\n static dependencies = [\n WorkspaceAspect,\n CLIAspect,\n LoggerAspect,\n ComponentAspect,\n ImporterAspect,\n DependencyResolverAspect,\n IssuesAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([workspace, cli, loggerMain, componentAspect, importerMain, depResolver, issues]: [\n Workspace,\n CLIMain,\n LoggerMain,\n ComponentMain,\n ImporterMain,\n DependencyResolverMain,\n IssuesMain\n ]) {\n const logger = loggerMain.createLogger(RemoveAspect.id);\n const removeMain = new RemoveMain(workspace, logger, importerMain, depResolver);\n issues.registerAddComponentsIssues(removeMain.addRemovedDependenciesIssues.bind(removeMain));\n componentAspect.registerShowFragments([new RemoveFragment(removeMain)]);\n cli.register(\n new RemoveCmd(removeMain, workspace),\n new DeleteCmd(removeMain, workspace),\n new RecoverCmd(removeMain)\n );\n return removeMain;\n }\n}\n\nRemoveAspect.addRuntime(RemoveMain);\n\nexport default RemoveMain;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IA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L,OAAA,EA1SUgB,UAAU,aA2SJuL,kBAAW;AAwB9B1I,sBAAY,CAAC2I,UAAU,CAACxL,UAAU,CAAC;AAAC,IAAAyL,QAAA,GAErBzL,UAAU;AAAA8K,OAAA,CAAA9L,OAAA,GAAAyM,QAAA"}
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@teambit/remove",
3
- "version": "0.0.313",
3
+ "version": "0.0.315",
4
4
  "homepage": "https://bit.cloud/teambit/component/remove",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "remove",
9
- "version": "0.0.313"
9
+ "version": "0.0.315"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
13
- "yn": "2.0.0",
13
+ "yesno": "0.4.0",
14
14
  "group-array": "1.0.0",
15
15
  "lodash.partition": "4.6.0",
16
16
  "p-map-series": "2.1.0",
@@ -18,18 +18,18 @@
18
18
  "lodash": "4.17.21",
19
19
  "core-js": "^3.0.0",
20
20
  "@babel/runtime": "7.20.0",
21
+ "@teambit/legacy-bit-id": "1.0.0",
21
22
  "@teambit/harmony": "0.4.6",
22
23
  "@teambit/component-id": "0.0.427",
23
- "@teambit/legacy-bit-id": "1.0.0",
24
24
  "@teambit/bit-error": "0.0.402",
25
- "@teambit/cli": "0.0.761",
26
- "@teambit/workspace": "0.0.1136",
27
- "@teambit/component": "0.0.1136",
25
+ "@teambit/cli": "0.0.762",
26
+ "@teambit/workspace": "0.0.1138",
27
+ "@teambit/component": "0.0.1138",
28
28
  "@teambit/component-issues": "0.0.95",
29
- "@teambit/dependency-resolver": "0.0.1136",
30
- "@teambit/importer": "0.0.565",
31
- "@teambit/issues": "0.0.444",
32
- "@teambit/logger": "0.0.854"
29
+ "@teambit/dependency-resolver": "0.0.1138",
30
+ "@teambit/importer": "0.0.567",
31
+ "@teambit/issues": "0.0.446",
32
+ "@teambit/logger": "0.0.855"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/lodash": "4.14.165",
@@ -41,7 +41,7 @@
41
41
  "@types/testing-library__jest-dom": "5.9.5"
42
42
  },
43
43
  "peerDependencies": {
44
- "@teambit/legacy": "1.0.545",
44
+ "@teambit/legacy": "1.0.546",
45
45
  "react": "^16.8.0 || ^17.0.0",
46
46
  "react-dom": "^16.8.0 || ^17.0.0"
47
47
  },
File without changes