@teambit/remove 1.0.122 → 1.0.124
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 +0 -1
- package/dist/delete-cmd.js +0 -1
- package/dist/delete-cmd.js.map +1 -1
- package/dist/recover-cmd.d.ts +0 -1
- package/dist/recover-cmd.js +0 -1
- package/dist/recover-cmd.js.map +1 -1
- package/dist/remove-cmd.d.ts +0 -1
- package/dist/remove-cmd.js +0 -1
- package/dist/remove-cmd.js.map +1 -1
- package/dist/remove-components.d.ts +3 -3
- package/dist/remove-components.js +9 -7
- package/dist/remove-components.js.map +1 -1
- package/dist/remove.main.runtime.d.ts +2 -1
- package/dist/remove.main.runtime.js +5 -4
- package/dist/remove.main.runtime.js.map +1 -1
- package/package.json +9 -9
- /package/dist/{preview-1704270602796.js → preview-1704358107276.js} +0 -0
package/dist/delete-cmd.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ export declare class DeleteCmd implements Command {
|
|
|
17
17
|
alias: string;
|
|
18
18
|
options: CommandOptions;
|
|
19
19
|
loader: boolean;
|
|
20
|
-
migration: boolean;
|
|
21
20
|
remoteOp: boolean;
|
|
22
21
|
constructor(remove: RemoveMain, workspace?: Workspace);
|
|
23
22
|
report([componentsPattern]: [string], { force, lane, updateMain, hard, silent, }: {
|
package/dist/delete-cmd.js
CHANGED
|
@@ -62,7 +62,6 @@ this command marks the components as deleted, and after snap/tag and export they
|
|
|
62
62
|
_defineProperty(this, "alias", '');
|
|
63
63
|
_defineProperty(this, "options", [['', 'lane', 'when on a lane, delete the component from this lane only. avoid merging it to main or other lanes'], ['', 'update-main', 'EXPERIMENTAL. delete component/s on the main lane after merging this lane into main'], ['s', 'silent', 'skip confirmation'], ['', 'hard', 'NOT-RECOMMENDED. delete a component completely from a remote scope. careful! this is a permanent change that could corrupt dependents.'], ['f', 'force', 'relevant for --hard. allow the deletion even if used as a dependency. WARNING: components that depend on this component will corrupt']]);
|
|
64
64
|
_defineProperty(this, "loader", true);
|
|
65
|
-
_defineProperty(this, "migration", true);
|
|
66
65
|
_defineProperty(this, "remoteOp", true);
|
|
67
66
|
}
|
|
68
67
|
async report([componentsPattern], {
|
package/dist/delete-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_constants","_removeTemplate","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","DeleteCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","report","componentsPattern","force","lane","updateMain","hard","silent","isOnLane","BitError","isOnMain","removePrompt","localResult","remoteResult","remote","localMessage","removeTemplate","paintArray","removedCompIds","deleteComps","chalk","green","join","bold","removedObjectsArray","map","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/dist/scope/removed-components';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { RemoveMain } from './remove.main.runtime';\nimport { removeTemplate } from './remove-template';\n\nexport class DeleteCmd implements Command {\n name = 'delete <component-pattern>';\n description = 'mark components as deleted on the remote';\n extendedDescription = `to remove components from your local workspace only, use \"bit remove\" command.\nthis command marks the components as deleted, and after snap/tag and export they will be marked as deleted from the remote scope as well.\n`;\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n group = 'collaborate';\n helpUrl = 'reference/components/removing-components';\n skipWorkspace = true;\n alias = '';\n options = [\n ['', 'lane', 'when on a lane, delete the component from this lane only. avoid merging it to main or other lanes'],\n ['', 'update-main', 'EXPERIMENTAL. delete component/s on the main lane after merging this lane into main'],\n ['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 ] as CommandOptions;\n loader = true;\n
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_constants","_removeTemplate","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","DeleteCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","report","componentsPattern","force","lane","updateMain","hard","silent","isOnLane","BitError","isOnMain","removePrompt","localResult","remoteResult","remote","localMessage","removeTemplate","paintArray","removedCompIds","deleteComps","chalk","green","join","bold","removedObjectsArray","map","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/dist/scope/removed-components';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { RemoveMain } from './remove.main.runtime';\nimport { removeTemplate } from './remove-template';\n\nexport class DeleteCmd implements Command {\n name = 'delete <component-pattern>';\n description = 'mark components as deleted on the remote';\n extendedDescription = `to remove components from your local workspace only, use \"bit remove\" command.\nthis command marks the components as deleted, and after snap/tag and export they will be marked as deleted from the remote scope as well.\n`;\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n group = 'collaborate';\n helpUrl = 'reference/components/removing-components';\n skipWorkspace = true;\n alias = '';\n options = [\n ['', 'lane', 'when on a lane, delete the component from this lane only. avoid merging it to main or other lanes'],\n ['', 'update-main', 'EXPERIMENTAL. delete component/s on the main lane after merging this lane into main'],\n ['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 ] as CommandOptions;\n loader = true;\n remoteOp = true;\n\n constructor(private remove: RemoveMain, private workspace?: Workspace) {}\n\n async report(\n [componentsPattern]: [string],\n {\n force = false,\n lane = false,\n updateMain = false,\n hard = false,\n silent = false,\n }: {\n force?: boolean;\n lane?: boolean;\n updateMain?: boolean;\n hard?: boolean;\n silent?: boolean;\n }\n ) {\n if (this.workspace?.isOnLane() && !hard && !lane && !updateMain) {\n throw new BitError(`error: to delete components when on a lane, use --lane flag`);\n }\n if (this.workspace?.isOnMain() && updateMain) {\n throw new BitError(`--update-main is relevant only when on a lane`);\n }\n\n if (!silent) {\n await this.removePrompt(hard, lane);\n }\n\n if (hard) {\n const { localResult, remoteResult = [] } = await this.remove.remove({ componentsPattern, remote: true, force });\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n let localMessage = removeTemplate(localResult, false);\n if (localMessage !== '') localMessage += '\\n';\n return `${localMessage}${this.paintArray(remoteResult)}`;\n }\n\n const removedCompIds = await this.remove.deleteComps(componentsPattern, { updateMain });\n return `${chalk.green('successfully deleted the following components:')}\n${removedCompIds.join('\\n')}\n\n${chalk.bold('to update the remote, please tag/snap and then export. to revert, please use \"bit recover\"')}`;\n }\n\n private paintArray(removedObjectsArray: RemovedObjects[]) {\n return removedObjectsArray.map((item) => removeTemplate(item, true));\n }\n\n private async removePrompt(hard?: boolean, 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,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,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,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,C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CAACuB,WAAW,CAACjB,iBAAiB,EAAE;MAAEG;IAAW,CAAC,CAAC;IACvF,OAAQ,GAAEe,gBAAK,CAACC,KAAK,CAAC,gDAAgD,CAAE;AAC5E,EAAEH,cAAc,CAACI,IAAI,CAAC,IAAI,CAAE;AAC5B;AACA,EAAEF,gBAAK,CAACG,IAAI,CAAC,4FAA4F,CAAE,EAAC;EAC1G;EAEQN,UAAUA,CAACO,mBAAqC,EAAE;IACxD,OAAOA,mBAAmB,CAACC,GAAG,CAAEC,IAAI,IAAK,IAAAV,gCAAc,EAACU,IAAI,EAAE,IAAI,CAAC,CAAC;EACtE;EAEA,MAAcf,YAAYA,CAACL,IAAc,EAAEF,IAAc,EAAE;IACzD,IAAI,CAACR,MAAM,CAAC+B,MAAM,CAACC,eAAe,CAAC,CAAC;IACpC,MAAMC,iBAAiB,GAAGzB,IAAI,GACzB,uJAAsJ,GACtJ,2HAA0H;IAC/H,MAAM0B,mBAAmB,GAAGxB,IAAI,GAC3B,oKAAmK,GACnK,GAAEuB,iBAAkB;AAC7B,4GAA4G;IAExG,MAAME,EAAE,GAAG,MAAM,IAAAC,gBAAK,EAAC;MACrBC,QAAQ,EAAG,GAAEH,mBAAoB;AACvC,EAAEV,gBAAK,CAACG,IAAI,CAAC,2CAA2C,CAAE;IACtD,CAAC,CAAC;IACF,IAAI,CAACQ,EAAE,EAAE;MACP,MAAM,KAAItB,oBAAQ,EAAC,iCAAiC,CAAC;IACvD;EACF;AACF;AAACyB,OAAA,CAAAxC,SAAA,GAAAA,SAAA"}
|
package/dist/recover-cmd.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export declare class RecoverCmd implements Command {
|
|
|
11
11
|
group: string;
|
|
12
12
|
options: CommandOptions;
|
|
13
13
|
loader: boolean;
|
|
14
|
-
migration: boolean;
|
|
15
14
|
constructor(remove: RemoveMain);
|
|
16
15
|
report([componentName]: [string], options: RecoverOptions): Promise<string>;
|
|
17
16
|
}
|
package/dist/recover-cmd.js
CHANGED
|
@@ -30,7 +30,6 @@ class RecoverCmd {
|
|
|
30
30
|
_defineProperty(this, "group", 'collaborate');
|
|
31
31
|
_defineProperty(this, "options", [['x', 'skip-dependency-installation', 'do not install packages in case of importing components'], ['', 'skip-write-config-files', 'do not write config files (such as eslint, tsconfig, prettier, etc...)']]);
|
|
32
32
|
_defineProperty(this, "loader", true);
|
|
33
|
-
_defineProperty(this, "migration", true);
|
|
34
33
|
}
|
|
35
34
|
async report([componentName], options) {
|
|
36
35
|
const hasRecovered = await this.remove.recover(componentName, options);
|
package/dist/recover-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_bitError","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","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 = 'EXPERIMENTAL. 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
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_bitError","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","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 = 'EXPERIMENTAL. 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,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAA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AAA"}
|
package/dist/remove-cmd.d.ts
CHANGED
|
@@ -17,7 +17,6 @@ export declare class RemoveCmd implements Command {
|
|
|
17
17
|
alias: string;
|
|
18
18
|
options: CommandOptions;
|
|
19
19
|
loader: boolean;
|
|
20
|
-
migration: boolean;
|
|
21
20
|
remoteOp: boolean;
|
|
22
21
|
constructor(remove: RemoveMain, workspace?: Workspace);
|
|
23
22
|
report([componentsPattern]: [string], { force, track, silent, keepFiles, }: {
|
package/dist/remove-cmd.js
CHANGED
|
@@ -60,7 +60,6 @@ class RemoveCmd {
|
|
|
60
60
|
_defineProperty(this, "alias", 'rm');
|
|
61
61
|
_defineProperty(this, "options", [['t', 'track', 'keep tracking component in .bitmap (default = false), helps transform a tagged-component to new'], ['', 'keep-files', 'keep component files (just untrack the component)'], ['f', 'force', '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'], ['s', 'silent', 'skip confirmation']]);
|
|
62
62
|
_defineProperty(this, "loader", true);
|
|
63
|
-
_defineProperty(this, "migration", true);
|
|
64
63
|
_defineProperty(this, "remoteOp", true);
|
|
65
64
|
}
|
|
66
65
|
async report([componentsPattern], {
|
package/dist/remove-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_constants","_removeTemplate","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","RemoveCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","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/dist/constants';\nimport { RemovedLocalObjects } from './removed-local-objects';\nimport { RemoveMain } from './remove.main.runtime';\nimport { removeTemplate } from './remove-template';\n\nexport class RemoveCmd implements Command {\n name = 'remove <component-pattern>';\n description = 'remove component(s) from the local workspace';\n extendedDescription = `to mark components as deleted on the remote scope, use \"bit delete\".`;\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n group = 'collaborate';\n helpUrl = 'reference/components/removing-components';\n skipWorkspace = true;\n alias = 'rm';\n options = [\n ['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
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_constants","_removeTemplate","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","RemoveCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","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/dist/constants';\nimport { RemovedLocalObjects } from './removed-local-objects';\nimport { RemoveMain } from './remove.main.runtime';\nimport { removeTemplate } from './remove-template';\n\nexport class RemoveCmd implements Command {\n name = 'remove <component-pattern>';\n description = 'remove component(s) from the local workspace';\n extendedDescription = `to mark components as deleted on the remote scope, use \"bit delete\".`;\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n group = 'collaborate';\n helpUrl = 'reference/components/removing-components';\n skipWorkspace = true;\n alias = 'rm';\n options = [\n ['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 remoteOp = true;\n\n constructor(private remove: RemoveMain, private workspace?: Workspace) {}\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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C;IACA,MAAM;MACJE;IAGF,CAAC,GAAG,MAAM,IAAI,CAACZ,MAAM,CAACA,MAAM,CAAC;MAAEM,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,CAACb,MAAM,CAACgB,MAAM,CAACC,eAAe,CAAC,CAAC;IACpC,MAAMC,gBAAgB,GAAGL,WAAW,GAChC,8FAA8F,GAC9F,EAAE;IACN,MAAMM,EAAE,GAAG,MAAM,IAAAC,gBAAK,EAAC;MACrBC,QAAQ,EAAG;AACjB,oCAAoCH,gBAAiB;AACrD,EAAEI,gBAAK,CAACC,IAAI,CAAC,2CAA2C,CAAE;IACtD,CAAC,CAAC;IACF,IAAI,CAACJ,EAAE,EAAE;MACP,MAAM,KAAIK,oBAAQ,EAAC,iCAAiC,CAAC;IACvD;EACF;AACF;AAACC,OAAA,CAAA3B,SAAA,GAAAA,SAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Workspace } from '@teambit/workspace';
|
|
2
2
|
import { ComponentIdList } from '@teambit/component-id';
|
|
3
3
|
import RemovedObjects from '@teambit/legacy/dist/scope/removed-components';
|
|
4
4
|
import { RemovedLocalObjects } from './removed-local-objects';
|
|
@@ -15,8 +15,8 @@ export type RemoveComponentsResult = {
|
|
|
15
15
|
* @param {boolean} track - keep tracking local staged components in bitmap.
|
|
16
16
|
* @param {boolean} deleteFiles - delete local added files from fs.
|
|
17
17
|
*/
|
|
18
|
-
export declare function removeComponents({
|
|
19
|
-
|
|
18
|
+
export declare function removeComponents({ workspace, ids, force, remote, track, deleteFiles, }: {
|
|
19
|
+
workspace?: Workspace;
|
|
20
20
|
ids: ComponentIdList;
|
|
21
21
|
force: boolean;
|
|
22
22
|
remote: boolean;
|
|
@@ -136,7 +136,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
136
136
|
* @param {boolean} deleteFiles - delete local added files from fs.
|
|
137
137
|
*/
|
|
138
138
|
async function removeComponents({
|
|
139
|
-
|
|
139
|
+
workspace,
|
|
140
140
|
ids,
|
|
141
141
|
force,
|
|
142
142
|
remote,
|
|
@@ -154,8 +154,8 @@ async function removeComponents({
|
|
|
154
154
|
if (remote && localIds.length) {
|
|
155
155
|
throw new (_generalError().default)(`unable to remove the remote components: ${localIds.join(',')} as they don't contain a scope-name`);
|
|
156
156
|
}
|
|
157
|
-
const remoteResult = remote && !_ramda().default.isEmpty(remoteIds) ? await removeRemote(
|
|
158
|
-
const localResult = !remote ? await removeLocal(
|
|
157
|
+
const remoteResult = remote && !_ramda().default.isEmpty(remoteIds) ? await removeRemote(workspace, remoteIds, force) : [];
|
|
158
|
+
const localResult = !remote ? await removeLocal(workspace, bitIdsLatest, force, track, deleteFiles) : new (_removedLocalObjects().RemovedLocalObjects)();
|
|
159
159
|
return {
|
|
160
160
|
localResult,
|
|
161
161
|
remoteResult
|
|
@@ -168,9 +168,9 @@ async function removeComponents({
|
|
|
168
168
|
* @param {ComponentIdList} bitIds - list of remote component ids to delete
|
|
169
169
|
* @param {boolean} force - delete component that are used by other components.
|
|
170
170
|
*/
|
|
171
|
-
async function removeRemote(
|
|
171
|
+
async function removeRemote(workspace, bitIds, force) {
|
|
172
172
|
const groupedBitsByScope = (0, _groupArray().default)(bitIds, 'scope');
|
|
173
|
-
const remotes =
|
|
173
|
+
const remotes = workspace ? await (0, _scopeRemotes().getScopeRemotes)(workspace.scope.legacyScope) : await _remotes().Remotes.getGlobalRemotes();
|
|
174
174
|
const shouldGoToCentralHub = remotes.shouldGoToCentralHub(Object.keys(groupedBitsByScope));
|
|
175
175
|
if (shouldGoToCentralHub) {
|
|
176
176
|
const http = await _http().Http.connect(_constants().CENTRAL_BIT_HUB_URL, _constants().CENTRAL_BIT_HUB_NAME);
|
|
@@ -182,7 +182,7 @@ async function removeRemote(consumer, bitIds, force) {
|
|
|
182
182
|
const context = {};
|
|
183
183
|
(0, _enrichContextFromGlobal().default)(context);
|
|
184
184
|
const removeP = Object.keys(groupedBitsByScope).map(async key => {
|
|
185
|
-
const resolvedRemote = await remotes.resolve(key,
|
|
185
|
+
const resolvedRemote = await remotes.resolve(key, workspace?.scope.legacyScope);
|
|
186
186
|
const idsStr = groupedBitsByScope[key].map(id => id.toStringWithoutVersion());
|
|
187
187
|
return resolvedRemote.deleteMany(idsStr, force, context);
|
|
188
188
|
});
|
|
@@ -195,7 +195,8 @@ async function removeRemote(consumer, bitIds, force) {
|
|
|
195
195
|
* @param {boolean} force - delete component that are used by other components.
|
|
196
196
|
* @param {boolean} deleteFiles - delete component that are used by other components.
|
|
197
197
|
*/
|
|
198
|
-
async function removeLocal(
|
|
198
|
+
async function removeLocal(workspace, bitIds, force, track, deleteFiles) {
|
|
199
|
+
const consumer = workspace.consumer;
|
|
199
200
|
// local remove in case user wants to delete tagged components
|
|
200
201
|
const modifiedComponents = new (_componentId().ComponentIdList)();
|
|
201
202
|
const nonModifiedComponents = new (_componentId().ComponentIdList)();
|
|
@@ -240,6 +241,7 @@ async function removeLocal(consumer, bitIds, force, track, deleteFiles) {
|
|
|
240
241
|
const removedComponents = componentsToRemove.filter(c => idsToCleanFromWorkspace.hasWithoutVersion(c.id));
|
|
241
242
|
await packageJsonUtils().removeComponentsFromWorkspacesAndDependencies(consumer, removedComponents, invalidComponentsIds);
|
|
242
243
|
await consumer.cleanFromBitMap(idsToCleanFromWorkspace);
|
|
244
|
+
await workspace.cleanFromConfig(idsToCleanFromWorkspace);
|
|
243
245
|
}
|
|
244
246
|
}
|
|
245
247
|
return new (_removedLocalObjects().RemovedLocalObjects)(_componentId().ComponentIdList.uniqFromArray([...idsToCleanFromWorkspace, ...removedComponentIds]), missingComponents, modifiedComponents, dependentBits, removedFromLane);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_groupArray","data","_interopRequireDefault","require","_lodash","_ramda","_componentId","_constants","_generalError","_enrichContextFromGlobal","_logger","_http","_remotes","_scopeRemotes","_deleteComponentFiles","_componentsList","_consumerComponent","packageJsonUtils","_interopRequireWildcard","_pMapSeries","_removedLocalObjects","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","removeComponents","consumer","ids","force","remote","track","deleteFiles","logger","debugAndAddBreadCrumb","toString","bitIdsLatest","ComponentIdList","fromArray","map","id","changeVersion","LATEST_BIT_VERSION","localIds","remoteIds","partition","isLocal","length","GeneralError","join","remoteResult","R","isEmpty","removeRemote","localResult","removeLocal","RemovedLocalObjects","bitIds","groupedBitsByScope","groupArray","remotes","getScopeRemotes","scope","Remotes","getGlobalRemotes","shouldGoToCentralHub","keys","http","Http","connect","CENTRAL_BIT_HUB_URL","CENTRAL_BIT_HUB_NAME","deleteViaCentralHub","idsAreLanes","context","enrichContextFromGlobal","removeP","key","resolvedRemote","resolve","idsStr","toStringWithoutVersion","deleteMany","Promise","all","modifiedComponents","nonModifiedComponents","pMapSeries","componentStatus","getComponentStatusById","modified","push","err","Component","isComponentInvalidByErrorType","idsToRemove","componentsList","ComponentsList","newComponents","listNewComponents","idsToRemoveFromScope","filter","hasWithoutVersion","idsToCleanFromWorkspace","components","componentsToRemove","invalidComponents","loadComponents","removedComponentIds","missingComponents","dependentBits","removedFromLane","removeMany","deleteComponentsFiles","invalidComponentsIds","removedComponents","c","removeComponentsFromWorkspacesAndDependencies","cleanFromBitMap","uniqFromArray"],"sources":["remove-components.ts"],"sourcesContent":["import groupArray from 'group-array';\nimport partition from 'lodash.partition';\nimport R from 'ramda';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { ComponentIdList } from '@teambit/component-id';\nimport { CENTRAL_BIT_HUB_NAME, CENTRAL_BIT_HUB_URL, LATEST_BIT_VERSION } from '@teambit/legacy/dist/constants';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport enrichContextFromGlobal from '@teambit/legacy/dist/hooks/utils/enrich-context-from-global';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport { Http } from '@teambit/legacy/dist/scope/network/http';\nimport { Remotes } from '@teambit/legacy/dist/remotes';\nimport { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';\nimport deleteComponentsFiles from '@teambit/legacy/dist/consumer/component-ops/delete-component-files';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport Component from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport RemovedObjects from '@teambit/legacy/dist/scope/removed-components';\nimport * as packageJsonUtils from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport pMapSeries from 'p-map-series';\nimport { RemovedLocalObjects } from './removed-local-objects';\n\nexport type RemoveComponentsResult = { localResult: RemovedLocalObjects; remoteResult: RemovedObjects[] };\n\n/**\n * Remove components local and remote\n * splits array of ids into local and remote and removes according to flags\n * @param {string[]} ids - list of remote component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n * @param {boolean} remote - delete component from a remote scope\n * @param {boolean} track - keep tracking local staged components in bitmap.\n * @param {boolean} deleteFiles - delete local added files from fs.\n */\nexport async function removeComponents({\n consumer,\n ids,\n force,\n remote,\n track,\n deleteFiles,\n}: {\n consumer: Consumer | null | undefined; // 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 GeneralError(\n `unable to remove the remote components: ${localIds.join(',')} as they don't contain a scope-name`\n );\n }\n const remoteResult = remote && !R.isEmpty(remoteIds) ? await removeRemote(consumer, remoteIds, force) : [];\n const localResult = !remote\n ? await removeLocal(consumer as Consumer, bitIdsLatest, force, track, deleteFiles)\n : new RemovedLocalObjects();\n\n return { localResult, remoteResult };\n}\n\n/**\n * Remove remote component from ssh server\n * this method groups remote components by remote name and deletes remote components together\n * @param {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 consumer: Consumer | null | undefined,\n bitIds: ComponentIdList,\n force: boolean\n): Promise<RemovedObjects[]> {\n const groupedBitsByScope = groupArray(bitIds, 'scope');\n const remotes = consumer ? await getScopeRemotes(consumer.scope) : await Remotes.getGlobalRemotes();\n const shouldGoToCentralHub = remotes.shouldGoToCentralHub(Object.keys(groupedBitsByScope));\n if (shouldGoToCentralHub) {\n const http = await Http.connect(CENTRAL_BIT_HUB_URL, CENTRAL_BIT_HUB_NAME);\n return http.deleteViaCentralHub(\n bitIds.map((id) => id.toString()),\n { force, idsAreLanes: false }\n );\n }\n const context = {};\n enrichContextFromGlobal(context);\n const removeP = Object.keys(groupedBitsByScope).map(async (key) => {\n const resolvedRemote = await remotes.resolve(key, consumer?.scope);\n const idsStr = groupedBitsByScope[key].map((id) => id.toStringWithoutVersion());\n return resolvedRemote.deleteMany(idsStr, force, context);\n });\n\n return Promise.all(removeP);\n}\n\n/**\n * removeLocal - remove local (imported, new staged components) from modules and bitmap according to flags\n * @param {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 consumer: Consumer,\n bitIds: ComponentIdList,\n force: boolean,\n track: boolean,\n deleteFiles: boolean\n): Promise<RemovedLocalObjects> {\n // local remove in case user wants to delete tagged components\n const modifiedComponents = new ComponentIdList();\n const nonModifiedComponents = new ComponentIdList();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n if (R.isEmpty(bitIds)) return new RemovedLocalObjects();\n if (!force) {\n await pMapSeries(bitIds, async (id) => {\n try {\n const componentStatus = await consumer.getComponentStatusById(id);\n if (componentStatus.modified) modifiedComponents.push(id);\n else nonModifiedComponents.push(id);\n } catch (err: any) {\n // if a component has an error, such as, missing main file, we do want to allow removing that component\n if (Component.isComponentInvalidByErrorType(err)) {\n nonModifiedComponents.push(id);\n } else {\n throw err;\n }\n }\n });\n }\n const idsToRemove = force ? bitIds : nonModifiedComponents;\n const componentsList = new ComponentsList(consumer);\n const newComponents = (await componentsList.listNewComponents(false)) as ComponentIdList;\n const idsToRemoveFromScope = ComponentIdList.fromArray(\n idsToRemove.filter((id) => !newComponents.hasWithoutVersion(id))\n );\n const idsToCleanFromWorkspace = ComponentIdList.fromArray(\n idsToRemove.filter((id) => newComponents.hasWithoutVersion(id))\n );\n const { components: componentsToRemove, invalidComponents } = await consumer.loadComponents(idsToRemove, false);\n const { removedComponentIds, missingComponents, dependentBits, removedFromLane } = await consumer.scope.removeMany(\n idsToRemoveFromScope,\n force,\n consumer\n );\n // otherwise, components should still be in .bitmap file\n idsToCleanFromWorkspace.push(...removedComponentIds);\n if (idsToCleanFromWorkspace.length) {\n if (deleteFiles) await deleteComponentsFiles(consumer, idsToCleanFromWorkspace);\n if (!track) {\n const invalidComponentsIds = invalidComponents.map((i) => i.id);\n const removedComponents = componentsToRemove.filter((c) => idsToCleanFromWorkspace.hasWithoutVersion(c.id));\n await packageJsonUtils.removeComponentsFromWorkspacesAndDependencies(\n consumer,\n removedComponents,\n invalidComponentsIds\n );\n await consumer.cleanFromBitMap(idsToCleanFromWorkspace);\n }\n }\n return new RemovedLocalObjects(\n ComponentIdList.uniqFromArray([...idsToCleanFromWorkspace, ...removedComponentIds]),\n missingComponents,\n modifiedComponents,\n dependentBits,\n removedFromLane\n );\n}\n"],"mappings":";;;;;;AAA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AAiB,CAAC9D,EAAE,CAAC,CAChE,CAAC;EACD,MAAM;IAAEgE,UAAU,EAAEC,kBAAkB;IAAEC;EAAkB,CAAC,GAAG,MAAM/E,QAAQ,CAACgF,cAAc,CAACZ,WAAW,EAAE,KAAK,CAAC;EAC/G,MAAM;IAAEa,mBAAmB;IAAEC,iBAAiB;IAAEC,aAAa;IAAEC;EAAgB,CAAC,GAAG,MAAMpF,QAAQ,CAACmC,KAAK,CAACkD,UAAU,CAChHZ,oBAAoB,EACpBvE,KAAK,EACLF,QACF,CAAC;EACD;EACA4E,uBAAuB,CAACZ,IAAI,CAAC,GAAGiB,mBAAmB,CAAC;EACpD,IAAIL,uBAAuB,CAACxD,MAAM,EAAE;IAClC,IAAIf,WAAW,EAAE,MAAM,IAAAiF,+BAAqB,EAACtF,QAAQ,EAAE4E,uBAAuB,CAAC;IAC/E,IAAI,CAACxE,KAAK,EAAE;MACV,MAAMmF,oBAAoB,GAAGR,iBAAiB,CAACnE,GAAG,CAAEhB,CAAC,IAAKA,CAAC,CAACiB,EAAE,CAAC;MAC/D,MAAM2E,iBAAiB,GAAGV,kBAAkB,CAACJ,MAAM,CAAEe,CAAC,IAAKb,uBAAuB,CAACD,iBAAiB,CAACc,CAAC,CAAC5E,EAAE,CAAC,CAAC;MAC3G,MAAMxC,gBAAgB,CAAD,CAAC,CAACqH,6CAA6C,CAClE1F,QAAQ,EACRwF,iBAAiB,EACjBD,oBACF,CAAC;MACD,MAAMvF,QAAQ,CAAC2F,eAAe,CAACf,uBAAuB,CAAC;IACzD;EACF;EACA,OAAO,KAAI/C,0CAAmB,EAC5BnB,8BAAe,CAACkF,aAAa,CAAC,CAAC,GAAGhB,uBAAuB,EAAE,GAAGK,mBAAmB,CAAC,CAAC,EACnFC,iBAAiB,EACjBxB,kBAAkB,EAClByB,aAAa,EACbC,eACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"names":["_groupArray","data","_interopRequireDefault","require","_lodash","_ramda","_componentId","_constants","_generalError","_enrichContextFromGlobal","_logger","_http","_remotes","_scopeRemotes","_deleteComponentFiles","_componentsList","_consumerComponent","packageJsonUtils","_interopRequireWildcard","_pMapSeries","_removedLocalObjects","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","removeComponents","workspace","ids","force","remote","track","deleteFiles","logger","debugAndAddBreadCrumb","toString","bitIdsLatest","ComponentIdList","fromArray","map","id","changeVersion","LATEST_BIT_VERSION","localIds","remoteIds","partition","isLocal","length","GeneralError","join","remoteResult","R","isEmpty","removeRemote","localResult","removeLocal","RemovedLocalObjects","bitIds","groupedBitsByScope","groupArray","remotes","getScopeRemotes","scope","legacyScope","Remotes","getGlobalRemotes","shouldGoToCentralHub","keys","http","Http","connect","CENTRAL_BIT_HUB_URL","CENTRAL_BIT_HUB_NAME","deleteViaCentralHub","idsAreLanes","context","enrichContextFromGlobal","removeP","key","resolvedRemote","resolve","idsStr","toStringWithoutVersion","deleteMany","Promise","all","consumer","modifiedComponents","nonModifiedComponents","pMapSeries","componentStatus","getComponentStatusById","modified","push","err","Component","isComponentInvalidByErrorType","idsToRemove","componentsList","ComponentsList","newComponents","listNewComponents","idsToRemoveFromScope","filter","hasWithoutVersion","idsToCleanFromWorkspace","components","componentsToRemove","invalidComponents","loadComponents","removedComponentIds","missingComponents","dependentBits","removedFromLane","removeMany","deleteComponentsFiles","invalidComponentsIds","removedComponents","c","removeComponentsFromWorkspacesAndDependencies","cleanFromBitMap","cleanFromConfig","uniqFromArray"],"sources":["remove-components.ts"],"sourcesContent":["import groupArray from 'group-array';\nimport partition from 'lodash.partition';\nimport { Workspace } from '@teambit/workspace';\nimport R from 'ramda';\nimport { ComponentIdList } from '@teambit/component-id';\nimport { CENTRAL_BIT_HUB_NAME, CENTRAL_BIT_HUB_URL, LATEST_BIT_VERSION } from '@teambit/legacy/dist/constants';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport enrichContextFromGlobal from '@teambit/legacy/dist/hooks/utils/enrich-context-from-global';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport { Http } from '@teambit/legacy/dist/scope/network/http';\nimport { Remotes } from '@teambit/legacy/dist/remotes';\nimport { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';\nimport deleteComponentsFiles from '@teambit/legacy/dist/consumer/component-ops/delete-component-files';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport Component from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport RemovedObjects from '@teambit/legacy/dist/scope/removed-components';\nimport * as packageJsonUtils from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport pMapSeries from 'p-map-series';\nimport { RemovedLocalObjects } from './removed-local-objects';\n\nexport type RemoveComponentsResult = { localResult: RemovedLocalObjects; remoteResult: RemovedObjects[] };\n\n/**\n * Remove components local and remote\n * splits array of ids into local and remote and removes according to flags\n * @param {string[]} ids - list of remote component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n * @param {boolean} remote - delete component from a remote scope\n * @param {boolean} track - keep tracking local staged components in bitmap.\n * @param {boolean} deleteFiles - delete local added files from fs.\n */\nexport async function removeComponents({\n 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 GeneralError(\n `unable to remove the remote components: ${localIds.join(',')} as they don't contain a scope-name`\n );\n }\n const remoteResult = remote && !R.isEmpty(remoteIds) ? await removeRemote(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 ssh server\n * this method groups remote components by remote name and deletes remote components together\n * @param {ComponentIdList} bitIds - list of remote component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n */\nasync function removeRemote(\n workspace: Workspace | undefined,\n bitIds: ComponentIdList,\n force: boolean\n): Promise<RemovedObjects[]> {\n const groupedBitsByScope = groupArray(bitIds, 'scope');\n const remotes = workspace ? await getScopeRemotes(workspace.scope.legacyScope) : await Remotes.getGlobalRemotes();\n const shouldGoToCentralHub = remotes.shouldGoToCentralHub(Object.keys(groupedBitsByScope));\n if (shouldGoToCentralHub) {\n const http = await Http.connect(CENTRAL_BIT_HUB_URL, CENTRAL_BIT_HUB_NAME);\n return http.deleteViaCentralHub(\n bitIds.map((id) => id.toString()),\n { force, idsAreLanes: false }\n );\n }\n const context = {};\n enrichContextFromGlobal(context);\n const removeP = Object.keys(groupedBitsByScope).map(async (key) => {\n const resolvedRemote = await remotes.resolve(key, workspace?.scope.legacyScope);\n const idsStr = groupedBitsByScope[key].map((id) => id.toStringWithoutVersion());\n return resolvedRemote.deleteMany(idsStr, force, context);\n });\n\n return Promise.all(removeP);\n}\n\n/**\n * removeLocal - remove local (imported, new staged components) from modules and bitmap according to flags\n * @param {ComponentIdList} bitIds - list of component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n * @param {boolean} deleteFiles - delete component that are used by other components.\n */\nasync function removeLocal(\n workspace: Workspace,\n bitIds: ComponentIdList,\n force: boolean,\n track: boolean,\n deleteFiles: boolean\n): Promise<RemovedLocalObjects> {\n const consumer = workspace.consumer;\n // local remove in case user wants to delete tagged components\n const modifiedComponents = new ComponentIdList();\n const nonModifiedComponents = new ComponentIdList();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n if (R.isEmpty(bitIds)) return new RemovedLocalObjects();\n if (!force) {\n await pMapSeries(bitIds, async (id) => {\n try {\n const componentStatus = await consumer.getComponentStatusById(id);\n if (componentStatus.modified) modifiedComponents.push(id);\n else nonModifiedComponents.push(id);\n } catch (err: any) {\n // if a component has an error, such as, missing main file, we do want to allow removing that component\n if (Component.isComponentInvalidByErrorType(err)) {\n nonModifiedComponents.push(id);\n } else {\n throw err;\n }\n }\n });\n }\n const idsToRemove = force ? bitIds : nonModifiedComponents;\n const componentsList = new ComponentsList(consumer);\n const newComponents = (await componentsList.listNewComponents(false)) as ComponentIdList;\n const idsToRemoveFromScope = ComponentIdList.fromArray(\n idsToRemove.filter((id) => !newComponents.hasWithoutVersion(id))\n );\n const idsToCleanFromWorkspace = ComponentIdList.fromArray(\n idsToRemove.filter((id) => newComponents.hasWithoutVersion(id))\n );\n const { components: componentsToRemove, invalidComponents } = await consumer.loadComponents(idsToRemove, false);\n const { removedComponentIds, missingComponents, dependentBits, removedFromLane } = await consumer.scope.removeMany(\n idsToRemoveFromScope,\n force,\n consumer\n );\n // otherwise, components should still be in .bitmap file\n idsToCleanFromWorkspace.push(...removedComponentIds);\n if (idsToCleanFromWorkspace.length) {\n if (deleteFiles) await deleteComponentsFiles(consumer, idsToCleanFromWorkspace);\n if (!track) {\n const invalidComponentsIds = invalidComponents.map((i) => i.id);\n const removedComponents = componentsToRemove.filter((c) => idsToCleanFromWorkspace.hasWithoutVersion(c.id));\n await packageJsonUtils.removeComponentsFromWorkspacesAndDependencies(\n consumer,\n removedComponents,\n invalidComponentsIds\n );\n await consumer.cleanFromBitMap(idsToCleanFromWorkspace);\n await workspace.cleanFromConfig(idsToCleanFromWorkspace);\n }\n }\n return new RemovedLocalObjects(\n ComponentIdList.uniqFromArray([...idsToCleanFromWorkspace, ...removedComponentIds]),\n missingComponents,\n modifiedComponents,\n dependentBits,\n removedFromLane\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBA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
|
@@ -31,8 +31,9 @@ export declare class RemoveMain {
|
|
|
31
31
|
/**
|
|
32
32
|
* remove components from the workspace.
|
|
33
33
|
*/
|
|
34
|
-
removeLocallyByIds(ids: ComponentID[], { force }?: {
|
|
34
|
+
removeLocallyByIds(ids: ComponentID[], { force, reasonForRemoval }?: {
|
|
35
35
|
force?: boolean;
|
|
36
|
+
reasonForRemoval?: string;
|
|
36
37
|
}): Promise<RemoveComponentsResult>;
|
|
37
38
|
markRemoveComps(componentIds: ComponentID[], shouldUpdateMain?: boolean): Promise<ComponentID[]>;
|
|
38
39
|
deleteComps(componentsPattern: string, opts?: {
|
|
@@ -198,7 +198,7 @@ class RemoveMain {
|
|
|
198
198
|
this.logger.setStatusLine(BEFORE_REMOVE); // again because the loader might changed when talking to the remote
|
|
199
199
|
const consumer = this.workspace?.consumer;
|
|
200
200
|
const removeResults = await (0, _removeComponents().removeComponents)({
|
|
201
|
-
|
|
201
|
+
workspace: this.workspace,
|
|
202
202
|
ids: _componentId().ComponentIdList.fromArray(bitIds),
|
|
203
203
|
force,
|
|
204
204
|
remote,
|
|
@@ -213,18 +213,19 @@ class RemoveMain {
|
|
|
213
213
|
* remove components from the workspace.
|
|
214
214
|
*/
|
|
215
215
|
async removeLocallyByIds(ids, {
|
|
216
|
-
force = false
|
|
216
|
+
force = false,
|
|
217
|
+
reasonForRemoval
|
|
217
218
|
} = {}) {
|
|
218
219
|
if (!this.workspace) throw new (_workspace().OutsideWorkspaceError)();
|
|
219
220
|
const results = await (0, _removeComponents().removeComponents)({
|
|
220
|
-
|
|
221
|
+
workspace: this.workspace,
|
|
221
222
|
ids: _componentId().ComponentIdList.fromArray(ids),
|
|
222
223
|
force,
|
|
223
224
|
remote: false,
|
|
224
225
|
track: false,
|
|
225
226
|
deleteFiles: true
|
|
226
227
|
});
|
|
227
|
-
await this.workspace.bitMap.write(
|
|
228
|
+
await this.workspace.bitMap.write(`remove (by ${reasonForRemoval || 'N/A'})`);
|
|
228
229
|
return results;
|
|
229
230
|
}
|
|
230
231
|
async markRemoveComps(componentIds, shouldUpdateMain = false) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_logger","_workspace","_interopRequireWildcard","_componentId","_exceptions","_importer","_interopRequireDefault","_lodash","_hasWildcard","_listScope","_bitError","_deleteComponentFiles","_dependencyResolver","_componentIssues","_issues","_pMapSeries","_noHeadNoVersion","_component","_packageJsonUtils","_removeCmd","_removeComponents","_remove","_remove2","_recoverCmd","_deleteCmd","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_defineProperty","key","value","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","String","Symbol","toPrimitive","TypeError","Number","BEFORE_REMOVE","RemoveMain","constructor","workspace","logger","importer","depResolver","remove","componentsPattern","force","remote","track","deleteFiles","setStatusLine","bitIds","getRemoteBitIdsToRemove","getLocalBitIdsToRemove","consumer","removeResults","removeComponents","ids","ComponentIdList","fromArray","onDestroy","removeLocallyByIds","OutsideWorkspaceError","results","bitMap","write","markRemoveComps","componentIds","shouldUpdateMain","components","getMany","removeComponentsFromNodeModules","map","c","state","_consumer","config","removed","removeOnMain","compId","addComponentConfig","RemoveAspect","id","deleteComponentsFiles","deleteComps","opts","ConsumerNotFound","idsByPattern","newComps","filter","hasVersion","length","BitError","toString","join","currentLane","getCurrentLaneObject","updateMain","isNew","Error","recover","compIdStr","options","bitMapEntry","find","compMap","fullName","toStringWithoutVersion","importComp","idStr","import","installNpmPackages","skipDependencyInstallation","writeConfigFiles","skipWriteConfigFiles","override","setAsRemovedFalse","addSpecificComponentConfig","compFromScope","scope","rootDir","removeComponentConfig","resolveComponentId","comp","isRemoved","idOnLane","getComponent","compIdWithPossibleVer","changeVersion","head","_legacy","getRemoteComponent","err","NoHeadNoVersion","throwForMainComponentWhenOnLane","laneComps","toBitIds","mainComps","hasWithoutVersion","getRemoveInfo","component","extensions","findExtension","isRemovedByIdWithoutLoadingComponent","componentId","bitmapEntry","getBitmapEntryIfExist","isRecovered","modelComp","getBitObjectModelComponent","versionObj","getBitObjectVersion","version","getRemovedStaged","isOnMain","getRemovedStagedFromMain","getRemovedStagedFromLane","addRemovedDependenciesIssues","pMapSeries","addRemovedDepIssue","dependencies","getComponentDependencies","removedWithUndefined","Promise","all","dep","undefined","compact","issues","getOrCreate","IssuesClasses","RemovedDependencies","stagedConfig","getStagedConfig","getAll","compConfig","laneIds","workspaceIds","listIds","laneIdsNotInWorkspace","wId","isEqualWithoutVersion","laneCompIdsNotInWorkspace","resolveMultipleComponentIds","comps","staged","snapDistance","getSnapDistance","warn","name","isSourceAhead","hasWildcard","getRemoteBitIdsByWildcards","ComponentID","fromString","provider","cli","loggerMain","componentAspect","importerMain","createLogger","removeMain","registerAddComponentsIssues","bind","registerShowFragments","RemoveFragment","register","RemoveCmd","DeleteCmd","RecoverCmd","exports","WorkspaceAspect","CLIAspect","LoggerAspect","ComponentAspect","ImporterAspect","DependencyResolverAspect","IssuesAspect","MainRuntime","addRuntime","_default"],"sources":["remove.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport ImporterAspect, { ImporterMain } from '@teambit/importer';\nimport { compact } from 'lodash';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport { getRemoteBitIdsByWildcards } from '@teambit/legacy/dist/api/consumer/lib/list-scope';\nimport { BitError } from '@teambit/bit-error';\nimport deleteComponentsFiles from '@teambit/legacy/dist/consumer/component-ops/delete-component-files';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport IssuesAspect, { IssuesMain } from '@teambit/issues';\nimport pMapSeries from 'p-map-series';\nimport { NoHeadNoVersion } from '@teambit/legacy/dist/scope/exceptions/no-head-no-version';\nimport ComponentAspect, { Component, ComponentMain } from '@teambit/component';\nimport { removeComponentsFromNodeModules } from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport { RemoveCmd } from './remove-cmd';\nimport { RemoveComponentsResult, removeComponents } from './remove-components';\nimport { RemoveAspect } from './remove.aspect';\nimport { RemoveFragment } from './remove.fragment';\nimport { RecoverCmd, RecoverOptions } from './recover-cmd';\nimport { DeleteCmd } from './delete-cmd';\n\nconst BEFORE_REMOVE = 'removing components';\n\nexport type RemoveInfo = {\n removed: boolean;\n /**\n * whether to remove the component from default lane once merged\n */\n removeOnMain?: boolean;\n};\n\nexport class RemoveMain {\n constructor(\n private workspace: Workspace,\n public logger: Logger,\n private importer: ImporterMain,\n private depResolver: DependencyResolverMain\n ) {}\n\n async remove({\n componentsPattern,\n force = false,\n remote = false,\n track = false,\n deleteFiles = true,\n }: {\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 consumer,\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(ids: ComponentID[], { force = false }: { force?: boolean } = {}) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const results = await removeComponents({\n consumer: this.workspace.consumer,\n ids: ComponentIdList.fromArray(ids),\n force,\n remote: false,\n track: false,\n deleteFiles: true,\n });\n await this.workspace.bitMap.write('remove');\n\n return results;\n }\n\n async markRemoveComps(componentIds: ComponentID[], shouldUpdateMain = false) {\n const components = await this.workspace.getMany(componentIds);\n await removeComponentsFromNodeModules(\n this.workspace.consumer,\n components.map((c) => c.state._consumer)\n );\n // don't use `this.workspace.addSpecificComponentConfig`, if the component has component.json it will be deleted\n // during this removal along with the entire component dir.\n const config: RemoveInfo = { removed: true };\n if (shouldUpdateMain) config.removeOnMain = true;\n componentIds.map((compId) => this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, config));\n await this.workspace.bitMap.write('delete');\n const bitIds = ComponentIdList.fromArray(componentIds.map((id) => id));\n await deleteComponentsFiles(this.workspace.consumer, bitIds);\n\n return componentIds;\n }\n\n async deleteComps(componentsPattern: string, opts: { updateMain?: boolean } = {}): Promise<ComponentID[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n const newComps = componentIds.filter((id) => !id.hasVersion());\n if (newComps.length) {\n throw new BitError(\n `no need to delete the following new component(s), please remove them by \"bit remove\"\\n${newComps\n .map((id) => id.toString())\n .join('\\n')}`\n );\n }\n const currentLane = await this.workspace.getCurrentLaneObject();\n const { updateMain } = opts;\n if (!updateMain && currentLane?.isNew) {\n throw new Error(\n 'no need to delete components from an un-exported lane, you can remove them by running \"bit remove\"'\n );\n }\n\n return this.markRemoveComps(componentIds, updateMain);\n }\n\n /**\n * recover a soft-removed component.\n * there are 4 different scenarios.\n * 1. a component was just soft-removed, it wasn't snapped yet. so it's now in .bitmap with the \"removed\" aspect entry.\n * 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 = await this.workspace.resolveComponentId(bitMapEntry.id);\n const comp = await this.workspace.get(compId);\n if (!this.isRemoved(comp)) {\n return false;\n }\n await setAsRemovedFalse(compId);\n return true;\n }\n const compId = await this.workspace.scope.resolveComponentId(compIdStr);\n const currentLane = await this.workspace.getCurrentLaneObject();\n const idOnLane = currentLane?.getComponent(compId);\n const compIdWithPossibleVer = idOnLane ? compId.changeVersion(idOnLane.head.toString()) : compId;\n const compFromScope = await this.workspace.scope.get(compIdWithPossibleVer);\n if (compFromScope && this.isRemoved(compFromScope)) {\n // case #2 and #3\n await importComp(compIdWithPossibleVer._legacy.toString());\n await setAsRemovedFalse(compIdWithPossibleVer);\n return true;\n }\n // case #5\n 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 (!this.isRemoved(comp)) {\n return false;\n }\n await importComp(compId._legacy.toString());\n await setAsRemovedFalse(compId);\n\n return true;\n }\n\n private async throwForMainComponentWhenOnLane(components: Component[]) {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return; // user on main\n const laneComps = currentLane.toBitIds();\n const mainComps = components.filter((comp) => !laneComps.hasWithoutVersion(comp.id));\n if (mainComps.length) {\n throw new BitError(`the following components belong to main, they cannot be soft-removed when on a lane. consider removing them without --soft.\n${mainComps.map((c) => c.id.toString()).join('\\n')}`);\n }\n }\n\n getRemoveInfo(component: Component): RemoveInfo {\n const data = component.config.extensions.findExtension(RemoveAspect.id)?.config as RemoveInfo | undefined;\n return {\n removed: data?.removed || false,\n };\n }\n\n isRemoved(component: Component): boolean {\n return this.getRemoveInfo(component).removed;\n }\n\n /**\n * performant version of isRemoved() in case the component object is not available and loading it is expensive.\n */\n async isRemovedByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n if (!componentId.hasVersion()) return false;\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId);\n if (bitmapEntry && bitmapEntry.isRemoved()) return true;\n if (bitmapEntry && bitmapEntry.isRecovered()) return false;\n const modelComp = await this.workspace.scope.getBitObjectModelComponent(componentId);\n if (!modelComp) return false;\n const versionObj = await this.workspace.scope.getBitObjectVersion(modelComp, componentId.version as string);\n if (!versionObj) return false;\n return versionObj.isRemoved();\n }\n\n /**\n * get components that were soft-removed and tagged/snapped/merged but not exported yet.\n */\n async getRemovedStaged(): Promise<ComponentID[]> {\n return this.workspace.isOnMain() ? this.getRemovedStagedFromMain() : this.getRemovedStagedFromLane();\n }\n\n async addRemovedDependenciesIssues(components: Component[]) {\n await pMapSeries(components, async (component) => {\n await this.addRemovedDepIssue(component);\n });\n }\n\n private async addRemovedDepIssue(component: Component) {\n const dependencies = await this.depResolver.getComponentDependencies(component);\n const removedWithUndefined = await Promise.all(\n dependencies.map(async (dep) => {\n const isRemoved = await this.isRemovedByIdWithoutLoadingComponent(dep.componentId);\n if (isRemoved) return dep.componentId;\n return undefined;\n })\n );\n const removed = compact(removedWithUndefined).map((id) => id.toString());\n if (removed.length) {\n component.state.issues.getOrCreate(IssuesClasses.RemovedDependencies).data = removed;\n }\n }\n\n private async getRemovedStagedFromMain(): Promise<ComponentID[]> {\n const stagedConfig = await this.workspace.scope.getStagedConfig();\n return stagedConfig\n .getAll()\n .filter((compConfig) => compConfig.config?.[RemoveAspect.id]?.removed)\n .map((compConfig) => compConfig.id);\n }\n\n private async getRemovedStagedFromLane(): Promise<ComponentID[]> {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return [];\n const laneIds = currentLane.toBitIds();\n const workspaceIds = await this.workspace.listIds();\n const laneIdsNotInWorkspace = laneIds.filter((id) => !workspaceIds.find((wId) => wId.isEqualWithoutVersion(id)));\n if (!laneIdsNotInWorkspace.length) return [];\n const laneCompIdsNotInWorkspace = await this.workspace.scope.resolveMultipleComponentIds(laneIdsNotInWorkspace);\n const comps = await this.workspace.scope.getMany(laneCompIdsNotInWorkspace);\n const removed = comps.filter((c) => this.isRemoved(c));\n const staged = await Promise.all(\n removed.map(async (c) => {\n const snapDistance = await this.workspace.scope.getSnapDistance(c.id, false);\n if (snapDistance.err) {\n this.logger.warn(\n `getRemovedStagedFromLane unable to get snapDistance for ${c.id.toString()} due to ${snapDistance.err.name}`\n );\n // todo: not clear what should be done here. should we consider it as removed-staged or not.\n }\n if (snapDistance.isSourceAhead()) return c.id;\n return undefined;\n })\n );\n return compact(staged);\n }\n\n private async getLocalBitIdsToRemove(componentsPattern: string): Promise<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 getRemoteBitIdsByWildcards(componentsPattern);\n }\n return [ComponentID.fromString(componentsPattern)];\n }\n\n static slots = [];\n static dependencies = [\n WorkspaceAspect,\n CLIAspect,\n LoggerAspect,\n ComponentAspect,\n ImporterAspect,\n DependencyResolverAspect,\n IssuesAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([workspace, cli, loggerMain, componentAspect, importerMain, depResolver, issues]: [\n Workspace,\n CLIMain,\n LoggerMain,\n ComponentMain,\n ImporterMain,\n DependencyResolverMain,\n IssuesMain\n ]) {\n const logger = loggerMain.createLogger(RemoveAspect.id);\n const removeMain = new RemoveMain(workspace, logger, importerMain, depResolver);\n issues.registerAddComponentsIssues(removeMain.addRemovedDependenciesIssues.bind(removeMain));\n componentAspect.registerShowFragments([new RemoveFragment(removeMain)]);\n cli.register(\n new RemoveCmd(removeMain, workspace),\n new DeleteCmd(removeMain, workspace),\n new RecoverCmd(removeMain)\n );\n return removeMain;\n }\n}\n\nRemoveAspect.addRuntime(RemoveMain);\n\nexport default RemoveMain;\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAH,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,aAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;E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C;IACD,OAAOA,UAAU;EACnB;AACF;AAACS,OAAA,CAAA5K,UAAA,GAAAA,UAAA;AAAAd,eAAA,CAvUYc,UAAU,WAuSN,EAAE;AAAAd,eAAA,CAvSNc,UAAU,kBAwSC,CACpB6K,oBAAe,EACfC,gBAAS,EACTC,sBAAY,EACZC,oBAAe,EACfC,mBAAc,EACdC,8CAAwB,EACxBC,iBAAY,CACb;AAAAjM,eAAA,CAhTUc,UAAU,aAiTJoL,kBAAW;AAwB9BzI,sBAAY,CAAC0I,UAAU,CAACrL,UAAU,CAAC;AAAC,IAAAsL,QAAA,GAAAV,OAAA,CAAA9M,OAAA,GAErBkC,UAAU"}
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_logger","_workspace","_interopRequireWildcard","_componentId","_exceptions","_importer","_interopRequireDefault","_lodash","_hasWildcard","_listScope","_bitError","_deleteComponentFiles","_dependencyResolver","_componentIssues","_issues","_pMapSeries","_noHeadNoVersion","_component","_packageJsonUtils","_removeCmd","_removeComponents","_remove","_remove2","_recoverCmd","_deleteCmd","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_defineProperty","key","value","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","String","Symbol","toPrimitive","TypeError","Number","BEFORE_REMOVE","RemoveMain","constructor","workspace","logger","importer","depResolver","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","shouldUpdateMain","components","getMany","removeComponentsFromNodeModules","map","c","state","_consumer","config","removed","removeOnMain","compId","addComponentConfig","RemoveAspect","id","deleteComponentsFiles","deleteComps","opts","ConsumerNotFound","idsByPattern","newComps","filter","hasVersion","length","BitError","toString","join","currentLane","getCurrentLaneObject","updateMain","isNew","Error","recover","compIdStr","options","bitMapEntry","find","compMap","fullName","toStringWithoutVersion","importComp","idStr","import","installNpmPackages","skipDependencyInstallation","writeConfigFiles","skipWriteConfigFiles","override","setAsRemovedFalse","addSpecificComponentConfig","compFromScope","scope","rootDir","removeComponentConfig","resolveComponentId","comp","isRemoved","idOnLane","getComponent","compIdWithPossibleVer","changeVersion","head","_legacy","getRemoteComponent","err","NoHeadNoVersion","throwForMainComponentWhenOnLane","laneComps","toBitIds","mainComps","hasWithoutVersion","getRemoveInfo","component","extensions","findExtension","isRemovedByIdWithoutLoadingComponent","componentId","bitmapEntry","getBitmapEntryIfExist","isRecovered","modelComp","getBitObjectModelComponent","versionObj","getBitObjectVersion","version","getRemovedStaged","isOnMain","getRemovedStagedFromMain","getRemovedStagedFromLane","addRemovedDependenciesIssues","pMapSeries","addRemovedDepIssue","dependencies","getComponentDependencies","removedWithUndefined","Promise","all","dep","undefined","compact","issues","getOrCreate","IssuesClasses","RemovedDependencies","stagedConfig","getStagedConfig","getAll","compConfig","laneIds","workspaceIds","listIds","laneIdsNotInWorkspace","wId","isEqualWithoutVersion","laneCompIdsNotInWorkspace","resolveMultipleComponentIds","comps","staged","snapDistance","getSnapDistance","warn","name","isSourceAhead","hasWildcard","getRemoteBitIdsByWildcards","ComponentID","fromString","provider","cli","loggerMain","componentAspect","importerMain","createLogger","removeMain","registerAddComponentsIssues","bind","registerShowFragments","RemoveFragment","register","RemoveCmd","DeleteCmd","RecoverCmd","exports","WorkspaceAspect","CLIAspect","LoggerAspect","ComponentAspect","ImporterAspect","DependencyResolverAspect","IssuesAspect","MainRuntime","addRuntime","_default"],"sources":["remove.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport ImporterAspect, { ImporterMain } from '@teambit/importer';\nimport { compact } from 'lodash';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport { getRemoteBitIdsByWildcards } from '@teambit/legacy/dist/api/consumer/lib/list-scope';\nimport { BitError } from '@teambit/bit-error';\nimport deleteComponentsFiles from '@teambit/legacy/dist/consumer/component-ops/delete-component-files';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport IssuesAspect, { IssuesMain } from '@teambit/issues';\nimport pMapSeries from 'p-map-series';\nimport { NoHeadNoVersion } from '@teambit/legacy/dist/scope/exceptions/no-head-no-version';\nimport ComponentAspect, { Component, ComponentMain } from '@teambit/component';\nimport { removeComponentsFromNodeModules } from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport { RemoveCmd } from './remove-cmd';\nimport { RemoveComponentsResult, removeComponents } from './remove-components';\nimport { RemoveAspect } from './remove.aspect';\nimport { RemoveFragment } from './remove.fragment';\nimport { RecoverCmd, RecoverOptions } from './recover-cmd';\nimport { DeleteCmd } from './delete-cmd';\n\nconst BEFORE_REMOVE = 'removing components';\n\nexport type RemoveInfo = {\n removed: boolean;\n /**\n * whether to remove the component from default lane once merged\n */\n removeOnMain?: boolean;\n};\n\nexport class RemoveMain {\n constructor(\n private workspace: Workspace,\n public logger: Logger,\n private importer: ImporterMain,\n private depResolver: DependencyResolverMain\n ) {}\n\n async remove({\n componentsPattern,\n force = false,\n remote = false,\n track = false,\n deleteFiles = true,\n }: {\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 async markRemoveComps(componentIds: ComponentID[], shouldUpdateMain = false) {\n const components = await this.workspace.getMany(componentIds);\n await removeComponentsFromNodeModules(\n this.workspace.consumer,\n components.map((c) => c.state._consumer)\n );\n // don't use `this.workspace.addSpecificComponentConfig`, if the component has component.json it will be deleted\n // during this removal along with the entire component dir.\n const config: RemoveInfo = { removed: true };\n if (shouldUpdateMain) config.removeOnMain = true;\n componentIds.map((compId) => this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, config));\n await this.workspace.bitMap.write('delete');\n const bitIds = ComponentIdList.fromArray(componentIds.map((id) => id));\n await deleteComponentsFiles(this.workspace.consumer, bitIds);\n\n return componentIds;\n }\n\n async deleteComps(componentsPattern: string, opts: { updateMain?: boolean } = {}): Promise<ComponentID[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n const newComps = componentIds.filter((id) => !id.hasVersion());\n if (newComps.length) {\n throw new BitError(\n `no need to delete the following new component(s), please remove them by \"bit remove\"\\n${newComps\n .map((id) => id.toString())\n .join('\\n')}`\n );\n }\n const currentLane = await this.workspace.getCurrentLaneObject();\n const { updateMain } = opts;\n if (!updateMain && currentLane?.isNew) {\n throw new Error(\n 'no need to delete components from an un-exported lane, you can remove them by running \"bit remove\"'\n );\n }\n\n return this.markRemoveComps(componentIds, updateMain);\n }\n\n /**\n * recover a soft-removed component.\n * there are 4 different scenarios.\n * 1. a component was just soft-removed, it wasn't snapped yet. so it's now in .bitmap with the \"removed\" aspect entry.\n * 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 = await this.workspace.resolveComponentId(bitMapEntry.id);\n const comp = await this.workspace.get(compId);\n if (!this.isRemoved(comp)) {\n return false;\n }\n await setAsRemovedFalse(compId);\n return true;\n }\n const compId = await this.workspace.scope.resolveComponentId(compIdStr);\n const currentLane = await this.workspace.getCurrentLaneObject();\n const idOnLane = currentLane?.getComponent(compId);\n const compIdWithPossibleVer = idOnLane ? compId.changeVersion(idOnLane.head.toString()) : compId;\n const compFromScope = await this.workspace.scope.get(compIdWithPossibleVer);\n if (compFromScope && this.isRemoved(compFromScope)) {\n // case #2 and #3\n await importComp(compIdWithPossibleVer._legacy.toString());\n await setAsRemovedFalse(compIdWithPossibleVer);\n return true;\n }\n // case #5\n 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 (!this.isRemoved(comp)) {\n return false;\n }\n await importComp(compId._legacy.toString());\n await setAsRemovedFalse(compId);\n\n return true;\n }\n\n private async throwForMainComponentWhenOnLane(components: Component[]) {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return; // user on main\n const laneComps = currentLane.toBitIds();\n const mainComps = components.filter((comp) => !laneComps.hasWithoutVersion(comp.id));\n if (mainComps.length) {\n throw new BitError(`the following components belong to main, they cannot be soft-removed when on a lane. consider removing them without --soft.\n${mainComps.map((c) => c.id.toString()).join('\\n')}`);\n }\n }\n\n getRemoveInfo(component: Component): RemoveInfo {\n const data = component.config.extensions.findExtension(RemoveAspect.id)?.config as RemoveInfo | undefined;\n return {\n removed: data?.removed || false,\n };\n }\n\n isRemoved(component: Component): boolean {\n return this.getRemoveInfo(component).removed;\n }\n\n /**\n * performant version of isRemoved() in case the component object is not available and loading it is expensive.\n */\n async isRemovedByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n if (!componentId.hasVersion()) return false;\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId);\n if (bitmapEntry && bitmapEntry.isRemoved()) return true;\n if (bitmapEntry && bitmapEntry.isRecovered()) return false;\n const modelComp = await this.workspace.scope.getBitObjectModelComponent(componentId);\n if (!modelComp) return false;\n const versionObj = await this.workspace.scope.getBitObjectVersion(modelComp, componentId.version as string);\n if (!versionObj) return false;\n return versionObj.isRemoved();\n }\n\n /**\n * get components that were soft-removed and tagged/snapped/merged but not exported yet.\n */\n async getRemovedStaged(): Promise<ComponentID[]> {\n return this.workspace.isOnMain() ? this.getRemovedStagedFromMain() : this.getRemovedStagedFromLane();\n }\n\n async addRemovedDependenciesIssues(components: Component[]) {\n await pMapSeries(components, async (component) => {\n await this.addRemovedDepIssue(component);\n });\n }\n\n private async addRemovedDepIssue(component: Component) {\n const dependencies = await this.depResolver.getComponentDependencies(component);\n const removedWithUndefined = await Promise.all(\n dependencies.map(async (dep) => {\n const isRemoved = await this.isRemovedByIdWithoutLoadingComponent(dep.componentId);\n if (isRemoved) return dep.componentId;\n return undefined;\n })\n );\n const removed = compact(removedWithUndefined).map((id) => id.toString());\n if (removed.length) {\n component.state.issues.getOrCreate(IssuesClasses.RemovedDependencies).data = removed;\n }\n }\n\n private async getRemovedStagedFromMain(): Promise<ComponentID[]> {\n const stagedConfig = await this.workspace.scope.getStagedConfig();\n return stagedConfig\n .getAll()\n .filter((compConfig) => compConfig.config?.[RemoveAspect.id]?.removed)\n .map((compConfig) => compConfig.id);\n }\n\n private async getRemovedStagedFromLane(): Promise<ComponentID[]> {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return [];\n const laneIds = currentLane.toBitIds();\n const workspaceIds = await this.workspace.listIds();\n const laneIdsNotInWorkspace = laneIds.filter((id) => !workspaceIds.find((wId) => wId.isEqualWithoutVersion(id)));\n if (!laneIdsNotInWorkspace.length) return [];\n const laneCompIdsNotInWorkspace = await this.workspace.scope.resolveMultipleComponentIds(laneIdsNotInWorkspace);\n const comps = await this.workspace.scope.getMany(laneCompIdsNotInWorkspace);\n const removed = comps.filter((c) => this.isRemoved(c));\n const staged = await Promise.all(\n removed.map(async (c) => {\n const snapDistance = await this.workspace.scope.getSnapDistance(c.id, false);\n if (snapDistance.err) {\n this.logger.warn(\n `getRemovedStagedFromLane unable to get snapDistance for ${c.id.toString()} due to ${snapDistance.err.name}`\n );\n // todo: not clear what should be done here. should we consider it as removed-staged or not.\n }\n if (snapDistance.isSourceAhead()) return c.id;\n return undefined;\n })\n );\n return compact(staged);\n }\n\n private async getLocalBitIdsToRemove(componentsPattern: string): Promise<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 getRemoteBitIdsByWildcards(componentsPattern);\n }\n return [ComponentID.fromString(componentsPattern)];\n }\n\n static slots = [];\n static dependencies = [\n WorkspaceAspect,\n CLIAspect,\n LoggerAspect,\n ComponentAspect,\n ImporterAspect,\n DependencyResolverAspect,\n IssuesAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([workspace, cli, loggerMain, componentAspect, importerMain, depResolver, issues]: [\n Workspace,\n CLIMain,\n LoggerMain,\n ComponentMain,\n ImporterMain,\n DependencyResolverMain,\n IssuesMain\n ]) {\n const logger = loggerMain.createLogger(RemoveAspect.id);\n const removeMain = new RemoveMain(workspace, logger, importerMain, depResolver);\n issues.registerAddComponentsIssues(removeMain.addRemovedDependenciesIssues.bind(removeMain));\n componentAspect.registerShowFragments([new RemoveFragment(removeMain)]);\n cli.register(\n new RemoveCmd(removeMain, workspace),\n new DeleteCmd(removeMain, workspace),\n new RecoverCmd(removeMain)\n );\n return removeMain;\n }\n}\n\nRemoveAspect.addRuntime(RemoveMain);\n\nexport default RemoveMain;\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAA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H,UAAU,GAAG,IAAIpK,UAAU,CAACE,SAAS,EAAEC,MAAM,EAAE+J,YAAY,EAAE7J,WAAW,CAAC;IAC/E8H,MAAM,CAACkC,2BAA2B,CAACD,UAAU,CAAC5C,4BAA4B,CAAC8C,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,EAAElK,SAAS,CAAC,EACpC,KAAIyK,sBAAS,EAACP,UAAU,EAAElK,SAAS,CAAC,EACpC,KAAI0K,wBAAU,EAACR,UAAU,CAC3B,CAAC;IACD,OAAOA,UAAU;EACnB;AACF;AAACS,OAAA,CAAA7K,UAAA,GAAAA,UAAA;AAAAd,eAAA,CA1UYc,UAAU,WA0SN,EAAE;AAAAd,eAAA,CA1SNc,UAAU,kBA2SC,CACpB8K,oBAAe,EACfC,gBAAS,EACTC,sBAAY,EACZC,oBAAe,EACfC,mBAAc,EACdC,8CAAwB,EACxBC,iBAAY,CACb;AAAAlM,eAAA,CAnTUc,UAAU,aAoTJqL,kBAAW;AAwB9BzI,sBAAY,CAAC0I,UAAU,CAACtL,UAAU,CAAC;AAAC,IAAAuL,QAAA,GAAAV,OAAA,CAAA/M,OAAA,GAErBkC,UAAU"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/remove",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.124",
|
|
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.124"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"@teambit/bit-error": "0.0.404",
|
|
20
20
|
"@teambit/component-id": "1.2.0",
|
|
21
21
|
"@teambit/harmony": "0.4.6",
|
|
22
|
-
"@teambit/cli": "0.0.
|
|
23
|
-
"@teambit/workspace": "1.0.
|
|
24
|
-
"@teambit/component": "1.0.
|
|
22
|
+
"@teambit/cli": "0.0.845",
|
|
23
|
+
"@teambit/workspace": "1.0.124",
|
|
24
|
+
"@teambit/component": "1.0.124",
|
|
25
25
|
"@teambit/component-issues": "0.0.140",
|
|
26
|
-
"@teambit/dependency-resolver": "1.0.
|
|
27
|
-
"@teambit/importer": "1.0.
|
|
28
|
-
"@teambit/issues": "1.0.
|
|
29
|
-
"@teambit/logger": "0.0.
|
|
26
|
+
"@teambit/dependency-resolver": "1.0.124",
|
|
27
|
+
"@teambit/importer": "1.0.124",
|
|
28
|
+
"@teambit/issues": "1.0.124",
|
|
29
|
+
"@teambit/logger": "0.0.938"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/lodash": "4.14.165",
|
|
File without changes
|