@teambit/merging 0.0.0-eaf913ca46effcb8ff9b877448fd09b87df7cdcd → 0.0.0-eb5529db44f2883f5e1ec0022ee8b8d4e2615e86
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.d.ts +5 -5
- package/dist/index.js +14 -68
- package/dist/index.js.map +1 -1
- package/dist/merge-cmd.d.ts +5 -21
- package/dist/merge-cmd.js +42 -136
- package/dist/merge-cmd.js.map +1 -1
- package/dist/merge-status-provider.d.ts +9 -8
- package/dist/merge-status-provider.js +15 -10
- package/dist/merge-status-provider.js.map +1 -1
- package/dist/merging.main.runtime.d.ts +34 -58
- package/dist/merging.main.runtime.js +105 -16
- package/dist/merging.main.runtime.js.map +1 -1
- package/package.json +30 -37
- package/dist/merge-files.d.ts +0 -31
- package/dist/merge-files.js +0 -86
- package/dist/merge-files.js.map +0 -1
- package/dist/merge-version/index.d.ts +0 -2
- package/dist/merge-version/index.js +0 -63
- package/dist/merge-version/index.js.map +0 -1
- package/dist/merge-version/merge-version.d.ts +0 -25
- package/dist/merge-version/merge-version.js +0 -76
- package/dist/merge-version/merge-version.js.map +0 -1
- package/dist/merge-version/three-way-merge.d.ts +0 -65
- package/dist/merge-version/three-way-merge.js +0 -254
- package/dist/merge-version/three-way-merge.js.map +0 -1
- package/merge-version/index.ts +0 -8
- package/merge-version/merge-version.ts +0 -41
- package/merge-version/three-way-merge.ts +0 -242
- /package/dist/{preview-1753283985481.js → preview-1773778468246.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MergingAspect } from './merging.aspect';
|
|
2
|
-
export { mergeReport
|
|
3
|
-
export { compIsAlreadyMergedMsg } from './merge-status-provider';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export
|
|
2
|
+
export { mergeReport } from './merge-cmd';
|
|
3
|
+
export { compIsAlreadyMergedMsg, compHasBeenRemovedMsg } from './merge-status-provider';
|
|
4
|
+
export type { MergingMain, ComponentMergeStatus } from './merging.main.runtime';
|
|
5
|
+
export type { ApplyVersionResult, ApplyVersionResults, FailedComponents, FilesStatus, } from '@teambit/component.modules.merge-helper';
|
|
6
|
+
export { FileStatus, getMergeStrategyInteractive, getMergeStrategy, MergeOptions, MergeStrategy, threeWayMerge, MergeResultsThreeWay, } from '@teambit/component.modules.merge-helper';
|
|
7
7
|
export default MergingAspect;
|
|
8
8
|
export { MergingAspect };
|
package/dist/index.js
CHANGED
|
@@ -6,37 +6,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "FileStatus", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "MergeFileParams", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _mergeFiles().MergeFileParams;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "MergeFileResult", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _mergeFiles().MergeFileResult;
|
|
9
|
+
return _componentModules().FileStatus;
|
|
22
10
|
}
|
|
23
11
|
});
|
|
24
12
|
Object.defineProperty(exports, "MergeOptions", {
|
|
25
13
|
enumerable: true,
|
|
26
14
|
get: function () {
|
|
27
|
-
return
|
|
15
|
+
return _componentModules().MergeOptions;
|
|
28
16
|
}
|
|
29
17
|
});
|
|
30
18
|
Object.defineProperty(exports, "MergeResultsThreeWay", {
|
|
31
19
|
enumerable: true,
|
|
32
20
|
get: function () {
|
|
33
|
-
return
|
|
21
|
+
return _componentModules().MergeResultsThreeWay;
|
|
34
22
|
}
|
|
35
23
|
});
|
|
36
24
|
Object.defineProperty(exports, "MergeStrategy", {
|
|
37
25
|
enumerable: true,
|
|
38
26
|
get: function () {
|
|
39
|
-
return
|
|
27
|
+
return _componentModules().MergeStrategy;
|
|
40
28
|
}
|
|
41
29
|
});
|
|
42
30
|
Object.defineProperty(exports, "MergingAspect", {
|
|
@@ -45,10 +33,10 @@ Object.defineProperty(exports, "MergingAspect", {
|
|
|
45
33
|
return _merging().MergingAspect;
|
|
46
34
|
}
|
|
47
35
|
});
|
|
48
|
-
Object.defineProperty(exports, "
|
|
36
|
+
Object.defineProperty(exports, "compHasBeenRemovedMsg", {
|
|
49
37
|
enumerable: true,
|
|
50
38
|
get: function () {
|
|
51
|
-
return
|
|
39
|
+
return _mergeStatusProvider().compHasBeenRemovedMsg;
|
|
52
40
|
}
|
|
53
41
|
});
|
|
54
42
|
Object.defineProperty(exports, "compIsAlreadyMergedMsg", {
|
|
@@ -57,53 +45,17 @@ Object.defineProperty(exports, "compIsAlreadyMergedMsg", {
|
|
|
57
45
|
return _mergeStatusProvider().compIsAlreadyMergedMsg;
|
|
58
46
|
}
|
|
59
47
|
});
|
|
60
|
-
Object.defineProperty(exports, "compilationErrorOutput", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function () {
|
|
63
|
-
return _mergeCmd().compilationErrorOutput;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
Object.defineProperty(exports, "conflictSummaryReport", {
|
|
67
|
-
enumerable: true,
|
|
68
|
-
get: function () {
|
|
69
|
-
return _mergeCmd().conflictSummaryReport;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
48
|
exports.default = void 0;
|
|
73
|
-
Object.defineProperty(exports, "
|
|
49
|
+
Object.defineProperty(exports, "getMergeStrategy", {
|
|
74
50
|
enumerable: true,
|
|
75
51
|
get: function () {
|
|
76
|
-
return
|
|
52
|
+
return _componentModules().getMergeStrategy;
|
|
77
53
|
}
|
|
78
54
|
});
|
|
79
55
|
Object.defineProperty(exports, "getMergeStrategyInteractive", {
|
|
80
56
|
enumerable: true,
|
|
81
57
|
get: function () {
|
|
82
|
-
return
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
Object.defineProperty(exports, "getRemovedOutput", {
|
|
86
|
-
enumerable: true,
|
|
87
|
-
get: function () {
|
|
88
|
-
return _mergeCmd().getRemovedOutput;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
Object.defineProperty(exports, "getWorkspaceConfigUpdateOutput", {
|
|
92
|
-
enumerable: true,
|
|
93
|
-
get: function () {
|
|
94
|
-
return _mergeCmd().getWorkspaceConfigUpdateOutput;
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
Object.defineProperty(exports, "installationErrorOutput", {
|
|
98
|
-
enumerable: true,
|
|
99
|
-
get: function () {
|
|
100
|
-
return _mergeCmd().installationErrorOutput;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
Object.defineProperty(exports, "mergeFiles", {
|
|
104
|
-
enumerable: true,
|
|
105
|
-
get: function () {
|
|
106
|
-
return _mergeFiles().mergeFiles;
|
|
58
|
+
return _componentModules().getMergeStrategyInteractive;
|
|
107
59
|
}
|
|
108
60
|
});
|
|
109
61
|
Object.defineProperty(exports, "mergeReport", {
|
|
@@ -115,7 +67,7 @@ Object.defineProperty(exports, "mergeReport", {
|
|
|
115
67
|
Object.defineProperty(exports, "threeWayMerge", {
|
|
116
68
|
enumerable: true,
|
|
117
69
|
get: function () {
|
|
118
|
-
return
|
|
70
|
+
return _componentModules().threeWayMerge;
|
|
119
71
|
}
|
|
120
72
|
});
|
|
121
73
|
function _merging() {
|
|
@@ -139,20 +91,14 @@ function _mergeStatusProvider() {
|
|
|
139
91
|
};
|
|
140
92
|
return data;
|
|
141
93
|
}
|
|
142
|
-
function
|
|
143
|
-
const data = require("
|
|
144
|
-
|
|
145
|
-
return data;
|
|
146
|
-
};
|
|
147
|
-
return data;
|
|
148
|
-
}
|
|
149
|
-
function _mergeFiles() {
|
|
150
|
-
const data = require("./merge-files");
|
|
151
|
-
_mergeFiles = function () {
|
|
94
|
+
function _componentModules() {
|
|
95
|
+
const data = require("@teambit/component.modules.merge-helper");
|
|
96
|
+
_componentModules = function () {
|
|
152
97
|
return data;
|
|
153
98
|
};
|
|
154
99
|
return data;
|
|
155
100
|
}
|
|
101
|
+
// Re-export types and functions from merge-helper for backward compatibility
|
|
156
102
|
var _default = exports.default = _merging().MergingAspect;
|
|
157
103
|
|
|
158
104
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_merging","data","require","_mergeCmd","_mergeStatusProvider","
|
|
1
|
+
{"version":3,"names":["_merging","data","require","_mergeCmd","_mergeStatusProvider","_componentModules","_default","exports","default","MergingAspect"],"sources":["index.ts"],"sourcesContent":["import { MergingAspect } from './merging.aspect';\n\nexport { mergeReport } from './merge-cmd';\nexport { compIsAlreadyMergedMsg, compHasBeenRemovedMsg } from './merge-status-provider';\nexport type { MergingMain, ComponentMergeStatus } from './merging.main.runtime';\n\n// Re-export types and functions from merge-helper for backward compatibility\nexport type {\n ApplyVersionResult,\n ApplyVersionResults,\n FailedComponents,\n FilesStatus,\n} from '@teambit/component.modules.merge-helper';\nexport {\n FileStatus,\n getMergeStrategyInteractive,\n getMergeStrategy,\n MergeOptions,\n MergeStrategy,\n threeWayMerge,\n MergeResultsThreeWay,\n} from '@teambit/component.modules.merge-helper';\n\nexport default MergingAspect;\nexport { MergingAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,qBAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,oBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAUA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,iBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAPA;AAAA,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAiBeC,wBAAa","ignoreList":[]}
|
package/dist/merge-cmd.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { ConfigStoreMain } from '@teambit/config-store';
|
|
1
|
+
import type { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
+
import type { ConfigMergeResult } from '@teambit/config-merger';
|
|
3
|
+
import { type MergeStrategy, type ApplyVersionResults } from '@teambit/component.modules.merge-helper';
|
|
4
|
+
import type { MergingMain } from './merging.main.runtime';
|
|
5
|
+
import type { ConfigStoreMain } from '@teambit/config-store';
|
|
7
6
|
export declare class MergeCmd implements Command {
|
|
8
7
|
private merging;
|
|
9
8
|
private configStore;
|
|
@@ -37,18 +36,3 @@ export declare class MergeCmd implements Command {
|
|
|
37
36
|
export declare function mergeReport({ components, failedComponents, removedComponents, version, mergeSnapResults, mergeSnapError, leftUnresolvedConflicts, verbose, configMergeResults, workspaceConfigUpdateResult, }: ApplyVersionResults & {
|
|
38
37
|
configMergeResults?: ConfigMergeResult[];
|
|
39
38
|
}): string;
|
|
40
|
-
export declare function getWorkspaceConfigUpdateOutput(workspaceConfigUpdateResult?: WorkspaceConfigUpdateResult): string;
|
|
41
|
-
/**
|
|
42
|
-
* shows only the file-changes section.
|
|
43
|
-
* if all files are "unchanged", it returns an empty string
|
|
44
|
-
*/
|
|
45
|
-
export declare function applyVersionReport(components: ApplyVersionResult[], addName?: boolean, showVersion?: boolean): string;
|
|
46
|
-
export declare function conflictSummaryReport(components: ApplyVersionResult[]): {
|
|
47
|
-
conflictedComponents: number;
|
|
48
|
-
conflictedFiles: number;
|
|
49
|
-
conflictStr: string;
|
|
50
|
-
};
|
|
51
|
-
export declare function installationErrorOutput(installationError?: Error): string;
|
|
52
|
-
export declare function compilationErrorOutput(compilationError?: Error): string;
|
|
53
|
-
export declare function getRemovedOutput(removedComponents?: ComponentID[]): string;
|
|
54
|
-
export declare function getAddedOutput(addedComponents?: ComponentID[]): string;
|
package/dist/merge-cmd.js
CHANGED
|
@@ -4,13 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.MergeCmd = void 0;
|
|
7
|
-
exports.applyVersionReport = applyVersionReport;
|
|
8
|
-
exports.compilationErrorOutput = compilationErrorOutput;
|
|
9
|
-
exports.conflictSummaryReport = conflictSummaryReport;
|
|
10
|
-
exports.getAddedOutput = getAddedOutput;
|
|
11
|
-
exports.getRemovedOutput = getRemovedOutput;
|
|
12
|
-
exports.getWorkspaceConfigUpdateOutput = getWorkspaceConfigUpdateOutput;
|
|
13
|
-
exports.installationErrorOutput = installationErrorOutput;
|
|
14
7
|
exports.mergeReport = mergeReport;
|
|
15
8
|
function _chalk() {
|
|
16
9
|
const data = _interopRequireDefault(require("chalk"));
|
|
@@ -40,9 +33,16 @@ function _bitError() {
|
|
|
40
33
|
};
|
|
41
34
|
return data;
|
|
42
35
|
}
|
|
43
|
-
function
|
|
44
|
-
const data = require("
|
|
45
|
-
|
|
36
|
+
function _componentModules() {
|
|
37
|
+
const data = require("@teambit/component.modules.merge-helper");
|
|
38
|
+
_componentModules = function () {
|
|
39
|
+
return data;
|
|
40
|
+
};
|
|
41
|
+
return data;
|
|
42
|
+
}
|
|
43
|
+
function _mergeStatusProvider() {
|
|
44
|
+
const data = require("./merge-status-provider");
|
|
45
|
+
_mergeStatusProvider = function () {
|
|
46
46
|
return data;
|
|
47
47
|
};
|
|
48
48
|
return data;
|
|
@@ -56,17 +56,18 @@ class MergeCmd {
|
|
|
56
56
|
this.merging = merging;
|
|
57
57
|
this.configStore = configStore;
|
|
58
58
|
_defineProperty(this, "name", 'merge [component-pattern]');
|
|
59
|
-
_defineProperty(this, "description", 'merge
|
|
59
|
+
_defineProperty(this, "description", 'merge diverged component history when local and remote have different versions');
|
|
60
60
|
_defineProperty(this, "helpUrl", 'reference/components/merging-changes');
|
|
61
61
|
_defineProperty(this, "group", 'version-control');
|
|
62
62
|
_defineProperty(this, "arguments", [{
|
|
63
63
|
name: 'component-pattern',
|
|
64
64
|
description: _legacy().COMPONENT_PATTERN_HELP
|
|
65
65
|
}]);
|
|
66
|
-
_defineProperty(this, "extendedDescription", `
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
_defineProperty(this, "extendedDescription", `resolves diverged component history when both local and remote have created different snaps/tags from the same base version.
|
|
67
|
+
if no component pattern is specified, all pending-merge components will be merged (run 'bit status' to list them).
|
|
68
|
+
'bit status' will show diverged components and suggest either merging or resetting local changes.
|
|
69
|
+
preferred approach: use 'bit reset' to remove local versions, then 'bit checkout head' to get remote versions.
|
|
70
|
+
for lane-to-lane merging, use 'bit lane merge' instead.`);
|
|
70
71
|
_defineProperty(this, "alias", '');
|
|
71
72
|
_defineProperty(this, "options", [['', 'ours', 'DEPRECATED. use --auto-merge-resolve. in case of a conflict, keep the local modification'], ['', 'theirs', 'DEPRECATED. use --auto-merge-resolve. in case of a conflict, override the local modification with the specified version'], ['', 'manual', 'same as "--auto-merge-resolve manual". in case of merge conflict, write the files with the conflict markers'], ['r', 'auto-merge-resolve <merge-strategy>', 'in case of a conflict, resolve according to the strategy: [ours, theirs, manual]'], ['', 'abort', 'in case of an unresolved merge, revert to pre-merge state'], ['', 'resolve', 'mark an unresolved merge as resolved and create a new snap with the changes'], ['', 'no-snap', 'do not auto snap even if the merge completed without conflicts'], ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'], ['', 'verbose', 'show details of components that were not merged successfully'], ['x', 'skip-dependency-installation', 'do not install new dependencies resulting from the merge'], ['m', 'message <message>', 'override the default message for the auto snap']]);
|
|
72
73
|
_defineProperty(this, "loader", true);
|
|
@@ -139,7 +140,7 @@ function mergeReport({
|
|
|
139
140
|
const getSuccessOutput = () => {
|
|
140
141
|
if (!components || !components.length) return '';
|
|
141
142
|
const title = `successfully merged ${components.length} components${version ? `from version ${_chalk().default.bold(version)}` : ''}\n`;
|
|
142
|
-
const fileChangesReport = applyVersionReport(components);
|
|
143
|
+
const fileChangesReport = (0, _componentModules().applyVersionReport)(components);
|
|
143
144
|
return _chalk().default.bold(title) + fileChangesReport;
|
|
144
145
|
};
|
|
145
146
|
let componentsWithConflicts = 0;
|
|
@@ -148,7 +149,7 @@ function mergeReport({
|
|
|
148
149
|
const title = `files with conflicts summary\n`;
|
|
149
150
|
const suggestion = `\n\nmerge process not completed due to the conflicts above. fix conflicts manually and then run "bit install".
|
|
150
151
|
once ready, snap/tag the components to complete the merge.`;
|
|
151
|
-
const conflictSummary = conflictSummaryReport(components);
|
|
152
|
+
const conflictSummary = (0, _componentModules().conflictSummaryReport)(components);
|
|
152
153
|
componentsWithConflicts = conflictSummary.conflictedComponents;
|
|
153
154
|
return _chalk().default.underline(title) + conflictSummary.conflictStr + _chalk().default.yellow(suggestion);
|
|
154
155
|
};
|
|
@@ -187,17 +188,30 @@ ${mergeSnapError.message}
|
|
|
187
188
|
};
|
|
188
189
|
const getFailureOutput = () => {
|
|
189
190
|
if (!failedComponents || !failedComponents.length) return '';
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
(
|
|
191
|
+
// always show removed components - the user needs to know about these
|
|
192
|
+
const skippedRemoved = failedComponents.filter(fc => fc.unchangedMessage === _mergeStatusProvider().compHasBeenRemovedMsg);
|
|
193
|
+
const otherComponents = failedComponents.filter(fc => fc.unchangedMessage !== _mergeStatusProvider().compHasBeenRemovedMsg);
|
|
194
|
+
const parts = [];
|
|
195
|
+
if (skippedRemoved.length) {
|
|
196
|
+
const removedTitle = _chalk().default.yellow(`\nmerge skipped for ${skippedRemoved.length} soft-removed component(s):`);
|
|
197
|
+
const removedBody = skippedRemoved.map(fc => `${_chalk().default.bold(fc.id.toString())}`).join('\n');
|
|
198
|
+
const removedHint = _chalk().default.yellow(`(use "bit recover <component-id>" to restore, then re-run the merge)`);
|
|
199
|
+
parts.push(`${removedTitle}\n${removedBody}\n${removedHint}`);
|
|
200
|
+
}
|
|
201
|
+
if (otherComponents.length) {
|
|
202
|
+
const title = '\nmerge skipped for the following component(s)';
|
|
203
|
+
const body = (0, _lodash().compact)(otherComponents.map(failedComponent => {
|
|
204
|
+
// all failures here are "unchangedLegitimately". otherwise, it would have been thrown as an error
|
|
205
|
+
if (!verbose) return null;
|
|
206
|
+
return `${_chalk().default.bold(failedComponent.id.toString())} - ${_chalk().default.white(failedComponent.unchangedMessage)}`;
|
|
207
|
+
})).join('\n');
|
|
208
|
+
if (!body) {
|
|
209
|
+
parts.push(`${_chalk().default.bold(`\nmerge skipped legitimately for ${otherComponents.length} component(s)`)}\n(use --verbose to list them next time)`);
|
|
210
|
+
} else {
|
|
211
|
+
parts.push(`${_chalk().default.underline(title)}\n${body}`);
|
|
212
|
+
}
|
|
199
213
|
}
|
|
200
|
-
return
|
|
214
|
+
return parts.join('\n');
|
|
201
215
|
};
|
|
202
216
|
const getSummary = () => {
|
|
203
217
|
const merged = components?.length || 0;
|
|
@@ -217,115 +231,7 @@ ${mergeSnapError.message}
|
|
|
217
231
|
const conflictStr = `\nConflicts: ${_chalk().default.bold(getConflictStr() || 'none')}`;
|
|
218
232
|
return title + mergedStr + unchangedLegitimatelyStr + autoSnappedStr + removedStr + conflictStr;
|
|
219
233
|
};
|
|
220
|
-
return (0, _lodash().compact)([getSuccessOutput(), getFailureOutput(), getRemovedOutput(removedComponents), getSnapsOutput(), getConfigMergeConflictSummary(), getWorkspaceConfigUpdateOutput(workspaceConfigUpdateResult), getConflictSummary(), getSummary()]).join('\n\n');
|
|
221
|
-
}
|
|
222
|
-
function getWorkspaceConfigUpdateOutput(workspaceConfigUpdateResult) {
|
|
223
|
-
if (!workspaceConfigUpdateResult) return '';
|
|
224
|
-
const {
|
|
225
|
-
workspaceConfigConflictWriteError,
|
|
226
|
-
workspaceDepsConflicts,
|
|
227
|
-
workspaceDepsUpdates,
|
|
228
|
-
workspaceDepsUnchanged
|
|
229
|
-
} = workspaceConfigUpdateResult;
|
|
230
|
-
const getWorkspaceConflictsOutput = () => {
|
|
231
|
-
if (!workspaceDepsConflicts && !workspaceConfigConflictWriteError) return '';
|
|
232
|
-
if (workspaceConfigConflictWriteError) {
|
|
233
|
-
return `${_chalk().default.red(workspaceConfigConflictWriteError.message)}`;
|
|
234
|
-
}
|
|
235
|
-
return _chalk().default.yellow('workspace.jsonc has conflicts, please edit the file and fix them');
|
|
236
|
-
};
|
|
237
|
-
const getWorkspaceUnchangedDepsOutput = () => {
|
|
238
|
-
if (!workspaceDepsUnchanged) return '';
|
|
239
|
-
const title = '\nworkspace.jsonc was unable to update the following dependencies';
|
|
240
|
-
const body = Object.keys(workspaceDepsUnchanged).map(pkgName => {
|
|
241
|
-
return ` ${pkgName}: ${workspaceDepsUnchanged[pkgName]}`;
|
|
242
|
-
}).join('\n');
|
|
243
|
-
return `${_chalk().default.underline(title)}\n${body}`;
|
|
244
|
-
};
|
|
245
|
-
return (0, _lodash().compact)([getWorkspaceUnchangedDepsOutput(), getWorkspaceDepsOutput(workspaceDepsUpdates), getWorkspaceConflictsOutput()]).join('\n\n');
|
|
246
|
-
}
|
|
247
|
-
function getWorkspaceDepsOutput(workspaceDepsUpdates) {
|
|
248
|
-
if (!workspaceDepsUpdates) return '';
|
|
249
|
-
const title = '\nworkspace.jsonc has been updated with the following dependencies';
|
|
250
|
-
const body = Object.keys(workspaceDepsUpdates).map(pkgName => {
|
|
251
|
-
const [from, to] = workspaceDepsUpdates[pkgName];
|
|
252
|
-
return ` ${pkgName}: ${from} => ${to}`;
|
|
253
|
-
}).join('\n');
|
|
254
|
-
return `${_chalk().default.underline(title)}\n${body}`;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* shows only the file-changes section.
|
|
259
|
-
* if all files are "unchanged", it returns an empty string
|
|
260
|
-
*/
|
|
261
|
-
function applyVersionReport(components, addName = true, showVersion = false) {
|
|
262
|
-
const tab = addName ? '\t' : '';
|
|
263
|
-
const fileChanges = (0, _lodash().compact)(components.map(component => {
|
|
264
|
-
const name = showVersion ? component.id.toString() : component.id.toStringWithoutVersion();
|
|
265
|
-
const files = (0, _lodash().compact)(Object.keys(component.filesStatus).map(file => {
|
|
266
|
-
if (component.filesStatus[file] === _mergeVersion().FileStatus.unchanged) return null;
|
|
267
|
-
const note = component.filesStatus[file] === _mergeVersion().FileStatus.manual ? _chalk().default.white('automatic merge failed. please fix conflicts manually and then run "bit install"') : '';
|
|
268
|
-
return `${tab}${String(component.filesStatus[file])} ${_chalk().default.bold(file)} ${note}`;
|
|
269
|
-
})).join('\n');
|
|
270
|
-
if (!files) return null;
|
|
271
|
-
return `${addName ? name : ''}\n${_chalk().default.cyan(files)}`;
|
|
272
|
-
})).join('\n\n');
|
|
273
|
-
if (!fileChanges) {
|
|
274
|
-
return '';
|
|
275
|
-
}
|
|
276
|
-
const title = `\n${_legacy().FILE_CHANGES_CHECKOUT_MSG}\n`;
|
|
277
|
-
return _chalk().default.underline(title) + fileChanges;
|
|
278
|
-
}
|
|
279
|
-
function conflictSummaryReport(components) {
|
|
280
|
-
const tab = '\t';
|
|
281
|
-
let conflictedComponents = 0;
|
|
282
|
-
let conflictedFiles = 0;
|
|
283
|
-
const conflictStr = (0, _lodash().compact)(components.map(component => {
|
|
284
|
-
const name = component.id.toStringWithoutVersion();
|
|
285
|
-
const files = (0, _lodash().compact)(Object.keys(component.filesStatus).map(file => {
|
|
286
|
-
if (component.filesStatus[file] === _mergeVersion().FileStatus.manual) {
|
|
287
|
-
conflictedFiles += 1;
|
|
288
|
-
return `${tab}${String(component.filesStatus[file])} ${_chalk().default.bold(file)}`;
|
|
289
|
-
}
|
|
290
|
-
return null;
|
|
291
|
-
}));
|
|
292
|
-
if (!files.length) return null;
|
|
293
|
-
conflictedComponents += 1;
|
|
294
|
-
return `${name}\n${_chalk().default.cyan(files.join('\n'))}`;
|
|
295
|
-
})).join('\n');
|
|
296
|
-
return {
|
|
297
|
-
conflictedComponents,
|
|
298
|
-
conflictedFiles,
|
|
299
|
-
conflictStr
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
function installationErrorOutput(installationError) {
|
|
303
|
-
if (!installationError) return '';
|
|
304
|
-
const title = _chalk().default.underline('Installation Error');
|
|
305
|
-
const subTitle = 'The following error was thrown by the package manager:';
|
|
306
|
-
const body = _chalk().default.red(installationError.message);
|
|
307
|
-
const suggestion = 'Use "bit install" to complete the installation, remove the imported components using "bit remove <comp id>" or remove the missing dependencies from their source code';
|
|
308
|
-
return `${title}\n${subTitle}\n${body}\n${suggestion}`;
|
|
309
|
-
}
|
|
310
|
-
function compilationErrorOutput(compilationError) {
|
|
311
|
-
if (!compilationError) return '';
|
|
312
|
-
const title = _chalk().default.underline('Compilation Error');
|
|
313
|
-
const subTitle = 'The following error was thrown by the compiler';
|
|
314
|
-
const body = _chalk().default.red(compilationError.message);
|
|
315
|
-
const suggestion = 'Please fix the issue and run "bit compile"';
|
|
316
|
-
return `${title}\n${subTitle}\n${body}\n${suggestion}`;
|
|
317
|
-
}
|
|
318
|
-
function getRemovedOutput(removedComponents) {
|
|
319
|
-
if (!removedComponents?.length) return '';
|
|
320
|
-
const title = `the following ${removedComponents.length} component(s) have been removed`;
|
|
321
|
-
const body = removedComponents.join('\n');
|
|
322
|
-
return `${_chalk().default.underline(title)}\n${body}`;
|
|
323
|
-
}
|
|
324
|
-
function getAddedOutput(addedComponents) {
|
|
325
|
-
if (!addedComponents?.length) return '';
|
|
326
|
-
const title = `the following ${addedComponents.length} component(s) have been added`;
|
|
327
|
-
const body = addedComponents.join('\n');
|
|
328
|
-
return `${_chalk().default.underline(title)}\n${body}`;
|
|
234
|
+
return (0, _lodash().compact)([getSuccessOutput(), getFailureOutput(), (0, _componentModules().getRemovedOutput)(removedComponents), getSnapsOutput(), getConfigMergeConflictSummary(), (0, _componentModules().getWorkspaceConfigUpdateOutput)(workspaceConfigUpdateResult), getConflictSummary(), getSummary()]).join('\n\n');
|
|
329
235
|
}
|
|
330
236
|
|
|
331
237
|
//# sourceMappingURL=merge-cmd.js.map
|
package/dist/merge-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_legacy","_bitError","_mergeVersion","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","MergeCmd","constructor","merging","configStore","name","description","COMPONENT_PATTERN_HELP","report","pattern","ours","theirs","manual","autoMergeResolve","abort","resolve","build","noSnap","verbose","message","skipDependencyInstallation","getConfigBoolean","CFG_FORCE_LOCAL_BUILD","Boolean","BitError","components","failedComponents","version","resolvedComponents","abortedComponents","mergeSnapResults","mergeSnapError","merge","title","componentsStr","map","c","id","toStringWithoutVersion","join","chalk","underline","green","mergeReport","exports","removedComponents","leftUnresolvedConflicts","configMergeResults","workspaceConfigUpdateResult","getSuccessOutput","length","bold","fileChangesReport","applyVersionReport","componentsWithConflicts","getConflictSummary","suggestion","conflictSummary","conflictSummaryReport","conflictedComponents","conflictStr","yellow","configMergeWithConflicts","filter","hasConflicts","getConfigMergeConflictSummary","comps","compIdStr","MergeConfigFilename","getSnapsOutput","snappedComponents","autoSnappedResults","outputComponents","component","componentOutput","toString","autoTag","result","triggeredBy","searchWithoutVersion","autoTagComp","a","AUTO_SNAPPED_MSG","getFailureOutput","body","compact","failedComponent","white","unchangedMessage","getSummary","merged","unchangedLegitimately","f","autoSnapped","getConflictStr","ws","workspaceDepsConflicts","mergeConfig","mergedStr","unchangedLegitimatelyStr","autoSnappedStr","removedStr","getRemovedOutput","getWorkspaceConfigUpdateOutput","workspaceConfigConflictWriteError","workspaceDepsUpdates","workspaceDepsUnchanged","getWorkspaceConflictsOutput","red","getWorkspaceUnchangedDepsOutput","keys","pkgName","getWorkspaceDepsOutput","from","to","addName","showVersion","tab","fileChanges","files","filesStatus","file","FileStatus","unchanged","note","cyan","FILE_CHANGES_CHECKOUT_MSG","conflictedFiles","installationErrorOutput","installationError","subTitle","compilationErrorOutput","compilationError","getAddedOutput","addedComponents"],"sources":["merge-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { ComponentID } from '@teambit/component-id';\nimport { compact } from 'lodash';\nimport {\n COMPONENT_PATTERN_HELP,\n AUTO_SNAPPED_MSG,\n MergeConfigFilename,\n FILE_CHANGES_CHECKOUT_MSG,\n CFG_FORCE_LOCAL_BUILD,\n} from '@teambit/legacy.constants';\nimport { ConfigMergeResult, WorkspaceConfigUpdateResult, WorkspaceDepsUpdates } from '@teambit/config-merger';\nimport { BitError } from '@teambit/bit-error';\nimport { FileStatus, MergeStrategy } from './merge-version';\nimport { ApplyVersionResults, MergingMain, ApplyVersionResult } from './merging.main.runtime';\nimport { ConfigStoreMain } from '@teambit/config-store';\n\nexport class MergeCmd implements Command {\n name = 'merge [component-pattern]';\n description = 'merge changes of the remote head into local - auto-snaps all merged components';\n helpUrl = 'reference/components/merging-changes';\n group = 'version-control';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n extendedDescription = `merge changes of the remote head into local when they are diverged. when on a lane, merge the remote head of the lane into the local\nand creates snaps for merged components that have diverged, on the lane.\nif no ids are specified, all pending-merge components will be merged. (run \"bit status\" to list them).\noptionally use '--abort' to revert the last merge. to revert a lane merge, use \"bit lane merge-abort\" command.`;\n alias = '';\n options = [\n ['', 'ours', 'DEPRECATED. use --auto-merge-resolve. in case of a conflict, keep the local modification'],\n [\n '',\n 'theirs',\n 'DEPRECATED. use --auto-merge-resolve. in case of a conflict, override the local modification with the specified version',\n ],\n [\n '',\n 'manual',\n 'same as \"--auto-merge-resolve manual\". in case of merge conflict, write the files with the conflict markers',\n ],\n [\n 'r',\n 'auto-merge-resolve <merge-strategy>',\n 'in case of a conflict, resolve according to the strategy: [ours, theirs, manual]',\n ],\n ['', 'abort', 'in case of an unresolved merge, revert to pre-merge state'],\n ['', 'resolve', 'mark an unresolved merge as resolved and create a new snap with the changes'],\n ['', 'no-snap', 'do not auto snap even if the merge completed without conflicts'],\n ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'],\n ['', 'verbose', 'show details of components that were not merged successfully'],\n ['x', 'skip-dependency-installation', 'do not install new dependencies resulting from the merge'],\n ['m', 'message <message>', 'override the default message for the auto snap'],\n ] as CommandOptions;\n loader = true;\n\n constructor(\n private merging: MergingMain,\n private configStore: ConfigStoreMain\n ) {}\n\n async report(\n [pattern]: [string],\n {\n ours = false,\n theirs = false,\n manual = false,\n autoMergeResolve,\n abort = false,\n resolve = false,\n build = false,\n noSnap = false,\n verbose = false,\n message,\n skipDependencyInstallation = false,\n }: {\n ours?: boolean;\n theirs?: boolean;\n manual?: boolean;\n autoMergeResolve?: MergeStrategy;\n abort?: boolean;\n resolve?: boolean;\n build?: boolean;\n noSnap?: boolean;\n verbose?: boolean;\n message: string;\n skipDependencyInstallation?: boolean;\n }\n ) {\n build = this.configStore.getConfigBoolean(CFG_FORCE_LOCAL_BUILD) || Boolean(build);\n if (ours || theirs) {\n throw new BitError('the \"--ours\" and \"--theirs\" flags are deprecated. use \"--auto-merge-resolve\" instead');\n }\n if (\n autoMergeResolve &&\n autoMergeResolve !== 'ours' &&\n autoMergeResolve !== 'theirs' &&\n autoMergeResolve !== 'manual'\n ) {\n throw new BitError('--auto-merge-resolve must be one of the following: [ours, theirs, manual]');\n }\n if (manual) autoMergeResolve = 'manual';\n if (abort && resolve) throw new BitError('unable to use \"abort\" and \"resolve\" flags together');\n if (noSnap && message) throw new BitError('unable to use \"noSnap\" and \"message\" flags together');\n const {\n components,\n failedComponents,\n version,\n resolvedComponents,\n abortedComponents,\n mergeSnapResults,\n mergeSnapError,\n }: ApplyVersionResults = await this.merging.merge(\n pattern,\n autoMergeResolve as any,\n abort,\n resolve,\n noSnap,\n message,\n build,\n skipDependencyInstallation\n );\n if (resolvedComponents) {\n const title = 'successfully resolved component(s)\\n';\n const componentsStr = resolvedComponents.map((c) => c.id.toStringWithoutVersion()).join('\\n');\n return chalk.underline(title) + chalk.green(componentsStr);\n }\n if (abortedComponents) {\n const title = 'successfully aborted the merge of the following component(s)\\n';\n const componentsStr = abortedComponents.map((c) => c.id.toStringWithoutVersion()).join('\\n');\n return chalk.underline(title) + chalk.green(componentsStr);\n }\n\n return mergeReport({\n components,\n failedComponents,\n version,\n mergeSnapResults,\n mergeSnapError,\n verbose,\n });\n }\n}\n\nexport function mergeReport({\n components,\n failedComponents,\n removedComponents,\n version,\n mergeSnapResults,\n mergeSnapError,\n leftUnresolvedConflicts,\n verbose,\n configMergeResults,\n workspaceConfigUpdateResult,\n}: ApplyVersionResults & { configMergeResults?: ConfigMergeResult[] }): string {\n const getSuccessOutput = () => {\n if (!components || !components.length) return '';\n const title = `successfully merged ${components.length} components${\n version ? `from version ${chalk.bold(version)}` : ''\n }\\n`;\n const fileChangesReport = applyVersionReport(components);\n\n return chalk.bold(title) + fileChangesReport;\n };\n\n let componentsWithConflicts = 0;\n const getConflictSummary = () => {\n if (!components || !components.length || !leftUnresolvedConflicts) return '';\n const title = `files with conflicts summary\\n`;\n const suggestion = `\\n\\nmerge process not completed due to the conflicts above. fix conflicts manually and then run \"bit install\".\nonce ready, snap/tag the components to complete the merge.`;\n const conflictSummary = conflictSummaryReport(components);\n componentsWithConflicts = conflictSummary.conflictedComponents;\n return chalk.underline(title) + conflictSummary.conflictStr + chalk.yellow(suggestion);\n };\n\n const configMergeWithConflicts = configMergeResults?.filter((c) => c.hasConflicts()) || [];\n const getConfigMergeConflictSummary = () => {\n if (!configMergeWithConflicts.length) return '';\n const comps = configMergeWithConflicts.map((c) => c.compIdStr).join('\\n');\n const title = `components with config-merge conflicts\\n`;\n const suggestion = `\\nconflicts were found while trying to merge the config. fix them manually by editing the ${MergeConfigFilename} file in the workspace root.\nonce ready, snap/tag the components to complete the merge.`;\n return chalk.underline(title) + comps + chalk.yellow(suggestion);\n };\n\n const getSnapsOutput = () => {\n if (mergeSnapError) {\n return `${chalk.bold(\n 'snapping merged components failed with the following error, please fix the issues and snap manually'\n )}\n${mergeSnapError.message}\n`;\n }\n if (!mergeSnapResults || !mergeSnapResults.snappedComponents) return '';\n const { snappedComponents, autoSnappedResults } = mergeSnapResults;\n const outputComponents = (comps) => {\n return comps\n .map((component) => {\n let componentOutput = ` > ${component.id.toString()}`;\n const autoTag = autoSnappedResults.filter((result) => result.triggeredBy.searchWithoutVersion(component.id));\n if (autoTag.length) {\n const autoTagComp = autoTag.map((a) => a.component.id.toString());\n componentOutput += `\\n ${AUTO_SNAPPED_MSG}: ${autoTagComp.join(', ')}`;\n }\n return componentOutput;\n })\n .join('\\n');\n };\n\n return `${chalk.underline(\n 'merge-snapped components'\n )}\\n(${'components snapped as a result of the merge'})\\n${outputComponents(snappedComponents)}`;\n };\n\n const getFailureOutput = () => {\n if (!failedComponents || !failedComponents.length) return '';\n const title = '\\nmerge skipped for the following component(s)';\n const body = compact(\n failedComponents.map((failedComponent) => {\n // all failures here are \"unchangedLegitimately\". otherwise, it would have been thrown as an error\n if (!verbose) return null;\n return `${chalk.bold(failedComponent.id.toString())} - ${chalk.white(failedComponent.unchangedMessage)}`;\n })\n ).join('\\n');\n if (!body) {\n return `${chalk.bold(`\\nmerge skipped legitimately for ${failedComponents.length} component(s)`)}\n(use --verbose to list them next time)`;\n }\n return `${chalk.underline(title)}\\n${body}`;\n };\n\n const getSummary = () => {\n const merged = components?.length || 0;\n const unchangedLegitimately = failedComponents?.filter((f) => f.unchangedLegitimately).length || 0;\n const autoSnapped =\n (mergeSnapResults?.snappedComponents.length || 0) + (mergeSnapResults?.autoSnappedResults.length || 0);\n const getConflictStr = () => {\n const comps = componentsWithConflicts ? `${componentsWithConflicts} components` : '';\n const ws = workspaceConfigUpdateResult?.workspaceDepsConflicts ? 'workspace.jsonc file' : '';\n const mergeConfig = configMergeWithConflicts.length ? `${MergeConfigFilename} file` : '';\n return compact([comps, ws, mergeConfig]).join(', ');\n };\n\n const title = chalk.bold.underline('Merge Summary');\n const mergedStr = `\\nTotal Merged: ${chalk.bold(merged.toString())}`;\n const unchangedLegitimatelyStr = `\\nTotal Unchanged: ${chalk.bold(unchangedLegitimately.toString())}`;\n const autoSnappedStr = `\\nTotal Snapped: ${chalk.bold(autoSnapped.toString())}`;\n const removedStr = `\\nTotal Removed: ${chalk.bold(removedComponents?.length.toString() || '0')}`;\n const conflictStr = `\\nConflicts: ${chalk.bold(getConflictStr() || 'none')}`;\n\n return title + mergedStr + unchangedLegitimatelyStr + autoSnappedStr + removedStr + conflictStr;\n };\n\n return compact([\n getSuccessOutput(),\n getFailureOutput(),\n getRemovedOutput(removedComponents),\n getSnapsOutput(),\n getConfigMergeConflictSummary(),\n getWorkspaceConfigUpdateOutput(workspaceConfigUpdateResult),\n getConflictSummary(),\n getSummary(),\n ]).join('\\n\\n');\n}\n\nexport function getWorkspaceConfigUpdateOutput(workspaceConfigUpdateResult?: WorkspaceConfigUpdateResult): string {\n if (!workspaceConfigUpdateResult) return '';\n const { workspaceConfigConflictWriteError, workspaceDepsConflicts, workspaceDepsUpdates, workspaceDepsUnchanged } =\n workspaceConfigUpdateResult;\n\n const getWorkspaceConflictsOutput = () => {\n if (!workspaceDepsConflicts && !workspaceConfigConflictWriteError) return '';\n if (workspaceConfigConflictWriteError) {\n return `${chalk.red(workspaceConfigConflictWriteError.message)}`;\n }\n return chalk.yellow('workspace.jsonc has conflicts, please edit the file and fix them');\n };\n\n const getWorkspaceUnchangedDepsOutput = () => {\n if (!workspaceDepsUnchanged) return '';\n const title = '\\nworkspace.jsonc was unable to update the following dependencies';\n const body = Object.keys(workspaceDepsUnchanged)\n .map((pkgName) => {\n return ` ${pkgName}: ${workspaceDepsUnchanged[pkgName]}`;\n })\n .join('\\n');\n\n return `${chalk.underline(title)}\\n${body}`;\n };\n\n return compact([\n getWorkspaceUnchangedDepsOutput(),\n getWorkspaceDepsOutput(workspaceDepsUpdates),\n getWorkspaceConflictsOutput(),\n ]).join('\\n\\n');\n}\n\nfunction getWorkspaceDepsOutput(workspaceDepsUpdates?: WorkspaceDepsUpdates): string {\n if (!workspaceDepsUpdates) return '';\n\n const title = '\\nworkspace.jsonc has been updated with the following dependencies';\n const body = Object.keys(workspaceDepsUpdates)\n .map((pkgName) => {\n const [from, to] = workspaceDepsUpdates[pkgName];\n return ` ${pkgName}: ${from} => ${to}`;\n })\n .join('\\n');\n\n return `${chalk.underline(title)}\\n${body}`;\n}\n\n/**\n * shows only the file-changes section.\n * if all files are \"unchanged\", it returns an empty string\n */\nexport function applyVersionReport(components: ApplyVersionResult[], addName = true, showVersion = false): string {\n const tab = addName ? '\\t' : '';\n const fileChanges = compact(\n components.map((component: ApplyVersionResult) => {\n const name = showVersion ? component.id.toString() : component.id.toStringWithoutVersion();\n const files = compact(\n Object.keys(component.filesStatus).map((file) => {\n if (component.filesStatus[file] === FileStatus.unchanged) return null;\n const note =\n component.filesStatus[file] === FileStatus.manual\n ? chalk.white('automatic merge failed. please fix conflicts manually and then run \"bit install\"')\n : '';\n return `${tab}${String(component.filesStatus[file])} ${chalk.bold(file)} ${note}`;\n })\n ).join('\\n');\n if (!files) return null;\n return `${addName ? name : ''}\\n${chalk.cyan(files)}`;\n })\n ).join('\\n\\n');\n if (!fileChanges) {\n return '';\n }\n const title = `\\n${FILE_CHANGES_CHECKOUT_MSG}\\n`;\n return chalk.underline(title) + fileChanges;\n}\n\nexport function conflictSummaryReport(components: ApplyVersionResult[]): {\n conflictedComponents: number;\n conflictedFiles: number;\n conflictStr: string;\n} {\n const tab = '\\t';\n let conflictedComponents = 0;\n let conflictedFiles = 0;\n const conflictStr = compact(\n components.map((component: ApplyVersionResult) => {\n const name = component.id.toStringWithoutVersion();\n const files = compact(\n Object.keys(component.filesStatus).map((file) => {\n if (component.filesStatus[file] === FileStatus.manual) {\n conflictedFiles += 1;\n return `${tab}${String(component.filesStatus[file])} ${chalk.bold(file)}`;\n }\n return null;\n })\n );\n if (!files.length) return null;\n conflictedComponents += 1;\n return `${name}\\n${chalk.cyan(files.join('\\n'))}`;\n })\n ).join('\\n');\n\n return { conflictedComponents, conflictedFiles, conflictStr };\n}\n\nexport function installationErrorOutput(installationError?: Error) {\n if (!installationError) return '';\n const title = chalk.underline('Installation Error');\n const subTitle = 'The following error was thrown by the package manager:';\n const body = chalk.red(installationError.message);\n const suggestion =\n 'Use \"bit install\" to complete the installation, remove the imported components using \"bit remove <comp id>\" or remove the missing dependencies from their source code';\n return `${title}\\n${subTitle}\\n${body}\\n${suggestion}`;\n}\n\nexport function compilationErrorOutput(compilationError?: Error) {\n if (!compilationError) return '';\n const title = chalk.underline('Compilation Error');\n const subTitle = 'The following error was thrown by the compiler';\n const body = chalk.red(compilationError.message);\n const suggestion = 'Please fix the issue and run \"bit compile\"';\n return `${title}\\n${subTitle}\\n${body}\\n${suggestion}`;\n}\n\nexport function getRemovedOutput(removedComponents?: ComponentID[]) {\n if (!removedComponents?.length) return '';\n const title = `the following ${removedComponents.length} component(s) have been removed`;\n const body = removedComponents.join('\\n');\n return `${chalk.underline(title)}\\n${body}`;\n}\n\nexport function getAddedOutput(addedComponents?: ComponentID[]) {\n if (!addedComponents?.length) return '';\n const title = `the following ${addedComponents.length} component(s) have been added`;\n const body = addedComponents.join('\\n');\n return `${chalk.underline(title)}\\n${body}`;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAA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MAAMjB,KAAK,GAAG,iBAAiBY,iBAAiB,CAACK,MAAM,iCAAiC;EACxF,MAAMkC,IAAI,GAAGvC,iBAAiB,CAACN,IAAI,CAAC,IAAI,CAAC;EACzC,OAAO,GAAGC,gBAAK,CAACC,SAAS,CAACR,KAAK,CAAC,KAAKmD,IAAI,EAAE;AAC7C;AAEO,SAASiD,cAAcA,CAACC,eAA+B,EAAE;EAC9D,IAAI,CAACA,eAAe,EAAEpF,MAAM,EAAE,OAAO,EAAE;EACvC,MAAMjB,KAAK,GAAG,iBAAiBqG,eAAe,CAACpF,MAAM,+BAA+B;EACpF,MAAMkC,IAAI,GAAGkD,eAAe,CAAC/F,IAAI,CAAC,IAAI,CAAC;EACvC,OAAO,GAAGC,gBAAK,CAACC,SAAS,CAACR,KAAK,CAAC,KAAKmD,IAAI,EAAE;AAC7C","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_legacy","_bitError","_componentModules","_mergeStatusProvider","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","MergeCmd","constructor","merging","configStore","name","description","COMPONENT_PATTERN_HELP","report","pattern","ours","theirs","manual","autoMergeResolve","abort","resolve","build","noSnap","verbose","message","skipDependencyInstallation","getConfigBoolean","CFG_FORCE_LOCAL_BUILD","Boolean","BitError","components","failedComponents","version","resolvedComponents","abortedComponents","mergeSnapResults","mergeSnapError","merge","title","componentsStr","map","c","id","toStringWithoutVersion","join","chalk","underline","green","mergeReport","exports","removedComponents","leftUnresolvedConflicts","configMergeResults","workspaceConfigUpdateResult","getSuccessOutput","length","bold","fileChangesReport","applyVersionReport","componentsWithConflicts","getConflictSummary","suggestion","conflictSummary","conflictSummaryReport","conflictedComponents","conflictStr","yellow","configMergeWithConflicts","filter","hasConflicts","getConfigMergeConflictSummary","comps","compIdStr","MergeConfigFilename","getSnapsOutput","snappedComponents","autoSnappedResults","outputComponents","component","componentOutput","toString","autoTag","result","triggeredBy","searchWithoutVersion","autoTagComp","a","AUTO_SNAPPED_MSG","getFailureOutput","skippedRemoved","fc","unchangedMessage","compHasBeenRemovedMsg","otherComponents","parts","removedTitle","removedBody","removedHint","push","body","compact","failedComponent","white","getSummary","merged","unchangedLegitimately","f","autoSnapped","getConflictStr","ws","workspaceDepsConflicts","mergeConfig","mergedStr","unchangedLegitimatelyStr","autoSnappedStr","removedStr","getRemovedOutput","getWorkspaceConfigUpdateOutput"],"sources":["merge-cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport type { Command, CommandOptions } from '@teambit/cli';\nimport { compact } from 'lodash';\nimport {\n COMPONENT_PATTERN_HELP,\n AUTO_SNAPPED_MSG,\n MergeConfigFilename,\n CFG_FORCE_LOCAL_BUILD,\n} from '@teambit/legacy.constants';\nimport type { ConfigMergeResult } from '@teambit/config-merger';\nimport { BitError } from '@teambit/bit-error';\nimport {\n type MergeStrategy,\n type ApplyVersionResults,\n applyVersionReport,\n conflictSummaryReport,\n getRemovedOutput,\n getWorkspaceConfigUpdateOutput,\n} from '@teambit/component.modules.merge-helper';\nimport type { MergingMain } from './merging.main.runtime';\nimport { compHasBeenRemovedMsg } from './merge-status-provider';\nimport type { ConfigStoreMain } from '@teambit/config-store';\n\nexport class MergeCmd implements Command {\n name = 'merge [component-pattern]';\n description = 'merge diverged component history when local and remote have different versions';\n helpUrl = 'reference/components/merging-changes';\n group = 'version-control';\n arguments = [{ name: 'component-pattern', description: COMPONENT_PATTERN_HELP }];\n extendedDescription = `resolves diverged component history when both local and remote have created different snaps/tags from the same base version.\nif no component pattern is specified, all pending-merge components will be merged (run 'bit status' to list them).\n'bit status' will show diverged components and suggest either merging or resetting local changes.\npreferred approach: use 'bit reset' to remove local versions, then 'bit checkout head' to get remote versions.\nfor lane-to-lane merging, use 'bit lane merge' instead.`;\n alias = '';\n options = [\n ['', 'ours', 'DEPRECATED. use --auto-merge-resolve. in case of a conflict, keep the local modification'],\n [\n '',\n 'theirs',\n 'DEPRECATED. use --auto-merge-resolve. in case of a conflict, override the local modification with the specified version',\n ],\n [\n '',\n 'manual',\n 'same as \"--auto-merge-resolve manual\". in case of merge conflict, write the files with the conflict markers',\n ],\n [\n 'r',\n 'auto-merge-resolve <merge-strategy>',\n 'in case of a conflict, resolve according to the strategy: [ours, theirs, manual]',\n ],\n ['', 'abort', 'in case of an unresolved merge, revert to pre-merge state'],\n ['', 'resolve', 'mark an unresolved merge as resolved and create a new snap with the changes'],\n ['', 'no-snap', 'do not auto snap even if the merge completed without conflicts'],\n ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'],\n ['', 'verbose', 'show details of components that were not merged successfully'],\n ['x', 'skip-dependency-installation', 'do not install new dependencies resulting from the merge'],\n ['m', 'message <message>', 'override the default message for the auto snap'],\n ] as CommandOptions;\n loader = true;\n\n constructor(\n private merging: MergingMain,\n private configStore: ConfigStoreMain\n ) {}\n\n async report(\n [pattern]: [string],\n {\n ours = false,\n theirs = false,\n manual = false,\n autoMergeResolve,\n abort = false,\n resolve = false,\n build = false,\n noSnap = false,\n verbose = false,\n message,\n skipDependencyInstallation = false,\n }: {\n ours?: boolean;\n theirs?: boolean;\n manual?: boolean;\n autoMergeResolve?: MergeStrategy;\n abort?: boolean;\n resolve?: boolean;\n build?: boolean;\n noSnap?: boolean;\n verbose?: boolean;\n message: string;\n skipDependencyInstallation?: boolean;\n }\n ) {\n build = this.configStore.getConfigBoolean(CFG_FORCE_LOCAL_BUILD) || Boolean(build);\n if (ours || theirs) {\n throw new BitError('the \"--ours\" and \"--theirs\" flags are deprecated. use \"--auto-merge-resolve\" instead');\n }\n if (\n autoMergeResolve &&\n autoMergeResolve !== 'ours' &&\n autoMergeResolve !== 'theirs' &&\n autoMergeResolve !== 'manual'\n ) {\n throw new BitError('--auto-merge-resolve must be one of the following: [ours, theirs, manual]');\n }\n if (manual) autoMergeResolve = 'manual';\n if (abort && resolve) throw new BitError('unable to use \"abort\" and \"resolve\" flags together');\n if (noSnap && message) throw new BitError('unable to use \"noSnap\" and \"message\" flags together');\n const {\n components,\n failedComponents,\n version,\n resolvedComponents,\n abortedComponents,\n mergeSnapResults,\n mergeSnapError,\n }: ApplyVersionResults = await this.merging.merge(\n pattern,\n autoMergeResolve as any,\n abort,\n resolve,\n noSnap,\n message,\n build,\n skipDependencyInstallation\n );\n if (resolvedComponents) {\n const title = 'successfully resolved component(s)\\n';\n const componentsStr = resolvedComponents.map((c) => c.id.toStringWithoutVersion()).join('\\n');\n return chalk.underline(title) + chalk.green(componentsStr);\n }\n if (abortedComponents) {\n const title = 'successfully aborted the merge of the following component(s)\\n';\n const componentsStr = abortedComponents.map((c) => c.id.toStringWithoutVersion()).join('\\n');\n return chalk.underline(title) + chalk.green(componentsStr);\n }\n\n return mergeReport({\n components,\n failedComponents,\n version,\n mergeSnapResults,\n mergeSnapError,\n verbose,\n });\n }\n}\n\nexport function mergeReport({\n components,\n failedComponents,\n removedComponents,\n version,\n mergeSnapResults,\n mergeSnapError,\n leftUnresolvedConflicts,\n verbose,\n configMergeResults,\n workspaceConfigUpdateResult,\n}: ApplyVersionResults & { configMergeResults?: ConfigMergeResult[] }): string {\n const getSuccessOutput = () => {\n if (!components || !components.length) return '';\n const title = `successfully merged ${components.length} components${\n version ? `from version ${chalk.bold(version)}` : ''\n }\\n`;\n const fileChangesReport = applyVersionReport(components);\n\n return chalk.bold(title) + fileChangesReport;\n };\n\n let componentsWithConflicts = 0;\n const getConflictSummary = () => {\n if (!components || !components.length || !leftUnresolvedConflicts) return '';\n const title = `files with conflicts summary\\n`;\n const suggestion = `\\n\\nmerge process not completed due to the conflicts above. fix conflicts manually and then run \"bit install\".\nonce ready, snap/tag the components to complete the merge.`;\n const conflictSummary = conflictSummaryReport(components);\n componentsWithConflicts = conflictSummary.conflictedComponents;\n return chalk.underline(title) + conflictSummary.conflictStr + chalk.yellow(suggestion);\n };\n\n const configMergeWithConflicts = configMergeResults?.filter((c) => c.hasConflicts()) || [];\n const getConfigMergeConflictSummary = () => {\n if (!configMergeWithConflicts.length) return '';\n const comps = configMergeWithConflicts.map((c) => c.compIdStr).join('\\n');\n const title = `components with config-merge conflicts\\n`;\n const suggestion = `\\nconflicts were found while trying to merge the config. fix them manually by editing the ${MergeConfigFilename} file in the workspace root.\nonce ready, snap/tag the components to complete the merge.`;\n return chalk.underline(title) + comps + chalk.yellow(suggestion);\n };\n\n const getSnapsOutput = () => {\n if (mergeSnapError) {\n return `${chalk.bold(\n 'snapping merged components failed with the following error, please fix the issues and snap manually'\n )}\n${mergeSnapError.message}\n`;\n }\n if (!mergeSnapResults || !mergeSnapResults.snappedComponents) return '';\n const { snappedComponents, autoSnappedResults } = mergeSnapResults;\n const outputComponents = (comps) => {\n return comps\n .map((component) => {\n let componentOutput = ` > ${component.id.toString()}`;\n const autoTag = autoSnappedResults.filter((result) => result.triggeredBy.searchWithoutVersion(component.id));\n if (autoTag.length) {\n const autoTagComp = autoTag.map((a) => a.component.id.toString());\n componentOutput += `\\n ${AUTO_SNAPPED_MSG}: ${autoTagComp.join(', ')}`;\n }\n return componentOutput;\n })\n .join('\\n');\n };\n\n return `${chalk.underline(\n 'merge-snapped components'\n )}\\n(${'components snapped as a result of the merge'})\\n${outputComponents(snappedComponents)}`;\n };\n\n const getFailureOutput = () => {\n if (!failedComponents || !failedComponents.length) return '';\n // always show removed components - the user needs to know about these\n const skippedRemoved = failedComponents.filter((fc) => fc.unchangedMessage === compHasBeenRemovedMsg);\n const otherComponents = failedComponents.filter((fc) => fc.unchangedMessage !== compHasBeenRemovedMsg);\n\n const parts: string[] = [];\n\n if (skippedRemoved.length) {\n const removedTitle = chalk.yellow(`\\nmerge skipped for ${skippedRemoved.length} soft-removed component(s):`);\n const removedBody = skippedRemoved.map((fc) => `${chalk.bold(fc.id.toString())}`).join('\\n');\n const removedHint = chalk.yellow(`(use \"bit recover <component-id>\" to restore, then re-run the merge)`);\n parts.push(`${removedTitle}\\n${removedBody}\\n${removedHint}`);\n }\n\n if (otherComponents.length) {\n const title = '\\nmerge skipped for the following component(s)';\n const body = compact(\n otherComponents.map((failedComponent) => {\n // all failures here are \"unchangedLegitimately\". otherwise, it would have been thrown as an error\n if (!verbose) return null;\n return `${chalk.bold(failedComponent.id.toString())} - ${chalk.white(failedComponent.unchangedMessage)}`;\n })\n ).join('\\n');\n if (!body) {\n parts.push(\n `${chalk.bold(`\\nmerge skipped legitimately for ${otherComponents.length} component(s)`)}\\n(use --verbose to list them next time)`\n );\n } else {\n parts.push(`${chalk.underline(title)}\\n${body}`);\n }\n }\n\n return parts.join('\\n');\n };\n\n const getSummary = () => {\n const merged = components?.length || 0;\n const unchangedLegitimately = failedComponents?.filter((f) => f.unchangedLegitimately).length || 0;\n const autoSnapped =\n (mergeSnapResults?.snappedComponents.length || 0) + (mergeSnapResults?.autoSnappedResults.length || 0);\n const getConflictStr = () => {\n const comps = componentsWithConflicts ? `${componentsWithConflicts} components` : '';\n const ws = workspaceConfigUpdateResult?.workspaceDepsConflicts ? 'workspace.jsonc file' : '';\n const mergeConfig = configMergeWithConflicts.length ? `${MergeConfigFilename} file` : '';\n return compact([comps, ws, mergeConfig]).join(', ');\n };\n\n const title = chalk.bold.underline('Merge Summary');\n const mergedStr = `\\nTotal Merged: ${chalk.bold(merged.toString())}`;\n const unchangedLegitimatelyStr = `\\nTotal Unchanged: ${chalk.bold(unchangedLegitimately.toString())}`;\n const autoSnappedStr = `\\nTotal Snapped: ${chalk.bold(autoSnapped.toString())}`;\n const removedStr = `\\nTotal Removed: ${chalk.bold(removedComponents?.length.toString() || '0')}`;\n const conflictStr = `\\nConflicts: ${chalk.bold(getConflictStr() || 'none')}`;\n\n return title + mergedStr + unchangedLegitimatelyStr + autoSnappedStr + removedStr + conflictStr;\n };\n\n return compact([\n getSuccessOutput(),\n getFailureOutput(),\n getRemovedOutput(removedComponents),\n getSnapsOutput(),\n getConfigMergeConflictSummary(),\n getWorkspaceConfigUpdateOutput(workspaceConfigUp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
|
-
import { ComponentID } from '@teambit/component-id';
|
|
3
|
-
import { Lane } from '@teambit/objects';
|
|
4
|
-
import { ImporterMain } from '@teambit/importer';
|
|
5
|
-
import { Logger } from '@teambit/logger';
|
|
6
|
-
import { ScopeMain } from '@teambit/scope';
|
|
7
|
-
import { MergeStrategy } from '
|
|
8
|
-
import { ComponentMergeStatus } from './merging.main.runtime';
|
|
1
|
+
import type { Workspace } from '@teambit/workspace';
|
|
2
|
+
import type { ComponentID } from '@teambit/component-id';
|
|
3
|
+
import type { Lane } from '@teambit/objects';
|
|
4
|
+
import type { ImporterMain } from '@teambit/importer';
|
|
5
|
+
import type { Logger } from '@teambit/logger';
|
|
6
|
+
import type { ScopeMain } from '@teambit/scope';
|
|
7
|
+
import type { MergeStrategy } from '@teambit/component.modules.merge-helper';
|
|
8
|
+
import type { ComponentMergeStatus } from './merging.main.runtime';
|
|
9
9
|
export type MergeStatusProviderOptions = {
|
|
10
10
|
resolveUnrelated?: MergeStrategy;
|
|
11
11
|
mergeStrategy: MergeStrategy;
|
|
@@ -22,6 +22,7 @@ export type DataMergeResult = {
|
|
|
22
22
|
conflictedAspects?: ConflictedDataAspects;
|
|
23
23
|
};
|
|
24
24
|
export declare const compIsAlreadyMergedMsg = "component is already merged";
|
|
25
|
+
export declare const compHasBeenRemovedMsg = "component has been removed";
|
|
25
26
|
export declare class MergeStatusProvider {
|
|
26
27
|
private scope;
|
|
27
28
|
private logger;
|