@teambit/remove 1.0.1174 → 1.0.1176

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.
@@ -18,6 +18,13 @@ function _component() {
18
18
  };
19
19
  return data;
20
20
  }
21
+ function _legacy2() {
22
+ const data = require("@teambit/legacy.bit-map");
23
+ _legacy2 = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
21
28
  async function deleteComponentsFiles(consumer, bitIds) {
22
29
  _legacy().logger.debug(`deleteComponentsFiles, ids: ${bitIds.toString()}`);
23
30
  const filesToDelete = getFilesToDelete();
@@ -36,6 +43,14 @@ async function deleteComponentsFiles(consumer, bitIds) {
36
43
  }
37
44
  const rootDir = componentMap.rootDir;
38
45
  if (!rootDir) throw new Error(`rootDir is missing from ${id.toString()}`);
46
+ if (rootDir === _legacy2().WORKSPACE_ROOT_DIR) {
47
+ // this component's rootDir is the workspace itself. deleting it would wipe the entire
48
+ // workspace - every nested component, .git, .bit and the .bitmap that maps them all.
49
+ // its files are the workspace's own (workspace.jsonc, README, CI config), not component
50
+ // source, so untracking it must leave them in place.
51
+ _legacy().logger.debug(`deleteComponentsFiles, skipping the files of ${id.toString()}, it owns the workspace root`);
52
+ return;
53
+ }
39
54
  dataToPersist.removePath(new (_component().RemovePath)(rootDir, true));
40
55
  });
41
56
  return dataToPersist;
