@teambit/merging 1.0.95 → 1.0.97
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/merge-status-provider.d.ts +7 -4
- package/dist/merge-status-provider.js +9 -7
- package/dist/merge-status-provider.js.map +1 -1
- package/dist/merging.main.runtime.d.ts +2 -4
- package/dist/merging.main.runtime.js +3 -1
- package/dist/merging.main.runtime.js.map +1 -1
- package/package.json +17 -17
- /package/dist/{preview-1702565348552.js → preview-1702696474142.js} +0 -0
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { Workspace } from '@teambit/workspace';
|
|
2
|
+
import { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';
|
|
2
3
|
import { ComponentID } from '@teambit/component-id';
|
|
3
4
|
import { Lane } from '@teambit/legacy/dist/scope/models';
|
|
4
5
|
import { ImporterMain } from '@teambit/importer';
|
|
5
6
|
import { Logger } from '@teambit/logger';
|
|
6
7
|
import { ComponentMergeStatus } from './merging.main.runtime';
|
|
8
|
+
export declare type MergeStatusProviderOptions = {
|
|
9
|
+
resolveUnrelated?: MergeStrategy;
|
|
10
|
+
ignoreConfigChanges?: boolean;
|
|
11
|
+
shouldSquash?: boolean;
|
|
12
|
+
};
|
|
7
13
|
export declare class MergeStatusProvider {
|
|
8
14
|
private workspace;
|
|
9
15
|
private logger;
|
|
@@ -13,10 +19,7 @@ export declare class MergeStatusProvider {
|
|
|
13
19
|
private options?;
|
|
14
20
|
constructor(workspace: Workspace, logger: Logger, importer: ImporterMain, currentLane?: Lane | undefined, // currently checked out lane. if on main, then it's undefined.
|
|
15
21
|
otherLane?: Lane | undefined, // the lane we want to merged to our lane. (undefined if it's "main").
|
|
16
|
-
options?:
|
|
17
|
-
resolveUnrelated?: "manual" | "ours" | "theirs" | undefined;
|
|
18
|
-
ignoreConfigChanges?: boolean | undefined;
|
|
19
|
-
} | undefined);
|
|
22
|
+
options?: MergeStatusProviderOptions | undefined);
|
|
20
23
|
getStatus(bitIds: ComponentID[]): Promise<ComponentMergeStatus[]>;
|
|
21
24
|
private getComponentMergeStatus;
|
|
22
25
|
private returnUnmerged;
|
|
@@ -87,16 +87,18 @@ class MergeStatusProvider {
|
|
|
87
87
|
this.options = options;
|
|
88
88
|
}
|
|
89
89
|
async getStatus(bitIds) {
|
|
90
|
-
var _this$otherLane, _this$otherLane2, _this$currentLane, _this$otherLane3;
|
|
90
|
+
var _this$options, _this$otherLane, _this$otherLane2, _this$currentLane, _this$otherLane3;
|
|
91
91
|
if (!this.currentLane && this.otherLane) {
|
|
92
92
|
await this.importer.importObjectsFromMainIfExist(this.otherLane.toBitIds().toVersionLatest());
|
|
93
93
|
}
|
|
94
94
|
const componentStatusBeforeMergeAttempt = await (0, _pMapSeries().default)(bitIds, id => this.getComponentStatusBeforeMergeAttempt(id));
|
|
95
95
|
// whether or not we need to import the gap between the common-snap and the other lane.
|
|
96
96
|
// the common-snap itself we need anyway in order to get the files hash/content for checking conflicts.
|
|
97
|
-
const shouldImportHistoryOfOtherLane = !this.
|
|
97
|
+
const shouldImportHistoryOfOtherLane = !((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.shouldSquash) && (
|
|
98
|
+
// when squashing, no need for all history, only the head is going to be pushed
|
|
99
|
+
!this.currentLane ||
|
|
98
100
|
// on main. we need all history in order to push each component to its remote
|
|
99
|
-
this.currentLane.scope !== ((_this$otherLane = this.otherLane) === null || _this$otherLane === void 0 ? void 0 : _this$otherLane.scope); // on lane, but the other lane is from a different scope. we need all history in order to push to the current lane's scope
|
|
101
|
+
this.currentLane.scope !== ((_this$otherLane = this.otherLane) === null || _this$otherLane === void 0 ? void 0 : _this$otherLane.scope)); // on lane, but the other lane is from a different scope. we need all history in order to push to the current lane's scope
|
|
100
102
|
const toImport = componentStatusBeforeMergeAttempt.map(compStatus => {
|
|
101
103
|
if (!compStatus.divergeData) return [];
|
|
102
104
|
const versionsToImport = [compStatus.divergeData.commonSnapBeforeDiverge];
|
|
@@ -186,7 +188,7 @@ other: ${otherLaneHead.toString()}`);
|
|
|
186
188
|
return componentStatus;
|
|
187
189
|
}
|
|
188
190
|
async getComponentStatusBeforeMergeAttempt(id) {
|
|
189
|
-
var _this$currentLane3, _this$
|
|
191
|
+
var _this$currentLane3, _this$options2;
|
|
190
192
|
const consumer = this.workspace.consumer;
|
|
191
193
|
const componentStatus = {
|
|
192
194
|
id
|
|
@@ -282,7 +284,7 @@ other: ${otherLaneHead.toString()}`);
|
|
|
282
284
|
return 'config';
|
|
283
285
|
};
|
|
284
286
|
const modifiedType = await isModified();
|
|
285
|
-
if (modifiedType === 'config' && !((_this$
|
|
287
|
+
if (modifiedType === 'config' && !((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.ignoreConfigChanges)) {
|
|
286
288
|
return this.returnUnmerged(id, `component has config changes, please snap/tag it first. alternatively, use --ignore-config-changes flag to bypass`);
|
|
287
289
|
}
|
|
288
290
|
if (modifiedType === 'code') {
|
|
@@ -298,8 +300,8 @@ other: ${otherLaneHead.toString()}`);
|
|
|
298
300
|
throws: false
|
|
299
301
|
});
|
|
300
302
|
if (divergeData.err) {
|
|
301
|
-
var _this$
|
|
302
|
-
if (!(divergeData.err instanceof _noCommonSnap().NoCommonSnap) || !((_this$
|
|
303
|
+
var _this$options3;
|
|
304
|
+
if (!(divergeData.err instanceof _noCommonSnap().NoCommonSnap) || !((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.resolveUnrelated)) {
|
|
303
305
|
return this.returnUnmerged(id, `unable to traverse ${currentComponent.id.toString()} history. error: ${divergeData.err.message}`);
|
|
304
306
|
}
|
|
305
307
|
return this.handleNoCommonSnap(modelComponent, id, otherLaneHead, currentComponent, componentOnOther, divergeData);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_componentId","_laneId","_getDivergeData","_repositories","_lodash","_threeWayMerge","_noCommonSnap","_configMerger","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","MergeStatusProvider","constructor","workspace","logger","importer","currentLane","otherLane","options","getStatus","bitIds","_this$otherLane","_this$otherLane2","_this$currentLane","_this$otherLane3","importObjectsFromMainIfExist","toBitIds","toVersionLatest","componentStatusBeforeMergeAttempt","mapSeries","id","getComponentStatusBeforeMergeAttempt","shouldImportHistoryOfOtherLane","scope","toImport","map","compStatus","divergeData","versionsToImport","commonSnapBeforeDiverge","snapsOnTargetOnly","compact","v","changeVersion","toString","flat","reason","consumer","scopeImporter","importWithoutDeps","ComponentIdList","fromArray","lane","cache","includeVersionHistory","compStatusNotNeedMerge","c","mergeProps","compStatusNeedMerge","getComponentsStatusNeedMerge","tmp","Tmp","componentsStatus","Promise","all","getComponentMergeStatus","clear","err","results","componentMergeStatusBeforeMergeAttempt","_this$currentLane2","currentComponent","Error","otherLaneHead","currentId","modelComponent","repo","objects","baseSnap","debug","toStringWithoutVersion","version","baseComponent","loadVersion","otherComponent","currentLaneName","toLaneId","otherLaneName","DEFAULT_LANE","currentLabel","otherLabel","workspaceIds","listIds","configMerger","ConfigMerger","extensions","configMergeResult","merge","mergeResults","threeWayMerge","returnUnmerged","msg","unmergedLegitimately","componentStatus","unchangedMessage","unchangedLegitimately","_this$currentLane3","_this$options","getModelComponentIfExist","unmerged","unmergedComponents","getEntry","fullName","getRef","existingBitMapId","bitMap","getComponentIdIfExist","ignoreVersion","componentOnOther","idOnCurrentLane","getComponent","isRemoved","shouldMerge","shouldRemoveFromMain","shouldBeRemoved","getCurrentId","head","getHeadAsTagIfExist","getDivergeData","targetHead","throws","componentFromModel","getCurrentComponent","loadComponent","getConsumerComponent","isTargetNotAhead","isTargetAhead","shouldIgnore","isModified","componentModificationStatus","getComponentStatusById","modified","isSourceCodeModified","isComponentSourceCodeModified","modifiedType","ignoreConfigChanges","_this$options2","NoCommonSnap","resolveUnrelated","message","handleNoCommonSnap","isDiverged","isSourceAhead","mainHead","returnAccordingToOurs","headToSaveInLane","unrelatedHead","unrelatedLaneId","resolvedUnrelated","strategy","headOnCurrentLane","returnAccordingToTheirs","resolvedRef","unrelatedHeadRef","currentVersionRef","otherVersionRef","hasResolvedFromMain","hashToCompare","divergeDataFromMain","sourceHead","hasResolvedLocally","getHeadRegardlessOfLane","hasResolvedRemotely","refToSaveInLane","_this$currentLane4","_this$currentLane5","_this$otherLane4","_this$currentLane6","exports"],"sources":["merge-status-provider.ts"],"sourcesContent":["import { Workspace } from '@teambit/workspace';\nimport { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport mapSeries from 'p-map-series';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport { ImporterMain } from '@teambit/importer';\nimport { Logger } from '@teambit/logger';\nimport { compact } from 'lodash';\nimport threeWayMerge from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport { NoCommonSnap } from '@teambit/legacy/dist/scope/exceptions/no-common-snap';\nimport { ConfigMerger } from './config-merger';\nimport { ComponentMergeStatus, ComponentMergeStatusBeforeMergeAttempt } from './merging.main.runtime';\n\nexport class MergeStatusProvider {\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private importer: ImporterMain,\n private currentLane?: Lane, // currently checked out lane. if on main, then it's undefined.\n private otherLane?: Lane, // the lane we want to merged to our lane. (undefined if it's \"main\").\n private options?: { resolveUnrelated?: MergeStrategy; ignoreConfigChanges?: boolean }\n ) {}\n\n async getStatus(\n bitIds: ComponentID[] // the id.version is the version we want to merge to the current component\n ): Promise<ComponentMergeStatus[]> {\n if (!this.currentLane && this.otherLane) {\n await this.importer.importObjectsFromMainIfExist(this.otherLane.toBitIds().toVersionLatest());\n }\n const componentStatusBeforeMergeAttempt = await mapSeries(bitIds, (id) =>\n this.getComponentStatusBeforeMergeAttempt(id)\n );\n // whether or not we need to import the gap between the common-snap and the other lane.\n // the common-snap itself we need anyway in order to get the files hash/content for checking conflicts.\n const shouldImportHistoryOfOtherLane =\n !this.currentLane || // on main. we need all history in order to push each component to its remote\n this.currentLane.scope !== this.otherLane?.scope; // on lane, but the other lane is from a different scope. we need all history in order to push to the current lane's scope\n const toImport = componentStatusBeforeMergeAttempt\n .map((compStatus) => {\n if (!compStatus.divergeData) return [];\n const versionsToImport = [compStatus.divergeData.commonSnapBeforeDiverge];\n if (shouldImportHistoryOfOtherLane) {\n versionsToImport.push(...compStatus.divergeData.snapsOnTargetOnly);\n }\n return compact(versionsToImport).map((v) => compStatus.id.changeVersion(v.toString()));\n })\n .flat();\n const reason = shouldImportHistoryOfOtherLane\n ? `for filling the gap between the common-snap and the head of ${this.otherLane?.id() || 'main'}`\n : `for getting the common-snap between ${this.currentLane?.id() || 'main'} and ${this.otherLane?.id() || 'main'}`;\n await this.workspace.consumer.scope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(toImport), {\n lane: this.otherLane,\n cache: true,\n includeVersionHistory: false,\n reason,\n });\n\n const compStatusNotNeedMerge = componentStatusBeforeMergeAttempt.filter(\n (c) => !c.mergeProps\n ) as ComponentMergeStatus[];\n const compStatusNeedMerge = componentStatusBeforeMergeAttempt.filter((c) => c.mergeProps);\n\n const getComponentsStatusNeedMerge = async (): Promise<ComponentMergeStatus[]> => {\n const tmp = new Tmp(this.workspace.consumer.scope);\n try {\n const componentsStatus = await Promise.all(\n compStatusNeedMerge.map((compStatus) => this.getComponentMergeStatus(compStatus))\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n };\n const results = await getComponentsStatusNeedMerge();\n\n results.push(...compStatusNotNeedMerge);\n return results;\n }\n\n private async getComponentMergeStatus(\n componentMergeStatusBeforeMergeAttempt: ComponentMergeStatusBeforeMergeAttempt\n ) {\n const { id, divergeData, currentComponent, mergeProps } = componentMergeStatusBeforeMergeAttempt;\n if (!mergeProps) throw new Error(`getDivergedMergeStatus, mergeProps is missing for ${id.toString()}`);\n const { otherLaneHead, currentId, modelComponent } = mergeProps;\n const repo = this.workspace.consumer.scope.objects;\n if (!divergeData) throw new Error(`getDivergedMergeStatus, divergeData is missing for ${id.toString()}`);\n if (!currentComponent) throw new Error(`getDivergedMergeStatus, currentComponent is missing for ${id.toString()}`);\n\n const baseSnap = divergeData.commonSnapBeforeDiverge as Ref; // must be set when isTrueMerge\n this.logger.debug(`merging snaps details:\nid: ${id.toStringWithoutVersion()}\nbase: ${baseSnap.toString()}\ncurrent: ${currentId.version}\nother: ${otherLaneHead.toString()}`);\n const baseComponent: Version = await modelComponent.loadVersion(baseSnap.toString(), repo);\n const otherComponent: Version = await modelComponent.loadVersion(otherLaneHead.toString(), repo);\n\n const currentLaneName = this.currentLane?.toLaneId().toString() || 'main';\n const otherLaneName = this.otherLane ? this.otherLane.toLaneId().toString() : DEFAULT_LANE;\n const currentLabel = `${currentId.version} (${currentLaneName === otherLaneName ? 'current' : currentLaneName})`;\n const otherLabel = `${otherLaneHead.toString()} (${\n otherLaneName === currentLaneName ? 'incoming' : otherLaneName\n })`;\n const workspaceIds = await this.workspace.listIds();\n const configMerger = new ConfigMerger(\n id.toStringWithoutVersion(),\n workspaceIds,\n this.otherLane,\n currentComponent.extensions,\n baseComponent.extensions,\n otherComponent.extensions,\n currentLabel,\n otherLabel,\n this.logger\n );\n const configMergeResult = configMerger.merge();\n\n const mergeResults = await threeWayMerge({\n consumer: this.workspace.consumer,\n otherComponent,\n otherLabel,\n currentComponent,\n currentLabel,\n baseComponent,\n });\n return { currentComponent, id, mergeResults, divergeData, configMergeResult };\n }\n\n private returnUnmerged(\n id: ComponentID,\n msg: string,\n unmergedLegitimately = false\n ): ComponentMergeStatusBeforeMergeAttempt {\n const componentStatus: ComponentMergeStatusBeforeMergeAttempt = { id };\n componentStatus.unchangedMessage = msg;\n componentStatus.unchangedLegitimately = unmergedLegitimately;\n return componentStatus;\n }\n\n private async getComponentStatusBeforeMergeAttempt(\n id: ComponentID // the id.version is the version we want to merge to the current component\n ): Promise<ComponentMergeStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const componentStatus: ComponentMergeStatusBeforeMergeAttempt = { id };\n const modelComponent = await consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) {\n return this.returnUnmerged(\n id,\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.fullName);\n if (unmerged) {\n return this.returnUnmerged(\n id,\n `component ${id.toStringWithoutVersion()} is in during-merge state a previous merge, please snap/tag it first (or use bit merge --resolve/--abort/ bit lane merge-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.getComponentIdIfExist(id, { ignoreVersion: true });\n const componentOnOther: Version = await modelComponent.loadVersion(version, consumer.scope.objects);\n const idOnCurrentLane = this.currentLane?.getComponent(id);\n\n if (componentOnOther.isRemoved()) {\n // if exist in current lane, we want the current lane to get the soft-remove update.\n // or if it was removed with --update-main, we want to merge it so then main will get the update.\n const shouldMerge = idOnCurrentLane || componentOnOther.shouldRemoveFromMain();\n if (shouldMerge) {\n // remove the component from the workspace if exist.\n componentStatus.shouldBeRemoved = true;\n } else {\n // on main, don't merge soft-removed components unless it's marked with removeOnMain.\n // on lane, if it's not part of the current lane, don't merge it.\n return this.returnUnmerged(id, `component has been removed`, true);\n }\n }\n const getCurrentId = () => {\n if (existingBitMapId) return existingBitMapId;\n if (this.currentLane) {\n if (!idOnCurrentLane) return null;\n return idOnCurrentLane.id.changeVersion(idOnCurrentLane.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, targetHead: otherLaneHead, throws: false });\n return { ...componentStatus, componentFromModel: componentOnOther, 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 if (currentComponent.isRemoved()) {\n // we have a few options:\n // 1. \"other\" is main. in this case, we don't care what happens on main, we want the component to stay deleted on\n // this lane. (even when main is ahead, we don't want to merge it).\n // 2. other is ahead. in this case, other recovered the component. so we can continue with the merge.\n // it is possible that it is diverged, in which case, still continue with the merge, and later on, the\n // merge-config will show a config conflict of the remove aspect.\n // 3. other is not ahead. in this case, just ignore this component, no point to merge it, we want it removed.\n const divergeData = await getDivergeData({ repo, modelComponent, targetHead: otherLaneHead, throws: false });\n const isTargetNotAhead = !divergeData.err && !divergeData.isTargetAhead();\n const shouldIgnore = this.otherLane\n ? isTargetNotAhead // option #2 and #3 above\n : true; // it's main. option #1 above.\n if (shouldIgnore) {\n return this.returnUnmerged(id, `component has been removed`, true);\n }\n }\n\n const isModified = async (): Promise<undefined | 'code' | 'config'> => {\n const componentModificationStatus = await consumer.getComponentStatusById(currentComponent.id);\n if (!componentModificationStatus.modified) return undefined;\n if (!existingBitMapId) return undefined;\n const baseComponent = await modelComponent.loadVersion(\n existingBitMapId.version as string,\n consumer.scope.objects\n );\n const isSourceCodeModified = await consumer.isComponentSourceCodeModified(baseComponent, currentComponent);\n if (isSourceCodeModified) return 'code';\n return 'config';\n };\n\n const modifiedType = await isModified();\n if (modifiedType === 'config' && !this.options?.ignoreConfigChanges) {\n return this.returnUnmerged(\n id,\n `component has config changes, please snap/tag it first. alternatively, use --ignore-config-changes flag to bypass`\n );\n }\n if (modifiedType === 'code') {\n return this.returnUnmerged(id, `component is modified, please snap/tag it first`);\n }\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({\n repo,\n modelComponent,\n targetHead: otherLaneHead,\n throws: false,\n });\n if (divergeData.err) {\n if (!(divergeData.err instanceof NoCommonSnap) || !this.options?.resolveUnrelated) {\n return this.returnUnmerged(\n id,\n `unable to traverse ${currentComponent.id.toString()} history. error: ${divergeData.err.message}`\n );\n }\n return this.handleNoCommonSnap(\n modelComponent,\n id,\n otherLaneHead,\n currentComponent,\n componentOnOther,\n divergeData\n );\n }\n if (!divergeData.isDiverged()) {\n if (divergeData.isSourceAhead()) {\n // do nothing!\n return this.returnUnmerged(id, `component ${currentComponent.id.toString()} is ahead, nothing to merge`, true);\n }\n if (divergeData.isTargetAhead()) {\n // just override with the model data\n return {\n ...componentStatus,\n currentComponent,\n componentFromModel: componentOnOther,\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 this.returnUnmerged(id, `component ${currentComponent.id.toString()} is already merged`, true);\n }\n\n // it's diverged and needs merge operation\n const mergeProps = {\n otherLaneHead,\n currentId,\n modelComponent,\n };\n\n return { ...componentStatus, currentComponent, mergeProps, divergeData };\n }\n\n private async handleNoCommonSnap(\n modelComponent: ModelComponent,\n id: ComponentID,\n otherLaneHead: Ref,\n currentComponent: ConsumerComponent,\n componentOnOther?: Version,\n divergeData?: SnapsDistance\n ): Promise<ComponentMergeStatusBeforeMergeAttempt> {\n let { resolveUnrelated } = this.options || {};\n if (currentComponent.isRemoved()) {\n resolveUnrelated = 'theirs';\n }\n if (!resolveUnrelated) throw new Error(`handleNoCommonSnap expects resolveUnrelated to be set`);\n const consumer = this.workspace.consumer;\n const repo = consumer.scope.objects;\n const mainHead = modelComponent.head;\n\n const returnAccordingToOurs = (\n headToSaveInLane: Ref,\n unrelatedHead: Ref,\n unrelatedLaneId: LaneId\n ): ComponentMergeStatusBeforeMergeAttempt => {\n return {\n currentComponent,\n id,\n divergeData,\n resolvedUnrelated: {\n strategy: 'ours',\n headOnCurrentLane: headToSaveInLane,\n unrelatedHead,\n unrelatedLaneId,\n },\n };\n };\n const returnAccordingToTheirs = (\n resolvedRef: Ref,\n unrelatedHeadRef: Ref,\n unrelatedLaneId: LaneId\n ): ComponentMergeStatusBeforeMergeAttempt => {\n // just override with the model data\n return {\n currentComponent,\n componentFromModel: componentOnOther,\n id,\n divergeData,\n resolvedUnrelated: {\n strategy: 'theirs',\n headOnCurrentLane: resolvedRef,\n unrelatedHead: unrelatedHeadRef,\n unrelatedLaneId,\n },\n };\n };\n\n const currentVersionRef = modelComponent.getRef(currentComponent.id.version as string);\n if (!currentVersionRef)\n throw new Error(\n `handleNoCommonSnap, unable to get ref of current version \"${\n currentComponent.id.version\n }\" for \"${id.toString()}\"`\n );\n const otherVersionRef = modelComponent.getRef(id.version as string);\n if (!otherVersionRef)\n throw new Error(`handleNoCommonSnap, unable to get ref of other version \"${id.version}\" for \"${id.toString()}\"`);\n\n if (mainHead) {\n const hasResolvedFromMain = async (hashToCompare: Ref | null) => {\n const divergeDataFromMain = await getDivergeData({\n repo,\n modelComponent,\n sourceHead: hashToCompare,\n targetHead: mainHead,\n throws: false,\n });\n if (!divergeDataFromMain.err) return true;\n return !(divergeDataFromMain.err instanceof NoCommonSnap);\n };\n const hasResolvedLocally = await hasResolvedFromMain(modelComponent.getHeadRegardlessOfLane() as Ref);\n const hasResolvedRemotely = await hasResolvedFromMain(otherLaneHead);\n if (!hasResolvedLocally && !hasResolvedRemotely) {\n return this.returnUnmerged(\n id,\n `unable to traverse ${currentComponent.id.toString()} history. the main-head ${mainHead.toString()} doesn't appear in both lanes.\nit was probably created in each lane separately and it also exists on main. please merge main first to one of these lanes`\n );\n }\n const refToSaveInLane = hasResolvedLocally ? currentVersionRef : otherVersionRef;\n const unrelatedHeadRef = hasResolvedLocally ? otherVersionRef : currentVersionRef;\n if (resolveUnrelated === 'ours') {\n return returnAccordingToOurs(refToSaveInLane, unrelatedHeadRef, this.currentLane?.toLaneId() as LaneId);\n }\n if (resolveUnrelated === 'theirs') {\n return returnAccordingToTheirs(refToSaveInLane, unrelatedHeadRef, this.currentLane?.toLaneId() as LaneId);\n }\n throw new Error(\n `unsupported strategy \"${resolveUnrelated}\" of resolve-unrelated. supported strategies are: [ours, theirs]`\n );\n }\n\n const refToSaveInLane = resolveUnrelated === 'ours' ? currentVersionRef : otherVersionRef;\n const unrelatedHeadRef = resolveUnrelated === 'ours' ? otherVersionRef : currentVersionRef;\n if (resolveUnrelated === 'ours') {\n return returnAccordingToOurs(refToSaveInLane, unrelatedHeadRef, this.otherLane?.toLaneId() as LaneId);\n }\n if (resolveUnrelated === 'theirs') {\n return returnAccordingToTheirs(refToSaveInLane, unrelatedHeadRef, this.currentLane?.toLaneId() as LaneId);\n }\n throw new Error(\n `unsupported strategy \"${resolveUnrelated}\" of resolve-unrelated. supported strategies are: [ours, theirs]`\n );\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,aAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,YAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,gBAAA;EAAA,MAAAL,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IAAA6B,kBAAA;MACjC,OAAOhB,uBAAuB,CAACY,eAAe,EAAEV,gBAAgB,GAAAc,kBAAA,GAAE,IAAI,CAACjK,WAAW,cAAAiK,kBAAA,uBAAhBA,kBAAA,CAAkB3F,QAAQ,CAAC,CAAW,CAAC;IAC3G;IACA,MAAM,IAAId,KAAK,CACZ,yBAAwB4E,gBAAiB,kEAC5C,CAAC;EACH;AACF;AAAC8B,OAAA,CAAAvK,mBAAA,GAAAA,mBAAA"}
|
|
1
|
+
{"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_componentId","_laneId","_getDivergeData","_repositories","_lodash","_threeWayMerge","_noCommonSnap","_configMerger","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","MergeStatusProvider","constructor","workspace","logger","importer","currentLane","otherLane","options","getStatus","bitIds","_this$options","_this$otherLane","_this$otherLane2","_this$currentLane","_this$otherLane3","importObjectsFromMainIfExist","toBitIds","toVersionLatest","componentStatusBeforeMergeAttempt","mapSeries","id","getComponentStatusBeforeMergeAttempt","shouldImportHistoryOfOtherLane","shouldSquash","scope","toImport","map","compStatus","divergeData","versionsToImport","commonSnapBeforeDiverge","snapsOnTargetOnly","compact","v","changeVersion","toString","flat","reason","consumer","scopeImporter","importWithoutDeps","ComponentIdList","fromArray","lane","cache","includeVersionHistory","compStatusNotNeedMerge","c","mergeProps","compStatusNeedMerge","getComponentsStatusNeedMerge","tmp","Tmp","componentsStatus","Promise","all","getComponentMergeStatus","clear","err","results","componentMergeStatusBeforeMergeAttempt","_this$currentLane2","currentComponent","Error","otherLaneHead","currentId","modelComponent","repo","objects","baseSnap","debug","toStringWithoutVersion","version","baseComponent","loadVersion","otherComponent","currentLaneName","toLaneId","otherLaneName","DEFAULT_LANE","currentLabel","otherLabel","workspaceIds","listIds","configMerger","ConfigMerger","extensions","configMergeResult","merge","mergeResults","threeWayMerge","returnUnmerged","msg","unmergedLegitimately","componentStatus","unchangedMessage","unchangedLegitimately","_this$currentLane3","_this$options2","getModelComponentIfExist","unmerged","unmergedComponents","getEntry","fullName","getRef","existingBitMapId","bitMap","getComponentIdIfExist","ignoreVersion","componentOnOther","idOnCurrentLane","getComponent","isRemoved","shouldMerge","shouldRemoveFromMain","shouldBeRemoved","getCurrentId","head","getHeadAsTagIfExist","getDivergeData","targetHead","throws","componentFromModel","getCurrentComponent","loadComponent","getConsumerComponent","isTargetNotAhead","isTargetAhead","shouldIgnore","isModified","componentModificationStatus","getComponentStatusById","modified","isSourceCodeModified","isComponentSourceCodeModified","modifiedType","ignoreConfigChanges","_this$options3","NoCommonSnap","resolveUnrelated","message","handleNoCommonSnap","isDiverged","isSourceAhead","mainHead","returnAccordingToOurs","headToSaveInLane","unrelatedHead","unrelatedLaneId","resolvedUnrelated","strategy","headOnCurrentLane","returnAccordingToTheirs","resolvedRef","unrelatedHeadRef","currentVersionRef","otherVersionRef","hasResolvedFromMain","hashToCompare","divergeDataFromMain","sourceHead","hasResolvedLocally","getHeadRegardlessOfLane","hasResolvedRemotely","refToSaveInLane","_this$currentLane4","_this$currentLane5","_this$otherLane4","_this$currentLane6","exports"],"sources":["merge-status-provider.ts"],"sourcesContent":["import { Workspace } from '@teambit/workspace';\nimport { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport mapSeries from 'p-map-series';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport { ImporterMain } from '@teambit/importer';\nimport { Logger } from '@teambit/logger';\nimport { compact } from 'lodash';\nimport threeWayMerge from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport { NoCommonSnap } from '@teambit/legacy/dist/scope/exceptions/no-common-snap';\nimport { ConfigMerger } from './config-merger';\nimport { ComponentMergeStatus, ComponentMergeStatusBeforeMergeAttempt } from './merging.main.runtime';\n\nexport type MergeStatusProviderOptions = {\n resolveUnrelated?: MergeStrategy;\n ignoreConfigChanges?: boolean;\n shouldSquash?: boolean;\n};\n\nexport class MergeStatusProvider {\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private importer: ImporterMain,\n private currentLane?: Lane, // currently checked out lane. if on main, then it's undefined.\n private otherLane?: Lane, // the lane we want to merged to our lane. (undefined if it's \"main\").\n private options?: MergeStatusProviderOptions\n ) {}\n\n async getStatus(\n bitIds: ComponentID[] // the id.version is the version we want to merge to the current component\n ): Promise<ComponentMergeStatus[]> {\n if (!this.currentLane && this.otherLane) {\n await this.importer.importObjectsFromMainIfExist(this.otherLane.toBitIds().toVersionLatest());\n }\n const componentStatusBeforeMergeAttempt = await mapSeries(bitIds, (id) =>\n this.getComponentStatusBeforeMergeAttempt(id)\n );\n // whether or not we need to import the gap between the common-snap and the other lane.\n // the common-snap itself we need anyway in order to get the files hash/content for checking conflicts.\n const shouldImportHistoryOfOtherLane =\n !this.options?.shouldSquash && // when squashing, no need for all history, only the head is going to be pushed\n (!this.currentLane || // on main. we need all history in order to push each component to its remote\n this.currentLane.scope !== this.otherLane?.scope); // on lane, but the other lane is from a different scope. we need all history in order to push to the current lane's scope\n const toImport = componentStatusBeforeMergeAttempt\n .map((compStatus) => {\n if (!compStatus.divergeData) return [];\n const versionsToImport = [compStatus.divergeData.commonSnapBeforeDiverge];\n if (shouldImportHistoryOfOtherLane) {\n versionsToImport.push(...compStatus.divergeData.snapsOnTargetOnly);\n }\n return compact(versionsToImport).map((v) => compStatus.id.changeVersion(v.toString()));\n })\n .flat();\n const reason = shouldImportHistoryOfOtherLane\n ? `for filling the gap between the common-snap and the head of ${this.otherLane?.id() || 'main'}`\n : `for getting the common-snap between ${this.currentLane?.id() || 'main'} and ${this.otherLane?.id() || 'main'}`;\n await this.workspace.consumer.scope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(toImport), {\n lane: this.otherLane,\n cache: true,\n includeVersionHistory: false,\n reason,\n });\n\n const compStatusNotNeedMerge = componentStatusBeforeMergeAttempt.filter(\n (c) => !c.mergeProps\n ) as ComponentMergeStatus[];\n const compStatusNeedMerge = componentStatusBeforeMergeAttempt.filter((c) => c.mergeProps);\n\n const getComponentsStatusNeedMerge = async (): Promise<ComponentMergeStatus[]> => {\n const tmp = new Tmp(this.workspace.consumer.scope);\n try {\n const componentsStatus = await Promise.all(\n compStatusNeedMerge.map((compStatus) => this.getComponentMergeStatus(compStatus))\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n };\n const results = await getComponentsStatusNeedMerge();\n\n results.push(...compStatusNotNeedMerge);\n return results;\n }\n\n private async getComponentMergeStatus(\n componentMergeStatusBeforeMergeAttempt: ComponentMergeStatusBeforeMergeAttempt\n ) {\n const { id, divergeData, currentComponent, mergeProps } = componentMergeStatusBeforeMergeAttempt;\n if (!mergeProps) throw new Error(`getDivergedMergeStatus, mergeProps is missing for ${id.toString()}`);\n const { otherLaneHead, currentId, modelComponent } = mergeProps;\n const repo = this.workspace.consumer.scope.objects;\n if (!divergeData) throw new Error(`getDivergedMergeStatus, divergeData is missing for ${id.toString()}`);\n if (!currentComponent) throw new Error(`getDivergedMergeStatus, currentComponent is missing for ${id.toString()}`);\n\n const baseSnap = divergeData.commonSnapBeforeDiverge as Ref; // must be set when isTrueMerge\n this.logger.debug(`merging snaps details:\nid: ${id.toStringWithoutVersion()}\nbase: ${baseSnap.toString()}\ncurrent: ${currentId.version}\nother: ${otherLaneHead.toString()}`);\n const baseComponent: Version = await modelComponent.loadVersion(baseSnap.toString(), repo);\n const otherComponent: Version = await modelComponent.loadVersion(otherLaneHead.toString(), repo);\n\n const currentLaneName = this.currentLane?.toLaneId().toString() || 'main';\n const otherLaneName = this.otherLane ? this.otherLane.toLaneId().toString() : DEFAULT_LANE;\n const currentLabel = `${currentId.version} (${currentLaneName === otherLaneName ? 'current' : currentLaneName})`;\n const otherLabel = `${otherLaneHead.toString()} (${\n otherLaneName === currentLaneName ? 'incoming' : otherLaneName\n })`;\n const workspaceIds = await this.workspace.listIds();\n const configMerger = new ConfigMerger(\n id.toStringWithoutVersion(),\n workspaceIds,\n this.otherLane,\n currentComponent.extensions,\n baseComponent.extensions,\n otherComponent.extensions,\n currentLabel,\n otherLabel,\n this.logger\n );\n const configMergeResult = configMerger.merge();\n\n const mergeResults = await threeWayMerge({\n consumer: this.workspace.consumer,\n otherComponent,\n otherLabel,\n currentComponent,\n currentLabel,\n baseComponent,\n });\n return { currentComponent, id, mergeResults, divergeData, configMergeResult };\n }\n\n private returnUnmerged(\n id: ComponentID,\n msg: string,\n unmergedLegitimately = false\n ): ComponentMergeStatusBeforeMergeAttempt {\n const componentStatus: ComponentMergeStatusBeforeMergeAttempt = { id };\n componentStatus.unchangedMessage = msg;\n componentStatus.unchangedLegitimately = unmergedLegitimately;\n return componentStatus;\n }\n\n private async getComponentStatusBeforeMergeAttempt(\n id: ComponentID // the id.version is the version we want to merge to the current component\n ): Promise<ComponentMergeStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const componentStatus: ComponentMergeStatusBeforeMergeAttempt = { id };\n const modelComponent = await consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) {\n return this.returnUnmerged(\n id,\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.fullName);\n if (unmerged) {\n return this.returnUnmerged(\n id,\n `component ${id.toStringWithoutVersion()} is in during-merge state a previous merge, please snap/tag it first (or use bit merge --resolve/--abort/ bit lane merge-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.getComponentIdIfExist(id, { ignoreVersion: true });\n const componentOnOther: Version = await modelComponent.loadVersion(version, consumer.scope.objects);\n const idOnCurrentLane = this.currentLane?.getComponent(id);\n\n if (componentOnOther.isRemoved()) {\n // if exist in current lane, we want the current lane to get the soft-remove update.\n // or if it was removed with --update-main, we want to merge it so then main will get the update.\n const shouldMerge = idOnCurrentLane || componentOnOther.shouldRemoveFromMain();\n if (shouldMerge) {\n // remove the component from the workspace if exist.\n componentStatus.shouldBeRemoved = true;\n } else {\n // on main, don't merge soft-removed components unless it's marked with removeOnMain.\n // on lane, if it's not part of the current lane, don't merge it.\n return this.returnUnmerged(id, `component has been removed`, true);\n }\n }\n const getCurrentId = () => {\n if (existingBitMapId) return existingBitMapId;\n if (this.currentLane) {\n if (!idOnCurrentLane) return null;\n return idOnCurrentLane.id.changeVersion(idOnCurrentLane.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, targetHead: otherLaneHead, throws: false });\n return { ...componentStatus, componentFromModel: componentOnOther, 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 if (currentComponent.isRemoved()) {\n // we have a few options:\n // 1. \"other\" is main. in this case, we don't care what happens on main, we want the component to stay deleted on\n // this lane. (even when main is ahead, we don't want to merge it).\n // 2. other is ahead. in this case, other recovered the component. so we can continue with the merge.\n // it is possible that it is diverged, in which case, still continue with the merge, and later on, the\n // merge-config will show a config conflict of the remove aspect.\n // 3. other is not ahead. in this case, just ignore this component, no point to merge it, we want it removed.\n const divergeData = await getDivergeData({ repo, modelComponent, targetHead: otherLaneHead, throws: false });\n const isTargetNotAhead = !divergeData.err && !divergeData.isTargetAhead();\n const shouldIgnore = this.otherLane\n ? isTargetNotAhead // option #2 and #3 above\n : true; // it's main. option #1 above.\n if (shouldIgnore) {\n return this.returnUnmerged(id, `component has been removed`, true);\n }\n }\n\n const isModified = async (): Promise<undefined | 'code' | 'config'> => {\n const componentModificationStatus = await consumer.getComponentStatusById(currentComponent.id);\n if (!componentModificationStatus.modified) return undefined;\n if (!existingBitMapId) return undefined;\n const baseComponent = await modelComponent.loadVersion(\n existingBitMapId.version as string,\n consumer.scope.objects\n );\n const isSourceCodeModified = await consumer.isComponentSourceCodeModified(baseComponent, currentComponent);\n if (isSourceCodeModified) return 'code';\n return 'config';\n };\n\n const modifiedType = await isModified();\n if (modifiedType === 'config' && !this.options?.ignoreConfigChanges) {\n return this.returnUnmerged(\n id,\n `component has config changes, please snap/tag it first. alternatively, use --ignore-config-changes flag to bypass`\n );\n }\n if (modifiedType === 'code') {\n return this.returnUnmerged(id, `component is modified, please snap/tag it first`);\n }\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({\n repo,\n modelComponent,\n targetHead: otherLaneHead,\n throws: false,\n });\n if (divergeData.err) {\n if (!(divergeData.err instanceof NoCommonSnap) || !this.options?.resolveUnrelated) {\n return this.returnUnmerged(\n id,\n `unable to traverse ${currentComponent.id.toString()} history. error: ${divergeData.err.message}`\n );\n }\n return this.handleNoCommonSnap(\n modelComponent,\n id,\n otherLaneHead,\n currentComponent,\n componentOnOther,\n divergeData\n );\n }\n if (!divergeData.isDiverged()) {\n if (divergeData.isSourceAhead()) {\n // do nothing!\n return this.returnUnmerged(id, `component ${currentComponent.id.toString()} is ahead, nothing to merge`, true);\n }\n if (divergeData.isTargetAhead()) {\n // just override with the model data\n return {\n ...componentStatus,\n currentComponent,\n componentFromModel: componentOnOther,\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 this.returnUnmerged(id, `component ${currentComponent.id.toString()} is already merged`, true);\n }\n\n // it's diverged and needs merge operation\n const mergeProps = {\n otherLaneHead,\n currentId,\n modelComponent,\n };\n\n return { ...componentStatus, currentComponent, mergeProps, divergeData };\n }\n\n private async handleNoCommonSnap(\n modelComponent: ModelComponent,\n id: ComponentID,\n otherLaneHead: Ref,\n currentComponent: ConsumerComponent,\n componentOnOther?: Version,\n divergeData?: SnapsDistance\n ): Promise<ComponentMergeStatusBeforeMergeAttempt> {\n let { resolveUnrelated } = this.options || {};\n if (currentComponent.isRemoved()) {\n resolveUnrelated = 'theirs';\n }\n if (!resolveUnrelated) throw new Error(`handleNoCommonSnap expects resolveUnrelated to be set`);\n const consumer = this.workspace.consumer;\n const repo = consumer.scope.objects;\n const mainHead = modelComponent.head;\n\n const returnAccordingToOurs = (\n headToSaveInLane: Ref,\n unrelatedHead: Ref,\n unrelatedLaneId: LaneId\n ): ComponentMergeStatusBeforeMergeAttempt => {\n return {\n currentComponent,\n id,\n divergeData,\n resolvedUnrelated: {\n strategy: 'ours',\n headOnCurrentLane: headToSaveInLane,\n unrelatedHead,\n unrelatedLaneId,\n },\n };\n };\n const returnAccordingToTheirs = (\n resolvedRef: Ref,\n unrelatedHeadRef: Ref,\n unrelatedLaneId: LaneId\n ): ComponentMergeStatusBeforeMergeAttempt => {\n // just override with the model data\n return {\n currentComponent,\n componentFromModel: componentOnOther,\n id,\n divergeData,\n resolvedUnrelated: {\n strategy: 'theirs',\n headOnCurrentLane: resolvedRef,\n unrelatedHead: unrelatedHeadRef,\n unrelatedLaneId,\n },\n };\n };\n\n const currentVersionRef = modelComponent.getRef(currentComponent.id.version as string);\n if (!currentVersionRef)\n throw new Error(\n `handleNoCommonSnap, unable to get ref of current version \"${\n currentComponent.id.version\n }\" for \"${id.toString()}\"`\n );\n const otherVersionRef = modelComponent.getRef(id.version as string);\n if (!otherVersionRef)\n throw new Error(`handleNoCommonSnap, unable to get ref of other version \"${id.version}\" for \"${id.toString()}\"`);\n\n if (mainHead) {\n const hasResolvedFromMain = async (hashToCompare: Ref | null) => {\n const divergeDataFromMain = await getDivergeData({\n repo,\n modelComponent,\n sourceHead: hashToCompare,\n targetHead: mainHead,\n throws: false,\n });\n if (!divergeDataFromMain.err) return true;\n return !(divergeDataFromMain.err instanceof NoCommonSnap);\n };\n const hasResolvedLocally = await hasResolvedFromMain(modelComponent.getHeadRegardlessOfLane() as Ref);\n const hasResolvedRemotely = await hasResolvedFromMain(otherLaneHead);\n if (!hasResolvedLocally && !hasResolvedRemotely) {\n return this.returnUnmerged(\n id,\n `unable to traverse ${currentComponent.id.toString()} history. the main-head ${mainHead.toString()} doesn't appear in both lanes.\nit was probably created in each lane separately and it also exists on main. please merge main first to one of these lanes`\n );\n }\n const refToSaveInLane = hasResolvedLocally ? currentVersionRef : otherVersionRef;\n const unrelatedHeadRef = hasResolvedLocally ? otherVersionRef : currentVersionRef;\n if (resolveUnrelated === 'ours') {\n return returnAccordingToOurs(refToSaveInLane, unrelatedHeadRef, this.currentLane?.toLaneId() as LaneId);\n }\n if (resolveUnrelated === 'theirs') {\n return returnAccordingToTheirs(refToSaveInLane, unrelatedHeadRef, this.currentLane?.toLaneId() as LaneId);\n }\n throw new Error(\n `unsupported strategy \"${resolveUnrelated}\" of resolve-unrelated. supported strategies are: [ours, theirs]`\n );\n }\n\n const refToSaveInLane = resolveUnrelated === 'ours' ? currentVersionRef : otherVersionRef;\n const unrelatedHeadRef = resolveUnrelated === 'ours' ? otherVersionRef : currentVersionRef;\n if (resolveUnrelated === 'ours') {\n return returnAccordingToOurs(refToSaveInLane, unrelatedHeadRef, this.otherLane?.toLaneId() as LaneId);\n }\n if (resolveUnrelated === 'theirs') {\n return returnAccordingToTheirs(refToSaveInLane, unrelatedHeadRef, this.curr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AA2B,kBAAA;QACjC,OAAOd,uBAAuB,CAACY,eAAe,EAAEV,gBAAgB,GAAAY,kBAAA,GAAE,IAAI,CAACjK,WAAW,cAAAiK,kBAAA,uBAAhBA,kBAAA,CAAkBzF,QAAQ,CAAC,CAAW,CAAC;MAC3G;MACA,MAAM,IAAId,KAAK,CACZ,yBAAwB4E,gBAAiB,kEAC5C,CAAC;IACH;IAEA,MAAMyB,eAAe,GAAGzB,gBAAgB,KAAK,MAAM,GAAGgB,iBAAiB,GAAGC,eAAe;IACzF,MAAMF,gBAAgB,GAAGf,gBAAgB,KAAK,MAAM,GAAGiB,eAAe,GAAGD,iBAAiB;IAC1F,IAAIhB,gBAAgB,KAAK,MAAM,EAAE;MAAA,IAAA4B,gBAAA;MAC/B,OAAOtB,qBAAqB,CAACmB,eAAe,EAAEV,gBAAgB,GAAAa,gBAAA,GAAE,IAAI,CAACjK,SAAS,cAAAiK,gBAAA,uBAAdA,gBAAA,CAAgB1F,QAAQ,CAAC,CAAW,CAAC;IACvG;IACA,IAAI8D,gBAAgB,KAAK,QAAQ,EAAE;MAAA,IAAA6B,kBAAA;MACjC,OAAOhB,uBAAuB,CAACY,eAAe,EAAEV,gBAAgB,GAAAc,kBAAA,GAAE,IAAI,CAACnK,WAAW,cAAAmK,kBAAA,uBAAhBA,kBAAA,CAAkB3F,QAAQ,CAAC,CAAW,CAAC;IAC3G;IACA,MAAM,IAAId,KAAK,CACZ,yBAAwB4E,gBAAiB,kEAC5C,CAAC;EACH;AACF;AAAC8B,OAAA,CAAAzK,mBAAA,GAAAA,mBAAA"}
|
|
@@ -21,6 +21,7 @@ import { CheckoutMain, ComponentStatusBase } from '@teambit/checkout';
|
|
|
21
21
|
import { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';
|
|
22
22
|
import { InstallMain } from '@teambit/install';
|
|
23
23
|
import { ConfigMergeResult } from './config-merge-result';
|
|
24
|
+
import { MergeStatusProviderOptions } from './merge-status-provider';
|
|
24
25
|
declare type ResolveUnrelatedData = {
|
|
25
26
|
strategy: MergeStrategy;
|
|
26
27
|
headOnCurrentLane: Ref;
|
|
@@ -118,10 +119,7 @@ export declare class MergingMain {
|
|
|
118
119
|
getMergeStatus(bitIds: ComponentID[], // the id.version is the version we want to merge to the current component
|
|
119
120
|
currentLane: Lane | null, // currently checked out lane. if on main, then it's null.
|
|
120
121
|
otherLane?: Lane | null, // the lane we want to merged to our lane. (null if it's "main").
|
|
121
|
-
options?:
|
|
122
|
-
resolveUnrelated?: MergeStrategy;
|
|
123
|
-
ignoreConfigChanges?: boolean;
|
|
124
|
-
}): Promise<ComponentMergeStatus[]>;
|
|
122
|
+
options?: MergeStatusProviderOptions): Promise<ComponentMergeStatus[]>;
|
|
125
123
|
private applyVersionMultiple;
|
|
126
124
|
private applyVersion;
|
|
127
125
|
private abortMerge;
|
|
@@ -755,7 +755,9 @@ class MergingMain {
|
|
|
755
755
|
}
|
|
756
756
|
return bitId.changeVersion(remoteHead.toString());
|
|
757
757
|
}));
|
|
758
|
-
return this.getMergeStatus(ids, localLaneObject, localLaneObject
|
|
758
|
+
return this.getMergeStatus(ids, localLaneObject, localLaneObject, {
|
|
759
|
+
shouldSquash: false
|
|
760
|
+
});
|
|
759
761
|
}
|
|
760
762
|
async snapResolvedComponents(consumer, snapMessage, build) {
|
|
761
763
|
const unmergedComponents = consumer.scope.objects.unmergedComponents.getComponents();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_semver","_interopRequireDefault","_workspace","_interopRequireWildcard","_componentsList","_mergeVersion","_snapping","_hasWildcard","_pMapSeries","_componentId","_bitError","_generalError","_laneId","_chalk","_config","_remove","_utils","_componentWriter","_importer","_logger","_globalConfig","_lodash","_dependencyResolver","_checkout","_constants","_deleteComponentFiles","_install","_mergeCmd","_merging","_configMergeResult","_mergeStatusProvider","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","key","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","MergingMain","constructor","workspace","install","snapping","checkout","logger","componentWriter","importer","config","remove","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","laneId","localLane","tag","_mergeSnapResults","componentWithConflict","find","component","hasConflicts","getMergeStrategyInteractive","componentStatus","shouldBeRemoved","componentIdsToRemove","changeVersion","succeededComponents","componentsResults","applyVersionMultiple","allConfigMerge","compact","configMergeResult","workspaceDepsUpdates","workspaceDepsConflicts","updateWorkspaceJsoncWithDepsIfNeeded","generateConfigMergeConflictFileForAll","scope","objects","add","persist","unmergedComponents","write","writeBitMap","compBitIdsToRemove","ComponentIdList","fromArray","deleteComponentsFiles","cleanFromBitMap","componentsHasConfigMergeConflicts","some","_c$configMergeResult","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","configMergeFile","getConflictMergeFile","workspaceConflict","ConfigMergeResult","DependencyResolverAspect","conflict","unshift","configMerge","generateMergeConflictFile","addConflict","compIdStr","hasConflict","allResults","getDepsResolverResult","nonConflictDeps","nonConflictSources","_configMerge$getDepsR","mergedConfig","mergedConfigPolicy","policy","DEPENDENCIES_FIELDS","depField","pkg","force","name","includes","version","conflictDeps","conflictDepsSources","_configMerge$getDepsR2","mergedConfigConflict","notConflictedPackages","conflictedPackages","workspaceConfig","Error","depResolver","extensions","findCoreExtension","workspaceJsonUpdates","pkgName","_policy$depField","currentVer","newVer","debug","WS_DEPS_FIELDS","workspaceJsonConflicts","dependencies","peerDependencies","conflictPackagesToRemoveFromConfigMerge","conflictRaw","currentVal","otherVal","split","_policy$depField2","currentVerInWsJson","semver","satisfies","replace","isEmpty","result","_result$conflict","_result$conflict2","dep","getMergeStatus","currentLane","otherLane","options","mergeStatusProvider","MergeStatusProvider","getStatus","mapSeries","currentComponent","resolvedUnrelated","modelComponent","getModelComponent","updatedLaneId","isDefault","LaneId","from","applyVersion","remoteHead","getRef","compsToWrite","legacyCompToWrite","manyComponentsWriterOpts","writeConfig","reasonForBitmapChange","writeMany","filesStatus","unmergedComponent","fullName","head","handleResolveUnrelated","addComponent","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","manual","unmergedPaths","f","filePath","setHead","markVersionAsLocal","values","getIdsForUnmerged","reset","removeComponent","abortedComponents","snap","legacyBitIds","resolvedComponents","localLaneObject","Promise","all","bitId","remoteScopeName","remoteLaneId","remoteLanes","laneIdStr","toStringWithoutVersion","getComponents","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","MainRuntime","addRuntime"],"sources":["merging.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport semver from 'semver';\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 ApplyVersionResult,\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, isEmpty } from 'lodash';\nimport { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport { DependencyResolverAspect, WorkspacePolicyConfigKeysNames } from '@teambit/dependency-resolver';\nimport {\n ApplyVersionWithComps,\n CheckoutAspect,\n CheckoutMain,\n ComponentStatusBase,\n applyModifiedVersion,\n removeFilesIfNeeded,\n updateFileStatus,\n} from '@teambit/checkout';\nimport { DEPENDENCIES_FIELDS } from '@teambit/legacy/dist/constants';\nimport deleteComponentsFiles from '@teambit/legacy/dist/consumer/component-ops/delete-component-files';\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 { ConfigMergeResult } from './config-merge-result';\nimport { MergeStatusProvider } from './merge-status-provider';\n\ntype ResolveUnrelatedData = {\n strategy: MergeStrategy;\n headOnCurrentLane: Ref;\n unrelatedHead: Ref;\n unrelatedLaneId: LaneId;\n};\ntype PkgEntry = { name: string; version: string; force: boolean };\n\nexport type WorkspaceDepsUpdates = { [pkgName: string]: [string, string] }; // from => to\nexport type WorkspaceDepsConflicts = Record<WorkspacePolicyConfigKeysNames, Array<{ name: string; version: string }>>; // the pkg value is in a format of CONFLICT::OURS::THEIRS\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\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};\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 ) {}\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 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 tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n }: {\n mergeStrategy: MergeStrategy;\n allComponentsStatus: ComponentMergeStatus[];\n laneId: LaneId;\n localLane: 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(succeededComponents, laneId, mergeStrategy, localLane);\n\n const allConfigMerge = compact(succeededComponents.map((c) => c.configMergeResult));\n\n const { workspaceDepsUpdates, workspaceDepsConflicts } = await this.updateWorkspaceJsoncWithDepsIfNeeded(\n allConfigMerge\n );\n\n await this.generateConfigMergeConflictFileForAll(allConfigMerge, workspaceDepsConflicts);\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 await consumer.writeBitMap(`merge ${laneId.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 leftUnresolvedConflicts,\n workspaceDepsUpdates,\n };\n }\n\n private async generateConfigMergeConflictFileForAll(\n allConfigMerge: ConfigMergeResult[],\n workspaceDepsConflicts?: WorkspaceDepsConflicts\n ) {\n const configMergeFile = this.workspace.getConflictMergeFile();\n if (workspaceDepsConflicts) {\n const workspaceConflict = new ConfigMergeResult('WORKSPACE', 'ours', 'theirs', [\n {\n id: DependencyResolverAspect.id,\n conflict: workspaceDepsConflicts,\n },\n ]);\n allConfigMerge.unshift(workspaceConflict);\n }\n allConfigMerge.forEach((configMerge) => {\n const conflict = configMerge.generateMergeConflictFile();\n if (!conflict) return;\n configMergeFile.addConflict(configMerge.compIdStr, conflict);\n });\n if (configMergeFile.hasConflict()) {\n await configMergeFile.write();\n }\n }\n\n private async updateWorkspaceJsoncWithDepsIfNeeded(\n allConfigMerge: ConfigMergeResult[]\n ): Promise<{ workspaceDepsUpdates?: WorkspaceDepsUpdates; workspaceDepsConflicts?: WorkspaceDepsConflicts }> {\n const allResults = allConfigMerge.map((c) => c.getDepsResolverResult());\n\n // aggregate all dependencies that can be updated (not conflicting)\n const nonConflictDeps: { [pkgName: string]: string[] } = {};\n const nonConflictSources: { [pkgName: string]: string[] } = {}; // for logging/debugging purposes\n allConfigMerge.forEach((configMerge) => {\n const mergedConfig = configMerge.getDepsResolverResult()?.mergedConfig;\n if (!mergedConfig || mergedConfig === '-') return;\n const mergedConfigPolicy = mergedConfig.policy || {};\n DEPENDENCIES_FIELDS.forEach((depField) => {\n if (!mergedConfigPolicy[depField]) return;\n mergedConfigPolicy[depField].forEach((pkg: PkgEntry) => {\n if (pkg.force) return; // we only care about auto-detected dependencies\n if (nonConflictDeps[pkg.name]) {\n if (!nonConflictDeps[pkg.name].includes(pkg.version)) nonConflictDeps[pkg.name].push(pkg.version);\n nonConflictSources[pkg.name].push(configMerge.compIdStr);\n return;\n }\n nonConflictDeps[pkg.name] = [pkg.version];\n nonConflictSources[pkg.name] = [configMerge.compIdStr];\n });\n });\n });\n\n // aggregate all dependencies that have conflicts\n const conflictDeps: { [pkgName: string]: string[] } = {};\n const conflictDepsSources: { [pkgName: string]: string[] } = {}; // for logging/debugging purposes\n allConfigMerge.forEach((configMerge) => {\n const mergedConfigConflict = configMerge.getDepsResolverResult()?.conflict;\n if (!mergedConfigConflict) return;\n DEPENDENCIES_FIELDS.forEach((depField) => {\n if (!mergedConfigConflict[depField]) return;\n mergedConfigConflict[depField].forEach((pkg: PkgEntry) => {\n if (pkg.force) return; // we only care about auto-detected dependencies\n if (conflictDeps[pkg.name]) {\n if (!conflictDeps[pkg.name].includes(pkg.version)) conflictDeps[pkg.name].push(pkg.version);\n conflictDepsSources[pkg.name].push(configMerge.compIdStr);\n return;\n }\n conflictDeps[pkg.name] = [pkg.version];\n conflictDepsSources[pkg.name] = [configMerge.compIdStr];\n });\n });\n });\n\n const notConflictedPackages = Object.keys(nonConflictDeps);\n const conflictedPackages = Object.keys(conflictDeps);\n if (!notConflictedPackages.length && !conflictedPackages.length) return {};\n\n const workspaceConfig = this.config.workspaceConfig;\n if (!workspaceConfig) throw new Error(`updateWorkspaceJsoncWithDepsIfNeeded unable to get workspace config`);\n const depResolver = workspaceConfig.extensions.findCoreExtension(DependencyResolverAspect.id);\n const policy = depResolver?.config.policy;\n if (!policy) {\n return {};\n }\n\n // calculate the workspace.json updates\n const workspaceJsonUpdates = {};\n notConflictedPackages.forEach((pkgName) => {\n if (nonConflictDeps[pkgName].length > 1) {\n // we only want the deps that the other lane has them in the workspace.json and that all comps use the same dep.\n return;\n }\n DEPENDENCIES_FIELDS.forEach((depField) => {\n if (!policy[depField]?.[pkgName]) return; // doesn't exists in the workspace.json\n const currentVer = policy[depField][pkgName];\n const newVer = nonConflictDeps[pkgName][0];\n if (currentVer === newVer) return;\n workspaceJsonUpdates[pkgName] = [currentVer, newVer];\n policy[depField][pkgName] = newVer;\n this.logger.debug(\n `update workspace.jsonc: ${pkgName} from ${currentVer} to ${newVer}. Triggered by: ${nonConflictSources[\n pkgName\n ].join(', ')}`\n );\n });\n });\n\n // calculate the workspace.json conflicts\n const WS_DEPS_FIELDS = ['dependencies', 'peerDependencies'];\n const workspaceJsonConflicts = { dependencies: [], peerDependencies: [] };\n const conflictPackagesToRemoveFromConfigMerge: string[] = [];\n conflictedPackages.forEach((pkgName) => {\n if (conflictDeps[pkgName].length > 1) {\n // we only want the deps that the other lane has them in the workspace.json and that all comps use the same dep.\n return;\n }\n const conflictRaw = conflictDeps[pkgName][0];\n const [, currentVal, otherVal] = conflictRaw.split('::');\n\n WS_DEPS_FIELDS.forEach((depField) => {\n if (!policy[depField]?.[pkgName]) return;\n const currentVerInWsJson = policy[depField][pkgName];\n if (!currentVerInWsJson) return;\n // the version is coming from the workspace.jsonc\n conflictPackagesToRemoveFromConfigMerge.push(pkgName);\n if (semver.satisfies(otherVal, currentVerInWsJson)) {\n // the other version is compatible with the current version in the workspace.json\n return;\n }\n workspaceJsonConflicts[depField].push({\n name: pkgName,\n version: conflictRaw.replace(currentVal, currentVerInWsJson),\n force: false,\n });\n conflictPackagesToRemoveFromConfigMerge.push(pkgName);\n this.logger.debug(\n `conflict workspace.jsonc: ${pkgName} current: ${currentVerInWsJson}, other: ${otherVal}. Triggered by: ${conflictDepsSources[\n pkgName\n ].join(', ')}`\n );\n });\n });\n WS_DEPS_FIELDS.forEach((depField) => {\n if (isEmpty(workspaceJsonConflicts[depField])) delete workspaceJsonConflicts[depField];\n });\n\n if (conflictPackagesToRemoveFromConfigMerge.length) {\n allResults.forEach((result) => {\n if (result?.conflict) {\n DEPENDENCIES_FIELDS.forEach((depField) => {\n if (!result.conflict?.[depField]) return;\n result.conflict[depField] = result.conflict?.[depField].filter(\n (dep) => !conflictPackagesToRemoveFromConfigMerge.includes(dep.name)\n );\n if (!result.conflict[depField].length) delete result.conflict[depField];\n });\n if (isEmpty(result.conflict)) result.conflict = undefined;\n }\n });\n }\n\n if (Object.keys(workspaceJsonUpdates).length) {\n await workspaceConfig.write();\n }\n\n this.logger.debug('final workspace.jsonc updates', workspaceJsonUpdates);\n this.logger.debug('final workspace.jsonc conflicts', workspaceJsonConflicts);\n\n return {\n workspaceDepsUpdates: Object.keys(workspaceJsonUpdates).length ? workspaceJsonUpdates : undefined,\n workspaceDepsConflicts: Object.keys(workspaceJsonConflicts).length ? workspaceJsonConflicts : undefined,\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?: { resolveUnrelated?: MergeStrategy; ignoreConfigChanges?: boolean }\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 laneId: LaneId,\n mergeStrategy: MergeStrategy,\n localLane: 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 = 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 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 laneId,\n localLane,\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 laneId: LaneId;\n localLane: 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 // @ts-ignore\n id: { name: id.fullName, scope: id.scope },\n head: remoteHead,\n laneId,\n };\n id = currentComponent ? currentComponent.id : id;\n\n const modelComponent = await consumer.scope.getModelComponent(id);\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 (!localLane) throw new Error('localLane must be defined when resolvedUnrelated');\n if (!resolvedUnrelated) throw new Error('resolvedUnrelated must be populated');\n localLane.addComponent({ id, head: 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 (localLane) {\n if (resolvedUnrelated) {\n // must be \"theirs\"\n return handleResolveUnrelated(legacyComponent);\n }\n localLane.addComponent({ id, head: 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.fullName));\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);\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.fullName);\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 ];\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 ]: [\n CLIMain,\n Workspace,\n SnappingMain,\n CheckoutMain,\n InstallMain,\n LoggerMain,\n ComponentWriterMain,\n ImporterMain,\n ConfigMain,\n RemoveMain,\n GlobalConfigMain\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 );\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,QAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;E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BAAa,CAAC9O,EAAE,CAAC;IACxD,MAAM+O,OAAO,GAAG,IAAI5R,WAAW,CAC7BE,SAAS,EACTC,OAAO,EACPC,QAAQ,EACRC,QAAQ,EACRC,MAAM,EACNkR,UAAU,EACVhR,QAAQ,EACRC,MAAM,EACNC,MACF,CAAC;IACD4Q,GAAG,CAACO,QAAQ,CAAC,KAAIC,oBAAQ,EAACF,OAAO,EAAEH,YAAY,CAAC,CAAC;IACjD,OAAOG,OAAO;EAChB;AACF;AAACG,OAAA,CAAA/R,WAAA,GAAAA,WAAA;AAAApB,eAAA,CA7sBYoB,WAAW,WAspBP,EAAE;AAAApB,eAAA,CAtpBNoB,WAAW,kBAupBA,CACpBgS,gBAAS,EACTC,oBAAe,EACfC,mBAAc,EACdC,0BAAc,EACdC,wBAAa,EACbC,sBAAY,EACZC,wCAAqB,EACrBC,mBAAc,EACdC,sBAAY,EACZC,iBAAY,EACZC,uBAAkB,CACnB;AAAA9T,eAAA,CAnqBUoB,WAAW,aAoqBL2S,kBAAW;AA2C9BhB,wBAAa,CAACiB,UAAU,CAAC5S,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_semver","_interopRequireDefault","_workspace","_interopRequireWildcard","_componentsList","_mergeVersion","_snapping","_hasWildcard","_pMapSeries","_componentId","_bitError","_generalError","_laneId","_chalk","_config","_remove","_utils","_componentWriter","_importer","_logger","_globalConfig","_lodash","_dependencyResolver","_checkout","_constants","_deleteComponentFiles","_install","_mergeCmd","_merging","_configMergeResult","_mergeStatusProvider","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","key","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","MergingMain","constructor","workspace","install","snapping","checkout","logger","componentWriter","importer","config","remove","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","laneId","localLane","tag","_mergeSnapResults","componentWithConflict","find","component","hasConflicts","getMergeStrategyInteractive","componentStatus","shouldBeRemoved","componentIdsToRemove","changeVersion","succeededComponents","componentsResults","applyVersionMultiple","allConfigMerge","compact","configMergeResult","workspaceDepsUpdates","workspaceDepsConflicts","updateWorkspaceJsoncWithDepsIfNeeded","generateConfigMergeConflictFileForAll","scope","objects","add","persist","unmergedComponents","write","writeBitMap","compBitIdsToRemove","ComponentIdList","fromArray","deleteComponentsFiles","cleanFromBitMap","componentsHasConfigMergeConflicts","some","_c$configMergeResult","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","configMergeFile","getConflictMergeFile","workspaceConflict","ConfigMergeResult","DependencyResolverAspect","conflict","unshift","configMerge","generateMergeConflictFile","addConflict","compIdStr","hasConflict","allResults","getDepsResolverResult","nonConflictDeps","nonConflictSources","_configMerge$getDepsR","mergedConfig","mergedConfigPolicy","policy","DEPENDENCIES_FIELDS","depField","pkg","force","name","includes","version","conflictDeps","conflictDepsSources","_configMerge$getDepsR2","mergedConfigConflict","notConflictedPackages","conflictedPackages","workspaceConfig","Error","depResolver","extensions","findCoreExtension","workspaceJsonUpdates","pkgName","_policy$depField","currentVer","newVer","debug","WS_DEPS_FIELDS","workspaceJsonConflicts","dependencies","peerDependencies","conflictPackagesToRemoveFromConfigMerge","conflictRaw","currentVal","otherVal","split","_policy$depField2","currentVerInWsJson","semver","satisfies","replace","isEmpty","result","_result$conflict","_result$conflict2","dep","getMergeStatus","currentLane","otherLane","options","mergeStatusProvider","MergeStatusProvider","getStatus","mapSeries","currentComponent","resolvedUnrelated","modelComponent","getModelComponent","updatedLaneId","isDefault","LaneId","from","applyVersion","remoteHead","getRef","compsToWrite","legacyCompToWrite","manyComponentsWriterOpts","writeConfig","reasonForBitmapChange","writeMany","filesStatus","unmergedComponent","fullName","head","handleResolveUnrelated","addComponent","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","manual","unmergedPaths","f","filePath","setHead","markVersionAsLocal","values","getIdsForUnmerged","reset","removeComponent","abortedComponents","snap","legacyBitIds","resolvedComponents","localLaneObject","Promise","all","bitId","remoteScopeName","remoteLaneId","remoteLanes","laneIdStr","toStringWithoutVersion","shouldSquash","getComponents","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","MainRuntime","addRuntime"],"sources":["merging.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport semver from 'semver';\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 ApplyVersionResult,\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, isEmpty } from 'lodash';\nimport { MergeResultsThreeWay } from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport { DependencyResolverAspect, WorkspacePolicyConfigKeysNames } from '@teambit/dependency-resolver';\nimport {\n ApplyVersionWithComps,\n CheckoutAspect,\n CheckoutMain,\n ComponentStatusBase,\n applyModifiedVersion,\n removeFilesIfNeeded,\n updateFileStatus,\n} from '@teambit/checkout';\nimport { DEPENDENCIES_FIELDS } from '@teambit/legacy/dist/constants';\nimport deleteComponentsFiles from '@teambit/legacy/dist/consumer/component-ops/delete-component-files';\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 { ConfigMergeResult } from './config-merge-result';\nimport { MergeStatusProvider, MergeStatusProviderOptions } from './merge-status-provider';\n\ntype ResolveUnrelatedData = {\n strategy: MergeStrategy;\n headOnCurrentLane: Ref;\n unrelatedHead: Ref;\n unrelatedLaneId: LaneId;\n};\ntype PkgEntry = { name: string; version: string; force: boolean };\n\nexport type WorkspaceDepsUpdates = { [pkgName: string]: [string, string] }; // from => to\nexport type WorkspaceDepsConflicts = Record<WorkspacePolicyConfigKeysNames, Array<{ name: string; version: string }>>; // the pkg value is in a format of CONFLICT::OURS::THEIRS\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\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};\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 ) {}\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 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 tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n }: {\n mergeStrategy: MergeStrategy;\n allComponentsStatus: ComponentMergeStatus[];\n laneId: LaneId;\n localLane: 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(succeededComponents, laneId, mergeStrategy, localLane);\n\n const allConfigMerge = compact(succeededComponents.map((c) => c.configMergeResult));\n\n const { workspaceDepsUpdates, workspaceDepsConflicts } = await this.updateWorkspaceJsoncWithDepsIfNeeded(\n allConfigMerge\n );\n\n await this.generateConfigMergeConflictFileForAll(allConfigMerge, workspaceDepsConflicts);\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 await consumer.writeBitMap(`merge ${laneId.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 leftUnresolvedConflicts,\n workspaceDepsUpdates,\n };\n }\n\n private async generateConfigMergeConflictFileForAll(\n allConfigMerge: ConfigMergeResult[],\n workspaceDepsConflicts?: WorkspaceDepsConflicts\n ) {\n const configMergeFile = this.workspace.getConflictMergeFile();\n if (workspaceDepsConflicts) {\n const workspaceConflict = new ConfigMergeResult('WORKSPACE', 'ours', 'theirs', [\n {\n id: DependencyResolverAspect.id,\n conflict: workspaceDepsConflicts,\n },\n ]);\n allConfigMerge.unshift(workspaceConflict);\n }\n allConfigMerge.forEach((configMerge) => {\n const conflict = configMerge.generateMergeConflictFile();\n if (!conflict) return;\n configMergeFile.addConflict(configMerge.compIdStr, conflict);\n });\n if (configMergeFile.hasConflict()) {\n await configMergeFile.write();\n }\n }\n\n private async updateWorkspaceJsoncWithDepsIfNeeded(\n allConfigMerge: ConfigMergeResult[]\n ): Promise<{ workspaceDepsUpdates?: WorkspaceDepsUpdates; workspaceDepsConflicts?: WorkspaceDepsConflicts }> {\n const allResults = allConfigMerge.map((c) => c.getDepsResolverResult());\n\n // aggregate all dependencies that can be updated (not conflicting)\n const nonConflictDeps: { [pkgName: string]: string[] } = {};\n const nonConflictSources: { [pkgName: string]: string[] } = {}; // for logging/debugging purposes\n allConfigMerge.forEach((configMerge) => {\n const mergedConfig = configMerge.getDepsResolverResult()?.mergedConfig;\n if (!mergedConfig || mergedConfig === '-') return;\n const mergedConfigPolicy = mergedConfig.policy || {};\n DEPENDENCIES_FIELDS.forEach((depField) => {\n if (!mergedConfigPolicy[depField]) return;\n mergedConfigPolicy[depField].forEach((pkg: PkgEntry) => {\n if (pkg.force) return; // we only care about auto-detected dependencies\n if (nonConflictDeps[pkg.name]) {\n if (!nonConflictDeps[pkg.name].includes(pkg.version)) nonConflictDeps[pkg.name].push(pkg.version);\n nonConflictSources[pkg.name].push(configMerge.compIdStr);\n return;\n }\n nonConflictDeps[pkg.name] = [pkg.version];\n nonConflictSources[pkg.name] = [configMerge.compIdStr];\n });\n });\n });\n\n // aggregate all dependencies that have conflicts\n const conflictDeps: { [pkgName: string]: string[] } = {};\n const conflictDepsSources: { [pkgName: string]: string[] } = {}; // for logging/debugging purposes\n allConfigMerge.forEach((configMerge) => {\n const mergedConfigConflict = configMerge.getDepsResolverResult()?.conflict;\n if (!mergedConfigConflict) return;\n DEPENDENCIES_FIELDS.forEach((depField) => {\n if (!mergedConfigConflict[depField]) return;\n mergedConfigConflict[depField].forEach((pkg: PkgEntry) => {\n if (pkg.force) return; // we only care about auto-detected dependencies\n if (conflictDeps[pkg.name]) {\n if (!conflictDeps[pkg.name].includes(pkg.version)) conflictDeps[pkg.name].push(pkg.version);\n conflictDepsSources[pkg.name].push(configMerge.compIdStr);\n return;\n }\n conflictDeps[pkg.name] = [pkg.version];\n conflictDepsSources[pkg.name] = [configMerge.compIdStr];\n });\n });\n });\n\n const notConflictedPackages = Object.keys(nonConflictDeps);\n const conflictedPackages = Object.keys(conflictDeps);\n if (!notConflictedPackages.length && !conflictedPackages.length) return {};\n\n const workspaceConfig = this.config.workspaceConfig;\n if (!workspaceConfig) throw new Error(`updateWorkspaceJsoncWithDepsIfNeeded unable to get workspace config`);\n const depResolver = workspaceConfig.extensions.findCoreExtension(DependencyResolverAspect.id);\n const policy = depResolver?.config.policy;\n if (!policy) {\n return {};\n }\n\n // calculate the workspace.json updates\n const workspaceJsonUpdates = {};\n notConflictedPackages.forEach((pkgName) => {\n if (nonConflictDeps[pkgName].length > 1) {\n // we only want the deps that the other lane has them in the workspace.json and that all comps use the same dep.\n return;\n }\n DEPENDENCIES_FIELDS.forEach((depField) => {\n if (!policy[depField]?.[pkgName]) return; // doesn't exists in the workspace.json\n const currentVer = policy[depField][pkgName];\n const newVer = nonConflictDeps[pkgName][0];\n if (currentVer === newVer) return;\n workspaceJsonUpdates[pkgName] = [currentVer, newVer];\n policy[depField][pkgName] = newVer;\n this.logger.debug(\n `update workspace.jsonc: ${pkgName} from ${currentVer} to ${newVer}. Triggered by: ${nonConflictSources[\n pkgName\n ].join(', ')}`\n );\n });\n });\n\n // calculate the workspace.json conflicts\n const WS_DEPS_FIELDS = ['dependencies', 'peerDependencies'];\n const workspaceJsonConflicts = { dependencies: [], peerDependencies: [] };\n const conflictPackagesToRemoveFromConfigMerge: string[] = [];\n conflictedPackages.forEach((pkgName) => {\n if (conflictDeps[pkgName].length > 1) {\n // we only want the deps that the other lane has them in the workspace.json and that all comps use the same dep.\n return;\n }\n const conflictRaw = conflictDeps[pkgName][0];\n const [, currentVal, otherVal] = conflictRaw.split('::');\n\n WS_DEPS_FIELDS.forEach((depField) => {\n if (!policy[depField]?.[pkgName]) return;\n const currentVerInWsJson = policy[depField][pkgName];\n if (!currentVerInWsJson) return;\n // the version is coming from the workspace.jsonc\n conflictPackagesToRemoveFromConfigMerge.push(pkgName);\n if (semver.satisfies(otherVal, currentVerInWsJson)) {\n // the other version is compatible with the current version in the workspace.json\n return;\n }\n workspaceJsonConflicts[depField].push({\n name: pkgName,\n version: conflictRaw.replace(currentVal, currentVerInWsJson),\n force: false,\n });\n conflictPackagesToRemoveFromConfigMerge.push(pkgName);\n this.logger.debug(\n `conflict workspace.jsonc: ${pkgName} current: ${currentVerInWsJson}, other: ${otherVal}. Triggered by: ${conflictDepsSources[\n pkgName\n ].join(', ')}`\n );\n });\n });\n WS_DEPS_FIELDS.forEach((depField) => {\n if (isEmpty(workspaceJsonConflicts[depField])) delete workspaceJsonConflicts[depField];\n });\n\n if (conflictPackagesToRemoveFromConfigMerge.length) {\n allResults.forEach((result) => {\n if (result?.conflict) {\n DEPENDENCIES_FIELDS.forEach((depField) => {\n if (!result.conflict?.[depField]) return;\n result.conflict[depField] = result.conflict?.[depField].filter(\n (dep) => !conflictPackagesToRemoveFromConfigMerge.includes(dep.name)\n );\n if (!result.conflict[depField].length) delete result.conflict[depField];\n });\n if (isEmpty(result.conflict)) result.conflict = undefined;\n }\n });\n }\n\n if (Object.keys(workspaceJsonUpdates).length) {\n await workspaceConfig.write();\n }\n\n this.logger.debug('final workspace.jsonc updates', workspaceJsonUpdates);\n this.logger.debug('final workspace.jsonc conflicts', workspaceJsonConflicts);\n\n return {\n workspaceDepsUpdates: Object.keys(workspaceJsonUpdates).length ? workspaceJsonUpdates : undefined,\n workspaceDepsConflicts: Object.keys(workspaceJsonConflicts).length ? workspaceJsonConflicts : undefined,\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 laneId: LaneId,\n mergeStrategy: MergeStrategy,\n localLane: 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 = 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 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 laneId,\n localLane,\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 laneId: LaneId;\n localLane: 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 // @ts-ignore\n id: { name: id.fullName, scope: id.scope },\n head: remoteHead,\n laneId,\n };\n id = currentComponent ? currentComponent.id : id;\n\n const modelComponent = await consumer.scope.getModelComponent(id);\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 (!localLane) throw new Error('localLane must be defined when resolvedUnrelated');\n if (!resolvedUnrelated) throw new Error('resolvedUnrelated must be populated');\n localLane.addComponent({ id, head: 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 (localLane) {\n if (resolvedUnrelated) {\n // must be \"theirs\"\n return handleResolveUnrelated(legacyComponent);\n }\n localLane.addComponent({ id, head: 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.fullName));\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.fullName);\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 ];\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 ]: [\n CLIMain,\n Workspace,\n SnappingMain,\n CheckoutMain,\n InstallMain,\n LoggerMain,\n ComponentWriterMain,\n ImporterMain,\n ConfigMain,\n RemoveMain,\n GlobalConfigMain\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 );\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,QAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAK,uBAAA,CAAAJ,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,g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,EACRC,MAAM,EACNC,MACF,CAAC;IACD6Q,GAAG,CAACO,QAAQ,CAAC,KAAIC,oBAAQ,EAACF,OAAO,EAAEH,YAAY,CAAC,CAAC;IACjD,OAAOG,OAAO;EAChB;AACF;AAACG,OAAA,CAAAhS,WAAA,GAAAA,WAAA;AAAApB,eAAA,CA7sBYoB,WAAW,WAspBP,EAAE;AAAApB,eAAA,CAtpBNoB,WAAW,kBAupBA,CACpBiS,gBAAS,EACTC,oBAAe,EACfC,mBAAc,EACdC,0BAAc,EACdC,wBAAa,EACbC,sBAAY,EACZC,wCAAqB,EACrBC,mBAAc,EACdC,sBAAY,EACZC,iBAAY,EACZC,uBAAkB,CACnB;AAAA/T,eAAA,CAnqBUoB,WAAW,aAoqBL4S,kBAAW;AA2C9BhB,wBAAa,CAACiB,UAAU,CAAC7S,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.97",
|
|
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.97"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -20,20 +20,20 @@
|
|
|
20
20
|
"@teambit/bit-error": "0.0.404",
|
|
21
21
|
"@teambit/lane-id": "0.0.311",
|
|
22
22
|
"@teambit/harmony": "0.4.6",
|
|
23
|
-
"@teambit/dependency-resolver": "1.0.
|
|
24
|
-
"@teambit/builder": "1.0.
|
|
25
|
-
"@teambit/envs": "1.0.
|
|
26
|
-
"@teambit/logger": "0.0.
|
|
27
|
-
"@teambit/cli": "0.0.
|
|
28
|
-
"@teambit/global-config": "0.0.
|
|
29
|
-
"@teambit/importer": "1.0.
|
|
30
|
-
"@teambit/workspace": "1.0.
|
|
31
|
-
"@teambit/checkout": "1.0.
|
|
32
|
-
"@teambit/component-writer": "1.0.
|
|
33
|
-
"@teambit/config": "0.0.
|
|
34
|
-
"@teambit/install": "1.0.
|
|
35
|
-
"@teambit/remove": "1.0.
|
|
36
|
-
"@teambit/snapping": "1.0.
|
|
23
|
+
"@teambit/dependency-resolver": "1.0.97",
|
|
24
|
+
"@teambit/builder": "1.0.97",
|
|
25
|
+
"@teambit/envs": "1.0.97",
|
|
26
|
+
"@teambit/logger": "0.0.926",
|
|
27
|
+
"@teambit/cli": "0.0.833",
|
|
28
|
+
"@teambit/global-config": "0.0.835",
|
|
29
|
+
"@teambit/importer": "1.0.97",
|
|
30
|
+
"@teambit/workspace": "1.0.97",
|
|
31
|
+
"@teambit/checkout": "1.0.97",
|
|
32
|
+
"@teambit/component-writer": "1.0.97",
|
|
33
|
+
"@teambit/config": "0.0.850",
|
|
34
|
+
"@teambit/install": "1.0.97",
|
|
35
|
+
"@teambit/remove": "1.0.97",
|
|
36
|
+
"@teambit/snapping": "1.0.97"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/lodash": "4.14.165",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@types/testing-library__jest-dom": "5.9.5"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@teambit/legacy": "1.0.
|
|
50
|
+
"@teambit/legacy": "1.0.618",
|
|
51
51
|
"react": "^16.8.0 || ^17.0.0",
|
|
52
52
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
53
53
|
},
|
|
File without changes
|