@teambit/remove 0.0.203 → 0.0.205
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.
- package/dist/recover-cmd.d.ts +16 -0
- package/dist/recover-cmd.js +51 -0
- package/dist/recover-cmd.js.map +1 -0
- package/dist/remove.main.runtime.d.ts +18 -3
- package/dist/remove.main.runtime.js +85 -6
- package/dist/remove.main.runtime.js.map +1 -1
- package/package-tar/teambit-remove-0.0.205.tgz +0 -0
- package/package.json +9 -8
- package/package-tar/teambit-remove-0.0.203.tgz +0 -0
- /package/dist/{preview-1680146722705.js → preview-1680406095586.js} +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
+
import { RemoveMain } from './remove.main.runtime';
|
|
3
|
+
export declare type RecoverOptions = {
|
|
4
|
+
skipDependencyInstallation?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare class RecoverCmd implements Command {
|
|
7
|
+
private remove;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
group: string;
|
|
11
|
+
options: CommandOptions;
|
|
12
|
+
loader: boolean;
|
|
13
|
+
migration: boolean;
|
|
14
|
+
constructor(remove: RemoveMain);
|
|
15
|
+
report([componentName]: [string], options: RecoverOptions): Promise<string>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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.RecoverCmd = 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 _bitError() {
|
|
25
|
+
const data = require("@teambit/bit-error");
|
|
26
|
+
_bitError = function () {
|
|
27
|
+
return data;
|
|
28
|
+
};
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
class RecoverCmd {
|
|
32
|
+
constructor(remove) {
|
|
33
|
+
this.remove = remove;
|
|
34
|
+
(0, _defineProperty2().default)(this, "name", 'recover <component-name>');
|
|
35
|
+
(0, _defineProperty2().default)(this, "description", 'EXPERIMENTAL. recover soft-removed component(s) from the workspace, or a remote scope');
|
|
36
|
+
(0, _defineProperty2().default)(this, "group", 'collaborate');
|
|
37
|
+
(0, _defineProperty2().default)(this, "options", [['x', 'skip-dependency-installation', 'do not install packages in case of importing components']]);
|
|
38
|
+
(0, _defineProperty2().default)(this, "loader", true);
|
|
39
|
+
(0, _defineProperty2().default)(this, "migration", true);
|
|
40
|
+
}
|
|
41
|
+
async report([componentName], options) {
|
|
42
|
+
const hasRecovered = await this.remove.recover(componentName, options);
|
|
43
|
+
if (!hasRecovered) {
|
|
44
|
+
throw new (_bitError().BitError)(`component ${componentName} was not soft-removed, nothing to recover from`);
|
|
45
|
+
}
|
|
46
|
+
return _chalk().default.green(`successfully recovered ${componentName}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.RecoverCmd = RecoverCmd;
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=recover-cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["RecoverCmd","constructor","remove","report","componentName","options","hasRecovered","recover","BitError","chalk","green"],"sources":["recover-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { BitError } from '@teambit/bit-error';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { RemoveMain } from './remove.main.runtime';\n\nexport type RecoverOptions = {\n skipDependencyInstallation?: boolean;\n};\n\nexport class RecoverCmd implements Command {\n name = 'recover <component-name>';\n description = 'EXPERIMENTAL. recover soft-removed component(s) from the workspace, or a remote scope';\n group = 'collaborate';\n options = [\n ['x', 'skip-dependency-installation', 'do not install packages in case of importing components'],\n ] as CommandOptions;\n loader = true;\n migration = true;\n\n constructor(private remove: RemoveMain) {}\n\n async report([componentName]: [string], options: RecoverOptions) {\n const hasRecovered = await this.remove.recover(componentName, options);\n if (!hasRecovered) {\n throw new BitError(`component ${componentName} was not soft-removed, nothing to recover from`);\n }\n return chalk.green(`successfully recovered ${componentName}`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAQO,MAAMA,UAAU,CAAoB;EAUzCC,WAAW,CAASC,MAAkB,EAAE;IAAA,KAApBA,MAAkB,GAAlBA,MAAkB;IAAA,8CAT/B,0BAA0B;IAAA,qDACnB,uFAAuF;IAAA,+CAC7F,aAAa;IAAA,iDACX,CACR,CAAC,GAAG,EAAE,8BAA8B,EAAE,yDAAyD,CAAC,CACjG;IAAA,gDACQ,IAAI;IAAA,mDACD,IAAI;EAEyB;EAEzC,MAAMC,MAAM,CAAC,CAACC,aAAa,CAAW,EAAEC,OAAuB,EAAE;IAC/D,MAAMC,YAAY,GAAG,MAAM,IAAI,CAACJ,MAAM,CAACK,OAAO,CAACH,aAAa,EAAEC,OAAO,CAAC;IACtE,IAAI,CAACC,YAAY,EAAE;MACjB,MAAM,KAAIE,oBAAQ,EAAE,aAAYJ,aAAc,gDAA+C,CAAC;IAChG;IACA,OAAOK,gBAAK,CAACC,KAAK,CAAE,0BAAyBN,aAAc,EAAC,CAAC;EAC/D;AACF;AAAC"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { CLIMain } from '@teambit/cli';
|
|
2
2
|
import { Logger, LoggerMain } from '@teambit/logger';
|
|
3
3
|
import { Workspace } from '@teambit/workspace';
|
|
4
|
+
import { ImporterMain } from '@teambit/importer';
|
|
4
5
|
import { ComponentID } from '@teambit/component-id';
|
|
5
6
|
import { Component, ComponentMain } from '@teambit/component';
|
|
7
|
+
import { RecoverOptions } from './recover-cmd';
|
|
6
8
|
export declare type RemoveInfo = {
|
|
7
9
|
removed: boolean;
|
|
8
10
|
};
|
|
9
11
|
export declare class RemoveMain {
|
|
10
12
|
private workspace;
|
|
11
13
|
private logger;
|
|
12
|
-
|
|
14
|
+
private importer;
|
|
15
|
+
constructor(workspace: Workspace, logger: Logger, importer: ImporterMain);
|
|
13
16
|
remove({ componentsPattern, force, remote, track, deleteFiles, fromLane, }: {
|
|
14
17
|
componentsPattern: string;
|
|
15
18
|
force: boolean;
|
|
@@ -19,6 +22,17 @@ export declare class RemoveMain {
|
|
|
19
22
|
fromLane: boolean;
|
|
20
23
|
}): Promise<any>;
|
|
21
24
|
softRemove(componentsPattern: string): Promise<ComponentID[]>;
|
|
25
|
+
/**
|
|
26
|
+
* recover a soft-removed component.
|
|
27
|
+
* there are 4 different scenarios.
|
|
28
|
+
* 1. a component was just soft-removed, it wasn't snapped yet. so it's now in .bitmap with the "removed" aspect entry.
|
|
29
|
+
* 2. soft-removed and then snapped. It's not in .bitmap now.
|
|
30
|
+
* 3. soft-removed, snapped, exported. it's not in .bitmap now.
|
|
31
|
+
* 4. a soft-removed components was imported, so it's now in .bitmap without the "removed" aspect entry.
|
|
32
|
+
* 5. workspace is empty. the soft-removed component is on the remote.
|
|
33
|
+
* returns `true` if it was recovered. `false` if the component wasn't soft-removed, so nothing to recover from.
|
|
34
|
+
*/
|
|
35
|
+
recover(compIdStr: string, options: RecoverOptions): Promise<boolean>;
|
|
22
36
|
private throwForMainComponentWhenOnLane;
|
|
23
37
|
getRemoveInfo(component: Component): RemoveInfo;
|
|
24
38
|
isRemoved(component: Component): boolean;
|
|
@@ -31,11 +45,12 @@ export declare class RemoveMain {
|
|
|
31
45
|
static slots: never[];
|
|
32
46
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
33
47
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
34
|
-
static provider([workspace, cli, loggerMain, componentAspect]: [
|
|
48
|
+
static provider([workspace, cli, loggerMain, componentAspect, importerMain]: [
|
|
35
49
|
Workspace,
|
|
36
50
|
CLIMain,
|
|
37
51
|
LoggerMain,
|
|
38
|
-
ComponentMain
|
|
52
|
+
ComponentMain,
|
|
53
|
+
ImporterMain
|
|
39
54
|
]): Promise<RemoveMain>;
|
|
40
55
|
}
|
|
41
56
|
export default RemoveMain;
|
|
@@ -56,6 +56,13 @@ function _exceptions() {
|
|
|
56
56
|
};
|
|
57
57
|
return data;
|
|
58
58
|
}
|
|
59
|
+
function _importer() {
|
|
60
|
+
const data = _interopRequireDefault(require("@teambit/importer"));
|
|
61
|
+
_importer = function () {
|
|
62
|
+
return data;
|
|
63
|
+
};
|
|
64
|
+
return data;
|
|
65
|
+
}
|
|
59
66
|
function _hasWildcard() {
|
|
60
67
|
const data = _interopRequireDefault(require("@teambit/legacy/dist/utils/string/has-wildcard"));
|
|
61
68
|
_hasWildcard = function () {
|
|
@@ -126,11 +133,19 @@ function _remove2() {
|
|
|
126
133
|
};
|
|
127
134
|
return data;
|
|
128
135
|
}
|
|
136
|
+
function _recoverCmd() {
|
|
137
|
+
const data = require("./recover-cmd");
|
|
138
|
+
_recoverCmd = function () {
|
|
139
|
+
return data;
|
|
140
|
+
};
|
|
141
|
+
return data;
|
|
142
|
+
}
|
|
129
143
|
const BEFORE_REMOVE = 'removing components';
|
|
130
144
|
class RemoveMain {
|
|
131
|
-
constructor(workspace, logger) {
|
|
145
|
+
constructor(workspace, logger, importer) {
|
|
132
146
|
this.workspace = workspace;
|
|
133
147
|
this.logger = logger;
|
|
148
|
+
this.importer = importer;
|
|
134
149
|
}
|
|
135
150
|
async remove({
|
|
136
151
|
componentsPattern,
|
|
@@ -181,6 +196,70 @@ class RemoveMain {
|
|
|
181
196
|
await (0, _deleteComponentFiles().default)(this.workspace.consumer, bitIds);
|
|
182
197
|
return componentIds;
|
|
183
198
|
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* recover a soft-removed component.
|
|
202
|
+
* there are 4 different scenarios.
|
|
203
|
+
* 1. a component was just soft-removed, it wasn't snapped yet. so it's now in .bitmap with the "removed" aspect entry.
|
|
204
|
+
* 2. soft-removed and then snapped. It's not in .bitmap now.
|
|
205
|
+
* 3. soft-removed, snapped, exported. it's not in .bitmap now.
|
|
206
|
+
* 4. a soft-removed components was imported, so it's now in .bitmap without the "removed" aspect entry.
|
|
207
|
+
* 5. workspace is empty. the soft-removed component is on the remote.
|
|
208
|
+
* returns `true` if it was recovered. `false` if the component wasn't soft-removed, so nothing to recover from.
|
|
209
|
+
*/
|
|
210
|
+
async recover(compIdStr, options) {
|
|
211
|
+
if (!this.workspace) throw new (_exceptions().ConsumerNotFound)();
|
|
212
|
+
const bitMapEntry = this.workspace.consumer.bitMap.components.find(compMap => {
|
|
213
|
+
return compMap.id.name === compIdStr || compMap.id.toStringWithoutVersion() === compIdStr;
|
|
214
|
+
});
|
|
215
|
+
const importComp = async idStr => {
|
|
216
|
+
await this.importer.import({
|
|
217
|
+
ids: [idStr],
|
|
218
|
+
installNpmPackages: !options.skipDependencyInstallation,
|
|
219
|
+
override: true
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
const setAsRemovedFalse = async compId => {
|
|
223
|
+
await this.workspace.addSpecificComponentConfig(compId, _remove().RemoveAspect.id, {
|
|
224
|
+
removed: false
|
|
225
|
+
});
|
|
226
|
+
await this.workspace.bitMap.write();
|
|
227
|
+
};
|
|
228
|
+
if (bitMapEntry) {
|
|
229
|
+
var _bitMapEntry$config;
|
|
230
|
+
if ((_bitMapEntry$config = bitMapEntry.config) !== null && _bitMapEntry$config !== void 0 && _bitMapEntry$config[_remove().RemoveAspect.id]) {
|
|
231
|
+
var _bitMapEntry$config2;
|
|
232
|
+
// case #1
|
|
233
|
+
(_bitMapEntry$config2 = bitMapEntry.config) === null || _bitMapEntry$config2 === void 0 ? true : delete _bitMapEntry$config2[_remove().RemoveAspect.id];
|
|
234
|
+
await importComp(bitMapEntry.id.toString());
|
|
235
|
+
return true;
|
|
236
|
+
}
|
|
237
|
+
// case #4
|
|
238
|
+
const compId = await this.workspace.resolveComponentId(bitMapEntry.id);
|
|
239
|
+
const comp = await this.workspace.get(compId);
|
|
240
|
+
if (!this.isRemoved(comp)) {
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
await setAsRemovedFalse(compId);
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
246
|
+
const compId = await this.workspace.scope.resolveComponentId(compIdStr);
|
|
247
|
+
const compFromScope = await this.workspace.scope.get(compId);
|
|
248
|
+
if (compFromScope && this.isRemoved(compFromScope)) {
|
|
249
|
+
// case #2 and #3
|
|
250
|
+
await importComp(compId._legacy.toString());
|
|
251
|
+
await setAsRemovedFalse(compId);
|
|
252
|
+
return true;
|
|
253
|
+
}
|
|
254
|
+
// case #5
|
|
255
|
+
const comp = await this.workspace.scope.getRemoteComponent(compId);
|
|
256
|
+
if (!this.isRemoved(comp)) {
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
259
|
+
await importComp(compId._legacy.toString());
|
|
260
|
+
await setAsRemovedFalse(compId);
|
|
261
|
+
return true;
|
|
262
|
+
}
|
|
184
263
|
async throwForMainComponentWhenOnLane(components) {
|
|
185
264
|
const currentLane = await this.workspace.getCurrentLaneObject();
|
|
186
265
|
if (!currentLane) return; // user on main
|
|
@@ -223,17 +302,17 @@ ${mainComps.map(c => c.id.toString()).join('\n')}`);
|
|
|
223
302
|
}
|
|
224
303
|
return [_legacyBitId().BitId.parse(componentsPattern, true)];
|
|
225
304
|
}
|
|
226
|
-
static async provider([workspace, cli, loggerMain, componentAspect]) {
|
|
305
|
+
static async provider([workspace, cli, loggerMain, componentAspect, importerMain]) {
|
|
227
306
|
const logger = loggerMain.createLogger(_remove().RemoveAspect.id);
|
|
228
|
-
const removeMain = new RemoveMain(workspace, logger);
|
|
307
|
+
const removeMain = new RemoveMain(workspace, logger, importerMain);
|
|
229
308
|
componentAspect.registerShowFragments([new (_remove2().RemoveFragment)(removeMain)]);
|
|
230
|
-
cli.register(new (_removeCmd().RemoveCmd)(removeMain));
|
|
231
|
-
return
|
|
309
|
+
cli.register(new (_removeCmd().RemoveCmd)(removeMain), new (_recoverCmd().RecoverCmd)(removeMain));
|
|
310
|
+
return removeMain;
|
|
232
311
|
}
|
|
233
312
|
}
|
|
234
313
|
exports.RemoveMain = RemoveMain;
|
|
235
314
|
(0, _defineProperty2().default)(RemoveMain, "slots", []);
|
|
236
|
-
(0, _defineProperty2().default)(RemoveMain, "dependencies", [_workspace().default, _cli().CLIAspect, _logger().LoggerAspect, _component().default]);
|
|
315
|
+
(0, _defineProperty2().default)(RemoveMain, "dependencies", [_workspace().default, _cli().CLIAspect, _logger().LoggerAspect, _component().default, _importer().default]);
|
|
237
316
|
(0, _defineProperty2().default)(RemoveMain, "runtime", _cli().MainRuntime);
|
|
238
317
|
_remove().RemoveAspect.addRuntime(RemoveMain);
|
|
239
318
|
var _default = RemoveMain;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BEFORE_REMOVE","RemoveMain","constructor","workspace","logger","remove","componentsPattern","force","remote","track","deleteFiles","fromLane","setStatusLine","bitIds","getRemoteBitIdsToRemove","getLocalBitIdsToRemove","consumer","removeResults","removeComponents","ids","BitIds","fromArray","onDestroy","softRemove","ConsumerNotFound","currentLane","getCurrentLaneObject","isNew","BitError","name","componentIds","idsByPattern","components","getMany","newComps","filter","c","id","hasVersion","length","map","toString","join","throwForMainComponentWhenOnLane","removeComponentsFromNodeModules","state","_consumer","compId","bitMap","addComponentConfig","RemoveAspect","removed","write","_legacy","deleteComponentsFiles","laneComps","toBitIds","mainComps","comp","hasWithoutVersion","getRemoveInfo","component","data","config","extensions","findExtension","isRemoved","getRemovedStaged","stagedConfig","scope","getStagedConfig","getAll","compConfig","hasWildcard","getRemoteBitIdsByWildcards","BitId","parse","provider","cli","loggerMain","componentAspect","createLogger","removeMain","registerShowFragments","RemoveFragment","register","RemoveCmd","WorkspaceAspect","CLIAspect","LoggerAspect","ComponentAspect","MainRuntime","addRuntime"],"sources":["remove.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { 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 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 ComponentAspect, { Component, ComponentMain } from '@teambit/component';\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';\n\nconst BEFORE_REMOVE = 'removing components';\n\nexport type RemoveInfo = {\n removed: boolean;\n};\n\nexport class RemoveMain {\n constructor(private workspace: Workspace, private logger: Logger) {}\n\n async remove({\n componentsPattern,\n force,\n remote,\n track,\n deleteFiles,\n fromLane,\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 async softRemove(componentsPattern: string): Promise<ComponentID[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (currentLane?.isNew) {\n throw new BitError(\n `unable to soft-remove on a new (not-exported) lane \"${currentLane.name}\". please remove without --soft`\n );\n }\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n const components = await this.workspace.getMany(componentIds);\n const newComps = components.filter((c) => !c.id.hasVersion());\n if (newComps.length) {\n throw new BitError(\n `unable to soft-remove the following new component(s), please remove them without --soft\\n${newComps\n .map((c) => c.id.toString())\n .join('\\n')}`\n );\n }\n await this.throwForMainComponentWhenOnLane(components);\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 componentIds.map((compId) =>\n this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, {\n removed: true,\n })\n );\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 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 * get components that were soft-removed and tagged/snapped but not exported yet.\n */\n async getRemovedStaged(): 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 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 = [WorkspaceAspect, CLIAspect, LoggerAspect, ComponentAspect];\n static runtime = MainRuntime;\n\n static async provider([workspace, cli, loggerMain, componentAspect]: [\n Workspace,\n CLIMain,\n LoggerMain,\n ComponentMain\n ]) {\n const logger = loggerMain.createLogger(RemoveAspect.id);\n const removeMain = new RemoveMain(workspace, logger);\n componentAspect.registerShowFragments([new RemoveFragment(removeMain)]);\n cli.register(new RemoveCmd(removeMain));\n return new RemoveMain(workspace, logger);\n }\n}\n\nRemoveAspect.addRuntime(RemoveMain);\n\nexport default RemoveMain;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;I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B,sBAAY,CAACb,EAAE,CAAC;IACvD,MAAM6C,UAAU,GAAG,IAAIjF,UAAU,CAACE,SAAS,EAAEC,MAAM,CAAC;IACpD4E,eAAe,CAACG,qBAAqB,CAAC,CAAC,KAAIC,yBAAc,EAACF,UAAU,CAAC,CAAC,CAAC;IACvEJ,GAAG,CAACO,QAAQ,CAAC,KAAIC,sBAAS,EAACJ,UAAU,CAAC,CAAC;IACvC,OAAO,IAAIjF,UAAU,CAACE,SAAS,EAAEC,MAAM,CAAC;EAC1C;AACF;AAAC;AAAA,gCAxIYH,UAAU,WAwHN,EAAE;AAAA,gCAxHNA,UAAU,kBAyHC,CAACsF,oBAAe,EAAEC,gBAAS,EAAEC,sBAAY,EAAEC,oBAAe,CAAC;AAAA,gCAzHtEzF,UAAU,aA0HJ0F,kBAAW;AAgB9BzC,sBAAY,CAAC0C,UAAU,CAAC3F,UAAU,CAAC;AAAC,eAErBA,UAAU;AAAA"}
|
|
1
|
+
{"version":3,"names":["BEFORE_REMOVE","RemoveMain","constructor","workspace","logger","importer","remove","componentsPattern","force","remote","track","deleteFiles","fromLane","setStatusLine","bitIds","getRemoteBitIdsToRemove","getLocalBitIdsToRemove","consumer","removeResults","removeComponents","ids","BitIds","fromArray","onDestroy","softRemove","ConsumerNotFound","currentLane","getCurrentLaneObject","isNew","BitError","name","componentIds","idsByPattern","components","getMany","newComps","filter","c","id","hasVersion","length","map","toString","join","throwForMainComponentWhenOnLane","removeComponentsFromNodeModules","state","_consumer","compId","bitMap","addComponentConfig","RemoveAspect","removed","write","_legacy","deleteComponentsFiles","recover","compIdStr","options","bitMapEntry","find","compMap","toStringWithoutVersion","importComp","idStr","import","installNpmPackages","skipDependencyInstallation","override","setAsRemovedFalse","addSpecificComponentConfig","config","resolveComponentId","comp","get","isRemoved","scope","compFromScope","getRemoteComponent","laneComps","toBitIds","mainComps","hasWithoutVersion","getRemoveInfo","component","data","extensions","findExtension","getRemovedStaged","stagedConfig","getStagedConfig","getAll","compConfig","hasWildcard","getRemoteBitIdsByWildcards","BitId","parse","provider","cli","loggerMain","componentAspect","importerMain","createLogger","removeMain","registerShowFragments","RemoveFragment","register","RemoveCmd","RecoverCmd","WorkspaceAspect","CLIAspect","LoggerAspect","ComponentAspect","ImporterAspect","MainRuntime","addRuntime"],"sources":["remove.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { 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 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 ComponentAspect, { Component, ComponentMain } from '@teambit/component';\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\nexport class RemoveMain {\n constructor(private workspace: Workspace, private logger: Logger, private importer: ImporterMain) {}\n\n async remove({\n componentsPattern,\n force,\n remote,\n track,\n deleteFiles,\n fromLane,\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 async softRemove(componentsPattern: string): Promise<ComponentID[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (currentLane?.isNew) {\n throw new BitError(\n `unable to soft-remove on a new (not-exported) lane \"${currentLane.name}\". please remove without --soft`\n );\n }\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n const components = await this.workspace.getMany(componentIds);\n const newComps = components.filter((c) => !c.id.hasVersion());\n if (newComps.length) {\n throw new BitError(\n `unable to soft-remove the following new component(s), please remove them without --soft\\n${newComps\n .map((c) => c.id.toString())\n .join('\\n')}`\n );\n }\n await this.throwForMainComponentWhenOnLane(components);\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 componentIds.map((compId) =>\n this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, {\n removed: true,\n })\n );\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 /**\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 compFromScope = await this.workspace.scope.get(compId);\n if (compFromScope && this.isRemoved(compFromScope)) {\n // case #2 and #3\n await importComp(compId._legacy.toString());\n await setAsRemovedFalse(compId);\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 * get components that were soft-removed and tagged/snapped but not exported yet.\n */\n async getRemovedStaged(): 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 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 = [WorkspaceAspect, CLIAspect, LoggerAspect, ComponentAspect, ImporterAspect];\n static runtime = MainRuntime;\n\n static async provider([workspace, cli, loggerMain, componentAspect, importerMain]: [\n Workspace,\n CLIMain,\n LoggerMain,\n ComponentMain,\n ImporterMain\n ]) {\n const logger = loggerMain.createLogger(RemoveAspect.id);\n const removeMain = new RemoveMain(workspace, logger, importerMain);\n componentAspect.registerShowFragments([new RemoveFragment(removeMain)]);\n cli.register(new RemoveCmd(removeMain), new RecoverCmd(removeMain));\n return removeMain;\n }\n}\n\nRemoveAspect.addRuntime(RemoveMain);\n\nexport default RemoveMain;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EA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,EAAE,CAAC;IACvD,MAAMiE,UAAU,GAAG,IAAItG,UAAU,CAACE,SAAS,EAAEC,MAAM,EAAEiG,YAAY,CAAC;IAClED,eAAe,CAACI,qBAAqB,CAAC,CAAC,KAAIC,yBAAc,EAACF,UAAU,CAAC,CAAC,CAAC;IACvEL,GAAG,CAACQ,QAAQ,CAAC,KAAIC,sBAAS,EAACJ,UAAU,CAAC,EAAE,KAAIK,wBAAU,EAACL,UAAU,CAAC,CAAC;IACnE,OAAOA,UAAU;EACnB;AACF;AAAC;AAAA,gCAtMYtG,UAAU,WAqLN,EAAE;AAAA,gCArLNA,UAAU,kBAsLC,CAAC4G,oBAAe,EAAEC,gBAAS,EAAEC,sBAAY,EAAEC,oBAAe,EAAEC,mBAAc,CAAC;AAAA,gCAtLtFhH,UAAU,aAuLJiH,kBAAW;AAiB9B/D,sBAAY,CAACgE,UAAU,CAAClH,UAAU,CAAC;AAAC,eAErBA,UAAU;AAAA"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/remove",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"homepage": "https://bit.
|
|
3
|
+
"version": "0.0.205",
|
|
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.
|
|
9
|
+
"version": "0.0.205"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -21,10 +21,11 @@
|
|
|
21
21
|
"@teambit/component-id": "0.0.427",
|
|
22
22
|
"@teambit/legacy-bit-id": "0.0.423",
|
|
23
23
|
"@teambit/bit-error": "0.0.402",
|
|
24
|
-
"@teambit/cli": "0.0.
|
|
25
|
-
"@teambit/component": "0.0.
|
|
26
|
-
"@teambit/
|
|
27
|
-
"@teambit/
|
|
24
|
+
"@teambit/cli": "0.0.691",
|
|
25
|
+
"@teambit/component": "0.0.1028",
|
|
26
|
+
"@teambit/importer": "0.0.457",
|
|
27
|
+
"@teambit/logger": "0.0.784",
|
|
28
|
+
"@teambit/workspace": "0.0.1028"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"@types/mocha": "9.1.0",
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
"@types/testing-library__jest-dom": "5.9.5"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
|
-
"@teambit/legacy": "1.0.
|
|
39
|
+
"@teambit/legacy": "1.0.471",
|
|
39
40
|
"react": "^16.8.0 || ^17.0.0",
|
|
40
41
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
41
42
|
},
|
|
Binary file
|
|
File without changes
|