@teambit/remove 1.0.330 → 1.0.332
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/artifacts/__bit_junit.xml +1 -1
- package/artifacts/schema.json +1405 -618
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/remove-components.d.ts +3 -0
- package/dist/remove-components.js +33 -12
- package/dist/remove-components.js.map +1 -1
- package/dist/remove.main.runtime.js +5 -12
- package/dist/remove.main.runtime.js.map +1 -1
- package/package.json +16 -12
- /package/dist/{preview-1720513025675.js → preview-1720690103747.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ export type { RemoveMain, RemoveInfo } from './remove.main.runtime';
|
|
|
3
3
|
export type { RemovedLocalObjects } from './removed-local-objects';
|
|
4
4
|
export { deleteComponentsFiles } from './delete-component-files';
|
|
5
5
|
export { removeTemplate } from './remove-template';
|
|
6
|
+
export { removeComponentsFromNodeModules } from './remove-components';
|
|
6
7
|
export default RemoveAspect;
|
|
7
8
|
export { RemoveAspect };
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,12 @@ Object.defineProperty(exports, "deleteComponentsFiles", {
|
|
|
16
16
|
return _deleteComponentFiles().deleteComponentsFiles;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
+
Object.defineProperty(exports, "removeComponentsFromNodeModules", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return _removeComponents().removeComponentsFromNodeModules;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
19
25
|
Object.defineProperty(exports, "removeTemplate", {
|
|
20
26
|
enumerable: true,
|
|
21
27
|
get: function () {
|
|
@@ -43,6 +49,13 @@ function _removeTemplate() {
|
|
|
43
49
|
};
|
|
44
50
|
return data;
|
|
45
51
|
}
|
|
52
|
+
function _removeComponents() {
|
|
53
|
+
const data = require("./remove-components");
|
|
54
|
+
_removeComponents = function () {
|
|
55
|
+
return data;
|
|
56
|
+
};
|
|
57
|
+
return data;
|
|
58
|
+
}
|
|
46
59
|
var _default = exports.default = _remove().RemoveAspect;
|
|
47
60
|
|
|
48
61
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_remove","data","require","_deleteComponentFiles","_removeTemplate","_default","exports","default","RemoveAspect"],"sources":["index.ts"],"sourcesContent":["import { RemoveAspect } from './remove.aspect';\n\nexport type { RemoveMain, RemoveInfo } from './remove.main.runtime';\nexport type { RemovedLocalObjects } from './removed-local-objects';\nexport { deleteComponentsFiles } from './delete-component-files';\nexport { removeTemplate } from './remove-template';\nexport default RemoveAspect;\nexport { RemoveAspect };\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_remove","data","require","_deleteComponentFiles","_removeTemplate","_removeComponents","_default","exports","default","RemoveAspect"],"sources":["index.ts"],"sourcesContent":["import { RemoveAspect } from './remove.aspect';\n\nexport type { RemoveMain, RemoveInfo } from './remove.main.runtime';\nexport type { RemovedLocalObjects } from './removed-local-objects';\nexport { deleteComponentsFiles } from './delete-component-files';\nexport { removeTemplate } from './remove-template';\nexport { removeComponentsFromNodeModules } from './remove-components';\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;AAIA,SAAAE,sBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,qBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,gBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,eAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,iBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsE,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACvDC,sBAAY","ignoreList":[]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Workspace } from '@teambit/workspace';
|
|
2
2
|
import { ComponentIdList } from '@teambit/component-id';
|
|
3
3
|
import RemovedObjects from '@teambit/legacy/dist/scope/removed-components';
|
|
4
|
+
import { Consumer } from '@teambit/legacy/dist/consumer';
|
|
5
|
+
import ConsumerComponent from '@teambit/legacy/dist/consumer/component';
|
|
4
6
|
import { RemovedLocalObjects } from './removed-local-objects';
|
|
5
7
|
export type RemoveComponentsResult = {
|
|
6
8
|
localResult: RemovedLocalObjects;
|
|
@@ -23,3 +25,4 @@ export declare function removeComponents({ workspace, ids, force, remote, track,
|
|
|
23
25
|
track: boolean;
|
|
24
26
|
deleteFiles: boolean;
|
|
25
27
|
}): Promise<RemoveComponentsResult>;
|
|
28
|
+
export declare function removeComponentsFromNodeModules(consumer: Consumer, components: ConsumerComponent[]): Promise<void[]>;
|
|
@@ -4,6 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.removeComponents = removeComponents;
|
|
7
|
+
exports.removeComponentsFromNodeModules = removeComponentsFromNodeModules;
|
|
8
|
+
function _fsExtra() {
|
|
9
|
+
const data = _interopRequireDefault(require("fs-extra"));
|
|
10
|
+
_fsExtra = function () {
|
|
11
|
+
return data;
|
|
12
|
+
};
|
|
13
|
+
return data;
|
|
14
|
+
}
|
|
7
15
|
function _groupArray() {
|
|
8
16
|
const data = _interopRequireDefault(require("group-array"));
|
|
9
17
|
_groupArray = function () {
|
|
@@ -102,16 +110,16 @@ function _consumerComponent() {
|
|
|
102
110
|
};
|
|
103
111
|
return data;
|
|
104
112
|
}
|
|
105
|
-
function
|
|
106
|
-
const data =
|
|
107
|
-
|
|
113
|
+
function _pMapSeries() {
|
|
114
|
+
const data = _interopRequireDefault(require("p-map-series"));
|
|
115
|
+
_pMapSeries = function () {
|
|
108
116
|
return data;
|
|
109
117
|
};
|
|
110
118
|
return data;
|
|
111
119
|
}
|
|
112
|
-
function
|
|
113
|
-
const data =
|
|
114
|
-
|
|
120
|
+
function _pkgModules() {
|
|
121
|
+
const data = require("@teambit/pkg.modules.component-package-name");
|
|
122
|
+
_pkgModules = function () {
|
|
115
123
|
return data;
|
|
116
124
|
};
|
|
117
125
|
return data;
|
|
@@ -123,9 +131,12 @@ function _removedLocalObjects() {
|
|
|
123
131
|
};
|
|
124
132
|
return data;
|
|
125
133
|
}
|
|
126
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
127
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
128
134
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
135
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
136
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
137
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
138
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
139
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
129
140
|
/**
|
|
130
141
|
* Remove components local and remote
|
|
131
142
|
* splits array of ids into local and remote and removes according to flags
|
|
@@ -237,8 +248,7 @@ If you understand the risks and wish to proceed with the removal, please use the
|
|
|
237
248
|
const idsToRemoveFromScope = _componentId().ComponentIdList.fromArray(idsToRemove.filter(id => !newComponents.hasWithoutVersion(id)));
|
|
238
249
|
const idsToCleanFromWorkspace = _componentId().ComponentIdList.fromArray(idsToRemove.filter(id => newComponents.hasWithoutVersion(id)));
|
|
239
250
|
const {
|
|
240
|
-
components: componentsToRemove
|
|
241
|
-
invalidComponents
|
|
251
|
+
components: componentsToRemove
|
|
242
252
|
} = await consumer.loadComponents(idsToRemove, false);
|
|
243
253
|
const {
|
|
244
254
|
removedComponentIds,
|
|
@@ -251,14 +261,25 @@ If you understand the risks and wish to proceed with the removal, please use the
|
|
|
251
261
|
if (idsToCleanFromWorkspace.length) {
|
|
252
262
|
if (deleteFiles) await (0, _deleteComponentFiles().deleteComponentsFiles)(consumer, idsToCleanFromWorkspace);
|
|
253
263
|
if (!track) {
|
|
254
|
-
const invalidComponentsIds = invalidComponents.map(i => i.id);
|
|
255
264
|
const removedComponents = componentsToRemove.filter(c => idsToCleanFromWorkspace.hasWithoutVersion(c.id));
|
|
256
|
-
await
|
|
265
|
+
await consumer.packageJson.removeComponentsFromDependencies(removedComponents);
|
|
266
|
+
await removeComponentsFromNodeModules(consumer, removedComponents);
|
|
257
267
|
await consumer.cleanFromBitMap(idsToCleanFromWorkspace);
|
|
258
268
|
await workspace.cleanFromConfig(idsToCleanFromWorkspace);
|
|
259
269
|
}
|
|
260
270
|
}
|
|
261
271
|
return new (_removedLocalObjects().RemovedLocalObjects)(_componentId().ComponentIdList.uniqFromArray([...idsToCleanFromWorkspace, ...removedComponentIds]), missingComponents, modifiedComponents, dependentBits, removedFromLane);
|
|
262
272
|
}
|
|
273
|
+
async function removeComponentsFromNodeModules(consumer, components) {
|
|
274
|
+
_logger().default.debug(`removeComponentsFromNodeModules: ${components.map(c => c.id.toString()).join(', ')}`);
|
|
275
|
+
const pathsToRemoveWithNulls = components.map(c => {
|
|
276
|
+
return (0, _pkgModules().getNodeModulesPathOfComponent)(_objectSpread(_objectSpread({}, c), {}, {
|
|
277
|
+
id: c.id
|
|
278
|
+
}));
|
|
279
|
+
});
|
|
280
|
+
const pathsToRemove = (0, _lodash2().compact)(pathsToRemoveWithNulls);
|
|
281
|
+
_logger().default.debug(`deleting the following paths: ${pathsToRemove.join('\n')}`);
|
|
282
|
+
return Promise.all(pathsToRemove.map(componentPath => _fsExtra().default.remove(consumer.toAbsolutePath(componentPath))));
|
|
283
|
+
}
|
|
263
284
|
|
|
264
285
|
//# sourceMappingURL=remove-components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_groupArray","data","_interopRequireDefault","require","_lodash","_componentId","_lodash2","_constants","_bitError","_enrichContextFromGlobal","_logger","_http","_remotes","_scopeRemotes","_deleteComponentFiles","_componentsList","_consumerComponent","packageJsonUtils","_interopRequireWildcard","_pMapSeries","_removedLocalObjects","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","removeComponents","workspace","ids","force","remote","track","deleteFiles","logger","debugAndAddBreadCrumb","toString","bitIdsLatest","ComponentIdList","fromArray","map","id","changeVersion","LATEST_BIT_VERSION","localIds","remoteIds","partition","isLocal","length","BitError","join","remoteResult","isEmpty","removeRemote","localResult","removeLocal","RemovedLocalObjects","bitIds","groupedBitsByScope","groupArray","remotes","getScopeRemotes","scope","legacyScope","Remotes","getGlobalRemotes","shouldGoToCentralHub","keys","http","Http","connect","CENTRAL_BIT_HUB_URL","CENTRAL_BIT_HUB_NAME","deleteViaCentralHub","idsAreLanes","context","enrichContextFromGlobal","removeP","key","resolvedRemote","resolve","idsStr","toStringWithoutVersion","deleteMany","Promise","all","consumer","modifiedComponents","nonModifiedComponents","newIds","pMapSeries","componentStatus","getComponentStatusById","newlyCreated","push","modified","err","Component","isComponentInvalidByErrorType","list","listWithInvalid","components","forEach","c","hasWithoutVersion","aspectIds","state","aspects","used","find","newId","includes","idsToRemove","componentsList","ComponentsList","newComponents","listNewComponents","idsToRemoveFromScope","filter","idsToCleanFromWorkspace","componentsToRemove","invalidComponents","loadComponents","removedComponentIds","missingComponents","dependentBits","removedFromLane","removeMany","deleteComponentsFiles","invalidComponentsIds","removedComponents","removeComponentsFromWorkspacesAndDependencies","cleanFromBitMap","cleanFromConfig","uniqFromArray"],"sources":["remove-components.ts"],"sourcesContent":["import groupArray from 'group-array';\nimport partition from 'lodash.partition';\nimport { Workspace } from '@teambit/workspace';\nimport { ComponentIdList } from '@teambit/component-id';\nimport { isEmpty } from 'lodash';\nimport { CENTRAL_BIT_HUB_NAME, CENTRAL_BIT_HUB_URL, LATEST_BIT_VERSION } from '@teambit/legacy/dist/constants';\nimport { BitError } from '@teambit/bit-error';\nimport enrichContextFromGlobal from '@teambit/legacy/dist/hooks/utils/enrich-context-from-global';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport { Http } from '@teambit/legacy/dist/scope/network/http';\nimport { Remotes } from '@teambit/legacy/dist/remotes';\nimport { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';\nimport { deleteComponentsFiles } from './delete-component-files';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport Component from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport RemovedObjects from '@teambit/legacy/dist/scope/removed-components';\nimport * as packageJsonUtils from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport pMapSeries from 'p-map-series';\nimport { RemovedLocalObjects } from './removed-local-objects';\n\nexport type RemoveComponentsResult = { localResult: RemovedLocalObjects; remoteResult: RemovedObjects[] };\n\n/**\n * Remove components local and remote\n * splits array of ids into local and remote and removes according to flags\n * @param {string[]} ids - list of remote component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n * @param {boolean} remote - delete component from a remote scope\n * @param {boolean} track - keep tracking local staged components in bitmap.\n * @param {boolean} deleteFiles - delete local added files from fs.\n */\nexport async function removeComponents({\n workspace,\n ids,\n force,\n remote,\n track,\n deleteFiles,\n}: {\n workspace?: Workspace; // when remote is false, it's always set\n ids: ComponentIdList;\n force: boolean;\n remote: boolean;\n track: boolean;\n deleteFiles: boolean;\n}): Promise<RemoveComponentsResult> {\n logger.debugAndAddBreadCrumb('removeComponents', `{ids}. force: ${force.toString()}`, { ids: ids.toString() });\n // added this to remove support for remove only one version from a component\n const bitIdsLatest = ComponentIdList.fromArray(\n ids.map((id) => {\n return id.changeVersion(LATEST_BIT_VERSION);\n })\n );\n const [localIds, remoteIds] = partition(bitIdsLatest, (id) => id.isLocal());\n if (remote && localIds.length) {\n throw new BitError(\n `unable to remove the remote components: ${localIds.join(',')} as they don't contain a scope-name`\n );\n }\n const remoteResult = remote && !isEmpty(remoteIds) ? await removeRemote(workspace, remoteIds, force) : [];\n const localResult = !remote\n ? await removeLocal(workspace as Workspace, bitIdsLatest, force, track, deleteFiles)\n : new RemovedLocalObjects();\n\n return { localResult, remoteResult };\n}\n\n/**\n * Remove remote component from the remote\n * this method groups remote components by remote name and deletes remote components together\n * @param {ComponentIdList} bitIds - list of remote component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n */\nasync function removeRemote(\n workspace: Workspace | undefined,\n bitIds: ComponentIdList,\n force: boolean\n): Promise<RemovedObjects[]> {\n const groupedBitsByScope = groupArray(bitIds, 'scope');\n const remotes = workspace ? await getScopeRemotes(workspace.scope.legacyScope) : await Remotes.getGlobalRemotes();\n const shouldGoToCentralHub = remotes.shouldGoToCentralHub(Object.keys(groupedBitsByScope));\n if (shouldGoToCentralHub) {\n const http = await Http.connect(CENTRAL_BIT_HUB_URL, CENTRAL_BIT_HUB_NAME);\n return http.deleteViaCentralHub(\n bitIds.map((id) => id.toString()),\n { force, idsAreLanes: false }\n );\n }\n const context = {};\n enrichContextFromGlobal(context);\n const removeP = Object.keys(groupedBitsByScope).map(async (key) => {\n const resolvedRemote = await remotes.resolve(key, workspace?.scope.legacyScope);\n const idsStr = groupedBitsByScope[key].map((id) => id.toStringWithoutVersion());\n return resolvedRemote.deleteMany(idsStr, force, context);\n });\n\n return Promise.all(removeP);\n}\n\n/**\n * removeLocal - remove local (imported, new staged components) from modules and bitmap according to flags\n * @param {ComponentIdList} bitIds - list of component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n * @param {boolean} deleteFiles - delete component that are used by other components.\n */\nasync function removeLocal(\n workspace: Workspace,\n bitIds: ComponentIdList,\n force: boolean,\n track: boolean,\n deleteFiles: boolean\n): Promise<RemovedLocalObjects> {\n const consumer = workspace.consumer;\n // local remove in case user wants to delete tagged components\n const modifiedComponents = new ComponentIdList();\n const nonModifiedComponents = new ComponentIdList();\n if (!bitIds.length) return new RemovedLocalObjects();\n if (!force) {\n const newIds: string[] = [];\n await pMapSeries(bitIds, async (id) => {\n try {\n const componentStatus = await workspace.getComponentStatusById(id);\n if (componentStatus.newlyCreated) newIds.push(id.toStringWithoutVersion());\n if (componentStatus.modified) modifiedComponents.push(id);\n else nonModifiedComponents.push(id);\n } catch (err: any) {\n // if a component has an error, such as, missing main file, we do want to allow removing that component\n if (Component.isComponentInvalidByErrorType(err)) {\n nonModifiedComponents.push(id);\n } else {\n throw err;\n }\n }\n });\n if (newIds.length) {\n const list = await workspace.listWithInvalid();\n list.components.forEach((c) => {\n if (bitIds.hasWithoutVersion(c.id)) return; // it gets deleted anyway\n const aspectIds = c.state.aspects.ids;\n const used = newIds.find((newId) => aspectIds.includes(newId));\n if (used)\n throw new BitError(`Unable to remove ${c.id.toStringWithoutVersion()}.\nThis component is 1) an aspect 2) is used by other components, such as \"${c.id.toStringWithoutVersion()}\" 3) it's a new component so it can't be installed as a package.\nRemoving this component from the workspace will disrupt the functionality of other components that depend on it, and resolving these issues may not be straightforward.\nIf you understand the risks and wish to proceed with the removal, please use the --force flag.\n`);\n });\n }\n }\n const idsToRemove = force ? bitIds : nonModifiedComponents;\n const componentsList = new ComponentsList(consumer);\n const newComponents = (await componentsList.listNewComponents(false)) as ComponentIdList;\n const idsToRemoveFromScope = ComponentIdList.fromArray(\n idsToRemove.filter((id) => !newComponents.hasWithoutVersion(id))\n );\n const idsToCleanFromWorkspace = ComponentIdList.fromArray(\n idsToRemove.filter((id) => newComponents.hasWithoutVersion(id))\n );\n const { components: componentsToRemove, invalidComponents } = await consumer.loadComponents(idsToRemove, false);\n const { removedComponentIds, missingComponents, dependentBits, removedFromLane } = await consumer.scope.removeMany(\n idsToRemoveFromScope,\n force,\n consumer\n );\n // otherwise, components should still be in .bitmap file\n idsToCleanFromWorkspace.push(...removedComponentIds);\n if (idsToCleanFromWorkspace.length) {\n if (deleteFiles) await deleteComponentsFiles(consumer, idsToCleanFromWorkspace);\n if (!track) {\n const invalidComponentsIds = invalidComponents.map((i) => i.id);\n const removedComponents = componentsToRemove.filter((c) => idsToCleanFromWorkspace.hasWithoutVersion(c.id));\n await packageJsonUtils.removeComponentsFromWorkspacesAndDependencies(\n consumer,\n removedComponents,\n invalidComponentsIds\n );\n await consumer.cleanFromBitMap(idsToCleanFromWorkspace);\n await workspace.cleanFromConfig(idsToCleanFromWorkspace);\n }\n }\n return new RemovedLocalObjects(\n ComponentIdList.uniqFromArray([...idsToCleanFromWorkspace, ...removedComponentIds]),\n missingComponents,\n modifiedComponents,\n dependentBits,\n removedFromLane\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,YAAA,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;AACA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,UAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,SAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,yBAAA;EAAA,MAAAR,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAM,wBAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,QAAA;EAAA,MAAAT,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EA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EC;EAAgB,CAAC,GAAG,MAAMxC,QAAQ,CAACxB,KAAK,CAACiE,UAAU,CAChHV,oBAAoB,EACpBvF,KAAK,EACLwD,QACF,CAAC;EACD;EACAiC,uBAAuB,CAACzB,IAAI,CAAC,GAAG6B,mBAAmB,CAAC;EACpD,IAAIJ,uBAAuB,CAACvE,MAAM,EAAE;IAClC,IAAIf,WAAW,EAAE,MAAM,IAAA+F,6CAAqB,EAAC1C,QAAQ,EAAEiC,uBAAuB,CAAC;IAC/E,IAAI,CAACvF,KAAK,EAAE;MACV,MAAMiG,oBAAoB,GAAGR,iBAAiB,CAACjF,GAAG,CAAEf,CAAC,IAAKA,CAAC,CAACgB,EAAE,CAAC;MAC/D,MAAMyF,iBAAiB,GAAGV,kBAAkB,CAACF,MAAM,CAAEf,CAAC,IAAKgB,uBAAuB,CAACf,iBAAiB,CAACD,CAAC,CAAC9D,EAAE,CAAC,CAAC;MAC3G,MAAMtC,gBAAgB,CAAD,CAAC,CAACgI,6CAA6C,CAClE7C,QAAQ,EACR4C,iBAAiB,EACjBD,oBACF,CAAC;MACD,MAAM3C,QAAQ,CAAC8C,eAAe,CAACb,uBAAuB,CAAC;MACvD,MAAM3F,SAAS,CAACyG,eAAe,CAACd,uBAAuB,CAAC;IAC1D;EACF;EACA,OAAO,KAAI/D,0CAAmB,EAC5BlB,8BAAe,CAACgG,aAAa,CAAC,CAAC,GAAGf,uBAAuB,EAAE,GAAGI,mBAAmB,CAAC,CAAC,EACnFC,iBAAiB,EACjBrC,kBAAkB,EAClBsC,aAAa,EACbC,eACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_groupArray","_lodash","_componentId","_lodash2","_constants","_bitError","_enrichContextFromGlobal","_logger","_http","_remotes","_scopeRemotes","_deleteComponentFiles","_componentsList","_consumerComponent","_pMapSeries","_pkgModules","_removedLocalObjects","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","removeComponents","workspace","ids","force","remote","track","deleteFiles","logger","debugAndAddBreadCrumb","toString","bitIdsLatest","ComponentIdList","fromArray","map","id","changeVersion","LATEST_BIT_VERSION","localIds","remoteIds","partition","isLocal","BitError","join","remoteResult","isEmpty","removeRemote","localResult","removeLocal","RemovedLocalObjects","bitIds","groupedBitsByScope","groupArray","remotes","getScopeRemotes","scope","legacyScope","Remotes","getGlobalRemotes","shouldGoToCentralHub","http","Http","connect","CENTRAL_BIT_HUB_URL","CENTRAL_BIT_HUB_NAME","deleteViaCentralHub","idsAreLanes","context","enrichContextFromGlobal","removeP","key","resolvedRemote","resolve","idsStr","toStringWithoutVersion","deleteMany","Promise","all","consumer","modifiedComponents","nonModifiedComponents","newIds","pMapSeries","componentStatus","getComponentStatusById","newlyCreated","modified","err","Component","isComponentInvalidByErrorType","list","listWithInvalid","components","c","hasWithoutVersion","aspectIds","state","aspects","used","find","newId","includes","idsToRemove","componentsList","ComponentsList","newComponents","listNewComponents","idsToRemoveFromScope","idsToCleanFromWorkspace","componentsToRemove","loadComponents","removedComponentIds","missingComponents","dependentBits","removedFromLane","removeMany","deleteComponentsFiles","removedComponents","packageJson","removeComponentsFromDependencies","removeComponentsFromNodeModules","cleanFromBitMap","cleanFromConfig","uniqFromArray","debug","pathsToRemoveWithNulls","getNodeModulesPathOfComponent","pathsToRemove","compact","componentPath","fs","remove","toAbsolutePath"],"sources":["remove-components.ts"],"sourcesContent":["import fs from 'fs-extra';\nimport groupArray from 'group-array';\nimport partition from 'lodash.partition';\nimport { Workspace } from '@teambit/workspace';\nimport { ComponentIdList } from '@teambit/component-id';\nimport { compact, isEmpty } from 'lodash';\nimport { CENTRAL_BIT_HUB_NAME, CENTRAL_BIT_HUB_URL, LATEST_BIT_VERSION } from '@teambit/legacy/dist/constants';\nimport { BitError } from '@teambit/bit-error';\nimport enrichContextFromGlobal from '@teambit/legacy/dist/hooks/utils/enrich-context-from-global';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport { Http } from '@teambit/legacy/dist/scope/network/http';\nimport { Remotes } from '@teambit/legacy/dist/remotes';\nimport { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';\nimport { deleteComponentsFiles } from './delete-component-files';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport Component from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport RemovedObjects from '@teambit/legacy/dist/scope/removed-components';\nimport pMapSeries from 'p-map-series';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component';\nimport { getNodeModulesPathOfComponent } from '@teambit/pkg.modules.component-package-name';\nimport { RemovedLocalObjects } from './removed-local-objects';\n\nexport type RemoveComponentsResult = { localResult: RemovedLocalObjects; remoteResult: RemovedObjects[] };\n\n/**\n * Remove components local and remote\n * splits array of ids into local and remote and removes according to flags\n * @param {string[]} ids - list of remote component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n * @param {boolean} remote - delete component from a remote scope\n * @param {boolean} track - keep tracking local staged components in bitmap.\n * @param {boolean} deleteFiles - delete local added files from fs.\n */\nexport async function removeComponents({\n workspace,\n ids,\n force,\n remote,\n track,\n deleteFiles,\n}: {\n workspace?: Workspace; // when remote is false, it's always set\n ids: ComponentIdList;\n force: boolean;\n remote: boolean;\n track: boolean;\n deleteFiles: boolean;\n}): Promise<RemoveComponentsResult> {\n logger.debugAndAddBreadCrumb('removeComponents', `{ids}. force: ${force.toString()}`, { ids: ids.toString() });\n // added this to remove support for remove only one version from a component\n const bitIdsLatest = ComponentIdList.fromArray(\n ids.map((id) => {\n return id.changeVersion(LATEST_BIT_VERSION);\n })\n );\n const [localIds, remoteIds] = partition(bitIdsLatest, (id) => id.isLocal());\n if (remote && localIds.length) {\n throw new BitError(\n `unable to remove the remote components: ${localIds.join(',')} as they don't contain a scope-name`\n );\n }\n const remoteResult = remote && !isEmpty(remoteIds) ? await removeRemote(workspace, remoteIds, force) : [];\n const localResult = !remote\n ? await removeLocal(workspace as Workspace, bitIdsLatest, force, track, deleteFiles)\n : new RemovedLocalObjects();\n\n return { localResult, remoteResult };\n}\n\n/**\n * Remove remote component from the remote\n * this method groups remote components by remote name and deletes remote components together\n * @param {ComponentIdList} bitIds - list of remote component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n */\nasync function removeRemote(\n workspace: Workspace | undefined,\n bitIds: ComponentIdList,\n force: boolean\n): Promise<RemovedObjects[]> {\n const groupedBitsByScope = groupArray(bitIds, 'scope');\n const remotes = workspace ? await getScopeRemotes(workspace.scope.legacyScope) : await Remotes.getGlobalRemotes();\n const shouldGoToCentralHub = remotes.shouldGoToCentralHub(Object.keys(groupedBitsByScope));\n if (shouldGoToCentralHub) {\n const http = await Http.connect(CENTRAL_BIT_HUB_URL, CENTRAL_BIT_HUB_NAME);\n return http.deleteViaCentralHub(\n bitIds.map((id) => id.toString()),\n { force, idsAreLanes: false }\n );\n }\n const context = {};\n enrichContextFromGlobal(context);\n const removeP = Object.keys(groupedBitsByScope).map(async (key) => {\n const resolvedRemote = await remotes.resolve(key, workspace?.scope.legacyScope);\n const idsStr = groupedBitsByScope[key].map((id) => id.toStringWithoutVersion());\n return resolvedRemote.deleteMany(idsStr, force, context);\n });\n\n return Promise.all(removeP);\n}\n\n/**\n * removeLocal - remove local (imported, new staged components) from modules and bitmap according to flags\n * @param {ComponentIdList} bitIds - list of component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n * @param {boolean} deleteFiles - delete component that are used by other components.\n */\nasync function removeLocal(\n workspace: Workspace,\n bitIds: ComponentIdList,\n force: boolean,\n track: boolean,\n deleteFiles: boolean\n): Promise<RemovedLocalObjects> {\n const consumer = workspace.consumer;\n // local remove in case user wants to delete tagged components\n const modifiedComponents = new ComponentIdList();\n const nonModifiedComponents = new ComponentIdList();\n if (!bitIds.length) return new RemovedLocalObjects();\n if (!force) {\n const newIds: string[] = [];\n await pMapSeries(bitIds, async (id) => {\n try {\n const componentStatus = await workspace.getComponentStatusById(id);\n if (componentStatus.newlyCreated) newIds.push(id.toStringWithoutVersion());\n if (componentStatus.modified) modifiedComponents.push(id);\n else nonModifiedComponents.push(id);\n } catch (err: any) {\n // if a component has an error, such as, missing main file, we do want to allow removing that component\n if (Component.isComponentInvalidByErrorType(err)) {\n nonModifiedComponents.push(id);\n } else {\n throw err;\n }\n }\n });\n if (newIds.length) {\n const list = await workspace.listWithInvalid();\n list.components.forEach((c) => {\n if (bitIds.hasWithoutVersion(c.id)) return; // it gets deleted anyway\n const aspectIds = c.state.aspects.ids;\n const used = newIds.find((newId) => aspectIds.includes(newId));\n if (used)\n throw new BitError(`Unable to remove ${c.id.toStringWithoutVersion()}.\nThis component is 1) an aspect 2) is used by other components, such as \"${c.id.toStringWithoutVersion()}\" 3) it's a new component so it can't be installed as a package.\nRemoving this component from the workspace will disrupt the functionality of other components that depend on it, and resolving these issues may not be straightforward.\nIf you understand the risks and wish to proceed with the removal, please use the --force flag.\n`);\n });\n }\n }\n const idsToRemove = force ? bitIds : nonModifiedComponents;\n const componentsList = new ComponentsList(consumer);\n const newComponents = (await componentsList.listNewComponents(false)) as ComponentIdList;\n const idsToRemoveFromScope = ComponentIdList.fromArray(\n idsToRemove.filter((id) => !newComponents.hasWithoutVersion(id))\n );\n const idsToCleanFromWorkspace = ComponentIdList.fromArray(\n idsToRemove.filter((id) => newComponents.hasWithoutVersion(id))\n );\n const { components: componentsToRemove } = await consumer.loadComponents(idsToRemove, false);\n const { removedComponentIds, missingComponents, dependentBits, removedFromLane } = await consumer.scope.removeMany(\n idsToRemoveFromScope,\n force,\n consumer\n );\n // otherwise, components should still be in .bitmap file\n idsToCleanFromWorkspace.push(...removedComponentIds);\n if (idsToCleanFromWorkspace.length) {\n if (deleteFiles) await deleteComponentsFiles(consumer, idsToCleanFromWorkspace);\n if (!track) {\n const removedComponents = componentsToRemove.filter((c) => idsToCleanFromWorkspace.hasWithoutVersion(c.id));\n await consumer.packageJson.removeComponentsFromDependencies(removedComponents);\n await removeComponentsFromNodeModules(consumer, removedComponents);\n await consumer.cleanFromBitMap(idsToCleanFromWorkspace);\n await workspace.cleanFromConfig(idsToCleanFromWorkspace);\n }\n }\n return new RemovedLocalObjects(\n ComponentIdList.uniqFromArray([...idsToCleanFromWorkspace, ...removedComponentIds]),\n missingComponents,\n modifiedComponents,\n dependentBits,\n removedFromLane\n );\n}\n\nexport async function removeComponentsFromNodeModules(consumer: Consumer, components: ConsumerComponent[]) {\n logger.debug(`removeComponentsFromNodeModules: ${components.map((c) => c.id.toString()).join(', ')}`);\n const pathsToRemoveWithNulls = components.map((c) => {\n return getNodeModulesPathOfComponent({ ...c, id: c.id });\n });\n const pathsToRemove = compact(pathsToRemoveWithNulls);\n logger.debug(`deleting the following paths: ${pathsToRemove.join('\\n')}`);\n return Promise.all(pathsToRemove.map((componentPath) => fs.remove(consumer.toAbsolutePath(componentPath))));\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,aAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,YAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;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,CAAE2D,CAAC,IAAK;IACnD,OAAO,IAAAiC,2CAA6B,EAAA7H,aAAA,CAAAA,aAAA,KAAM4F,CAAC;MAAE1D,EAAE,EAAE0D,CAAC,CAAC1D;IAAE,EAAE,CAAC;EAC1D,CAAC,CAAC;EACF,MAAM4F,aAAa,GAAG,IAAAC,kBAAO,EAACH,sBAAsB,CAAC;EACrDjG,iBAAM,CAACgG,KAAK,CAAC,iCAAiCG,aAAa,CAACpF,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;EACzE,OAAOiC,OAAO,CAACC,GAAG,CAACkD,aAAa,CAAC7F,GAAG,CAAE+F,aAAa,IAAKC,kBAAE,CAACC,MAAM,CAACrD,QAAQ,CAACsD,cAAc,CAACH,aAAa,CAAC,CAAC,CAAC,CAAC;AAC7G","ignoreList":[]}
|
|
@@ -60,9 +60,9 @@ function _lodash() {
|
|
|
60
60
|
};
|
|
61
61
|
return data;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
const data =
|
|
65
|
-
|
|
63
|
+
function _legacy() {
|
|
64
|
+
const data = require("@teambit/legacy.utils");
|
|
65
|
+
_legacy = function () {
|
|
66
66
|
return data;
|
|
67
67
|
};
|
|
68
68
|
return data;
|
|
@@ -116,13 +116,6 @@ function _component() {
|
|
|
116
116
|
};
|
|
117
117
|
return data;
|
|
118
118
|
}
|
|
119
|
-
function _packageJsonUtils() {
|
|
120
|
-
const data = require("@teambit/legacy/dist/consumer/component/package-json-utils");
|
|
121
|
-
_packageJsonUtils = function () {
|
|
122
|
-
return data;
|
|
123
|
-
};
|
|
124
|
-
return data;
|
|
125
|
-
}
|
|
126
119
|
function _deleteComponentFiles() {
|
|
127
120
|
const data = require("./delete-component-files");
|
|
128
121
|
_deleteComponentFiles = function () {
|
|
@@ -256,7 +249,7 @@ class RemoveMain {
|
|
|
256
249
|
const allComponentsToMarkDeleted = await this.workspace.getMany(componentIds);
|
|
257
250
|
const componentsToDeleteFromFs = range ? [] : allComponentsToMarkDeleted;
|
|
258
251
|
const componentsIdsToDeleteFromFs = _componentId().ComponentIdList.fromArray(componentsToDeleteFromFs.map(c => c.id));
|
|
259
|
-
await (0,
|
|
252
|
+
await (0, _removeComponents().removeComponentsFromNodeModules)(this.workspace.consumer, componentsToDeleteFromFs.map(c => c.state._consumer));
|
|
260
253
|
// don't use `this.workspace.addSpecificComponentConfig`, if the component has component.json it will be deleted
|
|
261
254
|
// during this removal along with the entire component dir.
|
|
262
255
|
// in case this is range, the "removed" property is set to false. even when the range overlap the current version.
|
|
@@ -517,7 +510,7 @@ ${mainComps.map(c => c.id.toString()).join('\n')}`);
|
|
|
517
510
|
return componentIds.map(id => id);
|
|
518
511
|
}
|
|
519
512
|
async getRemoteBitIdsToRemove(componentsPattern) {
|
|
520
|
-
if ((0,
|
|
513
|
+
if ((0, _legacy().hasWildcard)(componentsPattern)) {
|
|
521
514
|
return this.lister.getRemoteCompIdsByWildcards(componentsPattern);
|
|
522
515
|
}
|
|
523
516
|
return [_componentId().ComponentID.fromString(componentsPattern)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_semver","_interopRequireDefault","_logger","_workspace","_componentId","_exceptions","_importer","_lodash","_hasWildcard","_bitError","_dependencyResolver","_componentIssues","_issues","_pMapSeries","_noHeadNoVersion","_component","_packageJsonUtils","_deleteComponentFiles","_removeCmd","_removeComponents","_remove","_remove2","_recoverCmd","_deleteCmd","_scope","_lister","_chalk","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","BEFORE_REMOVE","RemoveMain","constructor","workspace","scope","logger","importer","depResolver","lister","remove","componentsPattern","force","remote","track","deleteFiles","setStatusLine","bitIds","getRemoteBitIdsToRemove","getLocalBitIdsToRemove","consumer","removeResults","removeComponents","ids","ComponentIdList","fromArray","onDestroy","removeLocallyByIds","reasonForRemoval","OutsideWorkspaceError","results","bitMap","write","markRemoveComps","componentIds","updateMain","range","allComponentsToMarkDeleted","getMany","componentsToDeleteFromFs","componentsIdsToDeleteFromFs","map","c","id","removeComponentsFromNodeModules","state","_consumer","config","removed","removeOnMain","forEach","compId","addComponentConfig","RemoveAspect","deleteComponentsFiles","deleteComps","opts","ConsumerNotFound","idsByPattern","newComps","filter","hasVersion","length","BitError","toString","join","currentLane","getCurrentLaneObject","isNew","Error","laneComp","toComponentIds","compIdsNotOnLane","hasWithoutVersion","chalk","bold","recover","compIdStr","options","bitMapEntry","components","find","compMap","fullName","toStringWithoutVersion","importComp","idStr","import","installNpmPackages","skipDependencyInstallation","writeConfigFiles","skipWriteConfigFiles","override","setAsRemovedFalse","addSpecificComponentConfig","compFromScope","get","rootDir","removeComponentConfig","comp","removeInfo","getRemoveInfo","resolveComponentId","idOnLane","getComponent","compIdWithPossibleVer","changeVersion","head","isDeleted","_legacy","getRemoteComponent","err","NoHeadNoVersion","throwForMainComponentWhenOnLane","laneComps","toBitIds","mainComps","component","headComponent","getHeadComponent","extensions","findExtension","isDeletedByRange","currentTag","getTag","Boolean","semver","satisfies","version","hash","headTag","headComp","undefined","isRemoved","isRemovedByIdWithoutLoadingComponent","componentId","bitmapEntry","getBitmapEntryIfExist","isRecovered","modelComp","getBitObjectModelComponent","legacyScope","objects","isEnvByIdWithoutLoadingComponent","versionObj","getBitObjectVersionById","envData","findCoreExtension","type","getRemovedStaged","isOnMain","getRemovedStagedFromMain","getRemovedStagedFromLane","addRemovedDependenciesIssues","pMapSeries","addRemovedDepIssue","dependencies","getComponentDependencies","removedDependencies","removedEnv","Promise","all","dep","isEnv","push","issues","getOrCreate","IssuesClasses","RemovedDependencies","RemovedEnv","stagedConfig","getStagedConfig","getAll","compConfig","laneIds","workspaceIds","listIds","laneCompIdsNotInWorkspace","wId","isEqualWithoutVersion","comps","staged","snapDistance","getSnapDistance","warn","name","isSourceAhead","compact","hasWildcard","getRemoteCompIdsByWildcards","ComponentID","fromString","provider","cli","loggerMain","componentAspect","importerMain","createLogger","removeMain","registerAddComponentsIssues","bind","registerShowFragments","RemoveFragment","register","RemoveCmd","DeleteCmd","RecoverCmd","exports","WorkspaceAspect","ScopeAspect","CLIAspect","LoggerAspect","ComponentAspect","ImporterAspect","DependencyResolverAspect","IssuesAspect","ListerAspect","MainRuntime","addRuntime","_default"],"sources":["remove.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport semver from 'semver';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { ComponentID, ComponentIdList } from '@teambit/component-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 { BitError } from '@teambit/bit-error';\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 { NoHeadNoVersion } from '@teambit/legacy/dist/scope/exceptions/no-head-no-version';\nimport { ComponentAspect, Component, ComponentMain } from '@teambit/component';\nimport { removeComponentsFromNodeModules } from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport { deleteComponentsFiles } from './delete-component-files';\nimport { RemoveCmd } from './remove-cmd';\nimport { RemoveComponentsResult, 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';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { ListerAspect, ListerMain } from '@teambit/lister';\nimport chalk from 'chalk';\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 * Semver range to mark specific versions as deleted\n */\n range?: string;\n};\n\nexport type DeleteOpts = { updateMain?: boolean; range?: string };\n\nexport class RemoveMain {\n constructor(\n private workspace: Workspace,\n private scope: ScopeMain,\n public logger: Logger,\n private importer: ImporterMain,\n private depResolver: DependencyResolverMain,\n private lister: ListerMain\n ) {}\n\n async remove({\n componentsPattern,\n force = false,\n remote = false,\n track = false,\n deleteFiles = true,\n }: {\n componentsPattern: string;\n force?: boolean;\n remote?: boolean;\n track?: boolean;\n deleteFiles?: boolean;\n }): Promise<RemoveComponentsResult> {\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 workspace: this.workspace,\n ids: ComponentIdList.fromArray(bitIds),\n force,\n remote,\n track,\n deleteFiles,\n });\n if (consumer) await consumer.onDestroy('remove');\n return removeResults;\n }\n\n /**\n * remove components from the workspace.\n */\n async removeLocallyByIds(\n ids: ComponentID[],\n { force = false, reasonForRemoval }: { force?: boolean; reasonForRemoval?: string } = {}\n ) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const results = await removeComponents({\n workspace: this.workspace,\n ids: ComponentIdList.fromArray(ids),\n force,\n remote: false,\n track: false,\n deleteFiles: true,\n });\n await this.workspace.bitMap.write(`remove (by ${reasonForRemoval || 'N/A'})`);\n\n return results;\n }\n\n private async markRemoveComps(componentIds: ComponentID[], { updateMain, range }: DeleteOpts): Promise<Component[]> {\n const allComponentsToMarkDeleted = await this.workspace.getMany(componentIds);\n\n const componentsToDeleteFromFs = range ? [] : allComponentsToMarkDeleted;\n const componentsIdsToDeleteFromFs = ComponentIdList.fromArray(componentsToDeleteFromFs.map((c) => c.id));\n await removeComponentsFromNodeModules(\n this.workspace.consumer,\n componentsToDeleteFromFs.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 // in case this is range, the \"removed\" property is set to false. even when the range overlap the current version.\n // the reason is that if we set it to true, then, the component is considered as \"deleted\" for *all* versions.\n // remember that this config is always passed to the next version and if we set removed: true, it'll be copied\n // to the next version even when that version is not in the range.\n const config: RemoveInfo = { removed: !range };\n if (updateMain) config.removeOnMain = true;\n if (range) config.range = range;\n componentIds.forEach((compId) => this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, config));\n await this.workspace.bitMap.write('delete');\n await deleteComponentsFiles(this.workspace.consumer, componentsIdsToDeleteFromFs);\n\n return componentsToDeleteFromFs;\n }\n\n async deleteComps(componentsPattern: string, opts: DeleteOpts = {}): Promise<Component[]> {\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 if (currentLane && !updateMain && opts.range) {\n throw new BitError(`--range is not needed when deleting components from a lane, unless --update-main is used`);\n }\n if (currentLane && !updateMain) {\n const laneComp = currentLane.toComponentIds();\n const compIdsNotOnLane = componentIds.filter((id) => !laneComp.hasWithoutVersion(id));\n if (compIdsNotOnLane.length) {\n throw new BitError(\n `unable to delete the following component(s) because they are not part of the current lane.\n${chalk.bold(compIdsNotOnLane.map((id) => id.toString()).join('\\n'))}\nto simply remove them from the workspace, use \"bit remove\".\nto delete them eventually from main, use \"--update-main\" flag and make sure to remove all occurrences from the code.`\n );\n }\n }\n return this.markRemoveComps(componentIds, opts);\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 * 1.a. the component still exists in the local scope. no need to import. write it from there.\n * 1.b. the component doesn't exist in the local scope. import it.\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.fullName === 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 writeConfigFiles: !options.skipWriteConfigFiles,\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('recover');\n };\n if (bitMapEntry) {\n if (bitMapEntry.config?.[RemoveAspect.id]) {\n // case #1\n const compFromScope = await this.workspace.scope.get(bitMapEntry.id);\n if (compFromScope) {\n // in the case the component is in the scope, we prefer to write it from the scope rather than import it.\n // because in some cases the \"import\" throws an error, e.g. when the component is diverged.\n await this.workspace.write(compFromScope, bitMapEntry.rootDir);\n this.workspace.bitMap.removeComponentConfig(bitMapEntry.id, RemoveAspect.id, false);\n await this.workspace.bitMap.write('recover');\n } else {\n delete bitMapEntry.config?.[RemoveAspect.id];\n await importComp(bitMapEntry.id.toString());\n }\n return true;\n }\n // case #4\n const compId = bitMapEntry.id;\n const comp = await this.workspace.get(compId);\n const removeInfo = await this.getRemoveInfo(comp);\n if (!removeInfo.removed && !removeInfo.range) {\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);\n const compIdWithPossibleVer = idOnLane ? compId.changeVersion(idOnLane.head.toString()) : compId;\n const compFromScope = await this.workspace.scope.get(compIdWithPossibleVer);\n if (compFromScope && (await this.isDeleted(compFromScope))) {\n // case #2 and #3\n await importComp(compIdWithPossibleVer._legacy.toString());\n await setAsRemovedFalse(compIdWithPossibleVer);\n return true;\n }\n // case #5\n let comp: Component | undefined;\n try {\n comp = await this.workspace.scope.getRemoteComponent(compId);\n } catch (err: any) {\n if (err instanceof NoHeadNoVersion) {\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 (!(await this.isDeleted(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));\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 async getRemoveInfo(component: Component): Promise<RemoveInfo> {\n const headComponent = await this.getHeadComponent(component);\n const data = headComponent.config.extensions.findExtension(RemoveAspect.id)?.config as RemoveInfo | undefined;\n\n const isDeletedByRange = () => {\n if (!data?.range) return false;\n const currentTag = component.getTag();\n return Boolean(currentTag && semver.satisfies(currentTag.version, data.range));\n };\n\n return {\n removed: data?.removed || isDeletedByRange() || false,\n range: data?.range,\n };\n }\n\n private async getHeadComponent(component: Component): Promise<Component> {\n if (\n component.id.version &&\n component.head &&\n component.id.version !== component.head?.hash &&\n component.id.version !== component.headTag?.version.version\n ) {\n const headComp = this.workspace // if workspace exits, prefer using the workspace as it may be modified\n ? await this.workspace.get(component.id.changeVersion(undefined))\n : await this.scope.get(component.id.changeVersion(component.head.hash));\n if (!headComp) throw new Error(`unable to get the head of ${component.id.toString()}`);\n return headComp;\n }\n return component;\n }\n\n /**\n * @deprecated use `isDeleted` instead.\n */\n async isRemoved(component: Component): Promise<boolean> {\n return this.isDeleted(component);\n }\n\n /**\n * whether a component is marked as deleted.\n */\n async isDeleted(component: Component): Promise<boolean> {\n const removeInfo = await this.getRemoveInfo(component);\n return removeInfo.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.changeVersion(undefined));\n if (!modelComp) return false;\n const isRemoved = await modelComp.isRemoved(\n this.workspace.scope.legacyScope.objects,\n componentId.version as string\n );\n return Boolean(isRemoved);\n }\n\n async isEnvByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n const versionObj = await this.workspace.scope.getBitObjectVersionById(componentId);\n const envData = versionObj?.extensions.findCoreExtension('teambit.envs/envs');\n return envData?.data.type === 'env';\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 = this.depResolver.getComponentDependencies(component);\n const removedDependencies: ComponentID[] = [];\n let removedEnv: ComponentID | undefined;\n await Promise.all(\n dependencies.map(async (dep) => {\n const isRemoved = await this.isRemovedByIdWithoutLoadingComponent(dep.componentId);\n if (!isRemoved) return;\n const isEnv = await this.isEnvByIdWithoutLoadingComponent(dep.componentId);\n if (isEnv) {\n removedEnv = dep.componentId;\n } else {\n removedDependencies.push(dep.componentId);\n }\n })\n );\n if (removedDependencies.length) {\n component.state.issues.getOrCreate(IssuesClasses.RemovedDependencies).data = removedDependencies.map((r) =>\n r.toString()\n );\n }\n if (removedEnv) {\n component.state.issues.getOrCreate(IssuesClasses.RemovedEnv).data = removedEnv.toString();\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.toComponentIds();\n const workspaceIds = this.workspace.listIds();\n const laneCompIdsNotInWorkspace = laneIds.filter(\n (id) => !workspaceIds.find((wId) => wId.isEqualWithoutVersion(id))\n );\n if (!laneCompIdsNotInWorkspace.length) return [];\n const comps = await this.workspace.scope.getMany(laneCompIdsNotInWorkspace);\n const removed = comps.filter((c) => this.isDeleted(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<ComponentID[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n return componentIds.map((id) => id);\n }\n\n private async getRemoteBitIdsToRemove(componentsPattern: string): Promise<ComponentID[]> {\n if (hasWildcard(componentsPattern)) {\n return this.lister.getRemoteCompIdsByWildcards(componentsPattern);\n }\n return [ComponentID.fromString(componentsPattern)];\n }\n\n static slots = [];\n static dependencies = [\n WorkspaceAspect,\n ScopeAspect,\n CLIAspect,\n LoggerAspect,\n ComponentAspect,\n ImporterAspect,\n DependencyResolverAspect,\n IssuesAspect,\n ListerAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([\n workspace,\n scope,\n cli,\n loggerMain,\n componentAspect,\n importerMain,\n depResolver,\n issues,\n lister,\n ]: [\n Workspace,\n ScopeMain,\n CLIMain,\n LoggerMain,\n ComponentMain,\n ImporterMain,\n DependencyResolverMain,\n IssuesMain,\n ListerMain\n ]) {\n const logger = loggerMain.createLogger(RemoveAspect.id);\n const removeMain = new RemoveMain(workspace, scope, logger, importerMain, depResolver, lister);\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,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ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AAU,kBA2XC,CACpB8M,4BAAe,EACfC,oBAAW,EACXC,gBAAS,EACTC,sBAAY,EACZC,4BAAe,EACfC,0BAAc,EACdC,8CAAwB,EACxBC,sBAAY,EACZC,sBAAY,CACb;AAAAzO,eAAA,CArYUmB,UAAU,aAsYJuN,kBAAW;AAoC9BpK,sBAAY,CAACqK,UAAU,CAACxN,UAAU,CAAC;AAAC,IAAAyN,QAAA,GAAAZ,OAAA,CAAAjO,OAAA,GAErBoB,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_semver","_interopRequireDefault","_logger","_workspace","_componentId","_exceptions","_importer","_lodash","_legacy","_bitError","_dependencyResolver","_componentIssues","_issues","_pMapSeries","_noHeadNoVersion","_component","_deleteComponentFiles","_removeCmd","_removeComponents","_remove","_remove2","_recoverCmd","_deleteCmd","_scope","_lister","_chalk","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","BEFORE_REMOVE","RemoveMain","constructor","workspace","scope","logger","importer","depResolver","lister","remove","componentsPattern","force","remote","track","deleteFiles","setStatusLine","bitIds","getRemoteBitIdsToRemove","getLocalBitIdsToRemove","consumer","removeResults","removeComponents","ids","ComponentIdList","fromArray","onDestroy","removeLocallyByIds","reasonForRemoval","OutsideWorkspaceError","results","bitMap","write","markRemoveComps","componentIds","updateMain","range","allComponentsToMarkDeleted","getMany","componentsToDeleteFromFs","componentsIdsToDeleteFromFs","map","c","id","removeComponentsFromNodeModules","state","_consumer","config","removed","removeOnMain","forEach","compId","addComponentConfig","RemoveAspect","deleteComponentsFiles","deleteComps","opts","ConsumerNotFound","idsByPattern","newComps","filter","hasVersion","length","BitError","toString","join","currentLane","getCurrentLaneObject","isNew","Error","laneComp","toComponentIds","compIdsNotOnLane","hasWithoutVersion","chalk","bold","recover","compIdStr","options","bitMapEntry","components","find","compMap","fullName","toStringWithoutVersion","importComp","idStr","import","installNpmPackages","skipDependencyInstallation","writeConfigFiles","skipWriteConfigFiles","override","setAsRemovedFalse","addSpecificComponentConfig","compFromScope","get","rootDir","removeComponentConfig","comp","removeInfo","getRemoveInfo","resolveComponentId","idOnLane","getComponent","compIdWithPossibleVer","changeVersion","head","isDeleted","getRemoteComponent","err","NoHeadNoVersion","throwForMainComponentWhenOnLane","laneComps","toBitIds","mainComps","component","headComponent","getHeadComponent","extensions","findExtension","isDeletedByRange","currentTag","getTag","Boolean","semver","satisfies","version","hash","headTag","headComp","undefined","isRemoved","isRemovedByIdWithoutLoadingComponent","componentId","bitmapEntry","getBitmapEntryIfExist","isRecovered","modelComp","getBitObjectModelComponent","legacyScope","objects","isEnvByIdWithoutLoadingComponent","versionObj","getBitObjectVersionById","envData","findCoreExtension","type","getRemovedStaged","isOnMain","getRemovedStagedFromMain","getRemovedStagedFromLane","addRemovedDependenciesIssues","pMapSeries","addRemovedDepIssue","dependencies","getComponentDependencies","removedDependencies","removedEnv","Promise","all","dep","isEnv","push","issues","getOrCreate","IssuesClasses","RemovedDependencies","RemovedEnv","stagedConfig","getStagedConfig","getAll","compConfig","laneIds","workspaceIds","listIds","laneCompIdsNotInWorkspace","wId","isEqualWithoutVersion","comps","staged","snapDistance","getSnapDistance","warn","name","isSourceAhead","compact","hasWildcard","getRemoteCompIdsByWildcards","ComponentID","fromString","provider","cli","loggerMain","componentAspect","importerMain","createLogger","removeMain","registerAddComponentsIssues","bind","registerShowFragments","RemoveFragment","register","RemoveCmd","DeleteCmd","RecoverCmd","exports","WorkspaceAspect","ScopeAspect","CLIAspect","LoggerAspect","ComponentAspect","ImporterAspect","DependencyResolverAspect","IssuesAspect","ListerAspect","MainRuntime","addRuntime","_default"],"sources":["remove.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport semver from 'semver';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { compact } from 'lodash';\nimport { hasWildcard } from '@teambit/legacy.utils';\nimport { BitError } from '@teambit/bit-error';\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 { NoHeadNoVersion } from '@teambit/legacy/dist/scope/exceptions/no-head-no-version';\nimport { ComponentAspect, Component, ComponentMain } from '@teambit/component';\nimport { deleteComponentsFiles } from './delete-component-files';\nimport { RemoveCmd } from './remove-cmd';\nimport { RemoveComponentsResult, removeComponents, removeComponentsFromNodeModules } from './remove-components';\nimport { RemoveAspect } from './remove.aspect';\nimport { RemoveFragment } from './remove.fragment';\nimport { RecoverCmd, RecoverOptions } from './recover-cmd';\nimport { DeleteCmd } from './delete-cmd';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { ListerAspect, ListerMain } from '@teambit/lister';\nimport chalk from 'chalk';\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 * Semver range to mark specific versions as deleted\n */\n range?: string;\n};\n\nexport type DeleteOpts = { updateMain?: boolean; range?: string };\n\nexport class RemoveMain {\n constructor(\n private workspace: Workspace,\n private scope: ScopeMain,\n public logger: Logger,\n private importer: ImporterMain,\n private depResolver: DependencyResolverMain,\n private lister: ListerMain\n ) {}\n\n async remove({\n componentsPattern,\n force = false,\n remote = false,\n track = false,\n deleteFiles = true,\n }: {\n componentsPattern: string;\n force?: boolean;\n remote?: boolean;\n track?: boolean;\n deleteFiles?: boolean;\n }): Promise<RemoveComponentsResult> {\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 workspace: this.workspace,\n ids: ComponentIdList.fromArray(bitIds),\n force,\n remote,\n track,\n deleteFiles,\n });\n if (consumer) await consumer.onDestroy('remove');\n return removeResults;\n }\n\n /**\n * remove components from the workspace.\n */\n async removeLocallyByIds(\n ids: ComponentID[],\n { force = false, reasonForRemoval }: { force?: boolean; reasonForRemoval?: string } = {}\n ) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const results = await removeComponents({\n workspace: this.workspace,\n ids: ComponentIdList.fromArray(ids),\n force,\n remote: false,\n track: false,\n deleteFiles: true,\n });\n await this.workspace.bitMap.write(`remove (by ${reasonForRemoval || 'N/A'})`);\n\n return results;\n }\n\n private async markRemoveComps(componentIds: ComponentID[], { updateMain, range }: DeleteOpts): Promise<Component[]> {\n const allComponentsToMarkDeleted = await this.workspace.getMany(componentIds);\n\n const componentsToDeleteFromFs = range ? [] : allComponentsToMarkDeleted;\n const componentsIdsToDeleteFromFs = ComponentIdList.fromArray(componentsToDeleteFromFs.map((c) => c.id));\n await removeComponentsFromNodeModules(\n this.workspace.consumer,\n componentsToDeleteFromFs.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 // in case this is range, the \"removed\" property is set to false. even when the range overlap the current version.\n // the reason is that if we set it to true, then, the component is considered as \"deleted\" for *all* versions.\n // remember that this config is always passed to the next version and if we set removed: true, it'll be copied\n // to the next version even when that version is not in the range.\n const config: RemoveInfo = { removed: !range };\n if (updateMain) config.removeOnMain = true;\n if (range) config.range = range;\n componentIds.forEach((compId) => this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, config));\n await this.workspace.bitMap.write('delete');\n await deleteComponentsFiles(this.workspace.consumer, componentsIdsToDeleteFromFs);\n\n return componentsToDeleteFromFs;\n }\n\n async deleteComps(componentsPattern: string, opts: DeleteOpts = {}): Promise<Component[]> {\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 if (currentLane && !updateMain && opts.range) {\n throw new BitError(`--range is not needed when deleting components from a lane, unless --update-main is used`);\n }\n if (currentLane && !updateMain) {\n const laneComp = currentLane.toComponentIds();\n const compIdsNotOnLane = componentIds.filter((id) => !laneComp.hasWithoutVersion(id));\n if (compIdsNotOnLane.length) {\n throw new BitError(\n `unable to delete the following component(s) because they are not part of the current lane.\n${chalk.bold(compIdsNotOnLane.map((id) => id.toString()).join('\\n'))}\nto simply remove them from the workspace, use \"bit remove\".\nto delete them eventually from main, use \"--update-main\" flag and make sure to remove all occurrences from the code.`\n );\n }\n }\n return this.markRemoveComps(componentIds, opts);\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 * 1.a. the component still exists in the local scope. no need to import. write it from there.\n * 1.b. the component doesn't exist in the local scope. import it.\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.fullName === 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 writeConfigFiles: !options.skipWriteConfigFiles,\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('recover');\n };\n if (bitMapEntry) {\n if (bitMapEntry.config?.[RemoveAspect.id]) {\n // case #1\n const compFromScope = await this.workspace.scope.get(bitMapEntry.id);\n if (compFromScope) {\n // in the case the component is in the scope, we prefer to write it from the scope rather than import it.\n // because in some cases the \"import\" throws an error, e.g. when the component is diverged.\n await this.workspace.write(compFromScope, bitMapEntry.rootDir);\n this.workspace.bitMap.removeComponentConfig(bitMapEntry.id, RemoveAspect.id, false);\n await this.workspace.bitMap.write('recover');\n } else {\n delete bitMapEntry.config?.[RemoveAspect.id];\n await importComp(bitMapEntry.id.toString());\n }\n return true;\n }\n // case #4\n const compId = bitMapEntry.id;\n const comp = await this.workspace.get(compId);\n const removeInfo = await this.getRemoveInfo(comp);\n if (!removeInfo.removed && !removeInfo.range) {\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);\n const compIdWithPossibleVer = idOnLane ? compId.changeVersion(idOnLane.head.toString()) : compId;\n const compFromScope = await this.workspace.scope.get(compIdWithPossibleVer);\n if (compFromScope && (await this.isDeleted(compFromScope))) {\n // case #2 and #3\n await importComp(compIdWithPossibleVer._legacy.toString());\n await setAsRemovedFalse(compIdWithPossibleVer);\n return true;\n }\n // case #5\n let comp: Component | undefined;\n try {\n comp = await this.workspace.scope.getRemoteComponent(compId);\n } catch (err: any) {\n if (err instanceof NoHeadNoVersion) {\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 (!(await this.isDeleted(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));\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 async getRemoveInfo(component: Component): Promise<RemoveInfo> {\n const headComponent = await this.getHeadComponent(component);\n const data = headComponent.config.extensions.findExtension(RemoveAspect.id)?.config as RemoveInfo | undefined;\n\n const isDeletedByRange = () => {\n if (!data?.range) return false;\n const currentTag = component.getTag();\n return Boolean(currentTag && semver.satisfies(currentTag.version, data.range));\n };\n\n return {\n removed: data?.removed || isDeletedByRange() || false,\n range: data?.range,\n };\n }\n\n private async getHeadComponent(component: Component): Promise<Component> {\n if (\n component.id.version &&\n component.head &&\n component.id.version !== component.head?.hash &&\n component.id.version !== component.headTag?.version.version\n ) {\n const headComp = this.workspace // if workspace exits, prefer using the workspace as it may be modified\n ? await this.workspace.get(component.id.changeVersion(undefined))\n : await this.scope.get(component.id.changeVersion(component.head.hash));\n if (!headComp) throw new Error(`unable to get the head of ${component.id.toString()}`);\n return headComp;\n }\n return component;\n }\n\n /**\n * @deprecated use `isDeleted` instead.\n */\n async isRemoved(component: Component): Promise<boolean> {\n return this.isDeleted(component);\n }\n\n /**\n * whether a component is marked as deleted.\n */\n async isDeleted(component: Component): Promise<boolean> {\n const removeInfo = await this.getRemoveInfo(component);\n return removeInfo.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.changeVersion(undefined));\n if (!modelComp) return false;\n const isRemoved = await modelComp.isRemoved(\n this.workspace.scope.legacyScope.objects,\n componentId.version as string\n );\n return Boolean(isRemoved);\n }\n\n async isEnvByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n const versionObj = await this.workspace.scope.getBitObjectVersionById(componentId);\n const envData = versionObj?.extensions.findCoreExtension('teambit.envs/envs');\n return envData?.data.type === 'env';\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 = this.depResolver.getComponentDependencies(component);\n const removedDependencies: ComponentID[] = [];\n let removedEnv: ComponentID | undefined;\n await Promise.all(\n dependencies.map(async (dep) => {\n const isRemoved = await this.isRemovedByIdWithoutLoadingComponent(dep.componentId);\n if (!isRemoved) return;\n const isEnv = await this.isEnvByIdWithoutLoadingComponent(dep.componentId);\n if (isEnv) {\n removedEnv = dep.componentId;\n } else {\n removedDependencies.push(dep.componentId);\n }\n })\n );\n if (removedDependencies.length) {\n component.state.issues.getOrCreate(IssuesClasses.RemovedDependencies).data = removedDependencies.map((r) =>\n r.toString()\n );\n }\n if (removedEnv) {\n component.state.issues.getOrCreate(IssuesClasses.RemovedEnv).data = removedEnv.toString();\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.toComponentIds();\n const workspaceIds = this.workspace.listIds();\n const laneCompIdsNotInWorkspace = laneIds.filter(\n (id) => !workspaceIds.find((wId) => wId.isEqualWithoutVersion(id))\n );\n if (!laneCompIdsNotInWorkspace.length) return [];\n const comps = await this.workspace.scope.getMany(laneCompIdsNotInWorkspace);\n const removed = comps.filter((c) => this.isDeleted(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<ComponentID[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n return componentIds.map((id) => id);\n }\n\n private async getRemoteBitIdsToRemove(componentsPattern: string): Promise<ComponentID[]> {\n if (hasWildcard(componentsPattern)) {\n return this.lister.getRemoteCompIdsByWildcards(componentsPattern);\n }\n return [ComponentID.fromString(componentsPattern)];\n }\n\n static slots = [];\n static dependencies = [\n WorkspaceAspect,\n ScopeAspect,\n CLIAspect,\n LoggerAspect,\n ComponentAspect,\n ImporterAspect,\n DependencyResolverAspect,\n IssuesAspect,\n ListerAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([\n workspace,\n scope,\n cli,\n loggerMain,\n componentAspect,\n importerMain,\n depResolver,\n issues,\n lister,\n ]: [\n Workspace,\n ScopeMain,\n CLIMain,\n LoggerMain,\n ComponentMain,\n ImporterMain,\n DependencyResolverMain,\n IssuesMain,\n ListerMain\n ]) {\n const logger = loggerMain.createLogger(RemoveAspect.id);\n const removeMain = new RemoveMain(workspace, scope, logger, importerMain, depResolver, lister);\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,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,YAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,WAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAA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AAY,CAACV,EAAE,CAAC;IACvD,MAAM0J,UAAU,GAAG,IAAInM,UAAU,CAACE,SAAS,EAAEC,KAAK,EAAEC,MAAM,EAAE6L,YAAY,EAAE3L,WAAW,EAAEC,MAAM,CAAC;IAC9F2J,MAAM,CAACkC,2BAA2B,CAACD,UAAU,CAAC7C,4BAA4B,CAAC+C,IAAI,CAACF,UAAU,CAAC,CAAC;IAC5FH,eAAe,CAACM,qBAAqB,CAAC,CAAC,KAAIC,yBAAc,EAACJ,UAAU,CAAC,CAAC,CAAC;IACvEL,GAAG,CAACU,QAAQ,CACV,KAAIC,sBAAS,EAACN,UAAU,EAAEjM,SAAS,CAAC,EACpC,KAAIwM,sBAAS,EAACP,UAAU,EAAEjM,SAAS,CAAC,EACpC,KAAIyM,wBAAU,EAACR,UAAU,CAC3B,CAAC;IACD,OAAOA,UAAU;EACnB;AACF;AAACS,OAAA,CAAA5M,UAAA,GAAAA,UAAA;AAAAnB,eAAA,CAxaYmB,UAAU,WA0XN,EAAE;AAAAnB,eAAA,CA1XNmB,UAAU,kBA2XC,CACpB6M,4BAAe,EACfC,oBAAW,EACXC,gBAAS,EACTC,sBAAY,EACZC,4BAAe,EACfC,0BAAc,EACdC,8CAAwB,EACxBC,sBAAY,EACZC,sBAAY,CACb;AAAAxO,eAAA,CArYUmB,UAAU,aAsYJsN,kBAAW;AAoC9BnK,sBAAY,CAACoK,UAAU,CAACvN,UAAU,CAAC;AAAC,IAAAwN,QAAA,GAAAZ,OAAA,CAAAhO,OAAA,GAErBoB,UAAU","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/remove",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.332",
|
|
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": "1.0.
|
|
9
|
+
"version": "1.0.332"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
13
13
|
"yesno": "0.4.0",
|
|
14
|
+
"fs-extra": "10.0.0",
|
|
14
15
|
"group-array": "1.0.0",
|
|
15
16
|
"lodash.partition": "4.6.0",
|
|
16
17
|
"lodash": "4.17.21",
|
|
@@ -19,23 +20,26 @@
|
|
|
19
20
|
"@teambit/bit-error": "0.0.404",
|
|
20
21
|
"@teambit/component-id": "1.2.0",
|
|
21
22
|
"@teambit/harmony": "0.4.6",
|
|
22
|
-
"@teambit/cli": "0.0.
|
|
23
|
-
"@teambit/workspace": "1.0.
|
|
24
|
-
"@teambit/component": "
|
|
23
|
+
"@teambit/cli": "0.0.909",
|
|
24
|
+
"@teambit/workspace": "1.0.332",
|
|
25
|
+
"@teambit/pkg.modules.component-package-name": "0.0.2",
|
|
26
|
+
"@teambit/component": "1.0.332",
|
|
25
27
|
"@teambit/component-issues": "0.0.150",
|
|
26
|
-
"@teambit/dependency-resolver": "1.0.
|
|
27
|
-
"@teambit/importer": "1.0.
|
|
28
|
-
"@teambit/issues": "1.0.
|
|
29
|
-
"@teambit/
|
|
30
|
-
"@teambit/
|
|
31
|
-
"@teambit/
|
|
28
|
+
"@teambit/dependency-resolver": "1.0.332",
|
|
29
|
+
"@teambit/importer": "1.0.332",
|
|
30
|
+
"@teambit/issues": "1.0.332",
|
|
31
|
+
"@teambit/legacy.utils": "0.0.3",
|
|
32
|
+
"@teambit/lister": "1.0.332",
|
|
33
|
+
"@teambit/logger": "0.0.1002",
|
|
34
|
+
"@teambit/scope": "1.0.332"
|
|
32
35
|
},
|
|
33
36
|
"devDependencies": {
|
|
37
|
+
"@types/fs-extra": "9.0.7",
|
|
34
38
|
"@types/lodash": "4.14.165",
|
|
35
39
|
"@types/semver": "7.3.4",
|
|
36
40
|
"@types/mocha": "9.1.0",
|
|
37
41
|
"chai": "4.3.0",
|
|
38
|
-
"@teambit/harmony.envs.core-aspect-env": "0.0.
|
|
42
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.42"
|
|
39
43
|
},
|
|
40
44
|
"peerDependencies": {
|
|
41
45
|
"@teambit/legacy": "1.0.624"
|
|
File without changes
|