@teambit/merging 0.0.146 → 0.0.149
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/merging.main.runtime.d.ts +9 -6
- package/dist/merging.main.runtime.js +112 -64
- package/dist/merging.main.runtime.js.map +1 -1
- package/package-tar/teambit-merging-0.0.149.tgz +0 -0
- package/package.json +9 -11
- /package/{preview-1661830538885.js → preview-1662032648662.js} +0 -0
- package/package-tar/teambit-merging-0.0.146.tgz +0 -0
|
@@ -6,17 +6,18 @@ import { SnappingMain } from '@teambit/snapping';
|
|
|
6
6
|
import { BitId } from '@teambit/legacy/dist/bit-id';
|
|
7
7
|
import { LaneId } from '@teambit/lane-id';
|
|
8
8
|
import { Lane, Version } from '@teambit/legacy/dist/scope/models';
|
|
9
|
-
import
|
|
9
|
+
import ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';
|
|
10
10
|
import { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';
|
|
11
11
|
import { DivergeData } from '@teambit/legacy/dist/scope/component-ops/diverge-data';
|
|
12
12
|
export declare type ComponentMergeStatus = {
|
|
13
|
-
|
|
13
|
+
currentComponent?: ConsumerComponent | null;
|
|
14
14
|
componentFromModel?: Version;
|
|
15
15
|
id: BitId;
|
|
16
16
|
unmergedMessage?: string;
|
|
17
17
|
unmergedLegitimately?: boolean;
|
|
18
18
|
mergeResults?: MergeResultsThreeWay | null;
|
|
19
19
|
divergeData?: DivergeData;
|
|
20
|
+
resolvedUnrelated?: MergeStrategy;
|
|
20
21
|
};
|
|
21
22
|
export declare class MergingMain {
|
|
22
23
|
private workspace;
|
|
@@ -37,10 +38,9 @@ export declare class MergingMain {
|
|
|
37
38
|
/**
|
|
38
39
|
* merge multiple components according to the "allComponentsStatus".
|
|
39
40
|
*/
|
|
40
|
-
mergeSnaps({ mergeStrategy, allComponentsStatus,
|
|
41
|
+
mergeSnaps({ mergeStrategy, allComponentsStatus, laneId, localLane, noSnap, snapMessage, build, skipDependencyInstallation, }: {
|
|
41
42
|
mergeStrategy: MergeStrategy;
|
|
42
43
|
allComponentsStatus: ComponentMergeStatus[];
|
|
43
|
-
remoteName: string | null;
|
|
44
44
|
laneId: LaneId;
|
|
45
45
|
localLane: Lane | null;
|
|
46
46
|
noSnap: boolean;
|
|
@@ -61,13 +61,16 @@ export declare class MergingMain {
|
|
|
61
61
|
*/
|
|
62
62
|
getComponentMergeStatus(id: BitId, // the id.version is the version we want to merge to the current component
|
|
63
63
|
localLane: Lane | null, // currently checked out lane. if on main, then it's null.
|
|
64
|
-
otherLaneName: string)
|
|
64
|
+
otherLaneName: string, // the lane name we want to merged to our lane. (can be also "main").
|
|
65
|
+
options?: {
|
|
66
|
+
resolveUnrelated?: MergeStrategy;
|
|
67
|
+
}): Promise<ComponentMergeStatus>;
|
|
65
68
|
private applyVersion;
|
|
66
69
|
private abortMerge;
|
|
67
70
|
private resolveMerge;
|
|
68
71
|
private getAllComponentsStatus;
|
|
69
72
|
private snapResolvedComponents;
|
|
70
|
-
private
|
|
73
|
+
private getIdsForUnmerged;
|
|
71
74
|
private getComponentsToMerge;
|
|
72
75
|
static slots: never[];
|
|
73
76
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
@@ -241,6 +241,16 @@ function _threeWayMerge() {
|
|
|
241
241
|
return data;
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
+
function _noCommonSnap() {
|
|
245
|
+
const data = require("@teambit/legacy/dist/scope/exceptions/no-common-snap");
|
|
246
|
+
|
|
247
|
+
_noCommonSnap = function () {
|
|
248
|
+
return data;
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
return data;
|
|
252
|
+
}
|
|
253
|
+
|
|
244
254
|
function _mergeCmd() {
|
|
245
255
|
const data = require("./merge-cmd");
|
|
246
256
|
|
|
@@ -332,7 +342,6 @@ class MergingMain {
|
|
|
332
342
|
return this.mergeSnaps({
|
|
333
343
|
mergeStrategy,
|
|
334
344
|
allComponentsStatus,
|
|
335
|
-
remoteName: currentLaneId.isDefault() ? null : currentLaneId.scope,
|
|
336
345
|
laneId: currentLaneId,
|
|
337
346
|
localLane: currentLaneObject,
|
|
338
347
|
noSnap,
|
|
@@ -349,7 +358,6 @@ class MergingMain {
|
|
|
349
358
|
async mergeSnaps({
|
|
350
359
|
mergeStrategy,
|
|
351
360
|
allComponentsStatus,
|
|
352
|
-
remoteName,
|
|
353
361
|
laneId,
|
|
354
362
|
localLane,
|
|
355
363
|
noSnap,
|
|
@@ -373,21 +381,22 @@ class MergingMain {
|
|
|
373
381
|
// which can be an issue when some components are also dependencies of others
|
|
374
382
|
|
|
375
383
|
const componentsResults = await (0, _pMapSeries().default)(succeededComponents, async ({
|
|
376
|
-
|
|
384
|
+
currentComponent,
|
|
377
385
|
id,
|
|
378
|
-
mergeResults
|
|
386
|
+
mergeResults,
|
|
387
|
+
resolvedUnrelated
|
|
379
388
|
}) => {
|
|
380
389
|
const modelComponent = await consumer.scope.getModelComponent(id);
|
|
390
|
+
const updatedLaneId = laneId.isDefault() ? _laneId().LaneId.from(laneId.name, id.scope) : laneId;
|
|
381
391
|
return this.applyVersion({
|
|
382
|
-
|
|
383
|
-
componentFromFS,
|
|
392
|
+
currentComponent,
|
|
384
393
|
id,
|
|
385
394
|
mergeResults,
|
|
386
395
|
mergeStrategy,
|
|
387
396
|
remoteHead: modelComponent.getRef(id.version),
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
397
|
+
laneId: updatedLaneId,
|
|
398
|
+
localLane,
|
|
399
|
+
resolvedUnrelated
|
|
391
400
|
});
|
|
392
401
|
});
|
|
393
402
|
const leftUnresolvedConflicts = componentWithConflict && mergeStrategy === 'manual';
|
|
@@ -404,7 +413,7 @@ class MergingMain {
|
|
|
404
413
|
await consumer.scope.objects.persist(); // persist anyway, if localLane is null it should save all main heads
|
|
405
414
|
|
|
406
415
|
await consumer.scope.objects.unmergedComponents.write(); // if one of the component has conflict, don't snap-merge. otherwise, some of the components would be snap-merged
|
|
407
|
-
// and some not.
|
|
416
|
+
// and some not. besides the fact that it could by mistake tag dependent, it's a confusing state. better not snap.
|
|
408
417
|
|
|
409
418
|
const mergeSnapResults = noSnap || leftUnresolvedConflicts ? null : await this.snapResolvedComponents(consumer, snapMessage, build);
|
|
410
419
|
return {
|
|
@@ -429,7 +438,8 @@ class MergingMain {
|
|
|
429
438
|
|
|
430
439
|
async getComponentMergeStatus(id, // the id.version is the version we want to merge to the current component
|
|
431
440
|
localLane, // currently checked out lane. if on main, then it's null.
|
|
432
|
-
otherLaneName)
|
|
441
|
+
otherLaneName, // the lane name we want to merged to our lane. (can be also "main").
|
|
442
|
+
options) {
|
|
433
443
|
var _modelComponent$laneH;
|
|
434
444
|
|
|
435
445
|
const consumer = this.workspace.consumer;
|
|
@@ -451,8 +461,8 @@ class MergingMain {
|
|
|
451
461
|
|
|
452
462
|
const unmerged = consumer.scope.objects.unmergedComponents.getEntry(id.name);
|
|
453
463
|
|
|
454
|
-
if (unmerged
|
|
455
|
-
return returnUnmerged(`component ${id.toStringWithoutVersion()}
|
|
464
|
+
if (unmerged) {
|
|
465
|
+
return returnUnmerged(`component ${id.toStringWithoutVersion()} is in during-merge state a previous merge, please snap/tag it first (or use bit merge --resolve/--abort)`);
|
|
456
466
|
}
|
|
457
467
|
|
|
458
468
|
const repo = consumer.scope.objects;
|
|
@@ -491,28 +501,21 @@ class MergingMain {
|
|
|
491
501
|
if (!currentId) {
|
|
492
502
|
const divergeData = await (0, _getDivergeData().getDivergeData)(repo, modelComponent, otherLaneHead, null, false);
|
|
493
503
|
return {
|
|
494
|
-
|
|
504
|
+
currentComponent: null,
|
|
495
505
|
componentFromModel: componentOnLane,
|
|
496
506
|
id,
|
|
497
507
|
mergeResults: null,
|
|
498
508
|
divergeData
|
|
499
509
|
};
|
|
500
|
-
}
|
|
501
|
-
// if (currentlyUsedVersion === version) {
|
|
502
|
-
// // @todo: maybe this check is not needed as we check for diverge later on
|
|
503
|
-
// if (localLane || modelComponent.hasHead()) {
|
|
504
|
-
// return returnUnmerged(`component ${id.toStringWithoutVersion()} is already merged`, true);
|
|
505
|
-
// }
|
|
506
|
-
// }
|
|
507
|
-
|
|
510
|
+
}
|
|
508
511
|
|
|
509
512
|
const getCurrentComponent = () => {
|
|
510
513
|
if (existingBitMapId) return consumer.loadComponent(existingBitMapId);
|
|
511
514
|
return consumer.scope.getConsumerComponent(currentId);
|
|
512
515
|
};
|
|
513
516
|
|
|
514
|
-
const
|
|
515
|
-
const componentModificationStatus = await consumer.getComponentStatusById(
|
|
517
|
+
const currentComponent = await getCurrentComponent();
|
|
518
|
+
const componentModificationStatus = await consumer.getComponentStatusById(currentComponent.id);
|
|
516
519
|
|
|
517
520
|
if (componentModificationStatus.modified) {
|
|
518
521
|
return returnUnmerged(`unable to merge ${id.toStringWithoutVersion()}, the component is modified, please snap/tag it first`);
|
|
@@ -528,19 +531,45 @@ class MergingMain {
|
|
|
528
531
|
const divergeData = await (0, _getDivergeData().getDivergeData)(repo, modelComponent, otherLaneHead, localHead, false);
|
|
529
532
|
|
|
530
533
|
if (divergeData.err) {
|
|
531
|
-
|
|
534
|
+
if (divergeData.err instanceof _noCommonSnap().NoCommonSnap && options !== null && options !== void 0 && options.resolveUnrelated) {
|
|
535
|
+
if ((options === null || options === void 0 ? void 0 : options.resolveUnrelated) === 'theirs') {
|
|
536
|
+
// just override with the model data
|
|
537
|
+
return {
|
|
538
|
+
currentComponent,
|
|
539
|
+
componentFromModel: componentOnLane,
|
|
540
|
+
id,
|
|
541
|
+
mergeResults: null,
|
|
542
|
+
divergeData,
|
|
543
|
+
resolvedUnrelated: 'theirs'
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
if ((options === null || options === void 0 ? void 0 : options.resolveUnrelated) === 'ours') {
|
|
548
|
+
return {
|
|
549
|
+
currentComponent,
|
|
550
|
+
id,
|
|
551
|
+
mergeResults: null,
|
|
552
|
+
divergeData,
|
|
553
|
+
resolvedUnrelated: 'ours'
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
throw new Error(`unsupported strategy "${options === null || options === void 0 ? void 0 : options.resolveUnrelated}" of resolve-unrelated. supported strategies are: [ours, theirs]`);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
return returnUnmerged(`unable to traverse ${currentComponent.id.toString()} history. error: ${divergeData.err.message}`);
|
|
532
561
|
}
|
|
533
562
|
|
|
534
563
|
if (!divergeData.isDiverged()) {
|
|
535
564
|
if (divergeData.isLocalAhead()) {
|
|
536
565
|
// do nothing!
|
|
537
|
-
return returnUnmerged(`component ${
|
|
566
|
+
return returnUnmerged(`component ${currentComponent.id.toString()} is ahead, nothing to merge`, true);
|
|
538
567
|
}
|
|
539
568
|
|
|
540
569
|
if (divergeData.isRemoteAhead()) {
|
|
541
570
|
// just override with the model data
|
|
542
571
|
return {
|
|
543
|
-
|
|
572
|
+
currentComponent,
|
|
544
573
|
componentFromModel: componentOnLane,
|
|
545
574
|
id,
|
|
546
575
|
mergeResults: null,
|
|
@@ -549,7 +578,7 @@ class MergingMain {
|
|
|
549
578
|
} // we know that localHead and remoteHead are set, so if none of them is ahead they must be equal
|
|
550
579
|
|
|
551
580
|
|
|
552
|
-
return returnUnmerged(`component ${
|
|
581
|
+
return returnUnmerged(`component ${currentComponent.id.toString()} is already merged`, true);
|
|
553
582
|
}
|
|
554
583
|
|
|
555
584
|
const baseSnap = divergeData.commonSnapBeforeDiverge; // must be set when isTrueMerge
|
|
@@ -561,12 +590,12 @@ class MergingMain {
|
|
|
561
590
|
consumer,
|
|
562
591
|
otherComponent,
|
|
563
592
|
otherLabel: `${otherLaneHead.toString()} (${otherLaneName})`,
|
|
564
|
-
currentComponent
|
|
593
|
+
currentComponent,
|
|
565
594
|
currentLabel: `${currentId.version} (${currentLaneName})`,
|
|
566
595
|
baseComponent
|
|
567
596
|
});
|
|
568
597
|
return {
|
|
569
|
-
|
|
598
|
+
currentComponent,
|
|
570
599
|
id,
|
|
571
600
|
mergeResults,
|
|
572
601
|
divergeData
|
|
@@ -574,16 +603,16 @@ class MergingMain {
|
|
|
574
603
|
}
|
|
575
604
|
|
|
576
605
|
async applyVersion({
|
|
577
|
-
|
|
578
|
-
componentFromFS,
|
|
606
|
+
currentComponent,
|
|
579
607
|
id,
|
|
580
608
|
mergeResults,
|
|
581
609
|
mergeStrategy,
|
|
582
610
|
remoteHead,
|
|
583
|
-
remoteName,
|
|
584
611
|
laneId,
|
|
585
|
-
localLane
|
|
612
|
+
localLane,
|
|
613
|
+
resolvedUnrelated
|
|
586
614
|
}) {
|
|
615
|
+
const consumer = this.workspace.consumer;
|
|
587
616
|
let filesStatus = {};
|
|
588
617
|
const unmergedComponent = {
|
|
589
618
|
// @ts-ignore
|
|
@@ -591,23 +620,40 @@ class MergingMain {
|
|
|
591
620
|
name: id.name,
|
|
592
621
|
scope: id.scope
|
|
593
622
|
},
|
|
594
|
-
// @ts-ignore
|
|
595
623
|
head: remoteHead,
|
|
596
|
-
|
|
597
|
-
|
|
624
|
+
remote: laneId.scope,
|
|
625
|
+
// @todo: remove. it has been deprecated around 0.0.832
|
|
598
626
|
lane: laneId.name,
|
|
599
|
-
|
|
600
|
-
|
|
627
|
+
// @todo: remove. it has been deprecated around 0.0.832
|
|
628
|
+
laneId
|
|
629
|
+
};
|
|
630
|
+
id = currentComponent ? currentComponent.id : id;
|
|
631
|
+
const modelComponent = await consumer.scope.getModelComponent(id);
|
|
632
|
+
|
|
633
|
+
const handleResolveUnrelated = () => {
|
|
634
|
+
if (!currentComponent) throw new Error('currentComponent must be defined when resolvedUnrelated');
|
|
635
|
+
if (!localLane) throw new Error('localLane must be defined when resolvedUnrelated');
|
|
636
|
+
const head = modelComponent.getRef(currentComponent.id.version);
|
|
637
|
+
if (!head) throw new Error(`unable to get the head for resolved-unrelated ${id.toString()}`);
|
|
638
|
+
unmergedComponent.laneId = localLane.toLaneId();
|
|
639
|
+
unmergedComponent.head = head;
|
|
640
|
+
unmergedComponent.unrelated = true;
|
|
641
|
+
consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);
|
|
642
|
+
return {
|
|
643
|
+
id,
|
|
644
|
+
filesStatus
|
|
645
|
+
};
|
|
601
646
|
};
|
|
602
|
-
id = componentFromFS ? componentFromFS.id : id;
|
|
603
647
|
|
|
604
|
-
|
|
605
|
-
if (!
|
|
606
|
-
|
|
607
|
-
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
648
|
+
const markAllFilesAsUnchanged = () => {
|
|
649
|
+
if (!currentComponent) throw new Error(`applyVersion expect to get currentComponent for ${id.toString()}`);
|
|
650
|
+
currentComponent.files.forEach(file => {
|
|
608
651
|
filesStatus[(0, _utils().pathNormalizeToLinux)(file.relative)] = _mergeVersion().FileStatus.unchanged;
|
|
609
652
|
});
|
|
610
|
-
|
|
653
|
+
};
|
|
654
|
+
|
|
655
|
+
if (mergeResults && mergeResults.hasConflicts && mergeStrategy === _mergeVersion().MergeOptions.ours) {
|
|
656
|
+
markAllFilesAsUnchanged();
|
|
611
657
|
consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);
|
|
612
658
|
return {
|
|
613
659
|
id,
|
|
@@ -615,15 +661,18 @@ class MergingMain {
|
|
|
615
661
|
};
|
|
616
662
|
}
|
|
617
663
|
|
|
664
|
+
if (resolvedUnrelated && resolvedUnrelated === 'ours') {
|
|
665
|
+
markAllFilesAsUnchanged();
|
|
666
|
+
localLane === null || localLane === void 0 ? void 0 : localLane.addComponent({
|
|
667
|
+
id,
|
|
668
|
+
head: remoteHead
|
|
669
|
+
});
|
|
670
|
+
return handleResolveUnrelated();
|
|
671
|
+
}
|
|
672
|
+
|
|
618
673
|
const remoteId = id.changeVersion(remoteHead.toString());
|
|
619
674
|
const idToLoad = !mergeResults || mergeStrategy === _mergeVersion().MergeOptions.theirs ? remoteId : id;
|
|
620
675
|
const componentWithDependencies = await consumer.loadComponentWithDependenciesFromModel(idToLoad);
|
|
621
|
-
|
|
622
|
-
if (!id.scope) {
|
|
623
|
-
componentWithDependencies.dependencies = [];
|
|
624
|
-
componentWithDependencies.devDependencies = [];
|
|
625
|
-
}
|
|
626
|
-
|
|
627
676
|
const files = componentWithDependencies.component.files;
|
|
628
677
|
files.forEach(file => {
|
|
629
678
|
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
@@ -640,8 +689,6 @@ class MergingMain {
|
|
|
640
689
|
filesStatus = _objectSpread(_objectSpread({}, filesStatus), modifiedStatus);
|
|
641
690
|
}
|
|
642
691
|
|
|
643
|
-
const shouldDependenciesSaveAsComponents = await consumer.shouldDependenciesSavedAsComponents([id]);
|
|
644
|
-
componentWithDependencies.component.dependenciesSavedAsComponents = shouldDependenciesSaveAsComponents[0].saveDependenciesAsComponents;
|
|
645
692
|
const manyComponentsWriter = new (_manyComponentsWriter().default)({
|
|
646
693
|
consumer,
|
|
647
694
|
componentsWithDependencies: [componentWithDependencies],
|
|
@@ -660,10 +707,7 @@ class MergingMain {
|
|
|
660
707
|
|
|
661
708
|
if (mergeResults) {
|
|
662
709
|
if (mergeResults.hasConflicts && mergeStrategy === _mergeVersion().MergeOptions.manual) {
|
|
663
|
-
unmergedComponent.resolved = false;
|
|
664
710
|
unmergedComponent.unmergedPaths = mergeResults.modifiedFiles.filter(f => f.conflict).map(f => f.filePath);
|
|
665
|
-
} else {
|
|
666
|
-
unmergedComponent.resolved = true;
|
|
667
711
|
}
|
|
668
712
|
|
|
669
713
|
consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);
|
|
@@ -672,9 +716,13 @@ class MergingMain {
|
|
|
672
716
|
id,
|
|
673
717
|
head: remoteHead
|
|
674
718
|
});
|
|
719
|
+
|
|
720
|
+
if (resolvedUnrelated) {
|
|
721
|
+
// must be "theirs"
|
|
722
|
+
return handleResolveUnrelated();
|
|
723
|
+
}
|
|
675
724
|
} else {
|
|
676
725
|
// this is main
|
|
677
|
-
const modelComponent = await consumer.scope.getModelComponent(id);
|
|
678
726
|
modelComponent.setHead(remoteHead); // mark it as local, otherwise, when importing this component from a remote, it'll override it.
|
|
679
727
|
|
|
680
728
|
modelComponent.markVersionAsLocal(remoteHead.toString());
|
|
@@ -688,7 +736,7 @@ class MergingMain {
|
|
|
688
736
|
}
|
|
689
737
|
|
|
690
738
|
async abortMerge(consumer, values) {
|
|
691
|
-
const ids = this.
|
|
739
|
+
const ids = this.getIdsForUnmerged(consumer, values); // @ts-ignore not clear yet what to do with other flags
|
|
692
740
|
|
|
693
741
|
const results = await (0, _checkoutVersion().default)(consumer, {
|
|
694
742
|
ids,
|
|
@@ -702,7 +750,7 @@ class MergingMain {
|
|
|
702
750
|
}
|
|
703
751
|
|
|
704
752
|
async resolveMerge(consumer, values, snapMessage, build) {
|
|
705
|
-
const ids = this.
|
|
753
|
+
const ids = this.getIdsForUnmerged(consumer, values); // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
706
754
|
|
|
707
755
|
const {
|
|
708
756
|
snappedComponents
|
|
@@ -739,13 +787,13 @@ class MergingMain {
|
|
|
739
787
|
}
|
|
740
788
|
|
|
741
789
|
async snapResolvedComponents(consumer, snapMessage, build) {
|
|
742
|
-
const
|
|
790
|
+
const unmergedComponents = consumer.scope.objects.unmergedComponents.getComponents();
|
|
743
791
|
|
|
744
|
-
_logger().default.debug(`merge-snaps, snapResolvedComponents, total ${
|
|
792
|
+
_logger().default.debug(`merge-snaps, snapResolvedComponents, total ${unmergedComponents.length.toString()} components`);
|
|
745
793
|
|
|
746
|
-
if (!
|
|
794
|
+
if (!unmergedComponents.length) return null;
|
|
747
795
|
|
|
748
|
-
const ids = _bitId().BitIds.fromArray(
|
|
796
|
+
const ids = _bitId().BitIds.fromArray(unmergedComponents.map(r => new (_bitId().BitId)(r.id)));
|
|
749
797
|
|
|
750
798
|
return this.snapping.snap({
|
|
751
799
|
legacyBitIds: ids,
|
|
@@ -754,7 +802,7 @@ class MergingMain {
|
|
|
754
802
|
});
|
|
755
803
|
}
|
|
756
804
|
|
|
757
|
-
|
|
805
|
+
getIdsForUnmerged(consumer, idsStr) {
|
|
758
806
|
if (idsStr && idsStr.length) {
|
|
759
807
|
const bitIds = idsStr.map(id => consumer.getParsedId(id));
|
|
760
808
|
bitIds.forEach(id => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MergingMain","constructor","workspace","snapping","consumer","merge","values","mergeStrategy","abort","resolve","noSnap","message","build","skipDependencyInstallation","ConsumerNotFound","mergeResults","firstValue","R","head","resolveMerge","abortMerge","BitId","isValidVersion","bitIds","getComponentsToMerge","mergeComponentsFromRemote","version","ids","tail","mergeVersion","onDestroy","snapMessage","currentLaneId","getCurrentLaneId","currentLaneObject","getCurrentLaneObject","allComponentsStatus","getAllComponentsStatus","failedComponents","filter","c","unmergedMessage","unmergedLegitimately","length","failureMsgs","map","failedComponent","chalk","bold","id","toString","red","join","BitError","mergeSnaps","remoteName","isDefault","scope","laneId","localLane","componentWithConflict","find","component","hasConflicts","getMergeStrategyInteractive","componentStatus","failureMessage","unchangedLegitimately","succeededComponents","componentsResults","mapSeries","componentFromFS","modelComponent","getModelComponent","applyVersion","remoteHead","getRef","leftUnresolvedConflicts","install","undefined","dedupe","updateExisting","import","objects","add","persist","unmergedComponents","write","mergeSnapResults","snapResolvedComponents","components","getComponentMergeStatus","otherLaneName","returnUnmerged","msg","getModelComponentIfExist","unmerged","getEntry","name","resolved","toStringWithoutVersion","repo","otherLaneHead","existingBitMapId","bitMap","getBitIdIfExist","ignoreVersion","componentOnLane","loadVersion","isRemoved","getCurrentId","idOnLane","getComponent","changeVersion","getHeadAsTagIfExist","currentId","divergeData","getDivergeData","componentFromModel","getCurrentComponent","loadComponent","getConsumerComponent","componentModificationStatus","getComponentStatusById","modified","laneHeadIsDifferentThanCheckedOut","laneHeadLocal","localHead","Ref","from","Error","err","isDiverged","isLocalAhead","isRemoteAhead","baseSnap","commonSnapBeforeDiverge","baseComponent","otherComponent","currentLaneName","toLaneId","threeWayMerge","otherLabel","currentComponent","currentLabel","filesStatus","unmergedComponent","remote","lane","MergeOptions","ours","files","forEach","file","pathNormalizeToLinux","relative","FileStatus","unchanged","addEntry","remoteId","idToLoad","theirs","componentWithDependencies","loadComponentWithDependenciesFromModel","dependencies","devDependencies","updated","modifiedStatus","modifiedFiles","applyModifiedVersion","shouldDependenciesSaveAsComponents","shouldDependenciesSavedAsComponents","dependenciesSavedAsComponents","saveDependenciesAsComponents","manyComponentsWriter","ManyComponentsWriter","componentsWithDependencies","installNpmPackages","override","writeConfig","verbose","writeDists","writePackageJson","writeAll","manual","unmergedPaths","f","conflict","filePath","addComponent","setHead","markVersionAsLocal","getIdsForUnresolved","results","checkoutVersion","reset","removeComponent","abortedComponents","snappedComponents","snap","legacyBitIds","BitIds","fromArray","resolvedComponents","localLaneObject","tmp","Tmp","componentsStatus","Promise","all","bitId","remoteScopeName","remoteLaneId","LaneId","remoteLanes","laneIdStr","clear","getResolvedComponents","logger","debug","r","idsStr","getParsedId","entry","GeneralError","unresolvedComponents","getComponents","u","hasWildcard","componentsList","ComponentsList","listComponentsByIdsWithWildcard","provider","cli","merging","register","MergeCmd","CLIAspect","WorkspaceAspect","SnappingAspect","MainRuntime","MergingAspect","addRuntime"],"sources":["merging.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport R from 'ramda';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport {\n ApplyVersionResults,\n MergeStrategy,\n mergeVersion,\n ApplyVersionResult,\n FailedComponents,\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport SnappingAspect, { SnappingMain } from '@teambit/snapping';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport mapSeries from 'p-map-series';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport { BitError } from '@teambit/bit-error';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport { LaneId } from '@teambit/lane-id';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport { AutoTagResult } from '@teambit/legacy/dist/scope/component-ops/auto-tag';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { UnmergedComponent } from '@teambit/legacy/dist/scope/lanes/unmerged-components';\nimport { Lane, Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport chalk from 'chalk';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport ManyComponentsWriter from '@teambit/legacy/dist/consumer/component-ops/many-components-writer';\nimport Component from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport checkoutVersion, { applyModifiedVersion } from '@teambit/legacy/dist/consumer/versions-ops/checkout-version';\nimport threeWayMerge, {\n MergeResultsThreeWay,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport { DivergeData } from '@teambit/legacy/dist/scope/component-ops/diverge-data';\nimport { MergeCmd } from './merge-cmd';\nimport { MergingAspect } from './merging.aspect';\n\nexport type ComponentMergeStatus = {\n componentFromFS?: Component | null;\n componentFromModel?: Version;\n id: BitId;\n unmergedMessage?: string;\n unmergedLegitimately?: boolean; // failed to merge but for a legitimate reason, such as, up-to-date\n mergeResults?: MergeResultsThreeWay | null;\n divergeData?: DivergeData;\n};\n\nexport class MergingMain {\n private consumer: Consumer;\n constructor(private workspace: Workspace, private snapping: SnappingMain) {\n this.consumer = this.workspace?.consumer;\n }\n\n /**\n * merge components according to the \"values\" param.\n * if the first param is a version, then merge the component ids to that version.\n * otherwise, merge from the remote head to the local.\n */\n async merge(\n values: 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 ConsumerNotFound();\n const consumer: Consumer = this.workspace.consumer;\n let mergeResults;\n const firstValue = R.head(values);\n if (resolve) {\n mergeResults = await this.resolveMerge(consumer, values, message, build);\n } else if (abort) {\n mergeResults = await this.abortMerge(consumer, values);\n } else if (!BitId.isValidVersion(firstValue)) {\n const bitIds = this.getComponentsToMerge(consumer, values);\n // @todo: version could be the lane only or remote/lane\n mergeResults = await this.mergeComponentsFromRemote(\n consumer,\n bitIds,\n mergeStrategy,\n noSnap,\n message,\n build,\n skipDependencyInstallation\n );\n } else {\n const version = firstValue;\n const ids = R.tail(values);\n const bitIds = this.getComponentsToMerge(consumer, ids);\n mergeResults = await mergeVersion(consumer, version, bitIds, mergeStrategy);\n }\n await consumer.onDestroy();\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: BitId[],\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.unmergedMessage && !c.unmergedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unmergedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to merge due to the following failures:\\n${failureMsgs}`);\n }\n\n return this.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n remoteName: currentLaneId.isDefault() ? null : currentLaneId.scope,\n laneId: currentLaneId,\n localLane: 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 remoteName,\n laneId,\n localLane,\n noSnap,\n snapMessage,\n build,\n skipDependencyInstallation,\n }: {\n mergeStrategy: MergeStrategy;\n allComponentsStatus: ComponentMergeStatus[];\n remoteName: string | null;\n laneId: LaneId;\n localLane: Lane | null;\n noSnap: 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.unmergedMessage)\n .map((componentStatus) => ({\n id: componentStatus.id,\n failureMessage: componentStatus.unmergedMessage as string,\n unchangedLegitimately: componentStatus.unmergedLegitimately,\n }));\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.unmergedMessage);\n // do not use Promise.all for applyVersion. otherwise, it'll write all components in parallel,\n // which can be an issue when some components are also dependencies of others\n const componentsResults = await mapSeries(succeededComponents, async ({ componentFromFS, id, mergeResults }) => {\n const modelComponent = await consumer.scope.getModelComponent(id);\n return this.applyVersion({\n consumer,\n componentFromFS,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead: modelComponent.getRef(id.version as string) as Ref,\n remoteName: remoteName || componentFromFS?.scope || null,\n laneId,\n localLane,\n });\n });\n\n const leftUnresolvedConflicts = componentWithConflict && mergeStrategy === 'manual';\n\n if (!skipDependencyInstallation && !leftUnresolvedConflicts) {\n await this.workspace.install(undefined, {\n dedupe: true,\n updateExisting: false,\n import: false,\n });\n }\n\n if (localLane) consumer.scope.objects.add(localLane);\n\n await consumer.scope.objects.persist(); // persist anyway, if localLane is null it should save all main heads\n\n await consumer.scope.objects.unmergedComponents.write();\n\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. except the fact that it could by mistake tag dependent, it's a confusing state. better not snap.\n const mergeSnapResults =\n noSnap || leftUnresolvedConflicts ? null : await this.snapResolvedComponents(consumer, snapMessage, build);\n\n return {\n components: componentsResults,\n failedComponents,\n mergeSnapResults,\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 * @param id\n * @param localLane\n * @param otherLaneName\n * @param existingOnWorkspaceOnly\n * @returns\n */\n async getComponentMergeStatus(\n id: BitId, // the id.version is the version we want to merge to the current component\n localLane: Lane | null, // currently checked out lane. if on main, then it's null.\n otherLaneName: string // the lane name we want to merged to our lane. (can be also \"main\").\n ): Promise<ComponentMergeStatus> {\n const consumer = this.workspace.consumer;\n const componentStatus: ComponentMergeStatus = { id };\n const returnUnmerged = (msg: string, unmergedLegitimately = false) => {\n componentStatus.unmergedMessage = msg;\n componentStatus.unmergedLegitimately = unmergedLegitimately;\n return componentStatus;\n };\n const modelComponent = await consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) {\n return returnUnmerged(\n `component ${id.toString()} is on the lane/main but its objects were not found, please re-import the lane`\n );\n }\n const unmerged = consumer.scope.objects.unmergedComponents.getEntry(id.name);\n if (unmerged && unmerged.resolved === false) {\n return returnUnmerged(\n `component ${id.toStringWithoutVersion()} has conflicts that need to be resolved first, please use bit merge --resolve/--abort`\n );\n }\n const repo = consumer.scope.objects;\n const version = id.version as string;\n const otherLaneHead = modelComponent.getRef(version);\n const existingBitMapId = consumer.bitMap.getBitIdIfExist(id, { ignoreVersion: true });\n const componentOnLane: Version = await modelComponent.loadVersion(version, consumer.scope.objects);\n if (componentOnLane.isRemoved()) {\n return returnUnmerged(`component has been removed`, true);\n }\n const getCurrentId = () => {\n if (existingBitMapId) return existingBitMapId;\n if (localLane) {\n const idOnLane = localLane.getComponent(id);\n if (!idOnLane) return null;\n return idOnLane.id.changeVersion(idOnLane.head.toString());\n }\n // it's on main\n const head = modelComponent.getHeadAsTagIfExist();\n if (head) {\n return id.changeVersion(head);\n }\n return null;\n };\n const currentId = getCurrentId();\n if (!currentId) {\n const divergeData = await getDivergeData(repo, modelComponent, otherLaneHead, null, false);\n return { componentFromFS: null, componentFromModel: componentOnLane, id, mergeResults: null, divergeData };\n }\n\n // const currentlyUsedVersion = existingBitMapId.version;\n // if (currentlyUsedVersion === version) {\n // // @todo: maybe this check is not needed as we check for diverge later on\n // if (localLane || modelComponent.hasHead()) {\n // return returnUnmerged(`component ${id.toStringWithoutVersion()} is already merged`, true);\n // }\n // }\n const getCurrentComponent = () => {\n if (existingBitMapId) return consumer.loadComponent(existingBitMapId);\n return consumer.scope.getConsumerComponent(currentId);\n };\n const component = await getCurrentComponent();\n const componentModificationStatus = await consumer.getComponentStatusById(component.id);\n if (componentModificationStatus.modified) {\n return returnUnmerged(\n `unable to merge ${id.toStringWithoutVersion()}, the component is modified, please snap/tag it first`\n );\n }\n const laneHeadIsDifferentThanCheckedOut =\n localLane && existingBitMapId?.version && modelComponent.laneHeadLocal?.toString() !== existingBitMapId?.version;\n const localHead = laneHeadIsDifferentThanCheckedOut ? Ref.from(existingBitMapId.version) : null;\n\n if (!otherLaneHead) {\n throw new Error(`merging: unable finding a hash for the version ${version} of ${id.toString()}`);\n }\n const divergeData = await getDivergeData(repo, modelComponent, otherLaneHead, localHead, false);\n if (divergeData.err) {\n return returnUnmerged(`unable to traverse ${component.id.toString()} history. error: ${divergeData.err.message}`);\n }\n if (!divergeData.isDiverged()) {\n if (divergeData.isLocalAhead()) {\n // do nothing!\n return returnUnmerged(`component ${component.id.toString()} is ahead, nothing to merge`, true);\n }\n if (divergeData.isRemoteAhead()) {\n // just override with the model data\n return {\n componentFromFS: component,\n componentFromModel: componentOnLane,\n id,\n mergeResults: null,\n divergeData,\n };\n }\n // we know that localHead and remoteHead are set, so if none of them is ahead they must be equal\n return returnUnmerged(`component ${component.id.toString()} is already merged`, true);\n }\n const baseSnap = divergeData.commonSnapBeforeDiverge as Ref; // must be set when isTrueMerge\n const baseComponent: Version = await modelComponent.loadVersion(baseSnap.toString(), repo);\n const otherComponent: Version = await modelComponent.loadVersion(otherLaneHead.toString(), repo);\n const currentLaneName = localLane?.toLaneId().toString() || 'main';\n const mergeResults = await threeWayMerge({\n consumer,\n otherComponent,\n otherLabel: `${otherLaneHead.toString()} (${otherLaneName})`,\n currentComponent: component,\n currentLabel: `${currentId.version} (${currentLaneName})`,\n baseComponent,\n });\n return { componentFromFS: component, id, mergeResults, divergeData };\n }\n\n private async applyVersion({\n consumer,\n componentFromFS,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead,\n remoteName,\n laneId,\n localLane,\n }: {\n consumer: Consumer;\n componentFromFS: Component | null | undefined;\n id: BitId;\n mergeResults: MergeResultsThreeWay | null | undefined;\n mergeStrategy: MergeStrategy;\n remoteHead: Ref;\n remoteName: string | null;\n laneId: LaneId;\n localLane: Lane | null;\n }): Promise<ApplyVersionResult> {\n let filesStatus = {};\n const unmergedComponent: UnmergedComponent = {\n // @ts-ignore\n id: { name: id.name, scope: id.scope },\n // @ts-ignore\n head: remoteHead,\n // @ts-ignore\n remote: remoteName,\n lane: laneId.name,\n resolved: false, // could be changed later\n };\n id = componentFromFS ? componentFromFS.id : id;\n if (mergeResults && mergeResults.hasConflicts && mergeStrategy === MergeOptions.ours) {\n if (!componentFromFS) throw new Error(`applyVersion expect to get componentFromFS for ${id.toString()}`);\n componentFromFS.files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n unmergedComponent.resolved = true;\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n\n return { id, filesStatus };\n }\n const remoteId = id.changeVersion(remoteHead.toString());\n const idToLoad = !mergeResults || mergeStrategy === MergeOptions.theirs ? remoteId : id;\n const componentWithDependencies = await consumer.loadComponentWithDependenciesFromModel(idToLoad);\n if (!id.scope) {\n componentWithDependencies.dependencies = [];\n componentWithDependencies.devDependencies = [];\n }\n const files = componentWithDependencies.component.files;\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.updated;\n });\n\n if (mergeResults) {\n // update files according to the merge results\n const { filesStatus: modifiedStatus, modifiedFiles } = applyModifiedVersion(files, mergeResults, mergeStrategy);\n componentWithDependencies.component.files = modifiedFiles;\n filesStatus = { ...filesStatus, ...modifiedStatus };\n }\n const shouldDependenciesSaveAsComponents = await consumer.shouldDependenciesSavedAsComponents([id]);\n componentWithDependencies.component.dependenciesSavedAsComponents =\n shouldDependenciesSaveAsComponents[0].saveDependenciesAsComponents;\n\n const manyComponentsWriter = new ManyComponentsWriter({\n consumer,\n componentsWithDependencies: [componentWithDependencies],\n installNpmPackages: false,\n override: true,\n writeConfig: false, // @todo: should write if config exists before, needs to figure out how to do it.\n verbose: false, // @todo: do we need a flag here?\n writeDists: true, // @todo: do we need a flag here?\n writePackageJson: false,\n });\n await manyComponentsWriter.writeAll();\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.resolved = false;\n unmergedComponent.unmergedPaths = mergeResults.modifiedFiles.filter((f) => f.conflict).map((f) => f.filePath);\n } else {\n unmergedComponent.resolved = true;\n }\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n } else if (localLane) {\n localLane.addComponent({ id, head: remoteHead });\n } else {\n // this is main\n const modelComponent = await consumer.scope.getModelComponent(id);\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 { id, filesStatus };\n }\n\n private async abortMerge(consumer: Consumer, values: string[]): Promise<ApplyVersionResults> {\n const ids = this.getIdsForUnresolved(consumer, values);\n // @ts-ignore not clear yet what to do with other flags\n const results = await checkoutVersion(consumer, { ids, reset: true });\n ids.forEach((id) => consumer.scope.objects.unmergedComponents.removeComponent(id.name));\n await consumer.scope.objects.unmergedComponents.write();\n return { abortedComponents: results.components };\n }\n\n private async resolveMerge(\n consumer: Consumer,\n values: string[],\n snapMessage: string,\n build: boolean\n ): Promise<ApplyVersionResults> {\n const ids = this.getIdsForUnresolved(consumer, values);\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const { snappedComponents } = await this.snapping.snap({\n legacyBitIds: BitIds.fromArray(ids),\n build,\n message: snapMessage,\n });\n return { resolvedComponents: snappedComponents };\n }\n\n private async getAllComponentsStatus(\n bitIds: BitId[],\n laneId: LaneId,\n localLaneObject: Lane | null\n ): Promise<ComponentMergeStatus[]> {\n const tmp = new Tmp(this.consumer.scope);\n try {\n const componentsStatus = 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.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 return this.getComponentMergeStatus(bitId.changeVersion(remoteHead.toString()), localLaneObject, laneIdStr);\n })\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n }\n\n private async snapResolvedComponents(\n consumer: Consumer,\n snapMessage: string,\n build: boolean\n ): Promise<null | { snappedComponents: Component[]; autoSnappedResults: AutoTagResult[] }> {\n const resolvedComponents = consumer.scope.objects.unmergedComponents.getResolvedComponents();\n logger.debug(`merge-snaps, snapResolvedComponents, total ${resolvedComponents.length.toString()} components`);\n if (!resolvedComponents.length) return null;\n const ids = BitIds.fromArray(resolvedComponents.map((r) => new BitId(r.id)));\n return this.snapping.snap({\n legacyBitIds: ids,\n build,\n message: snapMessage,\n });\n }\n\n private getIdsForUnresolved(consumer: Consumer, idsStr?: string[]): BitId[] {\n if (idsStr && idsStr.length) {\n const bitIds = idsStr.map((id) => consumer.getParsedId(id));\n bitIds.forEach((id) => {\n const entry = consumer.scope.objects.unmergedComponents.getEntry(id.name);\n if (!entry) {\n throw new GeneralError(`unable to merge-resolve ${id.toString()}, it is not marked as unresolved`);\n }\n });\n return bitIds;\n }\n const unresolvedComponents = 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) => new BitId(u.id));\n }\n\n private getComponentsToMerge(consumer: Consumer, ids: string[]): BitId[] {\n if (hasWildcard(ids)) {\n const componentsList = new ComponentsList(consumer);\n return componentsList.listComponentsByIdsWithWildcard(ids);\n }\n return ids.map((id) => consumer.getParsedId(id));\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect, SnappingAspect];\n static runtime = MainRuntime;\n static async provider([cli, workspace, snapping]: [CLIMain, Workspace, SnappingMain]) {\n const merging = new MergingMain(workspace, snapping);\n cli.register(new MergeCmd(merging));\n return merging;\n }\n}\n\nMergingAspect.addRuntime(MergingMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EA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,OAAOiO,cAAc,CAACE,+BAAf,CAA+C5M,GAA/C,CAAP;IACD;;IACD,OAAOA,GAAG,CAACkB,GAAJ,CAASI,EAAD,IAAQ7C,QAAQ,CAAC0N,WAAT,CAAqB7K,EAArB,CAAhB,CAAP;EACD;;EAKoB,aAARuL,QAAQ,CAAC,CAACC,GAAD,EAAMvO,SAAN,EAAiBC,QAAjB,CAAD,EAAiE;IACpF,MAAMuO,OAAO,GAAG,IAAI1O,WAAJ,CAAgBE,SAAhB,EAA2BC,QAA3B,CAAhB;IACAsO,GAAG,CAACE,QAAJ,CAAa,KAAIC,oBAAJ,EAAaF,OAAb,CAAb;IACA,OAAOA,OAAP;EACD;;AAtfsB;;;gCAAZ1O,W,WA+eI,E;gCA/eJA,W,kBAgfW,CAAC6O,gBAAD,EAAYC,oBAAZ,EAA6BC,mBAA7B,C;gCAhfX/O,W,aAifMgP,kB;;AAQnBC,wBAAA,CAAcC,UAAd,CAAyBlP,WAAzB"}
|
|
1
|
+
{"version":3,"names":["MergingMain","constructor","workspace","snapping","consumer","merge","values","mergeStrategy","abort","resolve","noSnap","message","build","skipDependencyInstallation","ConsumerNotFound","mergeResults","firstValue","R","head","resolveMerge","abortMerge","BitId","isValidVersion","bitIds","getComponentsToMerge","mergeComponentsFromRemote","version","ids","tail","mergeVersion","onDestroy","snapMessage","currentLaneId","getCurrentLaneId","currentLaneObject","getCurrentLaneObject","allComponentsStatus","getAllComponentsStatus","failedComponents","filter","c","unmergedMessage","unmergedLegitimately","length","failureMsgs","map","failedComponent","chalk","bold","id","toString","red","join","BitError","mergeSnaps","laneId","localLane","componentWithConflict","find","component","hasConflicts","getMergeStrategyInteractive","componentStatus","failureMessage","unchangedLegitimately","succeededComponents","componentsResults","mapSeries","currentComponent","resolvedUnrelated","modelComponent","scope","getModelComponent","updatedLaneId","isDefault","LaneId","from","name","applyVersion","remoteHead","getRef","leftUnresolvedConflicts","install","undefined","dedupe","updateExisting","import","objects","add","persist","unmergedComponents","write","mergeSnapResults","snapResolvedComponents","components","getComponentMergeStatus","otherLaneName","options","returnUnmerged","msg","getModelComponentIfExist","unmerged","getEntry","toStringWithoutVersion","repo","otherLaneHead","existingBitMapId","bitMap","getBitIdIfExist","ignoreVersion","componentOnLane","loadVersion","isRemoved","getCurrentId","idOnLane","getComponent","changeVersion","getHeadAsTagIfExist","currentId","divergeData","getDivergeData","componentFromModel","getCurrentComponent","loadComponent","getConsumerComponent","componentModificationStatus","getComponentStatusById","modified","laneHeadIsDifferentThanCheckedOut","laneHeadLocal","localHead","Ref","Error","err","NoCommonSnap","resolveUnrelated","isDiverged","isLocalAhead","isRemoteAhead","baseSnap","commonSnapBeforeDiverge","baseComponent","otherComponent","currentLaneName","toLaneId","threeWayMerge","otherLabel","currentLabel","filesStatus","unmergedComponent","remote","lane","handleResolveUnrelated","unrelated","addEntry","markAllFilesAsUnchanged","files","forEach","file","pathNormalizeToLinux","relative","FileStatus","unchanged","MergeOptions","ours","addComponent","remoteId","idToLoad","theirs","componentWithDependencies","loadComponentWithDependenciesFromModel","updated","modifiedStatus","modifiedFiles","applyModifiedVersion","manyComponentsWriter","ManyComponentsWriter","componentsWithDependencies","installNpmPackages","override","writeConfig","verbose","writeDists","writePackageJson","writeAll","manual","unmergedPaths","f","conflict","filePath","setHead","markVersionAsLocal","getIdsForUnmerged","results","checkoutVersion","reset","removeComponent","abortedComponents","snappedComponents","snap","legacyBitIds","BitIds","fromArray","resolvedComponents","localLaneObject","tmp","Tmp","componentsStatus","Promise","all","bitId","remoteScopeName","remoteLaneId","remoteLanes","laneIdStr","clear","getComponents","logger","debug","r","idsStr","getParsedId","entry","GeneralError","unresolvedComponents","u","hasWildcard","componentsList","ComponentsList","listComponentsByIdsWithWildcard","provider","cli","merging","register","MergeCmd","CLIAspect","WorkspaceAspect","SnappingAspect","MainRuntime","MergingAspect","addRuntime"],"sources":["merging.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport R from 'ramda';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport {\n ApplyVersionResults,\n MergeStrategy,\n mergeVersion,\n ApplyVersionResult,\n FailedComponents,\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport SnappingAspect, { SnappingMain } from '@teambit/snapping';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport mapSeries from 'p-map-series';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport { BitError } from '@teambit/bit-error';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport { LaneId } from '@teambit/lane-id';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport { AutoTagResult } from '@teambit/legacy/dist/scope/component-ops/auto-tag';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { UnmergedComponent } from '@teambit/legacy/dist/scope/lanes/unmerged-components';\nimport { Lane, Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport chalk from 'chalk';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport ManyComponentsWriter from '@teambit/legacy/dist/consumer/component-ops/many-components-writer';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport checkoutVersion, { applyModifiedVersion } from '@teambit/legacy/dist/consumer/versions-ops/checkout-version';\nimport threeWayMerge, {\n MergeResultsThreeWay,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport { NoCommonSnap } from '@teambit/legacy/dist/scope/exceptions/no-common-snap';\nimport { DivergeData } from '@teambit/legacy/dist/scope/component-ops/diverge-data';\nimport { MergeCmd } from './merge-cmd';\nimport { MergingAspect } from './merging.aspect';\n\nexport type ComponentMergeStatus = {\n currentComponent?: ConsumerComponent | null;\n componentFromModel?: Version;\n id: BitId;\n unmergedMessage?: string;\n unmergedLegitimately?: boolean; // failed to merge but for a legitimate reason, such as, up-to-date\n mergeResults?: MergeResultsThreeWay | null;\n divergeData?: DivergeData;\n resolvedUnrelated?: MergeStrategy;\n};\n\nexport class MergingMain {\n private consumer: Consumer;\n constructor(private workspace: Workspace, private snapping: SnappingMain) {\n this.consumer = this.workspace?.consumer;\n }\n\n /**\n * merge components according to the \"values\" param.\n * if the first param is a version, then merge the component ids to that version.\n * otherwise, merge from the remote head to the local.\n */\n async merge(\n values: 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 ConsumerNotFound();\n const consumer: Consumer = this.workspace.consumer;\n let mergeResults;\n const firstValue = R.head(values);\n if (resolve) {\n mergeResults = await this.resolveMerge(consumer, values, message, build);\n } else if (abort) {\n mergeResults = await this.abortMerge(consumer, values);\n } else if (!BitId.isValidVersion(firstValue)) {\n const bitIds = this.getComponentsToMerge(consumer, values);\n // @todo: version could be the lane only or remote/lane\n mergeResults = await this.mergeComponentsFromRemote(\n consumer,\n bitIds,\n mergeStrategy,\n noSnap,\n message,\n build,\n skipDependencyInstallation\n );\n } else {\n const version = firstValue;\n const ids = R.tail(values);\n const bitIds = this.getComponentsToMerge(consumer, ids);\n mergeResults = await mergeVersion(consumer, version, bitIds, mergeStrategy);\n }\n await consumer.onDestroy();\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: BitId[],\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.unmergedMessage && !c.unmergedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unmergedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to merge due to the following failures:\\n${failureMsgs}`);\n }\n\n return this.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n laneId: currentLaneId,\n localLane: 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 laneId,\n localLane,\n noSnap,\n snapMessage,\n build,\n skipDependencyInstallation,\n }: {\n mergeStrategy: MergeStrategy;\n allComponentsStatus: ComponentMergeStatus[];\n laneId: LaneId;\n localLane: Lane | null;\n noSnap: 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.unmergedMessage)\n .map((componentStatus) => ({\n id: componentStatus.id,\n failureMessage: componentStatus.unmergedMessage as string,\n unchangedLegitimately: componentStatus.unmergedLegitimately,\n }));\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.unmergedMessage);\n // do not use Promise.all for applyVersion. otherwise, it'll write all components in parallel,\n // which can be an issue when some components are also dependencies of others\n const componentsResults = await mapSeries(\n succeededComponents,\n async ({ currentComponent, id, mergeResults, resolvedUnrelated }) => {\n const modelComponent = await consumer.scope.getModelComponent(id);\n const updatedLaneId = laneId.isDefault() ? LaneId.from(laneId.name, id.scope as string) : laneId;\n return this.applyVersion({\n currentComponent,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead: modelComponent.getRef(id.version as string) as Ref,\n laneId: updatedLaneId,\n localLane,\n resolvedUnrelated,\n });\n }\n );\n\n const leftUnresolvedConflicts = componentWithConflict && mergeStrategy === 'manual';\n\n if (!skipDependencyInstallation && !leftUnresolvedConflicts) {\n await this.workspace.install(undefined, {\n dedupe: true,\n updateExisting: false,\n import: false,\n });\n }\n\n if (localLane) consumer.scope.objects.add(localLane);\n\n await consumer.scope.objects.persist(); // persist anyway, if localLane is null it should save all main heads\n\n await consumer.scope.objects.unmergedComponents.write();\n\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 const mergeSnapResults =\n noSnap || leftUnresolvedConflicts ? null : await this.snapResolvedComponents(consumer, snapMessage, build);\n\n return {\n components: componentsResults,\n failedComponents,\n mergeSnapResults,\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 * @param id\n * @param localLane\n * @param otherLaneName\n * @param existingOnWorkspaceOnly\n * @returns\n */\n async getComponentMergeStatus(\n id: BitId, // the id.version is the version we want to merge to the current component\n localLane: Lane | null, // currently checked out lane. if on main, then it's null.\n otherLaneName: string, // the lane name we want to merged to our lane. (can be also \"main\").\n options?: { resolveUnrelated?: MergeStrategy }\n ): Promise<ComponentMergeStatus> {\n const consumer = this.workspace.consumer;\n const componentStatus: ComponentMergeStatus = { id };\n const returnUnmerged = (msg: string, unmergedLegitimately = false) => {\n componentStatus.unmergedMessage = msg;\n componentStatus.unmergedLegitimately = unmergedLegitimately;\n return componentStatus;\n };\n const modelComponent = await consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) {\n return returnUnmerged(\n `component ${id.toString()} is on the lane/main but its objects were not found, please re-import the lane`\n );\n }\n const unmerged = consumer.scope.objects.unmergedComponents.getEntry(id.name);\n if (unmerged) {\n return returnUnmerged(\n `component ${id.toStringWithoutVersion()} is in during-merge state a previous merge, please snap/tag it first (or use bit merge --resolve/--abort)`\n );\n }\n const repo = consumer.scope.objects;\n const version = id.version as string;\n const otherLaneHead = modelComponent.getRef(version);\n const existingBitMapId = consumer.bitMap.getBitIdIfExist(id, { ignoreVersion: true });\n const componentOnLane: Version = await modelComponent.loadVersion(version, consumer.scope.objects);\n if (componentOnLane.isRemoved()) {\n return returnUnmerged(`component has been removed`, true);\n }\n const getCurrentId = () => {\n if (existingBitMapId) return existingBitMapId;\n if (localLane) {\n const idOnLane = localLane.getComponent(id);\n if (!idOnLane) return null;\n return idOnLane.id.changeVersion(idOnLane.head.toString());\n }\n // it's on main\n const head = modelComponent.getHeadAsTagIfExist();\n if (head) {\n return id.changeVersion(head);\n }\n return null;\n };\n const currentId = getCurrentId();\n if (!currentId) {\n const divergeData = await getDivergeData(repo, modelComponent, otherLaneHead, null, false);\n return { currentComponent: null, componentFromModel: componentOnLane, id, mergeResults: null, divergeData };\n }\n const getCurrentComponent = () => {\n if (existingBitMapId) return consumer.loadComponent(existingBitMapId);\n return consumer.scope.getConsumerComponent(currentId);\n };\n const currentComponent = await getCurrentComponent();\n const componentModificationStatus = await consumer.getComponentStatusById(currentComponent.id);\n if (componentModificationStatus.modified) {\n return returnUnmerged(\n `unable to merge ${id.toStringWithoutVersion()}, the component is modified, please snap/tag it first`\n );\n }\n const laneHeadIsDifferentThanCheckedOut =\n localLane && existingBitMapId?.version && modelComponent.laneHeadLocal?.toString() !== existingBitMapId?.version;\n const localHead = laneHeadIsDifferentThanCheckedOut ? Ref.from(existingBitMapId.version) : null;\n\n if (!otherLaneHead) {\n throw new Error(`merging: unable finding a hash for the version ${version} of ${id.toString()}`);\n }\n const divergeData = await getDivergeData(repo, modelComponent, otherLaneHead, localHead, false);\n if (divergeData.err) {\n if (divergeData.err instanceof NoCommonSnap && options?.resolveUnrelated) {\n if (options?.resolveUnrelated === 'theirs') {\n // just override with the model data\n return {\n currentComponent,\n componentFromModel: componentOnLane,\n id,\n mergeResults: null,\n divergeData,\n resolvedUnrelated: 'theirs',\n };\n }\n if (options?.resolveUnrelated === 'ours') {\n return {\n currentComponent,\n id,\n mergeResults: null,\n divergeData,\n resolvedUnrelated: 'ours',\n };\n }\n throw new Error(\n `unsupported strategy \"${options?.resolveUnrelated}\" of resolve-unrelated. supported strategies are: [ours, theirs]`\n );\n }\n return returnUnmerged(\n `unable to traverse ${currentComponent.id.toString()} history. error: ${divergeData.err.message}`\n );\n }\n if (!divergeData.isDiverged()) {\n if (divergeData.isLocalAhead()) {\n // do nothing!\n return returnUnmerged(`component ${currentComponent.id.toString()} is ahead, nothing to merge`, true);\n }\n if (divergeData.isRemoteAhead()) {\n // just override with the model data\n return {\n currentComponent,\n componentFromModel: componentOnLane,\n id,\n mergeResults: null,\n divergeData,\n };\n }\n // we know that localHead and remoteHead are set, so if none of them is ahead they must be equal\n return returnUnmerged(`component ${currentComponent.id.toString()} is already merged`, true);\n }\n const baseSnap = divergeData.commonSnapBeforeDiverge as Ref; // must be set when isTrueMerge\n const baseComponent: Version = await modelComponent.loadVersion(baseSnap.toString(), repo);\n const otherComponent: Version = await modelComponent.loadVersion(otherLaneHead.toString(), repo);\n const currentLaneName = localLane?.toLaneId().toString() || 'main';\n const mergeResults = await threeWayMerge({\n consumer,\n otherComponent,\n otherLabel: `${otherLaneHead.toString()} (${otherLaneName})`,\n currentComponent,\n currentLabel: `${currentId.version} (${currentLaneName})`,\n baseComponent,\n });\n return { currentComponent, id, mergeResults, divergeData };\n }\n\n private async applyVersion({\n currentComponent,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead,\n laneId,\n localLane,\n resolvedUnrelated,\n }: {\n currentComponent: ConsumerComponent | null | undefined;\n id: BitId;\n mergeResults: MergeResultsThreeWay | null | undefined;\n mergeStrategy: MergeStrategy;\n remoteHead: Ref;\n laneId: LaneId;\n localLane: Lane | null;\n resolvedUnrelated?: MergeStrategy;\n }): Promise<ApplyVersionResult> {\n const consumer = this.workspace.consumer;\n let filesStatus = {};\n const unmergedComponent: UnmergedComponent = {\n // @ts-ignore\n id: { name: id.name, scope: id.scope },\n head: remoteHead,\n remote: laneId.scope, // @todo: remove. it has been deprecated around 0.0.832\n lane: laneId.name, // @todo: remove. it has been deprecated around 0.0.832\n laneId,\n };\n id = currentComponent ? currentComponent.id : id;\n\n const modelComponent = await consumer.scope.getModelComponent(id);\n const handleResolveUnrelated = () => {\n if (!currentComponent) throw new Error('currentComponent must be defined when resolvedUnrelated');\n if (!localLane) throw new Error('localLane must be defined when resolvedUnrelated');\n const head = modelComponent.getRef(currentComponent.id.version as string);\n if (!head) throw new Error(`unable to get the head for resolved-unrelated ${id.toString()}`);\n unmergedComponent.laneId = localLane.toLaneId();\n unmergedComponent.head = head;\n unmergedComponent.unrelated = true;\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n return { id, filesStatus };\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 { id, filesStatus };\n }\n if (resolvedUnrelated && resolvedUnrelated === 'ours') {\n markAllFilesAsUnchanged();\n localLane?.addComponent({ id, head: remoteHead });\n return handleResolveUnrelated();\n }\n const remoteId = id.changeVersion(remoteHead.toString());\n const idToLoad = !mergeResults || mergeStrategy === MergeOptions.theirs ? remoteId : id;\n const componentWithDependencies = await consumer.loadComponentWithDependenciesFromModel(idToLoad);\n const files = componentWithDependencies.component.files;\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.updated;\n });\n\n if (mergeResults) {\n // update files according to the merge results\n const { filesStatus: modifiedStatus, modifiedFiles } = applyModifiedVersion(files, mergeResults, mergeStrategy);\n componentWithDependencies.component.files = modifiedFiles;\n filesStatus = { ...filesStatus, ...modifiedStatus };\n }\n\n const manyComponentsWriter = new ManyComponentsWriter({\n consumer,\n componentsWithDependencies: [componentWithDependencies],\n installNpmPackages: false,\n override: true,\n writeConfig: false, // @todo: should write if config exists before, needs to figure out how to do it.\n verbose: false, // @todo: do we need a flag here?\n writeDists: true, // @todo: do we need a flag here?\n writePackageJson: false,\n });\n await manyComponentsWriter.writeAll();\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 (localLane) {\n localLane.addComponent({ id, head: remoteHead });\n if (resolvedUnrelated) {\n // must be \"theirs\"\n return handleResolveUnrelated();\n }\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 { id, filesStatus };\n }\n\n private async abortMerge(consumer: Consumer, values: string[]): Promise<ApplyVersionResults> {\n const ids = this.getIdsForUnmerged(consumer, values);\n // @ts-ignore not clear yet what to do with other flags\n const results = await checkoutVersion(consumer, { ids, reset: true });\n ids.forEach((id) => consumer.scope.objects.unmergedComponents.removeComponent(id.name));\n await consumer.scope.objects.unmergedComponents.write();\n return { abortedComponents: results.components };\n }\n\n private async resolveMerge(\n consumer: Consumer,\n values: string[],\n snapMessage: string,\n build: boolean\n ): Promise<ApplyVersionResults> {\n const ids = this.getIdsForUnmerged(consumer, values);\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const { snappedComponents } = await this.snapping.snap({\n legacyBitIds: BitIds.fromArray(ids),\n build,\n message: snapMessage,\n });\n return { resolvedComponents: snappedComponents };\n }\n\n private async getAllComponentsStatus(\n bitIds: BitId[],\n laneId: LaneId,\n localLaneObject: Lane | null\n ): Promise<ComponentMergeStatus[]> {\n const tmp = new Tmp(this.consumer.scope);\n try {\n const componentsStatus = 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.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 return this.getComponentMergeStatus(bitId.changeVersion(remoteHead.toString()), localLaneObject, laneIdStr);\n })\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n }\n\n private async snapResolvedComponents(\n consumer: Consumer,\n snapMessage: string,\n build: boolean\n ): Promise<null | { snappedComponents: ConsumerComponent[]; autoSnappedResults: AutoTagResult[] }> {\n const unmergedComponents = consumer.scope.objects.unmergedComponents.getComponents();\n logger.debug(`merge-snaps, snapResolvedComponents, total ${unmergedComponents.length.toString()} components`);\n if (!unmergedComponents.length) return null;\n const ids = BitIds.fromArray(unmergedComponents.map((r) => new BitId(r.id)));\n return this.snapping.snap({\n legacyBitIds: ids,\n build,\n message: snapMessage,\n });\n }\n\n private getIdsForUnmerged(consumer: Consumer, idsStr?: string[]): BitId[] {\n if (idsStr && idsStr.length) {\n const bitIds = idsStr.map((id) => consumer.getParsedId(id));\n bitIds.forEach((id) => {\n const entry = consumer.scope.objects.unmergedComponents.getEntry(id.name);\n if (!entry) {\n throw new GeneralError(`unable to merge-resolve ${id.toString()}, it is not marked as unresolved`);\n }\n });\n return bitIds;\n }\n const unresolvedComponents = 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) => new BitId(u.id));\n }\n\n private getComponentsToMerge(consumer: Consumer, ids: string[]): BitId[] {\n if (hasWildcard(ids)) {\n const componentsList = new ComponentsList(consumer);\n return componentsList.listComponentsByIdsWithWildcard(ids);\n }\n return ids.map((id) => consumer.getParsedId(id));\n }\n\n static slots = [];\n static dependencies = [CLIAspect, WorkspaceAspect, SnappingAspect];\n static runtime = MainRuntime;\n static async provider([cli, workspace, snapping]: [CLIMain, Workspace, SnappingMain]) {\n const merging = new MergingMain(workspace, snapping);\n cli.register(new MergeCmd(merging));\n return merging;\n }\n}\n\nMergingAspect.addRuntime(MergingMain);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAUA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAA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AAG,IAAIxO,WAAJ,CAAgBE,SAAhB,EAA2BC,QAA3B,CAAhB;IACAoO,GAAG,CAACE,QAAJ,CAAa,KAAIC,oBAAJ,EAAaF,OAAb,CAAb;IACA,OAAOA,OAAP;EACD;;AAnhBsB;;;gCAAZxO,W,WA4gBI,E;gCA5gBJA,W,kBA6gBW,CAAC2O,gBAAD,EAAYC,oBAAZ,EAA6BC,mBAA7B,C;gCA7gBX7O,W,aA8gBM8O,kB;;AAQnBC,wBAAA,CAAcC,UAAd,CAAyBhP,WAAzB"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/merging",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.149",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/component/merging",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "merging",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.149"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"@babel/runtime": "7.12.18",
|
|
17
17
|
"core-js": "^3.0.0",
|
|
18
18
|
"@teambit/harmony": "0.3.3",
|
|
19
|
-
"@teambit/bit-error": "0.0.
|
|
20
|
-
"@teambit/cli": "0.0.
|
|
21
|
-
"@teambit/lane-id": "0.0.
|
|
22
|
-
"@teambit/snapping": "0.0.
|
|
23
|
-
"@teambit/workspace": "0.0.
|
|
19
|
+
"@teambit/bit-error": "0.0.397",
|
|
20
|
+
"@teambit/cli": "0.0.559",
|
|
21
|
+
"@teambit/lane-id": "0.0.78",
|
|
22
|
+
"@teambit/snapping": "0.0.149",
|
|
23
|
+
"@teambit/workspace": "0.0.834"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/lodash": "4.14.165",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@types/node": "12.20.4"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@teambit/legacy": "1.0.
|
|
35
|
+
"@teambit/legacy": "1.0.341",
|
|
36
36
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
37
37
|
"react": "^16.8.0 || ^17.0.0"
|
|
38
38
|
},
|
|
@@ -54,8 +54,6 @@
|
|
|
54
54
|
"react",
|
|
55
55
|
"react-components",
|
|
56
56
|
"angular",
|
|
57
|
-
"angular-components"
|
|
58
|
-
"vue",
|
|
59
|
-
"vue-components"
|
|
57
|
+
"angular-components"
|
|
60
58
|
]
|
|
61
59
|
}
|
|
File without changes
|
|
Binary file
|