@teambit/remove 0.0.224 → 0.0.226
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/remove-cmd.d.ts +1 -0
- package/dist/remove-cmd.js +6 -0
- package/dist/remove-cmd.js.map +1 -1
- package/package-tar/teambit-remove-0.0.226.tgz +0 -0
- package/package.json +8 -8
- package/package-tar/teambit-remove-0.0.224.tgz +0 -0
- /package/dist/{preview-1683084947241.js → preview-1683430915272.js} +0 -0
package/dist/remove-cmd.d.ts
CHANGED
package/dist/remove-cmd.js
CHANGED
|
@@ -61,6 +61,12 @@ class RemoveCmd {
|
|
|
61
61
|
this.remove = remove;
|
|
62
62
|
(0, _defineProperty2().default)(this, "name", 'remove <component-pattern>');
|
|
63
63
|
(0, _defineProperty2().default)(this, "description", 'remove component(s) from the workspace, or a remote scope');
|
|
64
|
+
(0, _defineProperty2().default)(this, "extendedDescription", `to remove components from your local workspace only, use "bit remove" (with no flags).
|
|
65
|
+
|
|
66
|
+
to remove a component from the remote scope, use "bit remove --delete", to mark the components as deleted.
|
|
67
|
+
once tagged/snapped and exported, the remote scope will be updated and it'll be marked as deleted there as well.
|
|
68
|
+
in case this is running on a lane, it'll mark the component as deleted on the lane only, which tells bit not to merge them. the main will not be affected.
|
|
69
|
+
`);
|
|
64
70
|
(0, _defineProperty2().default)(this, "arguments", [{
|
|
65
71
|
name: 'component-pattern',
|
|
66
72
|
description: _constants().COMPONENT_PATTERN_HELP
|
package/dist/remove-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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[]) {\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;AAGO,MAAMA,SAAS,CAAoB;
|
|
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 extendedDescription = `to remove components from your local workspace only, use \"bit remove\" (with no flags).\n\nto remove a component from the remote scope, use \"bit remove --delete\", to mark the components as deleted.\nonce tagged/snapped and exported, the remote scope will be updated and it'll be marked as deleted there as well.\nin case this is running on a lane, it'll mark the component as deleted on the lane only, which tells bit not to merge them. the main will not be affected.\n`;\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[]) {\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;AAGO,MAAMA,SAAS,CAAoB;EA0CxCC,WAAW,CAASC,MAAkB,EAAE;IAAA,KAApBA,MAAkB,GAAlBA,MAAkB;IAAA,8CAzC/B,4BAA4B;IAAA,qDACrB,2DAA2D;IAAA,6DAClD;AACzB;AACA;AACA;AACA;AACA,CAAC;IAAA,mDACa,CACV;MACEC,IAAI,EAAE,mBAAmB;MACzBC,WAAW,EAAEC;IACf,CAAC,CACF;IAAA,+CACO,aAAa;IAAA,iDACX,qCAAqC;IAAA,uDAC/B,IAAI;IAAA,+CACZ,IAAI;IAAA,iDACF,CACR,CAAC,EAAE,EAAE,MAAM,EAAE,kCAAkC,CAAC,EAChD,CAAC,EAAE,EAAE,QAAQ,EAAE,qFAAqF,CAAC,EACrG,CAAC,EAAE,EAAE,QAAQ,EAAE,gCAAgC,CAAC,EAChD,CACE,EAAE,EACF,MAAM,EACN,uIAAuI,CACxI,EACD,CAAC,EAAE,EAAE,WAAW,EAAE,8EAA8E,CAAC,EACjG,CAAC,GAAG,EAAE,OAAO,EAAE,iGA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I,CAAE;AAC5B;AACA,EAAEF,gBAAK,CAACG,IAAI,CAAC,4FAA4F,CAAE,EAAC;IACxG;IAEA,IAAI,CAACV,MAAM,EAAE;MACX,MAAMW,eAAe,GAAG,CAACd,IAAI,IAAI,CAACI,SAAS;MAC3C,MAAMW,kBAAkB,GAAG,MAAM,IAAAC,uBAAY,EAACF,eAAe,EAAEd,IAAI,CAAC,EAAE;MACtE;MACA,IAAI,CAAC,IAAAiB,aAAE,EAACF,kBAAkB,CAACG,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"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/remove",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.226",
|
|
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.
|
|
9
|
+
"version": "0.0.226"
|
|
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.
|
|
25
|
-
"@teambit/component": "0.0.
|
|
26
|
-
"@teambit/importer": "0.0.
|
|
27
|
-
"@teambit/logger": "0.0.
|
|
28
|
-
"@teambit/workspace": "0.0.
|
|
24
|
+
"@teambit/cli": "0.0.706",
|
|
25
|
+
"@teambit/component": "0.0.1049",
|
|
26
|
+
"@teambit/importer": "0.0.478",
|
|
27
|
+
"@teambit/logger": "0.0.799",
|
|
28
|
+
"@teambit/workspace": "0.0.1049"
|
|
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.
|
|
39
|
+
"@teambit/legacy": "1.0.486",
|
|
40
40
|
"react": "^16.8.0 || ^17.0.0",
|
|
41
41
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
42
42
|
},
|
|
Binary file
|
|
File without changes
|