@teambit/merging 0.0.308 → 0.0.310
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/merging.main.runtime.js +10 -6
- package/dist/merging.main.runtime.js.map +1 -1
- package/package-tar/teambit-merging-0.0.310.tgz +0 -0
- package/package.json +14 -14
- package/package-tar/teambit-merging-0.0.308.tgz +0 -0
- /package/dist/{preview-1677037172474.js → preview-1677176115060.js} +0 -0
|
@@ -722,8 +722,12 @@ other: ${otherLaneHead.toString()}`);
|
|
|
722
722
|
}
|
|
723
723
|
const remoteId = id.changeVersion(remoteHead.toString());
|
|
724
724
|
const idToLoad = !mergeResults || mergeStrategy === _mergeVersion().MergeOptions.theirs ? remoteId : id;
|
|
725
|
-
const
|
|
726
|
-
|
|
725
|
+
const legacyComponent = await consumer.loadComponentFromModelImportIfNeeded(idToLoad);
|
|
726
|
+
if (mergeResults && mergeStrategy === _mergeVersion().MergeOptions.theirs) {
|
|
727
|
+
// in this case, we don't want to update .bitmap with the version of the remote. we want to keep the same version
|
|
728
|
+
legacyComponent.version = id.version;
|
|
729
|
+
}
|
|
730
|
+
const files = legacyComponent.files;
|
|
727
731
|
files.forEach(file => {
|
|
728
732
|
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
|
|
729
733
|
filesStatus[(0, _utils().pathNormalizeToLinux)(file.relative)] = _mergeVersion().FileStatus.updated;
|
|
@@ -734,20 +738,20 @@ other: ${otherLaneHead.toString()}`);
|
|
|
734
738
|
filesStatus: modifiedStatus,
|
|
735
739
|
modifiedFiles
|
|
736
740
|
} = (0, _checkoutVersion().applyModifiedVersion)(files, mergeResults, mergeStrategy);
|
|
737
|
-
|
|
741
|
+
legacyComponent.files = modifiedFiles;
|
|
738
742
|
filesStatus = _objectSpread(_objectSpread({}, filesStatus), modifiedStatus);
|
|
739
743
|
}
|
|
740
744
|
const manyComponentsWriterOpts = {
|
|
741
745
|
consumer,
|
|
742
|
-
|
|
746
|
+
components: [legacyComponent],
|
|
743
747
|
skipDependencyInstallation: true,
|
|
744
748
|
writeConfig: false // @todo: should write if config exists before, needs to figure out how to do it.
|
|
745
749
|
};
|
|
746
750
|
|
|
747
751
|
await this.componentWriter.writeMany(manyComponentsWriterOpts);
|
|
748
752
|
if (configMergeResult) {
|
|
749
|
-
if (!
|
|
750
|
-
throw new Error(`
|
|
753
|
+
if (!legacyComponent.writtenPath) {
|
|
754
|
+
throw new Error(`component.writtenPath is missing for ${id.toString()}`);
|
|
751
755
|
}
|
|
752
756
|
const successfullyMergedConfig = configMergeResult.getSuccessfullyMergedConfig();
|
|
753
757
|
if (successfullyMergedConfig) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MergingMain","constructor","workspace","install","snapping","checkout","logger","componentWriter","importer","consumer","merge","ids","mergeStrategy","abort","resolve","noSnap","message","build","skipDependencyInstallation","OutsideWorkspaceError","mergeResults","resolveMerge","abortMerge","bitIds","getComponentsToMerge","mergeComponentsFromRemote","onDestroy","snapMessage","currentLaneId","getCurrentLaneId","currentLaneObject","getCurrentLaneObject","allComponentsStatus","getAllComponentsStatus","failedComponents","filter","c","unmergedMessage","unmergedLegitimately","length","failureMsgs","map","failedComponent","chalk","bold","id","toString","red","join","BitError","mergeSnaps","laneId","localLane","tag","componentWithConflict","find","component","hasConflicts","getMergeStrategyInteractive","componentStatus","failureMessage","unchangedLegitimately","succeededComponents","componentsResults","mapSeries","currentComponent","resolvedUnrelated","configMergeResult","modelComponent","scope","getModelComponent","updatedLaneId","isDefault","LaneId","from","name","applyVersion","remoteHead","getRef","version","allConfigMerge","generateConfigMergeConflictFileForAll","compact","objects","add","persist","unmergedComponents","write","writeBitMap","componentsHasConfigMergeConflicts","some","leftUnresolvedConflicts","undefined","dedupe","updateExisting","import","err","error","consoleError","getSnapOrTagResults","idsToTag","results","tagAllLaneComponent","taggedComponents","autoTaggedResults","snappedComponents","autoSnappedResults","snapResolvedComponents","mergeSnapResults","mergeSnapError","components","configMergeFile","getConflictMergeFile","forEach","configMerge","conflict","generateMergeConflictFile","addConflict","compIdStr","hasConflict","getMergeStatus","currentLane","otherLane","options","importObjectsFromMainIfExist","toBitIds","toVersionLatest","componentStatusBeforeMergeAttempt","getComponentStatusBeforeMergeAttempt","toImport","compStatus","divergeData","commonSnapBeforeDiverge","changeVersion","flat","scopeImporter","importManyIfMissingWithoutDeps","BitIds","fromArray","lane","compStatusNotNeedMerge","mergeProps","compStatusNeedMerge","getComponentsStatusNeedMerge","tmp","Tmp","componentsStatus","Promise","all","getComponentMergeStatus","clear","push","returnUnmerged","msg","getModelComponentIfExist","unmerged","getEntry","toStringWithoutVersion","repo","otherLaneHead","existingBitMapId","bitMap","getBitIdIfExist","ignoreVersion","componentOnOther","loadVersion","isRemoved","getCurrentId","idOnLane","getComponent","head","getHeadAsTagIfExist","currentId","getDivergeData","targetHead","throws","componentFromModel","getCurrentComponent","loadComponent","getConsumerComponent","removed","isModified","componentModificationStatus","getComponentStatusById","modified","baseComponent","ignoreConfigChanges","isComponentSourceCodeModified","isComponentModified","Error","mainHead","NoCommonSnap","resolveUnrelated","hasResolvedFromMain","hashToCompare","divergeDataFromMain","sourceHead","hasResolvedLocally","getHeadRegardlessOfLane","hasResolvedRemotely","versionToSaveInLane","resolvedRef","strategy","isDiverged","isSourceAhead","isTargetAhead","componentMergeStatusBeforeMergeAttempt","baseSnap","debug","otherComponent","currentLaneName","toLaneId","otherLaneName","DEFAULT_LANE","currentLabel","otherLabel","workspaceIds","listIds","configMerger","ConfigMerger","extensions","threeWayMerge","filesStatus","unmergedComponent","remote","handleResolveUnrelated","addComponent","unrelated","addEntry","markAllFilesAsUnchanged","files","file","pathNormalizeToLinux","relative","FileStatus","unchanged","MergeOptions","ours","remoteId","idToLoad","theirs","componentWithDependencies","loadComponentWithDependenciesFromModel","updated","modifiedStatus","modifiedFiles","applyModifiedVersion","manyComponentsWriterOpts","componentsWithDependencies","writeConfig","writeMany","writtenPath","successfullyMergedConfig","getSuccessfullyMergedConfig","mergedConfig","manual","unmergedPaths","f","filePath","setHead","markVersionAsLocal","values","getIdsForUnmerged","reset","removeComponent","fullName","abortedComponents","snap","legacyBitIds","_legacy","resolvedComponents","localLaneObject","bitId","remoteScopeName","remoteLaneId","remoteLanes","laneIdStr","getComponents","r","BitId","tagMessage","unmodified","idsStr","componentIds","resolveMultipleComponentIds","entry","GeneralError","unresolvedComponents","u","ComponentID","fromLegacy","hasWildcard","componentsList","ComponentsList","listComponentsByIdsWithWildcard","getParsedId","provider","cli","loggerMain","compWriter","createLogger","MergingAspect","merging","register","MergeCmd","CLIAspect","WorkspaceAspect","SnappingAspect","CheckoutAspect","InstallAspect","LoggerAspect","ComponentWriterAspect","ImporterAspect","MainRuntime","addRuntime"],"sources":["merging.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport {\n MergeStrategy,\n FailedComponents,\n FileStatus,\n ApplyVersionResult,\n getMergeStrategyInteractive,\n MergeOptions,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport SnappingAspect, { SnappingMain, TagResults } from '@teambit/snapping';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport mapSeries from 'p-map-series';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport { BitError } from '@teambit/bit-error';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { AutoTagResult } from '@teambit/legacy/dist/scope/component-ops/auto-tag';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { UnmergedComponent } from '@teambit/legacy/dist/scope/lanes/unmerged-components';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport chalk from 'chalk';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport { 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 { compact } from 'lodash';\nimport { applyModifiedVersion } from '@teambit/legacy/dist/consumer/versions-ops/checkout-version';\nimport threeWayMerge, {\n MergeResultsThreeWay,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport { NoCommonSnap } from '@teambit/legacy/dist/scope/exceptions/no-common-snap';\nimport { CheckoutAspect, CheckoutMain } from '@teambit/checkout';\nimport { ComponentID } from '@teambit/component-id';\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 { ConfigMerger } from './config-merger';\nimport { ConfigMergeResult } from './config-merge-result';\n\ntype ResolveUnrelatedData = { strategy: MergeStrategy; head: Ref };\n\nexport type ComponentMergeStatus = {\n currentComponent?: ConsumerComponent | null;\n componentFromModel?: Version;\n id: BitId;\n unmergedMessage?: string;\n unmergedLegitimately?: boolean; // failed to merge but for a legitimate reason, such as, up-to-date\n mergeResults?: MergeResultsThreeWay | null;\n divergeData?: SnapsDistance;\n resolvedUnrelated?: ResolveUnrelatedData;\n configMergeResult?: ConfigMergeResult;\n};\n\nexport type ComponentMergeStatusBeforeMergeAttempt = {\n currentComponent?: ConsumerComponent | null;\n componentFromModel?: Version;\n id: BitId;\n unmergedMessage?: string;\n unmergedLegitimately?: boolean; // failed to merge but for a legitimate reason, such as, up-to-date\n divergeData?: SnapsDistance;\n resolvedUnrelated?: ResolveUnrelatedData;\n mergeProps?: {\n otherLaneHead: Ref;\n currentId: BitId;\n modelComponent: ModelComponent;\n };\n};\n\nexport type ApplyVersionResults = {\n components?: ApplyVersionResult[];\n version?: string;\n failedComponents?: FailedComponents[];\n resolvedComponents?: ConsumerComponent[]; // relevant for bit merge --resolve\n abortedComponents?: ApplyVersionResult[]; // relevant for bit merge --abort\n mergeSnapResults?: { snappedComponents: ConsumerComponent[]; autoSnappedResults: AutoTagResult[] } | 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};\n\nexport class MergingMain {\n private consumer: Consumer;\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 ) {\n this.consumer = this.workspace?.consumer;\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 = this.getComponentsToMerge(consumer, ids);\n // @todo: version could be the lane only or remote/lane\n mergeResults = await this.mergeComponentsFromRemote(\n consumer,\n bitIds,\n mergeStrategy,\n noSnap,\n message,\n build,\n skipDependencyInstallation\n );\n }\n await consumer.onDestroy();\n return mergeResults;\n }\n\n /**\n * when user is on main, it merges the remote main components into local.\n * when user is on a lane, it merges the remote lane components into the local lane.\n */\n async mergeComponentsFromRemote(\n consumer: Consumer,\n bitIds: BitId[],\n mergeStrategy: MergeStrategy,\n noSnap: boolean,\n snapMessage: string,\n build: boolean,\n skipDependencyInstallation: boolean\n ): Promise<ApplyVersionResults> {\n const currentLaneId = consumer.getCurrentLaneId();\n const currentLaneObject = await consumer.getCurrentLaneObject();\n const allComponentsStatus = await this.getAllComponentsStatus(bitIds, currentLaneId, currentLaneObject);\n const failedComponents = allComponentsStatus.filter((c) => c.unmergedMessage && !c.unmergedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unmergedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to merge due to the following failures:\\n${failureMsgs}`);\n }\n\n return this.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n laneId: currentLaneId,\n localLane: currentLaneObject,\n noSnap,\n snapMessage,\n build,\n skipDependencyInstallation,\n });\n }\n\n /**\n * merge multiple components according to the \"allComponentsStatus\".\n */\n async mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n laneId,\n localLane,\n noSnap,\n 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.unmergedMessage)\n .map((componentStatus) => ({\n id: componentStatus.id,\n failureMessage: componentStatus.unmergedMessage as string,\n unchangedLegitimately: componentStatus.unmergedLegitimately,\n }));\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.unmergedMessage);\n // do not use Promise.all for applyVersion. otherwise, it'll write all components in parallel,\n // which can be an issue when some components are also dependencies of others\n const componentsResults = await mapSeries(\n succeededComponents,\n async ({ currentComponent, id, mergeResults, resolvedUnrelated, configMergeResult }) => {\n const modelComponent = await consumer.scope.getModelComponent(id);\n const updatedLaneId = laneId.isDefault() ? LaneId.from(laneId.name, id.scope as string) : laneId;\n return this.applyVersion({\n currentComponent,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead: modelComponent.getRef(id.version as string) as Ref,\n laneId: updatedLaneId,\n localLane,\n resolvedUnrelated,\n configMergeResult,\n });\n }\n );\n\n const allConfigMerge = succeededComponents.map((c) => c.configMergeResult);\n await this.generateConfigMergeConflictFileForAll(compact(allConfigMerge));\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();\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 } = results;\n return { snappedComponents: taggedComponents, autoSnappedResults: autoTaggedResults };\n }\n return this.snapResolvedComponents(consumer, snapMessage, build);\n };\n let mergeSnapResults: ApplyVersionResults['mergeSnapResults'] = null;\n let mergeSnapError: Error | undefined;\n try {\n mergeSnapResults = await getSnapOrTagResults();\n } catch (err: any) {\n mergeSnapError = err;\n }\n\n return {\n components: componentsResults,\n failedComponents,\n mergeSnapResults,\n mergeSnapError,\n leftUnresolvedConflicts,\n };\n }\n\n private async generateConfigMergeConflictFileForAll(allConfigMerge: ConfigMergeResult[]) {\n const configMergeFile = this.workspace.getConflictMergeFile();\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 /**\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: BitId[], // 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 if (!currentLane && otherLane) {\n await this.importer.importObjectsFromMainIfExist(otherLane.toBitIds().toVersionLatest());\n }\n const componentStatusBeforeMergeAttempt = await mapSeries(bitIds, (id) =>\n this.getComponentStatusBeforeMergeAttempt(id, currentLane, options)\n );\n const toImport = componentStatusBeforeMergeAttempt\n .map((compStatus) => {\n if (!compStatus.divergeData || !compStatus.divergeData.commonSnapBeforeDiverge) return [];\n return [compStatus.id.changeVersion(compStatus.divergeData.commonSnapBeforeDiverge.toString())];\n })\n .flat();\n\n await this.consumer.scope.scopeImporter.importManyIfMissingWithoutDeps({\n ids: BitIds.fromArray(toImport),\n lane: otherLane || undefined,\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.consumer.scope);\n try {\n const componentsStatus = await Promise.all(\n compStatusNeedMerge.map((compStatus) =>\n this.getComponentMergeStatus(currentLane, otherLane || undefined, compStatus)\n )\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 getComponentStatusBeforeMergeAttempt(\n id: BitId, // the id.version is the version we want to merge to the current component\n localLane: Lane | null, // currently checked out lane. if on main, then it's null.\n options?: { resolveUnrelated?: MergeStrategy; ignoreConfigChanges?: boolean }\n ): Promise<ComponentMergeStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const componentStatus: ComponentMergeStatus = { id };\n const returnUnmerged = (msg: string, unmergedLegitimately = false) => {\n componentStatus.unmergedMessage = msg;\n componentStatus.unmergedLegitimately = unmergedLegitimately;\n return componentStatus;\n };\n const modelComponent = await consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) {\n return returnUnmerged(\n `component ${id.toString()} is on the lane/main but its objects were not found, please re-import the lane`\n );\n }\n const unmerged = consumer.scope.objects.unmergedComponents.getEntry(id.name);\n if (unmerged) {\n return returnUnmerged(\n `component ${id.toStringWithoutVersion()} is in during-merge state a previous merge, please snap/tag it first (or use bit merge --resolve/--abort)`\n );\n }\n const repo = consumer.scope.objects;\n const version = id.version as string;\n const otherLaneHead = modelComponent.getRef(version);\n const existingBitMapId = consumer.bitMap.getBitIdIfExist(id, { ignoreVersion: true });\n const componentOnOther: Version = await modelComponent.loadVersion(version, consumer.scope.objects);\n if (componentOnOther.isRemoved()) {\n return returnUnmerged(`component has been removed`, true);\n }\n const getCurrentId = () => {\n if (existingBitMapId) return existingBitMapId;\n if (localLane) {\n const idOnLane = localLane.getComponent(id);\n if (!idOnLane) return null;\n return idOnLane.id.changeVersion(idOnLane.head.toString());\n }\n // it's on main\n const head = modelComponent.getHeadAsTagIfExist();\n if (head) {\n return id.changeVersion(head);\n }\n return null;\n };\n const currentId = getCurrentId();\n if (!currentId) {\n const divergeData = await getDivergeData({ repo, modelComponent, targetHead: otherLaneHead, throws: false });\n return { currentComponent: null, componentFromModel: componentOnOther, id, 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.removed) {\n return returnUnmerged(`component has been removed`, true);\n }\n const isModified = async () => {\n const componentModificationStatus = await consumer.getComponentStatusById(currentComponent.id);\n if (!componentModificationStatus.modified) return false;\n if (!existingBitMapId) return false;\n const baseComponent = await modelComponent.loadVersion(\n existingBitMapId.version as string,\n consumer.scope.objects\n );\n return options?.ignoreConfigChanges\n ? consumer.isComponentSourceCodeModified(baseComponent, currentComponent)\n : true;\n };\n\n const isComponentModified = await isModified();\n\n if (isComponentModified) {\n return returnUnmerged(`component is modified, please snap/tag it first`);\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 const mainHead = modelComponent.head;\n if (divergeData.err instanceof NoCommonSnap && options?.resolveUnrelated && 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 returnUnmerged(\n `unable to traverse ${currentComponent.id.toString()} history. the main-head ${mainHead.toString()} doesn't appear in both lanes, it was probably created in each lane separately`\n );\n }\n const versionToSaveInLane = hasResolvedLocally ? currentComponent.id.version : id.version;\n const resolvedRef = modelComponent.getRef(versionToSaveInLane as string);\n if (!resolvedRef) throw new Error(`unable to get ref of \"${versionToSaveInLane}\" for \"${id.toString()}\"`);\n if (options?.resolveUnrelated === 'theirs') {\n // just override with the model data\n return {\n currentComponent,\n componentFromModel: componentOnOther,\n id,\n divergeData,\n resolvedUnrelated: { strategy: 'theirs', head: resolvedRef },\n };\n }\n if (options?.resolveUnrelated === 'ours') {\n return {\n currentComponent,\n id,\n divergeData,\n resolvedUnrelated: { strategy: 'ours', head: resolvedRef },\n };\n }\n throw new Error(\n `unsupported strategy \"${options?.resolveUnrelated}\" of resolve-unrelated. supported strategies are: [ours, theirs]`\n );\n }\n return returnUnmerged(\n `unable to traverse ${currentComponent.id.toString()} history. error: ${divergeData.err.message}`\n );\n }\n if (!divergeData.isDiverged()) {\n if (divergeData.isSourceAhead()) {\n // do nothing!\n return returnUnmerged(`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 currentComponent,\n componentFromModel: componentOnOther,\n id,\n divergeData,\n };\n }\n // we know that localHead and remoteHead are set, so if none of them is ahead they must be equal\n return returnUnmerged(`component ${currentComponent.id.toString()} is already merged`, true);\n }\n\n // it's diverged and needs merge operation\n const mergeProps = {\n otherLaneHead,\n currentId,\n modelComponent,\n };\n return { currentComponent, id, divergeData, mergeProps };\n }\n\n private async getComponentMergeStatus(\n localLane: Lane | null, // currently checked out lane. if on main, then it's null.\n otherLane: Lane | undefined, // the lane name we want to merged to our lane. (can be also \"main\").\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 consumer = this.workspace.consumer;\n const repo = 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 = localLane?.toLaneId().toString() || 'main';\n const otherLaneName = otherLane ? 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 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,\n otherComponent,\n otherLabel,\n currentComponent,\n currentLabel,\n baseComponent,\n });\n return { currentComponent, id, mergeResults, divergeData, configMergeResult };\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: BitId;\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<ApplyVersionResult> {\n const consumer = this.workspace.consumer;\n let filesStatus = {};\n const unmergedComponent: UnmergedComponent = {\n // @ts-ignore\n id: { name: id.name, scope: id.scope },\n head: remoteHead,\n remote: laneId.scope, // @todo: remove. it has been deprecated around 0.0.832\n lane: laneId.name, // @todo: remove. it has been deprecated around 0.0.832\n laneId,\n };\n id = currentComponent ? currentComponent.id : id;\n\n const modelComponent = await consumer.scope.getModelComponent(id);\n const handleResolveUnrelated = () => {\n if (!currentComponent) throw new Error('currentComponent must be defined when resolvedUnrelated');\n if (!localLane) throw new Error('localLane must be defined when resolvedUnrelated');\n if (!resolvedUnrelated?.head) throw new Error('resolvedUnrelated must have head prop');\n localLane.addComponent({ id, head: resolvedUnrelated.head });\n const head = modelComponent.getRef(currentComponent.id.version as string);\n if (!head) throw new Error(`unable to get the head for resolved-unrelated ${id.toString()}`);\n unmergedComponent.laneId = localLane.toLaneId();\n unmergedComponent.head = head;\n unmergedComponent.unrelated = true;\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n return { id, filesStatus };\n };\n\n const markAllFilesAsUnchanged = () => {\n if (!currentComponent) throw new Error(`applyVersion expect to get currentComponent for ${id.toString()}`);\n currentComponent.files.forEach((file) => {\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n };\n if (mergeResults && mergeResults.hasConflicts && mergeStrategy === MergeOptions.ours) {\n markAllFilesAsUnchanged();\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n return { id, filesStatus };\n }\n if (resolvedUnrelated?.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 componentWithDependencies = await consumer.loadComponentWithDependenciesFromModel(idToLoad);\n const files = componentWithDependencies.component.files;\n files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.updated;\n });\n\n if (mergeResults) {\n // update files according to the merge results\n const { filesStatus: modifiedStatus, modifiedFiles } = applyModifiedVersion(files, mergeResults, mergeStrategy);\n componentWithDependencies.component.files = modifiedFiles;\n filesStatus = { ...filesStatus, ...modifiedStatus };\n }\n\n const manyComponentsWriterOpts = {\n consumer,\n componentsWithDependencies: [componentWithDependencies],\n skipDependencyInstallation: true,\n writeConfig: false, // @todo: should write if config exists before, needs to figure out how to do it.\n };\n await this.componentWriter.writeMany(manyComponentsWriterOpts);\n\n if (configMergeResult) {\n if (!componentWithDependencies.component.writtenPath) {\n throw new Error(`componentWithDependencies.component.writtenPath is missing for ${id.toString()}`);\n }\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();\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 { id, filesStatus };\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: BitIds.fromArray(ids.map((id) => id._legacy)),\n build,\n message: snapMessage,\n });\n return { resolvedComponents: snappedComponents };\n }\n\n private async getAllComponentsStatus(\n bitIds: BitId[],\n laneId: LaneId,\n localLaneObject: Lane | null\n ): Promise<ComponentMergeStatus[]> {\n const 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.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<null | { snappedComponents: ConsumerComponent[]; autoSnappedResults: AutoTagResult[] }> {\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 = BitIds.fromArray(unmergedComponents.map((r) => new BitId(r.id)));\n return this.snapping.snap({\n legacyBitIds: ids,\n build,\n message: snapMessage,\n });\n }\n\n private async tagAllLaneComponent(idsToTag: BitId[], tagMessage: string, build: boolean): 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.fromLegacy(new BitId(u.id)));\n }\n\n private getComponentsToMerge(consumer: Consumer, ids: string[]): BitId[] {\n if (hasWildcard(ids)) {\n const componentsList = new ComponentsList(consumer);\n return componentsList.listComponentsByIdsWithWildcard(ids);\n }\n return ids.map((id) => consumer.getParsedId(id));\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n SnappingAspect,\n CheckoutAspect,\n InstallAspect,\n LoggerAspect,\n ComponentWriterAspect,\n ImporterAspect,\n ];\n static runtime = MainRuntime;\n static async provider([cli, workspace, snapping, checkout, install, loggerMain, compWriter, importer]: [\n CLIMain,\n Workspace,\n SnappingMain,\n CheckoutMain,\n InstallMain,\n LoggerMain,\n ComponentWriterMain,\n ImporterMain\n ]) {\n const logger = loggerMain.createLogger(MergingAspect.id);\n const merging = new MergingMain(workspace, install, snapping, checkout, logger, compWriter,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KAAIC,oBAAQ,EAACF,OAAO,CAAC,CAAC;IACnC,OAAOA,OAAO;EAChB;AACF;AAAC;AAAA,gCA7tBY9S,WAAW,WAksBP,EAAE;AAAA,gCAlsBNA,WAAW,kBAmsBA,CACpBiT,gBAAS,EACTC,oBAAe,EACfC,mBAAc,EACdC,0BAAc,EACdC,wBAAa,EACbC,sBAAY,EACZC,wCAAqB,EACrBC,mBAAc,CACf;AAAA,gCA5sBUxT,WAAW,aA6sBLyT,kBAAW;AAkB9BZ,wBAAa,CAACa,UAAU,CAAC1T,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"names":["MergingMain","constructor","workspace","install","snapping","checkout","logger","componentWriter","importer","consumer","merge","ids","mergeStrategy","abort","resolve","noSnap","message","build","skipDependencyInstallation","OutsideWorkspaceError","mergeResults","resolveMerge","abortMerge","bitIds","getComponentsToMerge","mergeComponentsFromRemote","onDestroy","snapMessage","currentLaneId","getCurrentLaneId","currentLaneObject","getCurrentLaneObject","allComponentsStatus","getAllComponentsStatus","failedComponents","filter","c","unmergedMessage","unmergedLegitimately","length","failureMsgs","map","failedComponent","chalk","bold","id","toString","red","join","BitError","mergeSnaps","laneId","localLane","tag","componentWithConflict","find","component","hasConflicts","getMergeStrategyInteractive","componentStatus","failureMessage","unchangedLegitimately","succeededComponents","componentsResults","mapSeries","currentComponent","resolvedUnrelated","configMergeResult","modelComponent","scope","getModelComponent","updatedLaneId","isDefault","LaneId","from","name","applyVersion","remoteHead","getRef","version","allConfigMerge","generateConfigMergeConflictFileForAll","compact","objects","add","persist","unmergedComponents","write","writeBitMap","componentsHasConfigMergeConflicts","some","leftUnresolvedConflicts","undefined","dedupe","updateExisting","import","err","error","consoleError","getSnapOrTagResults","idsToTag","results","tagAllLaneComponent","taggedComponents","autoTaggedResults","snappedComponents","autoSnappedResults","snapResolvedComponents","mergeSnapResults","mergeSnapError","components","configMergeFile","getConflictMergeFile","forEach","configMerge","conflict","generateMergeConflictFile","addConflict","compIdStr","hasConflict","getMergeStatus","currentLane","otherLane","options","importObjectsFromMainIfExist","toBitIds","toVersionLatest","componentStatusBeforeMergeAttempt","getComponentStatusBeforeMergeAttempt","toImport","compStatus","divergeData","commonSnapBeforeDiverge","changeVersion","flat","scopeImporter","importManyIfMissingWithoutDeps","BitIds","fromArray","lane","compStatusNotNeedMerge","mergeProps","compStatusNeedMerge","getComponentsStatusNeedMerge","tmp","Tmp","componentsStatus","Promise","all","getComponentMergeStatus","clear","push","returnUnmerged","msg","getModelComponentIfExist","unmerged","getEntry","toStringWithoutVersion","repo","otherLaneHead","existingBitMapId","bitMap","getBitIdIfExist","ignoreVersion","componentOnOther","loadVersion","isRemoved","getCurrentId","idOnLane","getComponent","head","getHeadAsTagIfExist","currentId","getDivergeData","targetHead","throws","componentFromModel","getCurrentComponent","loadComponent","getConsumerComponent","removed","isModified","componentModificationStatus","getComponentStatusById","modified","baseComponent","ignoreConfigChanges","isComponentSourceCodeModified","isComponentModified","Error","mainHead","NoCommonSnap","resolveUnrelated","hasResolvedFromMain","hashToCompare","divergeDataFromMain","sourceHead","hasResolvedLocally","getHeadRegardlessOfLane","hasResolvedRemotely","versionToSaveInLane","resolvedRef","strategy","isDiverged","isSourceAhead","isTargetAhead","componentMergeStatusBeforeMergeAttempt","baseSnap","debug","otherComponent","currentLaneName","toLaneId","otherLaneName","DEFAULT_LANE","currentLabel","otherLabel","workspaceIds","listIds","configMerger","ConfigMerger","extensions","threeWayMerge","filesStatus","unmergedComponent","remote","handleResolveUnrelated","addComponent","unrelated","addEntry","markAllFilesAsUnchanged","files","file","pathNormalizeToLinux","relative","FileStatus","unchanged","MergeOptions","ours","remoteId","idToLoad","theirs","legacyComponent","loadComponentFromModelImportIfNeeded","updated","modifiedStatus","modifiedFiles","applyModifiedVersion","manyComponentsWriterOpts","writeConfig","writeMany","writtenPath","successfullyMergedConfig","getSuccessfullyMergedConfig","mergedConfig","manual","unmergedPaths","f","filePath","setHead","markVersionAsLocal","values","getIdsForUnmerged","reset","removeComponent","fullName","abortedComponents","snap","legacyBitIds","_legacy","resolvedComponents","localLaneObject","bitId","remoteScopeName","remoteLaneId","remoteLanes","laneIdStr","getComponents","r","BitId","tagMessage","unmodified","idsStr","componentIds","resolveMultipleComponentIds","entry","GeneralError","unresolvedComponents","u","ComponentID","fromLegacy","hasWildcard","componentsList","ComponentsList","listComponentsByIdsWithWildcard","getParsedId","provider","cli","loggerMain","compWriter","createLogger","MergingAspect","merging","register","MergeCmd","CLIAspect","WorkspaceAspect","SnappingAspect","CheckoutAspect","InstallAspect","LoggerAspect","ComponentWriterAspect","ImporterAspect","MainRuntime","addRuntime"],"sources":["merging.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport WorkspaceAspect, { OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport {\n MergeStrategy,\n FailedComponents,\n FileStatus,\n ApplyVersionResult,\n getMergeStrategyInteractive,\n MergeOptions,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport SnappingAspect, { SnappingMain, TagResults } from '@teambit/snapping';\nimport hasWildcard from '@teambit/legacy/dist/utils/string/has-wildcard';\nimport mapSeries from 'p-map-series';\nimport { BitId, BitIds } from '@teambit/legacy/dist/bit-id';\nimport { BitError } from '@teambit/bit-error';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { AutoTagResult } from '@teambit/legacy/dist/scope/component-ops/auto-tag';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { UnmergedComponent } from '@teambit/legacy/dist/scope/lanes/unmerged-components';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport chalk from 'chalk';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport { 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 { compact } from 'lodash';\nimport { applyModifiedVersion } from '@teambit/legacy/dist/consumer/versions-ops/checkout-version';\nimport threeWayMerge, {\n MergeResultsThreeWay,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport { NoCommonSnap } from '@teambit/legacy/dist/scope/exceptions/no-common-snap';\nimport { CheckoutAspect, CheckoutMain } from '@teambit/checkout';\nimport { ComponentID } from '@teambit/component-id';\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 { ConfigMerger } from './config-merger';\nimport { ConfigMergeResult } from './config-merge-result';\n\ntype ResolveUnrelatedData = { strategy: MergeStrategy; head: Ref };\n\nexport type ComponentMergeStatus = {\n currentComponent?: ConsumerComponent | null;\n componentFromModel?: Version;\n id: BitId;\n unmergedMessage?: string;\n unmergedLegitimately?: boolean; // failed to merge but for a legitimate reason, such as, up-to-date\n mergeResults?: MergeResultsThreeWay | null;\n divergeData?: SnapsDistance;\n resolvedUnrelated?: ResolveUnrelatedData;\n configMergeResult?: ConfigMergeResult;\n};\n\nexport type ComponentMergeStatusBeforeMergeAttempt = {\n currentComponent?: ConsumerComponent | null;\n componentFromModel?: Version;\n id: BitId;\n unmergedMessage?: string;\n unmergedLegitimately?: boolean; // failed to merge but for a legitimate reason, such as, up-to-date\n divergeData?: SnapsDistance;\n resolvedUnrelated?: ResolveUnrelatedData;\n mergeProps?: {\n otherLaneHead: Ref;\n currentId: BitId;\n modelComponent: ModelComponent;\n };\n};\n\nexport type ApplyVersionResults = {\n components?: ApplyVersionResult[];\n version?: string;\n failedComponents?: FailedComponents[];\n resolvedComponents?: ConsumerComponent[]; // relevant for bit merge --resolve\n abortedComponents?: ApplyVersionResult[]; // relevant for bit merge --abort\n mergeSnapResults?: { snappedComponents: ConsumerComponent[]; autoSnappedResults: AutoTagResult[] } | 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};\n\nexport class MergingMain {\n private consumer: Consumer;\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 ) {\n this.consumer = this.workspace?.consumer;\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 = this.getComponentsToMerge(consumer, ids);\n // @todo: version could be the lane only or remote/lane\n mergeResults = await this.mergeComponentsFromRemote(\n consumer,\n bitIds,\n mergeStrategy,\n noSnap,\n message,\n build,\n skipDependencyInstallation\n );\n }\n await consumer.onDestroy();\n return mergeResults;\n }\n\n /**\n * when user is on main, it merges the remote main components into local.\n * when user is on a lane, it merges the remote lane components into the local lane.\n */\n async mergeComponentsFromRemote(\n consumer: Consumer,\n bitIds: BitId[],\n mergeStrategy: MergeStrategy,\n noSnap: boolean,\n snapMessage: string,\n build: boolean,\n skipDependencyInstallation: boolean\n ): Promise<ApplyVersionResults> {\n const currentLaneId = consumer.getCurrentLaneId();\n const currentLaneObject = await consumer.getCurrentLaneObject();\n const allComponentsStatus = await this.getAllComponentsStatus(bitIds, currentLaneId, currentLaneObject);\n const failedComponents = allComponentsStatus.filter((c) => c.unmergedMessage && !c.unmergedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unmergedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to merge due to the following failures:\\n${failureMsgs}`);\n }\n\n return this.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n laneId: currentLaneId,\n localLane: currentLaneObject,\n noSnap,\n snapMessage,\n build,\n skipDependencyInstallation,\n });\n }\n\n /**\n * merge multiple components according to the \"allComponentsStatus\".\n */\n async mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n laneId,\n localLane,\n noSnap,\n 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.unmergedMessage)\n .map((componentStatus) => ({\n id: componentStatus.id,\n failureMessage: componentStatus.unmergedMessage as string,\n unchangedLegitimately: componentStatus.unmergedLegitimately,\n }));\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.unmergedMessage);\n // do not use Promise.all for applyVersion. otherwise, it'll write all components in parallel,\n // which can be an issue when some components are also dependencies of others\n const componentsResults = await mapSeries(\n succeededComponents,\n async ({ currentComponent, id, mergeResults, resolvedUnrelated, configMergeResult }) => {\n const modelComponent = await consumer.scope.getModelComponent(id);\n const updatedLaneId = laneId.isDefault() ? LaneId.from(laneId.name, id.scope as string) : laneId;\n return this.applyVersion({\n currentComponent,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead: modelComponent.getRef(id.version as string) as Ref,\n laneId: updatedLaneId,\n localLane,\n resolvedUnrelated,\n configMergeResult,\n });\n }\n );\n\n const allConfigMerge = succeededComponents.map((c) => c.configMergeResult);\n await this.generateConfigMergeConflictFileForAll(compact(allConfigMerge));\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();\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 } = results;\n return { snappedComponents: taggedComponents, autoSnappedResults: autoTaggedResults };\n }\n return this.snapResolvedComponents(consumer, snapMessage, build);\n };\n let mergeSnapResults: ApplyVersionResults['mergeSnapResults'] = null;\n let mergeSnapError: Error | undefined;\n try {\n mergeSnapResults = await getSnapOrTagResults();\n } catch (err: any) {\n mergeSnapError = err;\n }\n\n return {\n components: componentsResults,\n failedComponents,\n mergeSnapResults,\n mergeSnapError,\n leftUnresolvedConflicts,\n };\n }\n\n private async generateConfigMergeConflictFileForAll(allConfigMerge: ConfigMergeResult[]) {\n const configMergeFile = this.workspace.getConflictMergeFile();\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 /**\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: BitId[], // 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 if (!currentLane && otherLane) {\n await this.importer.importObjectsFromMainIfExist(otherLane.toBitIds().toVersionLatest());\n }\n const componentStatusBeforeMergeAttempt = await mapSeries(bitIds, (id) =>\n this.getComponentStatusBeforeMergeAttempt(id, currentLane, options)\n );\n const toImport = componentStatusBeforeMergeAttempt\n .map((compStatus) => {\n if (!compStatus.divergeData || !compStatus.divergeData.commonSnapBeforeDiverge) return [];\n return [compStatus.id.changeVersion(compStatus.divergeData.commonSnapBeforeDiverge.toString())];\n })\n .flat();\n\n await this.consumer.scope.scopeImporter.importManyIfMissingWithoutDeps({\n ids: BitIds.fromArray(toImport),\n lane: otherLane || undefined,\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.consumer.scope);\n try {\n const componentsStatus = await Promise.all(\n compStatusNeedMerge.map((compStatus) =>\n this.getComponentMergeStatus(currentLane, otherLane || undefined, compStatus)\n )\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 getComponentStatusBeforeMergeAttempt(\n id: BitId, // the id.version is the version we want to merge to the current component\n localLane: Lane | null, // currently checked out lane. if on main, then it's null.\n options?: { resolveUnrelated?: MergeStrategy; ignoreConfigChanges?: boolean }\n ): Promise<ComponentMergeStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const componentStatus: ComponentMergeStatus = { id };\n const returnUnmerged = (msg: string, unmergedLegitimately = false) => {\n componentStatus.unmergedMessage = msg;\n componentStatus.unmergedLegitimately = unmergedLegitimately;\n return componentStatus;\n };\n const modelComponent = await consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) {\n return returnUnmerged(\n `component ${id.toString()} is on the lane/main but its objects were not found, please re-import the lane`\n );\n }\n const unmerged = consumer.scope.objects.unmergedComponents.getEntry(id.name);\n if (unmerged) {\n return returnUnmerged(\n `component ${id.toStringWithoutVersion()} is in during-merge state a previous merge, please snap/tag it first (or use bit merge --resolve/--abort)`\n );\n }\n const repo = consumer.scope.objects;\n const version = id.version as string;\n const otherLaneHead = modelComponent.getRef(version);\n const existingBitMapId = consumer.bitMap.getBitIdIfExist(id, { ignoreVersion: true });\n const componentOnOther: Version = await modelComponent.loadVersion(version, consumer.scope.objects);\n if (componentOnOther.isRemoved()) {\n return returnUnmerged(`component has been removed`, true);\n }\n const getCurrentId = () => {\n if (existingBitMapId) return existingBitMapId;\n if (localLane) {\n const idOnLane = localLane.getComponent(id);\n if (!idOnLane) return null;\n return idOnLane.id.changeVersion(idOnLane.head.toString());\n }\n // it's on main\n const head = modelComponent.getHeadAsTagIfExist();\n if (head) {\n return id.changeVersion(head);\n }\n return null;\n };\n const currentId = getCurrentId();\n if (!currentId) {\n const divergeData = await getDivergeData({ repo, modelComponent, targetHead: otherLaneHead, throws: false });\n return { currentComponent: null, componentFromModel: componentOnOther, id, 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.removed) {\n return returnUnmerged(`component has been removed`, true);\n }\n const isModified = async () => {\n const componentModificationStatus = await consumer.getComponentStatusById(currentComponent.id);\n if (!componentModificationStatus.modified) return false;\n if (!existingBitMapId) return false;\n const baseComponent = await modelComponent.loadVersion(\n existingBitMapId.version as string,\n consumer.scope.objects\n );\n return options?.ignoreConfigChanges\n ? consumer.isComponentSourceCodeModified(baseComponent, currentComponent)\n : true;\n };\n\n const isComponentModified = await isModified();\n\n if (isComponentModified) {\n return returnUnmerged(`component is modified, please snap/tag it first`);\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 const mainHead = modelComponent.head;\n if (divergeData.err instanceof NoCommonSnap && options?.resolveUnrelated && 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 returnUnmerged(\n `unable to traverse ${currentComponent.id.toString()} history. the main-head ${mainHead.toString()} doesn't appear in both lanes, it was probably created in each lane separately`\n );\n }\n const versionToSaveInLane = hasResolvedLocally ? currentComponent.id.version : id.version;\n const resolvedRef = modelComponent.getRef(versionToSaveInLane as string);\n if (!resolvedRef) throw new Error(`unable to get ref of \"${versionToSaveInLane}\" for \"${id.toString()}\"`);\n if (options?.resolveUnrelated === 'theirs') {\n // just override with the model data\n return {\n currentComponent,\n componentFromModel: componentOnOther,\n id,\n divergeData,\n resolvedUnrelated: { strategy: 'theirs', head: resolvedRef },\n };\n }\n if (options?.resolveUnrelated === 'ours') {\n return {\n currentComponent,\n id,\n divergeData,\n resolvedUnrelated: { strategy: 'ours', head: resolvedRef },\n };\n }\n throw new Error(\n `unsupported strategy \"${options?.resolveUnrelated}\" of resolve-unrelated. supported strategies are: [ours, theirs]`\n );\n }\n return returnUnmerged(\n `unable to traverse ${currentComponent.id.toString()} history. error: ${divergeData.err.message}`\n );\n }\n if (!divergeData.isDiverged()) {\n if (divergeData.isSourceAhead()) {\n // do nothing!\n return returnUnmerged(`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 currentComponent,\n componentFromModel: componentOnOther,\n id,\n divergeData,\n };\n }\n // we know that localHead and remoteHead are set, so if none of them is ahead they must be equal\n return returnUnmerged(`component ${currentComponent.id.toString()} is already merged`, true);\n }\n\n // it's diverged and needs merge operation\n const mergeProps = {\n otherLaneHead,\n currentId,\n modelComponent,\n };\n return { currentComponent, id, divergeData, mergeProps };\n }\n\n private async getComponentMergeStatus(\n localLane: Lane | null, // currently checked out lane. if on main, then it's null.\n otherLane: Lane | undefined, // the lane name we want to merged to our lane. (can be also \"main\").\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 consumer = this.workspace.consumer;\n const repo = 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 = localLane?.toLaneId().toString() || 'main';\n const otherLaneName = otherLane ? 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 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,\n otherComponent,\n otherLabel,\n currentComponent,\n currentLabel,\n baseComponent,\n });\n return { currentComponent, id, mergeResults, divergeData, configMergeResult };\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: BitId;\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<ApplyVersionResult> {\n const consumer = this.workspace.consumer;\n let filesStatus = {};\n const unmergedComponent: UnmergedComponent = {\n // @ts-ignore\n id: { name: id.name, scope: id.scope },\n head: remoteHead,\n remote: laneId.scope, // @todo: remove. it has been deprecated around 0.0.832\n lane: laneId.name, // @todo: remove. it has been deprecated around 0.0.832\n laneId,\n };\n id = currentComponent ? currentComponent.id : id;\n\n const modelComponent = await consumer.scope.getModelComponent(id);\n const handleResolveUnrelated = () => {\n if (!currentComponent) throw new Error('currentComponent must be defined when resolvedUnrelated');\n if (!localLane) throw new Error('localLane must be defined when resolvedUnrelated');\n if (!resolvedUnrelated?.head) throw new Error('resolvedUnrelated must have head prop');\n localLane.addComponent({ id, head: resolvedUnrelated.head });\n const head = modelComponent.getRef(currentComponent.id.version as string);\n if (!head) throw new Error(`unable to get the head for resolved-unrelated ${id.toString()}`);\n unmergedComponent.laneId = localLane.toLaneId();\n unmergedComponent.head = head;\n unmergedComponent.unrelated = true;\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n return { id, filesStatus };\n };\n\n const markAllFilesAsUnchanged = () => {\n if (!currentComponent) throw new Error(`applyVersion expect to get currentComponent for ${id.toString()}`);\n currentComponent.files.forEach((file) => {\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.unchanged;\n });\n };\n if (mergeResults && mergeResults.hasConflicts && mergeStrategy === MergeOptions.ours) {\n markAllFilesAsUnchanged();\n consumer.scope.objects.unmergedComponents.addEntry(unmergedComponent);\n return { id, filesStatus };\n }\n if (resolvedUnrelated?.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 files.forEach((file) => {\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n filesStatus[pathNormalizeToLinux(file.relative)] = FileStatus.updated;\n });\n\n if (mergeResults) {\n // update files according to the merge results\n const { filesStatus: modifiedStatus, modifiedFiles } = applyModifiedVersion(files, mergeResults, mergeStrategy);\n legacyComponent.files = modifiedFiles;\n filesStatus = { ...filesStatus, ...modifiedStatus };\n }\n\n const manyComponentsWriterOpts = {\n consumer,\n components: [legacyComponent],\n skipDependencyInstallation: true,\n writeConfig: false, // @todo: should write if config exists before, needs to figure out how to do it.\n };\n await this.componentWriter.writeMany(manyComponentsWriterOpts);\n\n if (configMergeResult) {\n if (!legacyComponent.writtenPath) {\n throw new Error(`component.writtenPath is missing for ${id.toString()}`);\n }\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();\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 { id, filesStatus };\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: BitIds.fromArray(ids.map((id) => id._legacy)),\n build,\n message: snapMessage,\n });\n return { resolvedComponents: snappedComponents };\n }\n\n private async getAllComponentsStatus(\n bitIds: BitId[],\n laneId: LaneId,\n localLaneObject: Lane | null\n ): Promise<ComponentMergeStatus[]> {\n const 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.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<null | { snappedComponents: ConsumerComponent[]; autoSnappedResults: AutoTagResult[] }> {\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 = BitIds.fromArray(unmergedComponents.map((r) => new BitId(r.id)));\n return this.snapping.snap({\n legacyBitIds: ids,\n build,\n message: snapMessage,\n });\n }\n\n private async tagAllLaneComponent(idsToTag: BitId[], tagMessage: string, build: boolean): 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.fromLegacy(new BitId(u.id)));\n }\n\n private getComponentsToMerge(consumer: Consumer, ids: string[]): BitId[] {\n if (hasWildcard(ids)) {\n const componentsList = new ComponentsList(consumer);\n return componentsList.listComponentsByIdsWithWildcard(ids);\n }\n return ids.map((id) => consumer.getParsedId(id));\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n SnappingAspect,\n CheckoutAspect,\n InstallAspect,\n LoggerAspect,\n ComponentWriterAspect,\n ImporterAspect,\n ];\n static runtime = MainRuntime;\n static async provider([cli, workspace, snapping, checkout, install, loggerMain, compWriter, importer]: [\n CLIMain,\n Workspace,\n SnappingMain,\n CheckoutMain,\n InstallMain,\n LoggerMain,\n ComponentWriterMain,\n ImporterMain\n ]) {\n const logger = loggerMain.createLogger(MergingAspect.id);\n const merging = new MergingMain(workspace, install, snapping, checkout, logger, compWriter, importer);\n cli.register(new MergeCmd(merging));\n return merging;\n }\n}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IACrGgS,GAAG,CAACM,QAAQ,CAAC,KAAIC,oBAAQ,EAACF,OAAO,CAAC,CAAC;IACnC,OAAOA,OAAO;EAChB;AACF;AAAC;AAAA,gCAjuBY7S,WAAW,WAssBP,EAAE;AAAA,gCAtsBNA,WAAW,kBAusBA,CACpBgT,gBAAS,EACTC,oBAAe,EACfC,mBAAc,EACdC,0BAAc,EACdC,wBAAa,EACbC,sBAAY,EACZC,wCAAqB,EACrBC,mBAAc,CACf;AAAA,gCAhtBUvT,WAAW,aAitBLwT,kBAAW;AAkB9BZ,wBAAa,CAACa,UAAU,CAACzT,WAAW,CAAC"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/merging",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.310",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/component/merging",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "merging",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.310"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -18,18 +18,18 @@
|
|
|
18
18
|
"@teambit/harmony": "0.4.6",
|
|
19
19
|
"@teambit/component-id": "0.0.427",
|
|
20
20
|
"@teambit/component-version": "0.0.408",
|
|
21
|
-
"@teambit/dependency-resolver": "0.0.
|
|
22
|
-
"@teambit/envs": "0.0.
|
|
23
|
-
"@teambit/logger": "0.0.
|
|
21
|
+
"@teambit/dependency-resolver": "0.0.995",
|
|
22
|
+
"@teambit/envs": "0.0.995",
|
|
23
|
+
"@teambit/logger": "0.0.761",
|
|
24
24
|
"@teambit/bit-error": "0.0.402",
|
|
25
|
-
"@teambit/cli": "0.0.
|
|
26
|
-
"@teambit/checkout": "0.0.
|
|
27
|
-
"@teambit/component-writer": "0.0.
|
|
28
|
-
"@teambit/importer": "0.0.
|
|
29
|
-
"@teambit/install": "0.0.
|
|
30
|
-
"@teambit/lane-id": "0.0.
|
|
31
|
-
"@teambit/snapping": "0.0.
|
|
32
|
-
"@teambit/workspace": "0.0.
|
|
25
|
+
"@teambit/cli": "0.0.668",
|
|
26
|
+
"@teambit/checkout": "0.0.164",
|
|
27
|
+
"@teambit/component-writer": "0.0.31",
|
|
28
|
+
"@teambit/importer": "0.0.424",
|
|
29
|
+
"@teambit/install": "0.0.117",
|
|
30
|
+
"@teambit/lane-id": "0.0.185",
|
|
31
|
+
"@teambit/snapping": "0.0.310",
|
|
32
|
+
"@teambit/workspace": "0.0.995"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"chai": "4.3.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@types/testing-library__jest-dom": "5.9.5"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@teambit/legacy": "1.0.
|
|
47
|
+
"@teambit/legacy": "1.0.449",
|
|
48
48
|
"react": "^16.8.0 || ^17.0.0",
|
|
49
49
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
50
50
|
},
|
|
Binary file
|
|
File without changes
|