@teambit/merging 1.0.137 → 1.0.139
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 +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/merge-cmd.d.ts +3 -2
- package/dist/merge-cmd.js +47 -38
- package/dist/merge-cmd.js.map +1 -1
- package/dist/merging.main.runtime.d.ts +2 -4
- package/dist/merging.main.runtime.js +8 -6
- package/dist/merging.main.runtime.js.map +1 -1
- package/package.json +11 -11
- /package/dist/{preview-1705406853442.js → preview-1705577037962.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MergingAspect } from './merging.aspect';
|
|
2
|
-
export { mergeReport, applyVersionReport, conflictSummaryReport, installationErrorOutput, compilationErrorOutput, getRemovedOutput, getAddedOutput, } from './merge-cmd';
|
|
2
|
+
export { mergeReport, applyVersionReport, conflictSummaryReport, installationErrorOutput, compilationErrorOutput, getRemovedOutput, getAddedOutput, getWorkspaceConfigUpdateOutput, } from './merge-cmd';
|
|
3
3
|
export type { MergingMain, ComponentMergeStatus, ApplyVersionResults, ApplyVersionResult, FilesStatus, FailedComponents, } from './merging.main.runtime';
|
|
4
4
|
export default MergingAspect;
|
|
5
5
|
export { MergingAspect };
|
package/dist/index.js
CHANGED
|
@@ -40,6 +40,12 @@ Object.defineProperty(exports, "getRemovedOutput", {
|
|
|
40
40
|
return _mergeCmd().getRemovedOutput;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
+
Object.defineProperty(exports, "getWorkspaceConfigUpdateOutput", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _mergeCmd().getWorkspaceConfigUpdateOutput;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
43
49
|
Object.defineProperty(exports, "installationErrorOutput", {
|
|
44
50
|
enumerable: true,
|
|
45
51
|
get: function () {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_merging","data","require","_mergeCmd","_default","exports","default","MergingAspect"],"sources":["index.ts"],"sourcesContent":["import { MergingAspect } from './merging.aspect';\n\nexport {\n mergeReport,\n applyVersionReport,\n conflictSummaryReport,\n installationErrorOutput,\n compilationErrorOutput,\n getRemovedOutput,\n getAddedOutput,\n} from './merge-cmd';\nexport type {\n MergingMain,\n ComponentMergeStatus,\n ApplyVersionResults,\n ApplyVersionResult,\n FilesStatus,\n FailedComponents,\n} from './merging.main.runtime';\nexport default MergingAspect;\nexport { MergingAspect };\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_merging","data","require","_mergeCmd","_default","exports","default","MergingAspect"],"sources":["index.ts"],"sourcesContent":["import { MergingAspect } from './merging.aspect';\n\nexport {\n mergeReport,\n applyVersionReport,\n conflictSummaryReport,\n installationErrorOutput,\n compilationErrorOutput,\n getRemovedOutput,\n getAddedOutput,\n getWorkspaceConfigUpdateOutput,\n} from './merge-cmd';\nexport type {\n MergingMain,\n ComponentMergeStatus,\n ApplyVersionResults,\n ApplyVersionResult,\n FilesStatus,\n FailedComponents,\n} from './merging.main.runtime';\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;AASqB,IAAAG,QAAA,GAAAC,OAAA,CAAAC,OAAA,GASNC,wBAAa"}
|
package/dist/merge-cmd.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Command, CommandOptions } from '@teambit/cli';
|
|
|
2
2
|
import { ComponentID } from '@teambit/component-id';
|
|
3
3
|
import { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';
|
|
4
4
|
import { GlobalConfigMain } from '@teambit/global-config';
|
|
5
|
-
import { ConfigMergeResult } from '@teambit/config-merger';
|
|
5
|
+
import { ConfigMergeResult, WorkspaceConfigUpdateResult } from '@teambit/config-merger';
|
|
6
6
|
import { ApplyVersionResults, MergingMain, ApplyVersionResult } from './merging.main.runtime';
|
|
7
7
|
export declare class MergeCmd implements Command {
|
|
8
8
|
private merging;
|
|
@@ -30,9 +30,10 @@ export declare class MergeCmd implements Command {
|
|
|
30
30
|
skipDependencyInstallation?: boolean;
|
|
31
31
|
}): Promise<string>;
|
|
32
32
|
}
|
|
33
|
-
export declare function mergeReport({ components, failedComponents, removedComponents, version, mergeSnapResults, mergeSnapError, leftUnresolvedConflicts, verbose, configMergeResults,
|
|
33
|
+
export declare function mergeReport({ components, failedComponents, removedComponents, version, mergeSnapResults, mergeSnapError, leftUnresolvedConflicts, verbose, configMergeResults, workspaceConfigUpdateResult, }: ApplyVersionResults & {
|
|
34
34
|
configMergeResults?: ConfigMergeResult[];
|
|
35
35
|
}): string;
|
|
36
|
+
export declare function getWorkspaceConfigUpdateOutput(workspaceConfigUpdateResult?: WorkspaceConfigUpdateResult): string;
|
|
36
37
|
/**
|
|
37
38
|
* shows only the file-changes section.
|
|
38
39
|
* if all files are "unchanged", it returns an empty string
|
package/dist/merge-cmd.js
CHANGED
|
@@ -9,6 +9,7 @@ exports.compilationErrorOutput = compilationErrorOutput;
|
|
|
9
9
|
exports.conflictSummaryReport = conflictSummaryReport;
|
|
10
10
|
exports.getAddedOutput = getAddedOutput;
|
|
11
11
|
exports.getRemovedOutput = getRemovedOutput;
|
|
12
|
+
exports.getWorkspaceConfigUpdateOutput = getWorkspaceConfigUpdateOutput;
|
|
12
13
|
exports.installationErrorOutput = installationErrorOutput;
|
|
13
14
|
exports.mergeReport = mergeReport;
|
|
14
15
|
function _chalk() {
|
|
@@ -64,7 +65,7 @@ if no ids are specified, all pending-merge components will be merged. (run "bit
|
|
|
64
65
|
optionally use '--abort' to revert the last merge. to revert a lane merge, use "bit lane merge-abort" command.
|
|
65
66
|
${(0, _constants().WILDCARD_HELP)('merge')}`);
|
|
66
67
|
_defineProperty(this, "alias", '');
|
|
67
|
-
_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', '
|
|
68
|
+
_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'], ['', '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']]);
|
|
68
69
|
_defineProperty(this, "loader", true);
|
|
69
70
|
}
|
|
70
71
|
async report([ids = []], {
|
|
@@ -81,12 +82,13 @@ ${(0, _constants().WILDCARD_HELP)('merge')}`);
|
|
|
81
82
|
skipDependencyInstallation = false
|
|
82
83
|
}) {
|
|
83
84
|
build = (await this.globalConfig.getBool(_constants().CFG_FORCE_LOCAL_BUILD)) || Boolean(build);
|
|
84
|
-
if (ours || theirs
|
|
85
|
-
throw new (_bitError().BitError)('the "--ours"
|
|
85
|
+
if (ours || theirs) {
|
|
86
|
+
throw new (_bitError().BitError)('the "--ours" and "--theirs" flags are deprecated. use "--auto-merge-resolve" instead');
|
|
86
87
|
}
|
|
87
88
|
if (autoMergeResolve && autoMergeResolve !== 'ours' && autoMergeResolve !== 'theirs' && autoMergeResolve !== 'manual') {
|
|
88
89
|
throw new (_bitError().BitError)('--auto-merge-resolve must be one of the following: [ours, theirs, manual]');
|
|
89
90
|
}
|
|
91
|
+
if (manual) autoMergeResolve = 'manual';
|
|
90
92
|
if (abort && resolve) throw new (_bitError().BitError)('unable to use "abort" and "resolve" flags together');
|
|
91
93
|
if (noSnap && message) throw new (_bitError().BitError)('unable to use "noSnap" and "message" flags together');
|
|
92
94
|
const {
|
|
@@ -129,9 +131,7 @@ function mergeReport({
|
|
|
129
131
|
leftUnresolvedConflicts,
|
|
130
132
|
verbose,
|
|
131
133
|
configMergeResults,
|
|
132
|
-
|
|
133
|
-
workspaceDepsConflicts,
|
|
134
|
-
workspaceConflictError
|
|
134
|
+
workspaceConfigUpdateResult
|
|
135
135
|
}) {
|
|
136
136
|
const getSuccessOutput = () => {
|
|
137
137
|
if (!components || !components.length) return '';
|
|
@@ -142,7 +142,7 @@ function mergeReport({
|
|
|
142
142
|
let componentsWithConflicts = 0;
|
|
143
143
|
const getConflictSummary = () => {
|
|
144
144
|
if (!components || !components.length || !leftUnresolvedConflicts) return '';
|
|
145
|
-
const title =
|
|
145
|
+
const title = `files with conflicts summary\n`;
|
|
146
146
|
const suggestion = `\n\nmerge process not completed due to the conflicts above. fix conflicts manually and then run "bit install".
|
|
147
147
|
once ready, snap/tag the components to complete the merge.`;
|
|
148
148
|
const conflictSummary = conflictSummaryReport(components);
|
|
@@ -153,15 +153,14 @@ once ready, snap/tag the components to complete the merge.`;
|
|
|
153
153
|
const getConfigMergeConflictSummary = () => {
|
|
154
154
|
if (!configMergeWithConflicts.length) return '';
|
|
155
155
|
const comps = configMergeWithConflicts.map(c => c.compIdStr).join('\n');
|
|
156
|
-
const title =
|
|
156
|
+
const title = `components with config-merge conflicts\n`;
|
|
157
157
|
const suggestion = `\nconflicts were found while trying to merge the config. fix them manually by editing the ${_constants().MergeConfigFilename} file in the workspace root.
|
|
158
158
|
once ready, snap/tag the components to complete the merge.`;
|
|
159
159
|
return _chalk().default.underline(title) + comps + _chalk().default.yellow(suggestion);
|
|
160
160
|
};
|
|
161
161
|
const getSnapsOutput = () => {
|
|
162
162
|
if (mergeSnapError) {
|
|
163
|
-
return
|
|
164
|
-
${_chalk().default.bold('snapping merged components failed with the following error, please fix the issues and snap manually')}
|
|
163
|
+
return `${_chalk().default.bold('snapping merged components failed with the following error, please fix the issues and snap manually')}
|
|
165
164
|
${mergeSnapError.message}
|
|
166
165
|
`;
|
|
167
166
|
}
|
|
@@ -181,23 +180,7 @@ ${mergeSnapError.message}
|
|
|
181
180
|
return componentOutput;
|
|
182
181
|
}).join('\n');
|
|
183
182
|
};
|
|
184
|
-
return
|
|
185
|
-
};
|
|
186
|
-
const getWorkspaceDepsOutput = () => {
|
|
187
|
-
if (!workspaceDepsUpdates) return '';
|
|
188
|
-
const title = '\nworkspace.jsonc has been updated with the following dependencies';
|
|
189
|
-
const body = Object.keys(workspaceDepsUpdates).map(pkgName => {
|
|
190
|
-
const [from, to] = workspaceDepsUpdates[pkgName];
|
|
191
|
-
return ` ${pkgName}: ${from} => ${to}`;
|
|
192
|
-
}).join('\n');
|
|
193
|
-
return `\n${_chalk().default.underline(title)}\n${body}\n\n`;
|
|
194
|
-
};
|
|
195
|
-
const getWorkspaceConflictsOutput = () => {
|
|
196
|
-
if (!workspaceDepsConflicts && !workspaceConflictError) return '';
|
|
197
|
-
if (workspaceConflictError) {
|
|
198
|
-
return `\n${_chalk().default.red(workspaceConflictError.message)}\n\n`;
|
|
199
|
-
}
|
|
200
|
-
return _chalk().default.yellow('\nworkspace.jsonc has conflicts, please edit the file and fix them\n\n');
|
|
183
|
+
return `${_chalk().default.underline('merge-snapped components')}\n(${'components snapped as a result of the merge'})\n${outputComponents(snappedComponents)}`;
|
|
201
184
|
};
|
|
202
185
|
const getFailureOutput = () => {
|
|
203
186
|
if (!failedComponents || !failedComponents.length) return '';
|
|
@@ -211,7 +194,7 @@ ${mergeSnapError.message}
|
|
|
211
194
|
return `${_chalk().default.bold(`\nmerge skipped legitimately for ${failedComponents.length} component(s)`)}
|
|
212
195
|
(use --verbose to list them next time)`;
|
|
213
196
|
}
|
|
214
|
-
return
|
|
197
|
+
return `${_chalk().default.underline(title)}\n${body}`;
|
|
215
198
|
};
|
|
216
199
|
const getSummary = () => {
|
|
217
200
|
const merged = components?.length || 0;
|
|
@@ -219,20 +202,44 @@ ${mergeSnapError.message}
|
|
|
219
202
|
const autoSnapped = (mergeSnapResults?.snappedComponents.length || 0) + (mergeSnapResults?.autoSnappedResults.length || 0);
|
|
220
203
|
const getConflictStr = () => {
|
|
221
204
|
const comps = componentsWithConflicts ? `${componentsWithConflicts} components` : '';
|
|
222
|
-
const ws = workspaceDepsConflicts ? 'workspace.jsonc file' : '';
|
|
205
|
+
const ws = workspaceConfigUpdateResult?.workspaceDepsConflicts ? 'workspace.jsonc file' : '';
|
|
223
206
|
const mergeConfig = configMergeWithConflicts.length ? `${_constants().MergeConfigFilename} file` : '';
|
|
224
207
|
return (0, _lodash().compact)([comps, ws, mergeConfig]).join(', ');
|
|
225
208
|
};
|
|
226
|
-
const newLines = '\n\n';
|
|
227
209
|
const title = _chalk().default.bold.underline('Merge Summary');
|
|
228
210
|
const mergedStr = `\nTotal Merged: ${_chalk().default.bold(merged.toString())}`;
|
|
229
211
|
const unchangedLegitimatelyStr = `\nTotal Unchanged: ${_chalk().default.bold(unchangedLegitimately.toString())}`;
|
|
230
212
|
const autoSnappedStr = `\nTotal Snapped: ${_chalk().default.bold(autoSnapped.toString())}`;
|
|
231
213
|
const removedStr = `\nTotal Removed: ${_chalk().default.bold(removedComponents?.length.toString() || '0')}`;
|
|
232
214
|
const conflictStr = `\nConflicts: ${_chalk().default.bold(getConflictStr() || 'none')}`;
|
|
233
|
-
return
|
|
215
|
+
return title + mergedStr + unchangedLegitimatelyStr + autoSnappedStr + removedStr + conflictStr;
|
|
234
216
|
};
|
|
235
|
-
return getSuccessOutput()
|
|
217
|
+
return (0, _lodash().compact)([getSuccessOutput(), getFailureOutput(), getRemovedOutput(removedComponents), getSnapsOutput(), getConfigMergeConflictSummary(), getWorkspaceConfigUpdateOutput(workspaceConfigUpdateResult), getConflictSummary(), getSummary()]).join('\n\n');
|
|
218
|
+
}
|
|
219
|
+
function getWorkspaceConfigUpdateOutput(workspaceConfigUpdateResult) {
|
|
220
|
+
if (!workspaceConfigUpdateResult) return '';
|
|
221
|
+
const {
|
|
222
|
+
workspaceConfigConflictWriteError,
|
|
223
|
+
workspaceDepsConflicts,
|
|
224
|
+
workspaceDepsUpdates
|
|
225
|
+
} = workspaceConfigUpdateResult;
|
|
226
|
+
const getWorkspaceConflictsOutput = () => {
|
|
227
|
+
if (!workspaceDepsConflicts && !workspaceConfigConflictWriteError) return '';
|
|
228
|
+
if (workspaceConfigConflictWriteError) {
|
|
229
|
+
return `${_chalk().default.red(workspaceConfigConflictWriteError.message)}`;
|
|
230
|
+
}
|
|
231
|
+
return _chalk().default.yellow('workspace.jsonc has conflicts, please edit the file and fix them');
|
|
232
|
+
};
|
|
233
|
+
return (0, _lodash().compact)([getWorkspaceDepsOutput(workspaceDepsUpdates), getWorkspaceConflictsOutput()]).join('\n\n');
|
|
234
|
+
}
|
|
235
|
+
function getWorkspaceDepsOutput(workspaceDepsUpdates) {
|
|
236
|
+
if (!workspaceDepsUpdates) return '';
|
|
237
|
+
const title = '\nworkspace.jsonc has been updated with the following dependencies';
|
|
238
|
+
const body = Object.keys(workspaceDepsUpdates).map(pkgName => {
|
|
239
|
+
const [from, to] = workspaceDepsUpdates[pkgName];
|
|
240
|
+
return ` ${pkgName}: ${from} => ${to}`;
|
|
241
|
+
}).join('\n');
|
|
242
|
+
return `${_chalk().default.underline(title)}\n${body}`;
|
|
236
243
|
}
|
|
237
244
|
|
|
238
245
|
/**
|
|
@@ -283,28 +290,30 @@ function conflictSummaryReport(components) {
|
|
|
283
290
|
function installationErrorOutput(installationError) {
|
|
284
291
|
if (!installationError) return '';
|
|
285
292
|
const title = _chalk().default.underline('Installation Error');
|
|
286
|
-
const subTitle = 'The following error was thrown by the package manager
|
|
293
|
+
const subTitle = 'The following error was thrown by the package manager:';
|
|
287
294
|
const body = _chalk().default.red(installationError.message);
|
|
288
|
-
|
|
295
|
+
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';
|
|
296
|
+
return `${title}\n${subTitle}\n${body}\n${suggestion}`;
|
|
289
297
|
}
|
|
290
298
|
function compilationErrorOutput(compilationError) {
|
|
291
299
|
if (!compilationError) return '';
|
|
292
300
|
const title = _chalk().default.underline('Compilation Error');
|
|
293
|
-
const subTitle = 'The following error was thrown by the compiler
|
|
301
|
+
const subTitle = 'The following error was thrown by the compiler';
|
|
294
302
|
const body = _chalk().default.red(compilationError.message);
|
|
295
|
-
|
|
303
|
+
const suggestion = 'Please fix the issue and run "bit compile"';
|
|
304
|
+
return `${title}\n${subTitle}\n${body}\n${suggestion}`;
|
|
296
305
|
}
|
|
297
306
|
function getRemovedOutput(removedComponents) {
|
|
298
307
|
if (!removedComponents?.length) return '';
|
|
299
308
|
const title = `the following ${removedComponents.length} component(s) have been removed`;
|
|
300
309
|
const body = removedComponents.join('\n');
|
|
301
|
-
return
|
|
310
|
+
return `${_chalk().default.underline(title)}\n${body}`;
|
|
302
311
|
}
|
|
303
312
|
function getAddedOutput(addedComponents) {
|
|
304
313
|
if (!addedComponents?.length) return '';
|
|
305
314
|
const title = `the following ${addedComponents.length} component(s) have been added`;
|
|
306
315
|
const body = addedComponents.join('\n');
|
|
307
|
-
return
|
|
316
|
+
return `${_chalk().default.underline(title)}\n${body}`;
|
|
308
317
|
}
|
|
309
318
|
|
|
310
319
|
//# sourceMappingURL=merge-cmd.js.map
|
package/dist/merge-cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_constants","_mergeVersion","_bitError","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","MergeCmd","constructor","merging","globalConfig","WILDCARD_HELP","report","ids","ours","theirs","manual","autoMergeResolve","abort","resolve","build","noSnap","verbose","message","skipDependencyInstallation","getBool","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","workspaceDepsUpdates","workspaceDepsConflicts","workspaceConflictError","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","getWorkspaceDepsOutput","body","keys","pkgName","from","to","getWorkspaceConflictsOutput","red","getFailureOutput","compact","failedComponent","white","unchangedMessage","getSummary","merged","unchangedLegitimately","f","autoSnapped","getConflictStr","ws","mergeConfig","newLines","mergedStr","unchangedLegitimatelyStr","autoSnappedStr","removedStr","getRemovedOutput","addName","showVersion","tab","fileChanges","name","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 WILDCARD_HELP,\n AUTO_SNAPPED_MSG,\n MergeConfigFilename,\n FILE_CHANGES_CHECKOUT_MSG,\n CFG_FORCE_LOCAL_BUILD,\n} from '@teambit/legacy/dist/constants';\nimport { FileStatus, MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { GlobalConfigMain } from '@teambit/global-config';\nimport { ConfigMergeResult } from '@teambit/config-merger';\nimport { BitError } from '@teambit/bit-error';\nimport { ApplyVersionResults, MergingMain, ApplyVersionResult } from './merging.main.runtime';\n\nexport class MergeCmd implements Command {\n name = 'merge [ids...]';\n description = 'merge changes of the remote head into local - auto-snaps all merged components';\n helpUrl = 'reference/components/merging-changes';\n group = 'development';\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${WILDCARD_HELP('merge')}`;\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 ['', 'manual', 'DEPRECATED. use --auto-merge-resolve'],\n [\n '',\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(private merging: MergingMain, private globalConfig: GlobalConfigMain) {}\n\n async report(\n [ids = []]: [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 = (await this.globalConfig.getBool(CFG_FORCE_LOCAL_BUILD)) || Boolean(build);\n if (ours || theirs || manual) {\n throw new BitError(\n 'the \"--ours\", \"--theirs\" and \"--manual\" flags are deprecated. use \"--auto-merge-resolve\" instead'\n );\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 (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 ids,\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 workspaceDepsUpdates,\n workspaceDepsConflicts,\n workspaceConflictError,\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 = `\\n\\nfiles 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 = `\\n\\ncomponents 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 `\n${chalk.bold('snapping merged components failed with the following error, please fix the issues and snap manually')}\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 `\\n${chalk.underline(\n 'merge-snapped components'\n )}\\n(${'components snapped as a result of the merge'})\\n${outputComponents(snappedComponents)}\\n`;\n };\n\n const getWorkspaceDepsOutput = () => {\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 `\\n${chalk.underline(title)}\\n${body}\\n\\n`;\n };\n\n const getWorkspaceConflictsOutput = () => {\n if (!workspaceDepsConflicts && !workspaceConflictError) return '';\n if (workspaceConflictError) {\n return `\\n${chalk.red(workspaceConflictError.message)}\\n\\n`;\n }\n return chalk.yellow('\\nworkspace.jsonc has conflicts, please edit the file and fix them\\n\\n');\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 `\\n${chalk.underline(title)}\\n${body}\\n\\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 = workspaceDepsConflicts ? 'workspace.jsonc file' : '';\n const mergeConfig = configMergeWithConflicts.length ? `${MergeConfigFilename} file` : '';\n return compact([comps, ws, mergeConfig]).join(', ');\n };\n\n const newLines = '\\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 newLines + title + mergedStr + unchangedLegitimatelyStr + autoSnappedStr + removedStr + conflictStr;\n };\n\n return (\n getSuccessOutput() +\n getFailureOutput() +\n getRemovedOutput(removedComponents) +\n getSnapsOutput() +\n getWorkspaceDepsOutput() +\n getConfigMergeConflictSummary() +\n getWorkspaceConflictsOutput() +\n getConflictSummary() +\n getSummary()\n );\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, please fix the issue and run \"bit install\"';\n const body = chalk.red(installationError.message);\n return `\\n\\n${title}\\n${subTitle}\\n${body}`;\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, please fix the issue and run \"bit compile\"';\n const body = chalk.red(compilationError.message);\n return `\\n\\n${title}\\n${subTitle}\\n${body}`;\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 `\\n\\n${chalk.underline(title)}\\n${body}\\n\\n`;\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('\\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BAAsBA,CAACC,gBAAwB,EAAE;EAC/D,IAAI,CAACA,gBAAgB,EAAE,OAAO,EAAE;EAChC,MAAMjG,KAAK,GAAGO,gBAAK,CAACC,SAAS,CAAC,mBAAmB,CAAC;EAClD,MAAMuF,QAAQ,GAAG,4FAA4F;EAC7G,MAAM1C,IAAI,GAAG9C,gBAAK,CAACoD,GAAG,CAACsC,gBAAgB,CAAC/G,OAAO,CAAC;EAChD,OAAQ,OAAMc,KAAM,KAAI+F,QAAS,KAAI1C,IAAK,EAAC;AAC7C;AAEO,SAASyB,gBAAgBA,CAAClE,iBAAiC,EAAE;EAClE,IAAI,CAACA,iBAAiB,EAAEO,MAAM,EAAE,OAAO,EAAE;EACzC,MAAMnB,KAAK,GAAI,iBAAgBY,iBAAiB,CAACO,MAAO,iCAAgC;EACxF,MAAMkC,IAAI,GAAGzC,iBAAiB,CAACN,IAAI,CAAC,IAAI,CAAC;EACzC,OAAQ,OAAMC,gBAAK,CAACC,SAAS,CAACR,KAAK,CAAE,KAAIqD,IAAK,MAAK;AACrD;AAEO,SAAS6C,cAAcA,CAACC,eAA+B,EAAE;EAC9D,IAAI,CAACA,eAAe,EAAEhF,MAAM,EAAE,OAAO,EAAE;EACvC,MAAMnB,KAAK,GAAI,iBAAgBmG,eAAe,CAAChF,MAAO,+BAA8B;EACpF,MAAMkC,IAAI,GAAG8C,eAAe,CAAC7F,IAAI,CAAC,IAAI,CAAC;EACvC,OAAQ,OAAMC,gBAAK,CAACC,SAAS,CAACR,KAAK,CAAE,KAAIqD,IAAK,MAAK;AACrD"}
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_constants","_mergeVersion","_bitError","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","MergeCmd","constructor","merging","globalConfig","WILDCARD_HELP","report","ids","ours","theirs","manual","autoMergeResolve","abort","resolve","build","noSnap","verbose","message","skipDependencyInstallation","getBool","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","getWorkspaceConflictsOutput","red","getWorkspaceDepsOutput","keys","pkgName","from","to","addName","showVersion","tab","fileChanges","name","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 WILDCARD_HELP,\n AUTO_SNAPPED_MSG,\n MergeConfigFilename,\n FILE_CHANGES_CHECKOUT_MSG,\n CFG_FORCE_LOCAL_BUILD,\n} from '@teambit/legacy/dist/constants';\nimport { FileStatus, MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { GlobalConfigMain } from '@teambit/global-config';\nimport { ConfigMergeResult, WorkspaceConfigUpdateResult, WorkspaceDepsUpdates } from '@teambit/config-merger';\nimport { BitError } from '@teambit/bit-error';\nimport { ApplyVersionResults, MergingMain, ApplyVersionResult } from './merging.main.runtime';\n\nexport class MergeCmd implements Command {\n name = 'merge [ids...]';\n description = 'merge changes of the remote head into local - auto-snaps all merged components';\n helpUrl = 'reference/components/merging-changes';\n group = 'development';\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${WILDCARD_HELP('merge')}`;\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 '',\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(private merging: MergingMain, private globalConfig: GlobalConfigMain) {}\n\n async report(\n [ids = []]: [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 = (await this.globalConfig.getBool(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 ids,\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 } =\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 return compact([getWorkspaceDepsOutput(workspaceDepsUpdates), getWorkspaceConflictsOutput()]).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,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAK,cAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,aAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAM,UAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,gBAAAH,GAAA,EAAAI,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAJ,GAAA,IAAAO,MAAA,CAAAC,cAAA,CAAAR,GAAA,EAAAI,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAX,GAAA,CAAAI,GAAA,IAAAC,KAAA,WAAAL,GAAA;AAAA,SAAAM,eAAAM,C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,MAAMjB,KAAK,GAAI,iBAAgBoG,eAAe,CAACnF,MAAO,+BAA8B;EACpF,MAAMkC,IAAI,GAAGiD,eAAe,CAAC9F,IAAI,CAAC,IAAI,CAAC;EACvC,OAAQ,GAAEC,gBAAK,CAACC,SAAS,CAACR,KAAK,CAAE,KAAImD,IAAK,EAAC;AAC7C"}
|
|
@@ -17,7 +17,7 @@ import { Logger, LoggerMain } from '@teambit/logger';
|
|
|
17
17
|
import { GlobalConfigMain } from '@teambit/global-config';
|
|
18
18
|
import { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';
|
|
19
19
|
import { CheckoutMain, ComponentStatusBase } from '@teambit/checkout';
|
|
20
|
-
import { ConfigMergerMain, ConfigMergeResult,
|
|
20
|
+
import { ConfigMergerMain, ConfigMergeResult, WorkspaceConfigUpdateResult } from '@teambit/config-merger';
|
|
21
21
|
import { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';
|
|
22
22
|
import { InstallMain } from '@teambit/install';
|
|
23
23
|
import { MergeStatusProviderOptions } from './merge-status-provider';
|
|
@@ -74,9 +74,7 @@ export type ApplyVersionResults = {
|
|
|
74
74
|
newFromLaneAdded?: boolean;
|
|
75
75
|
installationError?: Error;
|
|
76
76
|
compilationError?: Error;
|
|
77
|
-
|
|
78
|
-
workspaceDepsConflicts?: WorkspaceDepsConflicts;
|
|
79
|
-
workspaceConflictError?: Error;
|
|
77
|
+
workspaceConfigUpdateResult?: WorkspaceConfigUpdateResult;
|
|
80
78
|
};
|
|
81
79
|
export declare class MergingMain {
|
|
82
80
|
private workspace;
|
|
@@ -289,9 +289,9 @@ class MergingMain {
|
|
|
289
289
|
workspaceDepsUpdates,
|
|
290
290
|
workspaceDepsConflicts
|
|
291
291
|
} = await this.configMerger.updateWorkspaceJsoncWithDepsIfNeeded(allConfigMerge);
|
|
292
|
-
let
|
|
292
|
+
let workspaceConfigConflictWriteError;
|
|
293
293
|
if (workspaceDepsConflicts) {
|
|
294
|
-
|
|
294
|
+
workspaceConfigConflictWriteError = await this.configMerger.writeWorkspaceJsoncWithConflictsGracefully(workspaceDepsConflicts);
|
|
295
295
|
}
|
|
296
296
|
await this.configMerger.generateConfigMergeConflictFileForAll(allConfigMerge);
|
|
297
297
|
if (currentLane) consumer.scope.objects.add(currentLane);
|
|
@@ -356,10 +356,12 @@ class MergingMain {
|
|
|
356
356
|
removedComponents: [...componentIdsToRemove, ...(mergeSnapResults?.removedComponents || [])],
|
|
357
357
|
mergeSnapResults,
|
|
358
358
|
mergeSnapError,
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
359
|
+
workspaceConfigUpdateResult: {
|
|
360
|
+
workspaceDepsUpdates,
|
|
361
|
+
workspaceDepsConflicts,
|
|
362
|
+
workspaceConfigConflictWriteError
|
|
363
|
+
},
|
|
364
|
+
leftUnresolvedConflicts
|
|
363
365
|
};
|
|
364
366
|
}
|
|
365
367
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_workspace","_interopRequireWildcard","_componentsList","_interopRequireDefault","_mergeVersion","_snapping","_hasWildcard","_pMapSeries","_componentId","_bitError","_generalError","_laneId","_chalk","_config","_remove","_utils","_componentWriter","_importer","_logger","_globalConfig","_lodash","_checkout","_deleteComponentFiles","_configMerger","_install","_mergeCmd","_merging","_mergeStatusProvider","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","key","value","_toPropertyKey","configurable","writable","_toPrimitive","String","Symbol","toPrimitive","TypeError","Number","MergingMain","constructor","workspace","install","snapping","checkout","logger","componentWriter","importer","config","remove","configMerger","merge","ids","mergeStrategy","abort","resolve","noSnap","message","build","skipDependencyInstallation","OutsideWorkspaceError","consumer","mergeResults","resolveMerge","abortMerge","bitIds","getComponentsToMerge","mergeComponentsFromRemote","onDestroy","snapMessage","currentLaneId","getCurrentLaneId","currentLaneObject","getCurrentLaneObject","allComponentsStatus","getAllComponentsStatus","failedComponents","c","unchangedMessage","unchangedLegitimately","failureMsgs","map","failedComponent","chalk","bold","id","toString","red","join","BitError","mergeSnaps","otherLaneId","currentLane","tag","componentWithConflict","find","component","hasConflicts","getMergeStrategyInteractive","componentStatus","shouldBeRemoved","componentIdsToRemove","changeVersion","undefined","succeededComponents","componentsResults","applyVersionMultiple","allConfigMerge","compact","configMergeResult","workspaceDepsUpdates","workspaceDepsConflicts","updateWorkspaceJsoncWithDepsIfNeeded","workspaceConflictError","writeWorkspaceJsoncWithConflictsGracefully","generateConfigMergeConflictFileForAll","scope","objects","add","persist","unmergedComponents","write","writeBitMap","compBitIdsToRemove","ComponentIdList","fromArray","deleteComponentsFiles","cleanFromBitMap","componentsHasConfigMergeConflicts","some","leftUnresolvedConflicts","dedupe","updateExisting","import","err","error","consoleError","getSnapOrTagResults","idsToTag","results","tagAllLaneComponent","taggedComponents","autoTaggedResults","removedComponents","snappedComponents","autoSnappedResults","snapResolvedComponents","mergeSnapResults","mergeSnapError","bitMapSnapshot","bitMap","takeSnapshot","restoreFromSnapshot","components","applyVersionResult","getMergeStatus","otherLane","options","mergeStatusProvider","MergeStatusProvider","getStatus","mapSeries","currentComponent","resolvedUnrelated","modelComponent","getModelComponent","updatedLaneId","isDefault","LaneId","from","name","applyVersion","remoteHead","getRef","version","compsToWrite","legacyCompToWrite","manyComponentsWriterOpts","writeConfig","reasonForBitmapChange","writeMany","filesStatus","unmergedComponent","fullName","head","laneId","addToCurrentLane","Error","isPartOfLane","isEqualWithoutVersion","addComponent","handleResolveUnrelated","headOnCurrentLane","unrelated","unrelatedHead","unrelatedLaneId","addEntry","markAllFilesAsUnchanged","files","file","pathNormalizeToLinux","relative","FileStatus","unchanged","MergeOptions","ours","strategy","remoteId","idToLoad","theirs","legacyComponent","loadComponentFromModelImportIfNeeded","updateFileStatus","modifiedStatus","modifiedFiles","applyModifiedVersion","removeFilesIfNeeded","successfullyMergedConfig","getSuccessfullyMergedConfig","mergedConfig","manual","unmergedPaths","f","conflict","filePath","setHead","markVersionAsLocal","values","getIdsForUnmerged","reset","removeComponent","abortedComponents","snap","legacyBitIds","resolvedComponents","localLaneObject","Promise","all","bitId","remoteScopeName","remoteLaneId","remoteLanes","laneIdStr","toStringWithoutVersion","shouldSquash","getComponents","debug","ComponentID","fromObject","tagMessage","unmodified","idsStr","componentIds","resolveMultipleComponentIds","entry","getEntry","GeneralError","unresolvedComponents","componentsList","ComponentsList","mergePending","listMergePendingComponents","hasWildcard","listComponentsByIdsWithWildcard","getParsedId","provider","cli","loggerMain","compWriter","globalConfig","createLogger","MergingAspect","merging","register","MergeCmd","exports","CLIAspect","WorkspaceAspect","SnappingAspect","CheckoutAspect","InstallAspect","LoggerAspect","ComponentWriterAspect","ImporterAspect","ConfigAspect","RemoveAspect","GlobalConfigAspect","ConfigMergerAspect","MainRuntime","addRuntime"],"sources":["merging.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport {\n MergeStrategy,\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport SnappingAspect, { SnapResults, SnappingMain, TagResults } from '@teambit/snapping';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport mapSeries from 'p-map-series';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport { LaneId } from '@teambit/lane-id';\nimport { AutoTagResult } from '@teambit/legacy/dist/scope/component-ops/auto-tag';\nimport { UnmergedComponent } from '@teambit/legacy/dist/scope/lanes/unmerged-components';\nimport { Lane, ModelComponent } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport chalk from 'chalk';\nimport { ConfigAspect, ConfigMain } from '@teambit/config';\nimport RemoveAspect, { RemoveMain } from '@teambit/remove';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport { ComponentWriterAspect, ComponentWriterMain } from '@teambit/component-writer';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport ImporterAspect, { ImporterMain } from '@teambit/importer';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport GlobalConfigAspect, { GlobalConfigMain } from '@teambit/global-config';\nimport { compact } from 'lodash';\nimport { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport {\n ApplyVersionWithComps,\n CheckoutAspect,\n CheckoutMain,\n ComponentStatusBase,\n applyModifiedVersion,\n removeFilesIfNeeded,\n updateFileStatus,\n} from '@teambit/checkout';\nimport deleteComponentsFiles from '@teambit/legacy/dist/consumer/component-ops/delete-component-files';\nimport {\n ConfigMergerAspect,\n ConfigMergerMain,\n ConfigMergeResult,\n WorkspaceDepsUpdates,\n WorkspaceDepsConflicts,\n} from '@teambit/config-merger';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport { InstallMain, InstallAspect } from '@teambit/install';\nimport { MergeCmd } from './merge-cmd';\nimport { MergingAspect } from './merging.aspect';\nimport { MergeStatusProvider, MergeStatusProviderOptions } from './merge-status-provider';\n\ntype ResolveUnrelatedData = {\n strategy: MergeStrategy;\n headOnCurrentLane: Ref;\n unrelatedHead: Ref;\n unrelatedLaneId: LaneId;\n};\n\nexport type ComponentMergeStatus = ComponentStatusBase & {\n mergeResults?: MergeResultsThreeWay | null;\n divergeData?: SnapsDistance;\n resolvedUnrelated?: ResolveUnrelatedData;\n configMergeResult?: ConfigMergeResult;\n};\n\nexport type ComponentMergeStatusBeforeMergeAttempt = ComponentStatusBase & {\n divergeData?: SnapsDistance;\n resolvedUnrelated?: ResolveUnrelatedData;\n mergeProps?: {\n otherLaneHead: Ref;\n currentId: ComponentID;\n modelComponent: ModelComponent;\n };\n};\n\nexport type FailedComponents = { id: ComponentID; unchangedMessage: string; unchangedLegitimately?: boolean };\n\n// fileName is PathLinux. TS doesn't let anything else in the keys other than string and number\nexport type FilesStatus = { [fileName: string]: keyof typeof FileStatus };\n\nexport type ApplyVersionResult = { id: ComponentID; filesStatus: FilesStatus };\n\nexport type ApplyVersionResults = {\n components?: ApplyVersionResult[];\n version?: string;\n failedComponents?: FailedComponents[];\n removedComponents?: ComponentID[];\n addedComponents?: ComponentID[]; // relevant when restoreMissingComponents is true (e.g. bit lane merge-abort)\n resolvedComponents?: ConsumerComponent[]; // relevant for bit merge --resolve\n abortedComponents?: ApplyVersionResult[]; // relevant for bit merge --abort\n mergeSnapResults?: {\n snappedComponents: ConsumerComponent[];\n autoSnappedResults: AutoTagResult[];\n removedComponents?: ComponentIdList;\n } | null;\n mergeSnapError?: Error;\n leftUnresolvedConflicts?: boolean;\n verbose?: boolean;\n newFromLane?: string[];\n newFromLaneAdded?: boolean;\n installationError?: Error; // in case the package manager failed, it won't throw, instead, it'll return error here\n compilationError?: Error; // in case the compiler failed, it won't throw, instead, it'll return error here\n workspaceDepsUpdates?: WorkspaceDepsUpdates; // in case workspace.jsonc has been updated with dependencies versions\n workspaceDepsConflicts?: WorkspaceDepsConflicts; // in case workspace.jsonc has conflicts\n workspaceConflictError?: Error; // in case workspace.jsonc has conflicts and we failed to write the conflicts to the file\n};\n\nexport class MergingMain {\n constructor(\n private workspace: Workspace,\n private install: InstallMain,\n private snapping: SnappingMain,\n private checkout: CheckoutMain,\n private logger: Logger,\n private componentWriter: ComponentWriterMain,\n private importer: ImporterMain,\n private config: ConfigMain,\n private remove: RemoveMain,\n private configMerger: ConfigMergerMain\n ) {}\n\n async merge(\n ids: string[],\n mergeStrategy: MergeStrategy,\n abort: boolean,\n resolve: boolean,\n noSnap: boolean,\n message: string,\n build: boolean,\n skipDependencyInstallation: boolean\n ): Promise<ApplyVersionResults> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer: Consumer = this.workspace.consumer;\n let mergeResults;\n if (resolve) {\n mergeResults = await this.resolveMerge(ids, message, build);\n } else if (abort) {\n mergeResults = await this.abortMerge(ids);\n } else {\n const bitIds = await this.getComponentsToMerge(consumer, ids);\n mergeResults = await this.mergeComponentsFromRemote(\n consumer,\n bitIds,\n mergeStrategy,\n noSnap,\n message,\n build,\n skipDependencyInstallation\n );\n }\n await consumer.onDestroy('merge');\n return mergeResults;\n }\n\n /**\n * when user is on main, it merges the remote main components into local.\n * when user is on a lane, it merges the remote lane components into the local lane.\n */\n async mergeComponentsFromRemote(\n consumer: Consumer,\n bitIds: ComponentID[],\n mergeStrategy: MergeStrategy,\n noSnap: boolean,\n snapMessage: string,\n build: boolean,\n skipDependencyInstallation: boolean\n ): Promise<ApplyVersionResults> {\n const currentLaneId = consumer.getCurrentLaneId();\n const currentLaneObject = await consumer.getCurrentLaneObject();\n const allComponentsStatus = await this.getAllComponentsStatus(bitIds, currentLaneId, currentLaneObject);\n const failedComponents = allComponentsStatus.filter((c) => c.unchangedMessage && !c.unchangedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unchangedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to merge due to the following failures:\\n${failureMsgs}`);\n }\n\n return this.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n otherLaneId: currentLaneId,\n currentLane: currentLaneObject,\n noSnap,\n snapMessage,\n build,\n skipDependencyInstallation,\n });\n }\n\n /**\n * merge multiple components according to the \"allComponentsStatus\".\n */\n async mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n otherLaneId,\n currentLane,\n noSnap,\n tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n }: {\n mergeStrategy: MergeStrategy;\n allComponentsStatus: ComponentMergeStatus[];\n otherLaneId: LaneId;\n currentLane: Lane | null;\n noSnap: boolean;\n tag?: boolean;\n snapMessage: string;\n build: boolean;\n skipDependencyInstallation?: boolean;\n }): Promise<ApplyVersionResults> {\n const consumer = this.workspace.consumer;\n const componentWithConflict = allComponentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict && !mergeStrategy) {\n mergeStrategy = await getMergeStrategyInteractive();\n }\n const failedComponents: FailedComponents[] = allComponentsStatus\n .filter((componentStatus) => componentStatus.unchangedMessage)\n .filter((componentStatus) => !componentStatus.shouldBeRemoved)\n .map((componentStatus) => ({\n id: componentStatus.id,\n unchangedMessage: componentStatus.unchangedMessage as string,\n unchangedLegitimately: componentStatus.unchangedLegitimately,\n }));\n\n const componentIdsToRemove = allComponentsStatus\n .filter((componentStatus) => componentStatus.shouldBeRemoved)\n .map((c) => c.id.changeVersion(undefined));\n\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.unchangedMessage);\n\n const componentsResults = await this.applyVersionMultiple(\n succeededComponents,\n otherLaneId,\n mergeStrategy,\n currentLane\n );\n\n const allConfigMerge = compact(succeededComponents.map((c) => c.configMergeResult));\n\n const { workspaceDepsUpdates, workspaceDepsConflicts } =\n await this.configMerger.updateWorkspaceJsoncWithDepsIfNeeded(allConfigMerge);\n\n let workspaceConflictError: Error | undefined;\n if (workspaceDepsConflicts) {\n workspaceConflictError = await this.configMerger.writeWorkspaceJsoncWithConflictsGracefully(\n workspaceDepsConflicts\n );\n }\n await this.configMerger.generateConfigMergeConflictFileForAll(allConfigMerge);\n\n if (currentLane) consumer.scope.objects.add(currentLane);\n\n await consumer.scope.objects.persist(); // persist anyway, if currentLane is null it should save all main heads\n\n await consumer.scope.objects.unmergedComponents.write();\n\n await consumer.writeBitMap(`merge ${otherLaneId.toString()}`);\n\n if (componentIdsToRemove.length) {\n const compBitIdsToRemove = ComponentIdList.fromArray(componentIdsToRemove);\n await deleteComponentsFiles(consumer, compBitIdsToRemove);\n await consumer.cleanFromBitMap(compBitIdsToRemove);\n }\n\n const componentsHasConfigMergeConflicts = allComponentsStatus.some((c) => c.configMergeResult?.hasConflicts());\n const leftUnresolvedConflicts = componentWithConflict && mergeStrategy === 'manual';\n if (!skipDependencyInstallation && !leftUnresolvedConflicts && !componentsHasConfigMergeConflicts) {\n try {\n await this.install.install(undefined, {\n dedupe: true,\n updateExisting: false,\n import: false,\n });\n } catch (err: any) {\n this.logger.error(`failed installing packages`, err);\n this.logger.consoleError(`failed installing packages, see the log for full stacktrace. error: ${err.message}`);\n }\n }\n\n const getSnapOrTagResults = async () => {\n // if one of the component has conflict, don't snap-merge. otherwise, some of the components would be snap-merged\n // and some not. besides the fact that it could by mistake tag dependent, it's a confusing state. better not snap.\n if (noSnap || leftUnresolvedConflicts || componentsHasConfigMergeConflicts) {\n return null;\n }\n if (tag) {\n const idsToTag = allComponentsStatus.map((c) => c.id);\n const results = await this.tagAllLaneComponent(idsToTag, snapMessage, build);\n if (!results) return null;\n const { taggedComponents, autoTaggedResults, removedComponents } = results;\n return { snappedComponents: taggedComponents, autoSnappedResults: autoTaggedResults, removedComponents };\n }\n return this.snapResolvedComponents(consumer, snapMessage, build);\n };\n let mergeSnapResults: ApplyVersionResults['mergeSnapResults'] = null;\n let mergeSnapError: Error | undefined;\n const bitMapSnapshot = this.workspace.bitMap.takeSnapshot();\n try {\n mergeSnapResults = await getSnapOrTagResults();\n } catch (err: any) {\n mergeSnapError = err;\n this.workspace.bitMap.restoreFromSnapshot(bitMapSnapshot);\n }\n\n return {\n components: componentsResults.map((c) => c.applyVersionResult),\n failedComponents,\n removedComponents: [...componentIdsToRemove, ...(mergeSnapResults?.removedComponents || [])],\n mergeSnapResults,\n mergeSnapError,\n workspaceConflictError,\n workspaceDepsConflicts,\n leftUnresolvedConflicts,\n workspaceDepsUpdates,\n };\n }\n\n /**\n * this function gets called from two different commands:\n * 1. \"bit merge <ids...>\", when merging a component from a remote to the local.\n * in this case, the remote and local are on the same lane or both on main.\n * 2. \"bit lane merge\", when merging from one lane to another.\n */\n async getMergeStatus(\n bitIds: ComponentID[], // the id.version is the version we want to merge to the current component\n currentLane: Lane | null, // currently checked out lane. if on main, then it's null.\n otherLane?: Lane | null, // the lane we want to merged to our lane. (null if it's \"main\").\n options?: MergeStatusProviderOptions\n ): Promise<ComponentMergeStatus[]> {\n const mergeStatusProvider = new MergeStatusProvider(\n this.workspace,\n this.logger,\n this.importer,\n currentLane || undefined,\n otherLane || undefined,\n options\n );\n return mergeStatusProvider.getStatus(bitIds);\n }\n\n private async applyVersionMultiple(\n succeededComponents: ComponentMergeStatus[],\n otherLaneId: LaneId,\n mergeStrategy: MergeStrategy,\n currentLane: Lane | null\n ): Promise<ApplyVersionWithComps[]> {\n const componentsResults = await mapSeries(\n succeededComponents,\n async ({ currentComponent, id, mergeResults, resolvedUnrelated, configMergeResult }) => {\n const modelComponent = await this.workspace.consumer.scope.getModelComponent(id);\n const updatedLaneId = otherLaneId.isDefault() ? LaneId.from(otherLaneId.name, id.scope as string) : otherLaneId;\n return this.applyVersion({\n currentComponent,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead: modelComponent.getRef(id.version as string) as Ref,\n otherLaneId: updatedLaneId,\n currentLane,\n resolvedUnrelated,\n configMergeResult,\n });\n }\n );\n\n const compsToWrite = compact(componentsResults.map((c) => c.legacyCompToWrite));\n\n const manyComponentsWriterOpts = {\n consumer: this.workspace.consumer,\n components: compsToWrite,\n skipDependencyInstallation: true,\n writeConfig: false, // @todo: should write if config exists before, needs to figure out how to do it.\n reasonForBitmapChange: 'merge',\n };\n await this.componentWriter.writeMany(manyComponentsWriterOpts);\n\n return componentsResults;\n }\n\n private async applyVersion({\n currentComponent,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead,\n otherLaneId,\n currentLane,\n resolvedUnrelated,\n configMergeResult,\n }: {\n currentComponent: ConsumerComponent | null | undefined;\n id: ComponentID;\n mergeResults: MergeResultsThreeWay | null | undefined;\n mergeStrategy: MergeStrategy;\n remoteHead: Ref;\n otherLaneId: LaneId;\n currentLane: Lane | null;\n resolvedUnrelated?: ResolveUnrelatedData;\n configMergeResult?: ConfigMergeResult;\n }): Promise<ApplyVersionWithComps> {\n const consumer = this.workspace.consumer;\n let filesStatus = {};\n const unmergedComponent: UnmergedComponent = {\n id: { name: id.fullName, scope: id.scope },\n head: remoteHead,\n laneId: otherLaneId,\n };\n id = currentComponent ? currentComponent.id : id;\n\n const modelComponent = await consumer.scope.getModelComponent(id);\n\n const addToCurrentLane = (head: Ref) => {\n if (!currentLane) throw new Error('currentLane must be defined when adding to the lane');\n if (otherLaneId.isDefault()) {\n const isPartOfLane = currentLane.components.find((c) => c.id.isEqualWithoutVersion(id));\n if (!isPartOfLane) return;\n }\n currentLane.addComponent({ id, head });\n };\n\n const handleResolveUnrelated = (legacyCompToWrite?: ConsumerComponent) => {\n if (!currentComponent) throw new Error('currentComponent must be defined when resolvedUnrelated');\n // because when on a main, we don't allow merging lanes with unrelated. we asks users to switch to the lane\n // first and then merge with --resolve-unrelated\n if (!currentLane) throw new Error('currentLane must be defined when resolvedUnrelated');\n if (!resolvedUnrelated) throw new Error('resolvedUnrelated must be populated');\n addToCurrentLane(resolvedUnrelated.headOnCurrentLane);\n unmergedComponent.unrelated = {\n unrelatedHead: resolvedUnrelated.unrelatedHead,\n headOnCurrentLane: resolvedUnrelated.headOnCurrentLane,\n unrelatedLaneId: resolvedUnrelated.unrelatedLaneId,\n };\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n return { applyVersionResult: { id, filesStatus }, component: currentComponent, legacyCompToWrite };\n };\n\n const markAllFilesAsUnchanged = () => {\n if (!currentComponent) throw new Error(`applyVersion expect to get currentComponent for ${id.toString()}`);\n currentComponent.files.forEach((file) => {\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n };\n if (mergeResults && mergeResults.hasConflicts && mergeStrategy === MergeOptions.ours) {\n markAllFilesAsUnchanged();\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n return { applyVersionResult: { id, filesStatus }, component: currentComponent || undefined };\n }\n if (resolvedUnrelated?.strategy === 'ours') {\n markAllFilesAsUnchanged();\n return handleResolveUnrelated();\n }\n const remoteId = id.changeVersion(remoteHead.toString());\n const idToLoad = !mergeResults || mergeStrategy === MergeOptions.theirs ? remoteId : id;\n const legacyComponent = await consumer.loadComponentFromModelImportIfNeeded(idToLoad);\n if (mergeResults && mergeStrategy === MergeOptions.theirs) {\n // in this case, we don't want to update .bitmap with the version of the remote. we want to keep the same version\n legacyComponent.version = id.version;\n }\n const files = legacyComponent.files;\n updateFileStatus(files, filesStatus, currentComponent || undefined);\n\n if (mergeResults) {\n // update files according to the merge results\n const { filesStatus: modifiedStatus, modifiedFiles } = applyModifiedVersion(files, mergeResults, mergeStrategy);\n legacyComponent.files = modifiedFiles;\n filesStatus = { ...filesStatus, ...modifiedStatus };\n }\n\n await removeFilesIfNeeded(filesStatus, currentComponent || undefined);\n\n if (configMergeResult) {\n const successfullyMergedConfig = configMergeResult.getSuccessfullyMergedConfig();\n if (successfullyMergedConfig) {\n unmergedComponent.mergedConfig = successfullyMergedConfig;\n // no need to `unmergedComponents.addEntry` here. it'll be added in the next lines inside `if (mergeResults)`.\n // because if `configMergeResult` is set, `mergeResults` must be set as well. both happen on diverge.\n }\n }\n\n // if mergeResults, the head snap is going to be updated on a later phase when snapping with two parents\n // otherwise, update the head of the current lane or main\n if (mergeResults) {\n if (mergeResults.hasConflicts && mergeStrategy === MergeOptions.manual) {\n unmergedComponent.unmergedPaths = mergeResults.modifiedFiles.filter((f) => f.conflict).map((f) => f.filePath);\n }\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n } else if (currentLane) {\n if (resolvedUnrelated) {\n // must be \"theirs\"\n return handleResolveUnrelated(legacyComponent);\n }\n addToCurrentLane(remoteHead);\n } else {\n // this is main\n modelComponent.setHead(remoteHead);\n // mark it as local, otherwise, when importing this component from a remote, it'll override it.\n modelComponent.markVersionAsLocal(remoteHead.toString());\n consumer.scope.objects.add(modelComponent);\n }\n\n return {\n applyVersionResult: { id, filesStatus },\n component: currentComponent || undefined,\n legacyCompToWrite: legacyComponent,\n };\n }\n\n private async abortMerge(values: string[]): Promise<ApplyVersionResults> {\n const consumer = this.workspace.consumer;\n const ids = await this.getIdsForUnmerged(values);\n const results = await this.checkout.checkout({ ids, reset: true });\n ids.forEach((id) => consumer.scope.objects.unmergedComponents.removeComponent(id));\n await consumer.scope.objects.unmergedComponents.write();\n return { abortedComponents: results.components };\n }\n\n private async resolveMerge(values: string[], snapMessage: string, build: boolean): Promise<ApplyVersionResults> {\n const ids = await this.getIdsForUnmerged(values);\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const { snappedComponents } = await this.snapping.snap({\n legacyBitIds: ComponentIdList.fromArray(ids.map((id) => id)),\n build,\n message: snapMessage,\n });\n return { resolvedComponents: snappedComponents };\n }\n\n private async getAllComponentsStatus(\n bitIds: ComponentID[],\n laneId: LaneId,\n localLaneObject: Lane | null\n ): Promise<ComponentMergeStatus[]> {\n const ids = await Promise.all(\n bitIds.map(async (bitId) => {\n const remoteScopeName = laneId.isDefault() ? bitId.scope : laneId.scope;\n const remoteLaneId = LaneId.from(laneId.name, remoteScopeName as string);\n const remoteHead = await this.workspace.consumer.scope.objects.remoteLanes.getRef(remoteLaneId, bitId);\n const laneIdStr = remoteLaneId.toString();\n if (!remoteHead) {\n throw new BitError(`unable to find a remote head of \"${bitId.toStringWithoutVersion()}\" in \"${laneIdStr}\"`);\n }\n return bitId.changeVersion(remoteHead.toString());\n })\n );\n\n return this.getMergeStatus(ids, localLaneObject, localLaneObject, { shouldSquash: false });\n }\n\n private async snapResolvedComponents(\n consumer: Consumer,\n snapMessage: string,\n build: boolean\n ): Promise<SnapResults | null> {\n const unmergedComponents = consumer.scope.objects.unmergedComponents.getComponents();\n this.logger.debug(`merge-snaps, snapResolvedComponents, total ${unmergedComponents.length.toString()} components`);\n if (!unmergedComponents.length) return null;\n const ids = ComponentIdList.fromArray(unmergedComponents.map((r) => ComponentID.fromObject(r.id)));\n return this.snapping.snap({\n legacyBitIds: ids,\n build,\n message: snapMessage,\n });\n }\n\n private async tagAllLaneComponent(\n idsToTag: ComponentID[],\n tagMessage: string,\n build: boolean\n ): Promise<TagResults | null> {\n const ids = idsToTag.map((id) => {\n return id.toStringWithoutVersion();\n });\n this.logger.debug(`merge-snaps, tagResolvedComponents, total ${idsToTag.length.toString()} components`);\n return this.snapping.tag({\n ids,\n build,\n message: tagMessage,\n unmodified: true,\n });\n }\n\n private async getIdsForUnmerged(idsStr?: string[]): Promise<ComponentID[]> {\n if (idsStr && idsStr.length) {\n const componentIds = await this.workspace.resolveMultipleComponentIds(idsStr);\n componentIds.forEach((id) => {\n const entry = this.workspace.consumer.scope.objects.unmergedComponents.getEntry(id);\n if (!entry) {\n throw new GeneralError(`unable to merge-resolve ${id.toString()}, it is not marked as unresolved`);\n }\n });\n return componentIds;\n }\n const unresolvedComponents = this.workspace.consumer.scope.objects.unmergedComponents.getComponents();\n if (!unresolvedComponents.length) throw new GeneralError(`all components are resolved already, nothing to do`);\n return unresolvedComponents.map((u) => ComponentID.fromObject(u.id));\n }\n\n private async getComponentsToMerge(consumer: Consumer, ids: string[]): Promise<ComponentID[]> {\n const componentsList = new ComponentsList(consumer);\n if (!ids.length) {\n const mergePending = await componentsList.listMergePendingComponents();\n return mergePending.map((c) => c.id);\n }\n if (hasWildcard(ids)) {\n return componentsList.listComponentsByIdsWithWildcard(ids);\n }\n return ids.map((id) => consumer.getParsedId(id));\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n SnappingAspect,\n CheckoutAspect,\n InstallAspect,\n LoggerAspect,\n ComponentWriterAspect,\n ImporterAspect,\n ConfigAspect,\n RemoveAspect,\n GlobalConfigAspect,\n ConfigMergerAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n cli,\n workspace,\n snapping,\n checkout,\n install,\n loggerMain,\n compWriter,\n importer,\n config,\n remove,\n globalConfig,\n configMerger,\n ]: [\n CLIMain,\n Workspace,\n SnappingMain,\n CheckoutMain,\n InstallMain,\n LoggerMain,\n ComponentWriterMain,\n ImporterMain,\n ConfigMain,\n RemoveMain,\n GlobalConfigMain,\n ConfigMergerMain\n ]) {\n const logger = loggerMain.createLogger(MergingAspect.id);\n const merging = new MergingMain(\n workspace,\n install,\n snapping,\n checkout,\n logger,\n compWriter,\n importer,\n config,\n remove,\n configMerger\n );\n cli.register(new MergeCmd(merging, globalConfig));\n return merging;\n }\n}\n\nMergingAspect.addRuntime(MergingMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,gBAAA;EAAA,MAAAJ,IAAA,GAAAK,sBAAA,CAAAJ,OAAA;EAAAG,eAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,cAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,aAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAMA,SAAAO,UAAA;EAAA,MAAAP,IAAA,GAAAK,sBAAA,CAAAJ,OAAA;EAAAM,SAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;A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ACpB,OAAO8M,cAAc,CAACK,+BAA+B,CAACnN,GAAG,CAAC;IAC5D;IACA,OAAOA,GAAG,CAAC6B,GAAG,CAAEI,EAAE,IAAKxB,QAAQ,CAAC2M,WAAW,CAACnL,EAAE,CAAC,CAAC;EAClD;EAkBA,aAAaoL,QAAQA,CAAC,CACpBC,GAAG,EACHjO,SAAS,EACTE,QAAQ,EACRC,QAAQ,EACRF,OAAO,EACPiO,UAAU,EACVC,UAAU,EACV7N,QAAQ,EACRC,MAAM,EACNC,MAAM,EACN4N,YAAY,EACZ3N,YAAY,CAcb,EAAE;IACD,MAAML,MAAM,GAAG8N,UAAU,CAACG,YAAY,CAACC,wBAAa,CAAC1L,EAAE,CAAC;IACxD,MAAM2L,OAAO,GAAG,IAAIzO,WAAW,CAC7BE,SAAS,EACTC,OAAO,EACPC,QAAQ,EACRC,QAAQ,EACRC,MAAM,EACN+N,UAAU,EACV7N,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,YACF,CAAC;IACDwN,GAAG,CAACO,QAAQ,CAAC,KAAIC,oBAAQ,EAACF,OAAO,EAAEH,YAAY,CAAC,CAAC;IACjD,OAAOG,OAAO;EAChB;AACF;AAACG,OAAA,CAAA5O,WAAA,GAAAA,WAAA;AAAAd,eAAA,CA1jBYc,WAAW,WA+fP,EAAE;AAAAd,eAAA,CA/fNc,WAAW,kBAggBA,CACpB6O,gBAAS,EACTC,oBAAe,EACfC,mBAAc,EACdC,0BAAc,EACdC,wBAAa,EACbC,sBAAY,EACZC,wCAAqB,EACrBC,mBAAc,EACdC,sBAAY,EACZC,iBAAY,EACZC,uBAAkB,EAClBC,kCAAkB,CACnB;AAAAtQ,eAAA,CA7gBUc,WAAW,aA8gBLyP,kBAAW;AA8C9BjB,wBAAa,CAACkB,UAAU,CAAC1P,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_workspace","_interopRequireWildcard","_componentsList","_interopRequireDefault","_mergeVersion","_snapping","_hasWildcard","_pMapSeries","_componentId","_bitError","_generalError","_laneId","_chalk","_config","_remove","_utils","_componentWriter","_importer","_logger","_globalConfig","_lodash","_checkout","_deleteComponentFiles","_configMerger","_install","_mergeCmd","_merging","_mergeStatusProvider","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","key","value","_toPropertyKey","configurable","writable","_toPrimitive","String","Symbol","toPrimitive","TypeError","Number","MergingMain","constructor","workspace","install","snapping","checkout","logger","componentWriter","importer","config","remove","configMerger","merge","ids","mergeStrategy","abort","resolve","noSnap","message","build","skipDependencyInstallation","OutsideWorkspaceError","consumer","mergeResults","resolveMerge","abortMerge","bitIds","getComponentsToMerge","mergeComponentsFromRemote","onDestroy","snapMessage","currentLaneId","getCurrentLaneId","currentLaneObject","getCurrentLaneObject","allComponentsStatus","getAllComponentsStatus","failedComponents","c","unchangedMessage","unchangedLegitimately","failureMsgs","map","failedComponent","chalk","bold","id","toString","red","join","BitError","mergeSnaps","otherLaneId","currentLane","tag","componentWithConflict","find","component","hasConflicts","getMergeStrategyInteractive","componentStatus","shouldBeRemoved","componentIdsToRemove","changeVersion","undefined","succeededComponents","componentsResults","applyVersionMultiple","allConfigMerge","compact","configMergeResult","workspaceDepsUpdates","workspaceDepsConflicts","updateWorkspaceJsoncWithDepsIfNeeded","workspaceConfigConflictWriteError","writeWorkspaceJsoncWithConflictsGracefully","generateConfigMergeConflictFileForAll","scope","objects","add","persist","unmergedComponents","write","writeBitMap","compBitIdsToRemove","ComponentIdList","fromArray","deleteComponentsFiles","cleanFromBitMap","componentsHasConfigMergeConflicts","some","leftUnresolvedConflicts","dedupe","updateExisting","import","err","error","consoleError","getSnapOrTagResults","idsToTag","results","tagAllLaneComponent","taggedComponents","autoTaggedResults","removedComponents","snappedComponents","autoSnappedResults","snapResolvedComponents","mergeSnapResults","mergeSnapError","bitMapSnapshot","bitMap","takeSnapshot","restoreFromSnapshot","components","applyVersionResult","workspaceConfigUpdateResult","getMergeStatus","otherLane","options","mergeStatusProvider","MergeStatusProvider","getStatus","mapSeries","currentComponent","resolvedUnrelated","modelComponent","getModelComponent","updatedLaneId","isDefault","LaneId","from","name","applyVersion","remoteHead","getRef","version","compsToWrite","legacyCompToWrite","manyComponentsWriterOpts","writeConfig","reasonForBitmapChange","writeMany","filesStatus","unmergedComponent","fullName","head","laneId","addToCurrentLane","Error","isPartOfLane","isEqualWithoutVersion","addComponent","handleResolveUnrelated","headOnCurrentLane","unrelated","unrelatedHead","unrelatedLaneId","addEntry","markAllFilesAsUnchanged","files","file","pathNormalizeToLinux","relative","FileStatus","unchanged","MergeOptions","ours","strategy","remoteId","idToLoad","theirs","legacyComponent","loadComponentFromModelImportIfNeeded","updateFileStatus","modifiedStatus","modifiedFiles","applyModifiedVersion","removeFilesIfNeeded","successfullyMergedConfig","getSuccessfullyMergedConfig","mergedConfig","manual","unmergedPaths","f","conflict","filePath","setHead","markVersionAsLocal","values","getIdsForUnmerged","reset","removeComponent","abortedComponents","snap","legacyBitIds","resolvedComponents","localLaneObject","Promise","all","bitId","remoteScopeName","remoteLaneId","remoteLanes","laneIdStr","toStringWithoutVersion","shouldSquash","getComponents","debug","ComponentID","fromObject","tagMessage","unmodified","idsStr","componentIds","resolveMultipleComponentIds","entry","getEntry","GeneralError","unresolvedComponents","componentsList","ComponentsList","mergePending","listMergePendingComponents","hasWildcard","listComponentsByIdsWithWildcard","getParsedId","provider","cli","loggerMain","compWriter","globalConfig","createLogger","MergingAspect","merging","register","MergeCmd","exports","CLIAspect","WorkspaceAspect","SnappingAspect","CheckoutAspect","InstallAspect","LoggerAspect","ComponentWriterAspect","ImporterAspect","ConfigAspect","RemoveAspect","GlobalConfigAspect","ConfigMergerAspect","MainRuntime","addRuntime"],"sources":["merging.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport {\n MergeStrategy,\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport SnappingAspect, { SnapResults, SnappingMain, TagResults } from '@teambit/snapping';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport mapSeries from 'p-map-series';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport { LaneId } from '@teambit/lane-id';\nimport { AutoTagResult } from '@teambit/legacy/dist/scope/component-ops/auto-tag';\nimport { UnmergedComponent } from '@teambit/legacy/dist/scope/lanes/unmerged-components';\nimport { Lane, ModelComponent } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport chalk from 'chalk';\nimport { ConfigAspect, ConfigMain } from '@teambit/config';\nimport RemoveAspect, { RemoveMain } from '@teambit/remove';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport { ComponentWriterAspect, ComponentWriterMain } from '@teambit/component-writer';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport ImporterAspect, { ImporterMain } from '@teambit/importer';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport GlobalConfigAspect, { GlobalConfigMain } from '@teambit/global-config';\nimport { compact } from 'lodash';\nimport { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport {\n ApplyVersionWithComps,\n CheckoutAspect,\n CheckoutMain,\n ComponentStatusBase,\n applyModifiedVersion,\n removeFilesIfNeeded,\n updateFileStatus,\n} from '@teambit/checkout';\nimport deleteComponentsFiles from '@teambit/legacy/dist/consumer/component-ops/delete-component-files';\nimport {\n ConfigMergerAspect,\n ConfigMergerMain,\n ConfigMergeResult,\n WorkspaceConfigUpdateResult,\n} from '@teambit/config-merger';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport { InstallMain, InstallAspect } from '@teambit/install';\nimport { MergeCmd } from './merge-cmd';\nimport { MergingAspect } from './merging.aspect';\nimport { MergeStatusProvider, MergeStatusProviderOptions } from './merge-status-provider';\n\ntype ResolveUnrelatedData = {\n strategy: MergeStrategy;\n headOnCurrentLane: Ref;\n unrelatedHead: Ref;\n unrelatedLaneId: LaneId;\n};\n\nexport type ComponentMergeStatus = ComponentStatusBase & {\n mergeResults?: MergeResultsThreeWay | null;\n divergeData?: SnapsDistance;\n resolvedUnrelated?: ResolveUnrelatedData;\n configMergeResult?: ConfigMergeResult;\n};\n\nexport type ComponentMergeStatusBeforeMergeAttempt = ComponentStatusBase & {\n divergeData?: SnapsDistance;\n resolvedUnrelated?: ResolveUnrelatedData;\n mergeProps?: {\n otherLaneHead: Ref;\n currentId: ComponentID;\n modelComponent: ModelComponent;\n };\n};\n\nexport type FailedComponents = { id: ComponentID; unchangedMessage: string; unchangedLegitimately?: boolean };\n\n// fileName is PathLinux. TS doesn't let anything else in the keys other than string and number\nexport type FilesStatus = { [fileName: string]: keyof typeof FileStatus };\n\nexport type ApplyVersionResult = { id: ComponentID; filesStatus: FilesStatus };\n\nexport type ApplyVersionResults = {\n components?: ApplyVersionResult[];\n version?: string;\n failedComponents?: FailedComponents[];\n removedComponents?: ComponentID[];\n addedComponents?: ComponentID[]; // relevant when restoreMissingComponents is true (e.g. bit lane merge-abort)\n resolvedComponents?: ConsumerComponent[]; // relevant for bit merge --resolve\n abortedComponents?: ApplyVersionResult[]; // relevant for bit merge --abort\n mergeSnapResults?: {\n snappedComponents: ConsumerComponent[];\n autoSnappedResults: AutoTagResult[];\n removedComponents?: ComponentIdList;\n } | null;\n mergeSnapError?: Error;\n leftUnresolvedConflicts?: boolean;\n verbose?: boolean;\n newFromLane?: string[];\n newFromLaneAdded?: boolean;\n installationError?: Error; // in case the package manager failed, it won't throw, instead, it'll return error here\n compilationError?: Error; // in case the compiler failed, it won't throw, instead, it'll return error here\n workspaceConfigUpdateResult?: WorkspaceConfigUpdateResult;\n};\n\nexport class MergingMain {\n constructor(\n private workspace: Workspace,\n private install: InstallMain,\n private snapping: SnappingMain,\n private checkout: CheckoutMain,\n private logger: Logger,\n private componentWriter: ComponentWriterMain,\n private importer: ImporterMain,\n private config: ConfigMain,\n private remove: RemoveMain,\n private configMerger: ConfigMergerMain\n ) {}\n\n async merge(\n ids: string[],\n mergeStrategy: MergeStrategy,\n abort: boolean,\n resolve: boolean,\n noSnap: boolean,\n message: string,\n build: boolean,\n skipDependencyInstallation: boolean\n ): Promise<ApplyVersionResults> {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const consumer: Consumer = this.workspace.consumer;\n let mergeResults;\n if (resolve) {\n mergeResults = await this.resolveMerge(ids, message, build);\n } else if (abort) {\n mergeResults = await this.abortMerge(ids);\n } else {\n const bitIds = await this.getComponentsToMerge(consumer, ids);\n mergeResults = await this.mergeComponentsFromRemote(\n consumer,\n bitIds,\n mergeStrategy,\n noSnap,\n message,\n build,\n skipDependencyInstallation\n );\n }\n await consumer.onDestroy('merge');\n return mergeResults;\n }\n\n /**\n * when user is on main, it merges the remote main components into local.\n * when user is on a lane, it merges the remote lane components into the local lane.\n */\n async mergeComponentsFromRemote(\n consumer: Consumer,\n bitIds: ComponentID[],\n mergeStrategy: MergeStrategy,\n noSnap: boolean,\n snapMessage: string,\n build: boolean,\n skipDependencyInstallation: boolean\n ): Promise<ApplyVersionResults> {\n const currentLaneId = consumer.getCurrentLaneId();\n const currentLaneObject = await consumer.getCurrentLaneObject();\n const allComponentsStatus = await this.getAllComponentsStatus(bitIds, currentLaneId, currentLaneObject);\n const failedComponents = allComponentsStatus.filter((c) => c.unchangedMessage && !c.unchangedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unchangedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to merge due to the following failures:\\n${failureMsgs}`);\n }\n\n return this.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n otherLaneId: currentLaneId,\n currentLane: currentLaneObject,\n noSnap,\n snapMessage,\n build,\n skipDependencyInstallation,\n });\n }\n\n /**\n * merge multiple components according to the \"allComponentsStatus\".\n */\n async mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n otherLaneId,\n currentLane,\n noSnap,\n tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n }: {\n mergeStrategy: MergeStrategy;\n allComponentsStatus: ComponentMergeStatus[];\n otherLaneId: LaneId;\n currentLane: Lane | null;\n noSnap: boolean;\n tag?: boolean;\n snapMessage: string;\n build: boolean;\n skipDependencyInstallation?: boolean;\n }): Promise<ApplyVersionResults> {\n const consumer = this.workspace.consumer;\n const componentWithConflict = allComponentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict && !mergeStrategy) {\n mergeStrategy = await getMergeStrategyInteractive();\n }\n const failedComponents: FailedComponents[] = allComponentsStatus\n .filter((componentStatus) => componentStatus.unchangedMessage)\n .filter((componentStatus) => !componentStatus.shouldBeRemoved)\n .map((componentStatus) => ({\n id: componentStatus.id,\n unchangedMessage: componentStatus.unchangedMessage as string,\n unchangedLegitimately: componentStatus.unchangedLegitimately,\n }));\n\n const componentIdsToRemove = allComponentsStatus\n .filter((componentStatus) => componentStatus.shouldBeRemoved)\n .map((c) => c.id.changeVersion(undefined));\n\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.unchangedMessage);\n\n const componentsResults = await this.applyVersionMultiple(\n succeededComponents,\n otherLaneId,\n mergeStrategy,\n currentLane\n );\n\n const allConfigMerge = compact(succeededComponents.map((c) => c.configMergeResult));\n\n const { workspaceDepsUpdates, workspaceDepsConflicts } =\n await this.configMerger.updateWorkspaceJsoncWithDepsIfNeeded(allConfigMerge);\n\n let workspaceConfigConflictWriteError: Error | undefined;\n if (workspaceDepsConflicts) {\n workspaceConfigConflictWriteError = await this.configMerger.writeWorkspaceJsoncWithConflictsGracefully(\n workspaceDepsConflicts\n );\n }\n await this.configMerger.generateConfigMergeConflictFileForAll(allConfigMerge);\n\n if (currentLane) consumer.scope.objects.add(currentLane);\n\n await consumer.scope.objects.persist(); // persist anyway, if currentLane is null it should save all main heads\n\n await consumer.scope.objects.unmergedComponents.write();\n\n await consumer.writeBitMap(`merge ${otherLaneId.toString()}`);\n\n if (componentIdsToRemove.length) {\n const compBitIdsToRemove = ComponentIdList.fromArray(componentIdsToRemove);\n await deleteComponentsFiles(consumer, compBitIdsToRemove);\n await consumer.cleanFromBitMap(compBitIdsToRemove);\n }\n\n const componentsHasConfigMergeConflicts = allComponentsStatus.some((c) => c.configMergeResult?.hasConflicts());\n const leftUnresolvedConflicts = componentWithConflict && mergeStrategy === 'manual';\n if (!skipDependencyInstallation && !leftUnresolvedConflicts && !componentsHasConfigMergeConflicts) {\n try {\n await this.install.install(undefined, {\n dedupe: true,\n updateExisting: false,\n import: false,\n });\n } catch (err: any) {\n this.logger.error(`failed installing packages`, err);\n this.logger.consoleError(`failed installing packages, see the log for full stacktrace. error: ${err.message}`);\n }\n }\n\n const getSnapOrTagResults = async () => {\n // if one of the component has conflict, don't snap-merge. otherwise, some of the components would be snap-merged\n // and some not. besides the fact that it could by mistake tag dependent, it's a confusing state. better not snap.\n if (noSnap || leftUnresolvedConflicts || componentsHasConfigMergeConflicts) {\n return null;\n }\n if (tag) {\n const idsToTag = allComponentsStatus.map((c) => c.id);\n const results = await this.tagAllLaneComponent(idsToTag, snapMessage, build);\n if (!results) return null;\n const { taggedComponents, autoTaggedResults, removedComponents } = results;\n return { snappedComponents: taggedComponents, autoSnappedResults: autoTaggedResults, removedComponents };\n }\n return this.snapResolvedComponents(consumer, snapMessage, build);\n };\n let mergeSnapResults: ApplyVersionResults['mergeSnapResults'] = null;\n let mergeSnapError: Error | undefined;\n const bitMapSnapshot = this.workspace.bitMap.takeSnapshot();\n try {\n mergeSnapResults = await getSnapOrTagResults();\n } catch (err: any) {\n mergeSnapError = err;\n this.workspace.bitMap.restoreFromSnapshot(bitMapSnapshot);\n }\n\n return {\n components: componentsResults.map((c) => c.applyVersionResult),\n failedComponents,\n removedComponents: [...componentIdsToRemove, ...(mergeSnapResults?.removedComponents || [])],\n mergeSnapResults,\n mergeSnapError,\n workspaceConfigUpdateResult: {\n workspaceDepsUpdates,\n workspaceDepsConflicts,\n workspaceConfigConflictWriteError,\n },\n leftUnresolvedConflicts,\n };\n }\n\n /**\n * this function gets called from two different commands:\n * 1. \"bit merge <ids...>\", when merging a component from a remote to the local.\n * in this case, the remote and local are on the same lane or both on main.\n * 2. \"bit lane merge\", when merging from one lane to another.\n */\n async getMergeStatus(\n bitIds: ComponentID[], // the id.version is the version we want to merge to the current component\n currentLane: Lane | null, // currently checked out lane. if on main, then it's null.\n otherLane?: Lane | null, // the lane we want to merged to our lane. (null if it's \"main\").\n options?: MergeStatusProviderOptions\n ): Promise<ComponentMergeStatus[]> {\n const mergeStatusProvider = new MergeStatusProvider(\n this.workspace,\n this.logger,\n this.importer,\n currentLane || undefined,\n otherLane || undefined,\n options\n );\n return mergeStatusProvider.getStatus(bitIds);\n }\n\n private async applyVersionMultiple(\n succeededComponents: ComponentMergeStatus[],\n otherLaneId: LaneId,\n mergeStrategy: MergeStrategy,\n currentLane: Lane | null\n ): Promise<ApplyVersionWithComps[]> {\n const componentsResults = await mapSeries(\n succeededComponents,\n async ({ currentComponent, id, mergeResults, resolvedUnrelated, configMergeResult }) => {\n const modelComponent = await this.workspace.consumer.scope.getModelComponent(id);\n const updatedLaneId = otherLaneId.isDefault() ? LaneId.from(otherLaneId.name, id.scope as string) : otherLaneId;\n return this.applyVersion({\n currentComponent,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead: modelComponent.getRef(id.version as string) as Ref,\n otherLaneId: updatedLaneId,\n currentLane,\n resolvedUnrelated,\n configMergeResult,\n });\n }\n );\n\n const compsToWrite = compact(componentsResults.map((c) => c.legacyCompToWrite));\n\n const manyComponentsWriterOpts = {\n consumer: this.workspace.consumer,\n components: compsToWrite,\n skipDependencyInstallation: true,\n writeConfig: false, // @todo: should write if config exists before, needs to figure out how to do it.\n reasonForBitmapChange: 'merge',\n };\n await this.componentWriter.writeMany(manyComponentsWriterOpts);\n\n return componentsResults;\n }\n\n private async applyVersion({\n currentComponent,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead,\n otherLaneId,\n currentLane,\n resolvedUnrelated,\n configMergeResult,\n }: {\n currentComponent: ConsumerComponent | null | undefined;\n id: ComponentID;\n mergeResults: MergeResultsThreeWay | null | undefined;\n mergeStrategy: MergeStrategy;\n remoteHead: Ref;\n otherLaneId: LaneId;\n currentLane: Lane | null;\n resolvedUnrelated?: ResolveUnrelatedData;\n configMergeResult?: ConfigMergeResult;\n }): Promise<ApplyVersionWithComps> {\n const consumer = this.workspace.consumer;\n let filesStatus = {};\n const unmergedComponent: UnmergedComponent = {\n id: { name: id.fullName, scope: id.scope },\n head: remoteHead,\n laneId: otherLaneId,\n };\n id = currentComponent ? currentComponent.id : id;\n\n const modelComponent = await consumer.scope.getModelComponent(id);\n\n const addToCurrentLane = (head: Ref) => {\n if (!currentLane) throw new Error('currentLane must be defined when adding to the lane');\n if (otherLaneId.isDefault()) {\n const isPartOfLane = currentLane.components.find((c) => c.id.isEqualWithoutVersion(id));\n if (!isPartOfLane) return;\n }\n currentLane.addComponent({ id, head });\n };\n\n const handleResolveUnrelated = (legacyCompToWrite?: ConsumerComponent) => {\n if (!currentComponent) throw new Error('currentComponent must be defined when resolvedUnrelated');\n // because when on a main, we don't allow merging lanes with unrelated. we asks users to switch to the lane\n // first and then merge with --resolve-unrelated\n if (!currentLane) throw new Error('currentLane must be defined when resolvedUnrelated');\n if (!resolvedUnrelated) throw new Error('resolvedUnrelated must be populated');\n addToCurrentLane(resolvedUnrelated.headOnCurrentLane);\n unmergedComponent.unrelated = {\n unrelatedHead: resolvedUnrelated.unrelatedHead,\n headOnCurrentLane: resolvedUnrelated.headOnCurrentLane,\n unrelatedLaneId: resolvedUnrelated.unrelatedLaneId,\n };\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n return { applyVersionResult: { id, filesStatus }, component: currentComponent, legacyCompToWrite };\n };\n\n const markAllFilesAsUnchanged = () => {\n if (!currentComponent) throw new Error(`applyVersion expect to get currentComponent for ${id.toString()}`);\n currentComponent.files.forEach((file) => {\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n };\n if (mergeResults && mergeResults.hasConflicts && mergeStrategy === MergeOptions.ours) {\n markAllFilesAsUnchanged();\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n return { applyVersionResult: { id, filesStatus }, component: currentComponent || undefined };\n }\n if (resolvedUnrelated?.strategy === 'ours') {\n markAllFilesAsUnchanged();\n return handleResolveUnrelated();\n }\n const remoteId = id.changeVersion(remoteHead.toString());\n const idToLoad = !mergeResults || mergeStrategy === MergeOptions.theirs ? remoteId : id;\n const legacyComponent = await consumer.loadComponentFromModelImportIfNeeded(idToLoad);\n if (mergeResults && mergeStrategy === MergeOptions.theirs) {\n // in this case, we don't want to update .bitmap with the version of the remote. we want to keep the same version\n legacyComponent.version = id.version;\n }\n const files = legacyComponent.files;\n updateFileStatus(files, filesStatus, currentComponent || undefined);\n\n if (mergeResults) {\n // update files according to the merge results\n const { filesStatus: modifiedStatus, modifiedFiles } = applyModifiedVersion(files, mergeResults, mergeStrategy);\n legacyComponent.files = modifiedFiles;\n filesStatus = { ...filesStatus, ...modifiedStatus };\n }\n\n await removeFilesIfNeeded(filesStatus, currentComponent || undefined);\n\n if (configMergeResult) {\n const successfullyMergedConfig = configMergeResult.getSuccessfullyMergedConfig();\n if (successfullyMergedConfig) {\n unmergedComponent.mergedConfig = successfullyMergedConfig;\n // no need to `unmergedComponents.addEntry` here. it'll be added in the next lines inside `if (mergeResults)`.\n // because if `configMergeResult` is set, `mergeResults` must be set as well. both happen on diverge.\n }\n }\n\n // if mergeResults, the head snap is going to be updated on a later phase when snapping with two parents\n // otherwise, update the head of the current lane or main\n if (mergeResults) {\n if (mergeResults.hasConflicts && mergeStrategy === MergeOptions.manual) {\n unmergedComponent.unmergedPaths = mergeResults.modifiedFiles.filter((f) => f.conflict).map((f) => f.filePath);\n }\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n } else if (currentLane) {\n if (resolvedUnrelated) {\n // must be \"theirs\"\n return handleResolveUnrelated(legacyComponent);\n }\n addToCurrentLane(remoteHead);\n } else {\n // this is main\n modelComponent.setHead(remoteHead);\n // mark it as local, otherwise, when importing this component from a remote, it'll override it.\n modelComponent.markVersionAsLocal(remoteHead.toString());\n consumer.scope.objects.add(modelComponent);\n }\n\n return {\n applyVersionResult: { id, filesStatus },\n component: currentComponent || undefined,\n legacyCompToWrite: legacyComponent,\n };\n }\n\n private async abortMerge(values: string[]): Promise<ApplyVersionResults> {\n const consumer = this.workspace.consumer;\n const ids = await this.getIdsForUnmerged(values);\n const results = await this.checkout.checkout({ ids, reset: true });\n ids.forEach((id) => consumer.scope.objects.unmergedComponents.removeComponent(id));\n await consumer.scope.objects.unmergedComponents.write();\n return { abortedComponents: results.components };\n }\n\n private async resolveMerge(values: string[], snapMessage: string, build: boolean): Promise<ApplyVersionResults> {\n const ids = await this.getIdsForUnmerged(values);\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const { snappedComponents } = await this.snapping.snap({\n legacyBitIds: ComponentIdList.fromArray(ids.map((id) => id)),\n build,\n message: snapMessage,\n });\n return { resolvedComponents: snappedComponents };\n }\n\n private async getAllComponentsStatus(\n bitIds: ComponentID[],\n laneId: LaneId,\n localLaneObject: Lane | null\n ): Promise<ComponentMergeStatus[]> {\n const ids = await Promise.all(\n bitIds.map(async (bitId) => {\n const remoteScopeName = laneId.isDefault() ? bitId.scope : laneId.scope;\n const remoteLaneId = LaneId.from(laneId.name, remoteScopeName as string);\n const remoteHead = await this.workspace.consumer.scope.objects.remoteLanes.getRef(remoteLaneId, bitId);\n const laneIdStr = remoteLaneId.toString();\n if (!remoteHead) {\n throw new BitError(`unable to find a remote head of \"${bitId.toStringWithoutVersion()}\" in \"${laneIdStr}\"`);\n }\n return bitId.changeVersion(remoteHead.toString());\n })\n );\n\n return this.getMergeStatus(ids, localLaneObject, localLaneObject, { shouldSquash: false });\n }\n\n private async snapResolvedComponents(\n consumer: Consumer,\n snapMessage: string,\n build: boolean\n ): Promise<SnapResults | null> {\n const unmergedComponents = consumer.scope.objects.unmergedComponents.getComponents();\n this.logger.debug(`merge-snaps, snapResolvedComponents, total ${unmergedComponents.length.toString()} components`);\n if (!unmergedComponents.length) return null;\n const ids = ComponentIdList.fromArray(unmergedComponents.map((r) => ComponentID.fromObject(r.id)));\n return this.snapping.snap({\n legacyBitIds: ids,\n build,\n message: snapMessage,\n });\n }\n\n private async tagAllLaneComponent(\n idsToTag: ComponentID[],\n tagMessage: string,\n build: boolean\n ): Promise<TagResults | null> {\n const ids = idsToTag.map((id) => {\n return id.toStringWithoutVersion();\n });\n this.logger.debug(`merge-snaps, tagResolvedComponents, total ${idsToTag.length.toString()} components`);\n return this.snapping.tag({\n ids,\n build,\n message: tagMessage,\n unmodified: true,\n });\n }\n\n private async getIdsForUnmerged(idsStr?: string[]): Promise<ComponentID[]> {\n if (idsStr && idsStr.length) {\n const componentIds = await this.workspace.resolveMultipleComponentIds(idsStr);\n componentIds.forEach((id) => {\n const entry = this.workspace.consumer.scope.objects.unmergedComponents.getEntry(id);\n if (!entry) {\n throw new GeneralError(`unable to merge-resolve ${id.toString()}, it is not marked as unresolved`);\n }\n });\n return componentIds;\n }\n const unresolvedComponents = this.workspace.consumer.scope.objects.unmergedComponents.getComponents();\n if (!unresolvedComponents.length) throw new GeneralError(`all components are resolved already, nothing to do`);\n return unresolvedComponents.map((u) => ComponentID.fromObject(u.id));\n }\n\n private async getComponentsToMerge(consumer: Consumer, ids: string[]): Promise<ComponentID[]> {\n const componentsList = new ComponentsList(consumer);\n if (!ids.length) {\n const mergePending = await componentsList.listMergePendingComponents();\n return mergePending.map((c) => c.id);\n }\n if (hasWildcard(ids)) {\n return componentsList.listComponentsByIdsWithWildcard(ids);\n }\n return ids.map((id) => consumer.getParsedId(id));\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n SnappingAspect,\n CheckoutAspect,\n InstallAspect,\n LoggerAspect,\n ComponentWriterAspect,\n ImporterAspect,\n ConfigAspect,\n RemoveAspect,\n GlobalConfigAspect,\n ConfigMergerAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n cli,\n workspace,\n snapping,\n checkout,\n install,\n loggerMain,\n compWriter,\n importer,\n config,\n remove,\n globalConfig,\n configMerger,\n ]: [\n CLIMain,\n Workspace,\n SnappingMain,\n CheckoutMain,\n InstallMain,\n LoggerMain,\n ComponentWriterMain,\n ImporterMain,\n ConfigMain,\n RemoveMain,\n GlobalConfigMain,\n ConfigMergerMain\n ]) {\n const logger = loggerMain.createLogger(MergingAspect.id);\n const merging = new MergingMain(\n workspace,\n install,\n snapping,\n checkout,\n logger,\n compWriter,\n importer,\n config,\n remove,\n configMerger\n );\n cli.register(new MergeCmd(merging, globalConfig));\n return merging;\n }\n}\n\nMergingAspect.addRuntime(MergingMain);\n"],"mappings":";;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA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Ad,eAAA,CA5jBYc,WAAW,WAigBP,EAAE;AAAAd,eAAA,CAjgBNc,WAAW,kBAkgBA,CACpB8O,gBAAS,EACTC,oBAAe,EACfC,mBAAc,EACdC,0BAAc,EACdC,wBAAa,EACbC,sBAAY,EACZC,wCAAqB,EACrBC,mBAAc,EACdC,sBAAY,EACZC,iBAAY,EACZC,uBAAkB,EAClBC,kCAAkB,CACnB;AAAAvQ,eAAA,CA/gBUc,WAAW,aAghBL0P,kBAAW;AA8C9BjB,wBAAa,CAACkB,UAAU,CAAC3P,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/merging",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.139",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/merging",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "merging",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.139"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"@teambit/lane-id": "0.0.311",
|
|
18
18
|
"@teambit/harmony": "0.4.6",
|
|
19
19
|
"@teambit/cli": "0.0.848",
|
|
20
|
-
"@teambit/config-merger": "0.0.
|
|
20
|
+
"@teambit/config-merger": "0.0.6",
|
|
21
21
|
"@teambit/global-config": "0.0.851",
|
|
22
|
-
"@teambit/importer": "1.0.
|
|
22
|
+
"@teambit/importer": "1.0.139",
|
|
23
23
|
"@teambit/logger": "0.0.941",
|
|
24
|
-
"@teambit/workspace": "1.0.
|
|
25
|
-
"@teambit/checkout": "1.0.
|
|
26
|
-
"@teambit/component-writer": "1.0.
|
|
27
|
-
"@teambit/config": "0.0.
|
|
28
|
-
"@teambit/install": "1.0.
|
|
29
|
-
"@teambit/remove": "1.0.
|
|
30
|
-
"@teambit/snapping": "1.0.
|
|
24
|
+
"@teambit/workspace": "1.0.139",
|
|
25
|
+
"@teambit/checkout": "1.0.139",
|
|
26
|
+
"@teambit/component-writer": "1.0.139",
|
|
27
|
+
"@teambit/config": "0.0.890",
|
|
28
|
+
"@teambit/install": "1.0.139",
|
|
29
|
+
"@teambit/remove": "1.0.139",
|
|
30
|
+
"@teambit/snapping": "1.0.139"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/lodash": "4.14.165",
|
|
File without changes
|