@teambit/remove 1.0.666 → 1.0.668
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.d.ts +3 -3
- package/dist/delete-cmd.js.map +1 -1
- package/dist/delete-component-files.d.ts +2 -2
- package/dist/delete-component-files.js.map +1 -1
- package/dist/recover-cmd.d.ts +2 -2
- package/dist/recover-cmd.js.map +1 -1
- package/dist/remove-cmd.d.ts +3 -3
- package/dist/remove-cmd.js.map +1 -1
- package/dist/remove-components.d.ts +3 -3
- package/dist/remove-components.js.map +1 -1
- package/dist/remove-template.js.map +1 -1
- package/dist/remove.fragment.d.ts +2 -2
- package/dist/remove.fragment.js.map +1 -1
- package/dist/remove.main.runtime.d.ts +11 -11
- package/dist/remove.main.runtime.js.map +1 -1
- package/dist/removed-local-objects.d.ts +1 -1
- package/dist/removed-local-objects.js.map +1 -1
- package/package.json +19 -19
- /package/dist/{preview-1753803956605.js → preview-1753833698619.js} +0 -0
package/dist/delete-cmd.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
-
import { Workspace } from '@teambit/workspace';
|
|
3
|
-
import { RemoveMain } from './remove.main.runtime';
|
|
1
|
+
import type { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
+
import type { Workspace } from '@teambit/workspace';
|
|
3
|
+
import type { RemoveMain } from './remove.main.runtime';
|
|
4
4
|
export declare class DeleteCmd implements Command {
|
|
5
5
|
private remove;
|
|
6
6
|
private workspace?;
|
package/dist/delete-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_legacy","_removeTemplate","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DeleteCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","report","componentsPattern","force","lane","updateMain","hard","silent","range","snaps","isOnLane","BitError","isOnMain","removePrompt","localResult","remoteResult","remote","localMessage","removeTemplate","paintArray","deleteOpts","split","map","s","trim","filter","Boolean","removedComps","deleteComps","removedCompIds","comp","id","toString","chalk","green","join","bold","removedObjectsArray","item","logger","clearStatusLine","laneOrMainWarning","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.scope';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.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.\nunless the '--hard' flag is used (not recommended!), in which case, the component will be deleted from the remote scope immediately.\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', 'delete component/s on the main lane after merging this lane into main'],\n [\n '',\n 'range <string>',\n 'EXPERIMENTAL. enter a Semver range to delete specific tags (cannot be used for snaps). see https://www.npmjs.com/package/semver#ranges for the range syntax',\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 [\n 'f',\n 'force',\n 'relevant for --hard. allow the deletion even if used as a dependency. WARNING: components that depend on this component will corrupt',\n ],\n ['', 'snaps <string>', 'comma-separated list of snap hashes to mark as deleted (e.g. --snaps \"hash1,hash2,hash3\")'],\n ] as CommandOptions;\n loader = true;\n remoteOp = true;\n\n constructor(\n private remove: RemoveMain,\n private workspace?: Workspace\n ) {}\n\n async report(\n [componentsPattern]: [string],\n {\n force = false,\n lane = false,\n updateMain = false,\n hard = false,\n silent = false,\n range,\n snaps,\n }: {\n force?: boolean;\n lane?: boolean;\n updateMain?: boolean;\n hard?: boolean;\n silent?: boolean;\n range?: string;\n snaps?: string;\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, lane);\n }\n\n if (hard) {\n if (range) throw new BitError(`--range is not supported with --hard flag`);\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 deleteOpts: any = { updateMain, range };\n if (snaps) {\n deleteOpts.snaps = snaps\n .split(',')\n .map((s) => s.trim())\n .filter(Boolean);\n }\n const removedComps = await this.remove.deleteComps(componentsPattern, deleteOpts);\n const removedCompIds = removedComps.map((comp) => comp.id.toString());\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, lane?: boolean) {\n this.remove.logger.clearStatusLine();\n const laneOrMainWarning = lane\n ? `this command will mark the component as removed from this lane, resetting the component to its pre-lane state and content (after tag/snap and export)`\n : `this command will mark the component as deleted, and it won’t be visible on the remote scope (after tag/snap and export).`;\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 soft deleted`\n : `${laneOrMainWarning}\nif your intent is to remove the component only from your local workspace, refer to bit remove or bit eject.`;\n\n const ok = await yesno({\n question: `${remoteOrLocalOutput}\n${chalk.bold('Would you like to proceed? [yes(y)/no(n)]')}`,\n });\n if (!ok) {\n throw new BitError('the operation has been canceled');\n }\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,gBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,eAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAmD,SAAAC,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAA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IAAAC,gBAAK,EAAC;MACrBC,QAAQ,EAAE,GAAGH,mBAAmB;AACtC,EAAET,gBAAK,CAACG,IAAI,CAAC,2CAA2C,CAAC;IACrD,CAAC,CAAC;IACF,IAAI,CAACO,EAAE,EAAE;MACP,MAAM,KAAIhC,oBAAQ,EAAC,iCAAiC,CAAC;IACvD;EACF;AACF;AAACmC,OAAA,CAAApD,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_legacy","_removeTemplate","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DeleteCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","report","componentsPattern","force","lane","updateMain","hard","silent","range","snaps","isOnLane","BitError","isOnMain","removePrompt","localResult","remoteResult","remote","localMessage","removeTemplate","paintArray","deleteOpts","split","map","s","trim","filter","Boolean","removedComps","deleteComps","removedCompIds","comp","id","toString","chalk","green","join","bold","removedObjectsArray","item","logger","clearStatusLine","laneOrMainWarning","remoteOrLocalOutput","ok","yesno","question","exports"],"sources":["delete-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport yesno from 'yesno';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport type { RemovedObjects } from '@teambit/legacy.scope';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { 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.\nunless the '--hard' flag is used (not recommended!), in which case, the component will be deleted from the remote scope immediately.\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', 'delete component/s on the main lane after merging this lane into main'],\n [\n '',\n 'range <string>',\n 'EXPERIMENTAL. enter a Semver range to delete specific tags (cannot be used for snaps). see https://www.npmjs.com/package/semver#ranges for the range syntax',\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 [\n 'f',\n 'force',\n 'relevant for --hard. allow the deletion even if used as a dependency. WARNING: components that depend on this component will corrupt',\n ],\n ['', 'snaps <string>', 'comma-separated list of snap hashes to mark as deleted (e.g. --snaps \"hash1,hash2,hash3\")'],\n ] as CommandOptions;\n loader = true;\n remoteOp = true;\n\n constructor(\n private remove: RemoveMain,\n private workspace?: Workspace\n ) {}\n\n async report(\n [componentsPattern]: [string],\n {\n force = false,\n lane = false,\n updateMain = false,\n hard = false,\n silent = false,\n range,\n snaps,\n }: {\n force?: boolean;\n lane?: boolean;\n updateMain?: boolean;\n hard?: boolean;\n silent?: boolean;\n range?: string;\n snaps?: string;\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, lane);\n }\n\n if (hard) {\n if (range) throw new BitError(`--range is not supported with --hard flag`);\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 deleteOpts: any = { updateMain, range };\n if (snaps) {\n deleteOpts.snaps = snaps\n .split(',')\n .map((s) => s.trim())\n .filter(Boolean);\n }\n const removedComps = await this.remove.deleteComps(componentsPattern, deleteOpts);\n const removedCompIds = removedComps.map((comp) => comp.id.toString());\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, lane?: boolean) {\n this.remove.logger.clearStatusLine();\n const laneOrMainWarning = lane\n ? `this command will mark the component as removed from this lane, resetting the component to its pre-lane state and content (after tag/snap and export)`\n : `this command will mark the component as deleted, and it won’t be visible on the remote scope (after tag/snap and export).`;\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 soft deleted`\n : `${laneOrMainWarning}\nif your intent is to remove the component only from your local workspace, refer to bit remove or bit eject.`;\n\n const ok = await yesno({\n question: `${remoteOrLocalOutput}\n${chalk.bold('Would you like to proceed? [yes(y)/no(n)]')}`,\n });\n if (!ok) {\n throw new BitError('the operation has been canceled');\n }\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;E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4FAA4F,CAAC,EAAE;EAC1G;EAEQjB,UAAUA,CAACkB,mBAAqC,EAAE;IACxD,OAAOA,mBAAmB,CAACf,GAAG,CAAEgB,IAAI,IAAK,IAAApB,gCAAc,EAACoB,IAAI,EAAE,IAAI,CAAC,CAAC;EACtE;EAEA,MAAczB,YAAYA,CAACP,IAAc,EAAEF,IAAc,EAAE;IACzD,IAAI,CAACR,MAAM,CAAC2C,MAAM,CAACC,eAAe,CAAC,CAAC;IACpC,MAAMC,iBAAiB,GAAGrC,IAAI,GAC1B,uJAAuJ,GACvJ,2HAA2H;IAC/H,MAAMsC,mBAAmB,GAAGpC,IAAI,GAC5B,oKAAoK,GACpK,GAAGmC,iBAAiB;AAC5B,4GAA4G;IAExG,MAAME,EAAE,GAAG,MAAM,IAAAC,gBAAK,EAAC;MACrBC,QAAQ,EAAE,GAAGH,mBAAmB;AACtC,EAAET,gBAAK,CAACG,IAAI,CAAC,2CAA2C,CAAC;IACrD,CAAC,CAAC;IACF,IAAI,CAACO,EAAE,EAAE;MACP,MAAM,KAAIhC,oBAAQ,EAAC,iCAAiC,CAAC;IACvD;EACF;AACF;AAACmC,OAAA,CAAApD,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ComponentIdList } from '@teambit/component-id';
|
|
2
|
-
import { Consumer } from '@teambit/legacy.consumer';
|
|
1
|
+
import type { ComponentIdList } from '@teambit/component-id';
|
|
2
|
+
import type { Consumer } from '@teambit/legacy.consumer';
|
|
3
3
|
export declare function deleteComponentsFiles(consumer: Consumer, bitIds: ComponentIdList): Promise<void>;
|
|
@@ -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 { ComponentIdList } from '@teambit/component-id';\nimport { logger } from '@teambit/legacy.logger';\nimport { DataToPersist, RemovePath } from '@teambit/component.sources';\nimport { 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","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":[]}
|
package/dist/recover-cmd.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
-
import { RemoveMain } from './remove.main.runtime';
|
|
1
|
+
import type { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
+
import type { RemoveMain } from './remove.main.runtime';
|
|
3
3
|
export type RecoverOptions = {
|
|
4
4
|
skipDependencyInstallation?: boolean;
|
|
5
5
|
skipWriteConfigFiles?: boolean;
|
package/dist/recover-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_bitError","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RecoverCmd","constructor","remove","report","componentName","options","hasRecovered","recover","BitError","chalk","green","exports"],"sources":["recover-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { BitError } from '@teambit/bit-error';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { RemoveMain } from './remove.main.runtime';\n\nexport type RecoverOptions = {\n skipDependencyInstallation?: boolean;\n skipWriteConfigFiles?: boolean;\n};\n\nexport class RecoverCmd implements Command {\n name = 'recover <component-name>';\n description = 'recover component(s) soft-deleted from the workspace, or a remote scope';\n group = 'collaborate';\n options = [\n ['x', 'skip-dependency-installation', 'do not install packages in case of importing components'],\n ['', 'skip-write-config-files', 'do not write config files (such as eslint, tsconfig, prettier, etc...)'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private remove: RemoveMain) {}\n\n async report([componentName]: [string], options: RecoverOptions) {\n const hasRecovered = await this.remove.recover(componentName, options);\n if (!hasRecovered) {\n throw new BitError(`component ${componentName} was not soft-deleted, nothing to recover`);\n }\n return chalk.green(`successfully recovered ${componentName}`);\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,UAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AASvC,MAAMgB,UAAU,CAAoB;EAUzCC,WAAWA,CAASC,MAAkB,EAAE;IAAA,KAApBA,MAAkB,GAAlBA,MAAkB;IAAApB,eAAA,eAT/B,0BAA0B;IAAAA,eAAA,sBACnB,yEAAyE;IAAAA,eAAA,gBAC/E,aAAa;IAAAA,eAAA,kBACX,CACR,CAAC,GAAG,EAAE,8BAA8B,EAAE,yDAAyD,CAAC,EAChG,CAAC,EAAE,EAAE,yBAAyB,EAAE,wEAAwE,CAAC,CAC1G;IAAAA,eAAA,iBACQ,IAAI;EAE4B;EAEzC,MAAMqB,MAAMA,CAAC,CAACC,aAAa,CAAW,EAAEC,OAAuB,EAAE;IAC/D,MAAMC,YAAY,GAAG,MAAM,IAAI,CAACJ,MAAM,CAACK,OAAO,CAACH,aAAa,EAAEC,OAAO,CAAC;IACtE,IAAI,CAACC,YAAY,EAAE;MACjB,MAAM,KAAIE,oBAAQ,EAAC,aAAaJ,aAAa,2CAA2C,CAAC;IAC3F;IACA,OAAOK,gBAAK,CAACC,KAAK,CAAC,0BAA0BN,aAAa,EAAE,CAAC;EAC/D;AACF;AAACO,OAAA,CAAAX,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_bitError","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RecoverCmd","constructor","remove","report","componentName","options","hasRecovered","recover","BitError","chalk","green","exports"],"sources":["recover-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { BitError } from '@teambit/bit-error';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { RemoveMain } from './remove.main.runtime';\n\nexport type RecoverOptions = {\n skipDependencyInstallation?: boolean;\n skipWriteConfigFiles?: boolean;\n};\n\nexport class RecoverCmd implements Command {\n name = 'recover <component-name>';\n description = 'recover component(s) soft-deleted from the workspace, or a remote scope';\n group = 'collaborate';\n options = [\n ['x', 'skip-dependency-installation', 'do not install packages in case of importing components'],\n ['', 'skip-write-config-files', 'do not write config files (such as eslint, tsconfig, prettier, etc...)'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private remove: RemoveMain) {}\n\n async report([componentName]: [string], options: RecoverOptions) {\n const hasRecovered = await this.remove.recover(componentName, options);\n if (!hasRecovered) {\n throw new BitError(`component ${componentName} was not soft-deleted, nothing to recover`);\n }\n return chalk.green(`successfully recovered ${componentName}`);\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,UAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EA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AC/D;AACF;AAACO,OAAA,CAAAX,UAAA,GAAAA,UAAA","ignoreList":[]}
|
package/dist/remove-cmd.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
-
import { Workspace } from '@teambit/workspace';
|
|
3
|
-
import { RemoveMain } from './remove.main.runtime';
|
|
1
|
+
import type { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
+
import type { Workspace } from '@teambit/workspace';
|
|
3
|
+
import type { RemoveMain } from './remove.main.runtime';
|
|
4
4
|
export declare class RemoveCmd implements Command {
|
|
5
5
|
private remove;
|
|
6
6
|
private workspace?;
|
package/dist/remove-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_legacy","_removeTemplate","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RemoveCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","cmd","report","componentsPattern","force","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.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 = 'component-development';\n helpUrl = 'reference/components/removing-components';\n skipWorkspace = true;\n alias = 'rm';\n options = [\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 examples = [\n {\n cmd: 'remove \"$deprecated\"',\n description: 'remove all components that are deprecated',\n },\n ];\n remoteOp = true;\n\n constructor(\n private remove: RemoveMain,\n private workspace?: Workspace\n ) {}\n\n async report(\n [componentsPattern]: [string],\n {\n force = false,\n track = false,\n silent = false,\n keepFiles = false,\n }: {\n force?: boolean;\n track?: 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 });\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,M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AC;IACrC;IACA,MAAM;MACJE;IAGF,CAAC,GAAG,MAAM,IAAI,CAACb,MAAM,CAACA,MAAM,CAAC;MAAEO,iBAAiB;MAAEC,KAAK;MAAEC,KAAK;MAAEK,WAAW,EAAE,CAACH;IAAU,CAAC,CAAC;IAC1F;IACA,MAAMI,YAAY,GAAG,IAAAC,gCAAc,EAACH,WAAW,EAAE,KAAK,CAAC;IACvD;IACA;IACA;IACA,OAAOE,YAAY;EACrB;EAEA,MAAcH,YAAYA,CAACE,WAAqB,EAAE;IAChD,IAAI,CAACd,MAAM,CAACiB,MAAM,CAACC,eAAe,CAAC,CAAC;IACpC,MAAMC,gBAAgB,GAAGL,WAAW,GAChC,8FAA8F,GAC9F,EAAE;IACN,MAAMM,EAAE,GAAG,MAAM,IAAAC,gBAAK,EAAC;MACrBC,QAAQ,EAAE;AAChB,oCAAoCH,gBAAgB;AACpD,EAAEI,gBAAK,CAACC,IAAI,CAAC,2CAA2C,CAAC;IACrD,CAAC,CAAC;IACF,IAAI,CAACJ,EAAE,EAAE;MACP,MAAM,KAAIK,oBAAQ,EAAC,iCAAiC,CAAC;IACvD;EACF;AACF;AAACC,OAAA,CAAA5B,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_legacy","_removeTemplate","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RemoveCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","cmd","report","componentsPattern","force","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 type { Command, CommandOptions } from '@teambit/cli';\nimport type { Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { RemovedLocalObjects } from './removed-local-objects';\nimport type { 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 = 'component-development';\n helpUrl = 'reference/components/removing-components';\n skipWorkspace = true;\n alias = 'rm';\n options = [\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 examples = [\n {\n cmd: 'remove \"$deprecated\"',\n description: 'remove all components that are deprecated',\n },\n ];\n remoteOp = true;\n\n constructor(\n private remove: RemoveMain,\n private workspace?: Workspace\n ) {}\n\n async report(\n [componentsPattern]: [string],\n {\n force = false,\n track = false,\n silent = false,\n keepFiles = false,\n }: {\n force?: boolean;\n track?: 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 });\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,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAM,gBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,eAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAmD,SAAAC,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAA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BF,WAAW,EAAE;IACf,CAAC,CACF;IAAAvB,eAAA,mBACU,IAAI;EAKZ;EAEH,MAAM0B,MAAMA,CACV,CAACC,iBAAiB,CAAW,EAC7B;IACEC,KAAK,GAAG,KAAK;IACbC,KAAK,GAAG,KAAK;IACbC,MAAM,GAAG,KAAK;IACdC,SAAS,GAAG;EAMd,CAAC,EACD;IACA,IAAI,CAACD,MAAM,EAAE;MACX,MAAM,IAAI,CAACE,YAAY,CAAC,CAACD,SAAS,CAAC;IACrC;IACA,MAAM;MACJE;IAGF,CAAC,GAAG,MAAM,IAAI,CAACb,MAAM,CAACA,MAAM,CAAC;MAAEO,iBAAiB;MAAEC,KAAK;MAAEC,KAAK;MAAEK,WAAW,EAAE,CAACH;IAAU,CAAC,CAAC;IAC1F;IACA,MAAMI,YAAY,GAAG,IAAAC,gCAAc,EAACH,WAAW,EAAE,KAAK,CAAC;IACvD;IACA;IACA;IACA,OAAOE,YAAY;EACrB;EAEA,MAAcH,YAAYA,CAACE,WAAqB,EAAE;IAChD,IAAI,CAACd,MAAM,CAACiB,MAAM,CAACC,eAAe,CAAC,CAAC;IACpC,MAAMC,gBAAgB,GAAGL,WAAW,GAChC,8FAA8F,GAC9F,EAAE;IACN,MAAMM,EAAE,GAAG,MAAM,IAAAC,gBAAK,EAAC;MACrBC,QAAQ,EAAE;AAChB,oCAAoCH,gBAAgB;AACpD,EAAEI,gBAAK,CAACC,IAAI,CAAC,2CAA2C,CAAC;IACrD,CAAC,CAAC;IACF,IAAI,CAACJ,EAAE,EAAE;MACP,MAAM,KAAIK,oBAAQ,EAAC,iCAAiC,CAAC;IACvD;EACF;AACF;AAACC,OAAA,CAAA5B,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Workspace } from '@teambit/workspace';
|
|
1
|
+
import type { Workspace } from '@teambit/workspace';
|
|
2
2
|
import { ComponentIdList } from '@teambit/component-id';
|
|
3
|
-
import { RemovedObjects } from '@teambit/legacy.scope';
|
|
4
|
-
import { Consumer } from '@teambit/legacy.consumer';
|
|
3
|
+
import type { RemovedObjects } from '@teambit/legacy.scope';
|
|
4
|
+
import type { Consumer } from '@teambit/legacy.consumer';
|
|
5
5
|
import { ConsumerComponent } from '@teambit/legacy.consumer-component';
|
|
6
6
|
import { RemovedLocalObjects } from './removed-local-objects';
|
|
7
7
|
export type RemoveComponentsResult = {
|
|
@@ -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","componentsToRemove","loadComponents","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 { 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 { RemovedObjects } from '@teambit/legacy.scope';\nimport pMapSeries from 'p-map-series';\nimport { 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 { components: componentsToRemove } = await consumer.loadComponents(idsToRemove, false);\n const { removedComponentIds, missingComponents, dependentBits, removedFromLane } = await consumer.scope.removeMany(\n idsToRemoveFromScope,\n force,\n consumer\n );\n // otherwise, components should still be in .bitmap file\n idsToCleanFromWorkspace.push(...removedComponentIds);\n if (idsToCleanFromWorkspace.length) {\n if (deleteFiles) await deleteComponentsFiles(consumer, idsToCleanFromWorkspace);\n if (!track) {\n const removedComponents = componentsToRemove.filter((c) => idsToCleanFromWorkspace.hasWithoutVersion(c.id));\n await consumer.packageJson.removeComponentsFromDependencies(removedComponents);\n await removeComponentsFromNodeModules(consumer, removedComponents);\n await consumer.cleanFromBitMap(idsToCleanFromWorkspace);\n await workspace.cleanFromConfig(idsToCleanFromWorkspace);\n 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,YA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AAA,aAAA,KAAM0F,CAAC;MAAExD,EAAE,EAAEwD,CAAC,CAACxD;IAAE,EAAE,CAAC;EAC1D,CAAC,CAAC;EACF,MAAM2F,aAAa,GAAG,IAAAC,kBAAO,EAACH,sBAAsB,CAAC;EACrDhG,iBAAM,CAAC+F,KAAK,CAAC,iCAAiCG,aAAa,CAACnF,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;EACzE,OAAO+B,OAAO,CAACC,GAAG,CAACmD,aAAa,CAAC5F,GAAG,CAAE8F,aAAa,IAAKC,kBAAE,CAACC,MAAM,CAACtD,QAAQ,CAACuD,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","_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","componentsToRemove","loadComponents","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 { components: componentsToRemove } = await consumer.loadComponents(idsToRemove, false);\n const { removedComponentIds, missingComponents, dependentBits, removedFromLane } = await consumer.scope.removeMany(\n idsToRemoveFromScope,\n force,\n consumer\n );\n // otherwise, components should still be in .bitmap file\n idsToCleanFromWorkspace.push(...removedComponentIds);\n if (idsToCleanFromWorkspace.length) {\n if (deleteFiles) await deleteComponentsFiles(consumer, idsToCleanFromWorkspace);\n if (!track) {\n const removedComponents = componentsToRemove.filter((c) => idsToCleanFromWorkspace.hasWithoutVersion(c.id));\n await consumer.packageJson.removeComponentsFromDependencies(removedComponents);\n await removeComponentsFromNodeModules(consumer, removedComponents);\n await consumer.cleanFromBitMap(idsToCleanFromWorkspace);\n await workspace.cleanFromConfig(idsToCleanFromWorkspace);\n 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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CAAC,CAACa,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;EACrG,MAAMiF,sBAAsB,GAAGlC,UAAU,CAACxD,GAAG,CAAEyD,CAAC,IAAK;IACnD,OAAO,IAAAkC,2CAA6B,EAAA5H,aAAA,CAAAA,aAAA,KAAM0F,CAAC;MAAExD,EAAE,EAAEwD,CAAC,CAACxD;IAAE,EAAE,CAAC;EAC1D,CAAC,CAAC;EACF,MAAM2F,aAAa,GAAG,IAAAC,kBAAO,EAACH,sBAAsB,CAAC;EACrDhG,iBAAM,CAAC+F,KAAK,CAAC,iCAAiCG,aAAa,CAACnF,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;EACzE,OAAO+B,OAAO,CAACC,GAAG,CAACmD,aAAa,CAAC5F,GAAG,CAAE8F,aAAa,IAAKC,kBAAE,CAACC,MAAM,CAACtD,QAAQ,CAACuD,cAAc,CAACH,aAAa,CAAC,CAAC,CAAC,CAAC;AAC7G","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_componentId","data","require","_chalk","_interopRequireDefault","_lodash","e","__esModule","default","removeTemplate","dependentBits","modifiedComponents","removedComponentIds","missingComponents","removedFromLane","isRemote","paintMissingComponents","isEmpty","chalk","red","map","id","ComponentID","fromObject","version","toStringWithoutVersion","toString","paintRemoved","compToStr","comps","getMsg","isLane","removedFrom","msg","green","newLine","compOutput","laneOutput","paintUnRemovedComponents","Object","keys","key","header","underline","body","join","paintModifiedComponents","modifiedStr"],"sources":["remove-template.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":["_componentId","data","require","_chalk","_interopRequireDefault","_lodash","e","__esModule","default","removeTemplate","dependentBits","modifiedComponents","removedComponentIds","missingComponents","removedFromLane","isRemote","paintMissingComponents","isEmpty","chalk","red","map","id","ComponentID","fromObject","version","toStringWithoutVersion","toString","paintRemoved","compToStr","comps","getMsg","isLane","removedFrom","msg","green","newLine","compOutput","laneOutput","paintUnRemovedComponents","Object","keys","key","header","underline","body","join","paintModifiedComponents","modifiedStr"],"sources":["remove-template.ts"],"sourcesContent":["import type { ComponentIdList } from '@teambit/component-id';\nimport { ComponentID } from '@teambit/component-id';\nimport chalk from 'chalk';\nimport { isEmpty } from 'lodash';\n\nexport function removeTemplate(\n { dependentBits, modifiedComponents = [], removedComponentIds, missingComponents, removedFromLane },\n isRemote\n) {\n const paintMissingComponents = () => {\n if (isEmpty(missingComponents)) return '';\n return (\n chalk.red('missing components:') +\n chalk(\n ` ${missingComponents.map((id) => {\n if (!(id instanceof ComponentID)) id = ComponentID.fromObject(id); // when the id was received from a remote it's not an instance of ComponentID\n return id.version === 'latest' ? id.toStringWithoutVersion() : id.toString();\n })}\\n`\n )\n );\n };\n const paintRemoved = () => {\n if (isEmpty(removedComponentIds) && isEmpty(removedFromLane)) return '';\n const compToStr = (comps: ComponentIdList) =>\n chalk(` ${comps.map((id) => (id.version === 'latest' ? id.toStringWithoutVersion() : id.toString()))}\\n`);\n const getMsg = (isLane = false) => {\n const removedFrom = isLane ? 'lane' : 'scope';\n const msg = isRemote\n ? `successfully removed components from the remote ${removedFrom}:`\n : `successfully removed components from the local ${removedFrom}:`;\n return chalk.green(msg);\n };\n const newLine = '\\n';\n const compOutput = isEmpty(removedComponentIds) ? '' : getMsg(false) + compToStr(removedComponentIds) + newLine;\n const laneOutput = isEmpty(removedFromLane) ? '' : getMsg(true) + compToStr(removedFromLane);\n\n return `${compOutput}${laneOutput}`;\n };\n\n const paintUnRemovedComponents = () => {\n if (isEmpty(dependentBits)) return '';\n return Object.keys(dependentBits)\n .map((key) => {\n const header = chalk.underline.red(\n `error: unable to delete ${key}, because the following components depend on it:`\n );\n const body = dependentBits[key].join('\\n');\n return `${header}\\n${body}`;\n })\n .join('\\n\\n');\n };\n\n const paintModifiedComponents = () => {\n if (isEmpty(modifiedComponents)) return '';\n const modifiedStr = modifiedComponents.map((id: ComponentID) =>\n id.version === 'latest' ? id.toStringWithoutVersion() : id.toString()\n );\n return `${\n chalk.red('error: unable to remove modified components (please use --force to remove modified components)\\n') +\n chalk(`- ${modifiedStr}`)\n }`;\n };\n\n return (\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n paintUnRemovedComponents(dependentBits) +\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n paintRemoved(removedComponentIds) +\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n paintMissingComponents(missingComponents) +\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n paintModifiedComponents(modifiedComponents)\n );\n}\n"],"mappings":";;;;;;AACA,SAAAA,aAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,YAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAiC,SAAAG,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE1B,SAASG,cAAcA,CAC5B;EAAEC,aAAa;EAAEC,kBAAkB,GAAG,EAAE;EAAEC,mBAAmB;EAAEC,iBAAiB;EAAEC;AAAgB,CAAC,EACnGC,QAAQ,EACR;EACA,MAAMC,sBAAsB,GAAGA,CAAA,KAAM;IACnC,IAAI,IAAAC,iBAAO,EAACJ,iBAAiB,CAAC,EAAE,OAAO,EAAE;IACzC,OACEK,gBAAK,CAACC,GAAG,CAAC,qBAAqB,CAAC,GAChC,IAAAD,gBAAK,EACH,IAAIL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
|
-
import { Component, ShowFragment } from '@teambit/component';
|
|
2
|
-
import { RemoveMain } from './remove.main.runtime';
|
|
1
|
+
import type { Component, ShowFragment } from '@teambit/component';
|
|
2
|
+
import type { RemoveMain } from './remove.main.runtime';
|
|
3
3
|
export declare class RemoveFragment implements ShowFragment {
|
|
4
4
|
private remove;
|
|
5
5
|
constructor(remove: RemoveMain);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RemoveFragment","constructor","remove","_defineProperty","renderRow","component","removedInfo","getRemoveInfo","isRemoved","removed","isRemovedStr","toString","range","snaps","length","join","title","content","json","exports"],"sources":["remove.fragment.ts"],"sourcesContent":["import { Component, ShowFragment } from '@teambit/component';\nimport { RemoveMain } from './remove.main.runtime';\n\nexport class RemoveFragment implements ShowFragment {\n constructor(private remove: RemoveMain) {}\n\n title = 'removed';\n\n async renderRow(component: Component) {\n const removedInfo = await this.remove.getRemoveInfo(component);\n const isRemoved = removedInfo.removed;\n const isRemovedStr = isRemoved.toString();\n const range = removedInfo.range ? ` (range: ${removedInfo.range})` : '';\n const snaps = removedInfo.snaps && removedInfo.snaps.length ? ` (snaps: ${removedInfo.snaps.join(', ')})` : '';\n\n return {\n title: this.title,\n // when it's not removed, set as an empty string so then it won't be shown in bit-show\n content: isRemoved || range || snaps ? isRemovedStr + range + snaps : '',\n };\n }\n\n async json(component: Component) {\n return {\n title: this.title,\n json: await this.remove.getRemoveInfo(component),\n };\n }\n\n weight = 3;\n}\n"],"mappings":";;;;;;;;;AAGO,MAAMA,cAAc,CAAyB;EAClDC,WAAWA,CAASC,MAAkB,EAAE;IAAA,KAApBA,MAAkB,GAAlBA,MAAkB;IAAAC,eAAA,gBAE9B,SAAS;IAAAA,eAAA,iBAuBR,CAAC;EAzB+B;EAIzC,MAAMC,SAASA,CAACC,SAAoB,EAAE;IACpC,MAAMC,WAAW,GAAG,MAAM,IAAI,CAACJ,MAAM,CAACK,aAAa,CAACF,SAAS,CAAC;IAC9D,MAAMG,SAAS,GAAGF,WAAW,CAACG,OAAO;IACrC,MAAMC,YAAY,GAAGF,SAAS,CAACG,QAAQ,CAAC,CAAC;IACzC,MAAMC,KAAK,GAAGN,WAAW,CAACM,KAAK,GAAG,YAAYN,WAAW,CAACM,KAAK,GAAG,GAAG,EAAE;IACvE,MAAMC,KAAK,GAAGP,WAAW,CAACO,KAAK,IAAIP,WAAW,CAACO,KAAK,CAACC,MAAM,GAAG,YAAYR,WAAW,CAACO,KAAK,CAACE,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,EAAE;IAE9G,OAAO;MACLC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjB;MACAC,OAAO,EAAET,SAAS,IAAII,KAAK,IAAIC,KAAK,GAAGH,YAAY,GAAGE,KAAK,GAAGC,KAAK,GAAG;IACxE,CAAC;EACH;EAEA,MAAMK,IAAIA,CAACb,SAAoB,EAAE;IAC/B,OAAO;MACLW,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBE,IAAI,EAAE,MAAM,IAAI,CAAChB,MAAM,CAACK,aAAa,CAACF,SAAS;IACjD,CAAC;EACH;AAGF;AAACc,OAAA,CAAAnB,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["RemoveFragment","constructor","remove","_defineProperty","renderRow","component","removedInfo","getRemoveInfo","isRemoved","removed","isRemovedStr","toString","range","snaps","length","join","title","content","json","exports"],"sources":["remove.fragment.ts"],"sourcesContent":["import type { Component, ShowFragment } from '@teambit/component';\nimport type { RemoveMain } from './remove.main.runtime';\n\nexport class RemoveFragment implements ShowFragment {\n constructor(private remove: RemoveMain) {}\n\n title = 'removed';\n\n async renderRow(component: Component) {\n const removedInfo = await this.remove.getRemoveInfo(component);\n const isRemoved = removedInfo.removed;\n const isRemovedStr = isRemoved.toString();\n const range = removedInfo.range ? ` (range: ${removedInfo.range})` : '';\n const snaps = removedInfo.snaps && removedInfo.snaps.length ? ` (snaps: ${removedInfo.snaps.join(', ')})` : '';\n\n return {\n title: this.title,\n // when it's not removed, set as an empty string so then it won't be shown in bit-show\n content: isRemoved || range || snaps ? isRemovedStr + range + snaps : '',\n };\n }\n\n async json(component: Component) {\n return {\n title: this.title,\n json: await this.remove.getRemoveInfo(component),\n };\n }\n\n weight = 3;\n}\n"],"mappings":";;;;;;;;;AAGO,MAAMA,cAAc,CAAyB;EAClDC,WAAWA,CAASC,MAAkB,EAAE;IAAA,KAApBA,MAAkB,GAAlBA,MAAkB;IAAAC,eAAA,gBAE9B,SAAS;IAAAA,eAAA,iBAuBR,CAAC;EAzB+B;EAIzC,MAAMC,SAASA,CAACC,SAAoB,EAAE;IACpC,MAAMC,WAAW,GAAG,MAAM,IAAI,CAACJ,MAAM,CAACK,aAAa,CAACF,SAAS,CAAC;IAC9D,MAAMG,SAAS,GAAGF,WAAW,CAACG,OAAO;IACrC,MAAMC,YAAY,GAAGF,SAAS,CAACG,QAAQ,CAAC,CAAC;IACzC,MAAMC,KAAK,GAAGN,WAAW,CAACM,KAAK,GAAG,YAAYN,WAAW,CAACM,KAAK,GAAG,GAAG,EAAE;IACvE,MAAMC,KAAK,GAAGP,WAAW,CAACO,KAAK,IAAIP,WAAW,CAACO,KAAK,CAACC,MAAM,GAAG,YAAYR,WAAW,CAACO,KAAK,CAACE,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,EAAE;IAE9G,OAAO;MACLC,KAAK,EAAE,IAAI,CAACA,KAAK;MACjB;MACAC,OAAO,EAAET,SAAS,IAAII,KAAK,IAAIC,KAAK,GAAGH,YAAY,GAAGE,KAAK,GAAGC,KAAK,GAAG;IACxE,CAAC;EACH;EAEA,MAAMK,IAAIA,CAACb,SAAoB,EAAE;IAC/B,OAAO;MACLW,KAAK,EAAE,IAAI,CAACA,KAAK;MACjBE,IAAI,EAAE,MAAM,IAAI,CAAChB,MAAM,CAACK,aAAa,CAACF,SAAS;IACjD,CAAC;EACH;AAGF;AAACc,OAAA,CAAAnB,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { CLIMain } from '@teambit/cli';
|
|
2
|
-
import { Logger, LoggerMain } from '@teambit/logger';
|
|
3
|
-
import { Workspace } from '@teambit/workspace';
|
|
1
|
+
import type { CLIMain } from '@teambit/cli';
|
|
2
|
+
import type { Logger, LoggerMain } from '@teambit/logger';
|
|
3
|
+
import type { Workspace } from '@teambit/workspace';
|
|
4
4
|
import { ComponentID } from '@teambit/component-id';
|
|
5
|
-
import { ImporterMain } from '@teambit/importer';
|
|
6
|
-
import { DependencyResolverMain } from '@teambit/dependency-resolver';
|
|
7
|
-
import { IssuesMain } from '@teambit/issues';
|
|
8
|
-
import { Component, ComponentMain } from '@teambit/component';
|
|
9
|
-
import { RemoveComponentsResult } from './remove-components';
|
|
10
|
-
import { RecoverOptions } from './recover-cmd';
|
|
11
|
-
import { ScopeMain } from '@teambit/scope';
|
|
12
|
-
import { ListerMain } from '@teambit/lister';
|
|
5
|
+
import type { ImporterMain } from '@teambit/importer';
|
|
6
|
+
import type { DependencyResolverMain } from '@teambit/dependency-resolver';
|
|
7
|
+
import type { IssuesMain } from '@teambit/issues';
|
|
8
|
+
import type { Component, ComponentMain } from '@teambit/component';
|
|
9
|
+
import type { RemoveComponentsResult } from './remove-components';
|
|
10
|
+
import type { RecoverOptions } from './recover-cmd';
|
|
11
|
+
import type { ScopeMain } from '@teambit/scope';
|
|
12
|
+
import type { ListerMain } from '@teambit/lister';
|
|
13
13
|
export type RemoveInfo = {
|
|
14
14
|
removed: boolean;
|
|
15
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_semver","_interopRequireDefault","_logger","_workspace","_componentId","_legacy","_importer","_lodash","_legacy2","_bitError","_dependencyResolver","_componentIssues","_issues","_pMapSeries","_legacy3","_component","_deleteComponentFiles","_removeCmd","_removeComponents","_remove","_remove2","_recoverCmd","_deleteCmd","_scope","_lister","_chalk","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","BEFORE_REMOVE","RemoveMain","constructor","workspace","scope","logger","importer","depResolver","lister","remove","componentsPattern","force","remote","track","deleteFiles","setStatusLine","bitIds","getRemoteBitIdsToRemove","getLocalBitIdsToRemove","consumer","removeResults","removeComponents","ids","ComponentIdList","fromArray","onDestroy","removeLocallyByIds","reasonForRemoval","OutsideWorkspaceError","results","bitMap","write","markRemoveComps","componentIds","updateMain","range","snaps","allComponentsToMarkDeleted","getMany","componentsToDeleteFromFs","componentsIdsToDeleteFromFs","map","c","id","removeComponentsFromNodeModules","state","_consumer","config","removed","removeOnMain","compId","addComponentConfig","RemoveAspect","deleteComponentsFiles","deleteComps","opts","ConsumerNotFound","idsByPattern","newComps","hasVersion","BitError","toString","join","currentLane","getCurrentLaneObject","isNew","Error","laneComp","toComponentIds","compIdsNotOnLane","hasWithoutVersion","chalk","bold","recover","compIdStr","options","bitMapEntry","components","find","compMap","fullName","toStringWithoutVersion","importComp","idStr","import","installNpmPackages","skipDependencyInstallation","writeConfigFiles","skipWriteConfigFiles","override","setAsRemovedFalse","addSpecificComponentConfig","compFromScope","get","rootDir","removeComponentConfig","comp","removeInfo","getRemoveInfo","resolveComponentId","idOnLane","getComponent","compIdWithPossibleVer","changeVersion","head","isDeleted","getRemoteComponent","err","NoHeadNoVersion","throwForMainComponentWhenOnLane","laneComps","toBitIds","mainComps","component","headComponent","getHeadComponent","extensions","findExtension","isDeletedByRange","currentTag","getTag","Boolean","semver","satisfies","version","isDeletedBySnaps","includes","hash","headTag","headComp","undefined","isRemoved","isRemovedByIdWithoutLoadingComponent","componentId","bitmapEntry","getBitmapEntryIfExist","isRecovered","modelComp","getBitObjectModelComponent","legacyScope","objects","isEnvByIdWithoutLoadingComponent","versionObj","getBitObjectVersionById","envData","findCoreExtension","type","getRemovedStaged","isOnMain","getRemovedStagedFromMain","getRemovedStagedFromLane","addRemovedDependenciesIssues","workspacePolicyManifest","getWorkspacePolicyManifest","workspaceDependencies","dependencies","peerDependencies","installedDeps","pMapSeries","addRemovedDepIssue","getComponentDependencies","removedDependencies","removedEnv","Promise","all","dep","packageName","getPackageName","isAvailableAsInstalledPackage","isEnv","issues","getOrCreate","IssuesClasses","RemovedDependencies","RemovedEnv","stagedConfig","getStagedConfig","getAll","compConfig","laneIds","workspaceIds","listIds","laneCompIdsNotInWorkspace","wId","isEqualWithoutVersion","comps","staged","snapDistance","getSnapDistance","warn","name","isSourceAhead","compact","hasWildcard","getRemoteCompIdsByWildcards","ComponentID","fromString","provider","cli","loggerMain","componentAspect","importerMain","createLogger","removeMain","registerAddComponentsIssues","bind","registerShowFragments","RemoveFragment","register","RemoveCmd","DeleteCmd","RecoverCmd","exports","WorkspaceAspect","ScopeAspect","CLIAspect","LoggerAspect","ComponentAspect","ImporterAspect","DependencyResolverAspect","IssuesAspect","ListerAspect","MainRuntime","addRuntime","_default"],"sources":["remove.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport semver from 'semver';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { ConsumerNotFound } from '@teambit/legacy.consumer';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { compact } from 'lodash';\nimport { hasWildcard } from '@teambit/legacy.utils';\nimport { BitError } from '@teambit/bit-error';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport pMapSeries from 'p-map-series';\nimport { NoHeadNoVersion } from '@teambit/legacy.scope';\nimport { ComponentAspect, Component, ComponentMain } from '@teambit/component';\nimport { deleteComponentsFiles } from './delete-component-files';\nimport { RemoveCmd } from './remove-cmd';\nimport { RemoveComponentsResult, removeComponents, removeComponentsFromNodeModules } from './remove-components';\nimport { RemoveAspect } from './remove.aspect';\nimport { RemoveFragment } from './remove.fragment';\nimport { RecoverCmd, RecoverOptions } from './recover-cmd';\nimport { DeleteCmd } from './delete-cmd';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { ListerAspect, ListerMain } from '@teambit/lister';\nimport chalk from 'chalk';\n\nconst BEFORE_REMOVE = 'removing components';\n\nexport type RemoveInfo = {\n removed: boolean;\n /**\n * whether to remove the component from default lane once merged\n */\n removeOnMain?: boolean;\n /**\n * Semver range to mark specific versions as deleted\n */\n range?: string;\n /**\n * Array of snap hashes to mark as deleted\n */\n snaps?: string[];\n};\n\nexport type DeleteOpts = { updateMain?: boolean; range?: string; snaps?: string[] };\n\nexport class RemoveMain {\n constructor(\n private workspace: Workspace,\n private scope: ScopeMain,\n public logger: Logger,\n private importer: ImporterMain,\n private depResolver: DependencyResolverMain,\n private lister: ListerMain\n ) {}\n\n async remove({\n componentsPattern,\n force = false,\n remote = false,\n track = false,\n deleteFiles = true,\n }: {\n componentsPattern: string;\n force?: boolean;\n remote?: boolean;\n track?: boolean;\n deleteFiles?: boolean;\n }): Promise<RemoveComponentsResult> {\n this.logger.setStatusLine(BEFORE_REMOVE);\n const bitIds = remote\n ? await this.getRemoteBitIdsToRemove(componentsPattern)\n : await this.getLocalBitIdsToRemove(componentsPattern);\n this.logger.setStatusLine(BEFORE_REMOVE); // again because the loader might changed when talking to the remote\n const consumer = this.workspace?.consumer;\n const removeResults = await removeComponents({\n workspace: this.workspace,\n ids: ComponentIdList.fromArray(bitIds),\n force,\n remote,\n track,\n deleteFiles,\n });\n if (consumer) await consumer.onDestroy('remove');\n return removeResults;\n }\n\n /**\n * remove components from the workspace.\n */\n async removeLocallyByIds(\n ids: ComponentID[],\n { force = false, reasonForRemoval }: { force?: boolean; reasonForRemoval?: string } = {}\n ) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const results = await removeComponents({\n workspace: this.workspace,\n ids: ComponentIdList.fromArray(ids),\n force,\n remote: false,\n track: false,\n deleteFiles: true,\n });\n await this.workspace.bitMap.write(`remove (by ${reasonForRemoval || 'N/A'})`);\n\n return results;\n }\n\n private async markRemoveComps(\n componentIds: ComponentID[],\n { updateMain, range, snaps }: DeleteOpts\n ): Promise<Component[]> {\n const allComponentsToMarkDeleted = await this.workspace.getMany(componentIds);\n\n const componentsToDeleteFromFs = range || snaps ? [] : allComponentsToMarkDeleted;\n const componentsIdsToDeleteFromFs = ComponentIdList.fromArray(componentsToDeleteFromFs.map((c) => c.id));\n await removeComponentsFromNodeModules(\n this.workspace.consumer,\n componentsToDeleteFromFs.map((c) => c.state._consumer)\n );\n // don't use `this.workspace.addSpecificComponentConfig`, if the component has component.json it will be deleted\n // during this removal along with the entire component dir.\n // in case this is range, the \"removed\" property is set to false. even when the range overlap the current version.\n // the reason is that if we set it to true, then, the component is considered as \"deleted\" for *all* versions.\n // remember that this config is always passed to the next version and if we set removed: true, it'll be copied\n // to the next version even when that version is not in the range.\n const config: RemoveInfo = { removed: !(range || snaps) };\n if (updateMain) config.removeOnMain = true;\n if (range) config.range = range;\n if (snaps && snaps.length) config.snaps = snaps;\n componentIds.forEach((compId) => this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, config));\n await this.workspace.bitMap.write('delete');\n await deleteComponentsFiles(this.workspace.consumer, componentsIdsToDeleteFromFs);\n\n return componentsToDeleteFromFs;\n }\n\n async deleteComps(componentsPattern: string, opts: DeleteOpts = {}): Promise<Component[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n const newComps = componentIds.filter((id) => !id.hasVersion());\n if (newComps.length) {\n throw new BitError(\n `no need to delete the following new component(s), please remove them by \"bit remove\"\\n${newComps\n .map((id) => id.toString())\n .join('\\n')}`\n );\n }\n const currentLane = await this.workspace.getCurrentLaneObject();\n const { updateMain } = opts;\n if (!updateMain && currentLane?.isNew) {\n throw new Error(\n 'no need to delete components from an un-exported lane, you can remove them by running \"bit remove\"'\n );\n }\n if (currentLane && !updateMain && opts.range) {\n throw new BitError(`--range is not needed when deleting components from a lane, unless --update-main is used`);\n }\n if (currentLane && !updateMain) {\n const laneComp = currentLane.toComponentIds();\n const compIdsNotOnLane = componentIds.filter((id) => !laneComp.hasWithoutVersion(id));\n if (compIdsNotOnLane.length) {\n throw new BitError(\n `unable to delete the following component(s) because they are not part of the current lane.\n${chalk.bold(compIdsNotOnLane.map((id) => id.toString()).join('\\n'))}\nto simply remove them from the workspace, use \"bit remove\".\nto delete them eventually from main, use \"--update-main\" flag and make sure to remove all occurrences from the code.`\n );\n }\n }\n return this.markRemoveComps(componentIds, opts);\n }\n\n /**\n * recover a soft-removed component.\n * there are 4 different scenarios.\n * 1. a component was just soft-removed, it wasn't snapped yet. so it's now in .bitmap with the \"removed\" aspect entry.\n * 1.a. the component still exists in the local scope. no need to import. write it from there.\n * 1.b. the component doesn't exist in the local scope. import it.\n * 2. soft-removed and then snapped. It's not in .bitmap now.\n * 3. soft-removed, snapped, exported. it's not in .bitmap now.\n * 4. a soft-removed components was imported, so it's now in .bitmap without the \"removed\" aspect entry.\n * 5. workspace is empty. the soft-removed component is on the remote.\n * returns `true` if it was recovered. `false` if the component wasn't soft-removed, so nothing to recover from.\n */\n async recover(compIdStr: string, options: RecoverOptions): Promise<boolean> {\n if (!this.workspace) throw new ConsumerNotFound();\n const bitMapEntry = this.workspace.consumer.bitMap.components.find((compMap) => {\n return compMap.id.fullName === compIdStr || compMap.id.toStringWithoutVersion() === compIdStr;\n });\n const importComp = async (idStr: string) => {\n await this.importer.import({\n ids: [idStr],\n installNpmPackages: !options.skipDependencyInstallation,\n writeConfigFiles: !options.skipWriteConfigFiles,\n override: true,\n });\n };\n const setAsRemovedFalse = async (compId: ComponentID) => {\n await this.workspace.addSpecificComponentConfig(compId, RemoveAspect.id, { removed: false });\n await this.workspace.bitMap.write('recover');\n };\n if (bitMapEntry) {\n if (bitMapEntry.config?.[RemoveAspect.id]) {\n // case #1\n const compFromScope = await this.workspace.scope.get(bitMapEntry.id);\n if (compFromScope) {\n // in the case the component is in the scope, we prefer to write it from the scope rather than import it.\n // because in some cases the \"import\" throws an error, e.g. when the component is diverged.\n await this.workspace.write(compFromScope, bitMapEntry.rootDir);\n this.workspace.bitMap.removeComponentConfig(bitMapEntry.id, RemoveAspect.id, false);\n await this.workspace.bitMap.write('recover');\n } else {\n delete bitMapEntry.config?.[RemoveAspect.id];\n await importComp(bitMapEntry.id.toString());\n }\n return true;\n }\n // case #4\n const compId = bitMapEntry.id;\n const comp = await this.workspace.get(compId);\n const removeInfo = await this.getRemoveInfo(comp);\n if (!removeInfo.removed && !removeInfo.range && !removeInfo.snaps) {\n return false;\n }\n await setAsRemovedFalse(compId);\n return true;\n }\n const compId = await this.workspace.scope.resolveComponentId(compIdStr);\n const currentLane = await this.workspace.getCurrentLaneObject();\n const idOnLane = currentLane?.getComponent(compId);\n const compIdWithPossibleVer = idOnLane ? compId.changeVersion(idOnLane.head.toString()) : compId;\n const compFromScope = await this.workspace.scope.get(compIdWithPossibleVer);\n if (compFromScope && (await this.isDeleted(compFromScope))) {\n // case #2 and #3\n await importComp(compIdWithPossibleVer._legacy.toString());\n await setAsRemovedFalse(compIdWithPossibleVer);\n return true;\n }\n // case #5\n let comp: Component | undefined;\n try {\n comp = await this.workspace.scope.getRemoteComponent(compId);\n } catch (err: any) {\n if (err instanceof NoHeadNoVersion) {\n throw new BitError(\n `unable to find the component ${compIdWithPossibleVer.toString()} in the current lane or main`\n );\n }\n throw err;\n }\n if (!(await this.isDeleted(comp))) {\n return false;\n }\n await importComp(compId._legacy.toString());\n await setAsRemovedFalse(compId);\n\n return true;\n }\n\n private async throwForMainComponentWhenOnLane(components: Component[]) {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return; // user on main\n const laneComps = currentLane.toBitIds();\n const mainComps = components.filter((comp) => !laneComps.hasWithoutVersion(comp.id));\n if (mainComps.length) {\n throw new BitError(`the following components belong to main, they cannot be soft-removed when on a lane. consider removing them without --soft.\n${mainComps.map((c) => c.id.toString()).join('\\n')}`);\n }\n }\n\n async getRemoveInfo(component: Component): Promise<RemoveInfo> {\n const headComponent = await this.getHeadComponent(component);\n const data = headComponent.config.extensions.findExtension(RemoveAspect.id)?.config as RemoveInfo | undefined;\n\n const isDeletedByRange = () => {\n if (!data?.range) return false;\n const currentTag = component.getTag();\n return Boolean(currentTag && semver.satisfies(currentTag.version, data.range));\n };\n const isDeletedBySnaps = () => {\n if (!data?.snaps || !component.id.version) return false;\n return data.snaps.includes(component.id.version);\n };\n\n return {\n removed: data?.removed || isDeletedByRange() || isDeletedBySnaps() || false,\n range: data?.range,\n snaps: data?.snaps,\n };\n }\n\n private async getHeadComponent(component: Component): Promise<Component> {\n if (\n component.id.version &&\n component.head &&\n component.id.version !== component.head?.hash &&\n component.id.version !== component.headTag?.version.version\n ) {\n const headComp = this.workspace // if workspace exits, prefer using the workspace as it may be modified\n ? await this.workspace.get(component.id.changeVersion(undefined))\n : await this.scope.get(component.id.changeVersion(component.head.hash));\n if (!headComp) throw new Error(`unable to get the head of ${component.id.toString()}`);\n return headComp;\n }\n return component;\n }\n\n /**\n * @deprecated use `isDeleted` instead.\n */\n async isRemoved(component: Component): Promise<boolean> {\n return this.isDeleted(component);\n }\n\n /**\n * whether a component is marked as deleted.\n */\n async isDeleted(component: Component): Promise<boolean> {\n const removeInfo = await this.getRemoveInfo(component);\n return removeInfo.removed;\n }\n\n /**\n * performant version of isRemoved() in case the component object is not available and loading it is expensive.\n */\n async isRemovedByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n if (!componentId.hasVersion()) return false;\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId);\n if (bitmapEntry && bitmapEntry.isRemoved()) return true;\n if (bitmapEntry && bitmapEntry.isRecovered()) return false;\n const modelComp = await this.workspace.scope.getBitObjectModelComponent(componentId.changeVersion(undefined));\n if (!modelComp) return false;\n const isRemoved = await modelComp.isRemoved(\n this.workspace.scope.legacyScope.objects,\n componentId.version as string\n );\n return Boolean(isRemoved);\n }\n\n async isEnvByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n const versionObj = await this.workspace.scope.getBitObjectVersionById(componentId);\n const envData = versionObj?.extensions.findCoreExtension('teambit.envs/envs');\n return envData?.data.type === 'env';\n }\n\n /**\n * get components that were soft-removed and tagged/snapped/merged but not exported yet.\n */\n async getRemovedStaged(): Promise<ComponentID[]> {\n return this.workspace.isOnMain() ? this.getRemovedStagedFromMain() : this.getRemovedStagedFromLane();\n }\n\n async addRemovedDependenciesIssues(components: Component[]) {\n const workspacePolicyManifest = this.depResolver.getWorkspacePolicyManifest();\n const workspaceDependencies = {\n ...workspacePolicyManifest.dependencies,\n ...workspacePolicyManifest.peerDependencies,\n };\n const installedDeps = Object.keys(workspaceDependencies);\n await pMapSeries(components, async (component) => {\n await this.addRemovedDepIssue(component, installedDeps);\n });\n }\n\n private async addRemovedDepIssue(component: Component, installedDeps: string[]) {\n const dependencies = this.depResolver.getComponentDependencies(component);\n const removedDependencies: ComponentID[] = [];\n let removedEnv: ComponentID | undefined;\n\n await Promise.all(\n dependencies.map(async (dep) => {\n const isRemoved = await this.isRemovedByIdWithoutLoadingComponent(dep.componentId);\n if (!isRemoved) return;\n\n // a component can be deleted from the workspace and installed as a package in different version.\n // normally, this is happening when checked out to a lane and a component is deleted from the lane.\n // the user still wants to use it but not as part of the lane.\n const packageName = dep.getPackageName();\n const isAvailableAsInstalledPackage = installedDeps.includes(packageName);\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(dep.componentId);\n if (bitmapEntry && isAvailableAsInstalledPackage && bitmapEntry.version !== dep.version) {\n return;\n }\n\n const isEnv = await this.isEnvByIdWithoutLoadingComponent(dep.componentId);\n if (isEnv) {\n removedEnv = dep.componentId;\n } else {\n removedDependencies.push(dep.componentId);\n }\n })\n );\n if (removedDependencies.length) {\n component.state.issues.getOrCreate(IssuesClasses.RemovedDependencies).data = removedDependencies.map((r) =>\n r.toString()\n );\n }\n if (removedEnv) {\n component.state.issues.getOrCreate(IssuesClasses.RemovedEnv).data = removedEnv.toString();\n }\n }\n\n private async getRemovedStagedFromMain(): Promise<ComponentID[]> {\n const stagedConfig = await this.workspace.scope.getStagedConfig();\n return stagedConfig\n .getAll()\n .filter((compConfig) => compConfig.config?.[RemoveAspect.id]?.removed)\n .map((compConfig) => compConfig.id);\n }\n\n private async getRemovedStagedFromLane(): Promise<ComponentID[]> {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return [];\n const laneIds = currentLane.toComponentIds();\n const workspaceIds = this.workspace.listIds();\n const laneCompIdsNotInWorkspace = laneIds.filter(\n (id) => !workspaceIds.find((wId) => wId.isEqualWithoutVersion(id))\n );\n if (!laneCompIdsNotInWorkspace.length) return [];\n const comps = await this.workspace.scope.getMany(laneCompIdsNotInWorkspace);\n const removed = comps.filter((c) => this.isDeleted(c));\n const staged = await Promise.all(\n removed.map(async (c) => {\n const snapDistance = await this.workspace.scope.getSnapDistance(c.id, false);\n if (snapDistance.err) {\n this.logger.warn(\n `getRemovedStagedFromLane unable to get snapDistance for ${c.id.toString()} due to ${snapDistance.err.name}`\n );\n // todo: not clear what should be done here. should we consider it as removed-staged or not.\n }\n if (snapDistance.isSourceAhead()) return c.id;\n return undefined;\n })\n );\n return compact(staged);\n }\n\n private async getLocalBitIdsToRemove(componentsPattern: string): Promise<ComponentID[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n return componentIds.map((id) => id);\n }\n\n private async getRemoteBitIdsToRemove(componentsPattern: string): Promise<ComponentID[]> {\n if (hasWildcard(componentsPattern)) {\n return this.lister.getRemoteCompIdsByWildcards(componentsPattern);\n }\n return [ComponentID.fromString(componentsPattern)];\n }\n\n static slots = [];\n static dependencies = [\n WorkspaceAspect,\n ScopeAspect,\n CLIAspect,\n LoggerAspect,\n ComponentAspect,\n ImporterAspect,\n DependencyResolverAspect,\n IssuesAspect,\n ListerAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([\n workspace,\n scope,\n cli,\n loggerMain,\n componentAspect,\n importerMain,\n depResolver,\n issues,\n lister,\n ]: [\n Workspace,\n ScopeMain,\n CLIMain,\n LoggerMain,\n ComponentMain,\n ImporterMain,\n DependencyResolverMain,\n IssuesMain,\n ListerMain,\n ]) {\n const logger = loggerMain.createLogger(RemoveAspect.id);\n const removeMain = new RemoveMain(workspace, scope, logger, importerMain, depResolver, lister);\n issues.registerAddComponentsIssues(removeMain.addRemovedDependenciesIssues.bind(removeMain));\n componentAspect.registerShowFragments([new RemoveFragment(removeMain)]);\n cli.register(\n new RemoveCmd(removeMain, workspace),\n new DeleteCmd(removeMain, workspace),\n new RecoverCmd(removeMain)\n );\n return removeMain;\n }\n}\n\nRemoveAspect.addRuntime(RemoveMain);\n\nexport default RemoveMain;\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,a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,GAAG,IAAI1M,UAAU,CAACE,SAAS,EAAEC,KAAK,EAAEC,MAAM,EAAEoM,YAAY,EAAElM,WAAW,EAAEC,MAAM,CAAC;IAC9FkK,MAAM,CAACkC,2BAA2B,CAACD,UAAU,CAACpD,4BAA4B,CAACsD,IAAI,CAACF,UAAU,CAAC,CAAC;IAC5FH,eAAe,CAACM,qBAAqB,CAAC,CAAC,KAAIC,yBAAc,EAACJ,UAAU,CAAC,CAAC,CAAC;IACvEL,GAAG,CAACU,QAAQ,CACV,KAAIC,sBAAS,EAACN,UAAU,EAAExM,SAAS,CAAC,EACpC,KAAI+M,sBAAS,EAACP,UAAU,EAAExM,SAAS,CAAC,EACpC,KAAIgN,wBAAU,EAACR,UAAU,CAC3B,CAAC;IACD,OAAOA,UAAU;EACnB;AACF;AAACS,OAAA,CAAAnN,UAAA,GAAAA,UAAA;AAAAjB,eAAA,CAncYiB,UAAU,WAqZN,EAAE;AAAAjB,eAAA,CArZNiB,UAAU,kBAsZC,CACpBoN,4BAAe,EACfC,oBAAW,EACXC,gBAAS,EACTC,sBAAY,EACZC,4BAAe,EACfC,0BAAc,EACdC,8CAAwB,EACxBC,sBAAY,EACZC,sBAAY,CACb;AAAA7O,eAAA,CAhaUiB,UAAU,aAiaJ6N,kBAAW;AAoC9B1K,sBAAY,CAAC2K,UAAU,CAAC9N,UAAU,CAAC;AAAC,IAAA+N,QAAA,GAAAZ,OAAA,CAAArP,OAAA,GAErBkC,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_semver","_interopRequireDefault","_logger","_workspace","_componentId","_legacy","_importer","_lodash","_legacy2","_bitError","_dependencyResolver","_componentIssues","_issues","_pMapSeries","_legacy3","_component","_deleteComponentFiles","_removeCmd","_removeComponents","_remove","_remove2","_recoverCmd","_deleteCmd","_scope","_lister","_chalk","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","BEFORE_REMOVE","RemoveMain","constructor","workspace","scope","logger","importer","depResolver","lister","remove","componentsPattern","force","remote","track","deleteFiles","setStatusLine","bitIds","getRemoteBitIdsToRemove","getLocalBitIdsToRemove","consumer","removeResults","removeComponents","ids","ComponentIdList","fromArray","onDestroy","removeLocallyByIds","reasonForRemoval","OutsideWorkspaceError","results","bitMap","write","markRemoveComps","componentIds","updateMain","range","snaps","allComponentsToMarkDeleted","getMany","componentsToDeleteFromFs","componentsIdsToDeleteFromFs","map","c","id","removeComponentsFromNodeModules","state","_consumer","config","removed","removeOnMain","compId","addComponentConfig","RemoveAspect","deleteComponentsFiles","deleteComps","opts","ConsumerNotFound","idsByPattern","newComps","hasVersion","BitError","toString","join","currentLane","getCurrentLaneObject","isNew","Error","laneComp","toComponentIds","compIdsNotOnLane","hasWithoutVersion","chalk","bold","recover","compIdStr","options","bitMapEntry","components","find","compMap","fullName","toStringWithoutVersion","importComp","idStr","import","installNpmPackages","skipDependencyInstallation","writeConfigFiles","skipWriteConfigFiles","override","setAsRemovedFalse","addSpecificComponentConfig","compFromScope","get","rootDir","removeComponentConfig","comp","removeInfo","getRemoveInfo","resolveComponentId","idOnLane","getComponent","compIdWithPossibleVer","changeVersion","head","isDeleted","getRemoteComponent","err","NoHeadNoVersion","throwForMainComponentWhenOnLane","laneComps","toBitIds","mainComps","component","headComponent","getHeadComponent","extensions","findExtension","isDeletedByRange","currentTag","getTag","Boolean","semver","satisfies","version","isDeletedBySnaps","includes","hash","headTag","headComp","undefined","isRemoved","isRemovedByIdWithoutLoadingComponent","componentId","bitmapEntry","getBitmapEntryIfExist","isRecovered","modelComp","getBitObjectModelComponent","legacyScope","objects","isEnvByIdWithoutLoadingComponent","versionObj","getBitObjectVersionById","envData","findCoreExtension","type","getRemovedStaged","isOnMain","getRemovedStagedFromMain","getRemovedStagedFromLane","addRemovedDependenciesIssues","workspacePolicyManifest","getWorkspacePolicyManifest","workspaceDependencies","dependencies","peerDependencies","installedDeps","pMapSeries","addRemovedDepIssue","getComponentDependencies","removedDependencies","removedEnv","Promise","all","dep","packageName","getPackageName","isAvailableAsInstalledPackage","isEnv","issues","getOrCreate","IssuesClasses","RemovedDependencies","RemovedEnv","stagedConfig","getStagedConfig","getAll","compConfig","laneIds","workspaceIds","listIds","laneCompIdsNotInWorkspace","wId","isEqualWithoutVersion","comps","staged","snapDistance","getSnapDistance","warn","name","isSourceAhead","compact","hasWildcard","getRemoteCompIdsByWildcards","ComponentID","fromString","provider","cli","loggerMain","componentAspect","importerMain","createLogger","removeMain","registerAddComponentsIssues","bind","registerShowFragments","RemoveFragment","register","RemoveCmd","DeleteCmd","RecoverCmd","exports","WorkspaceAspect","ScopeAspect","CLIAspect","LoggerAspect","ComponentAspect","ImporterAspect","DependencyResolverAspect","IssuesAspect","ListerAspect","MainRuntime","addRuntime","_default"],"sources":["remove.main.runtime.ts"],"sourcesContent":["import type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport semver from 'semver';\nimport type { Logger, LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect, OutsideWorkspaceError } from '@teambit/workspace';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { ConsumerNotFound } from '@teambit/legacy.consumer';\nimport type { ImporterMain } from '@teambit/importer';\nimport { ImporterAspect } from '@teambit/importer';\nimport { compact } from 'lodash';\nimport { hasWildcard } from '@teambit/legacy.utils';\nimport { BitError } from '@teambit/bit-error';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { DependencyResolverAspect } from '@teambit/dependency-resolver';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport type { IssuesMain } from '@teambit/issues';\nimport { IssuesAspect } from '@teambit/issues';\nimport pMapSeries from 'p-map-series';\nimport { NoHeadNoVersion } from '@teambit/legacy.scope';\nimport type { Component, ComponentMain } from '@teambit/component';\nimport { ComponentAspect } from '@teambit/component';\nimport { deleteComponentsFiles } from './delete-component-files';\nimport { RemoveCmd } from './remove-cmd';\nimport type { RemoveComponentsResult } from './remove-components';\nimport { removeComponents, removeComponentsFromNodeModules } from './remove-components';\nimport { RemoveAspect } from './remove.aspect';\nimport { RemoveFragment } from './remove.fragment';\nimport type { RecoverOptions } from './recover-cmd';\nimport { RecoverCmd } from './recover-cmd';\nimport { DeleteCmd } from './delete-cmd';\nimport type { ScopeMain } from '@teambit/scope';\nimport { ScopeAspect } from '@teambit/scope';\nimport type { ListerMain } from '@teambit/lister';\nimport { ListerAspect } from '@teambit/lister';\nimport chalk from 'chalk';\n\nconst BEFORE_REMOVE = 'removing components';\n\nexport type RemoveInfo = {\n removed: boolean;\n /**\n * whether to remove the component from default lane once merged\n */\n removeOnMain?: boolean;\n /**\n * Semver range to mark specific versions as deleted\n */\n range?: string;\n /**\n * Array of snap hashes to mark as deleted\n */\n snaps?: string[];\n};\n\nexport type DeleteOpts = { updateMain?: boolean; range?: string; snaps?: string[] };\n\nexport class RemoveMain {\n constructor(\n private workspace: Workspace,\n private scope: ScopeMain,\n public logger: Logger,\n private importer: ImporterMain,\n private depResolver: DependencyResolverMain,\n private lister: ListerMain\n ) {}\n\n async remove({\n componentsPattern,\n force = false,\n remote = false,\n track = false,\n deleteFiles = true,\n }: {\n componentsPattern: string;\n force?: boolean;\n remote?: boolean;\n track?: boolean;\n deleteFiles?: boolean;\n }): Promise<RemoveComponentsResult> {\n this.logger.setStatusLine(BEFORE_REMOVE);\n const bitIds = remote\n ? await this.getRemoteBitIdsToRemove(componentsPattern)\n : await this.getLocalBitIdsToRemove(componentsPattern);\n this.logger.setStatusLine(BEFORE_REMOVE); // again because the loader might changed when talking to the remote\n const consumer = this.workspace?.consumer;\n const removeResults = await removeComponents({\n workspace: this.workspace,\n ids: ComponentIdList.fromArray(bitIds),\n force,\n remote,\n track,\n deleteFiles,\n });\n if (consumer) await consumer.onDestroy('remove');\n return removeResults;\n }\n\n /**\n * remove components from the workspace.\n */\n async removeLocallyByIds(\n ids: ComponentID[],\n { force = false, reasonForRemoval }: { force?: boolean; reasonForRemoval?: string } = {}\n ) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const results = await removeComponents({\n workspace: this.workspace,\n ids: ComponentIdList.fromArray(ids),\n force,\n remote: false,\n track: false,\n deleteFiles: true,\n });\n await this.workspace.bitMap.write(`remove (by ${reasonForRemoval || 'N/A'})`);\n\n return results;\n }\n\n private async markRemoveComps(\n componentIds: ComponentID[],\n { updateMain, range, snaps }: DeleteOpts\n ): Promise<Component[]> {\n const allComponentsToMarkDeleted = await this.workspace.getMany(componentIds);\n\n const componentsToDeleteFromFs = range || snaps ? [] : allComponentsToMarkDeleted;\n const componentsIdsToDeleteFromFs = ComponentIdList.fromArray(componentsToDeleteFromFs.map((c) => c.id));\n await removeComponentsFromNodeModules(\n this.workspace.consumer,\n componentsToDeleteFromFs.map((c) => c.state._consumer)\n );\n // don't use `this.workspace.addSpecificComponentConfig`, if the component has component.json it will be deleted\n // during this removal along with the entire component dir.\n // in case this is range, the \"removed\" property is set to false. even when the range overlap the current version.\n // the reason is that if we set it to true, then, the component is considered as \"deleted\" for *all* versions.\n // remember that this config is always passed to the next version and if we set removed: true, it'll be copied\n // to the next version even when that version is not in the range.\n const config: RemoveInfo = { removed: !(range || snaps) };\n if (updateMain) config.removeOnMain = true;\n if (range) config.range = range;\n if (snaps && snaps.length) config.snaps = snaps;\n componentIds.forEach((compId) => this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, config));\n await this.workspace.bitMap.write('delete');\n await deleteComponentsFiles(this.workspace.consumer, componentsIdsToDeleteFromFs);\n\n return componentsToDeleteFromFs;\n }\n\n async deleteComps(componentsPattern: string, opts: DeleteOpts = {}): Promise<Component[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n const newComps = componentIds.filter((id) => !id.hasVersion());\n if (newComps.length) {\n throw new BitError(\n `no need to delete the following new component(s), please remove them by \"bit remove\"\\n${newComps\n .map((id) => id.toString())\n .join('\\n')}`\n );\n }\n const currentLane = await this.workspace.getCurrentLaneObject();\n const { updateMain } = opts;\n if (!updateMain && currentLane?.isNew) {\n throw new Error(\n 'no need to delete components from an un-exported lane, you can remove them by running \"bit remove\"'\n );\n }\n if (currentLane && !updateMain && opts.range) {\n throw new BitError(`--range is not needed when deleting components from a lane, unless --update-main is used`);\n }\n if (currentLane && !updateMain) {\n const laneComp = currentLane.toComponentIds();\n const compIdsNotOnLane = componentIds.filter((id) => !laneComp.hasWithoutVersion(id));\n if (compIdsNotOnLane.length) {\n throw new BitError(\n `unable to delete the following component(s) because they are not part of the current lane.\n${chalk.bold(compIdsNotOnLane.map((id) => id.toString()).join('\\n'))}\nto simply remove them from the workspace, use \"bit remove\".\nto delete them eventually from main, use \"--update-main\" flag and make sure to remove all occurrences from the code.`\n );\n }\n }\n return this.markRemoveComps(componentIds, opts);\n }\n\n /**\n * recover a soft-removed component.\n * there are 4 different scenarios.\n * 1. a component was just soft-removed, it wasn't snapped yet. so it's now in .bitmap with the \"removed\" aspect entry.\n * 1.a. the component still exists in the local scope. no need to import. write it from there.\n * 1.b. the component doesn't exist in the local scope. import it.\n * 2. soft-removed and then snapped. It's not in .bitmap now.\n * 3. soft-removed, snapped, exported. it's not in .bitmap now.\n * 4. a soft-removed components was imported, so it's now in .bitmap without the \"removed\" aspect entry.\n * 5. workspace is empty. the soft-removed component is on the remote.\n * returns `true` if it was recovered. `false` if the component wasn't soft-removed, so nothing to recover from.\n */\n async recover(compIdStr: string, options: RecoverOptions): Promise<boolean> {\n if (!this.workspace) throw new ConsumerNotFound();\n const bitMapEntry = this.workspace.consumer.bitMap.components.find((compMap) => {\n return compMap.id.fullName === compIdStr || compMap.id.toStringWithoutVersion() === compIdStr;\n });\n const importComp = async (idStr: string) => {\n await this.importer.import({\n ids: [idStr],\n installNpmPackages: !options.skipDependencyInstallation,\n writeConfigFiles: !options.skipWriteConfigFiles,\n override: true,\n });\n };\n const setAsRemovedFalse = async (compId: ComponentID) => {\n await this.workspace.addSpecificComponentConfig(compId, RemoveAspect.id, { removed: false });\n await this.workspace.bitMap.write('recover');\n };\n if (bitMapEntry) {\n if (bitMapEntry.config?.[RemoveAspect.id]) {\n // case #1\n const compFromScope = await this.workspace.scope.get(bitMapEntry.id);\n if (compFromScope) {\n // in the case the component is in the scope, we prefer to write it from the scope rather than import it.\n // because in some cases the \"import\" throws an error, e.g. when the component is diverged.\n await this.workspace.write(compFromScope, bitMapEntry.rootDir);\n this.workspace.bitMap.removeComponentConfig(bitMapEntry.id, RemoveAspect.id, false);\n await this.workspace.bitMap.write('recover');\n } else {\n delete bitMapEntry.config?.[RemoveAspect.id];\n await importComp(bitMapEntry.id.toString());\n }\n return true;\n }\n // case #4\n const compId = bitMapEntry.id;\n const comp = await this.workspace.get(compId);\n const removeInfo = await this.getRemoveInfo(comp);\n if (!removeInfo.removed && !removeInfo.range && !removeInfo.snaps) {\n return false;\n }\n await setAsRemovedFalse(compId);\n return true;\n }\n const compId = await this.workspace.scope.resolveComponentId(compIdStr);\n const currentLane = await this.workspace.getCurrentLaneObject();\n const idOnLane = currentLane?.getComponent(compId);\n const compIdWithPossibleVer = idOnLane ? compId.changeVersion(idOnLane.head.toString()) : compId;\n const compFromScope = await this.workspace.scope.get(compIdWithPossibleVer);\n if (compFromScope && (await this.isDeleted(compFromScope))) {\n // case #2 and #3\n await importComp(compIdWithPossibleVer._legacy.toString());\n await setAsRemovedFalse(compIdWithPossibleVer);\n return true;\n }\n // case #5\n let comp: Component | undefined;\n try {\n comp = await this.workspace.scope.getRemoteComponent(compId);\n } catch (err: any) {\n if (err instanceof NoHeadNoVersion) {\n throw new BitError(\n `unable to find the component ${compIdWithPossibleVer.toString()} in the current lane or main`\n );\n }\n throw err;\n }\n if (!(await this.isDeleted(comp))) {\n return false;\n }\n await importComp(compId._legacy.toString());\n await setAsRemovedFalse(compId);\n\n return true;\n }\n\n private async throwForMainComponentWhenOnLane(components: Component[]) {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return; // user on main\n const laneComps = currentLane.toBitIds();\n const mainComps = components.filter((comp) => !laneComps.hasWithoutVersion(comp.id));\n if (mainComps.length) {\n throw new BitError(`the following components belong to main, they cannot be soft-removed when on a lane. consider removing them without --soft.\n${mainComps.map((c) => c.id.toString()).join('\\n')}`);\n }\n }\n\n async getRemoveInfo(component: Component): Promise<RemoveInfo> {\n const headComponent = await this.getHeadComponent(component);\n const data = headComponent.config.extensions.findExtension(RemoveAspect.id)?.config as RemoveInfo | undefined;\n\n const isDeletedByRange = () => {\n if (!data?.range) return false;\n const currentTag = component.getTag();\n return Boolean(currentTag && semver.satisfies(currentTag.version, data.range));\n };\n const isDeletedBySnaps = () => {\n if (!data?.snaps || !component.id.version) return false;\n return data.snaps.includes(component.id.version);\n };\n\n return {\n removed: data?.removed || isDeletedByRange() || isDeletedBySnaps() || false,\n range: data?.range,\n snaps: data?.snaps,\n };\n }\n\n private async getHeadComponent(component: Component): Promise<Component> {\n if (\n component.id.version &&\n component.head &&\n component.id.version !== component.head?.hash &&\n component.id.version !== component.headTag?.version.version\n ) {\n const headComp = this.workspace // if workspace exits, prefer using the workspace as it may be modified\n ? await this.workspace.get(component.id.changeVersion(undefined))\n : await this.scope.get(component.id.changeVersion(component.head.hash));\n if (!headComp) throw new Error(`unable to get the head of ${component.id.toString()}`);\n return headComp;\n }\n return component;\n }\n\n /**\n * @deprecated use `isDeleted` instead.\n */\n async isRemoved(component: Component): Promise<boolean> {\n return this.isDeleted(component);\n }\n\n /**\n * whether a component is marked as deleted.\n */\n async isDeleted(component: Component): Promise<boolean> {\n const removeInfo = await this.getRemoveInfo(component);\n return removeInfo.removed;\n }\n\n /**\n * performant version of isRemoved() in case the component object is not available and loading it is expensive.\n */\n async isRemovedByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n if (!componentId.hasVersion()) return false;\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId);\n if (bitmapEntry && bitmapEntry.isRemoved()) return true;\n if (bitmapEntry && bitmapEntry.isRecovered()) return false;\n const modelComp = await this.workspace.scope.getBitObjectModelComponent(componentId.changeVersion(undefined));\n if (!modelComp) return false;\n const isRemoved = await modelComp.isRemoved(\n this.workspace.scope.legacyScope.objects,\n componentId.version as string\n );\n return Boolean(isRemoved);\n }\n\n async isEnvByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n const versionObj = await this.workspace.scope.getBitObjectVersionById(componentId);\n const envData = versionObj?.extensions.findCoreExtension('teambit.envs/envs');\n return envData?.data.type === 'env';\n }\n\n /**\n * get components that were soft-removed and tagged/snapped/merged but not exported yet.\n */\n async getRemovedStaged(): Promise<ComponentID[]> {\n return this.workspace.isOnMain() ? this.getRemovedStagedFromMain() : this.getRemovedStagedFromLane();\n }\n\n async addRemovedDependenciesIssues(components: Component[]) {\n const workspacePolicyManifest = this.depResolver.getWorkspacePolicyManifest();\n const workspaceDependencies = {\n ...workspacePolicyManifest.dependencies,\n ...workspacePolicyManifest.peerDependencies,\n };\n const installedDeps = Object.keys(workspaceDependencies);\n await pMapSeries(components, async (component) => {\n await this.addRemovedDepIssue(component, installedDeps);\n });\n }\n\n private async addRemovedDepIssue(component: Component, installedDeps: string[]) {\n const dependencies = this.depResolver.getComponentDependencies(component);\n const removedDependencies: ComponentID[] = [];\n let removedEnv: ComponentID | undefined;\n\n await Promise.all(\n dependencies.map(async (dep) => {\n const isRemoved = await this.isRemovedByIdWithoutLoadingComponent(dep.componentId);\n if (!isRemoved) return;\n\n // a component can be deleted from the workspace and installed as a package in different version.\n // normally, this is happening when checked out to a lane and a component is deleted from the lane.\n // the user still wants to use it but not as part of the lane.\n const packageName = dep.getPackageName();\n const isAvailableAsInstalledPackage = installedDeps.includes(packageName);\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(dep.componentId);\n if (bitmapEntry && isAvailableAsInstalledPackage && bitmapEntry.version !== dep.version) {\n return;\n }\n\n const isEnv = await this.isEnvByIdWithoutLoadingComponent(dep.componentId);\n if (isEnv) {\n removedEnv = dep.componentId;\n } else {\n removedDependencies.push(dep.componentId);\n }\n })\n );\n if (removedDependencies.length) {\n component.state.issues.getOrCreate(IssuesClasses.RemovedDependencies).data = removedDependencies.map((r) =>\n r.toString()\n );\n }\n if (removedEnv) {\n component.state.issues.getOrCreate(IssuesClasses.RemovedEnv).data = removedEnv.toString();\n }\n }\n\n private async getRemovedStagedFromMain(): Promise<ComponentID[]> {\n const stagedConfig = await this.workspace.scope.getStagedConfig();\n return stagedConfig\n .getAll()\n .filter((compConfig) => compConfig.config?.[RemoveAspect.id]?.removed)\n .map((compConfig) => compConfig.id);\n }\n\n private async getRemovedStagedFromLane(): Promise<ComponentID[]> {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return [];\n const laneIds = currentLane.toComponentIds();\n const workspaceIds = this.workspace.listIds();\n const laneCompIdsNotInWorkspace = laneIds.filter(\n (id) => !workspaceIds.find((wId) => wId.isEqualWithoutVersion(id))\n );\n if (!laneCompIdsNotInWorkspace.length) return [];\n const comps = await this.workspace.scope.getMany(laneCompIdsNotInWorkspace);\n const removed = comps.filter((c) => this.isDeleted(c));\n const staged = await Promise.all(\n removed.map(async (c) => {\n const snapDistance = await this.workspace.scope.getSnapDistance(c.id, false);\n if (snapDistance.err) {\n this.logger.warn(\n `getRemovedStagedFromLane unable to get snapDistance for ${c.id.toString()} due to ${snapDistance.err.name}`\n );\n // todo: not clear what should be done here. should we consider it as removed-staged or not.\n }\n if (snapDistance.isSourceAhead()) return c.id;\n return undefined;\n })\n );\n return compact(staged);\n }\n\n private async getLocalBitIdsToRemove(componentsPattern: string): Promise<ComponentID[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n return componentIds.map((id) => id);\n }\n\n private async getRemoteBitIdsToRemove(componentsPattern: string): Promise<ComponentID[]> {\n if (hasWildcard(componentsPattern)) {\n return this.lister.getRemoteCompIdsByWildcards(componentsPattern);\n }\n return [ComponentID.fromString(componentsPattern)];\n }\n\n static slots = [];\n static dependencies = [\n WorkspaceAspect,\n ScopeAspect,\n CLIAspect,\n LoggerAspect,\n ComponentAspect,\n ImporterAspect,\n DependencyResolverAspect,\n IssuesAspect,\n ListerAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([\n workspace,\n scope,\n cli,\n loggerMain,\n componentAspect,\n importerMain,\n depResolver,\n issues,\n lister,\n ]: [\n Workspace,\n ScopeMain,\n CLIMain,\n LoggerMain,\n ComponentMain,\n ImporterMain,\n DependencyResolverMain,\n IssuesMain,\n ListerMain,\n ]) {\n const logger = loggerMain.createLogger(RemoveAspect.id);\n const removeMain = new RemoveMain(workspace, scope, logger, importerMain, depResolver, lister);\n issues.registerAddComponentsIssues(removeMain.addRemovedDependenciesIssues.bind(removeMain));\n componentAspect.registerShowFragments([new RemoveFragment(removeMain)]);\n cli.register(\n new RemoveCmd(removeMain, workspace),\n new DeleteCmd(removeMain, workspace),\n new RecoverCmd(removeMain)\n );\n return removeMain;\n }\n}\n\nRemoveAspect.addRuntime(RemoveMain);\n\nexport default RemoveMain;\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAA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AAe,EACfC,YAAY,EACZlM,WAAW,EACXmK,MAAM,EACNlK,MAAM,CAWP,EAAE;IACD,MAAMH,MAAM,GAAGkM,UAAU,CAACG,YAAY,CAACtJ,sBAAY,CAACT,EAAE,CAAC;IACvD,MAAMgK,UAAU,GAAG,IAAI1M,UAAU,CAACE,SAAS,EAAEC,KAAK,EAAEC,MAAM,EAAEoM,YAAY,EAAElM,WAAW,EAAEC,MAAM,CAAC;IAC9FkK,MAAM,CAACkC,2BAA2B,CAACD,UAAU,CAACpD,4BAA4B,CAACsD,IAAI,CAACF,UAAU,CAAC,CAAC;IAC5FH,eAAe,CAACM,qBAAqB,CAAC,CAAC,KAAIC,yBAAc,EAACJ,UAAU,CAAC,CAAC,CAAC;IACvEL,GAAG,CAACU,QAAQ,CACV,KAAIC,sBAAS,EAACN,UAAU,EAAExM,SAAS,CAAC,EACpC,KAAI+M,sBAAS,EAACP,UAAU,EAAExM,SAAS,CAAC,EACpC,KAAIgN,wBAAU,EAACR,UAAU,CAC3B,CAAC;IACD,OAAOA,UAAU;EACnB;AACF;AAACS,OAAA,CAAAnN,UAAA,GAAAA,UAAA;AAAAjB,eAAA,CAncYiB,UAAU,WAqZN,EAAE;AAAAjB,eAAA,CArZNiB,UAAU,kBAsZC,CACpBoN,4BAAe,EACfC,oBAAW,EACXC,gBAAS,EACTC,sBAAY,EACZC,4BAAe,EACfC,0BAAc,EACdC,8CAAwB,EACxBC,sBAAY,EACZC,sBAAY,CACb;AAAA7O,eAAA,CAhaUiB,UAAU,aAiaJ6N,kBAAW;AAoC9B1K,sBAAY,CAAC2K,UAAU,CAAC9N,UAAU,CAAC;AAAC,IAAA+N,QAAA,GAAAZ,OAAA,CAAArP,OAAA,GAErBkC,UAAU","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentIdList } from '@teambit/component-id';
|
|
1
|
+
import type { ComponentIdList } from '@teambit/component-id';
|
|
2
2
|
import { RemovedObjects } from '@teambit/legacy.scope';
|
|
3
3
|
export declare class RemovedLocalObjects extends RemovedObjects {
|
|
4
4
|
modifiedComponents: ComponentIdList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_legacy","data","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RemovedLocalObjects","RemovedObjects","constructor","removedComponentIds","missingComponents","modifiedComponents","dependentBits","removedFromLane","exports"],"sources":["removed-local-objects.ts"],"sourcesContent":["import { ComponentIdList } from '@teambit/component-id';\nimport { RemovedObjects } from '@teambit/legacy.scope';\n\nexport class RemovedLocalObjects extends RemovedObjects {\n modifiedComponents: ComponentIdList;\n constructor(\n removedComponentIds?: ComponentIdList,\n missingComponents?: ComponentIdList,\n modifiedComponents?: ComponentIdList,\n dependentBits?: Record<string, any>,\n removedFromLane?: ComponentIdList\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,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAuD,SAAAE,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAEhD,MAAMgB,mBAAmB,SAASC,wBAAc,CAAC;EAEtDC,WAAWA,CACTC,mBAAqC,EACrCC,iBAAmC,EACnCC,kBAAoC,EACpCC,aAAmC,EACnCC,eAAiC,EACjC;IACA,KAAK,CAAC;MAAEJ,mBAAmB;MAAEC,iBAAiB;MAAEE,aAAa;MAAEC;IAAgB,CAAC,CAAC;IACjF;IAAA1B,eAAA;IACA,IAAI,CAACwB,kBAAkB,GAAGA,kBAAkB;EAC9C;AACF;AAACG,OAAA,CAAAR,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_legacy","data","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RemovedLocalObjects","RemovedObjects","constructor","removedComponentIds","missingComponents","modifiedComponents","dependentBits","removedFromLane","exports"],"sources":["removed-local-objects.ts"],"sourcesContent":["import type { ComponentIdList } from '@teambit/component-id';\nimport { RemovedObjects } from '@teambit/legacy.scope';\n\nexport class RemovedLocalObjects extends RemovedObjects {\n modifiedComponents: ComponentIdList;\n constructor(\n removedComponentIds?: ComponentIdList,\n missingComponents?: ComponentIdList,\n modifiedComponents?: ComponentIdList,\n dependentBits?: Record<string, any>,\n removedFromLane?: ComponentIdList\n ) {\n super({ removedComponentIds, missingComponents, dependentBits, removedFromLane });\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n this.modifiedComponents = modifi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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/remove",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.668",
|
|
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.668"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "4.1.2",
|
|
@@ -19,28 +19,28 @@
|
|
|
19
19
|
"semver": "7.7.1",
|
|
20
20
|
"@teambit/bit-error": "0.0.404",
|
|
21
21
|
"@teambit/legacy.constants": "0.0.13",
|
|
22
|
-
"@teambit/legacy.scope": "0.0.57",
|
|
23
22
|
"@teambit/component-id": "1.2.4",
|
|
24
|
-
"@teambit/component.sources": "0.0.109",
|
|
25
|
-
"@teambit/legacy.consumer": "0.0.57",
|
|
26
23
|
"@teambit/legacy.logger": "0.0.22",
|
|
27
|
-
"@teambit/legacy.component-list": "0.0.111",
|
|
28
|
-
"@teambit/legacy.consumer-component": "0.0.58",
|
|
29
|
-
"@teambit/pkg.modules.component-package-name": "0.0.64",
|
|
30
|
-
"@teambit/scope.network": "0.0.57",
|
|
31
|
-
"@teambit/scope.remotes": "0.0.57",
|
|
32
24
|
"@teambit/harmony": "0.4.7",
|
|
33
25
|
"@teambit/component-issues": "0.0.160",
|
|
34
26
|
"@teambit/legacy.utils": "0.0.22",
|
|
35
|
-
"@teambit/cli": "0.0.
|
|
36
|
-
"@teambit/
|
|
37
|
-
"@teambit/
|
|
38
|
-
"@teambit/
|
|
39
|
-
"@teambit/
|
|
40
|
-
"@teambit/
|
|
41
|
-
"@teambit/
|
|
42
|
-
"@teambit/
|
|
43
|
-
"@teambit/scope": "
|
|
27
|
+
"@teambit/cli": "0.0.1245",
|
|
28
|
+
"@teambit/legacy.scope": "0.0.58",
|
|
29
|
+
"@teambit/workspace": "1.0.668",
|
|
30
|
+
"@teambit/component.sources": "0.0.110",
|
|
31
|
+
"@teambit/legacy.consumer": "0.0.58",
|
|
32
|
+
"@teambit/legacy.component-list": "0.0.112",
|
|
33
|
+
"@teambit/legacy.consumer-component": "0.0.59",
|
|
34
|
+
"@teambit/pkg.modules.component-package-name": "0.0.65",
|
|
35
|
+
"@teambit/scope.network": "0.0.58",
|
|
36
|
+
"@teambit/scope.remotes": "0.0.58",
|
|
37
|
+
"@teambit/component": "1.0.668",
|
|
38
|
+
"@teambit/dependency-resolver": "1.0.668",
|
|
39
|
+
"@teambit/importer": "1.0.668",
|
|
40
|
+
"@teambit/issues": "1.0.668",
|
|
41
|
+
"@teambit/lister": "1.0.668",
|
|
42
|
+
"@teambit/logger": "0.0.1338",
|
|
43
|
+
"@teambit/scope": "1.0.668"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/fs-extra": "9.0.7",
|
|
File without changes
|