@teambit/merge-lanes 0.0.57 → 0.0.59
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/index.js +0 -5
- package/dist/index.js.map +1 -1
- package/dist/merge-lane-from-scope.cmd.js +2 -24
- package/dist/merge-lane-from-scope.cmd.js.map +1 -1
- package/dist/merge-lane.cmd.js +0 -36
- package/dist/merge-lane.cmd.js.map +1 -1
- package/dist/merge-lanes.aspect.js +0 -5
- package/dist/merge-lanes.aspect.js.map +1 -1
- package/dist/merge-lanes.main.runtime.js +13 -156
- package/dist/merge-lanes.main.runtime.js.map +1 -1
- package/package-tar/teambit-merge-lanes-0.0.59.tgz +0 -0
- package/package.json +12 -12
- /package/{preview-1666312873430.js → preview-1666496165706.js} +0 -0
- package/package-tar/teambit-merge-lanes-0.0.57.tgz +0 -0
package/dist/index.js
CHANGED
@@ -10,19 +10,14 @@ Object.defineProperty(exports, "MergeLanesAspect", {
|
|
10
10
|
}
|
11
11
|
});
|
12
12
|
exports.default = void 0;
|
13
|
-
|
14
13
|
function _mergeLanes() {
|
15
14
|
const data = require("./merge-lanes.aspect");
|
16
|
-
|
17
15
|
_mergeLanes = function () {
|
18
16
|
return data;
|
19
17
|
};
|
20
|
-
|
21
18
|
return data;
|
22
19
|
}
|
23
|
-
|
24
20
|
var _default = _mergeLanes().MergeLanesAspect;
|
25
|
-
|
26
21
|
exports.default = _default;
|
27
22
|
|
28
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["MergeLanesAspect"],"sources":["index.ts"],"sourcesContent":["import { MergeLanesAspect } from './merge-lanes.aspect';\n\nexport type { MergeLanesMain } from './merge-lanes.main.runtime';\nexport default MergeLanesAspect;\nexport { MergeLanesAspect };\n"],"mappings":"
|
1
|
+
{"version":3,"names":["MergeLanesAspect"],"sources":["index.ts"],"sourcesContent":["import { MergeLanesAspect } from './merge-lanes.aspect';\n\nexport type { MergeLanesMain } from './merge-lanes.main.runtime';\nexport default MergeLanesAspect;\nexport { MergeLanesAspect };\n"],"mappings":";;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAwD,eAGzCA,8BAAgB;AAAA"}
|
@@ -1,46 +1,33 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
4
|
require("core-js/modules/es.array.iterator.js");
|
6
|
-
|
7
5
|
require("core-js/modules/es.promise.js");
|
8
|
-
|
9
6
|
Object.defineProperty(exports, "__esModule", {
|
10
7
|
value: true
|
11
8
|
});
|
12
9
|
exports.MergeLaneFromScopeCmd = void 0;
|
13
|
-
|
14
10
|
function _defineProperty2() {
|
15
11
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
16
|
-
|
17
12
|
_defineProperty2 = function () {
|
18
13
|
return data;
|
19
14
|
};
|
20
|
-
|
21
15
|
return data;
|
22
16
|
}
|
23
|
-
|
24
17
|
function _chalk() {
|
25
18
|
const data = _interopRequireDefault(require("chalk"));
|
26
|
-
|
27
19
|
_chalk = function () {
|
28
20
|
return data;
|
29
21
|
};
|
30
|
-
|
31
22
|
return data;
|
32
23
|
}
|
33
|
-
|
34
24
|
function _bitError() {
|
35
25
|
const data = require("@teambit/bit-error");
|
36
|
-
|
37
26
|
_bitError = function () {
|
38
27
|
return data;
|
39
28
|
};
|
40
|
-
|
41
29
|
return data;
|
42
30
|
}
|
43
|
-
|
44
31
|
/**
|
45
32
|
* private command. the underscore prefix is intended.
|
46
33
|
*/
|
@@ -60,14 +47,14 @@ the lane must be up-to-date with main, otherwise, conflicts might occur which ar
|
|
60
47
|
description: 'EXPERIMENTAL. partially merge the lane with the specified component-pattern'
|
61
48
|
}]);
|
62
49
|
(0, _defineProperty2().default)(this, "alias", '');
|
63
|
-
(0, _defineProperty2().default)(this, "options", [['', 'push', 'export the updated objects to the original scopes once done'], ['', 'keep-readme', 'skip deleting the lane readme component after merging'], ['', 'no-squash', 'EXPERIMENTAL. relevant for merging lanes into main, which by default squash.'],
|
50
|
+
(0, _defineProperty2().default)(this, "options", [['', 'push', 'export the updated objects to the original scopes once done'], ['', 'keep-readme', 'skip deleting the lane readme component after merging'], ['', 'no-squash', 'EXPERIMENTAL. relevant for merging lanes into main, which by default squash.'],
|
51
|
+
// ['', 'verbose', 'show details of components that were not merged legitimately'],
|
64
52
|
['', 'include-deps', 'EXPERIMENTAL. relevant for "--pattern". merge also dependencies of the given components']]);
|
65
53
|
(0, _defineProperty2().default)(this, "loader", true);
|
66
54
|
(0, _defineProperty2().default)(this, "private", true);
|
67
55
|
(0, _defineProperty2().default)(this, "migration", true);
|
68
56
|
(0, _defineProperty2().default)(this, "remoteOp", true);
|
69
57
|
}
|
70
|
-
|
71
58
|
async report([name, pattern], {
|
72
59
|
push = false,
|
73
60
|
keepReadme = false,
|
@@ -77,7 +64,6 @@ the lane must be up-to-date with main, otherwise, conflicts might occur which ar
|
|
77
64
|
if (includeDeps && !pattern) {
|
78
65
|
throw new (_bitError().BitError)(`"--include-deps" flag is relevant only for --pattern flag`);
|
79
66
|
}
|
80
|
-
|
81
67
|
const {
|
82
68
|
mergedNow,
|
83
69
|
mergedPreviously,
|
@@ -89,23 +75,15 @@ the lane must be up-to-date with main, otherwise, conflicts might occur which ar
|
|
89
75
|
pattern,
|
90
76
|
includeDeps
|
91
77
|
});
|
92
|
-
|
93
78
|
const mergedTitle = _chalk().default.green(`successfully merged ${mergedNow.length} components from ${name} to main`);
|
94
|
-
|
95
79
|
const mergedOutput = mergedNow.length ? `${mergedTitle}\n${mergedNow.join('\n')}` : '';
|
96
|
-
|
97
80
|
const nonMergedTitle = _chalk().default.bold(`the following ${mergedPreviously.length} components were already merged before, they were left intact`);
|
98
|
-
|
99
81
|
const nonMergedOutput = mergedPreviously.length ? `\n${nonMergedTitle}\n${mergedPreviously.join('\n')}` : '';
|
100
|
-
|
101
82
|
const exportedTitle = _chalk().default.green(`successfully exported ${exportedIds.length} components`);
|
102
|
-
|
103
83
|
const exportedOutput = exportedIds.length ? `\n${exportedTitle}\n${exportedIds.join('\n')}` : '';
|
104
84
|
return mergedOutput + nonMergedOutput + exportedOutput;
|
105
85
|
}
|
106
|
-
|
107
86
|
}
|
108
|
-
|
109
87
|
exports.MergeLaneFromScopeCmd = MergeLaneFromScopeCmd;
|
110
88
|
|
111
89
|
//# sourceMappingURL=merge-lane-from-scope.cmd.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["MergeLaneFromScopeCmd","constructor","mergeLanes","name","description","report","pattern","push","keepReadme","noSquash","includeDeps","BitError","mergedNow","mergedPreviously","exportedIds","mergeFromScope","mergedTitle","chalk","green","length","mergedOutput","join","nonMergedTitle","bold","nonMergedOutput","exportedTitle","exportedOutput"],"sources":["merge-lane-from-scope.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { BitError } from '@teambit/bit-error';\nimport { MergeLanesMain } from './merge-lanes.main.runtime';\n\n/**\n * private command. the underscore prefix is intended.\n */\nexport class MergeLaneFromScopeCmd implements Command {\n name = '_merge-lane <lane> [pattern]';\n description = `merge a remote lane into main via a bare-scope (not workspace)`;\n extendedDescription = `to merge from a workspace, use \"bit lane merge\" command.\nthis is intended to use from the UI, which will have a button to merge an existing lane into main.\nthe lane must be up-to-date with main, otherwise, conflicts might occur which are not handled in this command`;\n arguments = [\n {\n name: 'lane',\n description: 'lane-id to merge to main',\n },\n {\n name: 'pattern',\n description: 'EXPERIMENTAL. partially merge the lane with the specified component-pattern',\n },\n ];\n alias = '';\n options = [\n ['', 'push', 'export the updated objects to the original scopes once done'],\n ['', 'keep-readme', 'skip deleting the lane readme component after merging'],\n ['', 'no-squash', 'EXPERIMENTAL. relevant for merging lanes into main, which by default squash.'],\n // ['', 'verbose', 'show details of components that were not merged legitimately'],\n ['', 'include-deps', 'EXPERIMENTAL. relevant for \"--pattern\". merge also dependencies of the given components'],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n remoteOp = true;\n\n constructor(private mergeLanes: MergeLanesMain) {}\n\n async report(\n [name, pattern]: [string, string],\n {\n push = false,\n keepReadme = false,\n noSquash = false,\n includeDeps = false,\n }: // verbose = false,\n {\n push?: boolean;\n keepReadme?: boolean;\n noSquash: boolean;\n includeDeps?: boolean;\n // verbose?: boolean;\n }\n ): Promise<string> {\n if (includeDeps && !pattern) {\n throw new BitError(`\"--include-deps\" flag is relevant only for --pattern flag`);\n }\n const { mergedNow, mergedPreviously, exportedIds } = await this.mergeLanes.mergeFromScope(name, {\n push,\n keepReadme,\n noSquash,\n pattern,\n includeDeps,\n });\n\n const mergedTitle = chalk.green(`successfully merged ${mergedNow.length} components from ${name} to main`);\n const mergedOutput = mergedNow.length ? `${mergedTitle}\\n${mergedNow.join('\\n')}` : '';\n\n const nonMergedTitle = chalk.bold(\n `the following ${mergedPreviously.length} components were already merged before, they were left intact`\n );\n const nonMergedOutput = mergedPreviously.length ? `\\n${nonMergedTitle}\\n${mergedPreviously.join('\\n')}` : '';\n\n const exportedTitle = chalk.green(`successfully exported ${exportedIds.length} components`);\n const exportedOutput = exportedIds.length ? `\\n${exportedTitle}\\n${exportedIds.join('\\n')}` : '';\n\n return mergedOutput + nonMergedOutput + exportedOutput;\n }\n}\n"],"mappings":"
|
1
|
+
{"version":3,"names":["MergeLaneFromScopeCmd","constructor","mergeLanes","name","description","report","pattern","push","keepReadme","noSquash","includeDeps","BitError","mergedNow","mergedPreviously","exportedIds","mergeFromScope","mergedTitle","chalk","green","length","mergedOutput","join","nonMergedTitle","bold","nonMergedOutput","exportedTitle","exportedOutput"],"sources":["merge-lane-from-scope.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { BitError } from '@teambit/bit-error';\nimport { MergeLanesMain } from './merge-lanes.main.runtime';\n\n/**\n * private command. the underscore prefix is intended.\n */\nexport class MergeLaneFromScopeCmd implements Command {\n name = '_merge-lane <lane> [pattern]';\n description = `merge a remote lane into main via a bare-scope (not workspace)`;\n extendedDescription = `to merge from a workspace, use \"bit lane merge\" command.\nthis is intended to use from the UI, which will have a button to merge an existing lane into main.\nthe lane must be up-to-date with main, otherwise, conflicts might occur which are not handled in this command`;\n arguments = [\n {\n name: 'lane',\n description: 'lane-id to merge to main',\n },\n {\n name: 'pattern',\n description: 'EXPERIMENTAL. partially merge the lane with the specified component-pattern',\n },\n ];\n alias = '';\n options = [\n ['', 'push', 'export the updated objects to the original scopes once done'],\n ['', 'keep-readme', 'skip deleting the lane readme component after merging'],\n ['', 'no-squash', 'EXPERIMENTAL. relevant for merging lanes into main, which by default squash.'],\n // ['', 'verbose', 'show details of components that were not merged legitimately'],\n ['', 'include-deps', 'EXPERIMENTAL. relevant for \"--pattern\". merge also dependencies of the given components'],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n remoteOp = true;\n\n constructor(private mergeLanes: MergeLanesMain) {}\n\n async report(\n [name, pattern]: [string, string],\n {\n push = false,\n keepReadme = false,\n noSquash = false,\n includeDeps = false,\n }: // verbose = false,\n {\n push?: boolean;\n keepReadme?: boolean;\n noSquash: boolean;\n includeDeps?: boolean;\n // verbose?: boolean;\n }\n ): Promise<string> {\n if (includeDeps && !pattern) {\n throw new BitError(`\"--include-deps\" flag is relevant only for --pattern flag`);\n }\n const { mergedNow, mergedPreviously, exportedIds } = await this.mergeLanes.mergeFromScope(name, {\n push,\n keepReadme,\n noSquash,\n pattern,\n includeDeps,\n });\n\n const mergedTitle = chalk.green(`successfully merged ${mergedNow.length} components from ${name} to main`);\n const mergedOutput = mergedNow.length ? `${mergedTitle}\\n${mergedNow.join('\\n')}` : '';\n\n const nonMergedTitle = chalk.bold(\n `the following ${mergedPreviously.length} components were already merged before, they were left intact`\n );\n const nonMergedOutput = mergedPreviously.length ? `\\n${nonMergedTitle}\\n${mergedPreviously.join('\\n')}` : '';\n\n const exportedTitle = chalk.green(`successfully exported ${exportedIds.length} components`);\n const exportedOutput = exportedIds.length ? `\\n${exportedTitle}\\n${exportedIds.join('\\n')}` : '';\n\n return mergedOutput + nonMergedOutput + exportedOutput;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;AACA;AACA;AACO,MAAMA,qBAAqB,CAAoB;EA6BpDC,WAAW,CAASC,UAA0B,EAAE;IAAA,KAA5BA,UAA0B,GAA1BA,UAA0B;IAAA,8CA5BvC,8BAA8B;IAAA,qDACtB,gEAA+D;IAAA,6DACvD;AACzB;AACA,8GAA8G;IAAA,mDAChG,CACV;MACEC,IAAI,EAAE,MAAM;MACZC,WAAW,EAAE;IACf,CAAC,EACD;MACED,IAAI,EAAE,SAAS;MACfC,WAAW,EAAE;IACf,CAAC,CACF;IAAA,+CACO,EAAE;IAAA,iDACA,CACR,CAAC,EAAE,EAAE,MAAM,EAAE,6DAA6D,CAAC,EAC3E,CAAC,EAAE,EAAE,aAAa,EAAE,uDAAuD,CAAC,EAC5E,CAAC,EAAE,EAAE,WAAW,EAAE,8EAA8E,CAAC;IACjG;IACA,CAAC,EAAE,EAAE,cAAc,EAAE,yFAAyF,CAAC,CAChH;IAAA,gDACQ,IAAI;IAAA,iDACH,IAAI;IAAA,mDACF,IAAI;IAAA,kDACL,IAAI;EAEkC;EAEjD,MAAMC,MAAM,CACV,CAACF,IAAI,EAAEG,OAAO,CAAmB,EACjC;IACEC,IAAI,GAAG,KAAK;IACZC,UAAU,GAAG,KAAK;IAClBC,QAAQ,GAAG,KAAK;IAChBC,WAAW,GAAG;EAQhB,CAAC,EACgB;IACjB,IAAIA,WAAW,IAAI,CAACJ,OAAO,EAAE;MAC3B,MAAM,KAAIK,oBAAQ,EAAE,2DAA0D,CAAC;IACjF;IACA,MAAM;MAAEC,SAAS;MAAEC,gBAAgB;MAAEC;IAAY,CAAC,GAAG,MAAM,IAAI,CAACZ,UAAU,CAACa,cAAc,CAACZ,IAAI,EAAE;MAC9FI,IAAI;MACJC,UAAU;MACVC,QAAQ;MACRH,OAAO;MACPI;IACF,CAAC,CAAC;IAEF,MAAMM,WAAW,GAAGC,gBAAK,CAACC,KAAK,CAAE,uBAAsBN,SAAS,CAACO,MAAO,oBAAmBhB,IAAK,UAAS,CAAC;IAC1G,MAAMiB,YAAY,GAAGR,SAAS,CAACO,MAAM,GAAI,GAAEH,WAAY,KAAIJ,SAAS,CAACS,IAAI,CAAC,IAAI,CAAE,EAAC,GAAG,EAAE;IAEtF,MAAMC,cAAc,GAAGL,gBAAK,CAACM,IAAI,CAC9B,iBAAgBV,gBAAgB,CAACM,MAAO,+DAA8D,CACxG;IACD,MAAMK,eAAe,GAAGX,gBAAgB,CAACM,MAAM,GAAI,KAAIG,cAAe,KAAIT,gBAAgB,CAACQ,IAAI,CAAC,IAAI,CAAE,EAAC,GAAG,EAAE;IAE5G,MAAMI,aAAa,GAAGR,gBAAK,CAACC,KAAK,CAAE,yBAAwBJ,WAAW,CAACK,MAAO,aAAY,CAAC;IAC3F,MAAMO,cAAc,GAAGZ,WAAW,CAACK,MAAM,GAAI,KAAIM,aAAc,KAAIX,WAAW,CAACO,IAAI,CAAC,IAAI,CAAE,EAAC,GAAG,EAAE;IAEhG,OAAOD,YAAY,GAAGI,eAAe,GAAGE,cAAc;EACxD;AACF;AAAC"}
|
package/dist/merge-lane.cmd.js
CHANGED
@@ -1,90 +1,63 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
4
|
require("core-js/modules/es.array.iterator.js");
|
6
|
-
|
7
5
|
require("core-js/modules/es.promise.js");
|
8
|
-
|
9
6
|
Object.defineProperty(exports, "__esModule", {
|
10
7
|
value: true
|
11
8
|
});
|
12
9
|
exports.MergeLaneCmd = void 0;
|
13
|
-
|
14
10
|
function _defineProperty2() {
|
15
11
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
16
|
-
|
17
12
|
_defineProperty2 = function () {
|
18
13
|
return data;
|
19
14
|
};
|
20
|
-
|
21
15
|
return data;
|
22
16
|
}
|
23
|
-
|
24
17
|
function _chalk() {
|
25
18
|
const data = _interopRequireDefault(require("chalk"));
|
26
|
-
|
27
19
|
_chalk = function () {
|
28
20
|
return data;
|
29
21
|
};
|
30
|
-
|
31
22
|
return data;
|
32
23
|
}
|
33
|
-
|
34
24
|
function _mergeVersion() {
|
35
25
|
const data = require("@teambit/legacy/dist/consumer/versions-ops/merge-version");
|
36
|
-
|
37
26
|
_mergeVersion = function () {
|
38
27
|
return data;
|
39
28
|
};
|
40
|
-
|
41
29
|
return data;
|
42
30
|
}
|
43
|
-
|
44
31
|
function _merging() {
|
45
32
|
const data = require("@teambit/merging");
|
46
|
-
|
47
33
|
_merging = function () {
|
48
34
|
return data;
|
49
35
|
};
|
50
|
-
|
51
36
|
return data;
|
52
37
|
}
|
53
|
-
|
54
38
|
function _featureToggle() {
|
55
39
|
const data = require("@teambit/legacy/dist/api/consumer/lib/feature-toggle");
|
56
|
-
|
57
40
|
_featureToggle = function () {
|
58
41
|
return data;
|
59
42
|
};
|
60
|
-
|
61
43
|
return data;
|
62
44
|
}
|
63
|
-
|
64
45
|
function _bitError() {
|
65
46
|
const data = require("@teambit/bit-error");
|
66
|
-
|
67
47
|
_bitError = function () {
|
68
48
|
return data;
|
69
49
|
};
|
70
|
-
|
71
50
|
return data;
|
72
51
|
}
|
73
|
-
|
74
52
|
function _removeTemplate() {
|
75
53
|
const data = _interopRequireDefault(require("@teambit/legacy/dist/cli/templates/remove-template"));
|
76
|
-
|
77
54
|
_removeTemplate = function () {
|
78
55
|
return data;
|
79
56
|
};
|
80
|
-
|
81
57
|
return data;
|
82
58
|
}
|
83
|
-
|
84
59
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
85
|
-
|
86
60
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
87
|
-
|
88
61
|
class MergeLaneCmd {
|
89
62
|
constructor(mergeLanes) {
|
90
63
|
this.mergeLanes = mergeLanes;
|
@@ -109,7 +82,6 @@ it will snap-merge these components to complete the merge. use "no-snap" to opt-
|
|
109
82
|
(0, _defineProperty2().default)(this, "migration", true);
|
110
83
|
(0, _defineProperty2().default)(this, "remoteOp", true);
|
111
84
|
}
|
112
|
-
|
113
85
|
async report([name, pattern], {
|
114
86
|
ours = false,
|
115
87
|
theirs = false,
|
@@ -131,26 +103,20 @@ it will snap-merge these components to complete the merge. use "no-snap" to opt-
|
|
131
103
|
build = (0, _featureToggle().isFeatureEnabled)(_featureToggle().BUILD_ON_CI) ? Boolean(build) : true;
|
132
104
|
const mergeStrategy = (0, _mergeVersion().getMergeStrategy)(ours, theirs, manual);
|
133
105
|
if (noSnap && snapMessage) throw new (_bitError().BitError)('unable to use "noSnap" and "message" flags together');
|
134
|
-
|
135
106
|
if (includeDeps && !pattern && !existingOnWorkspaceOnly) {
|
136
107
|
throw new (_bitError().BitError)(`"--include-deps" flag is relevant only for --workspace and --pattern flags`);
|
137
108
|
}
|
138
|
-
|
139
109
|
const getResolveUnrelated = () => {
|
140
110
|
if (!resolveUnrelated) return undefined;
|
141
111
|
if (typeof resolveUnrelated === 'boolean') return 'ours';
|
142
|
-
|
143
112
|
if (resolveUnrelated !== 'ours' && resolveUnrelated !== 'theirs' && resolveUnrelated !== 'manual') {
|
144
113
|
throw new Error('--resolve-unrelated must be one of the following: [ours, theirs, manual]');
|
145
114
|
}
|
146
|
-
|
147
115
|
return resolveUnrelated;
|
148
116
|
};
|
149
|
-
|
150
117
|
if (resolveUnrelated && typeof resolveUnrelated === 'boolean') {
|
151
118
|
resolveUnrelated = 'ours';
|
152
119
|
}
|
153
|
-
|
154
120
|
const {
|
155
121
|
mergeResults,
|
156
122
|
deleteResults
|
@@ -177,9 +143,7 @@ it will snap-merge these components to complete the merge. use "no-snap" to opt-
|
|
177
143
|
const deleteResult = `${deleteResults.localResult ? (0, _removeTemplate().default)(deleteResults.localResult, false) : ''}${(deleteResults.remoteResult || []).map(item => (0, _removeTemplate().default)(item, true))}${deleteResults.readmeResult && _chalk().default.yellow(deleteResults.readmeResult) || ''}\n`;
|
178
144
|
return mergeResult + deleteResult;
|
179
145
|
}
|
180
|
-
|
181
146
|
}
|
182
|
-
|
183
147
|
exports.MergeLaneCmd = MergeLaneCmd;
|
184
148
|
|
185
149
|
//# sourceMappingURL=merge-lane.cmd.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["MergeLaneCmd","constructor","mergeLanes","name","description","report","pattern","ours","theirs","manual","build","workspace","existingOnWorkspaceOnly","noSnap","tag","message","snapMessage","keepReadme","noSquash","skipDependencyInstallation","remote","includeDeps","resolveUnrelated","ignoreConfigChanges","verbose","isFeatureEnabled","BUILD_ON_CI","Boolean","mergeStrategy","getMergeStrategy","BitError","getResolveUnrelated","undefined","Error","mergeResults","deleteResults","mergeLane","mergeResult","mergeReport","deleteResult","localResult","paintRemoved","remoteResult","map","item","readmeResult","chalk","yellow"],"sources":["merge-lane.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { getMergeStrategy, MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { mergeReport } from '@teambit/merging';\nimport { BUILD_ON_CI, isFeatureEnabled } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';\nimport { BitError } from '@teambit/bit-error';\nimport paintRemoved from '@teambit/legacy/dist/cli/templates/remove-template';\nimport { MergeLanesMain } from './merge-lanes.main.runtime';\n\nexport class MergeLaneCmd implements Command {\n name = 'merge <lane> [pattern]';\n description = `merge a local or a remote lane`;\n extendedDescription = `if the <lane> exists locally, it will be merged from the local lane.\notherwise, it will fetch the lane from the remote and merge it.\nin case the <lane> exists locally but you want to merge the remote version of it, use --remote flag.\nwhen the current and the other lanes are diverged in history and the files could be merged with no conflicts,\nit will snap-merge these components to complete the merge. use \"no-snap\" to opt-out, or \"tag\" to tag instead`;\n arguments = [\n {\n name: 'lane',\n description: 'lane-name or lane-id (if not exists locally) to merge to the current lane',\n },\n {\n name: 'pattern',\n description: 'EXPERIMENTAL. partially merge the lane with the specified component-pattern',\n },\n ];\n alias = '';\n options = [\n ['', 'ours', 'in case of a conflict, override the used version with the current modification'],\n ['', 'theirs', 'in case of a conflict, override the current modification with the specified version'],\n ['', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'],\n ['', 'workspace', 'merge only components in a lane that exist in the workspace'],\n ['', 'no-snap', 'do not auto snap in case the merge completed without conflicts'],\n ['', 'tag', 'tag all lane components after merging into main (also tag-merge in case of snap-merge)'],\n ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'],\n ['m', 'message <message>', 'override the default message for the auto snap'],\n ['', 'keep-readme', 'skip deleting the lane readme component after merging'],\n ['', 'no-squash', 'EXPERIMENTAL. relevant for merging lanes into main, which by default squash.'],\n [\n '',\n 'ignore-config-changes',\n 'allow merging when component are modified due to config changes (such as dependencies) only and not files',\n ],\n ['', 'verbose', 'show details of components that were not merged legitimately'],\n ['', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ['', 'remote', 'relevant when the target-lane locally is differ than the remote and you want the remote'],\n [\n '',\n 'include-deps',\n 'EXPERIMENTAL. relevant for \"--pattern\" and \"--workspace\". merge also dependencies of the given components',\n ],\n [\n '',\n 'resolve-unrelated [merge-strategy]',\n 'EXPERIMENTAL. relevant when a component on a lane and the component on main has nothing in common. merge-strategy can be \"ours\" (default) or \"theirs\"',\n ],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n remoteOp = true;\n\n constructor(private mergeLanes: MergeLanesMain) {}\n\n async report(\n [name, pattern]: [string, string],\n {\n ours = false,\n theirs = false,\n manual = false,\n build,\n workspace: existingOnWorkspaceOnly = false,\n noSnap = false,\n tag = false,\n message: snapMessage = '',\n keepReadme = false,\n noSquash = false,\n skipDependencyInstallation = false,\n remote = false,\n includeDeps = false,\n resolveUnrelated,\n ignoreConfigChanges,\n verbose = false,\n }: {\n ours: boolean;\n theirs: boolean;\n manual: boolean;\n workspace?: boolean;\n build?: boolean;\n noSnap: boolean;\n tag: boolean;\n message: string;\n keepReadme?: boolean;\n noSquash: boolean;\n skipDependencyInstallation?: boolean;\n remote: boolean;\n includeDeps?: boolean;\n resolveUnrelated?: string | boolean;\n ignoreConfigChanges?: boolean;\n verbose?: boolean;\n }\n ): Promise<string> {\n build = isFeatureEnabled(BUILD_ON_CI) ? Boolean(build) : true;\n const mergeStrategy = getMergeStrategy(ours, theirs, manual);\n if (noSnap && snapMessage) throw new BitError('unable to use \"noSnap\" and \"message\" flags together');\n if (includeDeps && !pattern && !existingOnWorkspaceOnly) {\n throw new BitError(`\"--include-deps\" flag is relevant only for --workspace and --pattern flags`);\n }\n const getResolveUnrelated = (): MergeStrategy | undefined => {\n if (!resolveUnrelated) return undefined;\n if (typeof resolveUnrelated === 'boolean') return 'ours';\n if (resolveUnrelated !== 'ours' && resolveUnrelated !== 'theirs' && resolveUnrelated !== 'manual') {\n throw new Error('--resolve-unrelated must be one of the following: [ours, theirs, manual]');\n }\n return resolveUnrelated;\n };\n if (resolveUnrelated && typeof resolveUnrelated === 'boolean') {\n resolveUnrelated = 'ours';\n }\n const { mergeResults, deleteResults } = await this.mergeLanes.mergeLane(name, {\n build,\n // @ts-ignore\n mergeStrategy,\n existingOnWorkspaceOnly,\n noSnap,\n snapMessage,\n keepReadme,\n noSquash,\n tag,\n pattern,\n skipDependencyInstallation,\n remote,\n resolveUnrelated: getResolveUnrelated(),\n ignoreConfigChanges,\n includeDeps,\n });\n\n const mergeResult = mergeReport({ ...mergeResults, verbose });\n const deleteResult = `${deleteResults.localResult ? paintRemoved(deleteResults.localResult, false) : ''}${(\n deleteResults.remoteResult || []\n ).map((item) => paintRemoved(item, true))}${\n (deleteResults.readmeResult && chalk.yellow(deleteResults.readmeResult)) || ''\n }\\n`;\n return mergeResult + deleteResult;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;;;AAGO,MAAMA,YAAN,CAAsC;EAsD3CC,WAAW,CAASC,UAAT,EAAqC;IAAA,KAA5BA,UAA4B,GAA5BA,UAA4B;IAAA,8CArDzC,wBAqDyC;IAAA,qDApDjC,gCAoDiC;IAAA,6DAnDzB;AACzB;AACA;AACA;AACA,6GA+CkD;IAAA,mDA9CpC,CACV;MACEC,IAAI,EAAE,MADR;MAEEC,WAAW,EAAE;IAFf,CADU,EAKV;MACED,IAAI,EAAE,SADR;MAEEC,WAAW,EAAE;IAFf,CALU,CA8CoC;IAAA,+CApCxC,EAoCwC;IAAA,iDAnCtC,CACR,CAAC,EAAD,EAAK,MAAL,EAAa,gFAAb,CADQ,EAER,CAAC,EAAD,EAAK,QAAL,EAAe,qFAAf,CAFQ,EAGR,CAAC,EA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Ae5EF;IAf4E,CAAhC,CAA9C;IAkBA,MAAMgB,WAAW,GAAG,IAAAC,sBAAA,kCAAiBJ,YAAjB;MAA+BV;IAA/B,GAApB;IACA,MAAMe,YAAY,GAAI,GAAEJ,aAAa,CAACK,WAAd,GAA4B,IAAAC,yBAAA,EAAaN,aAAa,CAACK,WAA3B,EAAwC,KAAxC,CAA5B,GAA6E,EAAG,GAAE,CACxGL,aAAa,CAACO,YAAd,IAA8B,EAD0E,EAExGC,GAFwG,CAEnGC,IAAD,IAAU,IAAAH,yBAAA,EAAaG,IAAb,EAAmB,IAAnB,CAF0F,CAEhE,GACvCT,aAAa,CAACU,YAAd,IAA8BC,gBAAA,CAAMC,MAAN,CAAaZ,aAAa,CAACU,YAA3B,CAA/B,IAA4E,EAC7E,IAJD;IAKA,OAAOR,WAAW,GAAGE,YAArB;EACD;;AAxI0C"}
|
1
|
+
{"version":3,"names":["MergeLaneCmd","constructor","mergeLanes","name","description","report","pattern","ours","theirs","manual","build","workspace","existingOnWorkspaceOnly","noSnap","tag","message","snapMessage","keepReadme","noSquash","skipDependencyInstallation","remote","includeDeps","resolveUnrelated","ignoreConfigChanges","verbose","isFeatureEnabled","BUILD_ON_CI","Boolean","mergeStrategy","getMergeStrategy","BitError","getResolveUnrelated","undefined","Error","mergeResults","deleteResults","mergeLane","mergeResult","mergeReport","deleteResult","localResult","paintRemoved","remoteResult","map","item","readmeResult","chalk","yellow"],"sources":["merge-lane.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { getMergeStrategy, MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { mergeReport } from '@teambit/merging';\nimport { BUILD_ON_CI, isFeatureEnabled } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';\nimport { BitError } from '@teambit/bit-error';\nimport paintRemoved from '@teambit/legacy/dist/cli/templates/remove-template';\nimport { MergeLanesMain } from './merge-lanes.main.runtime';\n\nexport class MergeLaneCmd implements Command {\n name = 'merge <lane> [pattern]';\n description = `merge a local or a remote lane`;\n extendedDescription = `if the <lane> exists locally, it will be merged from the local lane.\notherwise, it will fetch the lane from the remote and merge it.\nin case the <lane> exists locally but you want to merge the remote version of it, use --remote flag.\nwhen the current and the other lanes are diverged in history and the files could be merged with no conflicts,\nit will snap-merge these components to complete the merge. use \"no-snap\" to opt-out, or \"tag\" to tag instead`;\n arguments = [\n {\n name: 'lane',\n description: 'lane-name or lane-id (if not exists locally) to merge to the current lane',\n },\n {\n name: 'pattern',\n description: 'EXPERIMENTAL. partially merge the lane with the specified component-pattern',\n },\n ];\n alias = '';\n options = [\n ['', 'ours', 'in case of a conflict, override the used version with the current modification'],\n ['', 'theirs', 'in case of a conflict, override the current modification with the specified version'],\n ['', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'],\n ['', 'workspace', 'merge only components in a lane that exist in the workspace'],\n ['', 'no-snap', 'do not auto snap in case the merge completed without conflicts'],\n ['', 'tag', 'tag all lane components after merging into main (also tag-merge in case of snap-merge)'],\n ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'],\n ['m', 'message <message>', 'override the default message for the auto snap'],\n ['', 'keep-readme', 'skip deleting the lane readme component after merging'],\n ['', 'no-squash', 'EXPERIMENTAL. relevant for merging lanes into main, which by default squash.'],\n [\n '',\n 'ignore-config-changes',\n 'allow merging when component are modified due to config changes (such as dependencies) only and not files',\n ],\n ['', 'verbose', 'show details of components that were not merged legitimately'],\n ['', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ['', 'remote', 'relevant when the target-lane locally is differ than the remote and you want the remote'],\n [\n '',\n 'include-deps',\n 'EXPERIMENTAL. relevant for \"--pattern\" and \"--workspace\". merge also dependencies of the given components',\n ],\n [\n '',\n 'resolve-unrelated [merge-strategy]',\n 'EXPERIMENTAL. relevant when a component on a lane and the component on main has nothing in common. merge-strategy can be \"ours\" (default) or \"theirs\"',\n ],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n remoteOp = true;\n\n constructor(private mergeLanes: MergeLanesMain) {}\n\n async report(\n [name, pattern]: [string, string],\n {\n ours = false,\n theirs = false,\n manual = false,\n build,\n workspace: existingOnWorkspaceOnly = false,\n noSnap = false,\n tag = false,\n message: snapMessage = '',\n keepReadme = false,\n noSquash = false,\n skipDependencyInstallation = false,\n remote = false,\n includeDeps = false,\n resolveUnrelated,\n ignoreConfigChanges,\n verbose = false,\n }: {\n ours: boolean;\n theirs: boolean;\n manual: boolean;\n workspace?: boolean;\n build?: boolean;\n noSnap: boolean;\n tag: boolean;\n message: string;\n keepReadme?: boolean;\n noSquash: boolean;\n skipDependencyInstallation?: boolean;\n remote: boolean;\n includeDeps?: boolean;\n resolveUnrelated?: string | boolean;\n ignoreConfigChanges?: boolean;\n verbose?: boolean;\n }\n ): Promise<string> {\n build = isFeatureEnabled(BUILD_ON_CI) ? Boolean(build) : true;\n const mergeStrategy = getMergeStrategy(ours, theirs, manual);\n if (noSnap && snapMessage) throw new BitError('unable to use \"noSnap\" and \"message\" flags together');\n if (includeDeps && !pattern && !existingOnWorkspaceOnly) {\n throw new BitError(`\"--include-deps\" flag is relevant only for --workspace and --pattern flags`);\n }\n const getResolveUnrelated = (): MergeStrategy | undefined => {\n if (!resolveUnrelated) return undefined;\n if (typeof resolveUnrelated === 'boolean') return 'ours';\n if (resolveUnrelated !== 'ours' && resolveUnrelated !== 'theirs' && resolveUnrelated !== 'manual') {\n throw new Error('--resolve-unrelated must be one of the following: [ours, theirs, manual]');\n }\n return resolveUnrelated;\n };\n if (resolveUnrelated && typeof resolveUnrelated === 'boolean') {\n resolveUnrelated = 'ours';\n }\n const { mergeResults, deleteResults } = await this.mergeLanes.mergeLane(name, {\n build,\n // @ts-ignore\n mergeStrategy,\n existingOnWorkspaceOnly,\n noSnap,\n snapMessage,\n keepReadme,\n noSquash,\n tag,\n pattern,\n skipDependencyInstallation,\n remote,\n resolveUnrelated: getResolveUnrelated(),\n ignoreConfigChanges,\n includeDeps,\n });\n\n const mergeResult = mergeReport({ ...mergeResults, verbose });\n const deleteResult = `${deleteResults.localResult ? paintRemoved(deleteResults.localResult, false) : ''}${(\n deleteResults.remoteResult || []\n ).map((item) => paintRemoved(item, true))}${\n (deleteResults.readmeResult && chalk.yellow(deleteResults.readmeResult)) || ''\n }\\n`;\n return mergeResult + deleteResult;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA8E;AAAA;AAGvE,MAAMA,YAAY,CAAoB;EAsD3CC,WAAW,CAASC,UAA0B,EAAE;IAAA,KAA5BA,UAA0B,GAA1BA,UAA0B;IAAA,8CArDvC,wBAAwB;IAAA,qDAChB,gCAA+B;IAAA,6DACvB;AACzB;AACA;AACA;AACA,6GAA6G;IAAA,mDAC/F,CACV;MACEC,IAAI,EAAE,MAAM;MACZC,WAAW,EAAE;IACf,CAAC,EACD;MACED,IAAI,EAAE,SAAS;MACfC,WAAW,EAAE;IACf,CAAC,CACF;IAAA,+CACO,EAAE;IAAA,iDACA,CACR,CAAC,EAAE,EAAE,MAAM,EAAE,gFAAgF,CAAC,EAC9F,CAAC,EAAE,EAAE,QAAQ,EAAE,qFAAqF,CAAC,EACrG,CAAC,EAAE,EAAE,QAAQ,EAAE,6FAA6F,CAAC,EAC7G,CAAC,EAAE,EAAE,WAAW,EAAE,6DAA6D,CAAC,EAChF,CAAC,EAAE,EAAE,SAAS,EAAE,gEAAgE,CAAC,EACjF,CAAC,EAAE,EAAE,KAAK,EAAE,wFAAwF,CAAC,EACrG,CAAC,EAAE,EAAE,OAAO,EAAE,wFAAwF,CAAC,EAC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AI,EAAE,IAAI,CAAC,CAAE,GACvCT,aAAa,CAACU,YAAY,IAAIC,gBAAK,CAACC,MAAM,CAACZ,aAAa,CAACU,YAAY,CAAC,IAAK,EAC7E,IAAG;IACJ,OAAOR,WAAW,GAAGE,YAAY;EACnC;AACF;AAAC"}
|
@@ -4,21 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.MergeLanesAspect = void 0;
|
7
|
-
|
8
7
|
function _harmony() {
|
9
8
|
const data = require("@teambit/harmony");
|
10
|
-
|
11
9
|
_harmony = function () {
|
12
10
|
return data;
|
13
11
|
};
|
14
|
-
|
15
12
|
return data;
|
16
13
|
}
|
17
|
-
|
18
14
|
const MergeLanesAspect = _harmony().Aspect.create({
|
19
15
|
id: 'teambit.lanes/merge-lanes'
|
20
16
|
});
|
21
|
-
|
22
17
|
exports.MergeLanesAspect = MergeLanesAspect;
|
23
18
|
|
24
19
|
//# sourceMappingURL=merge-lanes.aspect.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["MergeLanesAspect","Aspect","create","id"],"sources":["merge-lanes.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const MergeLanesAspect = Aspect.create({\n id: 'teambit.lanes/merge-lanes',\n});\n"],"mappings":"
|
1
|
+
{"version":3,"names":["MergeLanesAspect","Aspect","create","id"],"sources":["merge-lanes.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const MergeLanesAspect = Aspect.create({\n id: 'teambit.lanes/merge-lanes',\n});\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,gBAAgB,GAAGC,iBAAM,CAACC,MAAM,CAAC;EAC5CC,EAAE,EAAE;AACN,CAAC,CAAC;AAAC"}
|
@@ -1,230 +1,161 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
4
|
require("core-js/modules/es.array.flat.js");
|
6
|
-
|
7
5
|
require("core-js/modules/es.array.iterator.js");
|
8
|
-
|
9
6
|
require("core-js/modules/es.array.unscopables.flat.js");
|
10
|
-
|
11
7
|
require("core-js/modules/es.promise.js");
|
12
|
-
|
13
8
|
Object.defineProperty(exports, "__esModule", {
|
14
9
|
value: true
|
15
10
|
});
|
16
11
|
exports.default = exports.MergeLanesMain = void 0;
|
17
|
-
|
18
12
|
function _defineProperty2() {
|
19
13
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
20
|
-
|
21
14
|
_defineProperty2 = function () {
|
22
15
|
return data;
|
23
16
|
};
|
24
|
-
|
25
17
|
return data;
|
26
18
|
}
|
27
|
-
|
28
19
|
function _bitError() {
|
29
20
|
const data = require("@teambit/bit-error");
|
30
|
-
|
31
21
|
_bitError = function () {
|
32
22
|
return data;
|
33
23
|
};
|
34
|
-
|
35
24
|
return data;
|
36
25
|
}
|
37
|
-
|
38
26
|
function _cli() {
|
39
27
|
const data = require("@teambit/cli");
|
40
|
-
|
41
28
|
_cli = function () {
|
42
29
|
return data;
|
43
30
|
};
|
44
|
-
|
45
31
|
return data;
|
46
32
|
}
|
47
|
-
|
48
33
|
function _lanes() {
|
49
34
|
const data = require("@teambit/lanes");
|
50
|
-
|
51
35
|
_lanes = function () {
|
52
36
|
return data;
|
53
37
|
};
|
54
|
-
|
55
38
|
return data;
|
56
39
|
}
|
57
|
-
|
58
40
|
function _merging() {
|
59
41
|
const data = _interopRequireDefault(require("@teambit/merging"));
|
60
|
-
|
61
42
|
_merging = function () {
|
62
43
|
return data;
|
63
44
|
};
|
64
|
-
|
65
45
|
return data;
|
66
46
|
}
|
67
|
-
|
68
47
|
function _workspace() {
|
69
48
|
const data = _interopRequireDefault(require("@teambit/workspace"));
|
70
|
-
|
71
49
|
_workspace = function () {
|
72
50
|
return data;
|
73
51
|
};
|
74
|
-
|
75
52
|
return data;
|
76
53
|
}
|
77
|
-
|
78
54
|
function _chalk() {
|
79
55
|
const data = _interopRequireDefault(require("chalk"));
|
80
|
-
|
81
56
|
_chalk = function () {
|
82
57
|
return data;
|
83
58
|
};
|
84
|
-
|
85
59
|
return data;
|
86
60
|
}
|
87
|
-
|
88
61
|
function _pMapSeries() {
|
89
62
|
const data = _interopRequireDefault(require("p-map-series"));
|
90
|
-
|
91
63
|
_pMapSeries = function () {
|
92
64
|
return data;
|
93
65
|
};
|
94
|
-
|
95
66
|
return data;
|
96
67
|
}
|
97
|
-
|
98
68
|
function _bitId() {
|
99
69
|
const data = require("@teambit/legacy/dist/bit-id");
|
100
|
-
|
101
70
|
_bitId = function () {
|
102
71
|
return data;
|
103
72
|
};
|
104
|
-
|
105
73
|
return data;
|
106
74
|
}
|
107
|
-
|
108
75
|
function _scope() {
|
109
76
|
const data = require("@teambit/scope");
|
110
|
-
|
111
77
|
_scope = function () {
|
112
78
|
return data;
|
113
79
|
};
|
114
|
-
|
115
80
|
return data;
|
116
81
|
}
|
117
|
-
|
118
82
|
function _scopeComponentsImporter() {
|
119
83
|
const data = _interopRequireDefault(require("@teambit/legacy/dist/scope/component-ops/scope-components-importer"));
|
120
|
-
|
121
84
|
_scopeComponentsImporter = function () {
|
122
85
|
return data;
|
123
86
|
};
|
124
|
-
|
125
87
|
return data;
|
126
88
|
}
|
127
|
-
|
128
89
|
function _laneId() {
|
129
90
|
const data = require("@teambit/lane-id");
|
130
|
-
|
131
91
|
_laneId = function () {
|
132
92
|
return data;
|
133
93
|
};
|
134
|
-
|
135
94
|
return data;
|
136
95
|
}
|
137
|
-
|
138
96
|
function _repositories() {
|
139
97
|
const data = require("@teambit/legacy/dist/scope/repositories");
|
140
|
-
|
141
98
|
_repositories = function () {
|
142
99
|
return data;
|
143
100
|
};
|
144
|
-
|
145
101
|
return data;
|
146
102
|
}
|
147
|
-
|
148
103
|
function _logger() {
|
149
104
|
const data = require("@teambit/logger");
|
150
|
-
|
151
105
|
_logger = function () {
|
152
106
|
return data;
|
153
107
|
};
|
154
|
-
|
155
108
|
return data;
|
156
109
|
}
|
157
|
-
|
158
110
|
function _remove() {
|
159
111
|
const data = require("@teambit/remove");
|
160
|
-
|
161
112
|
_remove = function () {
|
162
113
|
return data;
|
163
114
|
};
|
164
|
-
|
165
115
|
return data;
|
166
116
|
}
|
167
|
-
|
168
117
|
function _lodash() {
|
169
118
|
const data = require("lodash");
|
170
|
-
|
171
119
|
_lodash = function () {
|
172
120
|
return data;
|
173
121
|
};
|
174
|
-
|
175
122
|
return data;
|
176
123
|
}
|
177
|
-
|
178
124
|
function _export() {
|
179
125
|
const data = require("@teambit/export");
|
180
|
-
|
181
126
|
_export = function () {
|
182
127
|
return data;
|
183
128
|
};
|
184
|
-
|
185
129
|
return data;
|
186
130
|
}
|
187
|
-
|
188
131
|
function _getDivergeData() {
|
189
132
|
const data = require("@teambit/legacy/dist/scope/component-ops/get-diverge-data");
|
190
|
-
|
191
133
|
_getDivergeData = function () {
|
192
134
|
return data;
|
193
135
|
};
|
194
|
-
|
195
136
|
return data;
|
196
137
|
}
|
197
|
-
|
198
138
|
function _mergeLanes() {
|
199
139
|
const data = require("./merge-lanes.aspect");
|
200
|
-
|
201
140
|
_mergeLanes = function () {
|
202
141
|
return data;
|
203
142
|
};
|
204
|
-
|
205
143
|
return data;
|
206
144
|
}
|
207
|
-
|
208
145
|
function _mergeLane() {
|
209
146
|
const data = require("./merge-lane.cmd");
|
210
|
-
|
211
147
|
_mergeLane = function () {
|
212
148
|
return data;
|
213
149
|
};
|
214
|
-
|
215
150
|
return data;
|
216
151
|
}
|
217
|
-
|
218
152
|
function _mergeLaneFromScope() {
|
219
153
|
const data = require("./merge-lane-from-scope.cmd");
|
220
|
-
|
221
154
|
_mergeLaneFromScope = function () {
|
222
155
|
return data;
|
223
156
|
};
|
224
|
-
|
225
157
|
return data;
|
226
158
|
}
|
227
|
-
|
228
159
|
class MergeLanesMain {
|
229
160
|
constructor(workspace, merging, lanes, logger, remove, scope, exporter) {
|
230
161
|
this.workspace = workspace;
|
@@ -235,12 +166,10 @@ class MergeLanesMain {
|
|
235
166
|
this.scope = scope;
|
236
167
|
this.exporter = exporter;
|
237
168
|
}
|
238
|
-
|
239
169
|
async mergeLane(laneName, options) {
|
240
170
|
if (!this.workspace) {
|
241
171
|
throw new (_bitError().BitError)(`unable to merge a lane outside of Bit workspace`);
|
242
172
|
}
|
243
|
-
|
244
173
|
const consumer = this.workspace.consumer;
|
245
174
|
const {
|
246
175
|
mergeStrategy,
|
@@ -259,53 +188,39 @@ class MergeLanesMain {
|
|
259
188
|
remote
|
260
189
|
} = options;
|
261
190
|
const currentLaneId = consumer.getCurrentLaneId();
|
262
|
-
|
263
191
|
if (tag && !currentLaneId.isDefault()) {
|
264
192
|
throw new (_bitError().BitError)(`--tag only possible when on main. currently checked out to ${currentLaneId.toString()}`);
|
265
193
|
}
|
266
|
-
|
267
194
|
const otherLaneId = await consumer.getParsedLaneId(laneName);
|
268
|
-
|
269
195
|
if (otherLaneId.isEqual(currentLaneId)) {
|
270
196
|
throw new (_bitError().BitError)(`unable to merge lane "${otherLaneId.toString()}", you're already at this lane. to get updates, simply run "bit checkout head"`);
|
271
197
|
}
|
272
|
-
|
273
198
|
const currentLane = currentLaneId.isDefault() ? null : await consumer.scope.loadLane(currentLaneId);
|
274
199
|
const isDefaultLane = otherLaneId.isDefault();
|
275
|
-
|
276
200
|
const getOtherLane = async () => {
|
277
201
|
if (isDefaultLane) {
|
278
202
|
return undefined;
|
279
203
|
}
|
280
|
-
|
281
204
|
const lane = await consumer.scope.loadLane(otherLaneId);
|
282
|
-
|
283
205
|
if (remote || !lane) {
|
284
206
|
return this.lanes.fetchLaneWithItsComponents(otherLaneId);
|
285
207
|
}
|
286
|
-
|
287
208
|
return lane;
|
288
209
|
};
|
289
|
-
|
290
210
|
const otherLane = await getOtherLane();
|
291
|
-
|
292
211
|
const getBitIds = async () => {
|
293
212
|
if (isDefaultLane) {
|
294
213
|
if (!currentLane) throw new Error(`unable to merge ${_laneId().DEFAULT_LANE}, the current lane was not found`);
|
295
214
|
return consumer.scope.getDefaultLaneIdsFromLane(currentLane);
|
296
215
|
}
|
297
|
-
|
298
216
|
if (!otherLane) throw new Error(`lane must be defined for non-default`);
|
299
217
|
return otherLane.toBitIds();
|
300
218
|
};
|
301
|
-
|
302
219
|
const bitIds = await getBitIds();
|
303
220
|
this.logger.debug(`merging the following bitIds: ${bitIds.toString()}`);
|
304
221
|
const otherLaneName = isDefaultLane ? _laneId().DEFAULT_LANE : otherLaneId.toString();
|
305
|
-
|
306
222
|
const getAllComponentsStatus = async () => {
|
307
223
|
const tmp = new (_repositories().Tmp)(consumer.scope);
|
308
|
-
|
309
224
|
try {
|
310
225
|
const componentsStatus = await Promise.all(bitIds.map(bitId => this.merging.getComponentMergeStatus(bitId, currentLane, otherLaneName, {
|
311
226
|
resolveUnrelated,
|
@@ -318,9 +233,7 @@ class MergeLanesMain {
|
|
318
233
|
throw err;
|
319
234
|
}
|
320
235
|
};
|
321
|
-
|
322
236
|
let allComponentsStatus = await getAllComponentsStatus();
|
323
|
-
|
324
237
|
if (pattern) {
|
325
238
|
const componentIds = await this.workspace.resolveMultipleComponentIds(bitIds);
|
326
239
|
const compIdsFromPattern = this.workspace.scope.filterIdsFromPoolIdsByPattern(pattern, componentIds);
|
@@ -335,7 +248,6 @@ class MergeLanesMain {
|
|
335
248
|
}
|
336
249
|
});
|
337
250
|
}
|
338
|
-
|
339
251
|
if (existingOnWorkspaceOnly) {
|
340
252
|
const workspaceIds = await this.workspace.listIds();
|
341
253
|
const compIdsFromPattern = workspaceIds.filter(id => allComponentsStatus.find(c => c.id.isEqualWithoutVersion(id._legacy)));
|
@@ -350,13 +262,10 @@ class MergeLanesMain {
|
|
350
262
|
}
|
351
263
|
});
|
352
264
|
}
|
353
|
-
|
354
265
|
throwForFailures();
|
355
|
-
|
356
266
|
if (currentLaneId.isDefault() && !noSquash) {
|
357
267
|
squashSnaps(allComponentsStatus, otherLaneId, consumer);
|
358
268
|
}
|
359
|
-
|
360
269
|
const mergeResults = await this.merging.mergeSnaps({
|
361
270
|
mergeStrategy,
|
362
271
|
allComponentsStatus,
|
@@ -370,10 +279,8 @@ class MergeLanesMain {
|
|
370
279
|
});
|
371
280
|
const mergedSuccessfully = !mergeResults.failedComponents || mergeResults.failedComponents.length === 0 || mergeResults.failedComponents.every(failedComponent => failedComponent.unchangedLegitimately);
|
372
281
|
let deleteResults = {};
|
373
|
-
|
374
282
|
if (!keepReadme && otherLane && otherLane.readmeComponent && mergedSuccessfully) {
|
375
283
|
var _otherLane$readmeComp, _otherLane$readmeComp2;
|
376
|
-
|
377
284
|
const readmeComponentId = otherLane.readmeComponent.id.changeVersion((_otherLane$readmeComp = otherLane.readmeComponent) === null || _otherLane$readmeComp === void 0 ? void 0 : (_otherLane$readmeComp2 = _otherLane$readmeComp.head) === null || _otherLane$readmeComp2 === void 0 ? void 0 : _otherLane$readmeComp2.hash).toString();
|
378
285
|
deleteResults = await this.remove.remove({
|
379
286
|
componentsPattern: readmeComponentId,
|
@@ -388,40 +295,32 @@ class MergeLanesMain {
|
|
388
295
|
readmeResult: `\nlane ${otherLane.name} doesn't have a readme component`
|
389
296
|
};
|
390
297
|
}
|
391
|
-
|
392
298
|
await this.workspace.consumer.onDestroy();
|
393
299
|
return {
|
394
300
|
mergeResults,
|
395
301
|
deleteResults
|
396
302
|
};
|
397
|
-
|
398
303
|
function throwForFailures() {
|
399
304
|
const failedComponents = allComponentsStatus.filter(c => c.unmergedMessage && !c.unmergedLegitimately);
|
400
|
-
|
401
305
|
if (failedComponents.length) {
|
402
306
|
const failureMsgs = failedComponents.map(failedComponent => `${_chalk().default.bold(failedComponent.id.toString())} - ${_chalk().default.red(failedComponent.unmergedMessage)}`).join('\n');
|
403
307
|
throw new (_bitError().BitError)(`unable to merge due to the following failures:\n${failureMsgs}`);
|
404
308
|
}
|
405
309
|
}
|
406
310
|
}
|
407
|
-
|
408
311
|
async mergeFromScope(laneName, options) {
|
409
312
|
if (this.workspace) throw new (_bitError().BitError)(`unable to run this command from a workspace, please create a new bare-scope and run it from there`);
|
410
|
-
|
411
313
|
const laneId = _laneId().LaneId.parse(laneName);
|
412
|
-
|
413
314
|
const lane = await this.lanes.importLaneObject(laneId);
|
414
315
|
const laneIds = lane.toBitIds();
|
415
|
-
|
416
316
|
const scopeComponentsImporter = _scopeComponentsImporter().default.getInstance(this.scope.legacyScope);
|
417
|
-
|
418
|
-
|
419
|
-
|
317
|
+
await scopeComponentsImporter.importManyDeltaWithoutDeps(laneIds, true, lane, true);
|
318
|
+
// get their main as well
|
420
319
|
await scopeComponentsImporter.importManyDeltaWithoutDeps(laneIds.toVersionLatest(), true, undefined, true);
|
421
|
-
const repo = this.scope.legacyScope.objects;
|
320
|
+
const repo = this.scope.legacyScope.objects;
|
321
|
+
// loop through all components, make sure they're all ahead of main (it might not be on main yet).
|
422
322
|
// then, change the version object to include an extra parent to point to the main.
|
423
323
|
// then, change the component object head to point to this changed version
|
424
|
-
|
425
324
|
const mergedPreviously = [];
|
426
325
|
const mergedNow = [];
|
427
326
|
const bitObjectsPerComp = await (0, _pMapSeries().default)(laneIds, async id => {
|
@@ -430,12 +329,10 @@ class MergeLanesMain {
|
|
430
329
|
const laneHead = modelComponent.getRef(id.version);
|
431
330
|
if (!laneHead) throw new Error(`lane head must be defined for ${id.toString()}`);
|
432
331
|
const mainHead = modelComponent.head || null;
|
433
|
-
|
434
332
|
if (mainHead !== null && mainHead !== void 0 && mainHead.isEqual(laneHead)) {
|
435
333
|
mergedPreviously.push(id);
|
436
334
|
return undefined;
|
437
335
|
}
|
438
|
-
|
439
336
|
const divergeData = await (0, _getDivergeData().getDivergeData)({
|
440
337
|
repo,
|
441
338
|
modelComponent,
|
@@ -454,12 +351,9 @@ class MergeLanesMain {
|
|
454
351
|
const bitObjects = (0, _lodash().compact)(bitObjectsPerComp).map(b => b.objects);
|
455
352
|
await repo.writeObjectsToTheFS(bitObjects.flat());
|
456
353
|
let exportedIds = [];
|
457
|
-
|
458
354
|
if (options.push) {
|
459
355
|
const ids = (0, _lodash().compact)(bitObjectsPerComp).map(b => b.id);
|
460
|
-
|
461
356
|
const bitIds = _bitId().BitIds.fromArray(ids);
|
462
|
-
|
463
357
|
const {
|
464
358
|
exported
|
465
359
|
} = await this.exporter.exportMany({
|
@@ -470,17 +364,14 @@ class MergeLanesMain {
|
|
470
364
|
});
|
471
365
|
exportedIds = exported.map(id => id.toString());
|
472
366
|
}
|
473
|
-
|
474
367
|
return {
|
475
368
|
mergedPreviously: mergedPreviously.map(id => id.toString()),
|
476
369
|
mergedNow: mergedNow.map(id => id.toString()),
|
477
370
|
exportedIds
|
478
371
|
};
|
479
372
|
}
|
480
|
-
|
481
373
|
static async provider([lanes, cli, workspace, merging, loggerMain, remove, scope, exporter]) {
|
482
374
|
var _lanesCommand$command;
|
483
|
-
|
484
375
|
const logger = loggerMain.createLogger(_mergeLanes().MergeLanesAspect.id);
|
485
376
|
const lanesCommand = cli.getCommand('lane');
|
486
377
|
const mergeLanesMain = new MergeLanesMain(workspace, merging, lanes, logger, remove, scope, exporter);
|
@@ -488,98 +379,74 @@ class MergeLanesMain {
|
|
488
379
|
cli.register(new (_mergeLaneFromScope().MergeLaneFromScopeCmd)(mergeLanesMain));
|
489
380
|
return mergeLanesMain;
|
490
381
|
}
|
491
|
-
|
492
382
|
}
|
493
|
-
|
494
383
|
exports.MergeLanesMain = MergeLanesMain;
|
495
384
|
(0, _defineProperty2().default)(MergeLanesMain, "slots", []);
|
496
385
|
(0, _defineProperty2().default)(MergeLanesMain, "dependencies", [_lanes().LanesAspect, _cli().CLIAspect, _workspace().default, _merging().default, _logger().LoggerAspect, _remove().RemoveAspect, _scope().ScopeAspect, _export().ExportAspect]);
|
497
386
|
(0, _defineProperty2().default)(MergeLanesMain, "runtime", _cli().MainRuntime);
|
498
|
-
|
499
387
|
async function filterComponentsStatus(allComponentsStatus, compIdsToKeep, allBitIds, workspace, includeDeps = false, lane) {
|
500
388
|
const bitIdsFromPattern = _bitId().BitIds.fromArray(compIdsToKeep.map(c => c._legacy));
|
501
|
-
|
502
389
|
const bitIdsNotFromPattern = allBitIds.filter(bitId => !bitIdsFromPattern.hasWithoutVersion(bitId));
|
503
390
|
const filteredComponentStatus = [];
|
504
391
|
const depsToAdd = [];
|
505
392
|
await (0, _pMapSeries().default)(compIdsToKeep, async compId => {
|
506
393
|
const fromStatus = allComponentsStatus.find(c => c.id.isEqualWithoutVersion(compId._legacy));
|
507
|
-
|
508
394
|
if (!fromStatus) {
|
509
395
|
throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);
|
510
396
|
}
|
511
|
-
|
512
397
|
filteredComponentStatus.push(fromStatus);
|
513
|
-
|
514
398
|
if (fromStatus.unmergedMessage) {
|
515
399
|
return;
|
516
400
|
}
|
517
|
-
|
518
401
|
const {
|
519
402
|
divergeData
|
520
403
|
} = fromStatus;
|
521
|
-
|
522
404
|
if (!divergeData) {
|
523
405
|
throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);
|
524
406
|
}
|
525
|
-
|
526
407
|
const remoteVersions = divergeData.snapsOnRemoteOnly;
|
527
|
-
|
528
408
|
if (!remoteVersions.length) {
|
529
409
|
return;
|
530
410
|
}
|
531
|
-
|
532
|
-
|
533
|
-
|
411
|
+
const modelComponent = await workspace.consumer.scope.getModelComponent(compId._legacy);
|
412
|
+
// optimization suggestion: if squash is given, check only the last version.
|
534
413
|
await (0, _pMapSeries().default)(remoteVersions, async remoteVersion => {
|
535
414
|
const versionObj = await modelComponent.loadVersion(remoteVersion.toString(), workspace.consumer.scope.objects);
|
536
415
|
const flattenedDeps = versionObj.getAllFlattenedDependencies();
|
537
416
|
const depsNotIncludeInPattern = flattenedDeps.filter(id => bitIdsNotFromPattern.find(bitId => bitId.isEqualWithoutVersion(id)));
|
538
|
-
|
539
417
|
if (!depsNotIncludeInPattern.length) {
|
540
418
|
return;
|
541
419
|
}
|
542
|
-
|
543
420
|
const depsOnLane = [];
|
544
421
|
await Promise.all(depsNotIncludeInPattern.map(async dep => {
|
545
422
|
const isOnLane = await workspace.consumer.scope.isIdOnLane(dep, lane);
|
546
|
-
|
547
423
|
if (isOnLane) {
|
548
424
|
depsOnLane.push(dep);
|
549
425
|
}
|
550
426
|
}));
|
551
|
-
|
552
427
|
if (!depsOnLane.length) {
|
553
428
|
return;
|
554
429
|
}
|
555
|
-
|
556
430
|
if (!includeDeps) {
|
557
431
|
throw new (_bitError().BitError)(`unable to merge ${compId.toString()}.
|
558
432
|
it has (in version ${remoteVersion.toString()}) the following dependencies which were not included in the pattern. consider adding "--include-deps" flag
|
559
433
|
${depsOnLane.map(d => d.toString()).join('\n')}`);
|
560
434
|
}
|
561
|
-
|
562
435
|
depsToAdd.push(...depsOnLane);
|
563
436
|
});
|
564
437
|
});
|
565
|
-
|
566
438
|
if (depsToAdd.length) {
|
567
439
|
const depsUniq = _bitId().BitIds.uniqFromArray(depsToAdd);
|
568
|
-
|
569
440
|
depsUniq.forEach(id => {
|
570
441
|
const fromStatus = allComponentsStatus.find(c => c.id.isEqualWithoutVersion(id));
|
571
|
-
|
572
442
|
if (!fromStatus) {
|
573
443
|
throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);
|
574
444
|
}
|
575
|
-
|
576
445
|
filteredComponentStatus.push(fromStatus);
|
577
446
|
});
|
578
447
|
}
|
579
|
-
|
580
448
|
return filteredComponentStatus;
|
581
449
|
}
|
582
|
-
|
583
450
|
function squashSnaps(allComponentsStatus, otherLaneId, consumer) {
|
584
451
|
const currentLaneName = consumer.getCurrentLaneId().name;
|
585
452
|
const succeededComponents = allComponentsStatus.filter(c => !c.unmergedMessage);
|
@@ -591,68 +458,58 @@ function squashSnaps(allComponentsStatus, otherLaneId, consumer) {
|
|
591
458
|
if (!divergeData) {
|
592
459
|
throw new Error(`unable to squash. divergeData is missing from ${id.toString()}`);
|
593
460
|
}
|
594
|
-
|
595
461
|
const modifiedComp = squashOneComp(currentLaneName, otherLaneId, id, divergeData, componentFromModel);
|
596
462
|
if (modifiedComp) consumer.scope.objects.add(modifiedComp);
|
597
463
|
});
|
598
464
|
}
|
465
|
+
|
599
466
|
/**
|
600
467
|
* returns Version object if it was modified. otherwise, returns undefined
|
601
468
|
*/
|
602
|
-
|
603
|
-
|
604
469
|
function squashOneComp(currentLaneName, otherLaneId, id, divergeData, componentFromModel) {
|
605
470
|
if (divergeData.isDiverged()) {
|
606
471
|
throw new (_bitError().BitError)(`unable to squash because ${id.toString()} is diverged in history.
|
607
472
|
consider switching to "${otherLaneId.name}" first, merging "${currentLaneName}", then switching back to "${currentLaneName}" and merging "${otherLaneId.name}"
|
608
473
|
alternatively, use "--no-squash" flag to keep the entire history of "${otherLaneId.name}"`);
|
609
474
|
}
|
610
|
-
|
611
475
|
if (divergeData.isLocalAhead()) {
|
612
476
|
// nothing to do. current is ahead, nothing to merge. (it was probably filtered out already as a "failedComponent")
|
613
477
|
return undefined;
|
614
478
|
}
|
615
|
-
|
616
479
|
if (!divergeData.isRemoteAhead()) {
|
617
480
|
// nothing to do. current and remote are the same, nothing to merge. (it was probably filtered out already as a "failedComponent")
|
618
481
|
return undefined;
|
619
|
-
}
|
620
|
-
|
621
|
-
|
482
|
+
}
|
483
|
+
// remote is ahead and was not diverge.
|
622
484
|
const remoteSnaps = divergeData.snapsOnRemoteOnly;
|
623
|
-
|
624
485
|
if (remoteSnaps.length === 0) {
|
625
486
|
throw new Error(`remote is ahead but it has no snaps. it's impossible`);
|
626
|
-
}
|
487
|
+
}
|
488
|
+
// no need to check this case. even if it has only one snap ahead, we want to do the "squash", and run "addAsOnlyParent"
|
627
489
|
// to make sure it doesn't not have two parents.
|
628
490
|
// if (remoteSnaps.length === 1) {
|
629
491
|
// // nothing to squash. it has only one commit.
|
630
492
|
// return;
|
631
493
|
// }
|
632
|
-
|
633
|
-
|
634
494
|
if (!componentFromModel) {
|
635
495
|
throw new Error('unable to squash, the componentFromModel is missing');
|
636
496
|
}
|
497
|
+
const currentParents = componentFromModel.parents;
|
637
498
|
|
638
|
-
|
639
|
-
|
499
|
+
// do the squash.
|
640
500
|
if (divergeData.commonSnapBeforeDiverge) {
|
641
501
|
componentFromModel.addAsOnlyParent(divergeData.commonSnapBeforeDiverge);
|
642
502
|
} else {
|
643
503
|
// there is no commonSnapBeforeDiverge. the local has no snaps, all are remote, no need for parents. keep only head.
|
644
504
|
componentFromModel.parents.forEach(ref => componentFromModel.removeParent(ref));
|
645
505
|
}
|
646
|
-
|
647
506
|
componentFromModel.setSquashed({
|
648
507
|
previousParents: currentParents,
|
649
508
|
laneId: otherLaneId
|
650
509
|
});
|
651
510
|
return componentFromModel;
|
652
511
|
}
|
653
|
-
|
654
512
|
_mergeLanes().MergeLanesAspect.addRuntime(MergeLanesMain);
|
655
|
-
|
656
513
|
var _default = MergeLanesMain;
|
657
514
|
exports.default = _default;
|
658
515
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["MergeLanesMain","constructor","workspace","merging","lanes","logger","remove","scope","exporter","mergeLane","laneName","options","BitError","consumer","mergeStrategy","noSnap","tag","snapMessage","existingOnWorkspaceOnly","build","keepReadme","noSquash","pattern","includeDeps","skipDependencyInstallation","resolveUnrelated","ignoreConfigChanges","remote","currentLaneId","getCurrentLaneId","isDefault","toString","otherLaneId","getParsedLaneId","isEqual","currentLane","loadLane","isDefaultLane","getOtherLane","undefined","lane","fetchLaneWithItsComponents","otherLane","getBitIds","Error","DEFAULT_LANE","getDefaultLaneIdsFromLane","toBitIds","bitIds","debug","otherLaneName","getAllComponentsStatus","tmp","Tmp","componentsStatus","Promise","all","map","bitId","getComponentMergeStatus","clear","err","allComponentsStatus","componentIds","resolveMultipleComponentIds","compIdsFromPattern","filterIdsFromPoolIdsByPattern","filterComponentsStatus","forEach","find","c","id","isEqualWithoutVersion","push","unmergedLegitimately","unmergedMessage","workspaceIds","listIds","filter","_legacy","throwForFailures","squashSnaps","mergeResults","mergeSnaps","laneId","localLane","mergedSuccessfully","failedComponents","length","every","failedComponent","unchangedLegitimately","deleteResults","readmeComponent","readmeComponentId","changeVersion","head","hash","componentsPattern","force","track","deleteFiles","fromLane","readmeResult","name","onDestroy","failureMsgs","chalk","bold","red","join","mergeFromScope","LaneId","parse","importLaneObject","laneIds","scopeComponentsImporter","ScopeComponentsImporter","getInstance","legacyScope","importManyDeltaWithoutDeps","toVersionLatest","repo","objects","mergedPreviously","mergedNow","bitObjectsPerComp","pMapSeries","modelComponent","getModelComponent","versionObj","loadVersion","version","laneHead","getRef","mainHead","divergeData","getDivergeData","remoteHead","checkedOutLocalHead","modifiedVersion","squashOneComp","setHead","bitObjects","compact","b","writeObjectsToTheFS","flat","exportedIds","ids","BitIds","fromArray","exported","exportMany","idsWithFutureScope","allVersions","provider","cli","loggerMain","createLogger","MergeLanesAspect","lanesCommand","getCommand","mergeLanesMain","commands","MergeLaneCmd","register","MergeLaneFromScopeCmd","LanesAspect","CLIAspect","WorkspaceAspect","MergingAspect","LoggerAspect","RemoveAspect","ScopeAspect","ExportAspect","MainRuntime","compIdsToKeep","allBitIds","bitIdsFromPattern","bitIdsNotFromPattern","hasWithoutVersion","filteredComponentStatus","depsToAdd","compId","fromStatus","remoteVersions","snapsOnRemoteOnly","remoteVersion","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","d","depsUniq","uniqFromArray","currentLaneName","succeededComponents","componentFromModel","modifiedComp","add","isDiverged","isLocalAhead","isRemoteAhead","remoteSnaps","currentParents","parents","commonSnapBeforeDiverge","addAsOnlyParent","ref","removeParent","setSquashed","previousParents","addRuntime"],"sources":["merge-lanes.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { LanesAspect, LanesMain } from '@teambit/lanes';\nimport MergingAspect, { MergingMain, ComponentMergeStatus } from '@teambit/merging';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport chalk from 'chalk';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport pMapSeries from 'p-map-series';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { MergeStrategy, ApplyVersionResults } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport { ComponentID } from '@teambit/component-id';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { Lane, Version } from '@teambit/legacy/dist/scope/models';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { DivergeData } from '@teambit/legacy/dist/scope/component-ops/diverge-data';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { compact } from 'lodash';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { BitObject } from '@teambit/legacy/dist/scope/objects';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { MergeLanesAspect } from './merge-lanes.aspect';\nimport { MergeLaneCmd } from './merge-lane.cmd';\nimport { MergeLaneFromScopeCmd } from './merge-lane-from-scope.cmd';\n\nexport type MergeLaneOptions = {\n mergeStrategy: MergeStrategy;\n noSnap: boolean;\n snapMessage: string;\n existingOnWorkspaceOnly: boolean;\n build: boolean;\n keepReadme: boolean;\n noSquash: boolean;\n tag?: boolean;\n pattern?: string;\n includeDeps?: boolean;\n skipDependencyInstallation?: boolean;\n resolveUnrelated?: MergeStrategy;\n ignoreConfigChanges?: boolean;\n remote?: boolean;\n};\n\nexport class MergeLanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private merging: MergingMain,\n private lanes: LanesMain,\n private logger: Logger,\n private remove: RemoveMain,\n private scope: ScopeMain,\n private exporter: ExportMain\n ) {}\n\n async mergeLane(\n laneName: string,\n options: MergeLaneOptions\n ): Promise<{ mergeResults: ApplyVersionResults; deleteResults: any }> {\n if (!this.workspace) {\n throw new BitError(`unable to merge a lane outside of Bit workspace`);\n }\n const consumer = this.workspace.consumer;\n\n const {\n mergeStrategy,\n noSnap,\n tag,\n snapMessage,\n existingOnWorkspaceOnly,\n build,\n keepReadme,\n noSquash,\n pattern,\n includeDeps,\n skipDependencyInstallation,\n resolveUnrelated,\n ignoreConfigChanges,\n remote,\n } = options;\n\n const currentLaneId = consumer.getCurrentLaneId();\n if (tag && !currentLaneId.isDefault()) {\n throw new BitError(`--tag only possible when on main. currently checked out to ${currentLaneId.toString()}`);\n }\n const otherLaneId = await consumer.getParsedLaneId(laneName);\n if (otherLaneId.isEqual(currentLaneId)) {\n throw new BitError(\n `unable to merge lane \"${otherLaneId.toString()}\", you're already at this lane. to get updates, simply run \"bit checkout head\"`\n );\n }\n const currentLane = currentLaneId.isDefault() ? null : await consumer.scope.loadLane(currentLaneId);\n const isDefaultLane = otherLaneId.isDefault();\n const getOtherLane = async () => {\n if (isDefaultLane) {\n return undefined;\n }\n const lane = await consumer.scope.loadLane(otherLaneId);\n if (remote || !lane) {\n return this.lanes.fetchLaneWithItsComponents(otherLaneId);\n }\n return lane;\n };\n const otherLane = await getOtherLane();\n const getBitIds = async () => {\n if (isDefaultLane) {\n if (!currentLane) throw new Error(`unable to merge ${DEFAULT_LANE}, the current lane was not found`);\n return consumer.scope.getDefaultLaneIdsFromLane(currentLane);\n }\n if (!otherLane) throw new Error(`lane must be defined for non-default`);\n return otherLane.toBitIds();\n };\n const bitIds = await getBitIds();\n this.logger.debug(`merging the following bitIds: ${bitIds.toString()}`);\n const otherLaneName = isDefaultLane ? DEFAULT_LANE : otherLaneId.toString();\n\n const getAllComponentsStatus = async (): Promise<ComponentMergeStatus[]> => {\n const tmp = new Tmp(consumer.scope);\n try {\n const componentsStatus = await Promise.all(\n bitIds.map((bitId) =>\n this.merging.getComponentMergeStatus(bitId, currentLane, otherLaneName, {\n resolveUnrelated,\n ignoreConfigChanges,\n })\n )\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n };\n let allComponentsStatus = await getAllComponentsStatus();\n\n if (pattern) {\n const componentIds = await this.workspace.resolveMultipleComponentIds(bitIds);\n const compIdsFromPattern = this.workspace.scope.filterIdsFromPoolIdsByPattern(pattern, componentIds);\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n bitIds,\n this.workspace,\n includeDeps,\n otherLane || undefined\n );\n bitIds.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unmergedLegitimately: true, unmergedMessage: `excluded by pattern` });\n }\n });\n }\n if (existingOnWorkspaceOnly) {\n const workspaceIds = await this.workspace.listIds();\n const compIdsFromPattern = workspaceIds.filter((id) =>\n allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id._legacy))\n );\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n bitIds,\n this.workspace,\n includeDeps\n );\n bitIds.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unmergedLegitimately: true, unmergedMessage: `not in the workspace` });\n }\n });\n }\n\n throwForFailures();\n\n if (currentLaneId.isDefault() && !noSquash) {\n squashSnaps(allComponentsStatus, otherLaneId, consumer);\n }\n\n const mergeResults = await this.merging.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n laneId: otherLaneId,\n localLane: currentLane,\n noSnap,\n tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n });\n\n const mergedSuccessfully =\n !mergeResults.failedComponents ||\n mergeResults.failedComponents.length === 0 ||\n mergeResults.failedComponents.every((failedComponent) => failedComponent.unchangedLegitimately);\n\n let deleteResults = {};\n\n if (!keepReadme && otherLane && otherLane.readmeComponent && mergedSuccessfully) {\n const readmeComponentId = otherLane.readmeComponent.id\n .changeVersion(otherLane.readmeComponent?.head?.hash)\n .toString();\n\n deleteResults = await this.remove.remove({\n componentsPattern: readmeComponentId,\n force: false,\n remote: false,\n track: false,\n deleteFiles: true,\n fromLane: false,\n });\n } else if (otherLane && !otherLane.readmeComponent) {\n deleteResults = { readmeResult: `\\nlane ${otherLane.name} doesn't have a readme component` };\n }\n\n await this.workspace.consumer.onDestroy();\n\n return { mergeResults, deleteResults };\n\n function throwForFailures() {\n const failedComponents = allComponentsStatus.filter((c) => c.unmergedMessage && !c.unmergedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unmergedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to merge due to the following failures:\\n${failureMsgs}`);\n }\n }\n }\n\n async mergeFromScope(\n laneName: string,\n options: Partial<MergeLaneOptions> & { push?: boolean }\n ): Promise<{\n mergedPreviously: string[];\n mergedNow: string[];\n exportedIds: string[];\n }> {\n if (this.workspace)\n throw new BitError(\n `unable to run this command from a workspace, please create a new bare-scope and run it from there`\n );\n const laneId = LaneId.parse(laneName);\n const lane = await this.lanes.importLaneObject(laneId);\n const laneIds = lane.toBitIds();\n const scopeComponentsImporter = ScopeComponentsImporter.getInstance(this.scope.legacyScope);\n await scopeComponentsImporter.importManyDeltaWithoutDeps(laneIds, true, lane, true);\n // get their main as well\n await scopeComponentsImporter.importManyDeltaWithoutDeps(laneIds.toVersionLatest(), true, undefined, true);\n const repo = this.scope.legacyScope.objects;\n // loop through all components, make sure they're all ahead of main (it might not be on main yet).\n // then, change the version object to include an extra parent to point to the main.\n // then, change the component object head to point to this changed version\n const mergedPreviously: BitId[] = [];\n const mergedNow: BitId[] = [];\n const bitObjectsPerComp = await pMapSeries(laneIds, async (id) => {\n const modelComponent = await this.scope.legacyScope.getModelComponent(id);\n const versionObj = await modelComponent.loadVersion(id.version as string, repo);\n const laneHead = modelComponent.getRef(id.version as string);\n if (!laneHead) throw new Error(`lane head must be defined for ${id.toString()}`);\n const mainHead = modelComponent.head || null;\n if (mainHead?.isEqual(laneHead)) {\n mergedPreviously.push(id);\n return undefined;\n }\n const divergeData = await getDivergeData({\n repo,\n modelComponent,\n remoteHead: laneHead,\n checkedOutLocalHead: mainHead,\n });\n const modifiedVersion = squashOneComp(DEFAULT_LANE, laneId, id, divergeData, versionObj);\n modelComponent.setHead(laneHead);\n const objects = [modelComponent, modifiedVersion];\n mergedNow.push(id);\n return { id, objects };\n });\n const bitObjects = compact(bitObjectsPerComp).map((b) => b.objects);\n await repo.writeObjectsToTheFS(bitObjects.flat() as BitObject[]);\n let exportedIds: string[] = [];\n if (options.push) {\n const ids = compact(bitObjectsPerComp).map((b) => b.id);\n const bitIds = BitIds.fromArray(ids);\n const { exported } = await this.exporter.exportMany({\n scope: this.scope.legacyScope,\n ids: bitIds,\n idsWithFutureScope: bitIds,\n allVersions: false,\n });\n exportedIds = exported.map((id) => id.toString());\n }\n\n return {\n mergedPreviously: mergedPreviously.map((id) => id.toString()),\n mergedNow: mergedNow.map((id) => id.toString()),\n exportedIds,\n };\n }\n\n static slots = [];\n static dependencies = [\n LanesAspect,\n CLIAspect,\n WorkspaceAspect,\n MergingAspect,\n LoggerAspect,\n RemoveAspect,\n ScopeAspect,\n ExportAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([lanes, cli, workspace, merging, loggerMain, remove, scope, exporter]: [\n LanesMain,\n CLIMain,\n Workspace,\n MergingMain,\n LoggerMain,\n RemoveMain,\n ScopeMain,\n ExportMain\n ]) {\n const logger = loggerMain.createLogger(MergeLanesAspect.id);\n const lanesCommand = cli.getCommand('lane');\n const mergeLanesMain = new MergeLanesMain(workspace, merging, lanes, logger, remove, scope, exporter);\n lanesCommand?.commands?.push(new MergeLaneCmd(mergeLanesMain));\n cli.register(new MergeLaneFromScopeCmd(mergeLanesMain));\n return mergeLanesMain;\n }\n}\n\nasync function filterComponentsStatus(\n allComponentsStatus: ComponentMergeStatus[],\n compIdsToKeep: ComponentID[],\n allBitIds: BitId[],\n workspace: Workspace,\n includeDeps = false,\n lane?: Lane\n): Promise<ComponentMergeStatus[]> {\n const bitIdsFromPattern = BitIds.fromArray(compIdsToKeep.map((c) => c._legacy));\n const bitIdsNotFromPattern = allBitIds.filter((bitId) => !bitIdsFromPattern.hasWithoutVersion(bitId));\n const filteredComponentStatus: ComponentMergeStatus[] = [];\n const depsToAdd: BitId[] = [];\n await pMapSeries(compIdsToKeep, async (compId) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(compId._legacy));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n if (fromStatus.unmergedMessage) {\n return;\n }\n const { divergeData } = fromStatus;\n if (!divergeData) {\n throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);\n }\n const remoteVersions = divergeData.snapsOnRemoteOnly;\n if (!remoteVersions.length) {\n return;\n }\n const modelComponent = await workspace.consumer.scope.getModelComponent(compId._legacy);\n // optimization suggestion: if squash is given, check only the last version.\n await pMapSeries(remoteVersions, async (remoteVersion) => {\n const versionObj = await modelComponent.loadVersion(remoteVersion.toString(), workspace.consumer.scope.objects);\n const flattenedDeps = versionObj.getAllFlattenedDependencies();\n const depsNotIncludeInPattern = flattenedDeps.filter((id) =>\n bitIdsNotFromPattern.find((bitId) => bitId.isEqualWithoutVersion(id))\n );\n if (!depsNotIncludeInPattern.length) {\n return;\n }\n const depsOnLane: BitId[] = [];\n await Promise.all(\n depsNotIncludeInPattern.map(async (dep) => {\n const isOnLane = await workspace.consumer.scope.isIdOnLane(dep, lane);\n if (isOnLane) {\n depsOnLane.push(dep);\n }\n })\n );\n if (!depsOnLane.length) {\n return;\n }\n if (!includeDeps) {\n throw new BitError(`unable to merge ${compId.toString()}.\nit has (in version ${remoteVersion.toString()}) the following dependencies which were not included in the pattern. consider adding \"--include-deps\" flag\n${depsOnLane.map((d) => d.toString()).join('\\n')}`);\n }\n depsToAdd.push(...depsOnLane);\n });\n });\n if (depsToAdd.length) {\n const depsUniq = BitIds.uniqFromArray(depsToAdd);\n depsUniq.forEach((id) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n });\n }\n return filteredComponentStatus;\n}\n\nfunction squashSnaps(allComponentsStatus: ComponentMergeStatus[], otherLaneId: LaneId, consumer: Consumer) {\n const currentLaneName = consumer.getCurrentLaneId().name;\n const succeededComponents = allComponentsStatus.filter((c) => !c.unmergedMessage);\n succeededComponents.forEach(({ id, divergeData, componentFromModel }) => {\n if (!divergeData) {\n throw new Error(`unable to squash. divergeData is missing from ${id.toString()}`);\n }\n const modifiedComp = squashOneComp(currentLaneName, otherLaneId, id, divergeData, componentFromModel);\n if (modifiedComp) consumer.scope.objects.add(modifiedComp);\n });\n}\n\n/**\n * returns Version object if it was modified. otherwise, returns undefined\n */\nfunction squashOneComp(\n currentLaneName: string,\n otherLaneId: LaneId,\n id: BitId,\n divergeData: DivergeData,\n componentFromModel?: Version\n): Version | undefined {\n if (divergeData.isDiverged()) {\n throw new BitError(`unable to squash because ${id.toString()} is diverged in history.\nconsider switching to \"${\n otherLaneId.name\n }\" first, merging \"${currentLaneName}\", then switching back to \"${currentLaneName}\" and merging \"${\n otherLaneId.name\n }\"\nalternatively, use \"--no-squash\" flag to keep the entire history of \"${otherLaneId.name}\"`);\n }\n if (divergeData.isLocalAhead()) {\n // nothing to do. current is ahead, nothing to merge. (it was probably filtered out already as a \"failedComponent\")\n return undefined;\n }\n if (!divergeData.isRemoteAhead()) {\n // nothing to do. current and remote are the same, nothing to merge. (it was probably filtered out already as a \"failedComponent\")\n return undefined;\n }\n // remote is ahead and was not diverge.\n const remoteSnaps = divergeData.snapsOnRemoteOnly;\n if (remoteSnaps.length === 0) {\n throw new Error(`remote is ahead but it has no snaps. it's impossible`);\n }\n // no need to check this case. even if it has only one snap ahead, we want to do the \"squash\", and run \"addAsOnlyParent\"\n // to make sure it doesn't not have two parents.\n // if (remoteSnaps.length === 1) {\n // // nothing to squash. it has only one commit.\n // return;\n // }\n if (!componentFromModel) {\n throw new Error('unable to squash, the componentFromModel is missing');\n }\n\n const currentParents = componentFromModel.parents;\n\n // do the squash.\n if (divergeData.commonSnapBeforeDiverge) {\n componentFromModel.addAsOnlyParent(divergeData.commonSnapBeforeDiverge);\n } else {\n // there is no commonSnapBeforeDiverge. the local has no snaps, all are remote, no need for parents. keep only head.\n componentFromModel.parents.forEach((ref) => componentFromModel.removeParent(ref));\n }\n componentFromModel.setSquashed({ previousParents: currentParents, laneId: otherLaneId });\n return componentFromModel;\n}\n\nMergeLanesAspect.addRuntime(MergeLanesMain);\n\nexport default MergeLanesMain;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAA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,YAAZ,EAAJ,EAAgC;IAC9B;IACA,OAAOtK,SAAP;EACD;;EACD,IAAI,CAACiG,WAAW,CAACsE,aAAZ,EAAL,EAAkC;IAChC;IACA,OAAOvK,SAAP;EACD,CAjBoB,CAkBrB;;;EACA,MAAMwK,WAAW,GAAGvE,WAAW,CAACmD,iBAAhC;;EACA,IAAIoB,WAAW,CAACvH,MAAZ,KAAuB,CAA3B,EAA8B;IAC5B,MAAM,IAAI5C,KAAJ,CAAW,sDAAX,CAAN;EACD,CAtBoB,CAuBrB;EACA;EACA;EACA;EACA;EACA;;;EACA,IAAI,CAAC6J,kBAAL,EAAyB;IACvB,MAAM,IAAI7J,KAAJ,CAAU,qDAAV,CAAN;EACD;;EAED,MAAMoK,cAAc,GAAGP,kBAAkB,CAACQ,OAA1C,CAjCqB,CAmCrB;;EACA,IAAIzE,WAAW,CAAC0E,uBAAhB,EAAyC;IACvCT,kBAAkB,CAACU,eAAnB,CAAmC3E,WAAW,CAAC0E,uBAA/C;EACD,CAFD,MAEO;IACL;IACAT,kBAAkB,CAACQ,OAAnB,CAA2B7I,OAA3B,CAAoCgJ,GAAD,IAASX,kBAAkB,CAACY,YAAnB,CAAgCD,GAAhC,CAA5C;EACD;;EACDX,kBAAkB,CAACa,WAAnB,CAA+B;IAAEC,eAAe,EAAEP,cAAnB;IAAmC5H,MAAM,EAAEpD;EAA3C,CAA/B;EACA,OAAOyK,kBAAP;AACD;;AAEDzC,8BAAA,CAAiBwD,UAAjB,CAA4BxN,cAA5B;;eAEeA,c"}
|
1
|
+
{"version":3,"names":["MergeLanesMain","constructor","workspace","merging","lanes","logger","remove","scope","exporter","mergeLane","laneName","options","BitError","consumer","mergeStrategy","noSnap","tag","snapMessage","existingOnWorkspaceOnly","build","keepReadme","noSquash","pattern","includeDeps","skipDependencyInstallation","resolveUnrelated","ignoreConfigChanges","remote","currentLaneId","getCurrentLaneId","isDefault","toString","otherLaneId","getParsedLaneId","isEqual","currentLane","loadLane","isDefaultLane","getOtherLane","undefined","lane","fetchLaneWithItsComponents","otherLane","getBitIds","Error","DEFAULT_LANE","getDefaultLaneIdsFromLane","toBitIds","bitIds","debug","otherLaneName","getAllComponentsStatus","tmp","Tmp","componentsStatus","Promise","all","map","bitId","getComponentMergeStatus","clear","err","allComponentsStatus","componentIds","resolveMultipleComponentIds","compIdsFromPattern","filterIdsFromPoolIdsByPattern","filterComponentsStatus","forEach","find","c","id","isEqualWithoutVersion","push","unmergedLegitimately","unmergedMessage","workspaceIds","listIds","filter","_legacy","throwForFailures","squashSnaps","mergeResults","mergeSnaps","laneId","localLane","mergedSuccessfully","failedComponents","length","every","failedComponent","unchangedLegitimately","deleteResults","readmeComponent","readmeComponentId","changeVersion","head","hash","componentsPattern","force","track","deleteFiles","fromLane","readmeResult","name","onDestroy","failureMsgs","chalk","bold","red","join","mergeFromScope","LaneId","parse","importLaneObject","laneIds","scopeComponentsImporter","ScopeComponentsImporter","getInstance","legacyScope","importManyDeltaWithoutDeps","toVersionLatest","repo","objects","mergedPreviously","mergedNow","bitObjectsPerComp","pMapSeries","modelComponent","getModelComponent","versionObj","loadVersion","version","laneHead","getRef","mainHead","divergeData","getDivergeData","remoteHead","checkedOutLocalHead","modifiedVersion","squashOneComp","setHead","bitObjects","compact","b","writeObjectsToTheFS","flat","exportedIds","ids","BitIds","fromArray","exported","exportMany","idsWithFutureScope","allVersions","provider","cli","loggerMain","createLogger","MergeLanesAspect","lanesCommand","getCommand","mergeLanesMain","commands","MergeLaneCmd","register","MergeLaneFromScopeCmd","LanesAspect","CLIAspect","WorkspaceAspect","MergingAspect","LoggerAspect","RemoveAspect","ScopeAspect","ExportAspect","MainRuntime","compIdsToKeep","allBitIds","bitIdsFromPattern","bitIdsNotFromPattern","hasWithoutVersion","filteredComponentStatus","depsToAdd","compId","fromStatus","remoteVersions","snapsOnRemoteOnly","remoteVersion","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","d","depsUniq","uniqFromArray","currentLaneName","succeededComponents","componentFromModel","modifiedComp","add","isDiverged","isLocalAhead","isRemoteAhead","remoteSnaps","currentParents","parents","commonSnapBeforeDiverge","addAsOnlyParent","ref","removeParent","setSquashed","previousParents","addRuntime"],"sources":["merge-lanes.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { LanesAspect, LanesMain } from '@teambit/lanes';\nimport MergingAspect, { MergingMain, ComponentMergeStatus } from '@teambit/merging';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport chalk from 'chalk';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport pMapSeries from 'p-map-series';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { MergeStrategy, ApplyVersionResults } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport { ComponentID } from '@teambit/component-id';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { Lane, Version } from '@teambit/legacy/dist/scope/models';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { DivergeData } from '@teambit/legacy/dist/scope/component-ops/diverge-data';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { compact } from 'lodash';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { BitObject } from '@teambit/legacy/dist/scope/objects';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { MergeLanesAspect } from './merge-lanes.aspect';\nimport { MergeLaneCmd } from './merge-lane.cmd';\nimport { MergeLaneFromScopeCmd } from './merge-lane-from-scope.cmd';\n\nexport type MergeLaneOptions = {\n mergeStrategy: MergeStrategy;\n noSnap: boolean;\n snapMessage: string;\n existingOnWorkspaceOnly: boolean;\n build: boolean;\n keepReadme: boolean;\n noSquash: boolean;\n tag?: boolean;\n pattern?: string;\n includeDeps?: boolean;\n skipDependencyInstallation?: boolean;\n resolveUnrelated?: MergeStrategy;\n ignoreConfigChanges?: boolean;\n remote?: boolean;\n};\n\nexport class MergeLanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private merging: MergingMain,\n private lanes: LanesMain,\n private logger: Logger,\n private remove: RemoveMain,\n private scope: ScopeMain,\n private exporter: ExportMain\n ) {}\n\n async mergeLane(\n laneName: string,\n options: MergeLaneOptions\n ): Promise<{ mergeResults: ApplyVersionResults; deleteResults: any }> {\n if (!this.workspace) {\n throw new BitError(`unable to merge a lane outside of Bit workspace`);\n }\n const consumer = this.workspace.consumer;\n\n const {\n mergeStrategy,\n noSnap,\n tag,\n snapMessage,\n existingOnWorkspaceOnly,\n build,\n keepReadme,\n noSquash,\n pattern,\n includeDeps,\n skipDependencyInstallation,\n resolveUnrelated,\n ignoreConfigChanges,\n remote,\n } = options;\n\n const currentLaneId = consumer.getCurrentLaneId();\n if (tag && !currentLaneId.isDefault()) {\n throw new BitError(`--tag only possible when on main. currently checked out to ${currentLaneId.toString()}`);\n }\n const otherLaneId = await consumer.getParsedLaneId(laneName);\n if (otherLaneId.isEqual(currentLaneId)) {\n throw new BitError(\n `unable to merge lane \"${otherLaneId.toString()}\", you're already at this lane. to get updates, simply run \"bit checkout head\"`\n );\n }\n const currentLane = currentLaneId.isDefault() ? null : await consumer.scope.loadLane(currentLaneId);\n const isDefaultLane = otherLaneId.isDefault();\n const getOtherLane = async () => {\n if (isDefaultLane) {\n return undefined;\n }\n const lane = await consumer.scope.loadLane(otherLaneId);\n if (remote || !lane) {\n return this.lanes.fetchLaneWithItsComponents(otherLaneId);\n }\n return lane;\n };\n const otherLane = await getOtherLane();\n const getBitIds = async () => {\n if (isDefaultLane) {\n if (!currentLane) throw new Error(`unable to merge ${DEFAULT_LANE}, the current lane was not found`);\n return consumer.scope.getDefaultLaneIdsFromLane(currentLane);\n }\n if (!otherLane) throw new Error(`lane must be defined for non-default`);\n return otherLane.toBitIds();\n };\n const bitIds = await getBitIds();\n this.logger.debug(`merging the following bitIds: ${bitIds.toString()}`);\n const otherLaneName = isDefaultLane ? DEFAULT_LANE : otherLaneId.toString();\n\n const getAllComponentsStatus = async (): Promise<ComponentMergeStatus[]> => {\n const tmp = new Tmp(consumer.scope);\n try {\n const componentsStatus = await Promise.all(\n bitIds.map((bitId) =>\n this.merging.getComponentMergeStatus(bitId, currentLane, otherLaneName, {\n resolveUnrelated,\n ignoreConfigChanges,\n })\n )\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n };\n let allComponentsStatus = await getAllComponentsStatus();\n\n if (pattern) {\n const componentIds = await this.workspace.resolveMultipleComponentIds(bitIds);\n const compIdsFromPattern = this.workspace.scope.filterIdsFromPoolIdsByPattern(pattern, componentIds);\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n bitIds,\n this.workspace,\n includeDeps,\n otherLane || undefined\n );\n bitIds.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unmergedLegitimately: true, unmergedMessage: `excluded by pattern` });\n }\n });\n }\n if (existingOnWorkspaceOnly) {\n const workspaceIds = await this.workspace.listIds();\n const compIdsFromPattern = workspaceIds.filter((id) =>\n allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id._legacy))\n );\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n bitIds,\n this.workspace,\n includeDeps\n );\n bitIds.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unmergedLegitimately: true, unmergedMessage: `not in the workspace` });\n }\n });\n }\n\n throwForFailures();\n\n if (currentLaneId.isDefault() && !noSquash) {\n squashSnaps(allComponentsStatus, otherLaneId, consumer);\n }\n\n const mergeResults = await this.merging.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n laneId: otherLaneId,\n localLane: currentLane,\n noSnap,\n tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n });\n\n const mergedSuccessfully =\n !mergeResults.failedComponents ||\n mergeResults.failedComponents.length === 0 ||\n mergeResults.failedComponents.every((failedComponent) => failedComponent.unchangedLegitimately);\n\n let deleteResults = {};\n\n if (!keepReadme && otherLane && otherLane.readmeComponent && mergedSuccessfully) {\n const readmeComponentId = otherLane.readmeComponent.id\n .changeVersion(otherLane.readmeComponent?.head?.hash)\n .toString();\n\n deleteResults = await this.remove.remove({\n componentsPattern: readmeComponentId,\n force: false,\n remote: false,\n track: false,\n deleteFiles: true,\n fromLane: false,\n });\n } else if (otherLane && !otherLane.readmeComponent) {\n deleteResults = { readmeResult: `\\nlane ${otherLane.name} doesn't have a readme component` };\n }\n\n await this.workspace.consumer.onDestroy();\n\n return { mergeResults, deleteResults };\n\n function throwForFailures() {\n const failedComponents = allComponentsStatus.filter((c) => c.unmergedMessage && !c.unmergedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unmergedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to merge due to the following failures:\\n${failureMsgs}`);\n }\n }\n }\n\n async mergeFromScope(\n laneName: string,\n options: Partial<MergeLaneOptions> & { push?: boolean }\n ): Promise<{\n mergedPreviously: string[];\n mergedNow: string[];\n exportedIds: string[];\n }> {\n if (this.workspace)\n throw new BitError(\n `unable to run this command from a workspace, please create a new bare-scope and run it from there`\n );\n const laneId = LaneId.parse(laneName);\n const lane = await this.lanes.importLaneObject(laneId);\n const laneIds = lane.toBitIds();\n const scopeComponentsImporter = ScopeComponentsImporter.getInstance(this.scope.legacyScope);\n await scopeComponentsImporter.importManyDeltaWithoutDeps(laneIds, true, lane, true);\n // get their main as well\n await scopeComponentsImporter.importManyDeltaWithoutDeps(laneIds.toVersionLatest(), true, undefined, true);\n const repo = this.scope.legacyScope.objects;\n // loop through all components, make sure they're all ahead of main (it might not be on main yet).\n // then, change the version object to include an extra parent to point to the main.\n // then, change the component object head to point to this changed version\n const mergedPreviously: BitId[] = [];\n const mergedNow: BitId[] = [];\n const bitObjectsPerComp = await pMapSeries(laneIds, async (id) => {\n const modelComponent = await this.scope.legacyScope.getModelComponent(id);\n const versionObj = await modelComponent.loadVersion(id.version as string, repo);\n const laneHead = modelComponent.getRef(id.version as string);\n if (!laneHead) throw new Error(`lane head must be defined for ${id.toString()}`);\n const mainHead = modelComponent.head || null;\n if (mainHead?.isEqual(laneHead)) {\n mergedPreviously.push(id);\n return undefined;\n }\n const divergeData = await getDivergeData({\n repo,\n modelComponent,\n remoteHead: laneHead,\n checkedOutLocalHead: mainHead,\n });\n const modifiedVersion = squashOneComp(DEFAULT_LANE, laneId, id, divergeData, versionObj);\n modelComponent.setHead(laneHead);\n const objects = [modelComponent, modifiedVersion];\n mergedNow.push(id);\n return { id, objects };\n });\n const bitObjects = compact(bitObjectsPerComp).map((b) => b.objects);\n await repo.writeObjectsToTheFS(bitObjects.flat() as BitObject[]);\n let exportedIds: string[] = [];\n if (options.push) {\n const ids = compact(bitObjectsPerComp).map((b) => b.id);\n const bitIds = BitIds.fromArray(ids);\n const { exported } = await this.exporter.exportMany({\n scope: this.scope.legacyScope,\n ids: bitIds,\n idsWithFutureScope: bitIds,\n allVersions: false,\n });\n exportedIds = exported.map((id) => id.toString());\n }\n\n return {\n mergedPreviously: mergedPreviously.map((id) => id.toString()),\n mergedNow: mergedNow.map((id) => id.toString()),\n exportedIds,\n };\n }\n\n static slots = [];\n static dependencies = [\n LanesAspect,\n CLIAspect,\n WorkspaceAspect,\n MergingAspect,\n LoggerAspect,\n RemoveAspect,\n ScopeAspect,\n ExportAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([lanes, cli, workspace, merging, loggerMain, remove, scope, exporter]: [\n LanesMain,\n CLIMain,\n Workspace,\n MergingMain,\n LoggerMain,\n RemoveMain,\n ScopeMain,\n ExportMain\n ]) {\n const logger = loggerMain.createLogger(MergeLanesAspect.id);\n const lanesCommand = cli.getCommand('lane');\n const mergeLanesMain = new MergeLanesMain(workspace, merging, lanes, logger, remove, scope, exporter);\n lanesCommand?.commands?.push(new MergeLaneCmd(mergeLanesMain));\n cli.register(new MergeLaneFromScopeCmd(mergeLanesMain));\n return mergeLanesMain;\n }\n}\n\nasync function filterComponentsStatus(\n allComponentsStatus: ComponentMergeStatus[],\n compIdsToKeep: ComponentID[],\n allBitIds: BitId[],\n workspace: Workspace,\n includeDeps = false,\n lane?: Lane\n): Promise<ComponentMergeStatus[]> {\n const bitIdsFromPattern = BitIds.fromArray(compIdsToKeep.map((c) => c._legacy));\n const bitIdsNotFromPattern = allBitIds.filter((bitId) => !bitIdsFromPattern.hasWithoutVersion(bitId));\n const filteredComponentStatus: ComponentMergeStatus[] = [];\n const depsToAdd: BitId[] = [];\n await pMapSeries(compIdsToKeep, async (compId) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(compId._legacy));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n if (fromStatus.unmergedMessage) {\n return;\n }\n const { divergeData } = fromStatus;\n if (!divergeData) {\n throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);\n }\n const remoteVersions = divergeData.snapsOnRemoteOnly;\n if (!remoteVersions.length) {\n return;\n }\n const modelComponent = await workspace.consumer.scope.getModelComponent(compId._legacy);\n // optimization suggestion: if squash is given, check only the last version.\n await pMapSeries(remoteVersions, async (remoteVersion) => {\n const versionObj = await modelComponent.loadVersion(remoteVersion.toString(), workspace.consumer.scope.objects);\n const flattenedDeps = versionObj.getAllFlattenedDependencies();\n const depsNotIncludeInPattern = flattenedDeps.filter((id) =>\n bitIdsNotFromPattern.find((bitId) => bitId.isEqualWithoutVersion(id))\n );\n if (!depsNotIncludeInPattern.length) {\n return;\n }\n const depsOnLane: BitId[] = [];\n await Promise.all(\n depsNotIncludeInPattern.map(async (dep) => {\n const isOnLane = await workspace.consumer.scope.isIdOnLane(dep, lane);\n if (isOnLane) {\n depsOnLane.push(dep);\n }\n })\n );\n if (!depsOnLane.length) {\n return;\n }\n if (!includeDeps) {\n throw new BitError(`unable to merge ${compId.toString()}.\nit has (in version ${remoteVersion.toString()}) the following dependencies which were not included in the pattern. consider adding \"--include-deps\" flag\n${depsOnLane.map((d) => d.toString()).join('\\n')}`);\n }\n depsToAdd.push(...depsOnLane);\n });\n });\n if (depsToAdd.length) {\n const depsUniq = BitIds.uniqFromArray(depsToAdd);\n depsUniq.forEach((id) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n });\n }\n return filteredComponentStatus;\n}\n\nfunction squashSnaps(allComponentsStatus: ComponentMergeStatus[], otherLaneId: LaneId, consumer: Consumer) {\n const currentLaneName = consumer.getCurrentLaneId().name;\n const succeededComponents = allComponentsStatus.filter((c) => !c.unmergedMessage);\n succeededComponents.forEach(({ id, divergeData, componentFromModel }) => {\n if (!divergeData) {\n throw new Error(`unable to squash. divergeData is missing from ${id.toString()}`);\n }\n const modifiedComp = squashOneComp(currentLaneName, otherLaneId, id, divergeData, componentFromModel);\n if (modifiedComp) consumer.scope.objects.add(modifiedComp);\n });\n}\n\n/**\n * returns Version object if it was modified. otherwise, returns undefined\n */\nfunction squashOneComp(\n currentLaneName: string,\n otherLaneId: LaneId,\n id: BitId,\n divergeData: DivergeData,\n componentFromModel?: Version\n): Version | undefined {\n if (divergeData.isDiverged()) {\n throw new BitError(`unable to squash because ${id.toString()} is diverged in history.\nconsider switching to \"${\n otherLaneId.name\n }\" first, merging \"${currentLaneName}\", then switching back to \"${currentLaneName}\" and merging \"${\n otherLaneId.name\n }\"\nalternatively, use \"--no-squash\" flag to keep the entire history of \"${otherLaneId.name}\"`);\n }\n if (divergeData.isLocalAhead()) {\n // nothing to do. current is ahead, nothing to merge. (it was probably filtered out already as a \"failedComponent\")\n return undefined;\n }\n if (!divergeData.isRemoteAhead()) {\n // nothing to do. current and remote are the same, nothing to merge. (it was probably filtered out already as a \"failedComponent\")\n return undefined;\n }\n // remote is ahead and was not diverge.\n const remoteSnaps = divergeData.snapsOnRemoteOnly;\n if (remoteSnaps.length === 0) {\n throw new Error(`remote is ahead but it has no snaps. it's impossible`);\n }\n // no need to check this case. even if it has only one snap ahead, we want to do the \"squash\", and run \"addAsOnlyParent\"\n // to make sure it doesn't not have two parents.\n // if (remoteSnaps.length === 1) {\n // // nothing to squash. it has only one commit.\n // return;\n // }\n if (!componentFromModel) {\n throw new Error('unable to squash, the componentFromModel is missing');\n }\n\n const currentParents = componentFromModel.parents;\n\n // do the squash.\n if (divergeData.commonSnapBeforeDiverge) {\n componentFromModel.addAsOnlyParent(divergeData.commonSnapBeforeDiverge);\n } else {\n // there is no commonSnapBeforeDiverge. the local has no snaps, all are remote, no need for parents. keep only head.\n componentFromModel.parents.forEach((ref) => componentFromModel.removeParent(ref));\n }\n componentFromModel.setSquashed({ previousParents: currentParents, laneId: otherLaneId });\n return componentFromModel;\n}\n\nMergeLanesAspect.addRuntime(MergeLanesMain);\n\nexport default MergeLanesMain;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IA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AA6BA,eAAgB,kBAChFvK,WAAW,CAACwE,IACb;AACL,uEAAuExE,WAAW,CAACwE,IAAK,GAAE,CAAC;EACzF;EACA,IAAIgC,WAAW,CAACqE,YAAY,EAAE,EAAE;IAC9B;IACA,OAAOtK,SAAS;EAClB;EACA,IAAI,CAACiG,WAAW,CAACsE,aAAa,EAAE,EAAE;IAChC;IACA,OAAOvK,SAAS;EAClB;EACA;EACA,MAAMwK,WAAW,GAAGvE,WAAW,CAACmD,iBAAiB;EACjD,IAAIoB,WAAW,CAACvH,MAAM,KAAK,CAAC,EAAE;IAC5B,MAAM,IAAI5C,KAAK,CAAE,sDAAqD,CAAC;EACzE;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAI,CAAC6J,kBAAkB,EAAE;IACvB,MAAM,IAAI7J,KAAK,CAAC,qDAAqD,CAAC;EACxE;EAEA,MAAMoK,cAAc,GAAGP,kBAAkB,CAACQ,OAAO;;EAEjD;EACA,IAAIzE,WAAW,CAAC0E,uBAAuB,EAAE;IACvCT,kBAAkB,CAACU,eAAe,CAAC3E,WAAW,CAAC0E,uBAAuB,CAAC;EACzE,CAAC,MAAM;IACL;IACAT,kBAAkB,CAACQ,OAAO,CAAC7I,OAAO,CAAEgJ,GAAG,IAAKX,kBAAkB,CAACY,YAAY,CAACD,GAAG,CAAC,CAAC;EACnF;EACAX,kBAAkB,CAACa,WAAW,CAAC;IAAEC,eAAe,EAAEP,cAAc;IAAE5H,MAAM,EAAEpD;EAAY,CAAC,CAAC;EACxF,OAAOyK,kBAAkB;AAC3B;AAEAzC,8BAAgB,CAACwD,UAAU,CAACxN,cAAc,CAAC;AAAC,eAE7BA,cAAc;AAAA"}
|
Binary file
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/merge-lanes",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.59",
|
4
4
|
"homepage": "https://bit.dev/teambit/lanes/merge-lanes",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.lanes",
|
8
8
|
"name": "merge-lanes",
|
9
|
-
"version": "0.0.
|
9
|
+
"version": "0.0.59"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "2.4.2",
|
@@ -16,17 +16,17 @@
|
|
16
16
|
"core-js": "^3.0.0",
|
17
17
|
"@teambit/harmony": "0.3.3",
|
18
18
|
"@teambit/bit-error": "0.0.400",
|
19
|
-
"@teambit/cli": "0.0.
|
20
|
-
"@teambit/merging": "0.0.
|
19
|
+
"@teambit/cli": "0.0.591",
|
20
|
+
"@teambit/merging": "0.0.197",
|
21
21
|
"@teambit/component-id": "0.0.418",
|
22
|
-
"@teambit/export": "0.0.
|
23
|
-
"@teambit/lane-id": "0.0.
|
24
|
-
"@teambit/lanes": "0.0.
|
22
|
+
"@teambit/export": "0.0.882",
|
23
|
+
"@teambit/lane-id": "0.0.109",
|
24
|
+
"@teambit/lanes": "0.0.454",
|
25
25
|
"@teambit/legacy-bit-id": "0.0.414",
|
26
|
-
"@teambit/logger": "0.0.
|
27
|
-
"@teambit/remove": "0.0.
|
28
|
-
"@teambit/scope": "0.0.
|
29
|
-
"@teambit/workspace": "0.0.
|
26
|
+
"@teambit/logger": "0.0.684",
|
27
|
+
"@teambit/remove": "0.0.59",
|
28
|
+
"@teambit/scope": "0.0.882",
|
29
|
+
"@teambit/workspace": "0.0.882"
|
30
30
|
},
|
31
31
|
"devDependencies": {
|
32
32
|
"@types/lodash": "4.14.165",
|
@@ -38,7 +38,7 @@
|
|
38
38
|
"@types/node": "12.20.4"
|
39
39
|
},
|
40
40
|
"peerDependencies": {
|
41
|
-
"@teambit/legacy": "1.0.
|
41
|
+
"@teambit/legacy": "1.0.374",
|
42
42
|
"react-dom": "^16.8.0 || ^17.0.0",
|
43
43
|
"react": "^16.8.0 || ^17.0.0"
|
44
44
|
},
|
File without changes
|
Binary file
|