@teambit/remove 1.0.321 → 1.0.323
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/artifacts/__bit_junit.xml +1 -1
- package/artifacts/schema.json +167 -5
- package/dist/delete-component-files.d.ts +3 -0
- package/dist/delete-component-files.js +53 -0
- package/dist/delete-component-files.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/remove-components.js +2 -2
- package/dist/remove-components.js.map +1 -1
- package/dist/remove.main.runtime.js +8 -8
- package/dist/remove.main.runtime.js.map +1 -1
- package/package.json +11 -11
- /package/dist/{preview-1719751947574.js → preview-1719976973592.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<testsuites tests="0" failures="0" errors="0" skipped="0">
|
|
3
|
-
<testsuite name="teambit.component/remove@1.0.
|
|
3
|
+
<testsuite name="teambit.component/remove@1.0.323" tests="0" failures="0" errors="0" skipped="0"/>
|
|
4
4
|
</testsuites>
|
package/artifacts/schema.json
CHANGED
|
@@ -1769,7 +1769,7 @@
|
|
|
1769
1769
|
"_legacy": {
|
|
1770
1770
|
"scope": "teambit.component",
|
|
1771
1771
|
"name": "remove",
|
|
1772
|
-
"version": "1.0.
|
|
1772
|
+
"version": "1.0.323"
|
|
1773
1773
|
},
|
|
1774
1774
|
"_scope": "teambit.component"
|
|
1775
1775
|
}
|
|
@@ -1786,6 +1786,86 @@
|
|
|
1786
1786
|
"line": 5,
|
|
1787
1787
|
"character": 10
|
|
1788
1788
|
},
|
|
1789
|
+
"name": "deleteComponentsFiles",
|
|
1790
|
+
"exportNode": {
|
|
1791
|
+
"__schema": "FunctionLikeSchema",
|
|
1792
|
+
"location": {
|
|
1793
|
+
"filePath": "delete-component-files.ts",
|
|
1794
|
+
"line": 7,
|
|
1795
|
+
"character": 1
|
|
1796
|
+
},
|
|
1797
|
+
"signature": "function deleteComponentsFiles(consumer: Consumer, bitIds: ComponentIdList): Promise<void>",
|
|
1798
|
+
"name": "deleteComponentsFiles",
|
|
1799
|
+
"params": [
|
|
1800
|
+
{
|
|
1801
|
+
"__schema": "ParameterSchema",
|
|
1802
|
+
"location": {
|
|
1803
|
+
"filePath": "delete-component-files.ts",
|
|
1804
|
+
"line": 7,
|
|
1805
|
+
"character": 45
|
|
1806
|
+
},
|
|
1807
|
+
"name": "consumer",
|
|
1808
|
+
"type": {
|
|
1809
|
+
"__schema": "TypeRefSchema",
|
|
1810
|
+
"location": {
|
|
1811
|
+
"filePath": "delete-component-files.ts",
|
|
1812
|
+
"line": 7,
|
|
1813
|
+
"character": 55
|
|
1814
|
+
},
|
|
1815
|
+
"name": "Consumer",
|
|
1816
|
+
"packageName": "@teambit/legacy/dist/consumer/consumer"
|
|
1817
|
+
},
|
|
1818
|
+
"isOptional": false,
|
|
1819
|
+
"isSpread": false
|
|
1820
|
+
},
|
|
1821
|
+
{
|
|
1822
|
+
"__schema": "ParameterSchema",
|
|
1823
|
+
"location": {
|
|
1824
|
+
"filePath": "delete-component-files.ts",
|
|
1825
|
+
"line": 7,
|
|
1826
|
+
"character": 65
|
|
1827
|
+
},
|
|
1828
|
+
"name": "bitIds",
|
|
1829
|
+
"type": {
|
|
1830
|
+
"__schema": "TypeRefSchema",
|
|
1831
|
+
"location": {
|
|
1832
|
+
"filePath": "delete-component-files.ts",
|
|
1833
|
+
"line": 7,
|
|
1834
|
+
"character": 73
|
|
1835
|
+
},
|
|
1836
|
+
"name": "ComponentIdList",
|
|
1837
|
+
"componentId": {
|
|
1838
|
+
"scope": "teambit.component",
|
|
1839
|
+
"name": "component-id",
|
|
1840
|
+
"version": "1.2.0"
|
|
1841
|
+
}
|
|
1842
|
+
},
|
|
1843
|
+
"isOptional": false,
|
|
1844
|
+
"isSpread": false
|
|
1845
|
+
}
|
|
1846
|
+
],
|
|
1847
|
+
"returnType": {
|
|
1848
|
+
"__schema": "InferenceTypeSchema",
|
|
1849
|
+
"location": {
|
|
1850
|
+
"filePath": "delete-component-files.ts",
|
|
1851
|
+
"line": 7,
|
|
1852
|
+
"character": 1
|
|
1853
|
+
},
|
|
1854
|
+
"type": "Promise<void>"
|
|
1855
|
+
},
|
|
1856
|
+
"modifiers": [
|
|
1857
|
+
"export",
|
|
1858
|
+
"async"
|
|
1859
|
+
]
|
|
1860
|
+
}
|
|
1861
|
+
},
|
|
1862
|
+
{
|
|
1863
|
+
"__schema": "ExportSchema",
|
|
1864
|
+
"location": {
|
|
1865
|
+
"filePath": "index.ts",
|
|
1866
|
+
"line": 6,
|
|
1867
|
+
"character": 10
|
|
1868
|
+
},
|
|
1789
1869
|
"name": "removeTemplate",
|
|
1790
1870
|
"exportNode": {
|
|
1791
1871
|
"__schema": "FunctionLikeSchema",
|
|
@@ -1965,7 +2045,7 @@
|
|
|
1965
2045
|
"__schema": "UnImplementedSchema",
|
|
1966
2046
|
"location": {
|
|
1967
2047
|
"filePath": "index.ts",
|
|
1968
|
-
"line":
|
|
2048
|
+
"line": 7,
|
|
1969
2049
|
"character": 16
|
|
1970
2050
|
},
|
|
1971
2051
|
"name": "RemoveAspect",
|
|
@@ -1975,7 +2055,7 @@
|
|
|
1975
2055
|
"__schema": "ExportSchema",
|
|
1976
2056
|
"location": {
|
|
1977
2057
|
"filePath": "index.ts",
|
|
1978
|
-
"line":
|
|
2058
|
+
"line": 8,
|
|
1979
2059
|
"character": 10
|
|
1980
2060
|
},
|
|
1981
2061
|
"name": "RemoveAspect",
|
|
@@ -3872,7 +3952,7 @@
|
|
|
3872
3952
|
"_legacy": {
|
|
3873
3953
|
"scope": "teambit.component",
|
|
3874
3954
|
"name": "remove",
|
|
3875
|
-
"version": "1.0.
|
|
3955
|
+
"version": "1.0.323"
|
|
3876
3956
|
},
|
|
3877
3957
|
"_scope": "teambit.component"
|
|
3878
3958
|
}
|
|
@@ -3884,6 +3964,88 @@
|
|
|
3884
3964
|
],
|
|
3885
3965
|
"internals": []
|
|
3886
3966
|
},
|
|
3967
|
+
{
|
|
3968
|
+
"__schema": "ModuleSchema",
|
|
3969
|
+
"location": {
|
|
3970
|
+
"filePath": "delete-component-files.ts",
|
|
3971
|
+
"line": 1,
|
|
3972
|
+
"character": 1
|
|
3973
|
+
},
|
|
3974
|
+
"exports": [
|
|
3975
|
+
{
|
|
3976
|
+
"__schema": "FunctionLikeSchema",
|
|
3977
|
+
"location": {
|
|
3978
|
+
"filePath": "delete-component-files.ts",
|
|
3979
|
+
"line": 7,
|
|
3980
|
+
"character": 1
|
|
3981
|
+
},
|
|
3982
|
+
"signature": "function deleteComponentsFiles(consumer: Consumer, bitIds: ComponentIdList): Promise<void>",
|
|
3983
|
+
"name": "deleteComponentsFiles",
|
|
3984
|
+
"params": [
|
|
3985
|
+
{
|
|
3986
|
+
"__schema": "ParameterSchema",
|
|
3987
|
+
"location": {
|
|
3988
|
+
"filePath": "delete-component-files.ts",
|
|
3989
|
+
"line": 7,
|
|
3990
|
+
"character": 45
|
|
3991
|
+
},
|
|
3992
|
+
"name": "consumer",
|
|
3993
|
+
"type": {
|
|
3994
|
+
"__schema": "TypeRefSchema",
|
|
3995
|
+
"location": {
|
|
3996
|
+
"filePath": "delete-component-files.ts",
|
|
3997
|
+
"line": 7,
|
|
3998
|
+
"character": 55
|
|
3999
|
+
},
|
|
4000
|
+
"name": "Consumer",
|
|
4001
|
+
"packageName": "@teambit/legacy/dist/consumer/consumer"
|
|
4002
|
+
},
|
|
4003
|
+
"isOptional": false,
|
|
4004
|
+
"isSpread": false
|
|
4005
|
+
},
|
|
4006
|
+
{
|
|
4007
|
+
"__schema": "ParameterSchema",
|
|
4008
|
+
"location": {
|
|
4009
|
+
"filePath": "delete-component-files.ts",
|
|
4010
|
+
"line": 7,
|
|
4011
|
+
"character": 65
|
|
4012
|
+
},
|
|
4013
|
+
"name": "bitIds",
|
|
4014
|
+
"type": {
|
|
4015
|
+
"__schema": "TypeRefSchema",
|
|
4016
|
+
"location": {
|
|
4017
|
+
"filePath": "delete-component-files.ts",
|
|
4018
|
+
"line": 7,
|
|
4019
|
+
"character": 73
|
|
4020
|
+
},
|
|
4021
|
+
"name": "ComponentIdList",
|
|
4022
|
+
"componentId": {
|
|
4023
|
+
"scope": "teambit.component",
|
|
4024
|
+
"name": "component-id",
|
|
4025
|
+
"version": "1.2.0"
|
|
4026
|
+
}
|
|
4027
|
+
},
|
|
4028
|
+
"isOptional": false,
|
|
4029
|
+
"isSpread": false
|
|
4030
|
+
}
|
|
4031
|
+
],
|
|
4032
|
+
"returnType": {
|
|
4033
|
+
"__schema": "InferenceTypeSchema",
|
|
4034
|
+
"location": {
|
|
4035
|
+
"filePath": "delete-component-files.ts",
|
|
4036
|
+
"line": 7,
|
|
4037
|
+
"character": 1
|
|
4038
|
+
},
|
|
4039
|
+
"type": "Promise<void>"
|
|
4040
|
+
},
|
|
4041
|
+
"modifiers": [
|
|
4042
|
+
"export",
|
|
4043
|
+
"async"
|
|
4044
|
+
]
|
|
4045
|
+
}
|
|
4046
|
+
],
|
|
4047
|
+
"internals": []
|
|
4048
|
+
},
|
|
3887
4049
|
{
|
|
3888
4050
|
"__schema": "ModuleSchema",
|
|
3889
4051
|
"location": {
|
|
@@ -3925,7 +4087,7 @@
|
|
|
3925
4087
|
"componentId": {
|
|
3926
4088
|
"scope": "teambit.component",
|
|
3927
4089
|
"name": "remove",
|
|
3928
|
-
"version": "1.0.
|
|
4090
|
+
"version": "1.0.323"
|
|
3929
4091
|
},
|
|
3930
4092
|
"taggedModuleExports": []
|
|
3931
4093
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.deleteComponentsFiles = deleteComponentsFiles;
|
|
7
|
+
function _logger() {
|
|
8
|
+
const data = _interopRequireDefault(require("@teambit/legacy/dist/logger/logger"));
|
|
9
|
+
_logger = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _dataToPersist() {
|
|
15
|
+
const data = _interopRequireDefault(require("@teambit/legacy/dist/consumer/component/sources/data-to-persist"));
|
|
16
|
+
_dataToPersist = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _removePath() {
|
|
22
|
+
const data = _interopRequireDefault(require("@teambit/legacy/dist/consumer/component/sources/remove-path"));
|
|
23
|
+
_removePath = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
|
+
async function deleteComponentsFiles(consumer, bitIds) {
|
|
30
|
+
_logger().default.debug(`deleteComponentsFiles, ids: ${bitIds.toString()}`);
|
|
31
|
+
const filesToDelete = getFilesToDelete();
|
|
32
|
+
filesToDelete.addBasePath(consumer.getPath());
|
|
33
|
+
return filesToDelete.persistAllToFS();
|
|
34
|
+
function getFilesToDelete() {
|
|
35
|
+
const dataToPersist = new (_dataToPersist().default)();
|
|
36
|
+
bitIds.forEach(id => {
|
|
37
|
+
const ignoreVersion = consumer.scope.isLocal(id) || !id.hasVersion();
|
|
38
|
+
const componentMap = consumer.bitMap.getComponentIfExist(id, {
|
|
39
|
+
ignoreVersion
|
|
40
|
+
});
|
|
41
|
+
if (!componentMap) {
|
|
42
|
+
_logger().default.warn(`deleteComponentsFiles was unable to delete ${id.toString()} because the id is missing from bitmap`);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const rootDir = componentMap.rootDir;
|
|
46
|
+
if (!rootDir) throw new Error(`rootDir is missing from ${id.toString()}`);
|
|
47
|
+
dataToPersist.removePath(new (_removePath().default)(rootDir, true));
|
|
48
|
+
});
|
|
49
|
+
return dataToPersist;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=delete-component-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_logger","data","_interopRequireDefault","require","_dataToPersist","_removePath","e","__esModule","default","deleteComponentsFiles","consumer","bitIds","logger","debug","toString","filesToDelete","getFilesToDelete","addBasePath","getPath","persistAllToFS","dataToPersist","DataToPersist","forEach","id","ignoreVersion","scope","isLocal","hasVersion","componentMap","bitMap","getComponentIfExist","warn","rootDir","Error","removePath","RemovePath"],"sources":["delete-component-files.ts"],"sourcesContent":["import { ComponentIdList } from '@teambit/component-id';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport DataToPersist from '@teambit/legacy/dist/consumer/component/sources/data-to-persist';\nimport RemovePath from '@teambit/legacy/dist/consumer/component/sources/remove-path';\nimport Consumer from '@teambit/legacy/dist/consumer/consumer';\n\nexport async function deleteComponentsFiles(consumer: Consumer, bitIds: ComponentIdList) {\n logger.debug(`deleteComponentsFiles, ids: ${bitIds.toString()}`);\n const filesToDelete = getFilesToDelete();\n filesToDelete.addBasePath(consumer.getPath());\n return filesToDelete.persistAllToFS();\n\n function getFilesToDelete(): DataToPersist {\n const dataToPersist = new DataToPersist();\n bitIds.forEach((id) => {\n const ignoreVersion = consumer.scope.isLocal(id) || !id.hasVersion();\n const componentMap = consumer.bitMap.getComponentIfExist(id, { ignoreVersion });\n if (!componentMap) {\n logger.warn(\n `deleteComponentsFiles was unable to delete ${id.toString()} because the id is missing from bitmap`\n );\n return;\n }\n const rootDir = componentMap.rootDir;\n if (!rootDir) throw new Error(`rootDir is missing from ${id.toString()}`);\n dataToPersist.removePath(new RemovePath(rootDir, true));\n });\n return dataToPersist;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,eAAA;EAAA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AAE,MAAM,IAAIC,KAAK,CAAC,2BAA2BV,EAAE,CAACT,QAAQ,CAAC,CAAC,EAAE,CAAC;MACzEM,aAAa,CAACc,UAAU,CAAC,KAAIC,qBAAU,EAACH,OAAO,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC,CAAC;IACF,OAAOZ,aAAa;EACtB;AACF","ignoreList":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RemoveAspect } from './remove.aspect';
|
|
2
2
|
export type { RemoveMain, RemoveInfo } from './remove.main.runtime';
|
|
3
3
|
export type { RemovedLocalObjects } from './removed-local-objects';
|
|
4
|
+
export { deleteComponentsFiles } from './delete-component-files';
|
|
4
5
|
export { removeTemplate } from './remove-template';
|
|
5
6
|
export default RemoveAspect;
|
|
6
7
|
export { RemoveAspect };
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,12 @@ Object.defineProperty(exports, "RemoveAspect", {
|
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
exports.default = void 0;
|
|
13
|
+
Object.defineProperty(exports, "deleteComponentsFiles", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () {
|
|
16
|
+
return _deleteComponentFiles().deleteComponentsFiles;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
13
19
|
Object.defineProperty(exports, "removeTemplate", {
|
|
14
20
|
enumerable: true,
|
|
15
21
|
get: function () {
|
|
@@ -23,6 +29,13 @@ function _remove() {
|
|
|
23
29
|
};
|
|
24
30
|
return data;
|
|
25
31
|
}
|
|
32
|
+
function _deleteComponentFiles() {
|
|
33
|
+
const data = require("./delete-component-files");
|
|
34
|
+
_deleteComponentFiles = function () {
|
|
35
|
+
return data;
|
|
36
|
+
};
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
26
39
|
function _removeTemplate() {
|
|
27
40
|
const data = require("./remove-template");
|
|
28
41
|
_removeTemplate = function () {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_remove","data","require","_removeTemplate","_default","exports","default","RemoveAspect"],"sources":["index.ts"],"sourcesContent":["import { RemoveAspect } from './remove.aspect';\n\nexport type { RemoveMain, RemoveInfo } from './remove.main.runtime';\nexport type { RemovedLocalObjects } from './removed-local-objects';\nexport { removeTemplate } from './remove-template';\nexport default RemoveAspect;\nexport { RemoveAspect };\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_remove","data","require","_deleteComponentFiles","_removeTemplate","_default","exports","default","RemoveAspect"],"sources":["index.ts"],"sourcesContent":["import { RemoveAspect } from './remove.aspect';\n\nexport type { RemoveMain, RemoveInfo } from './remove.main.runtime';\nexport type { RemovedLocalObjects } from './removed-local-objects';\nexport { deleteComponentsFiles } from './delete-component-files';\nexport { removeTemplate } from './remove-template';\nexport default RemoveAspect;\nexport { RemoveAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAE,sBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,qBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,gBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,eAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAmD,IAAAI,QAAA,GAAAC,OAAA,CAAAC,OAAA,GACpCC,sBAAY","ignoreList":[]}
|
|
@@ -82,7 +82,7 @@ function _scopeRemotes() {
|
|
|
82
82
|
return data;
|
|
83
83
|
}
|
|
84
84
|
function _deleteComponentFiles() {
|
|
85
|
-
const data =
|
|
85
|
+
const data = require("./delete-component-files");
|
|
86
86
|
_deleteComponentFiles = function () {
|
|
87
87
|
return data;
|
|
88
88
|
};
|
|
@@ -249,7 +249,7 @@ If you understand the risks and wish to proceed with the removal, please use the
|
|
|
249
249
|
// otherwise, components should still be in .bitmap file
|
|
250
250
|
idsToCleanFromWorkspace.push(...removedComponentIds);
|
|
251
251
|
if (idsToCleanFromWorkspace.length) {
|
|
252
|
-
if (deleteFiles) await (0, _deleteComponentFiles().
|
|
252
|
+
if (deleteFiles) await (0, _deleteComponentFiles().deleteComponentsFiles)(consumer, idsToCleanFromWorkspace);
|
|
253
253
|
if (!track) {
|
|
254
254
|
const invalidComponentsIds = invalidComponents.map(i => i.id);
|
|
255
255
|
const removedComponents = componentsToRemove.filter(c => idsToCleanFromWorkspace.hasWithoutVersion(c.id));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_groupArray","data","_interopRequireDefault","require","_lodash","_componentId","_lodash2","_constants","_bitError","_enrichContextFromGlobal","_logger","_http","_remotes","_scopeRemotes","_deleteComponentFiles","_componentsList","_consumerComponent","packageJsonUtils","_interopRequireWildcard","_pMapSeries","_removedLocalObjects","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","removeComponents","workspace","ids","force","remote","track","deleteFiles","logger","debugAndAddBreadCrumb","toString","bitIdsLatest","ComponentIdList","fromArray","map","id","changeVersion","LATEST_BIT_VERSION","localIds","remoteIds","partition","isLocal","length","BitError","join","remoteResult","isEmpty","removeRemote","localResult","removeLocal","RemovedLocalObjects","bitIds","groupedBitsByScope","groupArray","remotes","getScopeRemotes","scope","legacyScope","Remotes","getGlobalRemotes","shouldGoToCentralHub","keys","http","Http","connect","CENTRAL_BIT_HUB_URL","CENTRAL_BIT_HUB_NAME","deleteViaCentralHub","idsAreLanes","context","enrichContextFromGlobal","removeP","key","resolvedRemote","resolve","idsStr","toStringWithoutVersion","deleteMany","Promise","all","consumer","modifiedComponents","nonModifiedComponents","newIds","pMapSeries","componentStatus","getComponentStatusById","newlyCreated","push","modified","err","Component","isComponentInvalidByErrorType","list","listWithInvalid","components","forEach","c","hasWithoutVersion","aspectIds","state","aspects","used","find","newId","includes","idsToRemove","componentsList","ComponentsList","newComponents","listNewComponents","idsToRemoveFromScope","filter","idsToCleanFromWorkspace","componentsToRemove","invalidComponents","loadComponents","removedComponentIds","missingComponents","dependentBits","removedFromLane","removeMany","deleteComponentsFiles","invalidComponentsIds","removedComponents","removeComponentsFromWorkspacesAndDependencies","cleanFromBitMap","cleanFromConfig","uniqFromArray"],"sources":["remove-components.ts"],"sourcesContent":["import groupArray from 'group-array';\nimport partition from 'lodash.partition';\nimport { Workspace } from '@teambit/workspace';\nimport { ComponentIdList } from '@teambit/component-id';\nimport { isEmpty } from 'lodash';\nimport { CENTRAL_BIT_HUB_NAME, CENTRAL_BIT_HUB_URL, LATEST_BIT_VERSION } from '@teambit/legacy/dist/constants';\nimport { BitError } from '@teambit/bit-error';\nimport enrichContextFromGlobal from '@teambit/legacy/dist/hooks/utils/enrich-context-from-global';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport { Http } from '@teambit/legacy/dist/scope/network/http';\nimport { Remotes } from '@teambit/legacy/dist/remotes';\nimport { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';\nimport deleteComponentsFiles from '@teambit/legacy/dist/consumer/component-ops/delete-component-files';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport Component from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport RemovedObjects from '@teambit/legacy/dist/scope/removed-components';\nimport * as packageJsonUtils from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport pMapSeries from 'p-map-series';\nimport { RemovedLocalObjects } from './removed-local-objects';\n\nexport type RemoveComponentsResult = { localResult: RemovedLocalObjects; remoteResult: RemovedObjects[] };\n\n/**\n * Remove components local and remote\n * splits array of ids into local and remote and removes according to flags\n * @param {string[]} ids - list of remote component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n * @param {boolean} remote - delete component from a remote scope\n * @param {boolean} track - keep tracking local staged components in bitmap.\n * @param {boolean} deleteFiles - delete local added files from fs.\n */\nexport async function removeComponents({\n workspace,\n ids,\n force,\n remote,\n track,\n deleteFiles,\n}: {\n workspace?: Workspace; // when remote is false, it's always set\n ids: ComponentIdList;\n force: boolean;\n remote: boolean;\n track: boolean;\n deleteFiles: boolean;\n}): Promise<RemoveComponentsResult> {\n logger.debugAndAddBreadCrumb('removeComponents', `{ids}. force: ${force.toString()}`, { ids: ids.toString() });\n // added this to remove support for remove only one version from a component\n const bitIdsLatest = ComponentIdList.fromArray(\n ids.map((id) => {\n return id.changeVersion(LATEST_BIT_VERSION);\n })\n );\n const [localIds, remoteIds] = partition(bitIdsLatest, (id) => id.isLocal());\n if (remote && localIds.length) {\n throw new BitError(\n `unable to remove the remote components: ${localIds.join(',')} as they don't contain a scope-name`\n );\n }\n const remoteResult = remote && !isEmpty(remoteIds) ? await removeRemote(workspace, remoteIds, force) : [];\n const localResult = !remote\n ? await removeLocal(workspace as Workspace, bitIdsLatest, force, track, deleteFiles)\n : new RemovedLocalObjects();\n\n return { localResult, remoteResult };\n}\n\n/**\n * Remove remote component from the remote\n * this method groups remote components by remote name and deletes remote components together\n * @param {ComponentIdList} bitIds - list of remote component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n */\nasync function removeRemote(\n workspace: Workspace | undefined,\n bitIds: ComponentIdList,\n force: boolean\n): Promise<RemovedObjects[]> {\n const groupedBitsByScope = groupArray(bitIds, 'scope');\n const remotes = workspace ? await getScopeRemotes(workspace.scope.legacyScope) : await Remotes.getGlobalRemotes();\n const shouldGoToCentralHub = remotes.shouldGoToCentralHub(Object.keys(groupedBitsByScope));\n if (shouldGoToCentralHub) {\n const http = await Http.connect(CENTRAL_BIT_HUB_URL, CENTRAL_BIT_HUB_NAME);\n return http.deleteViaCentralHub(\n bitIds.map((id) => id.toString()),\n { force, idsAreLanes: false }\n );\n }\n const context = {};\n enrichContextFromGlobal(context);\n const removeP = Object.keys(groupedBitsByScope).map(async (key) => {\n const resolvedRemote = await remotes.resolve(key, workspace?.scope.legacyScope);\n const idsStr = groupedBitsByScope[key].map((id) => id.toStringWithoutVersion());\n return resolvedRemote.deleteMany(idsStr, force, context);\n });\n\n return Promise.all(removeP);\n}\n\n/**\n * removeLocal - remove local (imported, new staged components) from modules and bitmap according to flags\n * @param {ComponentIdList} bitIds - list of component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n * @param {boolean} deleteFiles - delete component that are used by other components.\n */\nasync function removeLocal(\n workspace: Workspace,\n bitIds: ComponentIdList,\n force: boolean,\n track: boolean,\n deleteFiles: boolean\n): Promise<RemovedLocalObjects> {\n const consumer = workspace.consumer;\n // local remove in case user wants to delete tagged components\n const modifiedComponents = new ComponentIdList();\n const nonModifiedComponents = new ComponentIdList();\n if (!bitIds.length) return new RemovedLocalObjects();\n if (!force) {\n const newIds: string[] = [];\n await pMapSeries(bitIds, async (id) => {\n try {\n const componentStatus = await workspace.getComponentStatusById(id);\n if (componentStatus.newlyCreated) newIds.push(id.toStringWithoutVersion());\n if (componentStatus.modified) modifiedComponents.push(id);\n else nonModifiedComponents.push(id);\n } catch (err: any) {\n // if a component has an error, such as, missing main file, we do want to allow removing that component\n if (Component.isComponentInvalidByErrorType(err)) {\n nonModifiedComponents.push(id);\n } else {\n throw err;\n }\n }\n });\n if (newIds.length) {\n const list = await workspace.listWithInvalid();\n list.components.forEach((c) => {\n if (bitIds.hasWithoutVersion(c.id)) return; // it gets deleted anyway\n const aspectIds = c.state.aspects.ids;\n const used = newIds.find((newId) => aspectIds.includes(newId));\n if (used)\n throw new BitError(`Unable to remove ${c.id.toStringWithoutVersion()}.\nThis component is 1) an aspect 2) is used by other components, such as \"${c.id.toStringWithoutVersion()}\" 3) it's a new component so it can't be installed as a package.\nRemoving this component from the workspace will disrupt the functionality of other components that depend on it, and resolving these issues may not be straightforward.\nIf you understand the risks and wish to proceed with the removal, please use the --force flag.\n`);\n });\n }\n }\n const idsToRemove = force ? bitIds : nonModifiedComponents;\n const componentsList = new ComponentsList(consumer);\n const newComponents = (await componentsList.listNewComponents(false)) as ComponentIdList;\n const idsToRemoveFromScope = ComponentIdList.fromArray(\n idsToRemove.filter((id) => !newComponents.hasWithoutVersion(id))\n );\n const idsToCleanFromWorkspace = ComponentIdList.fromArray(\n idsToRemove.filter((id) => newComponents.hasWithoutVersion(id))\n );\n const { components: componentsToRemove, invalidComponents } = await consumer.loadComponents(idsToRemove, false);\n const { removedComponentIds, missingComponents, dependentBits, removedFromLane } = await consumer.scope.removeMany(\n idsToRemoveFromScope,\n force,\n consumer\n );\n // otherwise, components should still be in .bitmap file\n idsToCleanFromWorkspace.push(...removedComponentIds);\n if (idsToCleanFromWorkspace.length) {\n if (deleteFiles) await deleteComponentsFiles(consumer, idsToCleanFromWorkspace);\n if (!track) {\n const invalidComponentsIds = invalidComponents.map((i) => i.id);\n const removedComponents = componentsToRemove.filter((c) => idsToCleanFromWorkspace.hasWithoutVersion(c.id));\n await packageJsonUtils.removeComponentsFromWorkspacesAndDependencies(\n consumer,\n removedComponents,\n invalidComponentsIds\n );\n await consumer.cleanFromBitMap(idsToCleanFromWorkspace);\n await workspace.cleanFromConfig(idsToCleanFromWorkspace);\n }\n }\n return new RemovedLocalObjects(\n ComponentIdList.uniqFromArray([...idsToCleanFromWorkspace, ...removedComponentIds]),\n missingComponents,\n modifiedComponents,\n dependentBits,\n removedFromLane\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GA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D,CAAC,CAAC9D,EAAE,CAAC,CAAC;MAC3G,MAAMtC,gBAAgB,CAAD,CAAC,CAACgI,6CAA6C,CAClE7C,QAAQ,EACR4C,iBAAiB,EACjBD,oBACF,CAAC;MACD,MAAM3C,QAAQ,CAAC8C,eAAe,CAACb,uBAAuB,CAAC;MACvD,MAAM3F,SAAS,CAACyG,eAAe,CAACd,uBAAuB,CAAC;IAC1D;EACF;EACA,OAAO,KAAI/D,0CAAmB,EAC5BlB,8BAAe,CAACgG,aAAa,CAAC,CAAC,GAAGf,uBAAuB,EAAE,GAAGI,mBAAmB,CAAC,CAAC,EACnFC,iBAAiB,EACjBrC,kBAAkB,EAClBsC,aAAa,EACbC,eACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_groupArray","data","_interopRequireDefault","require","_lodash","_componentId","_lodash2","_constants","_bitError","_enrichContextFromGlobal","_logger","_http","_remotes","_scopeRemotes","_deleteComponentFiles","_componentsList","_consumerComponent","packageJsonUtils","_interopRequireWildcard","_pMapSeries","_removedLocalObjects","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","removeComponents","workspace","ids","force","remote","track","deleteFiles","logger","debugAndAddBreadCrumb","toString","bitIdsLatest","ComponentIdList","fromArray","map","id","changeVersion","LATEST_BIT_VERSION","localIds","remoteIds","partition","isLocal","length","BitError","join","remoteResult","isEmpty","removeRemote","localResult","removeLocal","RemovedLocalObjects","bitIds","groupedBitsByScope","groupArray","remotes","getScopeRemotes","scope","legacyScope","Remotes","getGlobalRemotes","shouldGoToCentralHub","keys","http","Http","connect","CENTRAL_BIT_HUB_URL","CENTRAL_BIT_HUB_NAME","deleteViaCentralHub","idsAreLanes","context","enrichContextFromGlobal","removeP","key","resolvedRemote","resolve","idsStr","toStringWithoutVersion","deleteMany","Promise","all","consumer","modifiedComponents","nonModifiedComponents","newIds","pMapSeries","componentStatus","getComponentStatusById","newlyCreated","push","modified","err","Component","isComponentInvalidByErrorType","list","listWithInvalid","components","forEach","c","hasWithoutVersion","aspectIds","state","aspects","used","find","newId","includes","idsToRemove","componentsList","ComponentsList","newComponents","listNewComponents","idsToRemoveFromScope","filter","idsToCleanFromWorkspace","componentsToRemove","invalidComponents","loadComponents","removedComponentIds","missingComponents","dependentBits","removedFromLane","removeMany","deleteComponentsFiles","invalidComponentsIds","removedComponents","removeComponentsFromWorkspacesAndDependencies","cleanFromBitMap","cleanFromConfig","uniqFromArray"],"sources":["remove-components.ts"],"sourcesContent":["import groupArray from 'group-array';\nimport partition from 'lodash.partition';\nimport { Workspace } from '@teambit/workspace';\nimport { ComponentIdList } from '@teambit/component-id';\nimport { isEmpty } from 'lodash';\nimport { CENTRAL_BIT_HUB_NAME, CENTRAL_BIT_HUB_URL, LATEST_BIT_VERSION } from '@teambit/legacy/dist/constants';\nimport { BitError } from '@teambit/bit-error';\nimport enrichContextFromGlobal from '@teambit/legacy/dist/hooks/utils/enrich-context-from-global';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport { Http } from '@teambit/legacy/dist/scope/network/http';\nimport { Remotes } from '@teambit/legacy/dist/remotes';\nimport { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';\nimport { deleteComponentsFiles } from './delete-component-files';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport Component from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport RemovedObjects from '@teambit/legacy/dist/scope/removed-components';\nimport * as packageJsonUtils from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport pMapSeries from 'p-map-series';\nimport { RemovedLocalObjects } from './removed-local-objects';\n\nexport type RemoveComponentsResult = { localResult: RemovedLocalObjects; remoteResult: RemovedObjects[] };\n\n/**\n * Remove components local and remote\n * splits array of ids into local and remote and removes according to flags\n * @param {string[]} ids - list of remote component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n * @param {boolean} remote - delete component from a remote scope\n * @param {boolean} track - keep tracking local staged components in bitmap.\n * @param {boolean} deleteFiles - delete local added files from fs.\n */\nexport async function removeComponents({\n workspace,\n ids,\n force,\n remote,\n track,\n deleteFiles,\n}: {\n workspace?: Workspace; // when remote is false, it's always set\n ids: ComponentIdList;\n force: boolean;\n remote: boolean;\n track: boolean;\n deleteFiles: boolean;\n}): Promise<RemoveComponentsResult> {\n logger.debugAndAddBreadCrumb('removeComponents', `{ids}. force: ${force.toString()}`, { ids: ids.toString() });\n // added this to remove support for remove only one version from a component\n const bitIdsLatest = ComponentIdList.fromArray(\n ids.map((id) => {\n return id.changeVersion(LATEST_BIT_VERSION);\n })\n );\n const [localIds, remoteIds] = partition(bitIdsLatest, (id) => id.isLocal());\n if (remote && localIds.length) {\n throw new BitError(\n `unable to remove the remote components: ${localIds.join(',')} as they don't contain a scope-name`\n );\n }\n const remoteResult = remote && !isEmpty(remoteIds) ? await removeRemote(workspace, remoteIds, force) : [];\n const localResult = !remote\n ? await removeLocal(workspace as Workspace, bitIdsLatest, force, track, deleteFiles)\n : new RemovedLocalObjects();\n\n return { localResult, remoteResult };\n}\n\n/**\n * Remove remote component from the remote\n * this method groups remote components by remote name and deletes remote components together\n * @param {ComponentIdList} bitIds - list of remote component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n */\nasync function removeRemote(\n workspace: Workspace | undefined,\n bitIds: ComponentIdList,\n force: boolean\n): Promise<RemovedObjects[]> {\n const groupedBitsByScope = groupArray(bitIds, 'scope');\n const remotes = workspace ? await getScopeRemotes(workspace.scope.legacyScope) : await Remotes.getGlobalRemotes();\n const shouldGoToCentralHub = remotes.shouldGoToCentralHub(Object.keys(groupedBitsByScope));\n if (shouldGoToCentralHub) {\n const http = await Http.connect(CENTRAL_BIT_HUB_URL, CENTRAL_BIT_HUB_NAME);\n return http.deleteViaCentralHub(\n bitIds.map((id) => id.toString()),\n { force, idsAreLanes: false }\n );\n }\n const context = {};\n enrichContextFromGlobal(context);\n const removeP = Object.keys(groupedBitsByScope).map(async (key) => {\n const resolvedRemote = await remotes.resolve(key, workspace?.scope.legacyScope);\n const idsStr = groupedBitsByScope[key].map((id) => id.toStringWithoutVersion());\n return resolvedRemote.deleteMany(idsStr, force, context);\n });\n\n return Promise.all(removeP);\n}\n\n/**\n * removeLocal - remove local (imported, new staged components) from modules and bitmap according to flags\n * @param {ComponentIdList} bitIds - list of component ids to delete\n * @param {boolean} force - delete component that are used by other components.\n * @param {boolean} deleteFiles - delete component that are used by other components.\n */\nasync function removeLocal(\n workspace: Workspace,\n bitIds: ComponentIdList,\n force: boolean,\n track: boolean,\n deleteFiles: boolean\n): Promise<RemovedLocalObjects> {\n const consumer = workspace.consumer;\n // local remove in case user wants to delete tagged components\n const modifiedComponents = new ComponentIdList();\n const nonModifiedComponents = new ComponentIdList();\n if (!bitIds.length) return new RemovedLocalObjects();\n if (!force) {\n const newIds: string[] = [];\n await pMapSeries(bitIds, async (id) => {\n try {\n const componentStatus = await workspace.getComponentStatusById(id);\n if (componentStatus.newlyCreated) newIds.push(id.toStringWithoutVersion());\n if (componentStatus.modified) modifiedComponents.push(id);\n else nonModifiedComponents.push(id);\n } catch (err: any) {\n // if a component has an error, such as, missing main file, we do want to allow removing that component\n if (Component.isComponentInvalidByErrorType(err)) {\n nonModifiedComponents.push(id);\n } else {\n throw err;\n }\n }\n });\n if (newIds.length) {\n const list = await workspace.listWithInvalid();\n list.components.forEach((c) => {\n if (bitIds.hasWithoutVersion(c.id)) return; // it gets deleted anyway\n const aspectIds = c.state.aspects.ids;\n const used = newIds.find((newId) => aspectIds.includes(newId));\n if (used)\n throw new BitError(`Unable to remove ${c.id.toStringWithoutVersion()}.\nThis component is 1) an aspect 2) is used by other components, such as \"${c.id.toStringWithoutVersion()}\" 3) it's a new component so it can't be installed as a package.\nRemoving this component from the workspace will disrupt the functionality of other components that depend on it, and resolving these issues may not be straightforward.\nIf you understand the risks and wish to proceed with the removal, please use the --force flag.\n`);\n });\n }\n }\n const idsToRemove = force ? bitIds : nonModifiedComponents;\n const componentsList = new ComponentsList(consumer);\n const newComponents = (await componentsList.listNewComponents(false)) as ComponentIdList;\n const idsToRemoveFromScope = ComponentIdList.fromArray(\n idsToRemove.filter((id) => !newComponents.hasWithoutVersion(id))\n );\n const idsToCleanFromWorkspace = ComponentIdList.fromArray(\n idsToRemove.filter((id) => newComponents.hasWithoutVersion(id))\n );\n const { components: componentsToRemove, invalidComponents } = await consumer.loadComponents(idsToRemove, false);\n const { removedComponentIds, missingComponents, dependentBits, removedFromLane } = await consumer.scope.removeMany(\n idsToRemoveFromScope,\n force,\n consumer\n );\n // otherwise, components should still be in .bitmap file\n idsToCleanFromWorkspace.push(...removedComponentIds);\n if (idsToCleanFromWorkspace.length) {\n if (deleteFiles) await deleteComponentsFiles(consumer, idsToCleanFromWorkspace);\n if (!track) {\n const invalidComponentsIds = invalidComponents.map((i) => i.id);\n const removedComponents = componentsToRemove.filter((c) => idsToCleanFromWorkspace.hasWithoutVersion(c.id));\n await packageJsonUtils.removeComponentsFromWorkspacesAndDependencies(\n consumer,\n removedComponents,\n invalidComponentsIds\n );\n await consumer.cleanFromBitMap(idsToCleanFromWorkspace);\n await workspace.cleanFromConfig(idsToCleanFromWorkspace);\n }\n }\n return new RemovedLocalObjects(\n ComponentIdList.uniqFromArray([...idsToCleanFromWorkspace, ...removedComponentIds]),\n missingComponents,\n modifiedComponents,\n dependentBits,\n removedFromLane\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,YA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MAC3G,MAAMtC,gBAAgB,CAAD,CAAC,CAACgI,6CAA6C,CAClE7C,QAAQ,EACR4C,iBAAiB,EACjBD,oBACF,CAAC;MACD,MAAM3C,QAAQ,CAAC8C,eAAe,CAACb,uBAAuB,CAAC;MACvD,MAAM3F,SAAS,CAACyG,eAAe,CAACd,uBAAuB,CAAC;IAC1D;EACF;EACA,OAAO,KAAI/D,0CAAmB,EAC5BlB,8BAAe,CAACgG,aAAa,CAAC,CAAC,GAAGf,uBAAuB,EAAE,GAAGI,mBAAmB,CAAC,CAAC,EACnFC,iBAAiB,EACjBrC,kBAAkB,EAClBsC,aAAa,EACbC,eACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -74,13 +74,6 @@ function _bitError() {
|
|
|
74
74
|
};
|
|
75
75
|
return data;
|
|
76
76
|
}
|
|
77
|
-
function _deleteComponentFiles() {
|
|
78
|
-
const data = _interopRequireDefault(require("@teambit/legacy/dist/consumer/component-ops/delete-component-files"));
|
|
79
|
-
_deleteComponentFiles = function () {
|
|
80
|
-
return data;
|
|
81
|
-
};
|
|
82
|
-
return data;
|
|
83
|
-
}
|
|
84
77
|
function _dependencyResolver() {
|
|
85
78
|
const data = require("@teambit/dependency-resolver");
|
|
86
79
|
_dependencyResolver = function () {
|
|
@@ -130,6 +123,13 @@ function _packageJsonUtils() {
|
|
|
130
123
|
};
|
|
131
124
|
return data;
|
|
132
125
|
}
|
|
126
|
+
function _deleteComponentFiles() {
|
|
127
|
+
const data = require("./delete-component-files");
|
|
128
|
+
_deleteComponentFiles = function () {
|
|
129
|
+
return data;
|
|
130
|
+
};
|
|
131
|
+
return data;
|
|
132
|
+
}
|
|
133
133
|
function _removeCmd() {
|
|
134
134
|
const data = require("./remove-cmd");
|
|
135
135
|
_removeCmd = function () {
|
|
@@ -263,7 +263,7 @@ class RemoveMain {
|
|
|
263
263
|
if (range) config.range = range;
|
|
264
264
|
componentIds.forEach(compId => this.workspace.bitMap.addComponentConfig(compId, _remove().RemoveAspect.id, config));
|
|
265
265
|
await this.workspace.bitMap.write('delete');
|
|
266
|
-
await (0, _deleteComponentFiles().
|
|
266
|
+
await (0, _deleteComponentFiles().deleteComponentsFiles)(this.workspace.consumer, componentsIdsToDeleteFromFs);
|
|
267
267
|
return componentsToDeleteFromFs;
|
|
268
268
|
}
|
|
269
269
|
async deleteComps(componentsPattern, opts = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_semver","_interopRequireDefault","_logger","_workspace","_componentId","_exceptions","_importer","_lodash","_hasWildcard","_bitError","_deleteComponentFiles","_dependencyResolver","_componentIssues","_issues","_pMapSeries","_noHeadNoVersion","_component","_packageJsonUtils","_removeCmd","_removeComponents","_remove","_remove2","_recoverCmd","_deleteCmd","_scope","_lister","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","BEFORE_REMOVE","RemoveMain","constructor","workspace","scope","logger","importer","depResolver","lister","remove","componentsPattern","force","remote","track","deleteFiles","setStatusLine","bitIds","getRemoteBitIdsToRemove","getLocalBitIdsToRemove","consumer","removeResults","removeComponents","ids","ComponentIdList","fromArray","onDestroy","removeLocallyByIds","reasonForRemoval","OutsideWorkspaceError","results","bitMap","write","markRemoveComps","componentIds","updateMain","range","allComponentsToMarkDeleted","getMany","componentsToDeleteFromFs","componentsIdsToDeleteFromFs","map","c","id","removeComponentsFromNodeModules","state","_consumer","config","removed","removeOnMain","forEach","compId","addComponentConfig","RemoveAspect","deleteComponentsFiles","deleteComps","opts","ConsumerNotFound","idsByPattern","newComps","filter","hasVersion","length","BitError","toString","join","currentLane","getCurrentLaneObject","isNew","Error","recover","compIdStr","options","bitMapEntry","components","find","compMap","fullName","toStringWithoutVersion","importComp","idStr","import","installNpmPackages","skipDependencyInstallation","writeConfigFiles","skipWriteConfigFiles","override","setAsRemovedFalse","addSpecificComponentConfig","compFromScope","get","rootDir","removeComponentConfig","comp","removeInfo","getRemoveInfo","resolveComponentId","idOnLane","getComponent","compIdWithPossibleVer","changeVersion","head","isDeleted","_legacy","getRemoteComponent","err","NoHeadNoVersion","throwForMainComponentWhenOnLane","laneComps","toBitIds","mainComps","hasWithoutVersion","component","headComponent","getHeadComponent","extensions","findExtension","isDeletedByRange","currentTag","getTag","Boolean","semver","satisfies","version","hash","headTag","headComp","undefined","isRemoved","isRemovedByIdWithoutLoadingComponent","componentId","bitmapEntry","getBitmapEntryIfExist","isRecovered","modelComp","getBitObjectModelComponent","legacyScope","objects","getRemovedStaged","isOnMain","getRemovedStagedFromMain","getRemovedStagedFromLane","addRemovedDependenciesIssues","pMapSeries","addRemovedDepIssue","dependencies","getComponentDependencies","removedWithUndefined","Promise","all","dep","compact","issues","getOrCreate","IssuesClasses","RemovedDependencies","stagedConfig","getStagedConfig","getAll","compConfig","laneIds","toComponentIds","workspaceIds","listIds","laneCompIdsNotInWorkspace","wId","isEqualWithoutVersion","comps","staged","snapDistance","getSnapDistance","warn","name","isSourceAhead","hasWildcard","getRemoteCompIdsByWildcards","ComponentID","fromString","provider","cli","loggerMain","componentAspect","importerMain","createLogger","removeMain","registerAddComponentsIssues","bind","registerShowFragments","RemoveFragment","register","RemoveCmd","DeleteCmd","RecoverCmd","exports","WorkspaceAspect","ScopeAspect","CLIAspect","LoggerAspect","ComponentAspect","ImporterAspect","DependencyResolverAspect","IssuesAspect","ListerAspect","MainRuntime","addRuntime","_default"],"sources":["remove.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport semver from 'semver';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { compact } from 'lodash';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport { BitError } from '@teambit/bit-error';\nimport deleteComponentsFiles from '@teambit/legacy/dist/consumer/component-ops/delete-component-files';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport pMapSeries from 'p-map-series';\nimport { NoHeadNoVersion } from '@teambit/legacy/dist/scope/exceptions/no-head-no-version';\nimport { ComponentAspect, Component, ComponentMain } from '@teambit/component';\nimport { removeComponentsFromNodeModules } from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport { RemoveCmd } from './remove-cmd';\nimport { RemoveComponentsResult, removeComponents } from './remove-components';\nimport { RemoveAspect } from './remove.aspect';\nimport { RemoveFragment } from './remove.fragment';\nimport { RecoverCmd, RecoverOptions } from './recover-cmd';\nimport { DeleteCmd } from './delete-cmd';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { ListerAspect, ListerMain } from '@teambit/lister';\n\nconst BEFORE_REMOVE = 'removing components';\n\nexport type RemoveInfo = {\n removed: boolean;\n /**\n * whether to remove the component from default lane once merged\n */\n removeOnMain?: boolean;\n /**\n * Semver range to mark specific versions as deleted\n */\n range?: string;\n};\n\nexport type DeleteOpts = { updateMain?: boolean; range?: string };\n\nexport class RemoveMain {\n constructor(\n private workspace: Workspace,\n private scope: ScopeMain,\n public logger: Logger,\n private importer: ImporterMain,\n private depResolver: DependencyResolverMain,\n private lister: ListerMain\n ) {}\n\n async remove({\n componentsPattern,\n force = false,\n remote = false,\n track = false,\n deleteFiles = true,\n }: {\n componentsPattern: string;\n force?: boolean;\n remote?: boolean;\n track?: boolean;\n deleteFiles?: boolean;\n }): Promise<RemoveComponentsResult> {\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 workspace: this.workspace,\n ids: ComponentIdList.fromArray(bitIds),\n force,\n remote,\n track,\n deleteFiles,\n });\n if (consumer) await consumer.onDestroy('remove');\n return removeResults;\n }\n\n /**\n * remove components from the workspace.\n */\n async removeLocallyByIds(\n ids: ComponentID[],\n { force = false, reasonForRemoval }: { force?: boolean; reasonForRemoval?: string } = {}\n ) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const results = await removeComponents({\n workspace: this.workspace,\n ids: ComponentIdList.fromArray(ids),\n force,\n remote: false,\n track: false,\n deleteFiles: true,\n });\n await this.workspace.bitMap.write(`remove (by ${reasonForRemoval || 'N/A'})`);\n\n return results;\n }\n\n private async markRemoveComps(componentIds: ComponentID[], { updateMain, range }: DeleteOpts): Promise<Component[]> {\n const allComponentsToMarkDeleted = await this.workspace.getMany(componentIds);\n\n const componentsToDeleteFromFs = range ? [] : allComponentsToMarkDeleted;\n const componentsIdsToDeleteFromFs = ComponentIdList.fromArray(componentsToDeleteFromFs.map((c) => c.id));\n await removeComponentsFromNodeModules(\n this.workspace.consumer,\n componentsToDeleteFromFs.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 // in case this is range, the \"removed\" property is set to false. even when the range overlap the current version.\n // the reason is that if we set it to true, then, the component is considered as \"deleted\" for *all* versions.\n // remember that this config is always passed to the next version and if we set removed: true, it'll be copied\n // to the next version even when that version is not in the range.\n const config: RemoveInfo = { removed: !range };\n if (updateMain) config.removeOnMain = true;\n if (range) config.range = range;\n componentIds.forEach((compId) => this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, config));\n await this.workspace.bitMap.write('delete');\n await deleteComponentsFiles(this.workspace.consumer, componentsIdsToDeleteFromFs);\n\n return componentsToDeleteFromFs;\n }\n\n async deleteComps(componentsPattern: string, opts: DeleteOpts = {}): Promise<Component[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n const newComps = componentIds.filter((id) => !id.hasVersion());\n if (newComps.length) {\n throw new BitError(\n `no need to delete the following new component(s), please remove them by \"bit remove\"\\n${newComps\n .map((id) => id.toString())\n .join('\\n')}`\n );\n }\n const currentLane = await this.workspace.getCurrentLaneObject();\n const { updateMain } = opts;\n if (!updateMain && currentLane?.isNew) {\n throw new Error(\n 'no need to delete components from an un-exported lane, you can remove them by running \"bit remove\"'\n );\n }\n if (currentLane && !updateMain && opts.range) {\n throw new BitError(`--range is not needed when deleting components from a lane, unless --update-main is used`);\n }\n\n return this.markRemoveComps(componentIds, opts);\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 * 1.a. the component still exists in the local scope. no need to import. write it from there.\n * 1.b. the component doesn't exist in the local scope. import it.\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.fullName === 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 writeConfigFiles: !options.skipWriteConfigFiles,\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('recover');\n };\n if (bitMapEntry) {\n if (bitMapEntry.config?.[RemoveAspect.id]) {\n // case #1\n const compFromScope = await this.workspace.scope.get(bitMapEntry.id);\n if (compFromScope) {\n // in the case the component is in the scope, we prefer to write it from the scope rather than import it.\n // because in some cases the \"import\" throws an error, e.g. when the component is diverged.\n await this.workspace.write(compFromScope, bitMapEntry.rootDir);\n this.workspace.bitMap.removeComponentConfig(bitMapEntry.id, RemoveAspect.id, false);\n await this.workspace.bitMap.write('recover');\n } else {\n delete bitMapEntry.config?.[RemoveAspect.id];\n await importComp(bitMapEntry.id.toString());\n }\n return true;\n }\n // case #4\n const compId = bitMapEntry.id;\n const comp = await this.workspace.get(compId);\n const removeInfo = await this.getRemoveInfo(comp);\n if (!removeInfo.removed && !removeInfo.range) {\n return false;\n }\n await setAsRemovedFalse(compId);\n return true;\n }\n const compId = await this.workspace.scope.resolveComponentId(compIdStr);\n const currentLane = await this.workspace.getCurrentLaneObject();\n const idOnLane = currentLane?.getComponent(compId);\n const compIdWithPossibleVer = idOnLane ? compId.changeVersion(idOnLane.head.toString()) : compId;\n const compFromScope = await this.workspace.scope.get(compIdWithPossibleVer);\n if (compFromScope && (await this.isDeleted(compFromScope))) {\n // case #2 and #3\n await importComp(compIdWithPossibleVer._legacy.toString());\n await setAsRemovedFalse(compIdWithPossibleVer);\n return true;\n }\n // case #5\n let comp: Component | undefined;\n try {\n comp = await this.workspace.scope.getRemoteComponent(compId);\n } catch (err: any) {\n if (err instanceof NoHeadNoVersion) {\n throw new BitError(\n `unable to find the component ${compIdWithPossibleVer.toString()} in the current lane or main`\n );\n }\n throw err;\n }\n if (!(await this.isDeleted(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));\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 async getRemoveInfo(component: Component): Promise<RemoveInfo> {\n const headComponent = await this.getHeadComponent(component);\n const data = headComponent.config.extensions.findExtension(RemoveAspect.id)?.config as RemoveInfo | undefined;\n\n const isDeletedByRange = () => {\n if (!data?.range) return false;\n const currentTag = component.getTag();\n return Boolean(currentTag && semver.satisfies(currentTag.version, data.range));\n };\n\n return {\n removed: data?.removed || isDeletedByRange() || false,\n range: data?.range,\n };\n }\n\n private async getHeadComponent(component: Component): Promise<Component> {\n if (\n component.id.version &&\n component.head &&\n component.id.version !== component.head?.hash &&\n component.id.version !== component.headTag?.version.version\n ) {\n const headComp = this.workspace // if workspace exits, prefer using the workspace as it may be modified\n ? await this.workspace.get(component.id.changeVersion(undefined))\n : await this.scope.get(component.id.changeVersion(component.head.hash));\n if (!headComp) throw new Error(`unable to get the head of ${component.id.toString()}`);\n return headComp;\n }\n return component;\n }\n\n /**\n * @deprecated use `isDeleted` instead.\n */\n async isRemoved(component: Component): Promise<boolean> {\n return this.isDeleted(component);\n }\n\n /**\n * whether a component is marked as deleted.\n */\n async isDeleted(component: Component): Promise<boolean> {\n const removeInfo = await this.getRemoveInfo(component);\n return removeInfo.removed;\n }\n\n /**\n * performant version of isRemoved() in case the component object is not available and loading it is expensive.\n */\n async isRemovedByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n if (!componentId.hasVersion()) return false;\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId);\n if (bitmapEntry && bitmapEntry.isRemoved()) return true;\n if (bitmapEntry && bitmapEntry.isRecovered()) return false;\n const modelComp = await this.workspace.scope.getBitObjectModelComponent(componentId.changeVersion(undefined));\n if (!modelComp) return false;\n const isRemoved = await modelComp.isRemoved(\n this.workspace.scope.legacyScope.objects,\n componentId.version as string\n );\n return Boolean(isRemoved);\n }\n\n /**\n * get components that were soft-removed and tagged/snapped/merged but not exported yet.\n */\n async getRemovedStaged(): Promise<ComponentID[]> {\n return this.workspace.isOnMain() ? this.getRemovedStagedFromMain() : this.getRemovedStagedFromLane();\n }\n\n async addRemovedDependenciesIssues(components: Component[]) {\n await pMapSeries(components, async (component) => {\n await this.addRemovedDepIssue(component);\n });\n }\n\n private async addRemovedDepIssue(component: Component) {\n const dependencies = this.depResolver.getComponentDependencies(component);\n const removedWithUndefined = await Promise.all(\n dependencies.map(async (dep) => {\n const isRemoved = await this.isRemovedByIdWithoutLoadingComponent(dep.componentId);\n if (isRemoved) return dep.componentId;\n return undefined;\n })\n );\n const removed = compact(removedWithUndefined).map((id) => id.toString());\n if (removed.length) {\n component.state.issues.getOrCreate(IssuesClasses.RemovedDependencies).data = removed;\n }\n }\n\n private async getRemovedStagedFromMain(): 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 getRemovedStagedFromLane(): Promise<ComponentID[]> {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return [];\n const laneIds = currentLane.toComponentIds();\n const workspaceIds = this.workspace.listIds();\n const laneCompIdsNotInWorkspace = laneIds.filter(\n (id) => !workspaceIds.find((wId) => wId.isEqualWithoutVersion(id))\n );\n if (!laneCompIdsNotInWorkspace.length) return [];\n const comps = await this.workspace.scope.getMany(laneCompIdsNotInWorkspace);\n const removed = comps.filter((c) => this.isDeleted(c));\n const staged = await Promise.all(\n removed.map(async (c) => {\n const snapDistance = await this.workspace.scope.getSnapDistance(c.id, false);\n if (snapDistance.err) {\n this.logger.warn(\n `getRemovedStagedFromLane unable to get snapDistance for ${c.id.toString()} due to ${snapDistance.err.name}`\n );\n // todo: not clear what should be done here. should we consider it as removed-staged or not.\n }\n if (snapDistance.isSourceAhead()) return c.id;\n return undefined;\n })\n );\n return compact(staged);\n }\n\n private async getLocalBitIdsToRemove(componentsPattern: string): Promise<ComponentID[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n return componentIds.map((id) => id);\n }\n\n private async getRemoteBitIdsToRemove(componentsPattern: string): Promise<ComponentID[]> {\n if (hasWildcard(componentsPattern)) {\n return this.lister.getRemoteCompIdsByWildcards(componentsPattern);\n }\n return [ComponentID.fromString(componentsPattern)];\n }\n\n static slots = [];\n static dependencies = [\n WorkspaceAspect,\n ScopeAspect,\n CLIAspect,\n LoggerAspect,\n ComponentAspect,\n ImporterAspect,\n DependencyResolverAspect,\n IssuesAspect,\n ListerAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([\n workspace,\n scope,\n cli,\n loggerMain,\n componentAspect,\n importerMain,\n depResolver,\n issues,\n lister,\n ]: [\n Workspace,\n ScopeMain,\n CLIMain,\n LoggerMain,\n ComponentMain,\n ImporterMain,\n DependencyResolverMain,\n IssuesMain,\n ListerMain\n ]) {\n const logger = loggerMain.createLogger(RemoveAspect.id);\n const removeMain = new RemoveMain(workspace, scope, logger, importerMain, depResolver, lister);\n issues.registerAddComponentsIssues(removeMain.addRemovedDependenciesIssues.bind(removeMain));\n componentAspect.registerShowFragments([new RemoveFragment(removeMain)]);\n cli.register(\n new RemoveCmd(removeMain, workspace),\n new DeleteCmd(removeMain, workspace),\n new RecoverCmd(removeMain)\n );\n return removeMain;\n }\n}\n\nRemoveAspect.addRuntime(RemoveMain);\n\nexport default RemoveMain;\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,Q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nB,eAAA,CA9VNmB,UAAU,kBA+VC,CACpBgM,4BAAe,EACfC,oBAAW,EACXC,gBAAS,EACTC,sBAAY,EACZC,4BAAe,EACfC,0BAAc,EACdC,8CAAwB,EACxBC,sBAAY,EACZC,sBAAY,CACb;AAAA3N,eAAA,CAzWUmB,UAAU,aA0WJyM,kBAAW;AAoC9BtJ,sBAAY,CAACuJ,UAAU,CAAC1M,UAAU,CAAC;AAAC,IAAA2M,QAAA,GAAAZ,OAAA,CAAAnN,OAAA,GAErBoB,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_semver","_interopRequireDefault","_logger","_workspace","_componentId","_exceptions","_importer","_lodash","_hasWildcard","_bitError","_dependencyResolver","_componentIssues","_issues","_pMapSeries","_noHeadNoVersion","_component","_packageJsonUtils","_deleteComponentFiles","_removeCmd","_removeComponents","_remove","_remove2","_recoverCmd","_deleteCmd","_scope","_lister","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","BEFORE_REMOVE","RemoveMain","constructor","workspace","scope","logger","importer","depResolver","lister","remove","componentsPattern","force","remote","track","deleteFiles","setStatusLine","bitIds","getRemoteBitIdsToRemove","getLocalBitIdsToRemove","consumer","removeResults","removeComponents","ids","ComponentIdList","fromArray","onDestroy","removeLocallyByIds","reasonForRemoval","OutsideWorkspaceError","results","bitMap","write","markRemoveComps","componentIds","updateMain","range","allComponentsToMarkDeleted","getMany","componentsToDeleteFromFs","componentsIdsToDeleteFromFs","map","c","id","removeComponentsFromNodeModules","state","_consumer","config","removed","removeOnMain","forEach","compId","addComponentConfig","RemoveAspect","deleteComponentsFiles","deleteComps","opts","ConsumerNotFound","idsByPattern","newComps","filter","hasVersion","length","BitError","toString","join","currentLane","getCurrentLaneObject","isNew","Error","recover","compIdStr","options","bitMapEntry","components","find","compMap","fullName","toStringWithoutVersion","importComp","idStr","import","installNpmPackages","skipDependencyInstallation","writeConfigFiles","skipWriteConfigFiles","override","setAsRemovedFalse","addSpecificComponentConfig","compFromScope","get","rootDir","removeComponentConfig","comp","removeInfo","getRemoveInfo","resolveComponentId","idOnLane","getComponent","compIdWithPossibleVer","changeVersion","head","isDeleted","_legacy","getRemoteComponent","err","NoHeadNoVersion","throwForMainComponentWhenOnLane","laneComps","toBitIds","mainComps","hasWithoutVersion","component","headComponent","getHeadComponent","extensions","findExtension","isDeletedByRange","currentTag","getTag","Boolean","semver","satisfies","version","hash","headTag","headComp","undefined","isRemoved","isRemovedByIdWithoutLoadingComponent","componentId","bitmapEntry","getBitmapEntryIfExist","isRecovered","modelComp","getBitObjectModelComponent","legacyScope","objects","getRemovedStaged","isOnMain","getRemovedStagedFromMain","getRemovedStagedFromLane","addRemovedDependenciesIssues","pMapSeries","addRemovedDepIssue","dependencies","getComponentDependencies","removedWithUndefined","Promise","all","dep","compact","issues","getOrCreate","IssuesClasses","RemovedDependencies","stagedConfig","getStagedConfig","getAll","compConfig","laneIds","toComponentIds","workspaceIds","listIds","laneCompIdsNotInWorkspace","wId","isEqualWithoutVersion","comps","staged","snapDistance","getSnapDistance","warn","name","isSourceAhead","hasWildcard","getRemoteCompIdsByWildcards","ComponentID","fromString","provider","cli","loggerMain","componentAspect","importerMain","createLogger","removeMain","registerAddComponentsIssues","bind","registerShowFragments","RemoveFragment","register","RemoveCmd","DeleteCmd","RecoverCmd","exports","WorkspaceAspect","ScopeAspect","CLIAspect","LoggerAspect","ComponentAspect","ImporterAspect","DependencyResolverAspect","IssuesAspect","ListerAspect","MainRuntime","addRuntime","_default"],"sources":["remove.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport semver from 'semver';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { compact } from 'lodash';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport { BitError } from '@teambit/bit-error';\nimport { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { IssuesClasses } from '@teambit/component-issues';\nimport { IssuesAspect, IssuesMain } from '@teambit/issues';\nimport pMapSeries from 'p-map-series';\nimport { NoHeadNoVersion } from '@teambit/legacy/dist/scope/exceptions/no-head-no-version';\nimport { ComponentAspect, Component, ComponentMain } from '@teambit/component';\nimport { removeComponentsFromNodeModules } from '@teambit/legacy/dist/consumer/component/package-json-utils';\nimport { deleteComponentsFiles } from './delete-component-files';\nimport { RemoveCmd } from './remove-cmd';\nimport { RemoveComponentsResult, removeComponents } from './remove-components';\nimport { RemoveAspect } from './remove.aspect';\nimport { RemoveFragment } from './remove.fragment';\nimport { RecoverCmd, RecoverOptions } from './recover-cmd';\nimport { DeleteCmd } from './delete-cmd';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { ListerAspect, ListerMain } from '@teambit/lister';\n\nconst BEFORE_REMOVE = 'removing components';\n\nexport type RemoveInfo = {\n removed: boolean;\n /**\n * whether to remove the component from default lane once merged\n */\n removeOnMain?: boolean;\n /**\n * Semver range to mark specific versions as deleted\n */\n range?: string;\n};\n\nexport type DeleteOpts = { updateMain?: boolean; range?: string };\n\nexport class RemoveMain {\n constructor(\n private workspace: Workspace,\n private scope: ScopeMain,\n public logger: Logger,\n private importer: ImporterMain,\n private depResolver: DependencyResolverMain,\n private lister: ListerMain\n ) {}\n\n async remove({\n componentsPattern,\n force = false,\n remote = false,\n track = false,\n deleteFiles = true,\n }: {\n componentsPattern: string;\n force?: boolean;\n remote?: boolean;\n track?: boolean;\n deleteFiles?: boolean;\n }): Promise<RemoveComponentsResult> {\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 workspace: this.workspace,\n ids: ComponentIdList.fromArray(bitIds),\n force,\n remote,\n track,\n deleteFiles,\n });\n if (consumer) await consumer.onDestroy('remove');\n return removeResults;\n }\n\n /**\n * remove components from the workspace.\n */\n async removeLocallyByIds(\n ids: ComponentID[],\n { force = false, reasonForRemoval }: { force?: boolean; reasonForRemoval?: string } = {}\n ) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const results = await removeComponents({\n workspace: this.workspace,\n ids: ComponentIdList.fromArray(ids),\n force,\n remote: false,\n track: false,\n deleteFiles: true,\n });\n await this.workspace.bitMap.write(`remove (by ${reasonForRemoval || 'N/A'})`);\n\n return results;\n }\n\n private async markRemoveComps(componentIds: ComponentID[], { updateMain, range }: DeleteOpts): Promise<Component[]> {\n const allComponentsToMarkDeleted = await this.workspace.getMany(componentIds);\n\n const componentsToDeleteFromFs = range ? [] : allComponentsToMarkDeleted;\n const componentsIdsToDeleteFromFs = ComponentIdList.fromArray(componentsToDeleteFromFs.map((c) => c.id));\n await removeComponentsFromNodeModules(\n this.workspace.consumer,\n componentsToDeleteFromFs.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 // in case this is range, the \"removed\" property is set to false. even when the range overlap the current version.\n // the reason is that if we set it to true, then, the component is considered as \"deleted\" for *all* versions.\n // remember that this config is always passed to the next version and if we set removed: true, it'll be copied\n // to the next version even when that version is not in the range.\n const config: RemoveInfo = { removed: !range };\n if (updateMain) config.removeOnMain = true;\n if (range) config.range = range;\n componentIds.forEach((compId) => this.workspace.bitMap.addComponentConfig(compId, RemoveAspect.id, config));\n await this.workspace.bitMap.write('delete');\n await deleteComponentsFiles(this.workspace.consumer, componentsIdsToDeleteFromFs);\n\n return componentsToDeleteFromFs;\n }\n\n async deleteComps(componentsPattern: string, opts: DeleteOpts = {}): Promise<Component[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n const newComps = componentIds.filter((id) => !id.hasVersion());\n if (newComps.length) {\n throw new BitError(\n `no need to delete the following new component(s), please remove them by \"bit remove\"\\n${newComps\n .map((id) => id.toString())\n .join('\\n')}`\n );\n }\n const currentLane = await this.workspace.getCurrentLaneObject();\n const { updateMain } = opts;\n if (!updateMain && currentLane?.isNew) {\n throw new Error(\n 'no need to delete components from an un-exported lane, you can remove them by running \"bit remove\"'\n );\n }\n if (currentLane && !updateMain && opts.range) {\n throw new BitError(`--range is not needed when deleting components from a lane, unless --update-main is used`);\n }\n\n return this.markRemoveComps(componentIds, opts);\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 * 1.a. the component still exists in the local scope. no need to import. write it from there.\n * 1.b. the component doesn't exist in the local scope. import it.\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.fullName === 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 writeConfigFiles: !options.skipWriteConfigFiles,\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('recover');\n };\n if (bitMapEntry) {\n if (bitMapEntry.config?.[RemoveAspect.id]) {\n // case #1\n const compFromScope = await this.workspace.scope.get(bitMapEntry.id);\n if (compFromScope) {\n // in the case the component is in the scope, we prefer to write it from the scope rather than import it.\n // because in some cases the \"import\" throws an error, e.g. when the component is diverged.\n await this.workspace.write(compFromScope, bitMapEntry.rootDir);\n this.workspace.bitMap.removeComponentConfig(bitMapEntry.id, RemoveAspect.id, false);\n await this.workspace.bitMap.write('recover');\n } else {\n delete bitMapEntry.config?.[RemoveAspect.id];\n await importComp(bitMapEntry.id.toString());\n }\n return true;\n }\n // case #4\n const compId = bitMapEntry.id;\n const comp = await this.workspace.get(compId);\n const removeInfo = await this.getRemoveInfo(comp);\n if (!removeInfo.removed && !removeInfo.range) {\n return false;\n }\n await setAsRemovedFalse(compId);\n return true;\n }\n const compId = await this.workspace.scope.resolveComponentId(compIdStr);\n const currentLane = await this.workspace.getCurrentLaneObject();\n const idOnLane = currentLane?.getComponent(compId);\n const compIdWithPossibleVer = idOnLane ? compId.changeVersion(idOnLane.head.toString()) : compId;\n const compFromScope = await this.workspace.scope.get(compIdWithPossibleVer);\n if (compFromScope && (await this.isDeleted(compFromScope))) {\n // case #2 and #3\n await importComp(compIdWithPossibleVer._legacy.toString());\n await setAsRemovedFalse(compIdWithPossibleVer);\n return true;\n }\n // case #5\n let comp: Component | undefined;\n try {\n comp = await this.workspace.scope.getRemoteComponent(compId);\n } catch (err: any) {\n if (err instanceof NoHeadNoVersion) {\n throw new BitError(\n `unable to find the component ${compIdWithPossibleVer.toString()} in the current lane or main`\n );\n }\n throw err;\n }\n if (!(await this.isDeleted(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));\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 async getRemoveInfo(component: Component): Promise<RemoveInfo> {\n const headComponent = await this.getHeadComponent(component);\n const data = headComponent.config.extensions.findExtension(RemoveAspect.id)?.config as RemoveInfo | undefined;\n\n const isDeletedByRange = () => {\n if (!data?.range) return false;\n const currentTag = component.getTag();\n return Boolean(currentTag && semver.satisfies(currentTag.version, data.range));\n };\n\n return {\n removed: data?.removed || isDeletedByRange() || false,\n range: data?.range,\n };\n }\n\n private async getHeadComponent(component: Component): Promise<Component> {\n if (\n component.id.version &&\n component.head &&\n component.id.version !== component.head?.hash &&\n component.id.version !== component.headTag?.version.version\n ) {\n const headComp = this.workspace // if workspace exits, prefer using the workspace as it may be modified\n ? await this.workspace.get(component.id.changeVersion(undefined))\n : await this.scope.get(component.id.changeVersion(component.head.hash));\n if (!headComp) throw new Error(`unable to get the head of ${component.id.toString()}`);\n return headComp;\n }\n return component;\n }\n\n /**\n * @deprecated use `isDeleted` instead.\n */\n async isRemoved(component: Component): Promise<boolean> {\n return this.isDeleted(component);\n }\n\n /**\n * whether a component is marked as deleted.\n */\n async isDeleted(component: Component): Promise<boolean> {\n const removeInfo = await this.getRemoveInfo(component);\n return removeInfo.removed;\n }\n\n /**\n * performant version of isRemoved() in case the component object is not available and loading it is expensive.\n */\n async isRemovedByIdWithoutLoadingComponent(componentId: ComponentID): Promise<boolean> {\n if (!componentId.hasVersion()) return false;\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(componentId);\n if (bitmapEntry && bitmapEntry.isRemoved()) return true;\n if (bitmapEntry && bitmapEntry.isRecovered()) return false;\n const modelComp = await this.workspace.scope.getBitObjectModelComponent(componentId.changeVersion(undefined));\n if (!modelComp) return false;\n const isRemoved = await modelComp.isRemoved(\n this.workspace.scope.legacyScope.objects,\n componentId.version as string\n );\n return Boolean(isRemoved);\n }\n\n /**\n * get components that were soft-removed and tagged/snapped/merged but not exported yet.\n */\n async getRemovedStaged(): Promise<ComponentID[]> {\n return this.workspace.isOnMain() ? this.getRemovedStagedFromMain() : this.getRemovedStagedFromLane();\n }\n\n async addRemovedDependenciesIssues(components: Component[]) {\n await pMapSeries(components, async (component) => {\n await this.addRemovedDepIssue(component);\n });\n }\n\n private async addRemovedDepIssue(component: Component) {\n const dependencies = this.depResolver.getComponentDependencies(component);\n const removedWithUndefined = await Promise.all(\n dependencies.map(async (dep) => {\n const isRemoved = await this.isRemovedByIdWithoutLoadingComponent(dep.componentId);\n if (isRemoved) return dep.componentId;\n return undefined;\n })\n );\n const removed = compact(removedWithUndefined).map((id) => id.toString());\n if (removed.length) {\n component.state.issues.getOrCreate(IssuesClasses.RemovedDependencies).data = removed;\n }\n }\n\n private async getRemovedStagedFromMain(): 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 getRemovedStagedFromLane(): Promise<ComponentID[]> {\n const currentLane = await this.workspace.getCurrentLaneObject();\n if (!currentLane) return [];\n const laneIds = currentLane.toComponentIds();\n const workspaceIds = this.workspace.listIds();\n const laneCompIdsNotInWorkspace = laneIds.filter(\n (id) => !workspaceIds.find((wId) => wId.isEqualWithoutVersion(id))\n );\n if (!laneCompIdsNotInWorkspace.length) return [];\n const comps = await this.workspace.scope.getMany(laneCompIdsNotInWorkspace);\n const removed = comps.filter((c) => this.isDeleted(c));\n const staged = await Promise.all(\n removed.map(async (c) => {\n const snapDistance = await this.workspace.scope.getSnapDistance(c.id, false);\n if (snapDistance.err) {\n this.logger.warn(\n `getRemovedStagedFromLane unable to get snapDistance for ${c.id.toString()} due to ${snapDistance.err.name}`\n );\n // todo: not clear what should be done here. should we consider it as removed-staged or not.\n }\n if (snapDistance.isSourceAhead()) return c.id;\n return undefined;\n })\n );\n return compact(staged);\n }\n\n private async getLocalBitIdsToRemove(componentsPattern: string): Promise<ComponentID[]> {\n if (!this.workspace) throw new ConsumerNotFound();\n const componentIds = await this.workspace.idsByPattern(componentsPattern);\n return componentIds.map((id) => id);\n }\n\n private async getRemoteBitIdsToRemove(componentsPattern: string): Promise<ComponentID[]> {\n if (hasWildcard(componentsPattern)) {\n return this.lister.getRemoteCompIdsByWildcards(componentsPattern);\n }\n return [ComponentID.fromString(componentsPattern)];\n }\n\n static slots = [];\n static dependencies = [\n WorkspaceAspect,\n ScopeAspect,\n CLIAspect,\n LoggerAspect,\n ComponentAspect,\n ImporterAspect,\n DependencyResolverAspect,\n IssuesAspect,\n ListerAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([\n workspace,\n scope,\n cli,\n loggerMain,\n componentAspect,\n importerMain,\n depResolver,\n issues,\n lister,\n ]: [\n Workspace,\n ScopeMain,\n CLIMain,\n LoggerMain,\n ComponentMain,\n ImporterMain,\n DependencyResolverMain,\n IssuesMain,\n ListerMain\n ]) {\n const logger = loggerMain.createLogger(RemoveAspect.id);\n const removeMain = new RemoveMain(workspace, scope, logger, importerMain, depResolver, lister);\n issues.registerAddComponentsIssues(removeMain.addRemovedDependenciesIssues.bind(removeMain));\n componentAspect.registerShowFragments([new RemoveFragment(removeMain)]);\n cli.register(\n new RemoveCmd(removeMain, workspace),\n new DeleteCmd(removeMain, workspace),\n new RecoverCmd(removeMain)\n );\n return removeMain;\n }\n}\n\nRemoveAspect.addRuntime(RemoveMain);\n\nexport default RemoveMain;\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CA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AAA;AAAAnB,eAAA,CA5YYmB,UAAU,WA8VN,EAAE;AAAAnB,eAAA,CA9VNmB,UAAU,kBA+VC,CACpBgM,4BAAe,EACfC,oBAAW,EACXC,gBAAS,EACTC,sBAAY,EACZC,4BAAe,EACfC,0BAAc,EACdC,8CAAwB,EACxBC,sBAAY,EACZC,sBAAY,CACb;AAAA3N,eAAA,CAzWUmB,UAAU,aA0WJyM,kBAAW;AAoC9BtJ,sBAAY,CAACuJ,UAAU,CAAC1M,UAAU,CAAC;AAAC,IAAA2M,QAAA,GAAAZ,OAAA,CAAAnN,OAAA,GAErBoB,UAAU","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/remove",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.323",
|
|
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.323"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
"@teambit/bit-error": "0.0.404",
|
|
20
20
|
"@teambit/component-id": "1.2.0",
|
|
21
21
|
"@teambit/harmony": "0.4.6",
|
|
22
|
-
"@teambit/cli": "0.0.
|
|
23
|
-
"@teambit/workspace": "1.0.
|
|
24
|
-
"@teambit/component": "1.0.
|
|
22
|
+
"@teambit/cli": "0.0.900",
|
|
23
|
+
"@teambit/workspace": "1.0.323",
|
|
24
|
+
"@teambit/component": "1.0.323",
|
|
25
25
|
"@teambit/component-issues": "0.0.149",
|
|
26
|
-
"@teambit/dependency-resolver": "1.0.
|
|
27
|
-
"@teambit/importer": "1.0.
|
|
28
|
-
"@teambit/issues": "1.0.
|
|
29
|
-
"@teambit/lister": "1.0.
|
|
30
|
-
"@teambit/logger": "0.0.
|
|
31
|
-
"@teambit/scope": "1.0.
|
|
26
|
+
"@teambit/dependency-resolver": "1.0.323",
|
|
27
|
+
"@teambit/importer": "1.0.323",
|
|
28
|
+
"@teambit/issues": "1.0.323",
|
|
29
|
+
"@teambit/lister": "1.0.323",
|
|
30
|
+
"@teambit/logger": "0.0.993",
|
|
31
|
+
"@teambit/scope": "1.0.323"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/lodash": "4.14.165",
|
|
File without changes
|