@teambit/remove 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/delete-cmd.js.map +1 -1
- package/dist/remove-cmd.js.map +1 -1
- package/dist/remove-components.d.ts +7 -5
- package/dist/remove-components.js +7 -7
- package/dist/remove-components.js.map +1 -1
- package/dist/remove.main.runtime.d.ts +3 -5
- package/dist/remove.main.runtime.js.map +1 -1
- package/dist/removed-local-objects.d.ts +6 -0
- package/dist/removed-local-objects.js +33 -0
- package/dist/removed-local-objects.js.map +1 -0
- package/package.json +9 -9
- /package/dist/{preview-1695352690046.js → preview-1695413141774.js} +0 -0
package/dist/delete-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_constants","_removeTemplate","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","DeleteCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","report","componentsPattern","force","lane","updateMain","hard","silent","_this$workspace","_this$workspace2","isOnLane","BitError","isOnMain","removePrompt","localResult","remoteResult","remote","localMessage","removeTemplate","paintArray","removedCompIds","deleteComps","chalk","green","join","bold","removedObjectsArray","map","item","logger","clearStatusLine","remoteOrLocalOutput","ok","yesno","question","exports"],"sources":["delete-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport yesno from 'yesno';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport RemovedObjects from '@teambit/legacy/dist/scope/removed-components';\nimport
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_constants","_removeTemplate","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","DeleteCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","report","componentsPattern","force","lane","updateMain","hard","silent","_this$workspace","_this$workspace2","isOnLane","BitError","isOnMain","removePrompt","localResult","remoteResult","remote","localMessage","removeTemplate","paintArray","removedCompIds","deleteComps","chalk","green","join","bold","removedObjectsArray","map","item","logger","clearStatusLine","remoteOrLocalOutput","ok","yesno","question","exports"],"sources":["delete-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport yesno from 'yesno';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport RemovedObjects from '@teambit/legacy/dist/scope/removed-components';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { RemoveMain } from './remove.main.runtime';\nimport { removeTemplate } from './remove-template';\n\nexport class DeleteCmd implements Command {\n name = 'delete <component-pattern>';\n description = 'mark components as deleted on the remote';\n extendedDescription = `to remove components from your local workspace only, use \"bit remove\" command.\nthis command marks the components as deleted, and after snap/tag and export they will be marked as deleted from the remote scope as well.\n`;\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n group = 'collaborate';\n helpUrl = 'reference/components/removing-components';\n skipWorkspace = true;\n alias = '';\n options = [\n ['', 'lane', 'when on a lane, delete the component from this lane only. avoid merging it to main or other lanes'],\n ['', 'update-main', 'EXPERIMENTAL. delete component/s on the main lane after merging this lane into main'],\n [\n 'f',\n 'force',\n 'removes the component from the scope, even if used as a dependency. WARNING: components that depend on this component will corrupt',\n ],\n ['s', 'silent', 'skip confirmation'],\n [\n '',\n 'hard',\n 'NOT-RECOMMENDED. delete a component completely from a remote scope. careful! this is a permanent change that could corrupt dependents.',\n ],\n ] as CommandOptions;\n loader = true;\n migration = true;\n remoteOp = true;\n\n constructor(private remove: RemoveMain, private workspace?: Workspace) {}\n\n async report(\n [componentsPattern]: [string],\n {\n force = false,\n lane = false,\n updateMain = false,\n hard = false,\n silent = false,\n }: {\n force?: boolean;\n lane?: boolean;\n updateMain?: boolean;\n hard?: boolean;\n silent?: boolean;\n }\n ) {\n if (this.workspace?.isOnLane() && !hard && !lane && !updateMain) {\n throw new BitError(`error: to delete components when on a lane, use --lane flag`);\n }\n if (this.workspace?.isOnMain() && updateMain) {\n throw new BitError(`--update-main is relevant only when on a lane`);\n }\n\n if (!silent) {\n await this.removePrompt(hard);\n }\n\n if (hard) {\n const { localResult, remoteResult = [] } = await this.remove.remove({ componentsPattern, remote: true, force });\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n let localMessage = removeTemplate(localResult, false);\n if (localMessage !== '') localMessage += '\\n';\n return `${localMessage}${this.paintArray(remoteResult)}`;\n }\n\n const removedCompIds = await this.remove.deleteComps(componentsPattern, { updateMain });\n return `${chalk.green('successfully deleted the following components:')}\n${removedCompIds.join('\\n')}\n\n${chalk.bold('to update the remote, please tag/snap and then export. to revert, please use \"bit recover\"')}`;\n }\n\n private paintArray(removedObjectsArray: RemovedObjects[]) {\n return removedObjectsArray.map((item) => removeTemplate(item, true));\n }\n\n private async removePrompt(hard?: boolean) {\n this.remove.logger.clearStatusLine();\n const remoteOrLocalOutput = hard\n ? `WARNING: the component(s) will be permanently deleted from the remote with no option to recover. prefer omitting --hard to only mark the component as deleted`\n : `this command will mark the component as deleted, and it won’t be shown on the remote scope after tag/snap and export.\nif your intent, is to remove the component only from your local workspace, refer to bit remove.`;\n\n const ok = await yesno({\n question: `${remoteOrLocalOutput}\n${chalk.bold('Would you like to proceed? [yes(y)/no(n)]')}`,\n });\n if (!ok) {\n throw new BitError('the operation has been canceled');\n }\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA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,IAAK,IAAAV,gCAAc,EAACU,IAAI,EAAE,IAAI,CAAC,CAAC;EACtE;EAEA,MAAcf,YAAYA,CAACP,IAAc,EAAE;IACzC,IAAI,CAACV,MAAM,CAACiC,MAAM,CAACC,eAAe,CAAC,CAAC;IACpC,MAAMC,mBAAmB,GAAGzB,IAAI,GAC3B,+JAA8J,GAC9J;AACT,gGAAgG;IAE5F,MAAM0B,EAAE,GAAG,MAAM,IAAAC,gBAAK,EAAC;MACrBC,QAAQ,EAAG,GAAEH,mBAAoB;AACvC,EAAET,gBAAK,CAACG,IAAI,CAAC,2CAA2C,CAAE;IACtD,CAAC,CAAC;IACF,IAAI,CAACO,EAAE,EAAE;MACP,MAAM,KAAIrB,oBAAQ,EAAC,iCAAiC,CAAC;IACvD;EACF;AACF;AAACwB,OAAA,CAAAzC,SAAA,GAAAA,SAAA"}
|
package/dist/remove-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_constants","_removeTemplate","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","RemoveCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","report","componentsPattern","force","fromLane","track","silent","keepFiles","removePrompt","localResult","deleteFiles","localMessage","removeTemplate","logger","clearStatusLine","filesDeletionStr","ok","yesno","question","chalk","bold","BitError","exports"],"sources":["remove-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport yesno from 'yesno';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_constants","_removeTemplate","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","RemoveCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","report","componentsPattern","force","fromLane","track","silent","keepFiles","removePrompt","localResult","deleteFiles","localMessage","removeTemplate","logger","clearStatusLine","filesDeletionStr","ok","yesno","question","chalk","bold","BitError","exports"],"sources":["remove-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport yesno from 'yesno';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport RemovedLocalObjects from './removed-local-objects';\nimport { RemoveMain } from './remove.main.runtime';\nimport { removeTemplate } from './remove-template';\n\nexport class RemoveCmd implements Command {\n name = 'remove <component-pattern>';\n description = 'remove component(s) from the local workspace';\n extendedDescription = `to mark components as deleted on the remote scope, use \"bit delete\".`;\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n group = 'collaborate';\n helpUrl = 'reference/components/removing-components';\n skipWorkspace = true;\n alias = 'rm';\n options = [\n // this option is confusing and probably not in use. if needed, move this to \"bit lane remove-comp\" command.\n // ['', 'from-lane', 'revert to main if exists on currently checked out lane, otherwise, remove it'],\n ['t', 'track', 'keep tracking component in .bitmap (default = false), helps transform a tagged-component to new'],\n ['', 'keep-files', 'keep component files (just untrack the component)'],\n [\n 'f',\n 'force',\n 'removes the component from the scope, even if used as a dependency. WARNING: you will need to fix the components that depend on this component',\n ],\n ['s', 'silent', 'skip confirmation'],\n ] as CommandOptions;\n loader = true;\n migration = true;\n remoteOp = true;\n\n constructor(private remove: RemoveMain, private workspace?: Workspace) {}\n\n async report(\n [componentsPattern]: [string],\n {\n force = false,\n fromLane = false,\n track = false,\n silent = false,\n keepFiles = false,\n }: {\n force?: boolean;\n track?: boolean;\n fromLane?: boolean;\n silent?: boolean;\n keepFiles?: boolean;\n }\n ) {\n if (!silent) {\n await this.removePrompt(!keepFiles);\n }\n const {\n localResult,\n }: {\n localResult: RemovedLocalObjects;\n } = await this.remove.remove({ componentsPattern, force, track, deleteFiles: !keepFiles, fromLane });\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const localMessage = removeTemplate(localResult, false);\n // if (localMessage !== '')\n // localMessage +=\n // '. Note: these components were not deleted from the remote - if you want to delete components run \"bit delete\"\\n';\n return localMessage;\n }\n\n private async removePrompt(deleteFiles?: boolean) {\n this.remove.logger.clearStatusLine();\n const filesDeletionStr = deleteFiles\n ? ' and the files will be deleted from the filesystem (can be avoided by entering --keep-files)'\n : '';\n const ok = await yesno({\n question: `this command will remove the component/s only from your local workspace. if your intent is to delete the component/s also from the remote scope, refer to \"bit delete\".\nthe component(s) will be untracked${filesDeletionStr}.\n${chalk.bold('Would you like to proceed? [yes(y)/no(n)]')}`,\n });\n if (!ok) {\n throw new BitError('the operation has been canceled');\n }\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAM,gBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;E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BC,QAAQ,EAAG;AACjB,oCAAoCH,gBAAiB;AACrD,EAAEI,gBAAK,CAACC,IAAI,CAAC,2CAA2C,CAAE;IACtD,CAAC,CAAC;IACF,IAAI,CAACJ,EAAE,EAAE;MACP,MAAM,KAAIK,oBAAQ,EAAC,iCAAiC,CAAC;IACvD;EACF;AACF;AAACC,OAAA,CAAA5B,SAAA,GAAAA,SAAA"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { Consumer } from '@teambit/legacy/dist/consumer';
|
|
2
2
|
import BitIds from '@teambit/legacy/dist/bit-id/bit-ids';
|
|
3
|
-
import
|
|
3
|
+
import RemovedObjects from '@teambit/legacy/dist/scope/removed-components';
|
|
4
|
+
import RemovedLocalObjects from './removed-local-objects';
|
|
5
|
+
export declare type RemoveComponentsResult = {
|
|
6
|
+
localResult: RemovedLocalObjects;
|
|
7
|
+
remoteResult: RemovedObjects[];
|
|
8
|
+
};
|
|
4
9
|
/**
|
|
5
10
|
* Remove components local and remote
|
|
6
11
|
* splits array of ids into local and remote and removes according to flags
|
|
@@ -18,7 +23,4 @@ export declare function removeComponents({ consumer, ids, force, remote, track,
|
|
|
18
23
|
track: boolean;
|
|
19
24
|
deleteFiles: boolean;
|
|
20
25
|
fromLane: boolean;
|
|
21
|
-
}): Promise<
|
|
22
|
-
localResult: RemovedLocalObjects;
|
|
23
|
-
remoteResult: Record<string, any>[];
|
|
24
|
-
}>;
|
|
26
|
+
}): Promise<RemoveComponentsResult>;
|
|
@@ -74,13 +74,6 @@ function _remotes() {
|
|
|
74
74
|
};
|
|
75
75
|
return data;
|
|
76
76
|
}
|
|
77
|
-
function _removedLocalObjects() {
|
|
78
|
-
const data = _interopRequireDefault(require("@teambit/legacy/dist/scope/removed-local-objects"));
|
|
79
|
-
_removedLocalObjects = function () {
|
|
80
|
-
return data;
|
|
81
|
-
};
|
|
82
|
-
return data;
|
|
83
|
-
}
|
|
84
77
|
function _scopeRemotes() {
|
|
85
78
|
const data = require("@teambit/legacy/dist/scope/scope-remotes");
|
|
86
79
|
_scopeRemotes = function () {
|
|
@@ -123,6 +116,13 @@ function _pMapSeries() {
|
|
|
123
116
|
};
|
|
124
117
|
return data;
|
|
125
118
|
}
|
|
119
|
+
function _removedLocalObjects() {
|
|
120
|
+
const data = _interopRequireDefault(require("./removed-local-objects"));
|
|
121
|
+
_removedLocalObjects = function () {
|
|
122
|
+
return data;
|
|
123
|
+
};
|
|
124
|
+
return data;
|
|
125
|
+
}
|
|
126
126
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
127
127
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
128
128
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_groupArray","data","_interopRequireDefault","require","_lodash","_ramda","_bitIds","_constants","_generalError","_enrichContextFromGlobal","_logger","_http","_remotes","_removedLocalObjects","_scopeRemotes","_deleteComponentFiles","_componentsList","_consumerComponent","packageJsonUtils","_interopRequireWildcard","_pMapSeries","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","removeComponents","consumer","ids","force","remote","track","deleteFiles","fromLane","logger","debugAndAddBreadCrumb","toString","bitIdsLatest","BitIds","fromArray","map","id","changeVersion","LATEST_BIT_VERSION","localIds","remoteIds","partition","isLocal","length","GeneralError","join","remoteResult","R","isEmpty","removeRemote","localResult","removeLocal","RemovedLocalObjects","bitIds","groupedBitsByScope","groupArray","remotes","getScopeRemotes","scope","Remotes","getGlobalRemotes","shouldGoToCentralHub","keys","http","Http","connect","CENTRAL_BIT_HUB_URL","CENTRAL_BIT_HUB_NAME","deleteViaCentralHub","idsAreLanes","context","enrichContextFromGlobal","removeP","resolvedRemote","resolve","idsStr","toStringWithoutVersion","deleteMany","Promise","all","modifiedComponents","nonModifiedComponents","pMapSeries","componentStatus","getComponentStatusById","modified","push","err","Component","isComponentInvalidByErrorType","idsToRemove","componentsList","ComponentsList","newComponents","listNewComponents","idsToRemoveFromScope","filter","hasWithoutScopeAndVersion","idsToCleanFromWorkspace","components","componentsToRemove","invalidComponents","loadComponents","removedComponentIds","missingComponents","dependentBits","removedFromLane","removeMany","deleteComponentsFiles","invalidComponentsIds","i","removedComponents","c","hasWithoutVersion","removeComponentsFromWorkspacesAndDependencies","cleanFromBitMap","cleanOrRevertFromBitMapWhenOnLane","uniqFromArray"],"sources":["remove-components.ts"],"sourcesContent":["import groupArray from 'group-array';\nimport partition from 'lodash.partition';\nimport R from 'ramda';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport BitIds from '@teambit/legacy/dist/bit-id/bit-ids';\nimport { CENTRAL_BIT_HUB_NAME, CENTRAL_BIT_HUB_URL, LATEST_BIT_VERSION } from '@teambit/legacy/dist/constants';\nimport GeneralError from '@teambit/legacy/dist/error/general-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 RemovedLocalObjects from '@teambit/legacy/dist/scope/removed-local-objects';\nimport { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';\nimport deleteComponentsFiles from '@teambit/legacy/dist/consumer/component-ops/delete-component-files';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport Component from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport * as packageJsonUtils from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport pMapSeries from 'p-map-series';\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 consumer,\n ids,\n force,\n remote,\n track,\n deleteFiles,\n fromLane,\n}: {\n consumer: Consumer | null | undefined; // when remote is false, it's always set\n ids: BitIds;\n force: boolean;\n remote: boolean;\n track: boolean;\n deleteFiles: boolean;\n fromLane: boolean;\n}): Promise<{ localResult: RemovedLocalObjects; remoteResult: Record<string, any>[] }> {\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 = BitIds.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 GeneralError(\n `unable to remove the remote components: ${localIds.join(',')} as they don't contain a scope-name`\n );\n }\n const remoteResult = remote && !R.isEmpty(remoteIds) ? await removeRemote(consumer, remoteIds, force) : [];\n const localResult = !remote\n ? await removeLocal(consumer as Consumer, bitIdsLatest, force, track, deleteFiles, fromLane)\n : new RemovedLocalObjects();\n\n return { localResult, remoteResult };\n}\n\n/**\n * Remove remote component from ssh server\n * this method groups remote components by remote name and deletes remote components together\n * @param {BitIds} bitIds - list of remote component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n */\nasync function removeRemote(consumer: Consumer | null | undefined, bitIds: BitIds, force: boolean) {\n const groupedBitsByScope = groupArray(bitIds, 'scope');\n const remotes = consumer ? await getScopeRemotes(consumer.scope) : 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, consumer?.scope);\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 {BitIds} 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 consumer: Consumer,\n bitIds: BitIds,\n force: boolean,\n track: boolean,\n deleteFiles: boolean,\n fromLane: boolean\n): Promise<RemovedLocalObjects> {\n // local remove in case user wants to delete tagged components\n const modifiedComponents = new BitIds();\n const nonModifiedComponents = new BitIds();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n if (R.isEmpty(bitIds)) return new RemovedLocalObjects();\n if (!force) {\n await pMapSeries(bitIds, async (id) => {\n try {\n const componentStatus = await consumer.getComponentStatusById(id);\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 }\n const idsToRemove = force ? bitIds : nonModifiedComponents;\n const componentsList = new ComponentsList(consumer);\n const newComponents = (await componentsList.listNewComponents(false)) as BitIds;\n const idsToRemoveFromScope = BitIds.fromArray(\n idsToRemove.filter((id) => !newComponents.hasWithoutScopeAndVersion(id))\n );\n const idsToCleanFromWorkspace = BitIds.fromArray(\n idsToRemove.filter((id) => newComponents.hasWithoutScopeAndVersion(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 fromLane\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 }\n }\n if (removedFromLane.length && fromLane) {\n await consumer.cleanOrRevertFromBitMapWhenOnLane(removedFromLane);\n }\n return new RemovedLocalObjects(\n BitIds.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,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data","_interopRequireDefault","require","_lodash","_ramda","_bitIds","_constants","_generalError","_enrichContextFromGlobal","_logger","_http","_remotes","_scopeRemotes","_deleteComponentFiles","_componentsList","_consumerComponent","packageJsonUtils","_interopRequireWildcard","_pMapSeries","_removedLocalObjects","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","removeComponents","consumer","ids","force","remote","track","deleteFiles","fromLane","logger","debugAndAddBreadCrumb","toString","bitIdsLatest","BitIds","fromArray","map","id","changeVersion","LATEST_BIT_VERSION","localIds","remoteIds","partition","isLocal","length","GeneralError","join","remoteResult","R","isEmpty","removeRemote","localResult","removeLocal","RemovedLocalObjects","bitIds","groupedBitsByScope","groupArray","remotes","getScopeRemotes","scope","Remotes","getGlobalRemotes","shouldGoToCentralHub","keys","http","Http","connect","CENTRAL_BIT_HUB_URL","CENTRAL_BIT_HUB_NAME","deleteViaCentralHub","idsAreLanes","context","enrichContextFromGlobal","removeP","resolvedRemote","resolve","idsStr","toStringWithoutVersion","deleteMany","Promise","all","modifiedComponents","nonModifiedComponents","pMapSeries","componentStatus","getComponentStatusById","modified","push","err","Component","isComponentInvalidByErrorType","idsToRemove","componentsList","ComponentsList","newComponents","listNewComponents","idsToRemoveFromScope","filter","hasWithoutScopeAndVersion","idsToCleanFromWorkspace","components","componentsToRemove","invalidComponents","loadComponents","removedComponentIds","missingComponents","dependentBits","removedFromLane","removeMany","deleteComponentsFiles","invalidComponentsIds","i","removedComponents","c","hasWithoutVersion","removeComponentsFromWorkspacesAndDependencies","cleanFromBitMap","cleanOrRevertFromBitMapWhenOnLane","uniqFromArray"],"sources":["remove-components.ts"],"sourcesContent":["import groupArray from 'group-array';\nimport partition from 'lodash.partition';\nimport R from 'ramda';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport BitIds from '@teambit/legacy/dist/bit-id/bit-ids';\nimport { CENTRAL_BIT_HUB_NAME, CENTRAL_BIT_HUB_URL, LATEST_BIT_VERSION } from '@teambit/legacy/dist/constants';\nimport GeneralError from '@teambit/legacy/dist/error/general-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 '@teambit/legacy/dist/consumer/component-ops/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 consumer,\n ids,\n force,\n remote,\n track,\n deleteFiles,\n fromLane,\n}: {\n consumer: Consumer | null | undefined; // when remote is false, it's always set\n ids: BitIds;\n force: boolean;\n remote: boolean;\n track: boolean;\n deleteFiles: boolean;\n fromLane: 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 = BitIds.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 GeneralError(\n `unable to remove the remote components: ${localIds.join(',')} as they don't contain a scope-name`\n );\n }\n const remoteResult = remote && !R.isEmpty(remoteIds) ? await removeRemote(consumer, remoteIds, force) : [];\n const localResult = !remote\n ? await removeLocal(consumer as Consumer, bitIdsLatest, force, track, deleteFiles, fromLane)\n : new RemovedLocalObjects();\n\n return { localResult, remoteResult };\n}\n\n/**\n * Remove remote component from ssh server\n * this method groups remote components by remote name and deletes remote components together\n * @param {BitIds} 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 consumer: Consumer | null | undefined,\n bitIds: BitIds,\n force: boolean\n): Promise<RemovedObjects[]> {\n const groupedBitsByScope = groupArray(bitIds, 'scope');\n const remotes = consumer ? await getScopeRemotes(consumer.scope) : 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, consumer?.scope);\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 {BitIds} 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 consumer: Consumer,\n bitIds: BitIds,\n force: boolean,\n track: boolean,\n deleteFiles: boolean,\n fromLane: boolean\n): Promise<RemovedLocalObjects> {\n // local remove in case user wants to delete tagged components\n const modifiedComponents = new BitIds();\n const nonModifiedComponents = new BitIds();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n if (R.isEmpty(bitIds)) return new RemovedLocalObjects();\n if (!force) {\n await pMapSeries(bitIds, async (id) => {\n try {\n const componentStatus = await consumer.getComponentStatusById(id);\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 }\n const idsToRemove = force ? bitIds : nonModifiedComponents;\n const componentsList = new ComponentsList(consumer);\n const newComponents = (await componentsList.listNewComponents(false)) as BitIds;\n const idsToRemoveFromScope = BitIds.fromArray(\n idsToRemove.filter((id) => !newComponents.hasWithoutScopeAndVersion(id))\n );\n const idsToCleanFromWorkspace = BitIds.fromArray(\n idsToRemove.filter((id) => newComponents.hasWithoutScopeAndVersion(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 fromLane\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 }\n }\n if (removedFromLane.length && fromLane) {\n await consumer.cleanOrRevertFromBitMapWhenOnLane(removedFromLane);\n }\n return new RemovedLocalObjects(\n BitIds.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;IACtC,MAAMN,QAAQ,CAAC8F,iCAAiC,CAACV,eAAe,CAAC;EACnE;EACA,OAAO,KAAItD,8BAAmB,EAC5BnB,iBAAM,CAACoF,aAAa,CAAC,CAAC,GAAGnB,uBAAuB,EAAE,GAAGK,mBAAmB,CAAC,CAAC,EAC1EC,iBAAiB,EACjBxB,kBAAkB,EAClByB,aAAa,EACbC,eACF,CAAC;AACH"}
|
|
@@ -7,6 +7,7 @@ import { ComponentID } from '@teambit/component-id';
|
|
|
7
7
|
import { DependencyResolverMain } from '@teambit/dependency-resolver';
|
|
8
8
|
import { IssuesMain } from '@teambit/issues';
|
|
9
9
|
import { Component, ComponentMain } from '@teambit/component';
|
|
10
|
+
import { RemoveComponentsResult } from './remove-components';
|
|
10
11
|
import { RecoverOptions } from './recover-cmd';
|
|
11
12
|
export declare type RemoveInfo = {
|
|
12
13
|
removed: boolean;
|
|
@@ -28,16 +29,13 @@ export declare class RemoveMain {
|
|
|
28
29
|
track?: boolean;
|
|
29
30
|
deleteFiles?: boolean;
|
|
30
31
|
fromLane?: boolean;
|
|
31
|
-
}): Promise<
|
|
32
|
+
}): Promise<RemoveComponentsResult>;
|
|
32
33
|
/**
|
|
33
34
|
* remove components from the workspace.
|
|
34
35
|
*/
|
|
35
36
|
removeLocallyByIds(ids: BitId[], { force }?: {
|
|
36
37
|
force?: boolean;
|
|
37
|
-
}): Promise<
|
|
38
|
-
localResult: import("@teambit/legacy/dist/scope/removed-local-objects").default;
|
|
39
|
-
remoteResult: Record<string, any>[];
|
|
40
|
-
}>;
|
|
38
|
+
}): Promise<RemoveComponentsResult>;
|
|
41
39
|
markRemoveComps(componentIds: ComponentID[], shouldUpdateMain?: boolean): Promise<ComponentID[]>;
|
|
42
40
|
deleteComps(componentsPattern: string, opts?: {
|
|
43
41
|
updateMain?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_logger","_workspace","_interopRequireWildcard","_legacyBitId","_bitId","_exceptions","_importer","_interopRequireDefault","_lodash","_hasWildcard","_listScope","_bitError","_deleteComponentFiles","_dependencyResolver","_componentIssues","_issues","_pMapSeries","_component","_exceptions2","_packageJsonUtils","_removeCmd","_removeComponents","_remove","_remove2","_recoverCmd","_deleteCmd","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_defineProperty","value","_toPropertyKey","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","BEFORE_REMOVE","RemoveMain","constructor","workspace","logger","importer","depResolver","remove","componentsPattern","force","remote","track","deleteFiles","fromLane","_this$workspace","setStatusLine","bitIds","getRemoteBitIdsToRemove","getLocalBitIdsToRemove","consumer","removeResults","removeComponents","ids","BitIds","fromArray","onDestroy","removeLocallyByIds","OutsideWorkspaceError","results","bitMap","write","markRemoveComps","componentIds","shouldUpdateMain","components","getMany","removeComponentsFromNodeModules","map","c","state","_consumer","config","removed","removeOnMain","compId","addComponentConfig","RemoveAspect","id","_legacy","deleteComponentsFiles","deleteComps","opts","ConsumerNotFound","idsByPattern","newComps","filter","hasVersion","length","BitError","toString","join","currentLane","getCurrentLaneObject","updateMain","isNew","Error","recover","compIdStr","options","bitMapEntry","find","compMap","name","toStringWithoutVersion","importComp","idStr","import","installNpmPackages","skipDependencyInstallation","override","setAsRemovedFalse","addSpecificComponentConfig","_bitMapEntry$config","_bitMapEntry$config2","resolveComponentId","comp","isRemoved","scope","idOnLane","getComponent","compIdWithPossibleVer","changeVersion","head","compFromScope","err","VersionNotFound","version","getRemoteComponent","throwForMainComponentWhenOnLane","laneComps","toBitIds","mainComps","hasWithoutVersion","getRemoveInfo","component","_component$config$ext","extensions","findExtension","isRemovedByIdWithoutLoadingComponent","componentId","bitmapEntry","getBitmapEntryIfExist","isRecovered","modelComp","getBitObjectModelComponent","versionObj","getBitObjectVersion","getRemovedStaged","isOnMain","getRemovedStagedFromMain","getRemovedStagedFromLane","addRemovedDependenciesIssues","pMapSeries","addRemovedDepIssue","dependencies","getComponentDependencies","removedWithUndefined","Promise","all","dep","compact","issues","getOrCreate","IssuesClasses","RemovedDependencies","stagedConfig","getStagedConfig","getAll","compConfig","_compConfig$config","laneIds","workspaceIds","listIds","laneIdsNotInWorkspace","wId","isEqualWithoutVersion","laneCompIdsNotInWorkspace","resolveMultipleComponentIds","comps","staged","snapDistance","getSnapDistance","warn","isSourceAhead","hasWildcard","getRemoteBitIdsByWildcards","BitId","parse","provider","cli","loggerMain","componentAspect","importerMain","createLogger","removeMain","registerAddComponentsIssues","bind","registerShowFragments","RemoveFragment","register","RemoveCmd","DeleteCmd","RecoverCmd","exports","WorkspaceAspect","CLIAspect","LoggerAspect","ComponentAspect","ImporterAspect","DependencyResolverAspect","IssuesAspect","MainRuntime","addRuntime","_default"],"sources":["remove.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport ImporterAspect, { ImporterMain } from '@teambit/importer';\nimport { compact } from 'lodash';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport { getRemoteBitIdsByWildcards } from '@teambit/legacy/dist/api/consumer/lib/list-scope';\nimport { ComponentID } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport deleteComponentsFiles from '@teambit/legacy/dist/consumer/component-ops/delete-component-files';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport IssuesAspect, { IssuesMain } from '@teambit/issues';\nimport pMapSeries from 'p-map-series';\nimport ComponentAspect, { Component, ComponentMain } from '@teambit/component';\nimport { VersionNotFound } from '@teambit/legacy/dist/scope/exceptions';\nimport { removeComponentsFromNodeModules } from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport { RemoveCmd } from './remove-cmd';\nimport { removeComponents } from './remove-components';\nimport { RemoveAspect } from './remove.aspect';\nimport { RemoveFragment } from './remove.fragment';\nimport { RecoverCmd, RecoverOptions } from './recover-cmd';\nimport { DeleteCmd } from './delete-cmd';\n\nconst BEFORE_REMOVE = 'removing components';\n\nexport type RemoveInfo = {\n removed: boolean;\n /**\n * whether to remove the component from default lane once merged\n */\n removeOnMain?: boolean;\n};\n\nexport class RemoveMain {\n constructor(\n private workspace: Workspace,\n public logger: Logger,\n private importer: ImporterMain,\n private depResolver: DependencyResolverMain\n ) {}\n\n async remove({\n componentsPattern,\n force = false,\n remote = false,\n track = false,\n deleteFiles = true,\n fromLane = false,\n }: {\n componentsPattern: string;\n force?: boolean;\n remote?: boolean;\n track?: boolean;\n deleteFiles?: boolean;\n fromLane?: boolean;\n }): Promise<any> {\n this.logger.setStatusLine(BEFORE_REMOVE);\n const bitIds = remote\n ? await this.getRemoteBitIdsToRemove(componentsPattern)\n : await this.getLocalBitIdsToRemove(componentsPattern);\n this.logger.setStatusLine(BEFORE_REMOVE); // again because the loader might changed when talking to the remote\n const consumer = this.workspace?.consumer;\n const removeResults = await removeComponents({\n consumer,\n ids: BitIds.fromArray(bitIds),\n force,\n remote,\n track,\n deleteFiles,\n fromLane,\n });\n if (consumer) await consumer.onDestroy();\n return removeResults;\n }\n\n /**\n * remove components from the workspace.\n */\n async removeLocallyByIds(ids: BitId[], { force = false }: { force?: boolean } = {}) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const results = await removeComponents({\n consumer: this.workspace.consumer,\n ids: BitIds.fromArray(ids),\n force,\n remote: false,\n track: false,\n deleteFiles: true,\n fromLane: false,\n });\n await this.workspace.bitMap.write();\n\n return results;\n }\n\n async markRemoveComps(componentIds: ComponentID[], shouldUpdateMain = false) {\n const components = await this.workspace.getMany(componentIds);\n await removeComponentsFromNodeModules(\n this.workspace.consumer,\n components.map((c) => c.state._consumer)\n );\n // don't use `this.workspace.addSpecificComponentConfig`, if the component has component.json it will be deleted\n // during this removal along with the entire component dir.\n const config: RemoveInfo = { removed: true };\n if (shouldUpdateMain) config.removeOnMain = true;\n componentIds.map((compId) => this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, config));\n await this.workspace.bitMap.write();\n const bitIds = BitIds.fromArray(componentIds.map((id) => id._legacy));\n await deleteComponentsFiles(this.workspace.consumer, bitIds);\n\n return componentIds;\n }\n\n async deleteComps(componentsPattern: string, opts: { updateMain?: boolean } = {}): Promise<ComponentID[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n const newComps = componentIds.filter((id) => !id.hasVersion());\n if (newComps.length) {\n throw new BitError(\n `no need to delete the following new component(s), please remove them by \"bit remove\"\\n${newComps\n .map((id) => id.toString())\n .join('\\n')}`\n );\n }\n const currentLane = await this.workspace.getCurrentLaneObject();\n const { updateMain } = opts;\n if (!updateMain && currentLane?.isNew) {\n throw new Error(\n 'no need to delete components from an un-exported lane, you can remove them by running \"bit remove\"'\n );\n }\n\n return this.markRemoveComps(componentIds, updateMain);\n }\n\n /**\n * recover a soft-removed component.\n * there are 4 different scenarios.\n * 1. a component was just soft-removed, it wasn't snapped yet. so it's now in .bitmap with the \"removed\" aspect entry.\n * 2. soft-removed and then snapped. It's not in .bitmap now.\n * 3. soft-removed, snapped, exported. it's not in .bitmap now.\n * 4. a soft-removed components was imported, so it's now in .bitmap without the \"removed\" aspect entry.\n * 5. workspace is empty. the soft-removed component is on the remote.\n * returns `true` if it was recovered. `false` if the component wasn't soft-removed, so nothing to recover from.\n */\n async recover(compIdStr: string, options: RecoverOptions): Promise<boolean> {\n if (!this.workspace) throw new ConsumerNotFound();\n const bitMapEntry = this.workspace.consumer.bitMap.components.find((compMap) => {\n return compMap.id.name === compIdStr || compMap.id.toStringWithoutVersion() === compIdStr;\n });\n const importComp = async (idStr: string) => {\n await this.importer.import({\n ids: [idStr],\n installNpmPackages: !options.skipDependencyInstallation,\n override: true,\n });\n };\n const setAsRemovedFalse = async (compId: ComponentID) => {\n await this.workspace.addSpecificComponentConfig(compId, RemoveAspect.id, { removed: false });\n await this.workspace.bitMap.write();\n };\n if (bitMapEntry) {\n if (bitMapEntry.config?.[RemoveAspect.id]) {\n // case #1\n delete bitMapEntry.config?.[RemoveAspect.id];\n await importComp(bitMapEntry.id.toString());\n return true;\n }\n // case #4\n const compId = await this.workspace.resolveComponentId(bitMapEntry.id);\n const comp = await this.workspace.get(compId);\n if (!this.isRemoved(comp)) {\n return false;\n }\n await setAsRemovedFalse(compId);\n return true;\n }\n const compId = await this.workspace.scope.resolveComponentId(compIdStr);\n const currentLane = await this.workspace.getCurrentLaneObject();\n const idOnLane = currentLane?.getComponent(compId._legacy);\n const compIdWithPossibleVer = idOnLane ? compId.changeVersion(idOnLane.head.toString()) : compId;\n let compFromScope: Component | undefined;\n try {\n compFromScope = await this.workspace.scope.get(compIdWithPossibleVer);\n } catch (err: any) {\n if (err instanceof VersionNotFound && err.version === '0.0.0') {\n throw new BitError(\n `unable to find the component ${compIdWithPossibleVer.toString()} in the current lane or main`\n );\n }\n throw err;\n }\n if (compFromScope && this.isRemoved(compFromScope)) {\n // case #2 and #3\n await importComp(compIdWithPossibleVer._legacy.toString());\n await setAsRemovedFalse(compIdWithPossibleVer);\n return true;\n }\n // case #5\n const comp = await this.workspace.scope.getRemoteComponent(compId);\n if (!this.isRemoved(comp)) {\n return false;\n }\n await importComp(compId._legacy.toString());\n await setAsRemovedFalse(compId);\n\n return true;\n }\n\n private async throwForMainComponentWhenOnLane(components: Component[]) {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return; // user on main\n const laneComps = currentLane.toBitIds();\n const mainComps = components.filter((comp) => !laneComps.hasWithoutVersion(comp.id._legacy));\n if (mainComps.length) {\n throw new BitError(`the following components belong to main, they cannot be soft-removed when on a lane. consider removing them without --soft.\n${mainComps.map((c) => c.id.toString()).join('\\n')}`);\n }\n }\n\n getRemoveInfo(component: Component): RemoveInfo {\n const data = component.config.extensions.findExtension(RemoveAspect.id)?.config as RemoveInfo | undefined;\n return {\n removed: data?.removed || false,\n };\n }\n\n isRemoved(component: Component): boolean {\n return this.getRemoveInfo(component).removed;\n }\n\n /**\n * performant version of isRemoved() in case the component object is not available and loading it is expensive.\n */\n async isRemovedByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n if (!componentId.hasVersion()) return false;\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId);\n if (bitmapEntry && bitmapEntry.isRemoved()) return true;\n if (bitmapEntry && bitmapEntry.isRecovered()) return false;\n const modelComp = await this.workspace.scope.getBitObjectModelComponent(componentId);\n if (!modelComp) return false;\n const versionObj = await this.workspace.scope.getBitObjectVersion(modelComp, componentId.version);\n if (!versionObj) return false;\n return versionObj.isRemoved();\n }\n\n /**\n * get components that were soft-removed and tagged/snapped/merged but not exported yet.\n */\n async getRemovedStaged(): Promise<ComponentID[]> {\n return this.workspace.isOnMain() ? this.getRemovedStagedFromMain() : this.getRemovedStagedFromLane();\n }\n\n async addRemovedDependenciesIssues(components: Component[]) {\n await pMapSeries(components, async (component) => {\n await this.addRemovedDepIssue(component);\n });\n }\n\n private async addRemovedDepIssue(component: Component) {\n const dependencies = await this.depResolver.getComponentDependencies(component);\n const removedWithUndefined = await Promise.all(\n dependencies.map(async (dep) => {\n const isRemoved = await this.isRemovedByIdWithoutLoadingComponent(dep.componentId);\n if (isRemoved) return dep.componentId;\n return undefined;\n })\n );\n const removed = compact(removedWithUndefined).map((id) => id.toString());\n if (removed.length) {\n component.state.issues.getOrCreate(IssuesClasses.RemovedDependencies).data = removed;\n }\n }\n\n private async getRemovedStagedFromMain(): Promise<ComponentID[]> {\n const stagedConfig = await this.workspace.scope.getStagedConfig();\n return stagedConfig\n .getAll()\n .filter((compConfig) => compConfig.config?.[RemoveAspect.id]?.removed)\n .map((compConfig) => compConfig.id);\n }\n\n private async getRemovedStagedFromLane(): Promise<ComponentID[]> {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return [];\n const laneIds = currentLane.toBitIds();\n const workspaceIds = await this.workspace.listIds();\n const laneIdsNotInWorkspace = laneIds.filter(\n (id) => !workspaceIds.find((wId) => wId._legacy.isEqualWithoutVersion(id))\n );\n if (!laneIdsNotInWorkspace.length) return [];\n const laneCompIdsNotInWorkspace = await this.workspace.scope.resolveMultipleComponentIds(laneIdsNotInWorkspace);\n const comps = await this.workspace.scope.getMany(laneCompIdsNotInWorkspace);\n const removed = comps.filter((c) => this.isRemoved(c));\n const staged = await Promise.all(\n removed.map(async (c) => {\n const snapDistance = await this.workspace.scope.getSnapDistance(c.id, false);\n if (snapDistance.err) {\n this.logger.warn(\n `getRemovedStagedFromLane unable to get snapDistance for ${c.id.toString()} due to ${snapDistance.err.name}`\n );\n // todo: not clear what should be done here. should we consider it as removed-staged or not.\n }\n if (snapDistance.isSourceAhead()) return c.id;\n return undefined;\n })\n );\n return compact(staged);\n }\n\n private async getLocalBitIdsToRemove(componentsPattern: string): Promise<BitId[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n return componentIds.map((id) => id._legacy);\n }\n\n private async getRemoteBitIdsToRemove(componentsPattern: string): Promise<BitId[]> {\n if (hasWildcard(componentsPattern)) {\n return getRemoteBitIdsByWildcards(componentsPattern);\n }\n return [BitId.parse(componentsPattern, true)];\n }\n\n static slots = [];\n static dependencies = [\n WorkspaceAspect,\n CLIAspect,\n LoggerAspect,\n ComponentAspect,\n ImporterAspect,\n DependencyResolverAspect,\n IssuesAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([workspace, cli, loggerMain, componentAspect, importerMain, depResolver, issues]: [\n Workspace,\n CLIMain,\n LoggerMain,\n ComponentMain,\n ImporterMain,\n DependencyResolverMain,\n IssuesMain\n ]) {\n const logger = loggerMain.createLogger(RemoveAspect.id);\n const removeMain = new RemoveMain(workspace, logger, importerMain, depResolver);\n issues.registerAddComponentsIssues(removeMain.addRemovedDependenciesIssues.bind(removeMain));\n componentAspect.registerShowFragments([new RemoveFragment(removeMain)]);\n cli.register(\n new RemoveCmd(removeMain, workspace),\n new DeleteCmd(removeMain, workspace),\n new RecoverCmd(removeMain)\n );\n return removeMain;\n }\n}\n\nRemoveAspect.addRuntime(RemoveMain);\n\nexport default RemoveMain;\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAH,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,aAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,MAAA,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;AAAA;AACA,SAAAQ,UAAA;EAAA,MAAAR,IAAA,GAAAS,sB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SNmB,UAAU,kBAkSC,CACpB6K,oBAAe,EACfC,gBAAS,EACTC,sBAAY,EACZC,oBAAe,EACfC,mBAAc,EACdC,8CAAwB,EACxBC,iBAAY,CACb;AAAAtM,eAAA,CA1SUmB,UAAU,aA2SJoL,kBAAW;AAwB9BvI,sBAAY,CAACwI,UAAU,CAACrL,UAAU,CAAC;AAAC,IAAAsL,QAAA,GAErBtL,UAAU;AAAA4K,OAAA,CAAAnN,OAAA,GAAA6N,QAAA"}
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_logger","_workspace","_interopRequireWildcard","_legacyBitId","_bitId","_exceptions","_importer","_interopRequireDefault","_lodash","_hasWildcard","_listScope","_bitError","_deleteComponentFiles","_dependencyResolver","_componentIssues","_issues","_pMapSeries","_component","_exceptions2","_packageJsonUtils","_removeCmd","_removeComponents","_remove","_remove2","_recoverCmd","_deleteCmd","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_defineProperty","value","_toPropertyKey","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","BEFORE_REMOVE","RemoveMain","constructor","workspace","logger","importer","depResolver","remove","componentsPattern","force","remote","track","deleteFiles","fromLane","_this$workspace","setStatusLine","bitIds","getRemoteBitIdsToRemove","getLocalBitIdsToRemove","consumer","removeResults","removeComponents","ids","BitIds","fromArray","onDestroy","removeLocallyByIds","OutsideWorkspaceError","results","bitMap","write","markRemoveComps","componentIds","shouldUpdateMain","components","getMany","removeComponentsFromNodeModules","map","c","state","_consumer","config","removed","removeOnMain","compId","addComponentConfig","RemoveAspect","id","_legacy","deleteComponentsFiles","deleteComps","opts","ConsumerNotFound","idsByPattern","newComps","filter","hasVersion","length","BitError","toString","join","currentLane","getCurrentLaneObject","updateMain","isNew","Error","recover","compIdStr","options","bitMapEntry","find","compMap","name","toStringWithoutVersion","importComp","idStr","import","installNpmPackages","skipDependencyInstallation","override","setAsRemovedFalse","addSpecificComponentConfig","_bitMapEntry$config","_bitMapEntry$config2","resolveComponentId","comp","isRemoved","scope","idOnLane","getComponent","compIdWithPossibleVer","changeVersion","head","compFromScope","err","VersionNotFound","version","getRemoteComponent","throwForMainComponentWhenOnLane","laneComps","toBitIds","mainComps","hasWithoutVersion","getRemoveInfo","component","_component$config$ext","extensions","findExtension","isRemovedByIdWithoutLoadingComponent","componentId","bitmapEntry","getBitmapEntryIfExist","isRecovered","modelComp","getBitObjectModelComponent","versionObj","getBitObjectVersion","getRemovedStaged","isOnMain","getRemovedStagedFromMain","getRemovedStagedFromLane","addRemovedDependenciesIssues","pMapSeries","addRemovedDepIssue","dependencies","getComponentDependencies","removedWithUndefined","Promise","all","dep","compact","issues","getOrCreate","IssuesClasses","RemovedDependencies","stagedConfig","getStagedConfig","getAll","compConfig","_compConfig$config","laneIds","workspaceIds","listIds","laneIdsNotInWorkspace","wId","isEqualWithoutVersion","laneCompIdsNotInWorkspace","resolveMultipleComponentIds","comps","staged","snapDistance","getSnapDistance","warn","isSourceAhead","hasWildcard","getRemoteBitIdsByWildcards","BitId","parse","provider","cli","loggerMain","componentAspect","importerMain","createLogger","removeMain","registerAddComponentsIssues","bind","registerShowFragments","RemoveFragment","register","RemoveCmd","DeleteCmd","RecoverCmd","exports","WorkspaceAspect","CLIAspect","LoggerAspect","ComponentAspect","ImporterAspect","DependencyResolverAspect","IssuesAspect","MainRuntime","addRuntime","_default"],"sources":["remove.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport ImporterAspect, { ImporterMain } from '@teambit/importer';\nimport { compact } from 'lodash';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport { getRemoteBitIdsByWildcards } from '@teambit/legacy/dist/api/consumer/lib/list-scope';\nimport { ComponentID } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport deleteComponentsFiles from '@teambit/legacy/dist/consumer/component-ops/delete-component-files';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport IssuesAspect, { IssuesMain } from '@teambit/issues';\nimport pMapSeries from 'p-map-series';\nimport ComponentAspect, { Component, ComponentMain } from '@teambit/component';\nimport { VersionNotFound } from '@teambit/legacy/dist/scope/exceptions';\nimport { removeComponentsFromNodeModules } from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport { RemoveCmd } from './remove-cmd';\nimport { 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';\n\nconst BEFORE_REMOVE = 'removing components';\n\nexport type RemoveInfo = {\n removed: boolean;\n /**\n * whether to remove the component from default lane once merged\n */\n removeOnMain?: boolean;\n};\n\nexport class RemoveMain {\n constructor(\n private workspace: Workspace,\n public logger: Logger,\n private importer: ImporterMain,\n private depResolver: DependencyResolverMain\n ) {}\n\n async remove({\n componentsPattern,\n force = false,\n remote = false,\n track = false,\n deleteFiles = true,\n fromLane = false,\n }: {\n componentsPattern: string;\n force?: boolean;\n remote?: boolean;\n track?: boolean;\n deleteFiles?: boolean;\n fromLane?: boolean;\n }): Promise<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 consumer,\n ids: BitIds.fromArray(bitIds),\n force,\n remote,\n track,\n deleteFiles,\n fromLane,\n });\n if (consumer) await consumer.onDestroy();\n return removeResults;\n }\n\n /**\n * remove components from the workspace.\n */\n async removeLocallyByIds(ids: BitId[], { force = false }: { force?: boolean } = {}) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const results = await removeComponents({\n consumer: this.workspace.consumer,\n ids: BitIds.fromArray(ids),\n force,\n remote: false,\n track: false,\n deleteFiles: true,\n fromLane: false,\n });\n await this.workspace.bitMap.write();\n\n return results;\n }\n\n async markRemoveComps(componentIds: ComponentID[], shouldUpdateMain = false) {\n const components = await this.workspace.getMany(componentIds);\n await removeComponentsFromNodeModules(\n this.workspace.consumer,\n components.map((c) => c.state._consumer)\n );\n // don't use `this.workspace.addSpecificComponentConfig`, if the component has component.json it will be deleted\n // during this removal along with the entire component dir.\n const config: RemoveInfo = { removed: true };\n if (shouldUpdateMain) config.removeOnMain = true;\n componentIds.map((compId) => this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, config));\n await this.workspace.bitMap.write();\n const bitIds = BitIds.fromArray(componentIds.map((id) => id._legacy));\n await deleteComponentsFiles(this.workspace.consumer, bitIds);\n\n return componentIds;\n }\n\n async deleteComps(componentsPattern: string, opts: { updateMain?: boolean } = {}): Promise<ComponentID[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n const newComps = componentIds.filter((id) => !id.hasVersion());\n if (newComps.length) {\n throw new BitError(\n `no need to delete the following new component(s), please remove them by \"bit remove\"\\n${newComps\n .map((id) => id.toString())\n .join('\\n')}`\n );\n }\n const currentLane = await this.workspace.getCurrentLaneObject();\n const { updateMain } = opts;\n if (!updateMain && currentLane?.isNew) {\n throw new Error(\n 'no need to delete components from an un-exported lane, you can remove them by running \"bit remove\"'\n );\n }\n\n return this.markRemoveComps(componentIds, updateMain);\n }\n\n /**\n * recover a soft-removed component.\n * there are 4 different scenarios.\n * 1. a component was just soft-removed, it wasn't snapped yet. so it's now in .bitmap with the \"removed\" aspect entry.\n * 2. soft-removed and then snapped. It's not in .bitmap now.\n * 3. soft-removed, snapped, exported. it's not in .bitmap now.\n * 4. a soft-removed components was imported, so it's now in .bitmap without the \"removed\" aspect entry.\n * 5. workspace is empty. the soft-removed component is on the remote.\n * returns `true` if it was recovered. `false` if the component wasn't soft-removed, so nothing to recover from.\n */\n async recover(compIdStr: string, options: RecoverOptions): Promise<boolean> {\n if (!this.workspace) throw new ConsumerNotFound();\n const bitMapEntry = this.workspace.consumer.bitMap.components.find((compMap) => {\n return compMap.id.name === compIdStr || compMap.id.toStringWithoutVersion() === compIdStr;\n });\n const importComp = async (idStr: string) => {\n await this.importer.import({\n ids: [idStr],\n installNpmPackages: !options.skipDependencyInstallation,\n override: true,\n });\n };\n const setAsRemovedFalse = async (compId: ComponentID) => {\n await this.workspace.addSpecificComponentConfig(compId, RemoveAspect.id, { removed: false });\n await this.workspace.bitMap.write();\n };\n if (bitMapEntry) {\n if (bitMapEntry.config?.[RemoveAspect.id]) {\n // case #1\n delete bitMapEntry.config?.[RemoveAspect.id];\n await importComp(bitMapEntry.id.toString());\n return true;\n }\n // case #4\n const compId = await this.workspace.resolveComponentId(bitMapEntry.id);\n const comp = await this.workspace.get(compId);\n if (!this.isRemoved(comp)) {\n return false;\n }\n await setAsRemovedFalse(compId);\n return true;\n }\n const compId = await this.workspace.scope.resolveComponentId(compIdStr);\n const currentLane = await this.workspace.getCurrentLaneObject();\n const idOnLane = currentLane?.getComponent(compId._legacy);\n const compIdWithPossibleVer = idOnLane ? compId.changeVersion(idOnLane.head.toString()) : compId;\n let compFromScope: Component | undefined;\n try {\n compFromScope = await this.workspace.scope.get(compIdWithPossibleVer);\n } catch (err: any) {\n if (err instanceof VersionNotFound && err.version === '0.0.0') {\n throw new BitError(\n `unable to find the component ${compIdWithPossibleVer.toString()} in the current lane or main`\n );\n }\n throw err;\n }\n if (compFromScope && this.isRemoved(compFromScope)) {\n // case #2 and #3\n await importComp(compIdWithPossibleVer._legacy.toString());\n await setAsRemovedFalse(compIdWithPossibleVer);\n return true;\n }\n // case #5\n const comp = await this.workspace.scope.getRemoteComponent(compId);\n if (!this.isRemoved(comp)) {\n return false;\n }\n await importComp(compId._legacy.toString());\n await setAsRemovedFalse(compId);\n\n return true;\n }\n\n private async throwForMainComponentWhenOnLane(components: Component[]) {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return; // user on main\n const laneComps = currentLane.toBitIds();\n const mainComps = components.filter((comp) => !laneComps.hasWithoutVersion(comp.id._legacy));\n if (mainComps.length) {\n throw new BitError(`the following components belong to main, they cannot be soft-removed when on a lane. consider removing them without --soft.\n${mainComps.map((c) => c.id.toString()).join('\\n')}`);\n }\n }\n\n getRemoveInfo(component: Component): RemoveInfo {\n const data = component.config.extensions.findExtension(RemoveAspect.id)?.config as RemoveInfo | undefined;\n return {\n removed: data?.removed || false,\n };\n }\n\n isRemoved(component: Component): boolean {\n return this.getRemoveInfo(component).removed;\n }\n\n /**\n * performant version of isRemoved() in case the component object is not available and loading it is expensive.\n */\n async isRemovedByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n if (!componentId.hasVersion()) return false;\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId);\n if (bitmapEntry && bitmapEntry.isRemoved()) return true;\n if (bitmapEntry && bitmapEntry.isRecovered()) return false;\n const modelComp = await this.workspace.scope.getBitObjectModelComponent(componentId);\n if (!modelComp) return false;\n const versionObj = await this.workspace.scope.getBitObjectVersion(modelComp, componentId.version);\n if (!versionObj) return false;\n return versionObj.isRemoved();\n }\n\n /**\n * get components that were soft-removed and tagged/snapped/merged but not exported yet.\n */\n async getRemovedStaged(): Promise<ComponentID[]> {\n return this.workspace.isOnMain() ? this.getRemovedStagedFromMain() : this.getRemovedStagedFromLane();\n }\n\n async addRemovedDependenciesIssues(components: Component[]) {\n await pMapSeries(components, async (component) => {\n await this.addRemovedDepIssue(component);\n });\n }\n\n private async addRemovedDepIssue(component: Component) {\n const dependencies = await this.depResolver.getComponentDependencies(component);\n const removedWithUndefined = await Promise.all(\n dependencies.map(async (dep) => {\n const isRemoved = await this.isRemovedByIdWithoutLoadingComponent(dep.componentId);\n if (isRemoved) return dep.componentId;\n return undefined;\n })\n );\n const removed = compact(removedWithUndefined).map((id) => id.toString());\n if (removed.length) {\n component.state.issues.getOrCreate(IssuesClasses.RemovedDependencies).data = removed;\n }\n }\n\n private async getRemovedStagedFromMain(): Promise<ComponentID[]> {\n const stagedConfig = await this.workspace.scope.getStagedConfig();\n return stagedConfig\n .getAll()\n .filter((compConfig) => compConfig.config?.[RemoveAspect.id]?.removed)\n .map((compConfig) => compConfig.id);\n }\n\n private async getRemovedStagedFromLane(): Promise<ComponentID[]> {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return [];\n const laneIds = currentLane.toBitIds();\n const workspaceIds = await this.workspace.listIds();\n const laneIdsNotInWorkspace = laneIds.filter(\n (id) => !workspaceIds.find((wId) => wId._legacy.isEqualWithoutVersion(id))\n );\n if (!laneIdsNotInWorkspace.length) return [];\n const laneCompIdsNotInWorkspace = await this.workspace.scope.resolveMultipleComponentIds(laneIdsNotInWorkspace);\n const comps = await this.workspace.scope.getMany(laneCompIdsNotInWorkspace);\n const removed = comps.filter((c) => this.isRemoved(c));\n const staged = await Promise.all(\n removed.map(async (c) => {\n const snapDistance = await this.workspace.scope.getSnapDistance(c.id, false);\n if (snapDistance.err) {\n this.logger.warn(\n `getRemovedStagedFromLane unable to get snapDistance for ${c.id.toString()} due to ${snapDistance.err.name}`\n );\n // todo: not clear what should be done here. should we consider it as removed-staged or not.\n }\n if (snapDistance.isSourceAhead()) return c.id;\n return undefined;\n })\n );\n return compact(staged);\n }\n\n private async getLocalBitIdsToRemove(componentsPattern: string): Promise<BitId[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n return componentIds.map((id) => id._legacy);\n }\n\n private async getRemoteBitIdsToRemove(componentsPattern: string): Promise<BitId[]> {\n if (hasWildcard(componentsPattern)) {\n return getRemoteBitIdsByWildcards(componentsPattern);\n }\n return [BitId.parse(componentsPattern, true)];\n }\n\n static slots = [];\n static dependencies = [\n WorkspaceAspect,\n CLIAspect,\n LoggerAspect,\n ComponentAspect,\n ImporterAspect,\n DependencyResolverAspect,\n IssuesAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([workspace, cli, loggerMain, componentAspect, importerMain, depResolver, issues]: [\n Workspace,\n CLIMain,\n LoggerMain,\n ComponentMain,\n ImporterMain,\n DependencyResolverMain,\n IssuesMain\n ]) {\n const logger = loggerMain.createLogger(RemoveAspect.id);\n const removeMain = new RemoveMain(workspace, logger, importerMain, depResolver);\n issues.registerAddComponentsIssues(removeMain.addRemovedDependenciesIssues.bind(removeMain));\n componentAspect.registerShowFragments([new RemoveFragment(removeMain)]);\n cli.register(\n new RemoveCmd(removeMain, workspace),\n new DeleteCmd(removeMain, workspace),\n new RecoverCmd(removeMain)\n );\n return removeMain;\n }\n}\n\nRemoveAspect.addRuntime(RemoveMain);\n\nexport default RemoveMain;\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAH,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,aAAA;EAA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U,CAAC,CAAC;IAC5FH,eAAe,CAACM,qBAAqB,CAAC,CAAC,KAAIC,yBAAc,EAACJ,UAAU,CAAC,CAAC,CAAC;IACvEL,GAAG,CAACU,QAAQ,CACV,KAAIC,sBAAS,EAACN,UAAU,EAAEjK,SAAS,CAAC,EACpC,KAAIwK,sBAAS,EAACP,UAAU,EAAEjK,SAAS,CAAC,EACpC,KAAIyK,wBAAU,EAACR,UAAU,CAC3B,CAAC;IACD,OAAOA,UAAU;EACnB;AACF;AAACS,OAAA,CAAA5K,UAAA,GAAAA,UAAA;AAAAnB,eAAA,CAjUYmB,UAAU,WAiSN,EAAE;AAAAnB,eAAA,CAjSNmB,UAAU,kBAkSC,CACpB6K,oBAAe,EACfC,gBAAS,EACTC,sBAAY,EACZC,oBAAe,EACfC,mBAAc,EACdC,8CAAwB,EACxBC,iBAAY,CACb;AAAAtM,eAAA,CA1SUmB,UAAU,aA2SJoL,kBAAW;AAwB9BvI,sBAAY,CAACwI,UAAU,CAACrL,UAAU,CAAC;AAAC,IAAAsL,QAAA,GAErBtL,UAAU;AAAA4K,OAAA,CAAAnN,OAAA,GAAA6N,QAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BitIds } from '@teambit/legacy/dist/bit-id';
|
|
2
|
+
import RemovedObjects from '@teambit/legacy/dist/scope/removed-components';
|
|
3
|
+
export default class RemovedLocalObjects extends RemovedObjects {
|
|
4
|
+
modifiedComponents: BitIds;
|
|
5
|
+
constructor(removedComponentIds?: BitIds, missingComponents?: BitIds, modifiedComponents?: BitIds, dependentBits?: Record<string, any>, removedFromLane?: BitIds);
|
|
6
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
function _removedComponents() {
|
|
8
|
+
const data = _interopRequireDefault(require("@teambit/legacy/dist/scope/removed-components"));
|
|
9
|
+
_removedComponents = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
17
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
18
|
+
class RemovedLocalObjects extends _removedComponents().default {
|
|
19
|
+
constructor(removedComponentIds, missingComponents, modifiedComponents, dependentBits, removedFromLane) {
|
|
20
|
+
super({
|
|
21
|
+
removedComponentIds,
|
|
22
|
+
missingComponents,
|
|
23
|
+
dependentBits,
|
|
24
|
+
removedFromLane
|
|
25
|
+
});
|
|
26
|
+
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
27
|
+
_defineProperty(this, "modifiedComponents", void 0);
|
|
28
|
+
this.modifiedComponents = modifiedComponents;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.default = RemovedLocalObjects;
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=removed-local-objects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_removedComponents","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","RemovedLocalObjects","RemovedObjects","constructor","removedComponentIds","missingComponents","modifiedComponents","dependentBits","removedFromLane","exports"],"sources":["removed-local-objects.ts"],"sourcesContent":["import { BitIds } from '@teambit/legacy/dist/bit-id';\nimport RemovedObjects from '@teambit/legacy/dist/scope/removed-components';\n\nexport default class RemovedLocalObjects extends RemovedObjects {\n modifiedComponents: BitIds;\n constructor(\n removedComponentIds?: BitIds,\n missingComponents?: BitIds,\n modifiedComponents?: BitIds,\n dependentBits?: Record<string, any>,\n removedFromLane?: BitIds\n ) {\n super({ removedComponentIds, missingComponents, dependentBits, removedFromLane });\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n this.modifiedComponents = modifiedComponents;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2E,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;AAAA,SAAAM,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA,EAAAT,KAAA;AAE5D,MAAMU,mBAAmB,SAASC,4BAAc,CAAC;EAE9DC,WAAWA,CACTC,mBAA4B,EAC5BC,iBAA0B,EAC1BC,kBAA2B,EAC3BC,aAAmC,EACnCC,eAAwB,EACxB;IACA,KAAK,CAAC;MAAEJ,mBAAmB;MAAEC,iBAAiB;MAAEE,aAAa;MAAEC;IAAgB,CAAC,CAAC;IACjF;IAAA7B,eAAA;IACA,IAAI,CAAC2B,kBAAkB,GAAGA,kBAAkB;EAC9C;AACF;AAACG,OAAA,CAAA/B,OAAA,GAAAuB,mBAAA"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/remove",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
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.6"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"@teambit/harmony": "0.4.6",
|
|
23
23
|
"@teambit/component-id": "0.0.427",
|
|
24
24
|
"@teambit/bit-error": "0.0.404",
|
|
25
|
-
"@teambit/cli": "0.0.
|
|
26
|
-
"@teambit/workspace": "1.0.
|
|
27
|
-
"@teambit/component": "1.0.
|
|
25
|
+
"@teambit/cli": "0.0.788",
|
|
26
|
+
"@teambit/workspace": "1.0.6",
|
|
27
|
+
"@teambit/component": "1.0.6",
|
|
28
28
|
"@teambit/component-issues": "0.0.97",
|
|
29
|
-
"@teambit/dependency-resolver": "1.0.
|
|
30
|
-
"@teambit/importer": "1.0.
|
|
31
|
-
"@teambit/issues": "1.0.
|
|
32
|
-
"@teambit/logger": "0.0.
|
|
29
|
+
"@teambit/dependency-resolver": "1.0.6",
|
|
30
|
+
"@teambit/importer": "1.0.6",
|
|
31
|
+
"@teambit/issues": "1.0.6",
|
|
32
|
+
"@teambit/logger": "0.0.881"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/lodash": "4.14.165",
|
|
File without changes
|