@teambit/remove 0.0.222 → 0.0.224

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,15 +18,16 @@ export declare class RemoveCmd implements Command {
18
18
  migration: boolean;
19
19
  remoteOp: boolean;
20
20
  constructor(remove: RemoveMain);
21
- report([componentsPattern]: [string], { soft, force, remote, fromLane, track, deleteFiles, silent, keepFiles, }: {
21
+ report([componentsPattern]: [string], { soft, delete: softDelete, force, remote, hard, fromLane, track, silent, keepFiles, }: {
22
+ soft?: boolean;
23
+ delete: boolean;
22
24
  force: boolean;
23
- remote: boolean;
25
+ remote?: boolean;
26
+ hard: boolean;
24
27
  track: boolean;
25
28
  fromLane: boolean;
26
- deleteFiles: boolean;
27
29
  silent: boolean;
28
30
  keepFiles: boolean;
29
- soft: boolean;
30
31
  }): Promise<string>;
31
32
  paintArray(removedObjectsArray: RemovedObjects[]): string[];
32
33
  }
@@ -42,13 +42,6 @@ function _prompts() {
42
42
  };
43
43
  return data;
44
44
  }
45
- function _loader() {
46
- const data = _interopRequireDefault(require("@teambit/legacy/dist/cli/loader"));
47
- _loader = function () {
48
- return data;
49
- };
50
- return data;
51
- }
52
45
  function _removeTemplate() {
53
46
  const data = _interopRequireDefault(require("@teambit/legacy/dist/cli/templates/remove-template"));
54
47
  _removeTemplate = function () {
@@ -76,23 +69,32 @@ class RemoveCmd {
76
69
  (0, _defineProperty2().default)(this, "helpUrl", 'docs/components/removing-components');
77
70
  (0, _defineProperty2().default)(this, "skipWorkspace", true);
78
71
  (0, _defineProperty2().default)(this, "alias", 'rm');
79
- (0, _defineProperty2().default)(this, "options", [['', 'soft', 'EXPERIMENTAL. mark the component as deleted. after tag/snap and export the remote will be updated'], ['r', 'remote', 'remove a component completely from a remote scope (Careful! this is a permanent change. prefer --soft and tag+export)'], ['', 'from-lane', 'revert to main if exists on currently checked out lane, otherwise, remove it'], ['t', 'track', 'keep tracking component in .bitmap (default = false), helps transform a tagged-component to new'], ['d', 'delete-files', 'DEPRECATED (this is now the default). delete local component files'], ['', 'keep-files', 'keep component files (just untrack the component)'], ['f', 'force', 'removes the component from the scope, even if used as a dependency. WARNING: components that depend on this component will corrupt'], ['s', 'silent', 'skip confirmation']]);
72
+ (0, _defineProperty2().default)(this, "options", [['', 'soft', 'DEPRECATED. use --delete instead'], ['', 'delete', 'mark the component as deleted. after tag/snap and export the remote will be updated'], ['', 'remote', 'DEPRECATED. use --hard instead'], ['', 'hard', 'remove a component completely from a remote scope. careful! this is a permanent change that could corrupt dependents. prefer --delete'], ['', 'from-lane', 'revert to main if exists on currently checked out lane, otherwise, remove it'], ['t', 'track', 'keep tracking component in .bitmap (default = false), helps transform a tagged-component to new'], ['', 'keep-files', 'keep component files (just untrack the component)'], ['f', 'force', 'removes the component from the scope, even if used as a dependency. WARNING: components that depend on this component will corrupt'], ['s', 'silent', 'skip confirmation']]);
80
73
  (0, _defineProperty2().default)(this, "loader", true);
81
74
  (0, _defineProperty2().default)(this, "migration", true);
82
75
  (0, _defineProperty2().default)(this, "remoteOp", true);
83
76
  }
84
77
  async report([componentsPattern], {
85
- soft = false,
78
+ soft,
79
+ delete: softDelete = false,
86
80
  force = false,
87
- remote = false,
81
+ remote,
82
+ hard = false,
88
83
  fromLane = false,
89
84
  track = false,
90
- deleteFiles = false,
91
85
  silent = false,
92
86
  keepFiles = false
93
87
  }) {
94
88
  if (soft) {
95
- if (remote) throw new (_bitError().BitError)(`error: --remote and --soft cannot be used together. soft delete can only be done locally, after tag/snap and export it updates the remote`);
89
+ this.remove.logger.consoleWarning('--soft flag is deprecated. please use --delete instead');
90
+ softDelete = true;
91
+ }
92
+ if (remote) {
93
+ this.remove.logger.consoleWarning('--remote flag is deprecated. please use --hard instead');
94
+ hard = true;
95
+ }
96
+ if (softDelete) {
97
+ if (hard) throw new (_bitError().BitError)(`error: --hard and --delete cannot be used together. soft delete can only be done locally, after tag/snap and export it updates the remote`);
96
98
  if (track) throw new (_bitError().BitError)(`error: please use either --soft or --track, not both`);
97
99
  if (keepFiles) throw new (_bitError().BitError)(`error: please use either --soft or --keep-files, not both`);
98
100
  if (fromLane) throw new (_bitError().BitError)(`error: please use either --soft or --from-lane, not both`);
@@ -102,14 +104,9 @@ ${removedCompIds.join('\n')}
102
104
 
103
105
  ${_chalk().default.bold('to update the remote, please tag/snap and then export. to revert, please use "bit recover"')}`;
104
106
  }
105
- if (deleteFiles) {
106
- _loader().default.stop();
107
- // eslint-disable-next-line no-console
108
- console.warn(_chalk().default.yellow('--delete-files flag is deprecated. by default the files are deleted, unless --keep-files was provided'));
109
- }
110
107
  if (!silent) {
111
- const willDeleteFiles = !remote && !keepFiles;
112
- const removePromptResult = await (0, _prompts().removePrompt)(willDeleteFiles, remote)();
108
+ const willDeleteFiles = !hard && !keepFiles;
109
+ const removePromptResult = await (0, _prompts().removePrompt)(willDeleteFiles, hard)();
113
110
  // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
114
111
  if (!(0, _yn().default)(removePromptResult.shouldRemove)) {
115
112
  throw new (_bitError().BitError)('the operation has been canceled');
@@ -120,7 +117,7 @@ ${_chalk().default.bold('to update the remote, please tag/snap and then export.
120
117
  remoteResult = []
121
118
  } = await this.remove.remove({
122
119
  componentsPattern,
123
- remote,
120
+ remote: hard,
124
121
  force,
125
122
  track,
126
123
  deleteFiles: !keepFiles,
@@ -1 +1 @@
1
- {"version":3,"names":["RemoveCmd","constructor","remove","name","description","COMPONENT_PATTERN_HELP","report","componentsPattern","soft","force","remote","fromLane","track","deleteFiles","silent","keepFiles","BitError","removedCompIds","softRemove","chalk","green","join","bold","loader","stop","console","warn","yellow","willDeleteFiles","removePromptResult","removePrompt","yn","shouldRemove","localResult","remoteResult","paintRemoved","paintArray","removedObjectsArray","map","item"],"sources":["remove-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport yn from 'yn';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { BitError } from '@teambit/bit-error';\nimport { removePrompt } from '@teambit/legacy/dist/prompts';\nimport RemovedObjects from '@teambit/legacy/dist/scope/removed-components';\nimport RemovedLocalObjects from '@teambit/legacy/dist/scope/removed-local-objects';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport paintRemoved from '@teambit/legacy/dist/cli/templates/remove-template';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { RemoveMain } from './remove.main.runtime';\n\nexport class RemoveCmd implements Command {\n name = 'remove <component-pattern>';\n description = 'remove component(s) from the workspace, or a remote scope';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n group = 'collaborate';\n helpUrl = 'docs/components/removing-components';\n skipWorkspace = true;\n alias = 'rm';\n options = [\n ['', 'soft', 'EXPERIMENTAL. mark the component as deleted. after tag/snap and export the remote will be updated'],\n [\n 'r',\n 'remote',\n 'remove a component completely from a remote scope (Careful! this is a permanent change. prefer --soft and tag+export)',\n ],\n ['', 'from-lane', 'revert to main if exists on currently checked out lane, otherwise, remove it'],\n ['t', 'track', 'keep tracking component in .bitmap (default = false), helps transform a tagged-component to new'],\n ['d', 'delete-files', 'DEPRECATED (this is now the default). delete local component files'],\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: components that depend on this component will corrupt',\n ],\n ['s', 'silent', 'skip confirmation'],\n ] as CommandOptions;\n loader = true;\n migration = true;\n remoteOp = true;\n\n constructor(private remove: RemoveMain) {}\n\n async report(\n [componentsPattern]: [string],\n {\n soft = false,\n force = false,\n remote = false,\n fromLane = false,\n track = false,\n deleteFiles = false,\n silent = false,\n keepFiles = false,\n }: {\n force: boolean;\n remote: boolean;\n track: boolean;\n fromLane: boolean;\n deleteFiles: boolean;\n silent: boolean;\n keepFiles: boolean;\n soft: boolean;\n }\n ) {\n if (soft) {\n if (remote)\n throw new BitError(\n `error: --remote and --soft cannot be used together. soft delete can only be done locally, after tag/snap and export it updates the remote`\n );\n if (track) throw new BitError(`error: please use either --soft or --track, not both`);\n if (keepFiles) throw new BitError(`error: please use either --soft or --keep-files, not both`);\n if (fromLane) throw new BitError(`error: please use either --soft or --from-lane, not both`);\n const removedCompIds = await this.remove.softRemove(componentsPattern);\n return `${chalk.green('successfully soft-removed the following components:')}\n${removedCompIds.join('\\n')}\n\n${chalk.bold('to update the remote, please tag/snap and then export. to revert, please use \"bit recover\"')}`;\n }\n\n if (deleteFiles) {\n loader.stop();\n // eslint-disable-next-line no-console\n console.warn(\n chalk.yellow(\n '--delete-files flag is deprecated. by default the files are deleted, unless --keep-files was provided'\n )\n );\n }\n if (!silent) {\n const willDeleteFiles = !remote && !keepFiles;\n const removePromptResult = await removePrompt(willDeleteFiles, remote)();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n if (!yn(removePromptResult.shouldRemove)) {\n throw new BitError('the operation has been canceled');\n }\n }\n const {\n localResult,\n remoteResult = [],\n }: {\n localResult: RemovedLocalObjects;\n remoteResult: RemovedObjects[];\n } = await this.remove.remove({ componentsPattern, remote, force, track, deleteFiles: !keepFiles, fromLane });\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return paintRemoved(localResult, false) + this.paintArray(remoteResult);\n }\n paintArray(removedObjectsArray: RemovedObjects[]) {\n return removedObjectsArray.map((item) => paintRemoved(item, true));\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGO,MAAMA,SAAS,CAAoB;EAmCxCC,WAAW,CA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;EACpE;AACF;AAAC"}
1
+ {"version":3,"names":["RemoveCmd","constructor","remove","name","description","COMPONENT_PATTERN_HELP","report","componentsPattern","soft","delete","softDelete","force","remote","hard","fromLane","track","silent","keepFiles","logger","consoleWarning","BitError","removedCompIds","softRemove","chalk","green","join","bold","willDeleteFiles","removePromptResult","removePrompt","yn","shouldRemove","localResult","remoteResult","deleteFiles","paintRemoved","paintArray","removedObjectsArray","map","item"],"sources":["remove-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport yn from 'yn';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { BitError } from '@teambit/bit-error';\nimport { removePrompt } from '@teambit/legacy/dist/prompts';\nimport RemovedObjects from '@teambit/legacy/dist/scope/removed-components';\nimport RemovedLocalObjects from '@teambit/legacy/dist/scope/removed-local-objects';\nimport paintRemoved from '@teambit/legacy/dist/cli/templates/remove-template';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { RemoveMain } from './remove.main.runtime';\n\nexport class RemoveCmd implements Command {\n name = 'remove <component-pattern>';\n description = 'remove component(s) from the workspace, or a remote scope';\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n group = 'collaborate';\n helpUrl = 'docs/components/removing-components';\n skipWorkspace = true;\n alias = 'rm';\n options = [\n ['', 'soft', 'DEPRECATED. use --delete instead'],\n ['', 'delete', 'mark the component as deleted. after tag/snap and export the remote will be updated'],\n ['', 'remote', 'DEPRECATED. use --hard instead'],\n [\n '',\n 'hard',\n 'remove a component completely from a remote scope. careful! this is a permanent change that could corrupt dependents. prefer --delete',\n ],\n ['', 'from-lane', 'revert to main if exists on currently checked out lane, otherwise, remove it'],\n ['t', 'track', 'keep tracking component in .bitmap (default = false), helps transform a tagged-component to new'],\n ['', 'keep-files', 'keep component files (just untrack the component)'],\n [\n 'f',\n 'force',\n 'removes the component from the scope, even if used as a dependency. WARNING: components that depend on this component will corrupt',\n ],\n ['s', 'silent', 'skip confirmation'],\n ] as CommandOptions;\n loader = true;\n migration = true;\n remoteOp = true;\n\n constructor(private remove: RemoveMain) {}\n\n async report(\n [componentsPattern]: [string],\n {\n soft,\n delete: softDelete = false,\n force = false,\n remote,\n hard = false,\n fromLane = false,\n track = false,\n silent = false,\n keepFiles = false,\n }: {\n soft?: boolean;\n delete: boolean;\n force: boolean;\n remote?: boolean;\n hard: boolean;\n track: boolean;\n fromLane: boolean;\n silent: boolean;\n keepFiles: boolean;\n }\n ) {\n if (soft) {\n this.remove.logger.consoleWarning('--soft flag is deprecated. please use --delete instead');\n softDelete = true;\n }\n if (remote) {\n this.remove.logger.consoleWarning('--remote flag is deprecated. please use --hard instead');\n hard = true;\n }\n\n if (softDelete) {\n if (hard)\n throw new BitError(\n `error: --hard and --delete cannot be used together. soft delete can only be done locally, after tag/snap and export it updates the remote`\n );\n if (track) throw new BitError(`error: please use either --soft or --track, not both`);\n if (keepFiles) throw new BitError(`error: please use either --soft or --keep-files, not both`);\n if (fromLane) throw new BitError(`error: please use either --soft or --from-lane, not both`);\n const removedCompIds = await this.remove.softRemove(componentsPattern);\n return `${chalk.green('successfully soft-removed the following components:')}\n${removedCompIds.join('\\n')}\n\n${chalk.bold('to update the remote, please tag/snap and then export. to revert, please use \"bit recover\"')}`;\n }\n\n if (!silent) {\n const willDeleteFiles = !hard && !keepFiles;\n const removePromptResult = await removePrompt(willDeleteFiles, hard)();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n if (!yn(removePromptResult.shouldRemove)) {\n throw new BitError('the operation has been canceled');\n }\n }\n const {\n localResult,\n remoteResult = [],\n }: {\n localResult: RemovedLocalObjects;\n remoteResult: RemovedObjects[];\n } = await this.remove.remove({ componentsPattern, remote: hard, force, track, deleteFiles: !keepFiles, fromLane });\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return paintRemoved(localResult, false) + this.paintArray(remoteResult);\n }\n paintArray(removedObjectsArray: RemovedObjects[]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G,YAAY,CAAC,EAAE;QACxC,MAAM,KAAIX,oBAAQ,EAAC,iCAAiC,CAAC;MACvD;IACF;IACA,MAAM;MACJY,WAAW;MACXC,YAAY,GAAG;IAIjB,CAAC,GAAG,MAAM,IAAI,CAAC/B,MAAM,CAACA,MAAM,CAAC;MAAEK,iBAAiB;MAAEK,MAAM,EAAEC,IAAI;MAAEF,KAAK;MAAEI,KAAK;MAAEmB,WAAW,EAAE,CAACjB,SAAS;MAAEH;IAAS,CAAC,CAAC;IAClH;IACA,OAAO,IAAAqB,yBAAY,EAACH,WAAW,EAAE,KAAK,CAAC,GAAG,IAAI,CAACI,UAAU,CAACH,YAAY,CAAC;EACzE;EACAG,UAAU,CAACC,mBAAqC,EAAE;IAChD,OAAOA,mBAAmB,CAACC,GAAG,CAAEC,IAAI,IAAK,IAAAJ,yBAAY,EAACI,IAAI,EAAE,IAAI,CAAC,CAAC;EACpE;AACF;AAAC"}
@@ -10,7 +10,7 @@ export declare type RemoveInfo = {
10
10
  };
11
11
  export declare class RemoveMain {
12
12
  private workspace;
13
- private logger;
13
+ logger: Logger;
14
14
  private importer;
15
15
  constructor(workspace: Workspace, logger: Logger, importer: ImporterMain);
16
16
  remove({ componentsPattern, force, remote, track, deleteFiles, fromLane, }: {
@@ -1 +1 @@
1
- {"version":3,"names":["BEFORE_REMOVE","RemoveMain","constructor","workspace","logger","importer","remove","componentsPattern","force","remote","track","deleteFiles","fromLane","setStatusLine","bitIds","getRemoteBitIdsToRemove","getLocalBitIdsToRemove","consumer","removeResults","removeComponents","ids","BitIds","fromArray","onDestroy","softRemove","ConsumerNotFound","currentLane","getCurrentLaneObject","isNew","BitError","name","componentIds","idsByPattern","components","getMany","newComps","filter","c","id","hasVersion","length","map","toString","join","throwForMainComponentWhenOnLane","removeComponentsFromNodeModules","state","_consumer","compId","bitMap","addComponentConfig","RemoveAspect","removed","write","_legacy","deleteComponentsFiles","recover","compIdStr","options","bitMapEntry","find","compMap","toStringWithoutVersion","importComp","idStr","import","installNpmPackages","skipDependencyInstallation","override","setAsRemovedFalse","addSpecificComponentConfig","config","resolveComponentId","comp","get","isRemoved","scope","compFromScope","getRemoteComponent","laneComps","toBitIds","mainComps","hasWithoutVersion","getRemoveInfo","component","data","extensions","findExtension","getRemovedStaged","stagedConfig","getStagedConfig","getAll","compConfig","hasWildcard","getRemoteBitIdsByWildcards","BitId","parse","provider","cli","loggerMain","componentAspect","importerMain","createLogger","removeMain","registerShowFragments","RemoveFragment","register","RemoveCmd","RecoverCmd","WorkspaceAspect","CLIAspect","LoggerAspect","ComponentAspect","ImporterAspect","MainRuntime","addRuntime"],"sources":["remove.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { 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 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 ComponentAspect, { Component, ComponentMain } from '@teambit/component';\nimport { removeComponentsFromNodeModules } from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport { RemoveCmd } from './remove-cmd';\nimport { removeComponents } from './remove-components';\nimport { RemoveAspect } from './remove.aspect';\nimport { RemoveFragment } from './remove.fragment';\nimport { RecoverCmd, RecoverOptions } from './recover-cmd';\n\nconst BEFORE_REMOVE = 'removing components';\n\nexport type RemoveInfo = {\n removed: boolean;\n};\n\nexport class RemoveMain {\n constructor(private workspace: Workspace, private logger: Logger, private importer: ImporterMain) {}\n\n async remove({\n componentsPattern,\n force,\n remote,\n track,\n deleteFiles,\n fromLane,\n }: {\n componentsPattern: string;\n force: boolean;\n remote: boolean;\n track: boolean;\n deleteFiles: boolean;\n fromLane: boolean;\n }): Promise<any> {\n this.logger.setStatusLine(BEFORE_REMOVE);\n const bitIds = remote\n ? await this.getRemoteBitIdsToRemove(componentsPattern)\n : await this.getLocalBitIdsToRemove(componentsPattern);\n this.logger.setStatusLine(BEFORE_REMOVE); // again because the loader might changed when talking to the remote\n const consumer = this.workspace?.consumer;\n const removeResults = await removeComponents({\n consumer,\n ids: BitIds.fromArray(bitIds),\n force,\n remote,\n track,\n deleteFiles,\n fromLane,\n });\n if (consumer) await consumer.onDestroy();\n return removeResults;\n }\n\n async softRemove(componentsPattern: string): Promise<ComponentID[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (currentLane?.isNew) {\n throw new BitError(\n `unable to soft-remove on a new (not-exported) lane \"${currentLane.name}\". please remove without --soft`\n );\n }\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n const components = await this.workspace.getMany(componentIds);\n const newComps = components.filter((c) => !c.id.hasVersion());\n if (newComps.length) {\n throw new BitError(\n `unable to soft-remove the following new component(s), please remove them without --soft\\n${newComps\n .map((c) => c.id.toString())\n .join('\\n')}`\n );\n }\n await this.throwForMainComponentWhenOnLane(components);\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 componentIds.map((compId) =>\n this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, {\n removed: true,\n })\n );\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 /**\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 compFromScope = await this.workspace.scope.get(compId);\n if (compFromScope && this.isRemoved(compFromScope)) {\n // case #2 and #3\n await importComp(compId._legacy.toString());\n await setAsRemovedFalse(compId);\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 * get components that were soft-removed and tagged/snapped but not exported yet.\n */\n async getRemovedStaged(): 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 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 = [WorkspaceAspect, CLIAspect, LoggerAspect, ComponentAspect, ImporterAspect];\n static runtime = MainRuntime;\n\n static async provider([workspace, cli, loggerMain, componentAspect, importerMain]: [\n Workspace,\n CLIMain,\n LoggerMain,\n ComponentMain,\n ImporterMain\n ]) {\n const logger = loggerMain.createLogger(RemoveAspect.id);\n const removeMain = new RemoveMain(workspace, logger, importerMain);\n componentAspect.registerShowFragments([new RemoveFragment(removeMain)]);\n cli.register(new RemoveCmd(removeMain), new RecoverCmd(removeMain));\n return removeMain;\n }\n}\n\nRemoveAspect.addRuntime(RemoveMain);\n\nexport default RemoveMain;\n"],"mappings":";;;;;;;;;;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AE,IAAI,CAAC,CAAC;EAC/C;EAMA,aAAa0F,QAAQ,CAAC,CAAC9F,SAAS,EAAE+F,GAAG,EAAEC,UAAU,EAAEC,eAAe,EAAEC,YAAY,CAM/E,EAAE;IACD,MAAMjG,MAAM,GAAG+F,UAAU,CAACG,YAAY,CAACnD,sBAAY,CAACb,EAAE,CAAC;IACvD,MAAMiE,UAAU,GAAG,IAAItG,UAAU,CAACE,SAAS,EAAEC,MAAM,EAAEiG,YAAY,CAAC;IAClED,eAAe,CAACI,qBAAqB,CAAC,CAAC,KAAIC,yBAAc,EAACF,UAAU,CAAC,CAAC,CAAC;IACvEL,GAAG,CAACQ,QAAQ,CAAC,KAAIC,sBAAS,EAACJ,UAAU,CAAC,EAAE,KAAIK,wBAAU,EAACL,UAAU,CAAC,CAAC;IACnE,OAAOA,UAAU;EACnB;AACF;AAAC;AAAA,gCAtMYtG,UAAU,WAqLN,EAAE;AAAA,gCArLNA,UAAU,kBAsLC,CAAC4G,oBAAe,EAAEC,gBAAS,EAAEC,sBAAY,EAAEC,oBAAe,EAAEC,mBAAc,CAAC;AAAA,gCAtLtFhH,UAAU,aAuLJiH,kBAAW;AAiB9B/D,sBAAY,CAACgE,UAAU,CAAClH,UAAU,CAAC;AAAC,eAErBA,UAAU;AAAA"}
1
+ {"version":3,"names":["BEFORE_REMOVE","RemoveMain","constructor","workspace","logger","importer","remove","componentsPattern","force","remote","track","deleteFiles","fromLane","setStatusLine","bitIds","getRemoteBitIdsToRemove","getLocalBitIdsToRemove","consumer","removeResults","removeComponents","ids","BitIds","fromArray","onDestroy","softRemove","ConsumerNotFound","currentLane","getCurrentLaneObject","isNew","BitError","name","componentIds","idsByPattern","components","getMany","newComps","filter","c","id","hasVersion","length","map","toString","join","throwForMainComponentWhenOnLane","removeComponentsFromNodeModules","state","_consumer","compId","bitMap","addComponentConfig","RemoveAspect","removed","write","_legacy","deleteComponentsFiles","recover","compIdStr","options","bitMapEntry","find","compMap","toStringWithoutVersion","importComp","idStr","import","installNpmPackages","skipDependencyInstallation","override","setAsRemovedFalse","addSpecificComponentConfig","config","resolveComponentId","comp","get","isRemoved","scope","compFromScope","getRemoteComponent","laneComps","toBitIds","mainComps","hasWithoutVersion","getRemoveInfo","component","data","extensions","findExtension","getRemovedStaged","stagedConfig","getStagedConfig","getAll","compConfig","hasWildcard","getRemoteBitIdsByWildcards","BitId","parse","provider","cli","loggerMain","componentAspect","importerMain","createLogger","removeMain","registerShowFragments","RemoveFragment","register","RemoveCmd","RecoverCmd","WorkspaceAspect","CLIAspect","LoggerAspect","ComponentAspect","ImporterAspect","MainRuntime","addRuntime"],"sources":["remove.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport WorkspaceAspect, { 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 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 ComponentAspect, { Component, ComponentMain } from '@teambit/component';\nimport { removeComponentsFromNodeModules } from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport { RemoveCmd } from './remove-cmd';\nimport { removeComponents } from './remove-components';\nimport { RemoveAspect } from './remove.aspect';\nimport { RemoveFragment } from './remove.fragment';\nimport { RecoverCmd, RecoverOptions } from './recover-cmd';\n\nconst BEFORE_REMOVE = 'removing components';\n\nexport type RemoveInfo = {\n removed: boolean;\n};\n\nexport class RemoveMain {\n constructor(private workspace: Workspace, public logger: Logger, private importer: ImporterMain) {}\n\n async remove({\n componentsPattern,\n force,\n remote,\n track,\n deleteFiles,\n fromLane,\n }: {\n componentsPattern: string;\n force: boolean;\n remote: boolean;\n track: boolean;\n deleteFiles: boolean;\n fromLane: boolean;\n }): Promise<any> {\n this.logger.setStatusLine(BEFORE_REMOVE);\n const bitIds = remote\n ? await this.getRemoteBitIdsToRemove(componentsPattern)\n : await this.getLocalBitIdsToRemove(componentsPattern);\n this.logger.setStatusLine(BEFORE_REMOVE); // again because the loader might changed when talking to the remote\n const consumer = this.workspace?.consumer;\n const removeResults = await removeComponents({\n consumer,\n ids: BitIds.fromArray(bitIds),\n force,\n remote,\n track,\n deleteFiles,\n fromLane,\n });\n if (consumer) await consumer.onDestroy();\n return removeResults;\n }\n\n async softRemove(componentsPattern: string): Promise<ComponentID[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (currentLane?.isNew) {\n throw new BitError(\n `unable to soft-remove on a new (not-exported) lane \"${currentLane.name}\". please remove without --soft`\n );\n }\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n const components = await this.workspace.getMany(componentIds);\n const newComps = components.filter((c) => !c.id.hasVersion());\n if (newComps.length) {\n throw new BitError(\n `unable to soft-remove the following new component(s), please remove them without --soft\\n${newComps\n .map((c) => c.id.toString())\n .join('\\n')}`\n );\n }\n await this.throwForMainComponentWhenOnLane(components);\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 componentIds.map((compId) =>\n this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, {\n removed: true,\n })\n );\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 /**\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 compFromScope = await this.workspace.scope.get(compId);\n if (compFromScope && this.isRemoved(compFromScope)) {\n // case #2 and #3\n await importComp(compId._legacy.toString());\n await setAsRemovedFalse(compId);\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 * get components that were soft-removed and tagged/snapped but not exported yet.\n */\n async getRemovedStaged(): 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 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 = [WorkspaceAspect, CLIAspect, LoggerAspect, ComponentAspect, ImporterAspect];\n static runtime = MainRuntime;\n\n static async provider([workspace, cli, loggerMain, componentAspect, importerMain]: [\n Workspace,\n CLIMain,\n LoggerMain,\n ComponentMain,\n ImporterMain\n ]) {\n const logger = loggerMain.createLogger(RemoveAspect.id);\n const removeMain = new RemoveMain(workspace, logger, importerMain);\n componentAspect.registerShowFragments([new RemoveFragment(removeMain)]);\n cli.register(new RemoveCmd(removeMain), new RecoverCmd(removeMain));\n return removeMain;\n }\n}\n\nRemoveAspect.addRuntime(RemoveMain);\n\nexport default RemoveMain;\n"],"mappings":";;;;;;;;;;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IAAI,CAAC,CAAC;EAC/C;EAMA,aAAa0F,QAAQ,CAAC,CAAC9F,SAAS,EAAE+F,GAAG,EAAEC,UAAU,EAAEC,eAAe,EAAEC,YAAY,CAM/E,EAAE;IACD,MAAMjG,MAAM,GAAG+F,UAAU,CAACG,YAAY,CAACnD,sBAAY,CAACb,EAAE,CAAC;IACvD,MAAMiE,UAAU,GAAG,IAAItG,UAAU,CAACE,SAAS,EAAEC,MAAM,EAAEiG,YAAY,CAAC;IAClED,eAAe,CAACI,qBAAqB,CAAC,CAAC,KAAIC,yBAAc,EAACF,UAAU,CAAC,CAAC,CAAC;IACvEL,GAAG,CAACQ,QAAQ,CAAC,KAAIC,sBAAS,EAACJ,UAAU,CAAC,EAAE,KAAIK,wBAAU,EAACL,UAAU,CAAC,CAAC;IACnE,OAAOA,UAAU;EACnB;AACF;AAAC;AAAA,gCAtMYtG,UAAU,WAqLN,EAAE;AAAA,gCArLNA,UAAU,kBAsLC,CAAC4G,oBAAe,EAAEC,gBAAS,EAAEC,sBAAY,EAAEC,oBAAe,EAAEC,mBAAc,CAAC;AAAA,gCAtLtFhH,UAAU,aAuLJiH,kBAAW;AAiB9B/D,sBAAY,CAACgE,UAAU,CAAClH,UAAU,CAAC;AAAC,eAErBA,UAAU;AAAA"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/remove",
3
- "version": "0.0.222",
3
+ "version": "0.0.224",
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": "0.0.222"
9
+ "version": "0.0.224"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -21,11 +21,11 @@
21
21
  "@teambit/component-id": "0.0.427",
22
22
  "@teambit/legacy-bit-id": "0.0.423",
23
23
  "@teambit/bit-error": "0.0.402",
24
- "@teambit/cli": "0.0.703",
25
- "@teambit/component": "0.0.1045",
26
- "@teambit/importer": "0.0.474",
27
- "@teambit/logger": "0.0.796",
28
- "@teambit/workspace": "0.0.1045"
24
+ "@teambit/cli": "0.0.705",
25
+ "@teambit/component": "0.0.1047",
26
+ "@teambit/importer": "0.0.476",
27
+ "@teambit/logger": "0.0.798",
28
+ "@teambit/workspace": "0.0.1047"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/mocha": "9.1.0",
@@ -36,7 +36,7 @@
36
36
  "@types/testing-library__jest-dom": "5.9.5"
37
37
  },
38
38
  "peerDependencies": {
39
- "@teambit/legacy": "1.0.482",
39
+ "@teambit/legacy": "1.0.484",
40
40
  "react": "^16.8.0 || ^17.0.0",
41
41
  "react-dom": "^16.8.0 || ^17.0.0"
42
42
  },