@teambit/merging 1.0.1009 → 1.0.1010

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.
@@ -71,7 +71,7 @@ export declare class MergingMain {
71
71
  /**
72
72
  * merge multiple components according to the "allComponentsStatus".
73
73
  */
74
- mergeSnaps({ mergeStrategy, allComponentsStatus, otherLaneId, currentLane, noAutoSnap, noSnap, tag, snapMessage, build, skipDependencyInstallation, detachHead, loose, }: {
74
+ mergeSnaps({ mergeStrategy, allComponentsStatus, otherLaneId, currentLane, noAutoSnap, noSnap, tag, snapMessage, build, skipDependencyInstallation, detachHead, loose, shouldSquash, }: {
75
75
  mergeStrategy: MergeStrategy;
76
76
  allComponentsStatus: ComponentMergeStatus[];
77
77
  otherLaneId: LaneId;
@@ -84,6 +84,7 @@ export declare class MergingMain {
84
84
  skipDependencyInstallation?: boolean;
85
85
  detachHead?: boolean;
86
86
  loose?: boolean;
87
+ shouldSquash?: boolean;
87
88
  }): Promise<ApplyVersionResults>;
88
89
  removeFromWsJsonPolicyIfExists(componentsResults: ApplyVersionWithComps[], currentLane?: Lane, currentLaneIdsBeforeMerge?: ComponentIdList): Promise<void>;
89
90
  /**
@@ -278,7 +278,8 @@ class MergingMain {
278
278
  build,
279
279
  skipDependencyInstallation,
280
280
  detachHead,
281
- loose
281
+ loose,
282
+ shouldSquash
282
283
  }) {
283
284
  const consumer = this.workspace?.consumer;
284
285
  const legacyScope = this.scope.legacyScope;
@@ -294,7 +295,7 @@ class MergingMain {
294
295
  const componentIdsToRemove = allComponentsStatus.filter(componentStatus => componentStatus.shouldBeRemoved).map(c => c.id.changeVersion(undefined));
295
296
  const succeededComponents = allComponentsStatus.filter(componentStatus => !componentStatus.unchangedMessage);
296
297
  const currentLaneIdsBeforeMerge = currentLane?.toComponentIds();
297
- const componentsResults = await this.applyVersionMultiple(succeededComponents, otherLaneId, mergeStrategy, currentLane, detachHead);
298
+ const componentsResults = await this.applyVersionMultiple(succeededComponents, otherLaneId, mergeStrategy, currentLane, detachHead, shouldSquash);
298
299
  const allConfigMerge = (0, _lodash().compact)(succeededComponents.map(c => c.configMergeResult));
299
300
  const {
300
301
  workspaceDepsUpdates,
@@ -424,7 +425,7 @@ class MergingMain {
424
425
  const mergeStatusProvider = new (_mergeStatusProvider().MergeStatusProvider)(this.scope, this.logger, this.importer, options, this.workspace, currentLane, otherLane);
425
426
  return mergeStatusProvider.getStatus(bitIds);
426
427
  }
427
- async applyVersionMultiple(succeededComponents, otherLaneId, mergeStrategy, currentLane, detachHead) {
428
+ async applyVersionMultiple(succeededComponents, otherLaneId, mergeStrategy, currentLane, detachHead, shouldSquash) {
428
429
  const componentsResults = await (0, _pMapSeries().default)(succeededComponents, async ({
429
430
  currentComponent,
430
431
  id,
@@ -444,7 +445,8 @@ class MergingMain {
444
445
  currentLane,
445
446
  resolvedUnrelated,
446
447
  configMergeResult,
447
- detachHead
448
+ detachHead,
449
+ shouldSquash
448
450
  });
449
451
  });
450
452
  if (this.workspace) {
@@ -477,7 +479,8 @@ class MergingMain {
477
479
  currentLane,
478
480
  resolvedUnrelated,
479
481
  configMergeResult,
480
- detachHead
482
+ detachHead,
483
+ shouldSquash
481
484
  }) {
482
485
  const legacyScope = this.scope.legacyScope;
483
486
  let filesStatus = {};
@@ -487,7 +490,10 @@ class MergingMain {
487
490
  scope: id.scope
488
491
  },
489
492
  head: remoteHead,
490
- laneId: otherLaneId
493
+ laneId: otherLaneId,
494
+ // diverged components get squashed at snap-creation time (single-parent + squashed metadata)
495
+ // when shouldSquash is set. fast-forward squash is handled separately by squashSnaps().
496
+ shouldSquash: Boolean(shouldSquash && mergeResults)
491
497
  };
492
498
  id = currentComponent ? currentComponent.id : id;
493
499
  const modelComponent = await legacyScope.getModelComponent(id);
@@ -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","laneHistoryMsg","laneHistory","lanes","updateLaneHistory","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","hiddenIds","updateDependents","visibleResults","isEqualWithoutVersion","compsToWrite","manyComponentsWriterOpts","writeConfig","reasonForBitmapChange","writeMany","filesStatus","unmergedComponent","fullName","head","addToCurrentLane","Error","existingOnLane","getComponent","existingInUpdateDependents","findUpdateDependent","addComponentToUpdateDependents","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","updateDependentsIds","u","visibleIds","h","hiddenLegacyComponents","snapForMerge","tagMessage","unmodified","componentIds","idsByPattern","entry","unresolvedComponents","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 type { 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) {\n const laneHistoryMsg = `merge from \"${otherLaneId.toString()}\"`;\n const laneHistory = await legacyScope.lanes.updateLaneHistory(currentLane, laneHistoryMsg);\n legacyScope.objects.add(laneHistory);\n legacyScope.objects.add(currentLane);\n }\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 // Hidden lane updateDependents live only on the lane and in the scope. Writing them to\n // the workspace would (a) leak internal lane plumbing into bitmap/files, and (b) confuse\n // downstream classifiers that key off bitmap-presence (the cascade-on-snap detector in\n // version-maker treats \"in bitmap\" as \"workspace tracked\"). Filter them out here.\n const hiddenIds = currentLane?.updateDependents || [];\n const visibleResults = componentsResults.filter(\n (c) => !hiddenIds.find((id) => id.isEqualWithoutVersion(c.applyVersionResult.id))\n );\n const compsToWrite = compact(visibleResults.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 const existingOnLane = currentLane.getComponent(id);\n const existingInUpdateDependents = currentLane.findUpdateDependent(id);\n if (otherLaneId.isDefault() && !existingOnLane && !existingInUpdateDependents) return;\n // preserve the existing entry's bucket so a merge refreshing a hidden updateDependent\n // doesn't accidentally promote it into the workspace-tracked bucket (and vice versa).\n if (existingInUpdateDependents && !existingOnLane) {\n currentLane.addComponentToUpdateDependents(id.changeVersion(head.toString()));\n } else {\n currentLane.addComponent({ id, head });\n }\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 // Hidden lane updateDependents ride the same `makeVersion` batch as visible workspace\n // components. version-maker's `isHiddenLaneEntry` detection (workspace flow: not-in-bitmap)\n // routes each entry correctly. workspace.getMany picks up disk-merged files for visible; the\n // in-memory merged ConsumerComponents from `applyVersion` are passed through for hidden\n // (which have no disk state). Single pipeline → consistent log/buildStatus/\n // flattenedDependencies/lane-history/stagedSnaps for all merge-cascade snaps.\n const lane = await this.scope.legacyScope.getCurrentLaneObject();\n const updateDependentsIds = lane?.updateDependents || [];\n const hiddenIds = ComponentIdList.fromArray(\n ids.filter((id) => updateDependentsIds.find((u) => u.isEqualWithoutVersion(id)))\n );\n const visibleIds = ComponentIdList.fromArray(\n ids.filter((id) => !hiddenIds.find((h) => h.isEqualWithoutVersion(id)))\n );\n const hiddenLegacyComponents = updatedComponents.filter((c) =>\n hiddenIds.find((h) => h.isEqualWithoutVersion(c.componentId))\n );\n return this.snapping.snapForMerge({\n visibleIds,\n hiddenLegacyComponents,\n message: snapMessage,\n build,\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,YA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ACTC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,QAAQ,EACRC,MAAM,EACNkT,UAAU,EACVhT,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,YAAY,EACZC,WAAW,EACXC,WACF,CAAC;IACDyS,GAAG,CAACO,QAAQ,CAAC,KAAIC,oBAAQ,EAACF,OAAO,EAAEH,WAAW,CAAC,CAAC;IAChD,OAAOG,OAAO;EAChB;AACF;AAACG,OAAA,CAAAhU,WAAA,GAAAA,WAAA;AAAAhB,eAAA,CAv0BYgB,WAAW,WAgwBP,EAAE;AAAAhB,eAAA,CAhwBNgB,WAAW,kBAiwBA,CACpBiU,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;AAAA9V,eAAA,CAjxBUgB,WAAW,aAkxBL+U,kBAAW;AAuD9BnB,wBAAa,CAACoB,UAAU,CAAChV,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","shouldSquash","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","laneHistoryMsg","laneHistory","lanes","updateLaneHistory","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","hiddenIds","updateDependents","visibleResults","isEqualWithoutVersion","compsToWrite","manyComponentsWriterOpts","writeConfig","reasonForBitmapChange","writeMany","filesStatus","unmergedComponent","fullName","head","Boolean","addToCurrentLane","Error","existingOnLane","getComponent","existingInUpdateDependents","findUpdateDependent","addComponentToUpdateDependents","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","getComponents","debug","ComponentID","fromObject","getLoadAspectOnlyForIds","dataMergeResult","dataConflictedIds","conflictedAspects","aspectIds","aspectId","snapFromScope","aspects","getEntry","lane","updatedLegacyComponents","loadAspectOnlyForIds","updateDependentsIds","u","visibleIds","h","hiddenLegacyComponents","snapForMerge","tagMessage","unmodified","componentIds","idsByPattern","entry","unresolvedComponents","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 type { 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 shouldSquash,\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 shouldSquash?: 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 shouldSquash\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) {\n const laneHistoryMsg = `merge from \"${otherLaneId.toString()}\"`;\n const laneHistory = await legacyScope.lanes.updateLaneHistory(currentLane, laneHistoryMsg);\n legacyScope.objects.add(laneHistory);\n legacyScope.objects.add(currentLane);\n }\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 shouldSquash?: 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 shouldSquash,\n });\n }\n );\n\n if (this.workspace) {\n // Hidden lane updateDependents live only on the lane and in the scope. Writing them to\n // the workspace would (a) leak internal lane plumbing into bitmap/files, and (b) confuse\n // downstream classifiers that key off bitmap-presence (the cascade-on-snap detector in\n // version-maker treats \"in bitmap\" as \"workspace tracked\"). Filter them out here.\n const hiddenIds = currentLane?.updateDependents || [];\n const visibleResults = componentsResults.filter(\n (c) => !hiddenIds.find((id) => id.isEqualWithoutVersion(c.applyVersionResult.id))\n );\n const compsToWrite = compact(visibleResults.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 shouldSquash,\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 shouldSquash?: 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 // diverged components get squashed at snap-creation time (single-parent + squashed metadata)\n // when shouldSquash is set. fast-forward squash is handled separately by squashSnaps().\n shouldSquash: Boolean(shouldSquash && mergeResults),\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 const existingOnLane = currentLane.getComponent(id);\n const existingInUpdateDependents = currentLane.findUpdateDependent(id);\n if (otherLaneId.isDefault() && !existingOnLane && !existingInUpdateDependents) return;\n // preserve the existing entry's bucket so a merge refreshing a hidden updateDependent\n // doesn't accidentally promote it into the workspace-tracked bucket (and vice versa).\n if (existingInUpdateDependents && !existingOnLane) {\n currentLane.addComponentToUpdateDependents(id.changeVersion(head.toString()));\n } else {\n currentLane.addComponent({ id, head });\n }\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 // Hidden lane updateDependents ride the same `makeVersion` batch as visible workspace\n // components. version-maker's `isHiddenLaneEntry` detection (workspace flow: not-in-bitmap)\n // routes each entry correctly. workspace.getMany picks up disk-merged files for visible; the\n // in-memory merged ConsumerComponents from `applyVersion` are passed through for hidden\n // (which have no disk state). Single pipeline → consistent log/buildStatus/\n // flattenedDependencies/lane-history/stagedSnaps for all merge-cascade snaps.\n const lane = await this.scope.legacyScope.getCurrentLaneObject();\n const updateDependentsIds = lane?.updateDependents || [];\n const hiddenIds = ComponentIdList.fromArray(\n ids.filter((id) => updateDependentsIds.find((u) => u.isEqualWithoutVersion(id)))\n );\n const visibleIds = ComponentIdList.fromArray(\n ids.filter((id) => !hiddenIds.find((h) => h.isEqualWithoutVersion(id)))\n );\n const hiddenLegacyComponents = updatedComponents.filter((c) =>\n hiddenIds.find((h) => h.isEqualWithoutVersion(c.componentId))\n );\n return this.snapping.snapForMerge({\n visibleIds,\n hiddenLegacyComponents,\n message: snapMessage,\n build,\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,OAA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EACPC,QAAQ,EACRC,QAAQ,EACRC,MAAM,EACNmT,UAAU,EACVjT,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,YAAY,EACZC,WAAW,EACXC,WACF,CAAC;IACD0S,GAAG,CAACO,QAAQ,CAAC,KAAIC,oBAAQ,EAACF,OAAO,EAAEH,WAAW,CAAC,CAAC;IAChD,OAAOG,OAAO;EAChB;AACF;AAACG,OAAA,CAAAjU,WAAA,GAAAA,WAAA;AAAAhB,eAAA,CAj1BYgB,WAAW,WA0wBP,EAAE;AAAAhB,eAAA,CA1wBNgB,WAAW,kBA2wBA,CACpBkU,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;AAAA/V,eAAA,CA3xBUgB,WAAW,aA4xBLgV,kBAAW;AAuD9BnB,wBAAa,CAACoB,UAAU,CAACjV,WAAW,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,48 +1,48 @@
1
1
  {
2
2
  "name": "@teambit/merging",
3
- "version": "1.0.1009",
3
+ "version": "1.0.1010",
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.1009"
9
+ "version": "1.0.1010"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "4.1.2",
13
13
  "lodash": "4.17.21",
14
14
  "p-map-series": "2.1.0",
15
- "@teambit/component.modules.merge-helper": "0.0.65",
16
15
  "@teambit/bit-error": "0.0.404",
17
- "@teambit/cli": "0.0.1332",
18
- "@teambit/config-merger": "0.0.873",
19
- "@teambit/config-store": "0.0.213",
20
16
  "@teambit/legacy.constants": "0.0.29",
21
- "@teambit/builder": "1.0.1006",
22
17
  "@teambit/component-id": "1.2.4",
23
- "@teambit/component.snap-distance": "0.0.123",
24
- "@teambit/dependency-resolver": "1.0.1006",
25
- "@teambit/importer": "1.0.1006",
26
18
  "@teambit/lane-id": "0.0.312",
27
- "@teambit/legacy.consumer-component": "0.0.123",
28
- "@teambit/legacy.extension-data": "0.0.124",
29
- "@teambit/legacy.scope": "0.0.122",
30
- "@teambit/logger": "0.0.1425",
31
- "@teambit/objects": "0.0.513",
32
- "@teambit/scope": "1.0.1006",
33
- "@teambit/workspace": "1.0.1006",
34
19
  "@teambit/harmony": "0.4.7",
35
- "@teambit/application": "1.0.1006",
36
- "@teambit/checkout": "1.0.1007",
37
- "@teambit/component-writer": "1.0.1006",
38
- "@teambit/config": "0.0.1507",
39
- "@teambit/install": "1.0.1006",
40
- "@teambit/legacy.component-list": "0.0.176",
41
- "@teambit/legacy.consumer": "0.0.122",
42
- "@teambit/pkg.modules.component-package-name": "0.0.129",
43
- "@teambit/remove": "1.0.1006",
44
- "@teambit/snapping": "1.0.1006",
45
- "@teambit/toolbox.path.path": "0.0.17"
20
+ "@teambit/toolbox.path.path": "0.0.17",
21
+ "@teambit/component.modules.merge-helper": "0.0.66",
22
+ "@teambit/cli": "0.0.1333",
23
+ "@teambit/config-merger": "0.0.874",
24
+ "@teambit/config-store": "0.0.214",
25
+ "@teambit/builder": "1.0.1007",
26
+ "@teambit/component.snap-distance": "0.0.124",
27
+ "@teambit/dependency-resolver": "1.0.1007",
28
+ "@teambit/importer": "1.0.1007",
29
+ "@teambit/legacy.consumer-component": "0.0.124",
30
+ "@teambit/legacy.extension-data": "0.0.125",
31
+ "@teambit/legacy.scope": "0.0.123",
32
+ "@teambit/logger": "0.0.1426",
33
+ "@teambit/objects": "0.0.514",
34
+ "@teambit/scope": "1.0.1007",
35
+ "@teambit/workspace": "1.0.1007",
36
+ "@teambit/application": "1.0.1007",
37
+ "@teambit/checkout": "1.0.1008",
38
+ "@teambit/component-writer": "1.0.1007",
39
+ "@teambit/config": "0.0.1508",
40
+ "@teambit/install": "1.0.1007",
41
+ "@teambit/legacy.component-list": "0.0.177",
42
+ "@teambit/legacy.consumer": "0.0.123",
43
+ "@teambit/pkg.modules.component-package-name": "0.0.130",
44
+ "@teambit/remove": "1.0.1007",
45
+ "@teambit/snapping": "1.0.1007"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/lodash": "4.14.165",