@teambit/remove 1.0.27 → 1.0.30
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/index.d.ts +1 -0
- package/dist/index.js.map +1 -1
- package/dist/recover-cmd.d.ts +1 -0
- package/dist/recover-cmd.js +1 -1
- package/dist/recover-cmd.js.map +1 -1
- package/dist/remove-cmd.js.map +1 -1
- package/dist/remove-components.d.ts +3 -3
- package/dist/remove-components.js +14 -14
- package/dist/remove-components.js.map +1 -1
- package/dist/remove-template.js +4 -4
- package/dist/remove-template.js.map +1 -1
- package/dist/remove.main.runtime.d.ts +2 -3
- package/dist/remove.main.runtime.js +29 -35
- package/dist/remove.main.runtime.js.map +1 -1
- package/dist/removed-local-objects.d.ts +4 -4
- package/dist/removed-local-objects.js +2 -2
- package/dist/removed-local-objects.js.map +1 -1
- package/package.json +13 -14
- /package/dist/{preview-1697628054879.js → preview-1697841196686.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RemoveAspect } from './remove.aspect';
|
|
2
2
|
export type { RemoveMain, RemoveInfo } from './remove.main.runtime';
|
|
3
|
+
export type { RemovedLocalObjects } from './removed-local-objects';
|
|
3
4
|
export { removeTemplate } from './remove-template';
|
|
4
5
|
export default RemoveAspect;
|
|
5
6
|
export { RemoveAspect };
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_remove","data","require","_removeTemplate","_default","RemoveAspect","exports","default"],"sources":["index.ts"],"sourcesContent":["import { RemoveAspect } from './remove.aspect';\n\nexport type { RemoveMain, RemoveInfo } from './remove.main.runtime';\nexport { removeTemplate } from './remove-template';\nexport default RemoveAspect;\nexport { RemoveAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;
|
|
1
|
+
{"version":3,"names":["_remove","data","require","_removeTemplate","_default","RemoveAspect","exports","default"],"sources":["index.ts"],"sourcesContent":["import { RemoveAspect } from './remove.aspect';\n\nexport type { RemoveMain, RemoveInfo } from './remove.main.runtime';\nexport type { RemovedLocalObjects } from './removed-local-objects';\nexport { removeTemplate } from './remove-template';\nexport default RemoveAspect;\nexport { RemoveAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAmD,IAAAG,QAAA,GACpCC,sBAAY;AAAAC,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
|
package/dist/recover-cmd.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Command, CommandOptions } from '@teambit/cli';
|
|
|
2
2
|
import { RemoveMain } from './remove.main.runtime';
|
|
3
3
|
export declare type RecoverOptions = {
|
|
4
4
|
skipDependencyInstallation?: boolean;
|
|
5
|
+
skipWriteConfigFiles?: boolean;
|
|
5
6
|
};
|
|
6
7
|
export declare class RecoverCmd implements Command {
|
|
7
8
|
private remove;
|
package/dist/recover-cmd.js
CHANGED
|
@@ -28,7 +28,7 @@ class RecoverCmd {
|
|
|
28
28
|
_defineProperty(this, "name", 'recover <component-name>');
|
|
29
29
|
_defineProperty(this, "description", 'EXPERIMENTAL. recover component(s) soft-deleted from the workspace, or a remote scope');
|
|
30
30
|
_defineProperty(this, "group", 'collaborate');
|
|
31
|
-
_defineProperty(this, "options", [['x', 'skip-dependency-installation', 'do not install packages in case of importing components']]);
|
|
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
33
|
_defineProperty(this, "migration", true);
|
|
34
34
|
}
|
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","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","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};\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 ] as CommandOptions;\n loader = true;\n migration = 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,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;AAAA,SAAAM,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA,EAAAT,KAAA;
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_bitError","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","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 migration = 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,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;AAAA,SAAAM,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAA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_interopRequireDefault","require","_yesno","_bitError","_constants","_removeTemplate","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","RemoveCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","report","componentsPattern","force","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 migration = true;\n remoteOp = true;\n\n constructor(private remove: RemoveMain, private workspace?: Workspace) {}\n\n async report(\n [componentsPattern]: [string],\n {\n force = false,\n 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,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAM,gBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,eAAA,YAAAA,CA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AAI,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
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_constants","_removeTemplate","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","RemoveCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","report","componentsPattern","force","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 migration = true;\n remoteOp = true;\n\n constructor(private remove: RemoveMain, private workspace?: Workspace) {}\n\n async report(\n [componentsPattern]: [string],\n {\n force = false,\n 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,IA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AM,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,7 +1,7 @@
|
|
|
1
1
|
import { Consumer } from '@teambit/legacy/dist/consumer';
|
|
2
|
-
import
|
|
2
|
+
import { ComponentIdList } from '@teambit/component-id';
|
|
3
3
|
import RemovedObjects from '@teambit/legacy/dist/scope/removed-components';
|
|
4
|
-
import RemovedLocalObjects from './removed-local-objects';
|
|
4
|
+
import { RemovedLocalObjects } from './removed-local-objects';
|
|
5
5
|
export declare type RemoveComponentsResult = {
|
|
6
6
|
localResult: RemovedLocalObjects;
|
|
7
7
|
remoteResult: RemovedObjects[];
|
|
@@ -17,7 +17,7 @@ export declare type RemoveComponentsResult = {
|
|
|
17
17
|
*/
|
|
18
18
|
export declare function removeComponents({ consumer, ids, force, remote, track, deleteFiles, }: {
|
|
19
19
|
consumer: Consumer | null | undefined;
|
|
20
|
-
ids:
|
|
20
|
+
ids: ComponentIdList;
|
|
21
21
|
force: boolean;
|
|
22
22
|
remote: boolean;
|
|
23
23
|
track: boolean;
|
|
@@ -25,9 +25,9 @@ function _ramda() {
|
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
const data =
|
|
30
|
-
|
|
28
|
+
function _componentId() {
|
|
29
|
+
const data = require("@teambit/component-id");
|
|
30
|
+
_componentId = function () {
|
|
31
31
|
return data;
|
|
32
32
|
};
|
|
33
33
|
return data;
|
|
@@ -117,7 +117,7 @@ function _pMapSeries() {
|
|
|
117
117
|
return data;
|
|
118
118
|
}
|
|
119
119
|
function _removedLocalObjects() {
|
|
120
|
-
const data =
|
|
120
|
+
const data = require("./removed-local-objects");
|
|
121
121
|
_removedLocalObjects = function () {
|
|
122
122
|
return data;
|
|
123
123
|
};
|
|
@@ -147,7 +147,7 @@ async function removeComponents({
|
|
|
147
147
|
ids: ids.toString()
|
|
148
148
|
});
|
|
149
149
|
// added this to remove support for remove only one version from a component
|
|
150
|
-
const bitIdsLatest =
|
|
150
|
+
const bitIdsLatest = _componentId().ComponentIdList.fromArray(ids.map(id => {
|
|
151
151
|
return id.changeVersion(_constants().LATEST_BIT_VERSION);
|
|
152
152
|
}));
|
|
153
153
|
const [localIds, remoteIds] = (0, _lodash().default)(bitIdsLatest, id => id.isLocal());
|
|
@@ -155,7 +155,7 @@ async function removeComponents({
|
|
|
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
157
|
const remoteResult = remote && !_ramda().default.isEmpty(remoteIds) ? await removeRemote(consumer, remoteIds, force) : [];
|
|
158
|
-
const localResult = !remote ? await removeLocal(consumer, bitIdsLatest, force, track, deleteFiles) : new (_removedLocalObjects().
|
|
158
|
+
const localResult = !remote ? await removeLocal(consumer, bitIdsLatest, force, track, deleteFiles) : new (_removedLocalObjects().RemovedLocalObjects)();
|
|
159
159
|
return {
|
|
160
160
|
localResult,
|
|
161
161
|
remoteResult
|
|
@@ -165,7 +165,7 @@ async function removeComponents({
|
|
|
165
165
|
/**
|
|
166
166
|
* Remove remote component from ssh server
|
|
167
167
|
* this method groups remote components by remote name and deletes remote components together
|
|
168
|
-
* @param {
|
|
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
171
|
async function removeRemote(consumer, bitIds, force) {
|
|
@@ -191,16 +191,16 @@ async function removeRemote(consumer, bitIds, force) {
|
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
193
|
* removeLocal - remove local (imported, new staged components) from modules and bitmap according to flags
|
|
194
|
-
* @param {
|
|
194
|
+
* @param {ComponentIdList} bitIds - list of component ids to delete
|
|
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
198
|
async function removeLocal(consumer, bitIds, force, track, deleteFiles) {
|
|
199
199
|
// local remove in case user wants to delete tagged components
|
|
200
|
-
const modifiedComponents = new (
|
|
201
|
-
const nonModifiedComponents = new (
|
|
200
|
+
const modifiedComponents = new (_componentId().ComponentIdList)();
|
|
201
|
+
const nonModifiedComponents = new (_componentId().ComponentIdList)();
|
|
202
202
|
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
203
|
-
if (_ramda().default.isEmpty(bitIds)) return new (_removedLocalObjects().
|
|
203
|
+
if (_ramda().default.isEmpty(bitIds)) return new (_removedLocalObjects().RemovedLocalObjects)();
|
|
204
204
|
if (!force) {
|
|
205
205
|
await (0, _pMapSeries().default)(bitIds, async id => {
|
|
206
206
|
try {
|
|
@@ -219,8 +219,8 @@ async function removeLocal(consumer, bitIds, force, track, deleteFiles) {
|
|
|
219
219
|
const idsToRemove = force ? bitIds : nonModifiedComponents;
|
|
220
220
|
const componentsList = new (_componentsList().default)(consumer);
|
|
221
221
|
const newComponents = await componentsList.listNewComponents(false);
|
|
222
|
-
const idsToRemoveFromScope =
|
|
223
|
-
const idsToCleanFromWorkspace =
|
|
222
|
+
const idsToRemoveFromScope = _componentId().ComponentIdList.fromArray(idsToRemove.filter(id => !newComponents.hasWithoutVersion(id)));
|
|
223
|
+
const idsToCleanFromWorkspace = _componentId().ComponentIdList.fromArray(idsToRemove.filter(id => newComponents.hasWithoutVersion(id)));
|
|
224
224
|
const {
|
|
225
225
|
components: componentsToRemove,
|
|
226
226
|
invalidComponents
|
|
@@ -242,7 +242,7 @@ async function removeLocal(consumer, bitIds, force, track, deleteFiles) {
|
|
|
242
242
|
await consumer.cleanFromBitMap(idsToCleanFromWorkspace);
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
return new (_removedLocalObjects().
|
|
245
|
+
return new (_removedLocalObjects().RemovedLocalObjects)(_componentId().ComponentIdList.uniqFromArray([...idsToCleanFromWorkspace, ...removedComponentIds]), missingComponents, modifiedComponents, dependentBits, removedFromLane);
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
//# sourceMappingURL=remove-components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_groupArray","data","_interopRequireDefault","require","_lodash","_ramda","_bitIds","_constants","_generalError","_enrichContextFromGlobal","_logger","_http","_remotes","_scopeRemotes","_deleteComponentFiles","_componentsList","_consumerComponent","packageJsonUtils","_interopRequireWildcard","_pMapSeries","_removedLocalObjects","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","removeComponents","consumer","ids","force","remote","track","deleteFiles","logger","debugAndAddBreadCrumb","toString","bitIdsLatest","BitIds","fromArray","map","id","changeVersion","LATEST_BIT_VERSION","localIds","remoteIds","partition","isLocal","length","GeneralError","join","remoteResult","R","isEmpty","removeRemote","localResult","removeLocal","RemovedLocalObjects","bitIds","groupedBitsByScope","groupArray","remotes","getScopeRemotes","scope","Remotes","getGlobalRemotes","shouldGoToCentralHub","keys","http","Http","connect","CENTRAL_BIT_HUB_URL","CENTRAL_BIT_HUB_NAME","deleteViaCentralHub","idsAreLanes","context","enrichContextFromGlobal","removeP","resolvedRemote","resolve","idsStr","toStringWithoutVersion","deleteMany","Promise","all","modifiedComponents","nonModifiedComponents","pMapSeries","componentStatus","getComponentStatusById","modified","push","err","Component","isComponentInvalidByErrorType","idsToRemove","componentsList","ComponentsList","newComponents","listNewComponents","idsToRemoveFromScope","filter","hasWithoutVersion","idsToCleanFromWorkspace","components","componentsToRemove","invalidComponents","loadComponents","removedComponentIds","missingComponents","dependentBits","removedFromLane","removeMany","deleteComponentsFiles","invalidComponentsIds","i","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 BitIds from '@teambit/legacy/dist/bit-id/bit-ids';\nimport { CENTRAL_BIT_HUB_NAME, CENTRAL_BIT_HUB_URL, LATEST_BIT_VERSION } from '@teambit/legacy/dist/constants';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport enrichContextFromGlobal from '@teambit/legacy/dist/hooks/utils/enrich-context-from-global';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport { Http } from '@teambit/legacy/dist/scope/network/http';\nimport { Remotes } from '@teambit/legacy/dist/remotes';\nimport { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';\nimport deleteComponentsFiles from '@teambit/legacy/dist/consumer/component-ops/delete-component-files';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport Component from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport RemovedObjects from '@teambit/legacy/dist/scope/removed-components';\nimport * as packageJsonUtils from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport pMapSeries from 'p-map-series';\nimport RemovedLocalObjects from './removed-local-objects';\n\nexport type RemoveComponentsResult = { localResult: RemovedLocalObjects; remoteResult: RemovedObjects[] };\n\n/**\n * Remove components local and remote\n * splits array of ids into local and remote and removes according to flags\n * @param {string[]} ids - list of remote component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n * @param {boolean} remote - delete component from a remote scope\n * @param {boolean} track - keep tracking local staged components in bitmap.\n * @param {boolean} deleteFiles - delete local added files from fs.\n */\nexport async function removeComponents({\n consumer,\n ids,\n force,\n remote,\n track,\n deleteFiles,\n}: {\n consumer: Consumer | null | undefined; // when remote is false, it's always set\n ids: BitIds;\n force: boolean;\n remote: boolean;\n track: boolean;\n deleteFiles: boolean;\n}): Promise<RemoveComponentsResult> {\n logger.debugAndAddBreadCrumb('removeComponents', `{ids}. force: ${force.toString()}`, { ids: ids.toString() });\n // added this to remove support for remove only one version from a component\n const bitIdsLatest = BitIds.fromArray(\n ids.map((id) => {\n return id.changeVersion(LATEST_BIT_VERSION);\n })\n );\n const [localIds, remoteIds] = partition(bitIdsLatest, (id) => id.isLocal());\n if (remote && localIds.length) {\n throw new GeneralError(\n `unable to remove the remote components: ${localIds.join(',')} as they don't contain a scope-name`\n );\n }\n const remoteResult = remote && !R.isEmpty(remoteIds) ? await removeRemote(consumer, remoteIds, force) : [];\n const localResult = !remote\n ? await removeLocal(consumer as Consumer, bitIdsLatest, force, track, deleteFiles)\n : new RemovedLocalObjects();\n\n return { localResult, remoteResult };\n}\n\n/**\n * Remove remote component from ssh server\n * this method groups remote components by remote name and deletes remote components together\n * @param {BitIds} bitIds - list of remote component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n */\nasync function removeRemote(\n consumer: Consumer | null | undefined,\n bitIds: BitIds,\n force: boolean\n): Promise<RemovedObjects[]> {\n const groupedBitsByScope = groupArray(bitIds, 'scope');\n const remotes = consumer ? await getScopeRemotes(consumer.scope) : await Remotes.getGlobalRemotes();\n const shouldGoToCentralHub = remotes.shouldGoToCentralHub(Object.keys(groupedBitsByScope));\n if (shouldGoToCentralHub) {\n const http = await Http.connect(CENTRAL_BIT_HUB_URL, CENTRAL_BIT_HUB_NAME);\n return http.deleteViaCentralHub(\n bitIds.map((id) => id.toString()),\n { force, idsAreLanes: false }\n );\n }\n const context = {};\n enrichContextFromGlobal(context);\n const removeP = Object.keys(groupedBitsByScope).map(async (key) => {\n const resolvedRemote = await remotes.resolve(key, consumer?.scope);\n const idsStr = groupedBitsByScope[key].map((id) => id.toStringWithoutVersion());\n return resolvedRemote.deleteMany(idsStr, force, context);\n });\n\n return Promise.all(removeP);\n}\n\n/**\n * removeLocal - remove local (imported, new staged components) from modules and bitmap according to flags\n * @param {BitIds} bitIds - list of component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n * @param {boolean} deleteFiles - delete component that are used by other components.\n */\nasync function removeLocal(\n consumer: Consumer,\n bitIds: BitIds,\n force: boolean,\n track: boolean,\n deleteFiles: boolean\n): Promise<RemovedLocalObjects> {\n // local remove in case user wants to delete tagged components\n const modifiedComponents = new BitIds();\n const nonModifiedComponents = new BitIds();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n if (R.isEmpty(bitIds)) return new RemovedLocalObjects();\n if (!force) {\n await pMapSeries(bitIds, async (id) => {\n try {\n const componentStatus = await consumer.getComponentStatusById(id);\n if (componentStatus.modified) modifiedComponents.push(id);\n else nonModifiedComponents.push(id);\n } catch (err: any) {\n // if a component has an error, such as, missing main file, we do want to allow removing that component\n if (Component.isComponentInvalidByErrorType(err)) {\n nonModifiedComponents.push(id);\n } else {\n throw err;\n }\n }\n });\n }\n const idsToRemove = force ? bitIds : nonModifiedComponents;\n const componentsList = new ComponentsList(consumer);\n const newComponents = (await componentsList.listNewComponents(false)) as BitIds;\n const idsToRemoveFromScope = BitIds.fromArray(idsToRemove.filter((id) => !newComponents.hasWithoutVersion(id)));\n const idsToCleanFromWorkspace = BitIds.fromArray(idsToRemove.filter((id) => newComponents.hasWithoutVersion(id)));\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 BitIds.uniqFromArray([...idsToCleanFromWorkspace, ...removedComponentIds]),\n missingComponents,\n modifiedComponents,\n dependentBits,\n removedFromLane\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,cAAA;EAAA,MAAAP,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAK,aAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,yBAAA;EAAA,MAAAR,IAAA,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CAACqH,6CAA6C,CAClE1F,QAAQ,EACRwF,iBAAiB,EACjBF,oBACF,CAAC;MACD,MAAMtF,QAAQ,CAAC2F,eAAe,CAAChB,uBAAuB,CAAC;IACzD;EACF;EACA,OAAO,KAAI9C,8BAAmB,EAC5BnB,iBAAM,CAACkF,aAAa,CAAC,CAAC,GAAGjB,uBAAuB,EAAE,GAAGK,mBAAmB,CAAC,CAAC,EAC1EC,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","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","removeComponents","consumer","ids","force","remote","track","deleteFiles","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","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","i","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":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,aAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,YAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,WAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,cAAA;EAAA,MAAAP,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAK,aAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,yBAAA;EAAA,MAAAR,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAM,wBAAA,YAA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ACF,CAAC;MACD,MAAMtF,QAAQ,CAAC2F,eAAe,CAAChB,uBAAuB,CAAC;IACzD;EACF;EACA,OAAO,KAAI9C,0CAAmB,EAC5BnB,8BAAe,CAACkF,aAAa,CAAC,CAAC,GAAGjB,uBAAuB,EAAE,GAAGK,mBAAmB,CAAC,CAAC,EACnFC,iBAAiB,EACjBxB,kBAAkB,EAClByB,aAAa,EACbC,eACF,CAAC;AACH"}
|
package/dist/remove-template.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.removeTemplate = removeTemplate;
|
|
7
|
-
function
|
|
8
|
-
const data = require("@teambit/
|
|
9
|
-
|
|
7
|
+
function _componentId() {
|
|
8
|
+
const data = require("@teambit/component-id");
|
|
9
|
+
_componentId = function () {
|
|
10
10
|
return data;
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
@@ -36,7 +36,7 @@ function removeTemplate({
|
|
|
36
36
|
const paintMissingComponents = () => {
|
|
37
37
|
if (_ramda().default.isEmpty(missingComponents)) return '';
|
|
38
38
|
return _chalk().default.red('missing components:') + (0, _chalk().default)(` ${missingComponents.map(id => {
|
|
39
|
-
if (!(id instanceof
|
|
39
|
+
if (!(id instanceof _componentId().ComponentID)) id = _componentId().ComponentID.fromObject(id); // when the id was received from a remote it's not an instance of ComponentID
|
|
40
40
|
return id.version === 'latest' ? id.toStringWithoutVersion() : id.toString();
|
|
41
41
|
})}\n`);
|
|
42
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_componentId","data","require","_chalk","_interopRequireDefault","_ramda","obj","__esModule","default","removeTemplate","dependentBits","modifiedComponents","removedComponentIds","missingComponents","removedFromLane","isRemote","paintMissingComponents","R","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 { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport chalk from 'chalk';\nimport R from 'ramda';\n\nexport function removeTemplate(\n { dependentBits, modifiedComponents = [], removedComponentIds, missingComponents, removedFromLane },\n isRemote\n) {\n const paintMissingComponents = () => {\n if (R.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 (R.isEmpty(removedComponentIds) && R.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 = R.isEmpty(removedComponentIds) ? '' : getMsg(false) + compToStr(removedComponentIds) + newLine;\n const laneOutput = R.isEmpty(removedFromLane) ? '' : getMsg(true) + compToStr(removedFromLane);\n\n return `${compOutput}${laneOutput}`;\n };\n\n const paintUnRemovedComponents = () => {\n if (R.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 (R.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":";;;;;;AAAA,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,OAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsB,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEf,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,IAAIC,gBAAC,CAACC,OAAO,CAACL,iBAAiB,CAAC,EAAE,OAAO,EAAE;IAC3C,OACEM,gBAAK,CAACC,GAAG,CA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zC;IACAkC,uBAAuB,CAACpC,kBAAkB;EAAC;AAE/C"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { CLIMain } from '@teambit/cli';
|
|
2
2
|
import { Logger, LoggerMain } from '@teambit/logger';
|
|
3
3
|
import { Workspace } from '@teambit/workspace';
|
|
4
|
-
import { BitId } from '@teambit/legacy-bit-id';
|
|
5
|
-
import { ImporterMain } from '@teambit/importer';
|
|
6
4
|
import { ComponentID } from '@teambit/component-id';
|
|
5
|
+
import { ImporterMain } from '@teambit/importer';
|
|
7
6
|
import { DependencyResolverMain } from '@teambit/dependency-resolver';
|
|
8
7
|
import { IssuesMain } from '@teambit/issues';
|
|
9
8
|
import { Component, ComponentMain } from '@teambit/component';
|
|
@@ -32,7 +31,7 @@ export declare class RemoveMain {
|
|
|
32
31
|
/**
|
|
33
32
|
* remove components from the workspace.
|
|
34
33
|
*/
|
|
35
|
-
removeLocallyByIds(ids:
|
|
34
|
+
removeLocallyByIds(ids: ComponentID[], { force }?: {
|
|
36
35
|
force?: boolean;
|
|
37
36
|
}): Promise<RemoveComponentsResult>;
|
|
38
37
|
markRemoveComps(componentIds: ComponentID[], shouldUpdateMain?: boolean): Promise<ComponentID[]>;
|
|
@@ -25,16 +25,9 @@ function _workspace() {
|
|
|
25
25
|
};
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
const data = require("@teambit/
|
|
30
|
-
|
|
31
|
-
return data;
|
|
32
|
-
};
|
|
33
|
-
return data;
|
|
34
|
-
}
|
|
35
|
-
function _bitId() {
|
|
36
|
-
const data = require("@teambit/legacy/dist/bit-id");
|
|
37
|
-
_bitId = function () {
|
|
28
|
+
function _componentId() {
|
|
29
|
+
const data = require("@teambit/component-id");
|
|
30
|
+
_componentId = function () {
|
|
38
31
|
return data;
|
|
39
32
|
};
|
|
40
33
|
return data;
|
|
@@ -116,16 +109,16 @@ function _pMapSeries() {
|
|
|
116
109
|
};
|
|
117
110
|
return data;
|
|
118
111
|
}
|
|
119
|
-
function
|
|
120
|
-
const data =
|
|
121
|
-
|
|
112
|
+
function _noHeadNoVersion() {
|
|
113
|
+
const data = require("@teambit/legacy/dist/scope/exceptions/no-head-no-version");
|
|
114
|
+
_noHeadNoVersion = function () {
|
|
122
115
|
return data;
|
|
123
116
|
};
|
|
124
117
|
return data;
|
|
125
118
|
}
|
|
126
|
-
function
|
|
127
|
-
const data = require("@teambit/
|
|
128
|
-
|
|
119
|
+
function _component() {
|
|
120
|
+
const data = _interopRequireDefault(require("@teambit/component"));
|
|
121
|
+
_component = function () {
|
|
129
122
|
return data;
|
|
130
123
|
};
|
|
131
124
|
return data;
|
|
@@ -207,7 +200,7 @@ class RemoveMain {
|
|
|
207
200
|
const consumer = (_this$workspace = this.workspace) === null || _this$workspace === void 0 ? void 0 : _this$workspace.consumer;
|
|
208
201
|
const removeResults = await (0, _removeComponents().removeComponents)({
|
|
209
202
|
consumer,
|
|
210
|
-
ids:
|
|
203
|
+
ids: _componentId().ComponentIdList.fromArray(bitIds),
|
|
211
204
|
force,
|
|
212
205
|
remote,
|
|
213
206
|
track,
|
|
@@ -226,7 +219,7 @@ class RemoveMain {
|
|
|
226
219
|
if (!this.workspace) throw new (_workspace().OutsideWorkspaceError)();
|
|
227
220
|
const results = await (0, _removeComponents().removeComponents)({
|
|
228
221
|
consumer: this.workspace.consumer,
|
|
229
|
-
ids:
|
|
222
|
+
ids: _componentId().ComponentIdList.fromArray(ids),
|
|
230
223
|
force,
|
|
231
224
|
remote: false,
|
|
232
225
|
track: false,
|
|
@@ -246,7 +239,7 @@ class RemoveMain {
|
|
|
246
239
|
if (shouldUpdateMain) config.removeOnMain = true;
|
|
247
240
|
componentIds.map(compId => this.workspace.bitMap.addComponentConfig(compId, _remove().RemoveAspect.id, config));
|
|
248
241
|
await this.workspace.bitMap.write();
|
|
249
|
-
const bitIds =
|
|
242
|
+
const bitIds = _componentId().ComponentIdList.fromArray(componentIds.map(id => id));
|
|
250
243
|
await (0, _deleteComponentFiles().default)(this.workspace.consumer, bitIds);
|
|
251
244
|
return componentIds;
|
|
252
245
|
}
|
|
@@ -280,12 +273,13 @@ class RemoveMain {
|
|
|
280
273
|
async recover(compIdStr, options) {
|
|
281
274
|
if (!this.workspace) throw new (_exceptions().ConsumerNotFound)();
|
|
282
275
|
const bitMapEntry = this.workspace.consumer.bitMap.components.find(compMap => {
|
|
283
|
-
return compMap.id.
|
|
276
|
+
return compMap.id.fullName === compIdStr || compMap.id.toStringWithoutVersion() === compIdStr;
|
|
284
277
|
});
|
|
285
278
|
const importComp = async idStr => {
|
|
286
279
|
await this.importer.import({
|
|
287
280
|
ids: [idStr],
|
|
288
281
|
installNpmPackages: !options.skipDependencyInstallation,
|
|
282
|
+
writeConfigFiles: !options.skipWriteConfigFiles,
|
|
289
283
|
override: true
|
|
290
284
|
});
|
|
291
285
|
};
|
|
@@ -315,17 +309,9 @@ class RemoveMain {
|
|
|
315
309
|
}
|
|
316
310
|
const compId = await this.workspace.scope.resolveComponentId(compIdStr);
|
|
317
311
|
const currentLane = await this.workspace.getCurrentLaneObject();
|
|
318
|
-
const idOnLane = currentLane === null || currentLane === void 0 ? void 0 : currentLane.getComponent(compId
|
|
312
|
+
const idOnLane = currentLane === null || currentLane === void 0 ? void 0 : currentLane.getComponent(compId);
|
|
319
313
|
const compIdWithPossibleVer = idOnLane ? compId.changeVersion(idOnLane.head.toString()) : compId;
|
|
320
|
-
|
|
321
|
-
try {
|
|
322
|
-
compFromScope = await this.workspace.scope.get(compIdWithPossibleVer);
|
|
323
|
-
} catch (err) {
|
|
324
|
-
if (err instanceof _exceptions2().VersionNotFound && err.version === '0.0.0') {
|
|
325
|
-
throw new (_bitError().BitError)(`unable to find the component ${compIdWithPossibleVer.toString()} in the current lane or main`);
|
|
326
|
-
}
|
|
327
|
-
throw err;
|
|
328
|
-
}
|
|
314
|
+
const compFromScope = await this.workspace.scope.get(compIdWithPossibleVer);
|
|
329
315
|
if (compFromScope && this.isRemoved(compFromScope)) {
|
|
330
316
|
// case #2 and #3
|
|
331
317
|
await importComp(compIdWithPossibleVer._legacy.toString());
|
|
@@ -333,7 +319,15 @@ class RemoveMain {
|
|
|
333
319
|
return true;
|
|
334
320
|
}
|
|
335
321
|
// case #5
|
|
336
|
-
|
|
322
|
+
let comp;
|
|
323
|
+
try {
|
|
324
|
+
comp = await this.workspace.scope.getRemoteComponent(compId);
|
|
325
|
+
} catch (err) {
|
|
326
|
+
if (err instanceof _noHeadNoVersion().NoHeadNoVersion) {
|
|
327
|
+
throw new (_bitError().BitError)(`unable to find the component ${compIdWithPossibleVer.toString()} in the current lane or main`);
|
|
328
|
+
}
|
|
329
|
+
throw err;
|
|
330
|
+
}
|
|
337
331
|
if (!this.isRemoved(comp)) {
|
|
338
332
|
return false;
|
|
339
333
|
}
|
|
@@ -345,7 +339,7 @@ class RemoveMain {
|
|
|
345
339
|
const currentLane = await this.workspace.getCurrentLaneObject();
|
|
346
340
|
if (!currentLane) return; // user on main
|
|
347
341
|
const laneComps = currentLane.toBitIds();
|
|
348
|
-
const mainComps = components.filter(comp => !laneComps.hasWithoutVersion(comp.id
|
|
342
|
+
const mainComps = components.filter(comp => !laneComps.hasWithoutVersion(comp.id));
|
|
349
343
|
if (mainComps.length) {
|
|
350
344
|
throw new (_bitError().BitError)(`the following components belong to main, they cannot be soft-removed when on a lane. consider removing them without --soft.
|
|
351
345
|
${mainComps.map(c => c.id.toString()).join('\n')}`);
|
|
@@ -412,7 +406,7 @@ ${mainComps.map(c => c.id.toString()).join('\n')}`);
|
|
|
412
406
|
if (!currentLane) return [];
|
|
413
407
|
const laneIds = currentLane.toBitIds();
|
|
414
408
|
const workspaceIds = await this.workspace.listIds();
|
|
415
|
-
const laneIdsNotInWorkspace = laneIds.filter(id => !workspaceIds.find(wId => wId.
|
|
409
|
+
const laneIdsNotInWorkspace = laneIds.filter(id => !workspaceIds.find(wId => wId.isEqualWithoutVersion(id)));
|
|
416
410
|
if (!laneIdsNotInWorkspace.length) return [];
|
|
417
411
|
const laneCompIdsNotInWorkspace = await this.workspace.scope.resolveMultipleComponentIds(laneIdsNotInWorkspace);
|
|
418
412
|
const comps = await this.workspace.scope.getMany(laneCompIdsNotInWorkspace);
|
|
@@ -432,13 +426,13 @@ ${mainComps.map(c => c.id.toString()).join('\n')}`);
|
|
|
432
426
|
async getLocalBitIdsToRemove(componentsPattern) {
|
|
433
427
|
if (!this.workspace) throw new (_exceptions().ConsumerNotFound)();
|
|
434
428
|
const componentIds = await this.workspace.idsByPattern(componentsPattern);
|
|
435
|
-
return componentIds.map(id => id
|
|
429
|
+
return componentIds.map(id => id);
|
|
436
430
|
}
|
|
437
431
|
async getRemoteBitIdsToRemove(componentsPattern) {
|
|
438
432
|
if ((0, _hasWildcard().default)(componentsPattern)) {
|
|
439
433
|
return (0, _listScope().getRemoteBitIdsByWildcards)(componentsPattern);
|
|
440
434
|
}
|
|
441
|
-
return [
|
|
435
|
+
return [_componentId().ComponentID.fromString(componentsPattern)];
|
|
442
436
|
}
|
|
443
437
|
static async provider([workspace, cli, loggerMain, componentAspect, importerMain, depResolver, issues]) {
|
|
444
438
|
const logger = loggerMain.createLogger(_remove().RemoveAspect.id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_logger","_workspace","_interopRequireWildcard","_legacyBitId","_bitId","_exceptions","_importer","_interopRequireDefault","_lodash","_hasWildcard","_listScope","_bitError","_deleteComponentFiles","_dependencyResolver","_componentIssues","_issues","_pMapSeries","_component","_exceptions2","_packageJsonUtils","_removeCmd","_removeComponents","_remove","_remove2","_recoverCmd","_deleteCmd","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_defineProperty","value","_toPropertyKey","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","BEFORE_REMOVE","RemoveMain","constructor","workspace","logger","importer","depResolver","remove","componentsPattern","force","remote","track","deleteFiles","_this$workspace","setStatusLine","bitIds","getRemoteBitIdsToRemove","getLocalBitIdsToRemove","consumer","removeResults","removeComponents","ids","BitIds","fromArray","onDestroy","removeLocallyByIds","OutsideWorkspaceError","results","bitMap","write","markRemoveComps","componentIds","shouldUpdateMain","components","getMany","removeComponentsFromNodeModules","map","c","state","_consumer","config","removed","removeOnMain","compId","addComponentConfig","RemoveAspect","id","_legacy","deleteComponentsFiles","deleteComps","opts","ConsumerNotFound","idsByPattern","newComps","filter","hasVersion","length","BitError","toString","join","currentLane","getCurrentLaneObject","updateMain","isNew","Error","recover","compIdStr","options","bitMapEntry","find","compMap","name","toStringWithoutVersion","importComp","idStr","import","installNpmPackages","skipDependencyInstallation","override","setAsRemovedFalse","addSpecificComponentConfig","_bitMapEntry$config","_bitMapEntry$config2","resolveComponentId","comp","isRemoved","scope","idOnLane","getComponent","compIdWithPossibleVer","changeVersion","head","compFromScope","err","VersionNotFound","version","getRemoteComponent","throwForMainComponentWhenOnLane","laneComps","toBitIds","mainComps","hasWithoutVersion","getRemoveInfo","component","_component$config$ext","extensions","findExtension","isRemovedByIdWithoutLoadingComponent","componentId","bitmapEntry","getBitmapEntryIfExist","isRecovered","modelComp","getBitObjectModelComponent","versionObj","getBitObjectVersion","getRemovedStaged","isOnMain","getRemovedStagedFromMain","getRemovedStagedFromLane","addRemovedDependenciesIssues","pMapSeries","addRemovedDepIssue","dependencies","getComponentDependencies","removedWithUndefined","Promise","all","dep","compact","issues","getOrCreate","IssuesClasses","RemovedDependencies","stagedConfig","getStagedConfig","getAll","compConfig","_compConfig$config","laneIds","workspaceIds","listIds","laneIdsNotInWorkspace","wId","isEqualWithoutVersion","laneCompIdsNotInWorkspace","resolveMultipleComponentIds","comps","staged","snapDistance","getSnapDistance","warn","isSourceAhead","hasWildcard","getRemoteBitIdsByWildcards","BitId","parse","provider","cli","loggerMain","componentAspect","importerMain","createLogger","removeMain","registerAddComponentsIssues","bind","registerShowFragments","RemoveFragment","register","RemoveCmd","DeleteCmd","RecoverCmd","exports","WorkspaceAspect","CLIAspect","LoggerAspect","ComponentAspect","ImporterAspect","DependencyResolverAspect","IssuesAspect","MainRuntime","addRuntime","_default"],"sources":["remove.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport ImporterAspect, { ImporterMain } from '@teambit/importer';\nimport { compact } from 'lodash';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport { getRemoteBitIdsByWildcards } from '@teambit/legacy/dist/api/consumer/lib/list-scope';\nimport { ComponentID } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport deleteComponentsFiles from '@teambit/legacy/dist/consumer/component-ops/delete-component-files';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport IssuesAspect, { IssuesMain } from '@teambit/issues';\nimport pMapSeries from 'p-map-series';\nimport ComponentAspect, { Component, ComponentMain } from '@teambit/component';\nimport { VersionNotFound } from '@teambit/legacy/dist/scope/exceptions';\nimport { removeComponentsFromNodeModules } from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport { RemoveCmd } from './remove-cmd';\nimport { RemoveComponentsResult, removeComponents } from './remove-components';\nimport { RemoveAspect } from './remove.aspect';\nimport { RemoveFragment } from './remove.fragment';\nimport { RecoverCmd, RecoverOptions } from './recover-cmd';\nimport { DeleteCmd } from './delete-cmd';\n\nconst BEFORE_REMOVE = 'removing components';\n\nexport type RemoveInfo = {\n removed: boolean;\n /**\n * whether to remove the component from default lane once merged\n */\n removeOnMain?: boolean;\n};\n\nexport class RemoveMain {\n constructor(\n private workspace: Workspace,\n public logger: Logger,\n private importer: ImporterMain,\n private depResolver: DependencyResolverMain\n ) {}\n\n async remove({\n componentsPattern,\n force = false,\n remote = false,\n track = false,\n deleteFiles = true,\n }: {\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: BitIds.fromArray(bitIds),\n force,\n remote,\n track,\n deleteFiles,\n });\n if (consumer) await consumer.onDestroy();\n return removeResults;\n }\n\n /**\n * remove components from the workspace.\n */\n async removeLocallyByIds(ids: BitId[], { force = false }: { force?: boolean } = {}) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const results = await removeComponents({\n consumer: this.workspace.consumer,\n ids: BitIds.fromArray(ids),\n force,\n remote: false,\n track: false,\n deleteFiles: true,\n });\n await this.workspace.bitMap.write();\n\n return results;\n }\n\n async markRemoveComps(componentIds: ComponentID[], shouldUpdateMain = false) {\n const components = await this.workspace.getMany(componentIds);\n await removeComponentsFromNodeModules(\n this.workspace.consumer,\n components.map((c) => c.state._consumer)\n );\n // don't use `this.workspace.addSpecificComponentConfig`, if the component has component.json it will be deleted\n // during this removal along with the entire component dir.\n const config: RemoveInfo = { removed: true };\n if (shouldUpdateMain) config.removeOnMain = true;\n componentIds.map((compId) => this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, config));\n await this.workspace.bitMap.write();\n const bitIds = BitIds.fromArray(componentIds.map((id) => id._legacy));\n await deleteComponentsFiles(this.workspace.consumer, bitIds);\n\n return componentIds;\n }\n\n async deleteComps(componentsPattern: string, opts: { updateMain?: boolean } = {}): Promise<ComponentID[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n const newComps = componentIds.filter((id) => !id.hasVersion());\n if (newComps.length) {\n throw new BitError(\n `no need to delete the following new component(s), please remove them by \"bit remove\"\\n${newComps\n .map((id) => id.toString())\n .join('\\n')}`\n );\n }\n const currentLane = await this.workspace.getCurrentLaneObject();\n const { updateMain } = opts;\n if (!updateMain && currentLane?.isNew) {\n throw new Error(\n 'no need to delete components from an un-exported lane, you can remove them by running \"bit remove\"'\n );\n }\n\n return this.markRemoveComps(componentIds, updateMain);\n }\n\n /**\n * recover a soft-removed component.\n * there are 4 different scenarios.\n * 1. a component was just soft-removed, it wasn't snapped yet. so it's now in .bitmap with the \"removed\" aspect entry.\n * 2. soft-removed and then snapped. It's not in .bitmap now.\n * 3. soft-removed, snapped, exported. it's not in .bitmap now.\n * 4. a soft-removed components was imported, so it's now in .bitmap without the \"removed\" aspect entry.\n * 5. workspace is empty. the soft-removed component is on the remote.\n * returns `true` if it was recovered. `false` if the component wasn't soft-removed, so nothing to recover from.\n */\n async recover(compIdStr: string, options: RecoverOptions): Promise<boolean> {\n if (!this.workspace) throw new ConsumerNotFound();\n const bitMapEntry = this.workspace.consumer.bitMap.components.find((compMap) => {\n return compMap.id.name === compIdStr || compMap.id.toStringWithoutVersion() === compIdStr;\n });\n const importComp = async (idStr: string) => {\n await this.importer.import({\n ids: [idStr],\n installNpmPackages: !options.skipDependencyInstallation,\n override: true,\n });\n };\n const setAsRemovedFalse = async (compId: ComponentID) => {\n await this.workspace.addSpecificComponentConfig(compId, RemoveAspect.id, { removed: false });\n await this.workspace.bitMap.write();\n };\n if (bitMapEntry) {\n if (bitMapEntry.config?.[RemoveAspect.id]) {\n // case #1\n delete bitMapEntry.config?.[RemoveAspect.id];\n await importComp(bitMapEntry.id.toString());\n return true;\n }\n // case #4\n const compId = await this.workspace.resolveComponentId(bitMapEntry.id);\n const comp = await this.workspace.get(compId);\n if (!this.isRemoved(comp)) {\n return false;\n }\n await setAsRemovedFalse(compId);\n return true;\n }\n const compId = await this.workspace.scope.resolveComponentId(compIdStr);\n const currentLane = await this.workspace.getCurrentLaneObject();\n const idOnLane = currentLane?.getComponent(compId._legacy);\n const compIdWithPossibleVer = idOnLane ? compId.changeVersion(idOnLane.head.toString()) : compId;\n let compFromScope: Component | undefined;\n try {\n compFromScope = await this.workspace.scope.get(compIdWithPossibleVer);\n } catch (err: any) {\n if (err instanceof VersionNotFound && err.version === '0.0.0') {\n throw new BitError(\n `unable to find the component ${compIdWithPossibleVer.toString()} in the current lane or main`\n );\n }\n throw err;\n }\n if (compFromScope && this.isRemoved(compFromScope)) {\n // case #2 and #3\n await importComp(compIdWithPossibleVer._legacy.toString());\n await setAsRemovedFalse(compIdWithPossibleVer);\n return true;\n }\n // case #5\n const comp = await this.workspace.scope.getRemoteComponent(compId);\n if (!this.isRemoved(comp)) {\n return false;\n }\n await importComp(compId._legacy.toString());\n await setAsRemovedFalse(compId);\n\n return true;\n }\n\n private async throwForMainComponentWhenOnLane(components: Component[]) {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return; // user on main\n const laneComps = currentLane.toBitIds();\n const mainComps = components.filter((comp) => !laneComps.hasWithoutVersion(comp.id._legacy));\n if (mainComps.length) {\n throw new BitError(`the following components belong to main, they cannot be soft-removed when on a lane. consider removing them without --soft.\n${mainComps.map((c) => c.id.toString()).join('\\n')}`);\n }\n }\n\n getRemoveInfo(component: Component): RemoveInfo {\n const data = component.config.extensions.findExtension(RemoveAspect.id)?.config as RemoveInfo | undefined;\n return {\n removed: data?.removed || false,\n };\n }\n\n isRemoved(component: Component): boolean {\n return this.getRemoveInfo(component).removed;\n }\n\n /**\n * performant version of isRemoved() in case the component object is not available and loading it is expensive.\n */\n async isRemovedByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n if (!componentId.hasVersion()) return false;\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId);\n if (bitmapEntry && bitmapEntry.isRemoved()) return true;\n if (bitmapEntry && bitmapEntry.isRecovered()) return false;\n const modelComp = await this.workspace.scope.getBitObjectModelComponent(componentId);\n if (!modelComp) return false;\n const versionObj = await this.workspace.scope.getBitObjectVersion(modelComp, componentId.version 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(\n (id) => !workspaceIds.find((wId) => wId._legacy.isEqualWithoutVersion(id))\n );\n if (!laneIdsNotInWorkspace.length) return [];\n const laneCompIdsNotInWorkspace = await this.workspace.scope.resolveMultipleComponentIds(laneIdsNotInWorkspace);\n const comps = await this.workspace.scope.getMany(laneCompIdsNotInWorkspace);\n const removed = comps.filter((c) => this.isRemoved(c));\n const staged = await Promise.all(\n removed.map(async (c) => {\n const snapDistance = await this.workspace.scope.getSnapDistance(c.id, false);\n if (snapDistance.err) {\n this.logger.warn(\n `getRemovedStagedFromLane unable to get snapDistance for ${c.id.toString()} due to ${snapDistance.err.name}`\n );\n // todo: not clear what should be done here. should we consider it as removed-staged or not.\n }\n if (snapDistance.isSourceAhead()) return c.id;\n return undefined;\n })\n );\n return compact(staged);\n }\n\n private async getLocalBitIdsToRemove(componentsPattern: string): Promise<BitId[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n return componentIds.map((id) => id._legacy);\n }\n\n private async getRemoteBitIdsToRemove(componentsPattern: string): Promise<BitId[]> {\n if (hasWildcard(componentsPattern)) {\n return getRemoteBitIdsByWildcards(componentsPattern);\n }\n return [BitId.parse(componentsPattern, true)];\n }\n\n static slots = [];\n static dependencies = [\n WorkspaceAspect,\n CLIAspect,\n LoggerAspect,\n ComponentAspect,\n ImporterAspect,\n DependencyResolverAspect,\n IssuesAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([workspace, cli, loggerMain, componentAspect, importerMain, depResolver, issues]: [\n Workspace,\n CLIMain,\n LoggerMain,\n ComponentMain,\n ImporterMain,\n DependencyResolverMain,\n IssuesMain\n ]) {\n const logger = loggerMain.createLogger(RemoveAspect.id);\n const removeMain = new RemoveMain(workspace, logger, importerMain, depResolver);\n issues.registerAddComponentsIssues(removeMain.addRemovedDependenciesIssues.bind(removeMain));\n componentAspect.registerShowFragments([new RemoveFragment(removeMain)]);\n cli.register(\n new RemoveCmd(removeMain, workspace),\n new DeleteCmd(removeMain, workspace),\n new RecoverCmd(removeMain)\n );\n return removeMain;\n }\n}\n\nRemoveAspect.addRuntime(RemoveMain);\n\nexport default RemoveMain;\n"],"mappings":";;;;;;AAAA,SAAAA,KA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AAe,EAAEC,YAAY,EAAE3J,WAAW,EAAE4H,MAAM,CAQpG,EAAE;IACD,MAAM9H,MAAM,GAAG2J,UAAU,CAACG,YAAY,CAACrH,sBAAY,CAACC,EAAE,CAAC;IACvD,MAAMqH,UAAU,GAAG,IAAIlK,UAAU,CAACE,SAAS,EAAEC,MAAM,EAAE6J,YAAY,EAAE3J,WAAW,CAAC;IAC/E4H,MAAM,CAACkC,2BAA2B,CAACD,UAAU,CAAC3C,4BAA4B,CAAC6C,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,EAAEhK,SAAS,CAAC,EACpC,KAAIuK,sBAAS,EAACP,UAAU,EAAEhK,SAAS,CAAC,EACpC,KAAIwK,wBAAU,EAACR,UAAU,CAC3B,CAAC;IACD,OAAOA,UAAU;EACnB;AACF;AAACS,OAAA,CAAA3K,UAAA,GAAAA,UAAA;AAAAnB,eAAA,CA7TYmB,UAAU,WA6RN,EAAE;AAAAnB,eAAA,CA7RNmB,UAAU,kBA8RC,CACpB4K,oBAAe,EACfC,gBAAS,EACTC,sBAAY,EACZC,oBAAe,EACfC,mBAAc,EACdC,8CAAwB,EACxBC,iBAAY,CACb;AAAArM,eAAA,CAtSUmB,UAAU,aAuSJmL,kBAAW;AAwB9BvI,sBAAY,CAACwI,UAAU,CAACpL,UAAU,CAAC;AAAC,IAAAqL,QAAA,GAErBrL,UAAU;AAAA2K,OAAA,CAAAlN,OAAA,GAAA4N,QAAA"}
|
|
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","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_defineProperty","value","_toPropertyKey","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","BEFORE_REMOVE","RemoveMain","constructor","workspace","logger","importer","depResolver","remove","componentsPattern","force","remote","track","deleteFiles","_this$workspace","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","_bitMapEntry$config","_bitMapEntry$config2","resolveComponentId","comp","isRemoved","scope","idOnLane","getComponent","compIdWithPossibleVer","changeVersion","head","compFromScope","_legacy","getRemoteComponent","err","NoHeadNoVersion","throwForMainComponentWhenOnLane","laneComps","toBitIds","mainComps","hasWithoutVersion","getRemoveInfo","component","_component$config$ext","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","compact","issues","getOrCreate","IssuesClasses","RemovedDependencies","stagedConfig","getStagedConfig","getAll","compConfig","_compConfig$config","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();\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();\n\n return results;\n }\n\n async markRemoveComps(componentIds: ComponentID[], shouldUpdateMain = false) {\n const components = await this.workspace.getMany(componentIds);\n await removeComponentsFromNodeModules(\n this.workspace.consumer,\n components.map((c) => c.state._consumer)\n );\n // don't use `this.workspace.addSpecificComponentConfig`, if the component has component.json it will be deleted\n // during this removal along with the entire component dir.\n const config: RemoveInfo = { removed: true };\n if (shouldUpdateMain) config.removeOnMain = true;\n componentIds.map((compId) => this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, config));\n await this.workspace.bitMap.write();\n const bitIds = 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 * 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();\n };\n if (bitMapEntry) {\n if (bitMapEntry.config?.[RemoveAspect.id]) {\n // case #1\n delete bitMapEntry.config?.[RemoveAspect.id];\n await importComp(bitMapEntry.id.toString());\n return true;\n }\n // case #4\n const compId = await this.workspace.resolveComponentId(bitMapEntry.id);\n const comp = await this.workspace.get(compId);\n if (!this.isRemoved(comp)) {\n return false;\n }\n await setAsRemovedFalse(compId);\n return true;\n }\n const compId = await this.workspace.scope.resolveComponentId(compIdStr);\n const currentLane = await this.workspace.getCurrentLaneObject();\n const idOnLane = currentLane?.getComponent(compId);\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;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,YAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,WAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,UAAA;EAAA,MAAAP,IAAA,GAAAQ,sBAAA,CAAAP,OAAA;EAAAM,SAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,QAAA;EAAA,MAAAT,IAAA,GAAAC,OAAA;EAAAQ,OAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAU,aAAA;EAAA,MAAAV,IAAA,G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RemovedObjects from '@teambit/legacy/dist/scope/removed-components';
|
|
3
|
-
export
|
|
4
|
-
modifiedComponents:
|
|
5
|
-
constructor(removedComponentIds?:
|
|
3
|
+
export declare class RemovedLocalObjects extends RemovedObjects {
|
|
4
|
+
modifiedComponents: ComponentIdList;
|
|
5
|
+
constructor(removedComponentIds?: ComponentIdList, missingComponents?: ComponentIdList, modifiedComponents?: ComponentIdList, dependentBits?: Record<string, any>, removedFromLane?: ComponentIdList);
|
|
6
6
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.RemovedLocalObjects = void 0;
|
|
7
7
|
function _removedComponents() {
|
|
8
8
|
const data = _interopRequireDefault(require("@teambit/legacy/dist/scope/removed-components"));
|
|
9
9
|
_removedComponents = function () {
|
|
@@ -28,6 +28,6 @@ class RemovedLocalObjects extends _removedComponents().default {
|
|
|
28
28
|
this.modifiedComponents = modifiedComponents;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
exports.
|
|
31
|
+
exports.RemovedLocalObjects = RemovedLocalObjects;
|
|
32
32
|
|
|
33
33
|
//# sourceMappingURL=removed-local-objects.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_removedComponents","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","RemovedLocalObjects","RemovedObjects","constructor","removedComponentIds","missingComponents","modifiedComponents","dependentBits","removedFromLane","exports"],"sources":["removed-local-objects.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":["_removedComponents","data","_interopRequireDefault","require","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","RemovedLocalObjects","RemovedObjects","constructor","removedComponentIds","missingComponents","modifiedComponents","dependentBits","removedFromLane","exports"],"sources":["removed-local-objects.ts"],"sourcesContent":["import { ComponentIdList } from '@teambit/component-id';\nimport RemovedObjects from '@teambit/legacy/dist/scope/removed-components';\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,mBAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2E,SAAAC,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;AAAA,SAAAM,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,KAAA,EAAAC,IAAA,2BAAAK,GAAA,sBAAAA,GAAA,YAAAE,SAAA,4DAAAP,IAAA,gBAAAF,MAAA,GAAAU,MAAA,EAAAT,KAAA;AAEpE,MAAMU,mBAAmB,SAASC,4BAAc,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;IAAA7B,eAAA;IACA,IAAI,CAAC2B,kBAAkB,GAAGA,kBAAkB;EAC9C;AACF;AAACG,OAAA,CAAAR,mBAAA,GAAAA,mBAAA"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/remove",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.30",
|
|
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.30"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -18,18 +18,17 @@
|
|
|
18
18
|
"lodash": "4.17.21",
|
|
19
19
|
"core-js": "^3.0.0",
|
|
20
20
|
"@babel/runtime": "7.20.0",
|
|
21
|
-
"@teambit/harmony": "0.4.6",
|
|
22
21
|
"@teambit/bit-error": "0.0.404",
|
|
23
|
-
"@teambit/
|
|
24
|
-
"@teambit/
|
|
25
|
-
"@teambit/
|
|
26
|
-
"@teambit/
|
|
27
|
-
"@teambit/
|
|
28
|
-
"@teambit/component
|
|
29
|
-
"@teambit/dependency-resolver": "1.0.
|
|
30
|
-
"@teambit/importer": "1.0.
|
|
31
|
-
"@teambit/issues": "1.0.
|
|
32
|
-
"@teambit/logger": "0.0.
|
|
22
|
+
"@teambit/component-id": "1.1.0",
|
|
23
|
+
"@teambit/harmony": "0.4.6",
|
|
24
|
+
"@teambit/component-issues": "0.0.100",
|
|
25
|
+
"@teambit/cli": "0.0.802",
|
|
26
|
+
"@teambit/workspace": "1.0.30",
|
|
27
|
+
"@teambit/component": "1.0.30",
|
|
28
|
+
"@teambit/dependency-resolver": "1.0.30",
|
|
29
|
+
"@teambit/importer": "1.0.30",
|
|
30
|
+
"@teambit/issues": "1.0.30",
|
|
31
|
+
"@teambit/logger": "0.0.895"
|
|
33
32
|
},
|
|
34
33
|
"devDependencies": {
|
|
35
34
|
"@types/lodash": "4.14.165",
|
|
@@ -41,7 +40,7 @@
|
|
|
41
40
|
"@types/testing-library__jest-dom": "5.9.5"
|
|
42
41
|
},
|
|
43
42
|
"peerDependencies": {
|
|
44
|
-
"@teambit/legacy": "1.0.
|
|
43
|
+
"@teambit/legacy": "1.0.582",
|
|
45
44
|
"react": "^16.8.0 || ^17.0.0",
|
|
46
45
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
47
46
|
},
|
|
File without changes
|