@teambit/remove 1.0.956 → 1.0.957
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-template.js
CHANGED
|
@@ -44,8 +44,12 @@ function removeTemplate({
|
|
|
44
44
|
if ((0, _lodash().isEmpty)(removedComponentIds) && (0, _lodash().isEmpty)(removedFromLane)) return '';
|
|
45
45
|
const compToItems = comps => comps.map(id => (0, _cli().formatItem)(id.version === 'latest' ? id.toStringWithoutVersion() : id.toString()));
|
|
46
46
|
const getMsg = (isLane = false) => {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
if (isRemote) {
|
|
48
|
+
const removedFrom = isLane ? 'lane' : 'scope';
|
|
49
|
+
return `successfully removed components from the remote ${removedFrom}`;
|
|
50
|
+
}
|
|
51
|
+
const removedFrom = isLane ? 'lane' : 'workspace';
|
|
52
|
+
return `successfully removed components from the local ${removedFrom}`;
|
|
49
53
|
};
|
|
50
54
|
const compOutput = (0, _lodash().isEmpty)(removedComponentIds) ? '' : `${(0, _cli().formatSuccessSummary)(getMsg(false))}\n${compToItems(removedComponentIds).join('\n')}`;
|
|
51
55
|
const laneOutput = (0, _lodash().isEmpty)(removedFromLane) ? '' : `${(0, _cli().formatSuccessSummary)(getMsg(true))}\n${compToItems(removedFromLane).join('\n')}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_componentId","data","require","_lodash","_cli","removeTemplate","dependentBits","modifiedComponents","removedComponentIds","missingComponents","removedFromLane","isRemote","paintMissingComponents","isEmpty","items","map","id","ComponentID","fromObject","formatItem","version","toStringWithoutVersion","toString","errorSymbol","formatTitle","join","paintRemoved","compToItems","comps","getMsg","isLane","removedFrom","compOutput","formatSuccessSummary","laneOutput","joinSections","paintUnRemovedComponents","Object","keys","key","header","body","dep","paintModifiedComponents"],"sources":["remove-template.ts"],"sourcesContent":["import type { ComponentIdList } from '@teambit/component-id';\nimport { ComponentID } from '@teambit/component-id';\nimport { isEmpty } from 'lodash';\nimport { formatTitle, formatItem, formatSuccessSummary, errorSymbol, joinSections } from '@teambit/cli';\n\nexport function removeTemplate(\n { dependentBits, modifiedComponents = [], removedComponentIds, missingComponents, removedFromLane },\n isRemote\n) {\n const paintMissingComponents = () => {\n if (isEmpty(missingComponents)) return '';\n const items = missingComponents.map((id) => {\n if (!(id instanceof ComponentID)) id = ComponentID.fromObject(id);\n return formatItem(id.version === 'latest' ? id.toStringWithoutVersion() : id.toString(), errorSymbol);\n });\n return `${errorSymbol} ${formatTitle('missing components')}\\n${items.join('\\n')}`;\n };\n const paintRemoved = () => {\n if (isEmpty(removedComponentIds) && isEmpty(removedFromLane)) return '';\n const compToItems = (comps: ComponentIdList) =>\n comps.map((id) => formatItem(id.version === 'latest' ? id.toStringWithoutVersion() : id.toString()));\n const getMsg = (isLane = false) => {\n const removedFrom = isLane ? 'lane' : 'scope';\n
|
|
1
|
+
{"version":3,"names":["_componentId","data","require","_lodash","_cli","removeTemplate","dependentBits","modifiedComponents","removedComponentIds","missingComponents","removedFromLane","isRemote","paintMissingComponents","isEmpty","items","map","id","ComponentID","fromObject","formatItem","version","toStringWithoutVersion","toString","errorSymbol","formatTitle","join","paintRemoved","compToItems","comps","getMsg","isLane","removedFrom","compOutput","formatSuccessSummary","laneOutput","joinSections","paintUnRemovedComponents","Object","keys","key","header","body","dep","paintModifiedComponents"],"sources":["remove-template.ts"],"sourcesContent":["import type { ComponentIdList } from '@teambit/component-id';\nimport { ComponentID } from '@teambit/component-id';\nimport { isEmpty } from 'lodash';\nimport { formatTitle, formatItem, formatSuccessSummary, errorSymbol, joinSections } from '@teambit/cli';\n\nexport function removeTemplate(\n { dependentBits, modifiedComponents = [], removedComponentIds, missingComponents, removedFromLane },\n isRemote\n) {\n const paintMissingComponents = () => {\n if (isEmpty(missingComponents)) return '';\n const items = missingComponents.map((id) => {\n if (!(id instanceof ComponentID)) id = ComponentID.fromObject(id);\n return formatItem(id.version === 'latest' ? id.toStringWithoutVersion() : id.toString(), errorSymbol);\n });\n return `${errorSymbol} ${formatTitle('missing components')}\\n${items.join('\\n')}`;\n };\n const paintRemoved = () => {\n if (isEmpty(removedComponentIds) && isEmpty(removedFromLane)) return '';\n const compToItems = (comps: ComponentIdList) =>\n comps.map((id) => formatItem(id.version === 'latest' ? id.toStringWithoutVersion() : id.toString()));\n const getMsg = (isLane = false) => {\n if (isRemote) {\n const removedFrom = isLane ? 'lane' : 'scope';\n return `successfully removed components from the remote ${removedFrom}`;\n }\n const removedFrom = isLane ? 'lane' : 'workspace';\n return `successfully removed components from the local ${removedFrom}`;\n };\n const compOutput = isEmpty(removedComponentIds)\n ? ''\n : `${formatSuccessSummary(getMsg(false))}\\n${compToItems(removedComponentIds).join('\\n')}`;\n const laneOutput = isEmpty(removedFromLane)\n ? ''\n : `${formatSuccessSummary(getMsg(true))}\\n${compToItems(removedFromLane).join('\\n')}`;\n\n return joinSections([compOutput, laneOutput]);\n };\n\n const paintUnRemovedComponents = () => {\n if (isEmpty(dependentBits)) return '';\n return Object.keys(dependentBits)\n .map((key) => {\n const header = `${errorSymbol} ${formatTitle(`unable to delete ${key}, because the following components depend on it`)}`;\n const body = dependentBits[key].map((dep) => formatItem(dep, errorSymbol)).join('\\n');\n return `${header}\\n${body}`;\n })\n .join('\\n\\n');\n };\n\n const paintModifiedComponents = () => {\n if (isEmpty(modifiedComponents)) return '';\n const items = modifiedComponents.map((id: ComponentID) =>\n formatItem(id.version === 'latest' ? id.toStringWithoutVersion() : id.toString(), errorSymbol)\n );\n return `${errorSymbol} ${formatTitle('unable to remove modified components (use --force to remove)')}\\n${items.join('\\n')}`;\n };\n\n return joinSections([\n paintUnRemovedComponents(),\n paintRemoved(),\n paintMissingComponents(),\n paintModifiedComponents(),\n ]);\n}\n"],"mappings":";;;;;;AACA,SAAAA,aAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,YAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA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AAG,CAAC,CAACxB,GAAG,CAAE2B,GAAG,IAAK,IAAAvB,iBAAU,EAACuB,GAAG,EAAEnB,kBAAW,CAAC,CAAC,CAACE,IAAI,CAAC,IAAI,CAAC;MACrF,OAAO,GAAGe,MAAM,KAAKC,IAAI,EAAE;IAC7B,CAAC,CAAC,CACDhB,IAAI,CAAC,MAAM,CAAC;EACjB,CAAC;EAED,MAAMkB,uBAAuB,GAAGA,CAAA,KAAM;IACpC,IAAI,IAAA9B,iBAAO,EAACN,kBAAkB,CAAC,EAAE,OAAO,EAAE;IAC1C,MAAMO,KAAK,GAAGP,kBAAkB,CAACQ,GAAG,CAAEC,EAAe,IACnD,IAAAG,iBAAU,EAACH,EAAE,CAACI,OAAO,KAAK,QAAQ,GAAGJ,EAAE,CAACK,sBAAsB,CAAC,CAAC,GAAGL,EAAE,CAACM,QAAQ,CAAC,CAAC,EAAEC,kBAAW,CAC/F,CAAC;IACD,OAAO,GAAGA,kBAAW,IAAI,IAAAC,kBAAW,EAAC,8DAA8D,CAAC,KAAKV,KAAK,CAACW,IAAI,CAAC,IAAI,CAAC,EAAE;EAC7H,CAAC;EAED,OAAO,IAAAU,mBAAY,EAAC,CAClBC,wBAAwB,CAAC,CAAC,EAC1BV,YAAY,CAAC,CAAC,EACdd,sBAAsB,CAAC,CAAC,EACxB+B,uBAAuB,CAAC,CAAC,CAC1B,CAAC;AACJ","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/remove",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.957",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/remove",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "remove",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.957"
|
|
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/legacy.constants": "0.0.26",
|
|
22
|
-
"@teambit/component-id": "1.2.4",
|
|
23
|
-
"@teambit/legacy.logger": "0.0.38",
|
|
24
|
-
"@teambit/harmony": "0.4.7",
|
|
25
|
-
"@teambit/component-issues": "0.0.171",
|
|
26
|
-
"@teambit/legacy.utils": "0.0.34",
|
|
27
21
|
"@teambit/cli": "0.0.1318",
|
|
22
|
+
"@teambit/legacy.constants": "0.0.26",
|
|
28
23
|
"@teambit/legacy.scope": "0.0.109",
|
|
29
|
-
"@teambit/
|
|
24
|
+
"@teambit/component-id": "1.2.4",
|
|
30
25
|
"@teambit/component.sources": "0.0.161",
|
|
31
26
|
"@teambit/legacy.consumer": "0.0.109",
|
|
27
|
+
"@teambit/legacy.logger": "0.0.38",
|
|
32
28
|
"@teambit/legacy.component-list": "0.0.163",
|
|
33
29
|
"@teambit/legacy.consumer-component": "0.0.110",
|
|
34
30
|
"@teambit/pkg.modules.component-package-name": "0.0.116",
|
|
35
31
|
"@teambit/scope.network": "0.0.109",
|
|
36
32
|
"@teambit/scope.remotes": "0.0.109",
|
|
37
|
-
"@teambit/
|
|
38
|
-
"@teambit/
|
|
39
|
-
"@teambit/
|
|
40
|
-
"@teambit/issues": "1.0.956",
|
|
41
|
-
"@teambit/lister": "1.0.956",
|
|
33
|
+
"@teambit/harmony": "0.4.7",
|
|
34
|
+
"@teambit/component-issues": "0.0.171",
|
|
35
|
+
"@teambit/legacy.utils": "0.0.34",
|
|
42
36
|
"@teambit/logger": "0.0.1411",
|
|
43
|
-
"@teambit/
|
|
37
|
+
"@teambit/workspace": "1.0.957",
|
|
38
|
+
"@teambit/component": "1.0.957",
|
|
39
|
+
"@teambit/dependency-resolver": "1.0.957",
|
|
40
|
+
"@teambit/importer": "1.0.957",
|
|
41
|
+
"@teambit/issues": "1.0.957",
|
|
42
|
+
"@teambit/lister": "1.0.957",
|
|
43
|
+
"@teambit/scope": "1.0.957"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/fs-extra": "9.0.7",
|
|
File without changes
|