@teambit/remove 1.0.750 → 1.0.752

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.
@@ -48,11 +48,10 @@ class DeleteCmd {
48
48
  this.remove = remove;
49
49
  this.workspace = workspace;
50
50
  _defineProperty(this, "name", 'delete <component-pattern>');
51
- _defineProperty(this, "description", 'mark components as deleted on the remote');
52
- _defineProperty(this, "extendedDescription", `to remove components from your local workspace only, use "bit remove" command.
53
- this command marks the components as deleted, and after snap/tag and export they will be marked as deleted from the remote scope as well.
54
- unless the '--hard' flag is used (not recommended!), in which case, the component will be deleted from the remote scope immediately.
55
- `);
51
+ _defineProperty(this, "description", 'soft-delete components from remote scopes');
52
+ _defineProperty(this, "extendedDescription", `marks components as deleted so they won't be visible on remote scopes after export.
53
+ components remain recoverable using "bit recover" unless --hard is used (permanent deletion, not recommended).
54
+ to remove components from your local workspace only, use "bit remove" instead.`);
56
55
  _defineProperty(this, "arguments", [{
57
56
  name: 'component-pattern',
58
57
  description: _legacy().COMPONENT_PATTERN_HELP
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_legacy","_removeTemplate","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DeleteCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","report","componentsPattern","force","lane","updateMain","hard","silent","range","snaps","isOnLane","BitError","isOnMain","removePrompt","localResult","remoteResult","remote","localMessage","removeTemplate","paintArray","deleteOpts","split","map","s","trim","filter","Boolean","removedComps","deleteComps","removedCompIds","comp","id","toString","chalk","green","join","bold","removedObjectsArray","item","logger","clearStatusLine","laneOrMainWarning","remoteOrLocalOutput","ok","yesno","question","exports"],"sources":["delete-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport yesno from 'yesno';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport type { RemovedObjects } from '@teambit/legacy.scope';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { RemoveMain } from './remove.main.runtime';\nimport { removeTemplate } from './remove-template';\n\nexport class DeleteCmd implements Command {\n name = 'delete <component-pattern>';\n description = 'mark components as deleted on the remote';\n extendedDescription = `to remove components from your local workspace only, use \"bit remove\" command.\nthis command marks the components as deleted, and after snap/tag and export they will be marked as deleted from the remote scope as well.\nunless the '--hard' flag is used (not recommended!), in which case, the component will be deleted from the remote scope immediately.\n`;\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n group = 'collaborate';\n helpUrl = 'reference/components/removing-components';\n skipWorkspace = true;\n alias = '';\n options = [\n ['', 'lane', 'when on a lane, delete the component from this lane only. avoid merging it to main or other lanes'],\n ['', 'update-main', 'delete component/s on the main lane after merging this lane into main'],\n [\n '',\n 'range <string>',\n 'EXPERIMENTAL. enter a Semver range to delete specific tags (cannot be used for snaps). see https://www.npmjs.com/package/semver#ranges for the range syntax',\n ],\n ['s', 'silent', 'skip confirmation'],\n [\n '',\n 'hard',\n 'NOT-RECOMMENDED. delete a component completely from a remote scope. careful! this is a permanent change that could corrupt dependents.',\n ],\n [\n 'f',\n 'force',\n 'relevant for --hard. allow the deletion even if used as a dependency. WARNING: components that depend on this component will corrupt',\n ],\n ['', 'snaps <string>', 'comma-separated list of snap hashes to mark as deleted (e.g. --snaps \"hash1,hash2,hash3\")'],\n ] as CommandOptions;\n loader = true;\n remoteOp = true;\n\n constructor(\n private remove: RemoveMain,\n private workspace?: Workspace\n ) {}\n\n async report(\n [componentsPattern]: [string],\n {\n force = false,\n lane = false,\n updateMain = false,\n hard = false,\n silent = false,\n range,\n snaps,\n }: {\n force?: boolean;\n lane?: boolean;\n updateMain?: boolean;\n hard?: boolean;\n silent?: boolean;\n range?: string;\n snaps?: string;\n }\n ) {\n if (this.workspace?.isOnLane() && !hard && !lane && !updateMain) {\n throw new BitError(`error: to delete components when on a lane, use --lane flag`);\n }\n if (this.workspace?.isOnMain() && updateMain) {\n throw new BitError(`--update-main is relevant only when on a lane`);\n }\n\n if (!silent) {\n await this.removePrompt(hard, lane);\n }\n\n if (hard) {\n if (range) throw new BitError(`--range is not supported with --hard flag`);\n const { localResult, remoteResult = [] } = await this.remove.remove({ componentsPattern, remote: true, force });\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n let localMessage = removeTemplate(localResult, false);\n if (localMessage !== '') localMessage += '\\n';\n return `${localMessage}${this.paintArray(remoteResult)}`;\n }\n\n const deleteOpts: any = { updateMain, range };\n if (snaps) {\n deleteOpts.snaps = snaps\n .split(',')\n .map((s) => s.trim())\n .filter(Boolean);\n }\n const removedComps = await this.remove.deleteComps(componentsPattern, deleteOpts);\n const removedCompIds = removedComps.map((comp) => comp.id.toString());\n return `${chalk.green('successfully deleted the following components:')}\n${removedCompIds.join('\\n')}\n\n${chalk.bold('to update the remote, please tag/snap and then export. to revert, please use \"bit recover\"')}`;\n }\n\n private paintArray(removedObjectsArray: RemovedObjects[]) {\n return removedObjectsArray.map((item) => removeTemplate(item, true));\n }\n\n private async removePrompt(hard?: boolean, lane?: boolean) {\n this.remove.logger.clearStatusLine();\n const laneOrMainWarning = lane\n ? `this command will mark the component as removed from this lane, resetting the component to its pre-lane state and content (after tag/snap and export)`\n : `this command will mark the component as deleted, and it won’t be visible on the remote scope (after tag/snap and export).`;\n const remoteOrLocalOutput = hard\n ? `WARNING: the component(s) will be permanently deleted from the remote with no option to recover. prefer omitting --hard to only mark the component as soft deleted`\n : `${laneOrMainWarning}\nif your intent is to remove the component only from your local workspace, refer to bit remove or bit eject.`;\n\n const ok = await yesno({\n question: `${remoteOrLocalOutput}\n${chalk.bold('Would you like to proceed? [yes(y)/no(n)]')}`,\n });\n if (!ok) {\n throw new BitError('the operation has been canceled');\n }\n }\n}\n"],"m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C,MAAM,CAACC,OAAO,CAAC;IACpB;IACA,MAAMC,YAAY,GAAG,MAAM,IAAI,CAAC/B,MAAM,CAACgC,WAAW,CAAC1B,iBAAiB,EAAEkB,UAAU,CAAC;IACjF,MAAMS,cAAc,GAAGF,YAAY,CAACL,GAAG,CAAEQ,IAAI,IAAKA,IAAI,CAACC,EAAE,CAACC,QAAQ,CAAC,CAAC,CAAC;IACrE,OAAO,GAAGC,gBAAK,CAACC,KAAK,CAAC,gDAAgD,CAAC;AAC3E,EAAEL,cAAc,CAACM,IAAI,CAAC,IAAI,CAAC;AAC3B;AACA,EAAEF,gBAAK,CAACG,IAAI,CAAC,4FAA4F,CAAC,EAAE;EAC1G;EAEQjB,UAAUA,CAACkB,mBAAqC,EAAE;IACxD,OAAOA,mBAAmB,CAACf,GAAG,CAAEgB,IAAI,IAAK,IAAApB,gCAAc,EAACoB,IAAI,EAAE,IAAI,CAAC,CAAC;EACtE;EAEA,MAAczB,YAAYA,CAACP,IAAc,EAAEF,IAAc,EAAE;IACzD,IAAI,CAACR,MAAM,CAAC2C,MAAM,CAACC,eAAe,CAAC,CAAC;IACpC,MAAMC,iBAAiB,GAAGrC,IAAI,GAC1B,uJAAuJ,GACvJ,2HAA2H;IAC/H,MAAMsC,mBAAmB,GAAGpC,IAAI,GAC5B,oKAAoK,GACpK,GAAGmC,iBAAiB;AAC5B,4GAA4G;IAExG,MAAME,EAAE,GAAG,MAAM,IAAAC,gBAAK,EAAC;MACrBC,QAAQ,EAAE,GAAGH,mBAAmB;AACtC,EAAET,gBAAK,CAACG,IAAI,CAAC,2CAA2C,CAAC;IACrD,CAAC,CAAC;IACF,IAAI,CAACO,EAAE,EAAE;MACP,MAAM,KAAIhC,oBAAQ,EAAC,iCAAiC,CAAC;IACvD;EACF;AACF;AAACmC,OAAA,CAAApD,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_legacy","_removeTemplate","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DeleteCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","report","componentsPattern","force","lane","updateMain","hard","silent","range","snaps","isOnLane","BitError","isOnMain","removePrompt","localResult","remoteResult","remote","localMessage","removeTemplate","paintArray","deleteOpts","split","map","s","trim","filter","Boolean","removedComps","deleteComps","removedCompIds","comp","id","toString","chalk","green","join","bold","removedObjectsArray","item","logger","clearStatusLine","laneOrMainWarning","remoteOrLocalOutput","ok","yesno","question","exports"],"sources":["delete-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport yesno from 'yesno';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport type { RemovedObjects } from '@teambit/legacy.scope';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { RemoveMain } from './remove.main.runtime';\nimport { removeTemplate } from './remove-template';\n\nexport class DeleteCmd implements Command {\n name = 'delete <component-pattern>';\n description = 'soft-delete components from remote scopes';\n extendedDescription = `marks components as deleted so they won't be visible on remote scopes after export.\ncomponents remain recoverable using \"bit recover\" unless --hard is used (permanent deletion, not recommended).\nto remove components from your local workspace only, use \"bit remove\" instead.`;\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n group = 'collaborate';\n helpUrl = 'reference/components/removing-components';\n skipWorkspace = true;\n alias = '';\n options = [\n ['', 'lane', 'when on a lane, delete the component from this lane only. avoid merging it to main or other lanes'],\n ['', 'update-main', 'delete component/s on the main lane after merging this lane into main'],\n [\n '',\n 'range <string>',\n 'EXPERIMENTAL. enter a Semver range to delete specific tags (cannot be used for snaps). see https://www.npmjs.com/package/semver#ranges for the range syntax',\n ],\n ['s', 'silent', 'skip confirmation'],\n [\n '',\n 'hard',\n 'NOT-RECOMMENDED. delete a component completely from a remote scope. careful! this is a permanent change that could corrupt dependents.',\n ],\n [\n 'f',\n 'force',\n 'relevant for --hard. allow the deletion even if used as a dependency. WARNING: components that depend on this component will corrupt',\n ],\n ['', 'snaps <string>', 'comma-separated list of snap hashes to mark as deleted (e.g. --snaps \"hash1,hash2,hash3\")'],\n ] as CommandOptions;\n loader = true;\n remoteOp = true;\n\n constructor(\n private remove: RemoveMain,\n private workspace?: Workspace\n ) {}\n\n async report(\n [componentsPattern]: [string],\n {\n force = false,\n lane = false,\n updateMain = false,\n hard = false,\n silent = false,\n range,\n snaps,\n }: {\n force?: boolean;\n lane?: boolean;\n updateMain?: boolean;\n hard?: boolean;\n silent?: boolean;\n range?: string;\n snaps?: string;\n }\n ) {\n if (this.workspace?.isOnLane() && !hard && !lane && !updateMain) {\n throw new BitError(`error: to delete components when on a lane, use --lane flag`);\n }\n if (this.workspace?.isOnMain() && updateMain) {\n throw new BitError(`--update-main is relevant only when on a lane`);\n }\n\n if (!silent) {\n await this.removePrompt(hard, lane);\n }\n\n if (hard) {\n if (range) throw new BitError(`--range is not supported with --hard flag`);\n const { localResult, remoteResult = [] } = await this.remove.remove({ componentsPattern, remote: true, force });\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n let localMessage = removeTemplate(localResult, false);\n if (localMessage !== '') localMessage += '\\n';\n return `${localMessage}${this.paintArray(remoteResult)}`;\n }\n\n const deleteOpts: any = { updateMain, range };\n if (snaps) {\n deleteOpts.snaps = snaps\n .split(',')\n .map((s) => s.trim())\n .filter(Boolean);\n }\n const removedComps = await this.remove.deleteComps(componentsPattern, deleteOpts);\n const removedCompIds = removedComps.map((comp) => comp.id.toString());\n return `${chalk.green('successfully deleted the following components:')}\n${removedCompIds.join('\\n')}\n\n${chalk.bold('to update the remote, please tag/snap and then export. to revert, please use \"bit recover\"')}`;\n }\n\n private paintArray(removedObjectsArray: RemovedObjects[]) {\n return removedObjectsArray.map((item) => removeTemplate(item, true));\n }\n\n private async removePrompt(hard?: boolean, lane?: boolean) {\n this.remove.logger.clearStatusLine();\n const laneOrMainWarning = lane\n ? `this command will mark the component as removed from this lane, resetting the component to its pre-lane state and content (after tag/snap and export)`\n : `this command will mark the component as deleted, and it won’t be visible on the remote scope (after tag/snap and export).`;\n const remoteOrLocalOutput = hard\n ? `WARNING: the component(s) will be permanently deleted from the remote with no option to recover. prefer omitting --hard to only mark the component as soft deleted`\n : `${laneOrMainWarning}\nif your intent is to remove the component only from your local workspace, refer to bit remove or bit eject.`;\n\n const ok = await yesno({\n question: `${remoteOrLocalOutput}\n${chalk.bold('Would you like to proceed? [yes(y)/no(n)]')}`,\n });\n if (!ok) {\n throw new BitError('the operation has been canceled');\n }\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,gBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,eAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAmD,SAAAC,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OA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mBAAmB,GAAGpC,IAAI,GAC5B,oKAAoK,GACpK,GAAGmC,iBAAiB;AAC5B,4GAA4G;IAExG,MAAME,EAAE,GAAG,MAAM,IAAAC,gBAAK,EAAC;MACrBC,QAAQ,EAAE,GAAGH,mBAAmB;AACtC,EAAET,gBAAK,CAACG,IAAI,CAAC,2CAA2C,CAAC;IACrD,CAAC,CAAC;IACF,IAAI,CAACO,EAAE,EAAE;MACP,MAAM,KAAIhC,oBAAQ,EAAC,iCAAiC,CAAC;IACvD;EACF;AACF;AAACmC,OAAA,CAAApD,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -8,6 +8,7 @@ export declare class RecoverCmd implements Command {
8
8
  private remove;
9
9
  name: string;
10
10
  description: string;
11
+ extendedDescription: string;
11
12
  group: string;
12
13
  options: CommandOptions;
13
14
  loader: boolean;
@@ -26,7 +26,8 @@ class RecoverCmd {
26
26
  constructor(remove) {
27
27
  this.remove = remove;
28
28
  _defineProperty(this, "name", 'recover <component-name>');
29
- _defineProperty(this, "description", 'recover component(s) soft-deleted from the workspace, or a remote scope');
29
+ _defineProperty(this, "description", 'restore soft-deleted components');
30
+ _defineProperty(this, "extendedDescription", 'reverses the soft-deletion of components marked with "bit delete", restoring them to their previous state. works for both local and remote soft-deleted components.');
30
31
  _defineProperty(this, "group", 'collaborate');
31
32
  _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
33
  _defineProperty(this, "loader", true);
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_bitError","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RecoverCmd","constructor","remove","report","componentName","options","hasRecovered","recover","BitError","chalk","green","exports"],"sources":["recover-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { BitError } from '@teambit/bit-error';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { RemoveMain } from './remove.main.runtime';\n\nexport type RecoverOptions = {\n skipDependencyInstallation?: boolean;\n skipWriteConfigFiles?: boolean;\n};\n\nexport class RecoverCmd implements Command {\n name = 'recover <component-name>';\n description = 'recover component(s) soft-deleted from the workspace, or a remote scope';\n group = 'collaborate';\n options = [\n ['x', 'skip-dependency-installation', 'do not install packages in case of importing components'],\n ['', 'skip-write-config-files', 'do not write config files (such as eslint, tsconfig, prettier, etc...)'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private remove: RemoveMain) {}\n\n async report([componentName]: [string], options: RecoverOptions) {\n const hasRecovered = await this.remove.recover(componentName, options);\n if (!hasRecovered) {\n throw new BitError(`component ${componentName} was not soft-deleted, nothing to recover`);\n }\n return chalk.green(`successfully recovered ${componentName}`);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAZ,CAAA,CAAAI,CAAA,IAAAC,CAAA,EAAAL,CAAA;AAAA,SAAAM,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AASvC,MAAMgB,UAAU,CAAoB;EAUzCC,WAAWA,CAASC,MAAkB,EAAE;IAAA,KAApBA,MAAkB,GAAlBA,MAAkB;IAAApB,eAAA,eAT/B,0BAA0B;IAAAA,eAAA,sBACnB,yEAAyE;IAAAA,eAAA,gBAC/E,aAAa;IAAAA,eAAA,kBACX,CACR,CAAC,GAAG,EAAE,8BAA8B,EAAE,yDAAyD,CAAC,EAChG,CAAC,EAAE,EAAE,yBAAyB,EAAE,wEAAwE,CAAC,CAC1G;IAAAA,eAAA,iBACQ,IAAI;EAE4B;EAEzC,MAAMqB,MAAMA,CAAC,CAACC,aAAa,CAAW,EAAEC,OAAuB,EAAE;IAC/D,MAAMC,YAAY,GAAG,MAAM,IAAI,CAACJ,MAAM,CAACK,OAAO,CAACH,aAAa,EAAEC,OAAO,CAAC;IACtE,IAAI,CAACC,YAAY,EAAE;MACjB,MAAM,KAAIE,oBAAQ,EAAC,aAAaJ,aAAa,2CAA2C,CAAC;IAC3F;IACA,OAAOK,gBAAK,CAACC,KAAK,CAAC,0BAA0BN,aAAa,EAAE,CAAC;EAC/D;AACF;AAACO,OAAA,CAAAX,UAAA,GAAAA,UAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_bitError","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RecoverCmd","constructor","remove","report","componentName","options","hasRecovered","recover","BitError","chalk","green","exports"],"sources":["recover-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { BitError } from '@teambit/bit-error';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { RemoveMain } from './remove.main.runtime';\n\nexport type RecoverOptions = {\n skipDependencyInstallation?: boolean;\n skipWriteConfigFiles?: boolean;\n};\n\nexport class RecoverCmd implements Command {\n name = 'recover <component-name>';\n description = 'restore soft-deleted components';\n extendedDescription =\n 'reverses the soft-deletion of components marked with \"bit delete\", restoring them to their previous state. works for both local and remote soft-deleted components.';\n group = 'collaborate';\n options = [\n ['x', 'skip-dependency-installation', 'do not install packages in case of importing components'],\n ['', 'skip-write-config-files', 'do not write config files (such as eslint, tsconfig, prettier, etc...)'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private remove: RemoveMain) {}\n\n async report([componentName]: [string], options: RecoverOptions) {\n const hasRecovered = await this.remove.recover(componentName, options);\n if (!hasRecovered) {\n throw new BitError(`component ${componentName} was not soft-deleted, nothing to recover`);\n }\n return chalk.green(`successfully recovered ${componentName}`);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,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AQ,EAAC,aAAaJ,aAAa,2CAA2C,CAAC;IAC3F;IACA,OAAOK,gBAAK,CAACC,KAAK,CAAC,0BAA0BN,aAAa,EAAE,CAAC;EAC/D;AACF;AAACO,OAAA,CAAAX,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -48,8 +48,10 @@ class RemoveCmd {
48
48
  this.remove = remove;
49
49
  this.workspace = workspace;
50
50
  _defineProperty(this, "name", 'remove <component-pattern>');
51
- _defineProperty(this, "description", 'remove component(s) from the local workspace');
52
- _defineProperty(this, "extendedDescription", `to mark components as deleted on the remote scope, use "bit delete".`);
51
+ _defineProperty(this, "description", 'untrack components from the workspace');
52
+ _defineProperty(this, "extendedDescription", `removes components from the local workspace only - stops tracking them in .bitmap and deletes their files by default.
53
+ does not affect remote scopes - to delete components from remotes, use "bit delete" instead.
54
+ use --keep-files to preserve component files while only removing the tracking.`);
53
55
  _defineProperty(this, "arguments", [{
54
56
  name: 'component-pattern',
55
57
  description: _legacy().COMPONENT_PATTERN_HELP
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_legacy","_removeTemplate","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RemoveCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","cmd","report","componentsPattern","force","track","silent","keepFiles","removePrompt","localResult","deleteFiles","localMessage","removeTemplate","logger","clearStatusLine","filesDeletionStr","ok","yesno","question","chalk","bold","BitError","exports"],"sources":["remove-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport yesno from 'yesno';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { RemovedLocalObjects } from './removed-local-objects';\nimport type { RemoveMain } from './remove.main.runtime';\nimport { removeTemplate } from './remove-template';\n\nexport class RemoveCmd implements Command {\n name = 'remove <component-pattern>';\n description = 'remove component(s) from the local workspace';\n extendedDescription = `to mark components as deleted on the remote scope, use \"bit delete\".`;\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n group = 'component-development';\n helpUrl = 'reference/components/removing-components';\n skipWorkspace = true;\n alias = 'rm';\n options = [\n ['t', 'track', 'keep tracking component in .bitmap (default = false), helps transform a tagged-component to new'],\n ['', 'keep-files', 'keep component files (just untrack the component)'],\n [\n 'f',\n 'force',\n 'removes the component from the scope, even if used as a dependency. WARNING: you will need to fix the components that depend on this component',\n ],\n ['s', 'silent', 'skip confirmation'],\n ] as CommandOptions;\n loader = true;\n examples = [\n {\n cmd: 'remove \"$deprecated\"',\n description: 'remove all components that are deprecated',\n },\n ];\n remoteOp = true;\n\n constructor(\n private remove: RemoveMain,\n private workspace?: Workspace\n ) {}\n\n async report(\n [componentsPattern]: [string],\n {\n force = false,\n track = false,\n silent = false,\n keepFiles = false,\n }: {\n force?: boolean;\n track?: boolean;\n silent?: boolean;\n keepFiles?: boolean;\n }\n ) {\n if (!silent) {\n await this.removePrompt(!keepFiles);\n }\n const {\n localResult,\n }: {\n localResult: RemovedLocalObjects;\n } = await this.remove.remove({ componentsPattern, force, track, deleteFiles: !keepFiles });\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const localMessage = removeTemplate(localResult, false);\n // if (localMessage !== '')\n // localMessage +=\n // '. Note: these components were not deleted from the remote - if you want to delete components run \"bit delete\"\\n';\n return localMessage;\n }\n\n private async removePrompt(deleteFiles?: boolean) {\n this.remove.logger.clearStatusLine();\n const filesDeletionStr = deleteFiles\n ? ' and the files will be deleted from the filesystem (can be avoided by entering --keep-files)'\n : '';\n const ok = await yesno({\n question: `this command will remove the component/s only from your local workspace. if your intent is to delete the component/s also from the remote scope, refer to \"bit delete\".\nthe component(s) will be untracked${filesDeletionStr}.\n${chal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K,GAAG,KAAK;IACbC,KAAK,GAAG,KAAK;IACbC,MAAM,GAAG,KAAK;IACdC,SAAS,GAAG;EAMd,CAAC,EACD;IACA,IAAI,CAACD,MAAM,EAAE;MACX,MAAM,IAAI,CAACE,YAAY,CAAC,CAACD,SAAS,CAAC;IACrC;IACA,MAAM;MACJE;IAGF,CAAC,GAAG,MAAM,IAAI,CAACb,MAAM,CAACA,MAAM,CAAC;MAAEO,iBAAiB;MAAEC,KAAK;MAAEC,KAAK;MAAEK,WAAW,EAAE,CAACH;IAAU,CAAC,CAAC;IAC1F;IACA,MAAMI,YAAY,GAAG,IAAAC,gCAAc,EAACH,WAAW,EAAE,KAAK,CAAC;IACvD;IACA;IACA;IACA,OAAOE,YAAY;EACrB;EAEA,MAAcH,YAAYA,CAACE,WAAqB,EAAE;IAChD,IAAI,CAACd,MAAM,CAACiB,MAAM,CAACC,eAAe,CAAC,CAAC;IACpC,MAAMC,gBAAgB,GAAGL,WAAW,GAChC,8FAA8F,GAC9F,EAAE;IACN,MAAMM,EAAE,GAAG,MAAM,IAAAC,gBAAK,EAAC;MACrBC,QAAQ,EAAE;AAChB,oCAAoCH,gBAAgB;AACpD,EAAEI,gBAAK,CAACC,IAAI,CAAC,2CAA2C,CAAC;IACrD,CAAC,CAAC;IACF,IAAI,CAACJ,EAAE,EAAE;MACP,MAAM,KAAIK,oBAAQ,EAAC,iCAAiC,CAAC;IACvD;EACF;AACF;AAACC,OAAA,CAAA5B,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_yesno","_bitError","_legacy","_removeTemplate","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RemoveCmd","constructor","remove","workspace","name","description","COMPONENT_PATTERN_HELP","cmd","report","componentsPattern","force","track","silent","keepFiles","removePrompt","localResult","deleteFiles","localMessage","removeTemplate","logger","clearStatusLine","filesDeletionStr","ok","yesno","question","chalk","bold","BitError","exports"],"sources":["remove-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport yesno from 'yesno';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport type { Workspace } from '@teambit/workspace';\nimport { BitError } from '@teambit/bit-error';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy.constants';\nimport type { RemovedLocalObjects } from './removed-local-objects';\nimport type { RemoveMain } from './remove.main.runtime';\nimport { removeTemplate } from './remove-template';\n\nexport class RemoveCmd implements Command {\n name = 'remove <component-pattern>';\n description = 'untrack components from the workspace';\n extendedDescription = `removes components from the local workspace only - stops tracking them in .bitmap and deletes their files by default.\ndoes not affect remote scopes - to delete components from remotes, use \"bit delete\" instead.\nuse --keep-files to preserve component files while only removing the tracking.`;\n arguments = [\n {\n name: 'component-pattern',\n description: COMPONENT_PATTERN_HELP,\n },\n ];\n group = 'component-development';\n helpUrl = 'reference/components/removing-components';\n skipWorkspace = true;\n alias = 'rm';\n options = [\n ['t', 'track', 'keep tracking component in .bitmap (default = false), helps transform a tagged-component to new'],\n ['', 'keep-files', 'keep component files (just untrack the component)'],\n [\n 'f',\n 'force',\n 'removes the component from the scope, even if used as a dependency. WARNING: you will need to fix the components that depend on this component',\n ],\n ['s', 'silent', 'skip confirmation'],\n ] as CommandOptions;\n loader = true;\n examples = [\n {\n cmd: 'remove \"$deprecated\"',\n description: 'remove all components that are deprecated',\n },\n ];\n remoteOp = true;\n\n constructor(\n private remove: RemoveMain,\n private workspace?: Workspace\n ) {}\n\n async report(\n [componentsPattern]: [string],\n {\n force = false,\n track = false,\n silent = false,\n keepFiles = false,\n }: {\n force?: boolean;\n track?: boolean;\n silent?: boolean;\n keepFiles?: boolean;\n }\n ) {\n if (!silent) {\n await this.removePrompt(!keepFiles);\n }\n const {\n localResult,\n }: {\n localResult: RemovedLocalObjects;\n } = await this.remove.remove({ componentsPattern, force, track, deleteFiles: !keepFiles });\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const localMessage = removeTemplate(localResult, false);\n // if (localMessage !== '')\n // localMessage +=\n // '. Note: these components were not deleted from the remote - if you want to delete components run \"bit delete\"\\n';\n return localMessage;\n }\n\n private async removePrompt(deleteFiles?: boolean) {\n this.remove.logger.clearStatusLine();\n const filesDeletionStr = deleteFiles\n ? ' and the files will be deleted from the filesystem (can be avoided by entering --keep-files)'\n : '';\n const ok = await yesno({\n question: `this command will remove the component/s only from your local workspace. if your intent is to delete the component/s also from the remote scope, refer to \"bit delete\".\nthe component(s) will be untracked${filesDeletionStr}.\n${chalk.bold('Would you like to proceed? [yes(y)/no(n)]')}`,\n });\n if (!ok) {\n throw new BitError('the operation has been canceled');\n }\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAM,gBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,eAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAmD,SAAAC,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,K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,EAAC,iCAAiC,CAAC;IACvD;EACF;AACF;AAACC,OAAA,CAAA5B,SAAA,GAAAA,SAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/remove",
3
- "version": "1.0.750",
3
+ "version": "1.0.752",
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.750"
9
+ "version": "1.0.752"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "4.1.2",
@@ -18,29 +18,29 @@
18
18
  "p-map-series": "2.1.0",
19
19
  "semver": "7.7.1",
20
20
  "@teambit/bit-error": "0.0.404",
21
- "@teambit/cli": "0.0.1272",
22
- "@teambit/legacy.constants": "0.0.17",
23
- "@teambit/legacy.scope": "0.0.73",
21
+ "@teambit/cli": "0.0.1273",
22
+ "@teambit/legacy.constants": "0.0.18",
23
+ "@teambit/legacy.scope": "0.0.74",
24
24
  "@teambit/component-id": "1.2.4",
25
- "@teambit/component.sources": "0.0.125",
26
- "@teambit/legacy.consumer": "0.0.73",
27
- "@teambit/legacy.logger": "0.0.27",
28
- "@teambit/legacy.component-list": "0.0.127",
29
- "@teambit/legacy.consumer-component": "0.0.74",
30
- "@teambit/pkg.modules.component-package-name": "0.0.80",
31
- "@teambit/scope.network": "0.0.73",
32
- "@teambit/scope.remotes": "0.0.73",
25
+ "@teambit/component.sources": "0.0.126",
26
+ "@teambit/legacy.consumer": "0.0.74",
27
+ "@teambit/legacy.logger": "0.0.28",
28
+ "@teambit/legacy.component-list": "0.0.128",
29
+ "@teambit/legacy.consumer-component": "0.0.75",
30
+ "@teambit/pkg.modules.component-package-name": "0.0.81",
31
+ "@teambit/scope.network": "0.0.74",
32
+ "@teambit/scope.remotes": "0.0.74",
33
33
  "@teambit/harmony": "0.4.7",
34
- "@teambit/component-issues": "0.0.163",
35
- "@teambit/legacy.utils": "0.0.26",
36
- "@teambit/logger": "0.0.1365",
37
- "@teambit/workspace": "1.0.750",
38
- "@teambit/component": "1.0.750",
39
- "@teambit/dependency-resolver": "1.0.750",
40
- "@teambit/importer": "1.0.750",
41
- "@teambit/issues": "1.0.750",
42
- "@teambit/lister": "1.0.750",
43
- "@teambit/scope": "1.0.750"
34
+ "@teambit/component-issues": "0.0.164",
35
+ "@teambit/legacy.utils": "0.0.27",
36
+ "@teambit/logger": "0.0.1366",
37
+ "@teambit/workspace": "1.0.752",
38
+ "@teambit/component": "1.0.752",
39
+ "@teambit/dependency-resolver": "1.0.752",
40
+ "@teambit/importer": "1.0.752",
41
+ "@teambit/issues": "1.0.752",
42
+ "@teambit/lister": "1.0.752",
43
+ "@teambit/scope": "1.0.752"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/fs-extra": "9.0.7",