@@ -1 +1 @@
1
- {"version":3,"names":["_legacy","data","require","_component","deleteComponentsFiles","consumer","bitIds","logger","debug","toString","filesToDelete","getFilesToDelete","addBasePath","getPath","persistAllToFS","dataToPersist","DataToPersist","forEach","id","ignoreVersion","scope","isLocal","hasVersion","componentMap","bitMap","getComponentIfExist","warn","rootDir","Error","removePath","RemovePath"],"sources":["delete-component-files.ts"],"sourcesContent":["import type { ComponentIdList } from '@teambit/component-id';\nimport { logger } from '@teambit/legacy.logger';\nimport { DataToPersist, RemovePath } from '@teambit/component.sources';\nimport type { Consumer } from '@teambit/legacy.consumer';\n\nexport async function deleteComponentsFiles(consumer: Consumer, bitIds: ComponentIdList) {\n logger.debug(`deleteComponentsFiles, ids: ${bitIds.toString()}`);\n const filesToDelete = getFilesToDelete();\n filesToDelete.addBasePath(consumer.getPath());\n return filesToDelete.persistAllToFS();\n\n function getFilesToDelete(): DataToPersist {\n const dataToPersist = new DataToPersist();\n bitIds.forEach((id) => {\n const ignoreVersion = consumer.scope.isLocal(id) || !id.hasVersion();\n const componentMap = consumer.bitMap.getComponentIfExist(id, { ignoreVersion });\n if (!componentMap) {\n logger.warn(\n `deleteComponentsFiles was unable to delete ${id.toString()} because the id is missing from bitmap`\n );\n return;\n }\n const rootDir = componentMap.rootDir;\n if (!rootDir) throw new Error(`rootDir is missing from ${id.toString()}`);\n dataToPersist.removePath(new RemovePath(rootDir, true));\n });\n return dataToPersist;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGO,eAAeG,qBAAqBA,CAACC,QAAkB,EAAEC,MAAuB,EAAE;EACvFC,gBAAM,CAACC,KAAK,CAAC,+BAA+BF,MAAM,CAACG,QAAQ,CAAC,CAAC,EAAE,CAAC;EAChE,MAAMC,aAAa,GAAGC,gBAAgB,CAAC,CAAC;EACxCD,aAAa,CAACE,WAAW,CAACP,QAAQ,CAACQ,OAAO,CAAC,CAAC,CAAC;EAC7C,OAAOH,aAAa,CAACI,cAAc,CAAC,CAAC;EAErC,SAASH,gBAAgBA,CAAA,EAAkB;IACzC,MAAMI,aAAa,GAAG,KAAIC,0BAAa,EAAC,CAAC;IACzCV,MAAM,CAACW,OAAO,CAAEC,EAAE,IAAK;MACrB,MAAMC,aAAa,GAAGd,QAAQ,CAACe,KAAK,CAACC,OAAO,CAACH,EAAE,CAAC,IAAI,CAACA,EAAE,CAACI,UAAU,CAAC,CAAC;MACpE,MAAMC,YAAY,GAAGlB,QAAQ,CAACmB,MAAM,CAACC,mBAAmB,CAACP,EAAE,EAAE;QAAEC;MAAc,CAAC,CAAC;MAC/E,IAAI,CAACI,YAAY,EAAE;QACjBhB,gBAAM,CAACmB,IAAI,CACT,8CAA8CR,EAAE,CAACT,QAAQ,CAAC,CAAC,wCAC7D,CAAC;QACD;MACF;MACA,MAAMkB,OAAO,GAAGJ,YAAY,CAACI,OAAO;MACpC,IAAI,CAACA,OAAO,EAAE,MAAM,IAAIC,KAAK,CAAC,2BAA2BV,EAAE,CAACT,QAAQ,CAAC,CAAC,EAAE,CAAC;MACzEM,aAAa,CAACc,UAAU,CAAC,KAAIC,uBAAU,EAACH,OAAO,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC,CAAC;IACF,OAAOZ,aAAa;EACtB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_legacy","data","require","_component","_legacy2","deleteComponentsFiles","consumer","bitIds","logger","debug","toString","filesToDelete","getFilesToDelete","addBasePath","getPath","persistAllToFS","dataToPersist","DataToPersist","forEach","id","ignoreVersion","scope","isLocal","hasVersion","componentMap","bitMap","getComponentIfExist","warn","rootDir","Error","WORKSPACE_ROOT_DIR","removePath","RemovePath"],"sources":["delete-component-files.ts"],"sourcesContent":["import type { ComponentIdList } from '@teambit/component-id';\nimport { logger } from '@teambit/legacy.logger';\nimport { DataToPersist, RemovePath } from '@teambit/component.sources';\nimport { WORKSPACE_ROOT_DIR } from '@teambit/legacy.bit-map';\nimport type { Consumer } from '@teambit/legacy.consumer';\n\nexport async function deleteComponentsFiles(consumer: Consumer, bitIds: ComponentIdList) {\n logger.debug(`deleteComponentsFiles, ids: ${bitIds.toString()}`);\n const filesToDelete = getFilesToDelete();\n filesToDelete.addBasePath(consumer.getPath());\n return filesToDelete.persistAllToFS();\n\n function getFilesToDelete(): DataToPersist {\n const dataToPersist = new DataToPersist();\n bitIds.forEach((id) => {\n const ignoreVersion = consumer.scope.isLocal(id) || !id.hasVersion();\n const componentMap = consumer.bitMap.getComponentIfExist(id, { ignoreVersion });\n if (!componentMap) {\n logger.warn(\n `deleteComponentsFiles was unable to delete ${id.toString()} because the id is missing from bitmap`\n );\n return;\n }\n const rootDir = componentMap.rootDir;\n if (!rootDir) throw new Error(`rootDir is missing from ${id.toString()}`);\n if (rootDir === WORKSPACE_ROOT_DIR) {\n // this component's rootDir is the workspace itself. deleting it would wipe the entire\n // workspace - every nested component, .git, .bit and the .bitmap that maps them all.\n // its files are the workspace's own (workspace.jsonc, README, CI config), not component\n // source, so untracking it must leave them in place.\n logger.debug(`deleteComponentsFiles, skipping the files of ${id.toString()}, it owns the workspace root`);\n return;\n }\n dataToPersist.removePath(new RemovePath(rootDir, true));\n });\n return dataToPersist;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGO,eAAeI,qBAAqBA,CAACC,QAAkB,EAAEC,MAAuB,EAAE;EACvFC,gBAAM,CAACC,KAAK,CAAC,+BAA+BF,MAAM,CAACG,QAAQ,CAAC,CAAC,EAAE,CAAC;EAChE,MAAMC,aAAa,GAAGC,gBAAgB,CAAC,CAAC;EACxCD,aAAa,CAACE,WAAW,CAACP,QAAQ,CAACQ,OAAO,CAAC,CAAC,CAAC;EAC7C,OAAOH,aAAa,CAACI,cAAc,CAAC,CAAC;EAErC,SAASH,gBAAgBA,CAAA,EAAkB;IACzC,MAAMI,aAAa,GAAG,KAAIC,0BAAa,EAAC,CAAC;IACzCV,MAAM,CAACW,OAAO,CAAEC,EAAE,IAAK;MACrB,MAAMC,aAAa,GAAGd,QAAQ,CAACe,KAAK,CAACC,OAAO,CAACH,EAAE,CAAC,IAAI,CAACA,EAAE,CAACI,UAAU,CAAC,CAAC;MACpE,MAAMC,YAAY,GAAGlB,QAAQ,CAACmB,MAAM,CAACC,mBAAmB,CAACP,EAAE,EAAE;QAAEC;MAAc,CAAC,CAAC;MAC/E,IAAI,CAACI,YAAY,EAAE;QACjBhB,gBAAM,CAACmB,IAAI,CACT,8CAA8CR,EAAE,CAACT,QAAQ,CAAC,CAAC,wCAC7D,CAAC;QACD;MACF;MACA,MAAMkB,OAAO,GAAGJ,YAAY,CAACI,OAAO;MACpC,IAAI,CAACA,OAAO,EAAE,MAAM,IAAIC,KAAK,CAAC,2BAA2BV,EAAE,CAACT,QAAQ,CAAC,CAAC,EAAE,CAAC;MACzE,IAAIkB,OAAO,KAAKE,6BAAkB,EAAE;QAClC;QACA;QACA;QACA;QACAtB,gBAAM,CAACC,KAAK,CAAC,gDAAgDU,EAAE,CAACT,QAAQ,CAAC,CAAC,8BAA8B,CAAC;QACzG;MACF;MACAM,aAAa,CAACe,UAAU,CAAC,KAAIC,uBAAU,EAACJ,OAAO,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC,CAAC;IACF,OAAOZ,aAAa;EACtB;AACF","ignoreList":[]}
@@ -83,12 +83,19 @@ function _deleteComponentFiles() {
83
83
  return data;
84
84
  }
85
85
  function _legacy3() {
86
- const data = require("@teambit/legacy.component-list");
86
+ const data = require("@teambit/legacy.bit-map");
87
87
  _legacy3 = function () {
88
88
  return data;
89
89
  };
90
90
  return data;
91
91
  }
92
+ function _legacy4() {
93
+ const data = require("@teambit/legacy.component-list");
94
+ _legacy4 = function () {
95
+ return data;
96
+ };
97
+ return data;
98
+ }
92
99
  function _pMapSeries() {
93
100
  const data = _interopRequireDefault(require("p-map-series"));
94
101
  _pMapSeries = function () {
@@ -96,9 +103,9 @@ function _pMapSeries() {
96
103
  };
97
104
  return data;
98
105
  }
99
- function _legacy4() {
106
+ function _legacy5() {
100
107
  const data = require("@teambit/legacy.consumer-component");
101
- _legacy4 = function () {
108
+ _legacy5 = function () {
102
109
  return data;
103
110
  };
104
111
  return data;
@@ -206,7 +213,7 @@ async function removeLocal(workspace, bitIds, force, track, deleteFiles) {
206
213
  if (componentStatus.modified) modifiedComponents.push(id);else nonModifiedComponents.push(id);
207
214
  } catch (err) {
208
215
  // if a component has an error, such as, missing main file, we do want to allow removing that component
209
- if (_legacy4().ConsumerComponent.isComponentInvalidByErrorType(err)) {
216
+ if (_legacy5().ConsumerComponent.isComponentInvalidByErrorType(err)) {
210
217
  nonModifiedComponents.push(id);
211
218
  } else {
212
219
  throw err;
@@ -228,7 +235,7 @@ If you understand the risks and wish to proceed with the removal, please use the
228
235
  }
229
236
  }
230
237
  const idsToRemove = force ? bitIds : nonModifiedComponents;
231
- const componentsList = new (_legacy3().ComponentsList)(workspace);
238
+ const componentsList = new (_legacy4().ComponentsList)(workspace);
232
239
  const newComponents = await componentsList.listNewComponents(false);
233
240
  const idsToRemoveFromScope = _componentId().ComponentIdList.fromArray(idsToRemove.filter(id => !newComponents.hasWithoutVersion(id)));
234
241
  const idsToCleanFromWorkspace = _componentId().ComponentIdList.fromArray(idsToRemove.filter(id => newComponents.hasWithoutVersion(id)));
@@ -246,8 +253,10 @@ If you understand the risks and wish to proceed with the removal, please use the
246
253
  if (deleteFiles) await (0, _deleteComponentFiles().deleteComponentsFiles)(consumer, idsToCleanFromWorkspace);
247
254
  if (!track) {
248
255
  const removedComponents = componentsToRemove.filter(c => idsToCleanFromWorkspace.hasWithoutVersion(c.id));
249
- await consumer.packageJson.removeComponentsFromDependencies(removedComponents);
250
- await removeComponentsFromNodeModules(consumer, removedComponents);
256
+ // the root is untracked only. it was never a package, see withoutWorkspaceRoot.
257
+ const packageComponents = withoutWorkspaceRoot(consumer, removedComponents);
258
+ await consumer.packageJson.removeComponentsFromDependencies(packageComponents);
259
+ await removeComponentsFromNodeModules(consumer, packageComponents);
251
260
  await consumer.cleanFromBitMap(idsToCleanFromWorkspace);
252
261
  await workspace.cleanFromConfig(idsToCleanFromWorkspace);
253
262
  await workspace.removeFromStagedConfig(idsToCleanFromWorkspace);
@@ -255,9 +264,21 @@ If you understand the risks and wish to proceed with the removal, please use the
255
264
  }
256
265
  return new (_removedLocalObjects().RemovedLocalObjects)(_componentId().ComponentIdList.uniqFromArray([...idsToCleanFromWorkspace, ...removedComponentIds]), missingComponents, modifiedComponents, dependentBits, removedFromLane);
257
266
  }
267
+
268
+ /**
269
+ * the workspace-root component is never installed nor linked - it is the workspace, not a package - so
270
+ * there is nothing of it to remove from the manifests or from node_modules, and the package name its
271
+ * id derives may belong to a dependency of the same name.
272
+ */
273
+ function withoutWorkspaceRoot(consumer, components) {
274
+ return components.filter(c => consumer.bitMap.getComponentIfExist(c.id, {
275
+ ignoreVersion: true
276
+ })?.rootDir !== _legacy3().WORKSPACE_ROOT_DIR);
277
+ }
258
278
  async function removeComponentsFromNodeModules(consumer, components) {
259
279
  _legacy2().logger.debug(`removeComponentsFromNodeModules: ${components.map(c => c.id.toString()).join(', ')}`);
260
- const pathsToRemoveWithNulls = components.map(c => {
280
+ const linkedComponents = withoutWorkspaceRoot(consumer, components);
281
+ const pathsToRemoveWithNulls = linkedComponents.map(c => {
261
282
  return (0, _pkgModules().getNodeModulesPathOfComponent)(_objectSpread(_objectSpread({}, c), {}, {
262
283
  id: c.id
263
284
  }));
@@ -1 +1 @@
1
- {"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_groupArray","_lodash","_componentId","_lodash2","_legacy","_bitError","_legacy2","_scope","_scope2","_deleteComponentFiles","_legacy3","_pMapSeries","_legacy4","_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","scope","getRemoteScopes","Remotes","getGlobalRemotes","shouldGoToCentralHub","http","Http","connect","CENTRAL_BIT_HUB_URL","CENTRAL_BIT_HUB_NAME","deleteViaCentralHub","idsAreLanes","context","removeP","key","resolvedRemote","resolve","idsStr","toStringWithoutVersion","deleteMany","Promise","all","consumer","modifiedComponents","nonModifiedComponents","newIds","pMapSeries","componentStatus","getComponentStatusById","newlyCreated","modified","err","ConsumerComponent","isComponentInvalidByErrorType","list","listWithInvalid","components","c","hasWithoutVersion","aspectIds","state","aspects","used","find","newId","includes","idsToRemove","componentsList","ComponentsList","newComponents","listNewComponents","idsToRemoveFromScope","idsToCleanFromWorkspace","workspaceComponents","getMany","undefined","componentsToRemove","workspaceComponent","_consumer","removedComponentIds","missingComponents","dependentBits","removedFromLane","removeMany","deleteComponentsFiles","removedComponents","packageJson","removeComponentsFromDependencies","removeComponentsFromNodeModules","cleanFromBitMap","cleanFromConfig","removeFromStagedConfig","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 type { 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.constants';\nimport { BitError } from '@teambit/bit-error';\nimport { logger } from '@teambit/legacy.logger';\nimport { Http } from '@teambit/scope.network';\nimport { Remotes } from '@teambit/scope.remotes';\nimport { deleteComponentsFiles } from './delete-component-files';\nimport { ComponentsList } from '@teambit/legacy.component-list';\nimport type { RemovedObjects } from '@teambit/legacy.scope';\nimport pMapSeries from 'p-map-series';\nimport type { Consumer } from '@teambit/legacy.consumer';\nimport { ConsumerComponent } from '@teambit/legacy.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 workspace.scope.getRemoteScopes() : 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 const removeP = Object.keys(groupedBitsByScope).map(async (key) => {\n const resolvedRemote = await remotes.resolve(key);\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 (ConsumerComponent.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(workspace);\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 workspaceComponents = await workspace.getMany(idsToRemove, undefined, false);\n const componentsToRemove = workspaceComponents.map((workspaceComponent) => workspaceComponent.state._consumer);\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 await workspace.removeFromStagedConfig(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;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAA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E,OAAO+B,OAAO,CAACC,GAAG,CAACuD,aAAa,CAAChG,GAAG,CAAEkG,aAAa,IAAKC,kBAAE,CAACC,MAAM,CAAC1D,QAAQ,CAAC2D,cAAc,CAACH,aAAa,CAAC,CAAC,CAAC,CAAC;AAC7G","ignoreList":[]}
1
+ {"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_groupArray","_lodash","_componentId","_lodash2","_legacy","_bitError","_legacy2","_scope","_scope2","_deleteComponentFiles","_legacy3","_legacy4","_pMapSeries","_legacy5","_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","scope","getRemoteScopes","Remotes","getGlobalRemotes","shouldGoToCentralHub","http","Http","connect","CENTRAL_BIT_HUB_URL","CENTRAL_BIT_HUB_NAME","deleteViaCentralHub","idsAreLanes","context","removeP","key","resolvedRemote","resolve","idsStr","toStringWithoutVersion","deleteMany","Promise","all","consumer","modifiedComponents","nonModifiedComponents","newIds","pMapSeries","componentStatus","getComponentStatusById","newlyCreated","modified","err","ConsumerComponent","isComponentInvalidByErrorType","list","listWithInvalid","components","c","hasWithoutVersion","aspectIds","state","aspects","used","find","newId","includes","idsToRemove","componentsList","ComponentsList","newComponents","listNewComponents","idsToRemoveFromScope","idsToCleanFromWorkspace","workspaceComponents","getMany","undefined","componentsToRemove","workspaceComponent","_consumer","removedComponentIds","missingComponents","dependentBits","removedFromLane","removeMany","deleteComponentsFiles","removedComponents","packageComponents","withoutWorkspaceRoot","packageJson","removeComponentsFromDependencies","removeComponentsFromNodeModules","cleanFromBitMap","cleanFromConfig","removeFromStagedConfig","uniqFromArray","bitMap","getComponentIfExist","ignoreVersion","rootDir","WORKSPACE_ROOT_DIR","debug","linkedComponents","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 type { 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.constants';\nimport { BitError } from '@teambit/bit-error';\nimport { logger } from '@teambit/legacy.logger';\nimport { Http } from '@teambit/scope.network';\nimport { Remotes } from '@teambit/scope.remotes';\nimport { deleteComponentsFiles } from './delete-component-files';\nimport { WORKSPACE_ROOT_DIR } from '@teambit/legacy.bit-map';\nimport { ComponentsList } from '@teambit/legacy.component-list';\nimport type { RemovedObjects } from '@teambit/legacy.scope';\nimport pMapSeries from 'p-map-series';\nimport type { Consumer } from '@teambit/legacy.consumer';\nimport { ConsumerComponent } from '@teambit/legacy.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 workspace.scope.getRemoteScopes() : 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 const removeP = Object.keys(groupedBitsByScope).map(async (key) => {\n const resolvedRemote = await remotes.resolve(key);\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 (ConsumerComponent.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(workspace);\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 workspaceComponents = await workspace.getMany(idsToRemove, undefined, false);\n const componentsToRemove = workspaceComponents.map((workspaceComponent) => workspaceComponent.state._consumer);\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 // the root is untracked only. it was never a package, see withoutWorkspaceRoot.\n const packageComponents = withoutWorkspaceRoot(consumer, removedComponents);\n await consumer.packageJson.removeComponentsFromDependencies(packageComponents);\n await removeComponentsFromNodeModules(consumer, packageComponents);\n await consumer.cleanFromBitMap(idsToCleanFromWorkspace);\n await workspace.cleanFromConfig(idsToCleanFromWorkspace);\n await workspace.removeFromStagedConfig(idsToCleanFromWorkspace);\n }\n }\n return new RemovedLocalObjects(\n ComponentIdList.uniqFromArray([...idsToCleanFromWorkspace, ...removedComponentIds]),\n missingComponents,\n modifiedComponents,\n dependentBits,\n removedFromLane\n );\n}\n\n/**\n * the workspace-root component is never installed nor linked - it is the workspace, not a package - so\n * there is nothing of it to remove from the manifests or from node_modules, and the package name its\n * id derives may belong to a dependency of the same name.\n */\nfunction withoutWorkspaceRoot(consumer: Consumer, components: ConsumerComponent[]): ConsumerComponent[] {\n return components.filter(\n (c) => consumer.bitMap.getComponentIfExist(c.id, { ignoreVersion: true })?.rootDir !== WORKSPACE_ROOT_DIR\n );\n}\n\nexport async function removeComponentsFromNodeModules(consumer: Consumer, components: ConsumerComponent[]) {\n logger.debug(`removeComponentsFromNodeModules: ${components.map((c) => c.id.toString()).join(', ')}`);\n const linkedComponents = withoutWorkspaceRoot(consumer, components);\n const pathsToRemoveWithNulls = linkedComponents.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;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,UAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,SAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,SAAA;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;IAAE,EAAE,CAAC;EAC1D,CAAC,CAAC;EACF,MAAMuG,aAAa,GAAG,IAAAC,kBAAO,EAACH,sBAAsB,CAAC;EACrD5G,iBAAM,CAAC0G,KAAK,CAAC,iCAAiCI,aAAa,CAAC/F,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;EACzE,OAAO+B,OAAO,CAACC,GAAG,CAAC+D,aAAa,CAACxG,GAAG,CAAE0G,aAAa,IAAKC,kBAAE,CAACC,MAAM,CAAClE,QAAQ,CAACmE,cAAc,CAACH,aAAa,CAAC,CAAC,CAAC,CAAC;AAC7G","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/remove",
3
- "version": "1.0.1174",
3
+ "version": "1.0.1176",
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.1174"
9
+ "version": "1.0.1176"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "4.1.2",
@@ -18,30 +18,31 @@
18
18
  "p-map-series": "2.1.0",
19
19
  "semver": "7.7.1",
20
20
  "@teambit/bit-error": "0.0.404",
21
- "@teambit/cli": "0.0.1393",
22
- "@teambit/harmony.modules.feature-toggle": "0.0.57",
23
- "@teambit/legacy.constants": "0.0.44",
24
- "@teambit/legacy.scope": "0.0.164",
21
+ "@teambit/harmony.modules.feature-toggle": "0.0.58",
22
+ "@teambit/legacy.constants": "0.0.45",
25
23
  "@teambit/component-id": "1.2.4",
26
- "@teambit/component.sources": "0.0.216",
27
- "@teambit/legacy.consumer": "0.0.164",
28
- "@teambit/legacy.logger": "0.0.61",
29
- "@teambit/legacy.component-list": "0.0.218",
30
- "@teambit/legacy.consumer-component": "0.0.165",
31
- "@teambit/pkg.modules.component-package-name": "0.0.171",
32
- "@teambit/scope.network": "0.0.164",
33
- "@teambit/scope.remotes": "0.0.164",
24
+ "@teambit/legacy.logger": "0.0.62",
34
25
  "@teambit/harmony": "0.4.12",
35
26
  "@teambit/component-issues": "0.0.188",
36
- "@teambit/legacy.utils": "0.0.51",
37
- "@teambit/logger": "0.0.1486",
38
- "@teambit/workspace": "1.0.1174",
39
- "@teambit/component": "1.0.1174",
40
- "@teambit/dependency-resolver": "1.0.1174",
41
- "@teambit/importer": "1.0.1174",
42
- "@teambit/issues": "1.0.1174",
43
- "@teambit/lister": "1.0.1174",
44
- "@teambit/scope": "1.0.1174"
27
+ "@teambit/cli": "0.0.1395",
28
+ "@teambit/legacy.scope": "0.0.166",
29
+ "@teambit/workspace": "1.0.1176",
30
+ "@teambit/component.sources": "0.0.218",
31
+ "@teambit/legacy.bit-map": "0.0.223",
32
+ "@teambit/legacy.consumer": "0.0.166",
33
+ "@teambit/legacy.component-list": "0.0.220",
34
+ "@teambit/legacy.consumer-component": "0.0.167",
35
+ "@teambit/pkg.modules.component-package-name": "0.0.173",
36
+ "@teambit/scope.network": "0.0.166",
37
+ "@teambit/scope.remotes": "0.0.166",
38
+ "@teambit/component": "1.0.1176",
39
+ "@teambit/dependency-resolver": "1.0.1176",
40
+ "@teambit/importer": "1.0.1176",
41
+ "@teambit/issues": "1.0.1176",
42
+ "@teambit/legacy.utils": "0.0.52",
43
+ "@teambit/lister": "1.0.1176",
44
+ "@teambit/logger": "0.0.1488",
45
+ "@teambit/scope": "1.0.1176"
45
46
  },
46
47
  "devDependencies": {
47
48
  "@types/fs-extra": "9.0.7",