@teambit/merging 1.0.796 → 1.0.798

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.
@@ -491,6 +491,11 @@ class MergingMain {
491
491
  head
492
492
  });
493
493
  };
494
+ const convertHashToTagIfPossible = componentId => {
495
+ if (!componentId.version) return componentId;
496
+ const tag = modelComponent.getTag(componentId.version);
497
+ return tag ? componentId.changeVersion(tag) : componentId;
498
+ };
494
499
  const handleResolveUnrelated = legacyCompToWrite => {
495
500
  if (!currentComponent) throw new Error('currentComponent must be defined when resolvedUnrelated');
496
501
  // because when on a main, we don't allow merging lanes with unrelated. we asks users to switch to the lane
@@ -504,9 +509,10 @@ class MergingMain {
504
509
  unrelatedLaneId: resolvedUnrelated.unrelatedLaneId
505
510
  };
506
511
  legacyScope.objects.unmergedComponents.addEntry(unmergedComponent);
512
+ const idForOutput = convertHashToTagIfPossible(id);
507
513
  return {
508
514
  applyVersionResult: {
509
- id,
515
+ id: idForOutput,
510
516
  filesStatus
511
517
  },
512
518
  component: currentComponent,
@@ -522,9 +528,10 @@ class MergingMain {
522
528
  if (mergeResults && mergeResults.hasConflicts && mergeStrategy === _componentModules().MergeOptions.ours) {
523
529
  markAllFilesAsUnchanged();
524
530
  legacyScope.objects.unmergedComponents.addEntry(unmergedComponent);
531
+ const idForOutput = convertHashToTagIfPossible(id);
525
532
  return {
526
533
  applyVersionResult: {
527
- id,
534
+ id: idForOutput,
528
535
  filesStatus
529
536
  },
530
537
  component: currentComponent || undefined
@@ -590,9 +597,10 @@ class MergingMain {
590
597
  }
591
598
  legacyScope.objects.add(modelComponent);
592
599
  }
600
+ const idForOutput = convertHashToTagIfPossible(idToLoad);
593
601
  return {
594
602
  applyVersionResult: {
595
- id: idToLoad,
603
+ id: idForOutput,
596
604
  filesStatus
597
605
  },
598
606
  component: currentComponent || undefined,
@@ -1 +1 @@
1
- {"version":3,"names":["_cli","data","require","_workspace","_legacy","_snapping","_pMapSeries","_interopRequireDefault","_componentId","_bitError","_laneId","_chalk","_config","_remove","_toolboxPath","_pkgModules","_componentWriter","_importer","_logger","_lodash","_checkout","_configMerger","_dependencyResolver","_install","_scope","_mergeCmd","_merging","_mergeStatusProvider","_componentModules","_configStore","_application","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","MergingMain","constructor","workspace","scope","install","snapping","checkout","logger","componentWriter","importer","config","remove","configMerger","depResolver","application","merge","pattern","mergeStrategy","abort","resolve","noAutoSnap","message","build","skipDependencyInstallation","OutsideWorkspaceError","consumer","mergeResults","resolveMerge","abortMerge","bitIds","getComponentsToMerge","mergeComponentsFromRemote","onDestroy","snapMessage","currentLaneId","getCurrentLaneId","currentLaneObject","getCurrentLaneObject","allComponentsStatus","getAllComponentsStatus","failedComponents","c","unchangedMessage","unchangedLegitimately","failureMsgs","map","failedComponent","chalk","bold","id","toString","red","join","BitError","mergeSnaps","otherLaneId","currentLane","noSnap","tag","detachHead","loose","legacyScope","componentWithConflict","find","component","hasConflicts","getMergeStrategyInteractive","componentStatus","shouldBeRemoved","componentIdsToRemove","changeVersion","undefined","succeededComponents","currentLaneIdsBeforeMerge","toComponentIds","componentsResults","applyVersionMultiple","allConfigMerge","compact","configMergeResult","workspaceDepsUpdates","workspaceDepsConflicts","workspaceDepsUnchanged","updateWorkspaceJsoncWithDepsIfNeeded","workspaceConfigConflictWriteError","writeWorkspaceJsoncWithConflictsGracefully","generateConfigMergeConflictFileForAll","objects","add","persist","unmergedComponents","write","writeBitMap","removeFromWsJsonPolicyIfExists","compBitIdsToRemove","ComponentIdList","fromArray","deleteComponentsFiles","cleanFromBitMap","componentsHasConfigMergeConflicts","some","leftUnresolvedConflicts","loadAllAppsAsAspects","dedupe","updateExisting","import","err","error","consoleFailure","updatedComponents","legacyCompToWrite","getSnapOrTagResults","idsToTag","results","tagAllLaneComponent","taggedComponents","autoTaggedResults","removedComponents","snappedComponents","autoSnappedResults","snapResolvedComponents","laneId","toLaneId","mergeSnapResults","mergeSnapError","bitMapSnapshot","bitMap","takeSnapshot","restoreFromSnapshot","components","applyVersionResult","workspaceConfigUpdateResult","newlyIntroducedIds","hasWithoutVersion","newlyIntroducedComponentIds","packages","componentIdToPackageName","isRemoved","removeFromRootPolicy","persistConfig","getMergeStatus","options","otherLane","mergeStatusProvider","MergeStatusProvider","getStatus","mapSeries","currentComponent","resolvedUnrelated","modelComponent","getModelComponent","updatedLaneId","isDefault","LaneId","from","name","applyVersion","remoteHead","getRef","version","compsToWrite","manyComponentsWriterOpts","writeConfig","reasonForBitmapChange","writeMany","filesStatus","unmergedComponent","fullName","head","addToCurrentLane","Error","isPartOfLane","isEqualWithoutVersion","addComponent","handleResolveUnrelated","headOnCurrentLane","unrelated","unrelatedHead","unrelatedLaneId","addEntry","markAllFilesAsUnchanged","files","file","pathNormalizeToLinux","relative","FileStatus","unchanged","MergeOptions","ours","strategy","remoteId","idToLoad","theirs","legacyComponent","loadComponentFromModelImportIfNeeded","getConsumerComponent","updateFileStatus","modifiedStatus","modifiedFiles","applyModifiedVersion","removeFilesIfNeeded","successfullyMergedConfig","getSuccessfullyMergedConfig","mergeScopeSpecificDepsPolicy","extensions","filterDeletedDependenciesFromConfig","mergedConfig","manual","unmergedPaths","f","conflict","filePath","detachedHeads","setHead","markVersionAsLocal","ids","getIdsForUnmerged","reset","removeComponent","abortedComponents","snap","legacyBitIds","resolvedComponents","localLaneObject","Promise","all","bitId","remoteScopeName","remoteLaneId","remoteLanes","laneIdStr","toStringWithoutVersion","shouldSquash","getComponents","debug","ComponentID","fromObject","getLoadAspectOnlyForIds","dataMergeResult","dataConflictedIds","conflictedAspects","aspectIds","aspectId","snapFromScope","componentId","aspects","getEntry","lane","updatedLegacyComponents","loadAspectOnlyForIds","tagMessage","unmodified","componentIds","idsByPattern","entry","unresolvedComponents","u","mergePending","listMergePendingComponents","componentsList","ComponentsList","allIds","getAllIdsAvailableOnLaneIncludeRemoved","componentsFromModel","getModelComponents","duringMergeComps","listDuringMergeStateComponents","mergePendingComponents","toComponentId","divergedData","getDivergeDataForMergePending","isDiverged","diverge","scopeExtensions","mergeConfig","mergeConfigPolicy","DependencyResolverAspect","policy","depsResolver","findCoreExtension","scopePolicy","depType","scopeDepsForType","depId","force","addScopePolicyToMergedArray","policyArray","existingDep","dep","depValue","filtered","provider","cli","loggerMain","compWriter","configStore","createLogger","MergingAspect","merging","register","MergeCmd","exports","CLIAspect","WorkspaceAspect","ScopeAspect","SnappingAspect","CheckoutAspect","InstallAspect","LoggerAspect","ComponentWriterAspect","ImporterAspect","ConfigAspect","RemoveAspect","ConfigStoreAspect","ConfigMergerAspect","ApplicationAspect","MainRuntime","addRuntime"],"sources":["merging.main.runtime.ts"],"sourcesContent":["import type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect, OutsideWorkspaceError } from '@teambit/workspace';\nimport type { Consumer } from '@teambit/legacy.consumer';\nimport { ComponentsList } from '@teambit/legacy.component-list';\nimport type { SnappingMain, TagResults } from '@teambit/snapping';\nimport { SnappingAspect } from '@teambit/snapping';\nimport mapSeries from 'p-map-series';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport { LaneId } from '@teambit/lane-id';\nimport type { UnmergedComponent } from '@teambit/legacy.scope';\nimport type { Ref, Lane, ModelComponent } from '@teambit/objects';\nimport chalk from 'chalk';\nimport type { ConfigMain } from '@teambit/config';\nimport { ConfigAspect } from '@teambit/config';\nimport type { RemoveMain } from '@teambit/remove';\nimport { RemoveAspect, deleteComponentsFiles } from '@teambit/remove';\nimport { pathNormalizeToLinux } from '@teambit/toolbox.path.path';\nimport { componentIdToPackageName } from '@teambit/pkg.modules.component-package-name';\nimport type { ComponentWriterMain } from '@teambit/component-writer';\nimport { ComponentWriterAspect } from '@teambit/component-writer';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport type { ImporterMain } from '@teambit/importer';\nimport { ImporterAspect } from '@teambit/importer';\nimport type { Logger, LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport { compact } from 'lodash';\nimport type { ApplyVersionWithComps, CheckoutMain, ComponentStatusBase } from '@teambit/checkout';\nimport { CheckoutAspect, removeFilesIfNeeded, updateFileStatus } from '@teambit/checkout';\nimport type { ConfigMergerMain, ConfigMergeResult, PolicyDependency } from '@teambit/config-merger';\nimport { ConfigMergerAspect } from '@teambit/config-merger';\nimport type { SnapsDistance } from '@teambit/component.snap-distance';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { DependencyResolverAspect } from '@teambit/dependency-resolver';\nimport type { InstallMain } from '@teambit/install';\nimport { InstallAspect } from '@teambit/install';\nimport type { ScopeMain } from '@teambit/scope';\nimport { ScopeAspect } from '@teambit/scope';\nimport { ExtensionDataList } from '@teambit/legacy.extension-data';\nimport { MergeCmd } from './merge-cmd';\nimport { MergingAspect } from './merging.aspect';\nimport type { DataMergeResult, MergeStatusProviderOptions } from './merge-status-provider';\nimport { MergeStatusProvider } from './merge-status-provider';\nimport type {\n MergeStrategy,\n MergeResultsThreeWay,\n ApplyVersionResults,\n FailedComponents,\n MergeSnapResults,\n} from '@teambit/component.modules.merge-helper';\nimport {\n applyModifiedVersion,\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n} from '@teambit/component.modules.merge-helper';\nimport type { ConfigStoreMain } from '@teambit/config-store';\nimport { ConfigStoreAspect } from '@teambit/config-store';\nimport type { ApplicationMain } from '@teambit/application';\nimport { ApplicationAspect } from '@teambit/application';\n\ntype ResolveUnrelatedData = {\n strategy: MergeStrategy;\n headOnCurrentLane: Ref;\n unrelatedHead: Ref;\n unrelatedLaneId: LaneId;\n};\n\nexport type DivergedComponent = { id: ComponentID; diverge: SnapsDistance };\n\nexport type ComponentMergeStatus = ComponentStatusBase & {\n mergeResults?: MergeResultsThreeWay | null;\n divergeData?: SnapsDistance;\n resolvedUnrelated?: ResolveUnrelatedData;\n configMergeResult?: ConfigMergeResult;\n dataMergeResult?: DataMergeResult;\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 class MergingMain {\n constructor(\n private workspace: Workspace,\n private scope: ScopeMain,\n private install: InstallMain,\n private snapping: SnappingMain,\n private checkout: CheckoutMain,\n private logger: Logger,\n private componentWriter: ComponentWriterMain,\n private importer: ImporterMain,\n private config: ConfigMain,\n private remove: RemoveMain,\n private configMerger: ConfigMergerMain,\n private depResolver: DependencyResolverMain,\n private application: ApplicationMain\n ) {}\n\n async merge(\n pattern: string,\n mergeStrategy: MergeStrategy,\n abort: boolean,\n resolve: boolean,\n noAutoSnap: 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(pattern, message, build);\n } else if (abort) {\n mergeResults = await this.abortMerge(pattern);\n } else {\n const bitIds = await this.getComponentsToMerge(pattern);\n mergeResults = await this.mergeComponentsFromRemote(\n consumer,\n bitIds,\n mergeStrategy,\n noAutoSnap,\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 noAutoSnap: 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(\n bitIds,\n currentLaneId,\n currentLaneObject,\n mergeStrategy\n );\n const failedComponents = allComponentsStatus.filter((c) => c.unchangedMessage && !c.unchangedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unchangedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to merge due to the following failures:\\n${failureMsgs}`);\n }\n\n return this.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n otherLaneId: currentLaneId,\n currentLane: currentLaneObject,\n noAutoSnap: noAutoSnap,\n snapMessage,\n build,\n skipDependencyInstallation,\n });\n }\n\n /**\n * merge multiple components according to the \"allComponentsStatus\".\n */\n async mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n otherLaneId,\n currentLane,\n noAutoSnap,\n noSnap,\n tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n detachHead,\n loose,\n }: {\n mergeStrategy: MergeStrategy;\n allComponentsStatus: ComponentMergeStatus[];\n otherLaneId: LaneId;\n currentLane?: Lane;\n noAutoSnap?: boolean;\n noSnap?: boolean;\n tag?: boolean;\n snapMessage?: string;\n build?: boolean;\n skipDependencyInstallation?: boolean;\n detachHead?: boolean;\n loose?: boolean;\n }): Promise<ApplyVersionResults> {\n const consumer = this.workspace?.consumer;\n const legacyScope = this.scope.legacyScope;\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 currentLaneIdsBeforeMerge = currentLane?.toComponentIds();\n\n const componentsResults = await this.applyVersionMultiple(\n succeededComponents,\n otherLaneId,\n mergeStrategy,\n currentLane,\n detachHead\n );\n\n const allConfigMerge = compact(succeededComponents.map((c) => c.configMergeResult));\n\n const { workspaceDepsUpdates, workspaceDepsConflicts, workspaceDepsUnchanged } = this.workspace\n ? await this.configMerger.updateWorkspaceJsoncWithDepsIfNeeded(allConfigMerge)\n : { workspaceDepsUpdates: undefined, workspaceDepsConflicts: undefined, workspaceDepsUnchanged: undefined };\n\n let workspaceConfigConflictWriteError: Error | undefined;\n if (workspaceDepsConflicts) {\n workspaceConfigConflictWriteError =\n await this.configMerger.writeWorkspaceJsoncWithConflictsGracefully(workspaceDepsConflicts);\n }\n if (this.workspace) await this.configMerger.generateConfigMergeConflictFileForAll(allConfigMerge);\n\n if (currentLane) legacyScope.objects.add(currentLane);\n\n await legacyScope.objects.persist(); // persist anyway, if currentLane is null it should save all main heads\n\n await legacyScope.objects.unmergedComponents.write();\n\n if (this.workspace) {\n await consumer.writeBitMap(`merge ${otherLaneId.toString()}`);\n await this.removeFromWsJsonPolicyIfExists(componentsResults, currentLane, currentLaneIdsBeforeMerge);\n }\n\n if (componentIdsToRemove.length && this.workspace) {\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\n if (!skipDependencyInstallation && !leftUnresolvedConflicts && !componentsHasConfigMergeConflicts) {\n // this is a workaround.\n // keep this here. although it gets called before snapping.\n // the reason is that when the installation is running, for some reason, some apps are unable to load in the same process.\n // they throw an error \"Cannot find module\" during the aspect loading.\n await this.application.loadAllAppsAsAspects();\n\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.consoleFailure(\n `failed installing packages, see the log for full stacktrace. error: ${err.message}`\n );\n }\n }\n\n const updatedComponents = compact(componentsResults.map((c) => c.legacyCompToWrite));\n\n const getSnapOrTagResults = async (): Promise<MergeSnapResults> => {\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 (noAutoSnap || 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(allComponentsStatus, updatedComponents, {\n snapMessage,\n build,\n laneId: currentLane?.toLaneId(),\n loose,\n });\n };\n let mergeSnapResults: MergeSnapResults = null;\n let mergeSnapError: Error | undefined;\n const bitMapSnapshot = this.workspace ? this.workspace.bitMap.takeSnapshot() : null;\n try {\n mergeSnapResults = await getSnapOrTagResults();\n } catch (err: any) {\n this.logger.error('failed running snap. mergeSnapError:', err);\n mergeSnapError = err;\n if (bitMapSnapshot) this.workspace.bitMap.restoreFromSnapshot(bitMapSnapshot);\n }\n\n return {\n components: componentsResults.map((c) => c.applyVersionResult),\n failedComponents,\n removedComponents: [...componentIdsToRemove, ...(mergeSnapResults?.removedComponents || [])],\n mergeSnapResults,\n mergeSnapError,\n workspaceConfigUpdateResult: {\n workspaceDepsUpdates,\n workspaceDepsConflicts,\n workspaceDepsUnchanged,\n workspaceConfigConflictWriteError,\n },\n leftUnresolvedConflicts,\n };\n }\n\n async removeFromWsJsonPolicyIfExists(\n componentsResults: ApplyVersionWithComps[],\n currentLane?: Lane,\n currentLaneIdsBeforeMerge?: ComponentIdList\n ) {\n const newlyIntroducedIds = currentLane\n ?.toComponentIds()\n .filter((id) => !currentLaneIdsBeforeMerge?.hasWithoutVersion(id));\n const newlyIntroducedComponentIds = ComponentIdList.fromArray(newlyIntroducedIds || []);\n const components = compact(\n componentsResults\n .map((c) => c.legacyCompToWrite)\n .filter((c) => c && newlyIntroducedComponentIds.hasWithoutVersion(c.id))\n );\n const packages = components.map((c) => componentIdToPackageName(c));\n const isRemoved = this.depResolver.removeFromRootPolicy(packages);\n if (isRemoved) await this.depResolver.persistConfig('merge (remove packages)');\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 options: MergeStatusProviderOptions,\n currentLane?: Lane, // currently checked out lane. if on main, then it's null.\n otherLane?: Lane // the lane we want to merged to our lane. (null if it's \"main\").\n ): Promise<ComponentMergeStatus[]> {\n const mergeStatusProvider = new MergeStatusProvider(\n this.scope,\n this.logger,\n this.importer,\n options,\n this.workspace,\n currentLane,\n otherLane\n );\n return mergeStatusProvider.getStatus(bitIds);\n }\n\n private async applyVersionMultiple(\n succeededComponents: ComponentMergeStatus[],\n otherLaneId: LaneId,\n mergeStrategy: MergeStrategy,\n currentLane?: Lane,\n detachHead?: boolean\n ): Promise<ApplyVersionWithComps[]> {\n const componentsResults = await mapSeries(\n succeededComponents,\n async ({ currentComponent, id, mergeResults, resolvedUnrelated, configMergeResult }) => {\n const modelComponent = await this.scope.legacyScope.getModelComponent(id);\n const updatedLaneId = otherLaneId.isDefault() ? LaneId.from(otherLaneId.name, id.scope as string) : otherLaneId;\n return this.applyVersion({\n currentComponent,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead: modelComponent.getRef(id.version as string) as Ref,\n otherLaneId: updatedLaneId,\n currentLane,\n resolvedUnrelated,\n configMergeResult,\n detachHead,\n });\n }\n );\n\n if (this.workspace) {\n const compsToWrite = compact(componentsResults.map((c) => c.legacyCompToWrite));\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\n return componentsResults;\n }\n\n private async applyVersion({\n currentComponent,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead,\n otherLaneId,\n currentLane,\n resolvedUnrelated,\n configMergeResult,\n detachHead,\n }: {\n currentComponent: ConsumerComponent | null | undefined;\n id: ComponentID;\n mergeResults: MergeResultsThreeWay | null | undefined;\n mergeStrategy: MergeStrategy;\n remoteHead: Ref;\n otherLaneId: LaneId;\n currentLane?: Lane;\n resolvedUnrelated?: ResolveUnrelatedData;\n configMergeResult?: ConfigMergeResult;\n detachHead?: boolean;\n }): Promise<ApplyVersionWithComps> {\n const legacyScope = this.scope.legacyScope;\n let filesStatus = {};\n const unmergedComponent: UnmergedComponent = {\n id: { name: id.fullName, scope: id.scope },\n head: remoteHead,\n laneId: otherLaneId,\n };\n id = currentComponent ? currentComponent.id : id;\n const modelComponent = await legacyScope.getModelComponent(id);\n\n const addToCurrentLane = (head: Ref) => {\n if (!currentLane) throw new Error('currentLane must be defined when adding to the lane');\n if (otherLaneId.isDefault()) {\n const isPartOfLane = currentLane.components.find((c) => c.id.isEqualWithoutVersion(id));\n if (!isPartOfLane) return;\n }\n currentLane.addComponent({ id, head });\n };\n\n const handleResolveUnrelated = (legacyCompToWrite?: ConsumerComponent) => {\n if (!currentComponent) throw new Error('currentComponent must be defined when resolvedUnrelated');\n // because when on a main, we don't allow merging lanes with unrelated. we asks users to switch to the lane\n // first and then merge with --resolve-unrelated\n if (!currentLane) throw new Error('currentLane must be defined when resolvedUnrelated');\n if (!resolvedUnrelated) throw new Error('resolvedUnrelated must be populated');\n addToCurrentLane(resolvedUnrelated.headOnCurrentLane);\n unmergedComponent.unrelated = {\n unrelatedHead: resolvedUnrelated.unrelatedHead,\n headOnCurrentLane: resolvedUnrelated.headOnCurrentLane,\n unrelatedLaneId: resolvedUnrelated.unrelatedLaneId,\n };\n legacyScope.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 legacyScope.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 = this.workspace\n ? await this.workspace.consumer.loadComponentFromModelImportIfNeeded(idToLoad)\n : await legacyScope.getConsumerComponent(idToLoad); // when loading from the scope, we import all needed components first, so it should be fine. otherwise, change the code to import it here\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 if (this.workspace) await removeFilesIfNeeded(filesStatus, this.workspace.consumer, currentComponent || undefined);\n\n if (configMergeResult) {\n const successfullyMergedConfig = configMergeResult.getSuccessfullyMergedConfig();\n if (successfullyMergedConfig) {\n // Process mergedConfig to merge scope-specific policy and filter deletion markers\n // This happens ONCE here, so both workspace and bare-scope merges use the same processed config\n this.mergeScopeSpecificDepsPolicy(legacyComponent.extensions, successfullyMergedConfig);\n this.filterDeletedDependenciesFromConfig(successfullyMergedConfig);\n\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 legacyScope.objects.unmergedComponents.addEntry(unmergedComponent);\n } else if (currentLane) {\n if (resolvedUnrelated) {\n // must be \"theirs\"\n return handleResolveUnrelated(legacyComponent);\n }\n addToCurrentLane(remoteHead);\n } else {\n // this is main\n if (detachHead) {\n modelComponent.detachedHeads.setHead(remoteHead);\n } else {\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 }\n legacyScope.objects.add(modelComponent);\n }\n\n return {\n applyVersionResult: { id: idToLoad, filesStatus },\n component: currentComponent || undefined,\n legacyCompToWrite: legacyComponent,\n };\n }\n\n private async abortMerge(pattern: string): Promise<ApplyVersionResults> {\n const consumer = this.workspace.consumer;\n const ids = await this.getIdsForUnmerged(pattern);\n const results = await this.checkout.checkout({ ids, reset: true });\n ids.forEach((id) => consumer.scope.objects.unmergedComponents.removeComponent(id));\n await consumer.scope.objects.unmergedComponents.write();\n return { abortedComponents: results.components };\n }\n\n private async resolveMerge(pattern: string, snapMessage: string, build: boolean): Promise<ApplyVersionResults> {\n const ids = await this.getIdsForUnmerged(pattern);\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 | undefined,\n mergeStrategy: MergeStrategy\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, { shouldSquash: false, mergeStrategy }, localLaneObject, localLaneObject);\n }\n\n private async snapResolvedComponents(\n allComponentsStatus: ComponentMergeStatus[],\n updatedComponents: ConsumerComponent[],\n {\n snapMessage,\n build,\n laneId,\n loose,\n }: {\n snapMessage?: string;\n build?: boolean;\n laneId?: LaneId;\n loose?: boolean;\n }\n ): Promise<MergeSnapResults> {\n const unmergedComponents = this.scope.legacyScope.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 if (!this.workspace) {\n const getLoadAspectOnlyForIds = (): ComponentIdList | undefined => {\n if (!allComponentsStatus.length || !allComponentsStatus[0].dataMergeResult) return undefined;\n const dataConflictedIds = allComponentsStatus\n .filter((c) => {\n const conflictedAspects = c.dataMergeResult?.conflictedAspects || {};\n const aspectIds = Object.keys(conflictedAspects);\n aspectIds.forEach((aspectId) =>\n this.logger.debug(\n `conflicted-data for \"${c.id.toString()}\". aspectId: ${aspectId}. reason: ${conflictedAspects[aspectId]}`\n )\n );\n return aspectIds.length;\n })\n .map((c) => c.id);\n return ComponentIdList.fromArray(dataConflictedIds);\n };\n\n // mergedConfig has already been processed in applyVersion() with scope-specific policy merged\n // and deletion markers filtered, so we can use it directly\n const results = await this.snapping.snapFromScope(\n ids.map((id) => ({\n componentId: id.toString(),\n aspects: this.scope.legacyScope.objects.unmergedComponents.getEntry(id)?.mergedConfig,\n })),\n {\n message: snapMessage,\n build,\n lane: laneId?.toString(),\n updatedLegacyComponents: updatedComponents,\n loadAspectOnlyForIds: getLoadAspectOnlyForIds(),\n loose,\n }\n );\n return results;\n }\n return this.snapping.snap({\n legacyBitIds: ids,\n build,\n message: snapMessage,\n loose,\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(pattern?: string): Promise<ComponentID[]> {\n if (pattern) {\n const componentIds = await this.workspace.idsByPattern(pattern);\n componentIds.forEach((id) => {\n const entry = this.workspace.consumer.scope.objects.unmergedComponents.getEntry(id);\n if (!entry) {\n throw new BitError(`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 BitError(`all components are resolved already, nothing to do`);\n return unresolvedComponents.map((u) => ComponentID.fromObject(u.id));\n }\n\n private async getComponentsToMerge(pattern?: string): Promise<ComponentID[]> {\n if (pattern) {\n return this.workspace.idsByPattern(pattern);\n }\n const mergePending = await this.listMergePendingComponents();\n return mergePending.map((c) => c.id);\n }\n\n async listMergePendingComponents(componentsList?: ComponentsList): Promise<DivergedComponent[]> {\n const consumer = this.workspace.consumer;\n componentsList = componentsList || new ComponentsList(this.workspace);\n const allIds = consumer.bitMap.getAllIdsAvailableOnLaneIncludeRemoved();\n const componentsFromModel = await componentsList.getModelComponents();\n const duringMergeComps = componentsList.listDuringMergeStateComponents();\n const mergePendingComponents = await Promise.all(\n allIds.map(async (componentId: ComponentID) => {\n const modelComponent = componentsFromModel.find((c) => c.toComponentId().isEqualWithoutVersion(componentId));\n if (!modelComponent || duringMergeComps.hasWithoutVersion(componentId)) return null;\n const divergedData = await modelComponent.getDivergeDataForMergePending(consumer.scope.objects);\n if (!divergedData.isDiverged()) return null;\n return { id: modelComponent.toComponentId(), diverge: divergedData };\n })\n );\n return compact(mergePendingComponents);\n }\n\n /**\n * Merges scope dependency policy into the merged config.\n * This handles dependencies with force:true from the scope, regardless of whether they're\n * set via \"bit dependencies set\" (__specific: true) or workspace variants.\n *\n * This is needed because if the mergeConfig has a policy, it will be used, and any other policy along the line will be ignored.\n * In case the model has some dependencies that were set explicitly they're gonna be ignored.\n * This makes sure to add them to the policy of the mergeConfig.\n * In a way, this is similar to what we do when a user is running `bit deps set` and the component had previous dependencies set,\n * we copy those dependencies along with the current one to the .bitmap file, so they won't get lost.\n */\n private mergeScopeSpecificDepsPolicy(scopeExtensions: ExtensionDataList, mergeConfig?: Record<string, any>): void {\n const mergeConfigPolicy: Record<string, PolicyDependency[]> | undefined =\n mergeConfig?.[DependencyResolverAspect.id]?.policy;\n if (!mergeConfigPolicy) return;\n\n const depsResolver = scopeExtensions.findCoreExtension(DependencyResolverAspect.id);\n const scopePolicy = depsResolver?.config.policy;\n if (!scopePolicy) return;\n\n Object.keys(scopePolicy).forEach((depType) => {\n const scopeDepsForType = scopePolicy[depType];\n if (!mergeConfigPolicy[depType]) {\n // mergeConfigPolicy doesn't have this depType yet.\n // Convert scope policy (object format) to array format before adding\n mergeConfigPolicy[depType] = Object.keys(scopeDepsForType).map((depId) => ({\n name: depId,\n version: scopeDepsForType[depId],\n force: true,\n }));\n return;\n }\n\n // mergeConfigPolicy is always in array format (from config merger)\n this.addScopePolicyToMergedArray(mergeConfigPolicy[depType], scopeDepsForType);\n });\n }\n\n private addScopePolicyToMergedArray(policyArray: PolicyDependency[], scopeDepsForType: Record<string, string>): void {\n Object.keys(scopeDepsForType).forEach((depId) => {\n const version = scopeDepsForType[depId];\n const existingDep = policyArray.find((dep) => dep.name === depId);\n\n if (existingDep) {\n // If merge config has version: '-', it means the dependency was explicitly deleted.\n // Keep the '-' marker and don't override with scope policy.\n if (existingDep.version === '-') {\n return;\n }\n // Otherwise, dependency exists in merge config - keep merge config version (it's stronger)\n } else {\n // Dependency only exists in scope policy - add it to merge config\n policyArray.push({ name: depId, version, force: true });\n }\n });\n }\n\n private filterDeletedDependenciesFromConfig(mergeConfig?: Record<string, any>): void {\n const policy: Record<string, PolicyDependency[]> | undefined = mergeConfig?.[DependencyResolverAspect.id]?.policy;\n if (!policy) return;\n\n Object.keys(policy).forEach((depType) => {\n const depValue = policy[depType];\n // Filter out entries with version: '-' (deletion markers)\n const filtered = depValue.filter((dep) => dep.version !== '-');\n // If array is now empty, delete the key to avoid issues with downstream code\n if (filtered.length === 0) {\n delete policy[depType];\n } else {\n policy[depType] = filtered;\n }\n });\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n ScopeAspect,\n SnappingAspect,\n CheckoutAspect,\n InstallAspect,\n LoggerAspect,\n ComponentWriterAspect,\n ImporterAspect,\n ConfigAspect,\n RemoveAspect,\n ConfigStoreAspect,\n ConfigMergerAspect,\n DependencyResolverAspect,\n ApplicationAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n cli,\n workspace,\n scope,\n snapping,\n checkout,\n install,\n loggerMain,\n compWriter,\n importer,\n config,\n remove,\n configStore,\n configMerger,\n depResolver,\n application,\n ]: [\n CLIMain,\n Workspace,\n ScopeMain,\n SnappingMain,\n CheckoutMain,\n InstallMain,\n LoggerMain,\n ComponentWriterMain,\n ImporterMain,\n ConfigMain,\n RemoveMain,\n ConfigStoreMain,\n ConfigMergerMain,\n DependencyResolverMain,\n ApplicationMain,\n ]) {\n const logger = loggerMain.createLogger(MergingAspect.id);\n const merging = new MergingMain(\n workspace,\n scope,\n install,\n snapping,\n checkout,\n logger,\n compWriter,\n importer,\n config,\n remove,\n configMerger,\n depResolver,\n application\n );\n cli.register(new MergeCmd(merging, configStore));\n return merging;\n }\n}\n\nMergingAspect.addRuntime(MergingMain);\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,YAAA;EAAA,MAAAL,IAAA,GAAAM,sBAAA,CAAAL,O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V7R,QAAQ,EACRC,MAAM,EACNC,MAAM,EACN4R,WAAW,EACX3R,YAAY,EACZC,WAAW,EACXC,WAAW,CAiBZ,EAAE;IACD,MAAMP,MAAM,GAAG8R,UAAU,CAACG,YAAY,CAACC,wBAAa,CAACxP,EAAE,CAAC;IACxD,MAAMyP,OAAO,GAAG,IAAI1S,WAAW,CAC7BE,SAAS,EACTC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,QAAQ,EACRC,MAAM,EACN+R,UAAU,EACV7R,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,YAAY,EACZC,WAAW,EACXC,WACF,CAAC;IACDsR,GAAG,CAACO,QAAQ,CAAC,KAAIC,oBAAQ,EAACF,OAAO,EAAEH,WAAW,CAAC,CAAC;IAChD,OAAOG,OAAO;EAChB;AACF;AAACG,OAAA,CAAA7S,WAAA,GAAAA,WAAA;AAAAhB,eAAA,CA1xBYgB,WAAW,WAmtBP,EAAE;AAAAhB,eAAA,CAntBNgB,WAAW,kBAotBA,CACpB8S,gBAAS,EACTC,4BAAe,EACfC,oBAAW,EACXC,0BAAc,EACdC,0BAAc,EACdC,wBAAa,EACbC,sBAAY,EACZC,wCAAqB,EACrBC,0BAAc,EACdC,sBAAY,EACZC,sBAAY,EACZC,gCAAiB,EACjBC,kCAAkB,EAClBtC,8CAAwB,EACxBuC,gCAAiB,CAClB;AAAA3U,eAAA,CApuBUgB,WAAW,aAquBL4T,kBAAW;AAuD9BnB,wBAAa,CAACoB,UAAU,CAAC7T,WAAW,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_cli","data","require","_workspace","_legacy","_snapping","_pMapSeries","_interopRequireDefault","_componentId","_bitError","_laneId","_chalk","_config","_remove","_toolboxPath","_pkgModules","_componentWriter","_importer","_logger","_lodash","_checkout","_configMerger","_dependencyResolver","_install","_scope","_mergeCmd","_merging","_mergeStatusProvider","_componentModules","_configStore","_application","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","MergingMain","constructor","workspace","scope","install","snapping","checkout","logger","componentWriter","importer","config","remove","configMerger","depResolver","application","merge","pattern","mergeStrategy","abort","resolve","noAutoSnap","message","build","skipDependencyInstallation","OutsideWorkspaceError","consumer","mergeResults","resolveMerge","abortMerge","bitIds","getComponentsToMerge","mergeComponentsFromRemote","onDestroy","snapMessage","currentLaneId","getCurrentLaneId","currentLaneObject","getCurrentLaneObject","allComponentsStatus","getAllComponentsStatus","failedComponents","c","unchangedMessage","unchangedLegitimately","failureMsgs","map","failedComponent","chalk","bold","id","toString","red","join","BitError","mergeSnaps","otherLaneId","currentLane","noSnap","tag","detachHead","loose","legacyScope","componentWithConflict","find","component","hasConflicts","getMergeStrategyInteractive","componentStatus","shouldBeRemoved","componentIdsToRemove","changeVersion","undefined","succeededComponents","currentLaneIdsBeforeMerge","toComponentIds","componentsResults","applyVersionMultiple","allConfigMerge","compact","configMergeResult","workspaceDepsUpdates","workspaceDepsConflicts","workspaceDepsUnchanged","updateWorkspaceJsoncWithDepsIfNeeded","workspaceConfigConflictWriteError","writeWorkspaceJsoncWithConflictsGracefully","generateConfigMergeConflictFileForAll","objects","add","persist","unmergedComponents","write","writeBitMap","removeFromWsJsonPolicyIfExists","compBitIdsToRemove","ComponentIdList","fromArray","deleteComponentsFiles","cleanFromBitMap","componentsHasConfigMergeConflicts","some","leftUnresolvedConflicts","loadAllAppsAsAspects","dedupe","updateExisting","import","err","error","consoleFailure","updatedComponents","legacyCompToWrite","getSnapOrTagResults","idsToTag","results","tagAllLaneComponent","taggedComponents","autoTaggedResults","removedComponents","snappedComponents","autoSnappedResults","snapResolvedComponents","laneId","toLaneId","mergeSnapResults","mergeSnapError","bitMapSnapshot","bitMap","takeSnapshot","restoreFromSnapshot","components","applyVersionResult","workspaceConfigUpdateResult","newlyIntroducedIds","hasWithoutVersion","newlyIntroducedComponentIds","packages","componentIdToPackageName","isRemoved","removeFromRootPolicy","persistConfig","getMergeStatus","options","otherLane","mergeStatusProvider","MergeStatusProvider","getStatus","mapSeries","currentComponent","resolvedUnrelated","modelComponent","getModelComponent","updatedLaneId","isDefault","LaneId","from","name","applyVersion","remoteHead","getRef","version","compsToWrite","manyComponentsWriterOpts","writeConfig","reasonForBitmapChange","writeMany","filesStatus","unmergedComponent","fullName","head","addToCurrentLane","Error","isPartOfLane","isEqualWithoutVersion","addComponent","convertHashToTagIfPossible","componentId","getTag","handleResolveUnrelated","headOnCurrentLane","unrelated","unrelatedHead","unrelatedLaneId","addEntry","idForOutput","markAllFilesAsUnchanged","files","file","pathNormalizeToLinux","relative","FileStatus","unchanged","MergeOptions","ours","strategy","remoteId","idToLoad","theirs","legacyComponent","loadComponentFromModelImportIfNeeded","getConsumerComponent","updateFileStatus","modifiedStatus","modifiedFiles","applyModifiedVersion","removeFilesIfNeeded","successfullyMergedConfig","getSuccessfullyMergedConfig","mergeScopeSpecificDepsPolicy","extensions","filterDeletedDependenciesFromConfig","mergedConfig","manual","unmergedPaths","f","conflict","filePath","detachedHeads","setHead","markVersionAsLocal","ids","getIdsForUnmerged","reset","removeComponent","abortedComponents","snap","legacyBitIds","resolvedComponents","localLaneObject","Promise","all","bitId","remoteScopeName","remoteLaneId","remoteLanes","laneIdStr","toStringWithoutVersion","shouldSquash","getComponents","debug","ComponentID","fromObject","getLoadAspectOnlyForIds","dataMergeResult","dataConflictedIds","conflictedAspects","aspectIds","aspectId","snapFromScope","aspects","getEntry","lane","updatedLegacyComponents","loadAspectOnlyForIds","tagMessage","unmodified","componentIds","idsByPattern","entry","unresolvedComponents","u","mergePending","listMergePendingComponents","componentsList","ComponentsList","allIds","getAllIdsAvailableOnLaneIncludeRemoved","componentsFromModel","getModelComponents","duringMergeComps","listDuringMergeStateComponents","mergePendingComponents","toComponentId","divergedData","getDivergeDataForMergePending","isDiverged","diverge","scopeExtensions","mergeConfig","mergeConfigPolicy","DependencyResolverAspect","policy","depsResolver","findCoreExtension","scopePolicy","depType","scopeDepsForType","depId","force","addScopePolicyToMergedArray","policyArray","existingDep","dep","depValue","filtered","provider","cli","loggerMain","compWriter","configStore","createLogger","MergingAspect","merging","register","MergeCmd","exports","CLIAspect","WorkspaceAspect","ScopeAspect","SnappingAspect","CheckoutAspect","InstallAspect","LoggerAspect","ComponentWriterAspect","ImporterAspect","ConfigAspect","RemoveAspect","ConfigStoreAspect","ConfigMergerAspect","ApplicationAspect","MainRuntime","addRuntime"],"sources":["merging.main.runtime.ts"],"sourcesContent":["import type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect, OutsideWorkspaceError } from '@teambit/workspace';\nimport type { Consumer } from '@teambit/legacy.consumer';\nimport { ComponentsList } from '@teambit/legacy.component-list';\nimport type { SnappingMain, TagResults } from '@teambit/snapping';\nimport { SnappingAspect } from '@teambit/snapping';\nimport mapSeries from 'p-map-series';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { BitError } from '@teambit/bit-error';\nimport { LaneId } from '@teambit/lane-id';\nimport type { UnmergedComponent } from '@teambit/legacy.scope';\nimport type { Ref, Lane, ModelComponent } from '@teambit/objects';\nimport chalk from 'chalk';\nimport type { ConfigMain } from '@teambit/config';\nimport { ConfigAspect } from '@teambit/config';\nimport type { RemoveMain } from '@teambit/remove';\nimport { RemoveAspect, deleteComponentsFiles } from '@teambit/remove';\nimport { pathNormalizeToLinux } from '@teambit/toolbox.path.path';\nimport { componentIdToPackageName } from '@teambit/pkg.modules.component-package-name';\nimport type { ComponentWriterMain } from '@teambit/component-writer';\nimport { ComponentWriterAspect } from '@teambit/component-writer';\nimport type { ConsumerComponent } from '@teambit/legacy.consumer-component';\nimport type { ImporterMain } from '@teambit/importer';\nimport { ImporterAspect } from '@teambit/importer';\nimport type { Logger, LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport { compact } from 'lodash';\nimport type { ApplyVersionWithComps, CheckoutMain, ComponentStatusBase } from '@teambit/checkout';\nimport { CheckoutAspect, removeFilesIfNeeded, updateFileStatus } from '@teambit/checkout';\nimport type { ConfigMergerMain, ConfigMergeResult, PolicyDependency } from '@teambit/config-merger';\nimport { ConfigMergerAspect } from '@teambit/config-merger';\nimport type { SnapsDistance } from '@teambit/component.snap-distance';\nimport type { DependencyResolverMain } from '@teambit/dependency-resolver';\nimport { DependencyResolverAspect } from '@teambit/dependency-resolver';\nimport type { InstallMain } from '@teambit/install';\nimport { InstallAspect } from '@teambit/install';\nimport type { ScopeMain } from '@teambit/scope';\nimport { ScopeAspect } from '@teambit/scope';\nimport { ExtensionDataList } from '@teambit/legacy.extension-data';\nimport { MergeCmd } from './merge-cmd';\nimport { MergingAspect } from './merging.aspect';\nimport type { DataMergeResult, MergeStatusProviderOptions } from './merge-status-provider';\nimport { MergeStatusProvider } from './merge-status-provider';\nimport type {\n MergeStrategy,\n MergeResultsThreeWay,\n ApplyVersionResults,\n FailedComponents,\n MergeSnapResults,\n} from '@teambit/component.modules.merge-helper';\nimport {\n applyModifiedVersion,\n FileStatus,\n getMergeStrategyInteractive,\n MergeOptions,\n} from '@teambit/component.modules.merge-helper';\nimport type { ConfigStoreMain } from '@teambit/config-store';\nimport { ConfigStoreAspect } from '@teambit/config-store';\nimport type { ApplicationMain } from '@teambit/application';\nimport { ApplicationAspect } from '@teambit/application';\n\ntype ResolveUnrelatedData = {\n strategy: MergeStrategy;\n headOnCurrentLane: Ref;\n unrelatedHead: Ref;\n unrelatedLaneId: LaneId;\n};\n\nexport type DivergedComponent = { id: ComponentID; diverge: SnapsDistance };\n\nexport type ComponentMergeStatus = ComponentStatusBase & {\n mergeResults?: MergeResultsThreeWay | null;\n divergeData?: SnapsDistance;\n resolvedUnrelated?: ResolveUnrelatedData;\n configMergeResult?: ConfigMergeResult;\n dataMergeResult?: DataMergeResult;\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 class MergingMain {\n constructor(\n private workspace: Workspace,\n private scope: ScopeMain,\n private install: InstallMain,\n private snapping: SnappingMain,\n private checkout: CheckoutMain,\n private logger: Logger,\n private componentWriter: ComponentWriterMain,\n private importer: ImporterMain,\n private config: ConfigMain,\n private remove: RemoveMain,\n private configMerger: ConfigMergerMain,\n private depResolver: DependencyResolverMain,\n private application: ApplicationMain\n ) {}\n\n async merge(\n pattern: string,\n mergeStrategy: MergeStrategy,\n abort: boolean,\n resolve: boolean,\n noAutoSnap: 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(pattern, message, build);\n } else if (abort) {\n mergeResults = await this.abortMerge(pattern);\n } else {\n const bitIds = await this.getComponentsToMerge(pattern);\n mergeResults = await this.mergeComponentsFromRemote(\n consumer,\n bitIds,\n mergeStrategy,\n noAutoSnap,\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 noAutoSnap: 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(\n bitIds,\n currentLaneId,\n currentLaneObject,\n mergeStrategy\n );\n const failedComponents = allComponentsStatus.filter((c) => c.unchangedMessage && !c.unchangedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unchangedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to merge due to the following failures:\\n${failureMsgs}`);\n }\n\n return this.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n otherLaneId: currentLaneId,\n currentLane: currentLaneObject,\n noAutoSnap: noAutoSnap,\n snapMessage,\n build,\n skipDependencyInstallation,\n });\n }\n\n /**\n * merge multiple components according to the \"allComponentsStatus\".\n */\n async mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n otherLaneId,\n currentLane,\n noAutoSnap,\n noSnap,\n tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n detachHead,\n loose,\n }: {\n mergeStrategy: MergeStrategy;\n allComponentsStatus: ComponentMergeStatus[];\n otherLaneId: LaneId;\n currentLane?: Lane;\n noAutoSnap?: boolean;\n noSnap?: boolean;\n tag?: boolean;\n snapMessage?: string;\n build?: boolean;\n skipDependencyInstallation?: boolean;\n detachHead?: boolean;\n loose?: boolean;\n }): Promise<ApplyVersionResults> {\n const consumer = this.workspace?.consumer;\n const legacyScope = this.scope.legacyScope;\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 currentLaneIdsBeforeMerge = currentLane?.toComponentIds();\n\n const componentsResults = await this.applyVersionMultiple(\n succeededComponents,\n otherLaneId,\n mergeStrategy,\n currentLane,\n detachHead\n );\n\n const allConfigMerge = compact(succeededComponents.map((c) => c.configMergeResult));\n\n const { workspaceDepsUpdates, workspaceDepsConflicts, workspaceDepsUnchanged } = this.workspace\n ? await this.configMerger.updateWorkspaceJsoncWithDepsIfNeeded(allConfigMerge)\n : { workspaceDepsUpdates: undefined, workspaceDepsConflicts: undefined, workspaceDepsUnchanged: undefined };\n\n let workspaceConfigConflictWriteError: Error | undefined;\n if (workspaceDepsConflicts) {\n workspaceConfigConflictWriteError =\n await this.configMerger.writeWorkspaceJsoncWithConflictsGracefully(workspaceDepsConflicts);\n }\n if (this.workspace) await this.configMerger.generateConfigMergeConflictFileForAll(allConfigMerge);\n\n if (currentLane) legacyScope.objects.add(currentLane);\n\n await legacyScope.objects.persist(); // persist anyway, if currentLane is null it should save all main heads\n\n await legacyScope.objects.unmergedComponents.write();\n\n if (this.workspace) {\n await consumer.writeBitMap(`merge ${otherLaneId.toString()}`);\n await this.removeFromWsJsonPolicyIfExists(componentsResults, currentLane, currentLaneIdsBeforeMerge);\n }\n\n if (componentIdsToRemove.length && this.workspace) {\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\n if (!skipDependencyInstallation && !leftUnresolvedConflicts && !componentsHasConfigMergeConflicts) {\n // this is a workaround.\n // keep this here. although it gets called before snapping.\n // the reason is that when the installation is running, for some reason, some apps are unable to load in the same process.\n // they throw an error \"Cannot find module\" during the aspect loading.\n await this.application.loadAllAppsAsAspects();\n\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.consoleFailure(\n `failed installing packages, see the log for full stacktrace. error: ${err.message}`\n );\n }\n }\n\n const updatedComponents = compact(componentsResults.map((c) => c.legacyCompToWrite));\n\n const getSnapOrTagResults = async (): Promise<MergeSnapResults> => {\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 (noAutoSnap || 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(allComponentsStatus, updatedComponents, {\n snapMessage,\n build,\n laneId: currentLane?.toLaneId(),\n loose,\n });\n };\n let mergeSnapResults: MergeSnapResults = null;\n let mergeSnapError: Error | undefined;\n const bitMapSnapshot = this.workspace ? this.workspace.bitMap.takeSnapshot() : null;\n try {\n mergeSnapResults = await getSnapOrTagResults();\n } catch (err: any) {\n this.logger.error('failed running snap. mergeSnapError:', err);\n mergeSnapError = err;\n if (bitMapSnapshot) this.workspace.bitMap.restoreFromSnapshot(bitMapSnapshot);\n }\n\n return {\n components: componentsResults.map((c) => c.applyVersionResult),\n failedComponents,\n removedComponents: [...componentIdsToRemove, ...(mergeSnapResults?.removedComponents || [])],\n mergeSnapResults,\n mergeSnapError,\n workspaceConfigUpdateResult: {\n workspaceDepsUpdates,\n workspaceDepsConflicts,\n workspaceDepsUnchanged,\n workspaceConfigConflictWriteError,\n },\n leftUnresolvedConflicts,\n };\n }\n\n async removeFromWsJsonPolicyIfExists(\n componentsResults: ApplyVersionWithComps[],\n currentLane?: Lane,\n currentLaneIdsBeforeMerge?: ComponentIdList\n ) {\n const newlyIntroducedIds = currentLane\n ?.toComponentIds()\n .filter((id) => !currentLaneIdsBeforeMerge?.hasWithoutVersion(id));\n const newlyIntroducedComponentIds = ComponentIdList.fromArray(newlyIntroducedIds || []);\n const components = compact(\n componentsResults\n .map((c) => c.legacyCompToWrite)\n .filter((c) => c && newlyIntroducedComponentIds.hasWithoutVersion(c.id))\n );\n const packages = components.map((c) => componentIdToPackageName(c));\n const isRemoved = this.depResolver.removeFromRootPolicy(packages);\n if (isRemoved) await this.depResolver.persistConfig('merge (remove packages)');\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 options: MergeStatusProviderOptions,\n currentLane?: Lane, // currently checked out lane. if on main, then it's null.\n otherLane?: Lane // the lane we want to merged to our lane. (null if it's \"main\").\n ): Promise<ComponentMergeStatus[]> {\n const mergeStatusProvider = new MergeStatusProvider(\n this.scope,\n this.logger,\n this.importer,\n options,\n this.workspace,\n currentLane,\n otherLane\n );\n return mergeStatusProvider.getStatus(bitIds);\n }\n\n private async applyVersionMultiple(\n succeededComponents: ComponentMergeStatus[],\n otherLaneId: LaneId,\n mergeStrategy: MergeStrategy,\n currentLane?: Lane,\n detachHead?: boolean\n ): Promise<ApplyVersionWithComps[]> {\n const componentsResults = await mapSeries(\n succeededComponents,\n async ({ currentComponent, id, mergeResults, resolvedUnrelated, configMergeResult }) => {\n const modelComponent = await this.scope.legacyScope.getModelComponent(id);\n const updatedLaneId = otherLaneId.isDefault() ? LaneId.from(otherLaneId.name, id.scope as string) : otherLaneId;\n return this.applyVersion({\n currentComponent,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead: modelComponent.getRef(id.version as string) as Ref,\n otherLaneId: updatedLaneId,\n currentLane,\n resolvedUnrelated,\n configMergeResult,\n detachHead,\n });\n }\n );\n\n if (this.workspace) {\n const compsToWrite = compact(componentsResults.map((c) => c.legacyCompToWrite));\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\n return componentsResults;\n }\n\n private async applyVersion({\n currentComponent,\n id,\n mergeResults,\n mergeStrategy,\n remoteHead,\n otherLaneId,\n currentLane,\n resolvedUnrelated,\n configMergeResult,\n detachHead,\n }: {\n currentComponent: ConsumerComponent | null | undefined;\n id: ComponentID;\n mergeResults: MergeResultsThreeWay | null | undefined;\n mergeStrategy: MergeStrategy;\n remoteHead: Ref;\n otherLaneId: LaneId;\n currentLane?: Lane;\n resolvedUnrelated?: ResolveUnrelatedData;\n configMergeResult?: ConfigMergeResult;\n detachHead?: boolean;\n }): Promise<ApplyVersionWithComps> {\n const legacyScope = this.scope.legacyScope;\n let filesStatus = {};\n const unmergedComponent: UnmergedComponent = {\n id: { name: id.fullName, scope: id.scope },\n head: remoteHead,\n laneId: otherLaneId,\n };\n id = currentComponent ? currentComponent.id : id;\n const modelComponent = await legacyScope.getModelComponent(id);\n\n const addToCurrentLane = (head: Ref) => {\n if (!currentLane) throw new Error('currentLane must be defined when adding to the lane');\n if (otherLaneId.isDefault()) {\n const isPartOfLane = currentLane.components.find((c) => c.id.isEqualWithoutVersion(id));\n if (!isPartOfLane) return;\n }\n currentLane.addComponent({ id, head });\n };\n\n const convertHashToTagIfPossible = (componentId: ComponentID): ComponentID => {\n if (!componentId.version) return componentId;\n const tag = modelComponent.getTag(componentId.version);\n return tag ? componentId.changeVersion(tag) : componentId;\n };\n\n const handleResolveUnrelated = (legacyCompToWrite?: ConsumerComponent) => {\n if (!currentComponent) throw new Error('currentComponent must be defined when resolvedUnrelated');\n // because when on a main, we don't allow merging lanes with unrelated. we asks users to switch to the lane\n // first and then merge with --resolve-unrelated\n if (!currentLane) throw new Error('currentLane must be defined when resolvedUnrelated');\n if (!resolvedUnrelated) throw new Error('resolvedUnrelated must be populated');\n addToCurrentLane(resolvedUnrelated.headOnCurrentLane);\n unmergedComponent.unrelated = {\n unrelatedHead: resolvedUnrelated.unrelatedHead,\n headOnCurrentLane: resolvedUnrelated.headOnCurrentLane,\n unrelatedLaneId: resolvedUnrelated.unrelatedLaneId,\n };\n legacyScope.objects.unmergedComponents.addEntry(unmergedComponent);\n const idForOutput = convertHashToTagIfPossible(id);\n return { applyVersionResult: { id: idForOutput, 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 legacyScope.objects.unmergedComponents.addEntry(unmergedComponent);\n const idForOutput = convertHashToTagIfPossible(id);\n return { applyVersionResult: { id: idForOutput, 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 = this.workspace\n ? await this.workspace.consumer.loadComponentFromModelImportIfNeeded(idToLoad)\n : await legacyScope.getConsumerComponent(idToLoad); // when loading from the scope, we import all needed components first, so it should be fine. otherwise, change the code to import it here\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 if (this.workspace) await removeFilesIfNeeded(filesStatus, this.workspace.consumer, currentComponent || undefined);\n\n if (configMergeResult) {\n const successfullyMergedConfig = configMergeResult.getSuccessfullyMergedConfig();\n if (successfullyMergedConfig) {\n // Process mergedConfig to merge scope-specific policy and filter deletion markers\n // This happens ONCE here, so both workspace and bare-scope merges use the same processed config\n this.mergeScopeSpecificDepsPolicy(legacyComponent.extensions, successfullyMergedConfig);\n this.filterDeletedDependenciesFromConfig(successfullyMergedConfig);\n\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 legacyScope.objects.unmergedComponents.addEntry(unmergedComponent);\n } else if (currentLane) {\n if (resolvedUnrelated) {\n // must be \"theirs\"\n return handleResolveUnrelated(legacyComponent);\n }\n addToCurrentLane(remoteHead);\n } else {\n // this is main\n if (detachHead) {\n modelComponent.detachedHeads.setHead(remoteHead);\n } else {\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 }\n legacyScope.objects.add(modelComponent);\n }\n\n const idForOutput = convertHashToTagIfPossible(idToLoad);\n return {\n applyVersionResult: { id: idForOutput, filesStatus },\n component: currentComponent || undefined,\n legacyCompToWrite: legacyComponent,\n };\n }\n\n private async abortMerge(pattern: string): Promise<ApplyVersionResults> {\n const consumer = this.workspace.consumer;\n const ids = await this.getIdsForUnmerged(pattern);\n const results = await this.checkout.checkout({ ids, reset: true });\n ids.forEach((id) => consumer.scope.objects.unmergedComponents.removeComponent(id));\n await consumer.scope.objects.unmergedComponents.write();\n return { abortedComponents: results.components };\n }\n\n private async resolveMerge(pattern: string, snapMessage: string, build: boolean): Promise<ApplyVersionResults> {\n const ids = await this.getIdsForUnmerged(pattern);\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 | undefined,\n mergeStrategy: MergeStrategy\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, { shouldSquash: false, mergeStrategy }, localLaneObject, localLaneObject);\n }\n\n private async snapResolvedComponents(\n allComponentsStatus: ComponentMergeStatus[],\n updatedComponents: ConsumerComponent[],\n {\n snapMessage,\n build,\n laneId,\n loose,\n }: {\n snapMessage?: string;\n build?: boolean;\n laneId?: LaneId;\n loose?: boolean;\n }\n ): Promise<MergeSnapResults> {\n const unmergedComponents = this.scope.legacyScope.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 if (!this.workspace) {\n const getLoadAspectOnlyForIds = (): ComponentIdList | undefined => {\n if (!allComponentsStatus.length || !allComponentsStatus[0].dataMergeResult) return undefined;\n const dataConflictedIds = allComponentsStatus\n .filter((c) => {\n const conflictedAspects = c.dataMergeResult?.conflictedAspects || {};\n const aspectIds = Object.keys(conflictedAspects);\n aspectIds.forEach((aspectId) =>\n this.logger.debug(\n `conflicted-data for \"${c.id.toString()}\". aspectId: ${aspectId}. reason: ${conflictedAspects[aspectId]}`\n )\n );\n return aspectIds.length;\n })\n .map((c) => c.id);\n return ComponentIdList.fromArray(dataConflictedIds);\n };\n\n // mergedConfig has already been processed in applyVersion() with scope-specific policy merged\n // and deletion markers filtered, so we can use it directly\n const results = await this.snapping.snapFromScope(\n ids.map((id) => ({\n componentId: id.toString(),\n aspects: this.scope.legacyScope.objects.unmergedComponents.getEntry(id)?.mergedConfig,\n })),\n {\n message: snapMessage,\n build,\n lane: laneId?.toString(),\n updatedLegacyComponents: updatedComponents,\n loadAspectOnlyForIds: getLoadAspectOnlyForIds(),\n loose,\n }\n );\n return results;\n }\n return this.snapping.snap({\n legacyBitIds: ids,\n build,\n message: snapMessage,\n loose,\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(pattern?: string): Promise<ComponentID[]> {\n if (pattern) {\n const componentIds = await this.workspace.idsByPattern(pattern);\n componentIds.forEach((id) => {\n const entry = this.workspace.consumer.scope.objects.unmergedComponents.getEntry(id);\n if (!entry) {\n throw new BitError(`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 BitError(`all components are resolved already, nothing to do`);\n return unresolvedComponents.map((u) => ComponentID.fromObject(u.id));\n }\n\n private async getComponentsToMerge(pattern?: string): Promise<ComponentID[]> {\n if (pattern) {\n return this.workspace.idsByPattern(pattern);\n }\n const mergePending = await this.listMergePendingComponents();\n return mergePending.map((c) => c.id);\n }\n\n async listMergePendingComponents(componentsList?: ComponentsList): Promise<DivergedComponent[]> {\n const consumer = this.workspace.consumer;\n componentsList = componentsList || new ComponentsList(this.workspace);\n const allIds = consumer.bitMap.getAllIdsAvailableOnLaneIncludeRemoved();\n const componentsFromModel = await componentsList.getModelComponents();\n const duringMergeComps = componentsList.listDuringMergeStateComponents();\n const mergePendingComponents = await Promise.all(\n allIds.map(async (componentId: ComponentID) => {\n const modelComponent = componentsFromModel.find((c) => c.toComponentId().isEqualWithoutVersion(componentId));\n if (!modelComponent || duringMergeComps.hasWithoutVersion(componentId)) return null;\n const divergedData = await modelComponent.getDivergeDataForMergePending(consumer.scope.objects);\n if (!divergedData.isDiverged()) return null;\n return { id: modelComponent.toComponentId(), diverge: divergedData };\n })\n );\n return compact(mergePendingComponents);\n }\n\n /**\n * Merges scope dependency policy into the merged config.\n * This handles dependencies with force:true from the scope, regardless of whether they're\n * set via \"bit dependencies set\" (__specific: true) or workspace variants.\n *\n * This is needed because if the mergeConfig has a policy, it will be used, and any other policy along the line will be ignored.\n * In case the model has some dependencies that were set explicitly they're gonna be ignored.\n * This makes sure to add them to the policy of the mergeConfig.\n * In a way, this is similar to what we do when a user is running `bit deps set` and the component had previous dependencies set,\n * we copy those dependencies along with the current one to the .bitmap file, so they won't get lost.\n */\n private mergeScopeSpecificDepsPolicy(scopeExtensions: ExtensionDataList, mergeConfig?: Record<string, any>): void {\n const mergeConfigPolicy: Record<string, PolicyDependency[]> | undefined =\n mergeConfig?.[DependencyResolverAspect.id]?.policy;\n if (!mergeConfigPolicy) return;\n\n const depsResolver = scopeExtensions.findCoreExtension(DependencyResolverAspect.id);\n const scopePolicy = depsResolver?.config.policy;\n if (!scopePolicy) return;\n\n Object.keys(scopePolicy).forEach((depType) => {\n const scopeDepsForType = scopePolicy[depType];\n if (!mergeConfigPolicy[depType]) {\n // mergeConfigPolicy doesn't have this depType yet.\n // Convert scope policy (object format) to array format before adding\n mergeConfigPolicy[depType] = Object.keys(scopeDepsForType).map((depId) => ({\n name: depId,\n version: scopeDepsForType[depId],\n force: true,\n }));\n return;\n }\n\n // mergeConfigPolicy is always in array format (from config merger)\n this.addScopePolicyToMergedArray(mergeConfigPolicy[depType], scopeDepsForType);\n });\n }\n\n private addScopePolicyToMergedArray(policyArray: PolicyDependency[], scopeDepsForType: Record<string, string>): void {\n Object.keys(scopeDepsForType).forEach((depId) => {\n const version = scopeDepsForType[depId];\n const existingDep = policyArray.find((dep) => dep.name === depId);\n\n if (existingDep) {\n // If merge config has version: '-', it means the dependency was explicitly deleted.\n // Keep the '-' marker and don't override with scope policy.\n if (existingDep.version === '-') {\n return;\n }\n // Otherwise, dependency exists in merge config - keep merge config version (it's stronger)\n } else {\n // Dependency only exists in scope policy - add it to merge config\n policyArray.push({ name: depId, version, force: true });\n }\n });\n }\n\n private filterDeletedDependenciesFromConfig(mergeConfig?: Record<string, any>): void {\n const policy: Record<string, PolicyDependency[]> | undefined = mergeConfig?.[DependencyResolverAspect.id]?.policy;\n if (!policy) return;\n\n Object.keys(policy).forEach((depType) => {\n const depValue = policy[depType];\n // Filter out entries with version: '-' (deletion markers)\n const filtered = depValue.filter((dep) => dep.version !== '-');\n // If array is now empty, delete the key to avoid issues with downstream code\n if (filtered.length === 0) {\n delete policy[depType];\n } else {\n policy[depType] = filtered;\n }\n });\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n WorkspaceAspect,\n ScopeAspect,\n SnappingAspect,\n CheckoutAspect,\n InstallAspect,\n LoggerAspect,\n ComponentWriterAspect,\n ImporterAspect,\n ConfigAspect,\n RemoveAspect,\n ConfigStoreAspect,\n ConfigMergerAspect,\n DependencyResolverAspect,\n ApplicationAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n cli,\n workspace,\n scope,\n snapping,\n checkout,\n install,\n loggerMain,\n compWriter,\n importer,\n config,\n remove,\n configStore,\n configMerger,\n depResolver,\n application,\n ]: [\n CLIMain,\n Workspace,\n ScopeMain,\n SnappingMain,\n CheckoutMain,\n InstallMain,\n LoggerMain,\n ComponentWriterMain,\n ImporterMain,\n ConfigMain,\n RemoveMain,\n ConfigStoreMain,\n ConfigMergerMain,\n DependencyResolverMain,\n ApplicationMain,\n ]) {\n const logger = loggerMain.createLogger(MergingAspect.id);\n const merging = new MergingMain(\n workspace,\n scope,\n install,\n snapping,\n checkout,\n logger,\n compWriter,\n importer,\n config,\n remove,\n configMerger,\n depResolver,\n application\n );\n cli.register(new MergeCmd(merging, configStore));\n return merging;\n }\n}\n\nMergingAspect.addRuntime(MergingMain);\n"],"mappings":";;;;;;AACA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,YAAA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BAAa,EACbC,sBAAY,EACZC,wCAAqB,EACrBC,0BAAc,EACdC,sBAAY,EACZC,sBAAY,EACZC,gCAAiB,EACjBC,kCAAkB,EAClBtC,8CAAwB,EACxBuC,gCAAiB,CAClB;AAAA9U,eAAA,CA7uBUgB,WAAW,aA8uBL+T,kBAAW;AAuD9BnB,wBAAa,CAACoB,UAAU,CAAChU,WAAW,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/merging",
3
- "version": "1.0.796",
3
+ "version": "1.0.798",
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.796"
9
+ "version": "1.0.798"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "4.1.2",
@@ -30,19 +30,19 @@
30
30
  "@teambit/legacy.consumer": "0.0.84",
31
31
  "@teambit/pkg.modules.component-package-name": "0.0.91",
32
32
  "@teambit/toolbox.path.path": "0.0.11",
33
- "@teambit/config-merger": "0.0.663",
34
- "@teambit/builder": "1.0.796",
35
- "@teambit/dependency-resolver": "1.0.796",
36
- "@teambit/importer": "1.0.796",
37
- "@teambit/objects": "0.0.303",
38
- "@teambit/scope": "1.0.796",
39
- "@teambit/workspace": "1.0.796",
40
- "@teambit/application": "1.0.796",
41
- "@teambit/checkout": "1.0.796",
42
- "@teambit/component-writer": "1.0.796",
43
- "@teambit/install": "1.0.796",
44
- "@teambit/remove": "1.0.796",
45
- "@teambit/snapping": "1.0.796"
33
+ "@teambit/config-merger": "0.0.665",
34
+ "@teambit/builder": "1.0.798",
35
+ "@teambit/dependency-resolver": "1.0.798",
36
+ "@teambit/importer": "1.0.798",
37
+ "@teambit/objects": "0.0.305",
38
+ "@teambit/scope": "1.0.798",
39
+ "@teambit/workspace": "1.0.798",
40
+ "@teambit/application": "1.0.798",
41
+ "@teambit/checkout": "1.0.798",
42
+ "@teambit/component-writer": "1.0.798",
43
+ "@teambit/install": "1.0.798",
44
+ "@teambit/remove": "1.0.798",
45
+ "@teambit/snapping": "1.0.798"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/lodash": "4.14.165",