@teambit/remove 0.0.210 → 0.0.212
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.js
CHANGED
|
@@ -100,7 +100,7 @@ class RemoveCmd {
|
|
|
100
100
|
return `${_chalk().default.green('successfully soft-removed the following components:')}
|
|
101
101
|
${removedCompIds.join('\n')}
|
|
102
102
|
|
|
103
|
-
${_chalk().default.bold('to update the remote, please tag/snap and then export')}`;
|
|
103
|
+
${_chalk().default.bold('to update the remote, please tag/snap and then export. to revert, please use "bit recover"')}`;
|
|
104
104
|
}
|
|
105
105
|
if (deleteFiles) {
|
|
106
106
|
_loader().default.stop();
|
package/dist/remove-cmd.js.map
CHANGED
|
@@ -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')}`;\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,CAASC,MAAkB,EAAE;IAAA,KAApBA,MAAkB,GAAlBA,MAAkB;IAAA,8CAlC/B,4BAA4B;IAAA,qDACrB,2DAA2D;IAAA,mDAC7D,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,mGAAmG,CAAC,EACjH,CACE,GAAG,EACH,QAAQ,EACR,uHAAuH,CACxH,EACD,CAAC,EAAE,EAAE,WAAW,EAAE,8EAA8E,CAAC,EACjG,CAAC,GAAG,EAAE,OAAO,EAAE,iGAAiG,CAAC,EACjH,CAAC,GAAG,EAAE,cAAc,EAAE,oEAAoE,CAAC,EAC3F,CAAC,EAAE,EAAE,YAAY,EAAE,mDAAmD,CAAC,EACvE,CACE,GAAG,EACH,OAAO,EACP,oIAAoI,CACrI,EACD,CAAC,GAAG,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CACrC;IAAA,gDACQ,IAAI;IAAA,mDACD,IAAI;IAAA,kDACL,IAAI;EAE0B;EAEzC,MAAMC,MAAM,CACV,CAACC,iBAAiB,CAAW,EAC7B;IACEC,IAAI,GAAG,KAAK;IACZC,KAAK,GAAG,KAAK;IACbC,MAAM,GAAG,KAAK;IACdC,QAAQ,GAAG,KAAK;IAChBC,KAAK,GAAG,KAAK;IACbC,WAAW,GAAG,KAAK;IACnBC,MAAM,GAAG,KAAK;IACdC,SAAS,GAAG;EAUd,CAAC,EACD;IACA,IAAIP,IAAI,EAAE;MACR,IAAIE,MAAM,EACR,MAAM,KAAIM,oBAAQ,EACf,2IAA0I,CAC5I;MACH,IAAIJ,KAAK,EAAE,MAAM,KAAII,oBAAQ,EAAE,sDAAqD,CAAC;MACrF,IAAID,SAAS,EAAE,MAAM,KAAIC,oBAAQ,EAAE,2DAA0D,CAAC;MAC9F,IAAIL,QAAQ,EAAE,MAAM,KAAIK,oBAAQ,EAAE,0DAAyD,CAAC;MAC5F,MAAMC,cAAc,GAAG,MAAM,IAAI,CAACf,MAAM,CAACgB,UAAU,CAACX,iBAAiB,CAAC;MACtE,OAAQ,GAAEY,gBAAK,CAACC,KAAK,CAAC,qDAAqD,CAAE;AACnF,EAAEH,cAAc,CAACI,IAAI,CAAC,IAAI,CAAE;AAC5B;AACA,EAAEF,gBAAK,CAACG,IAAI,CAAC,
|
|
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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EJ;IAAS,CAAC,CAAC;IAC5G;IACA,OAAO,IAAAwB,yBAAY,EAACF,WAAW,EAAE,KAAK,CAAC,GAAG,IAAI,CAACG,UAAU,CAACF,YAAY,CAAC;EACzE;EACAE,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.212",
|
|
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.212"
|
|
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.696",
|
|
25
|
+
"@teambit/component": "0.0.1035",
|
|
26
|
+
"@teambit/importer": "0.0.464",
|
|
27
|
+
"@teambit/logger": "0.0.789",
|
|
28
|
+
"@teambit/workspace": "0.0.1035"
|
|
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.476",
|
|
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
|