@teambit/merge-lanes 1.0.550 → 1.0.552

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.
@@ -268,7 +268,8 @@ class MergeLanesMain {
268
268
  shouldSquash,
269
269
  mergeStrategy,
270
270
  handleTargetAheadAsDiverged: noSnap,
271
- detachHead
271
+ detachHead,
272
+ shouldMergeAspectsData: true
272
273
  }, currentLane, otherLane);
273
274
  if (pattern) {
274
275
  const componentIds = idsToMerge;
@@ -1 +1 @@
1
- {"version":3,"names":["_bitError","data","require","_path","_interopRequireDefault","_cli","_importer","_lanes","_merging","_workspace","_configStore","_harmonyModules","_componentId","_pMapSeries","_scope","_laneId","_logger","_checkout","_remove","_lodash","_export","_mergeLanes","_mergeLane","_mergeLaneFromScope","_missingCompsToMerge","_mergeAbort","_lastMerged","_mergeMove","_harmonyModules2","_express","_lanesCheckConflicts","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","MergeLanesMain","constructor","workspace","merging","lanes","logger","remove","scope","exporter","importer","checkout","mergeLaneByCLI","laneName","options","BitError","currentLaneId","consumer","getCurrentLaneId","otherLaneId","getParsedLaneId","mergeLane","validateMergeFlags","currentLane","otherLane","laneToFetchArtifactsFrom","idsToMerge","resolveMergeContext","mergeStrategy","noAutoSnap","noSnap","tag","snapMessage","existingOnWorkspaceOnly","build","keepReadme","squash","noSquash","pattern","includeDeps","skipDependencyInstallation","resolveUnrelated","ignoreConfigChanges","throwIfNotUpToDate","detachHead","legacyScope","debug","toString","shouldSquash","isDefault","allComponentsStatus","getMergeStatus","handleTargetAheadAsDiverged","componentIds","compIdsFromPattern","filterIdsFromPoolIdsByPattern","filterComponentsStatus","bitId","find","c","id","isEqualWithoutVersion","unchangedLegitimately","unchangedMessage","workspaceIds","listIds","throwForFailures","succeededComponents","squashSnaps","messageTitle","ids","map","importHeadArtifactsFromLane","lastMerged","LastMerged","undefined","snapshot","takeSnapshot","mergeResults","mergeSnaps","persistSnapshot","mergedSuccessfully","failedComponents","every","failedComponent","deleteResults","readmeComponent","readmeComponentId","changeVersion","head","hash","removeLocallyByIds","reasonForRemoval","readmeResult","configMergeResults","compact","configMergeResult","mergedSnapIds","ComponentIdList","fromArray","mergeSnapResults","snappedComponents","componentsWithConfigConflicts","hasConflicts","compIdStr","conflicts","mergedSuccessfullyIds","components","files","filesStatus","f","FileStatus","manual","binaryConflict","config","includes","toStringWithoutVersion","snappedId","searchWithoutVersion","onDestroy","name","isEqual","isFeatureEnabled","DETACH_HEAD","skipFetch","excludeNonLaneComps","shouldIncludeUpdateDependents","fetchCurrent","fetchLaneWithItsComponents","loadLane","isDefaultLane","getMainIdsToMerge","compIdList","toVersionLatest","importObjectsFromMainIfExist","getOtherLane","lane","shouldFetch","isNew","getBitIds","modelComponents","Promise","all","getModelComponent","toComponentId","Error","toComponentIdsIncludeUpdateDependents","toComponentIds","checkLaneForConflicts","sourceLaneIdStr","targetLaneIdStr","parseLaneIdFromString","modifiedFiles","conflict","isBinaryConflict","filePath","mergeMove","newLaneName","OutsideWorkspaceError","lastMerge","restoreLaneObjectFromLastMerged","newLaneResult","createLane","abortLaneMerge","checkoutProps","mergeAbortOpts","getCurrentLane","compDirsToRemove","restoreFromLastMerged","_reloadConsumer","objects","unmergedComponents","removeAllComponents","write","configMergeFile","getConflictMergeFile","delete","checkoutResults","checkoutError","restoreMissingComponents","err","error","restoredItems","path","basename","bitMap","mapPath","join","includeNonLaneComps","includeUpdateDependents","DEFAULT_LANE","laneIds","isExported","mainNotOnLane","laneId","mergeFromScope","fromLane","toLane","fromLaneId","parseLaneId","toLaneId","getDefaultLaneId","LaneId","parse","pushToScopes","idsToExport","laneToExport","compIdsList","exportResult","laneObject","allVersions","exportHeadsOnly","filterOutExistingVersions","throwForMissingArtifacts","exportOrigin","setCurrentLaneId","mergeSnapError","generateMergeConflictFile","snappedIds","mergedNow","mergedPreviously","compIsAlreadyMergedMsg","unmerged","reason","status","diffStatus","skipChanges","compsNotUpToDate","componentsStatus","s","upToDate","componentId","provider","cli","loggerMain","configStore","express","createLogger","MergeLanesAspect","lanesCommand","getCommand","mergeLanesMain","commands","MergeLaneCmd","MergeAbortLaneCmd","MergeMoveLaneCmd","register","MergeLaneFromScopeCmd","LanesCheckConflictsRoute","exports","LanesAspect","CLIAspect","WorkspaceAspect","MergingAspect","LoggerAspect","RemoveAspect","ScopeAspect","ExportAspect","ImporterAspect","CheckoutAspect","ConfigStoreAspect","ExpressAspect","MainRuntime","compIdsToKeep","allBitIds","bitIdsFromPattern","bitIdsNotFromPattern","hasWithoutVersion","filteredComponentStatus","depsToAdd","missingDepsFromHead","missingDepsFromHistory","versionsToCheckPerId","pMapSeries","compId","fromStatus","divergeData","targetVersions","snapsOnTargetOnly","modelComponent","headOnTarget","getComponent","toImport","v","flat","scopeImporter","importWithoutDeps","cache","includeVersionHistory","remoteVersion","versionObj","loadVersion","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","depsOnLaneStr","MissingCompsToMerge","uniq","depsWithoutVersion","d","depsUniqWithoutVersion","uniqFromArray","getLogForSquash","basicLog","getBasicLog","log","message","opts","currentLaneName","componentFromModel","modifiedComp","squashOneComp","add","versionHistory","updateRebasedVersionHistory","isDiverged","isSourceAhead","isTargetAhead","remoteSnaps","getAllMessages","importManyObjects","versionObjects","load","getFinalMessage","allMessage","allMessageStr","m","currentParents","parents","commonSnapBeforeDiverge","doSquash","addAsOnlyParent","getModelComponentIfExist","ref","removeParent","finalMessage","setSquashed","previousParents","addRuntime","_default"],"sources":["merge-lanes.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport path from 'path';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { LanesAspect, LanesMain } from '@teambit/lanes';\nimport {\n MergingAspect,\n MergingMain,\n ComponentMergeStatus,\n ApplyVersionResults,\n compIsAlreadyMergedMsg,\n FileStatus,\n MergeStrategy,\n} from '@teambit/merging';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { ConfigStoreAspect, ConfigStoreMain } from '@teambit/config-store';\nimport { getBasicLog } from '@teambit/harmony.modules.get-basic-log';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { Ref, Lane, Version, Log } from '@teambit/objects';\nimport pMapSeries from 'p-map-series';\nimport { Scope as LegacyScope } from '@teambit/legacy.scope';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { ConfigMergeResult } from '@teambit/config-merger';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { CheckoutAspect, CheckoutMain, CheckoutProps, throwForFailures } from '@teambit/checkout';\nimport { SnapsDistance } from '@teambit/component.snap-distance';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { compact, uniq } from 'lodash';\nimport { ExportAspect, ExportMain, PushToScopesResult } from '@teambit/export';\nimport { MergeLanesAspect } from './merge-lanes.aspect';\nimport { MergeLaneCmd } from './merge-lane.cmd';\nimport { MergeLaneFromScopeCmd } from './merge-lane-from-scope.cmd';\nimport { MissingCompsToMerge } from './exceptions/missing-comps-to-merge';\nimport { MergeAbortLaneCmd, MergeAbortOpts } from './merge-abort.cmd';\nimport { LastMerged } from './last-merged';\nimport { MergeMoveLaneCmd } from './merge-move.cmd';\nimport { DETACH_HEAD, isFeatureEnabled } from '@teambit/harmony.modules.feature-toggle';\nimport { ExpressAspect, ExpressMain } from '@teambit/express';\nimport { LanesCheckConflictsRoute } from './lanes-check-conflicts.route';\n\nexport type MergeLaneOptions = {\n mergeStrategy: MergeStrategy;\n ours?: boolean;\n theirs?: boolean;\n noAutoSnap?: boolean;\n noSnap?: boolean;\n snapMessage?: string;\n existingOnWorkspaceOnly?: boolean;\n build?: boolean;\n keepReadme?: boolean;\n squash?: boolean;\n noSquash?: boolean;\n tag?: boolean;\n pattern?: string;\n includeDeps?: boolean;\n skipDependencyInstallation?: boolean;\n resolveUnrelated?: MergeStrategy;\n ignoreConfigChanges?: boolean;\n skipFetch?: boolean;\n excludeNonLaneComps?: boolean;\n shouldIncludeUpdateDependents?: boolean;\n throwIfNotUpToDate?: boolean; // relevant when merging from a scope\n fetchCurrent?: boolean; // needed when merging from a bare-scope (because it's empty)\n detachHead?: boolean;\n};\nexport type ConflictPerId = { id: ComponentID; files: string[]; config?: boolean };\nexport type MergeFromScopeResult = {\n mergedNow: ComponentID[];\n exportResult?: PushToScopesResult;\n unmerged: { id: ComponentID; reason: string }[]; // reasons currently are: ahead / already-merge / removed\n conflicts?: ConflictPerId[]; // relevant in case of diverge (currently possible only when merging from main to a lane)\n snappedIds?: ComponentID[]; // relevant in case of diverge (currently possible only when merging from main to a lane)\n mergedPreviously: ComponentID[];\n mergeSnapError?: Error;\n};\n\nexport class MergeLanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private merging: MergingMain,\n readonly lanes: LanesMain,\n readonly logger: Logger,\n private remove: RemoveMain,\n private scope: ScopeMain,\n private exporter: ExportMain,\n private importer: ImporterMain,\n private checkout: CheckoutMain\n ) {}\n\n async mergeLaneByCLI(laneName: string, options: MergeLaneOptions) {\n if (!this.workspace) {\n throw new BitError(`unable to merge a lane outside of Bit workspace`);\n }\n const currentLaneId = this.workspace.consumer.getCurrentLaneId();\n const otherLaneId = await this.workspace.consumer.getParsedLaneId(laneName);\n return this.mergeLane(otherLaneId, currentLaneId, options);\n }\n\n /**\n * merge otherLaneId into currentLaneId\n */\n async mergeLane(\n otherLaneId: LaneId,\n currentLaneId: LaneId,\n options: MergeLaneOptions\n ): Promise<{\n mergeResults: ApplyVersionResults;\n deleteResults: any;\n configMergeResults: ConfigMergeResult[];\n mergedSuccessfullyIds: ComponentID[];\n conflicts: ConflictPerId[];\n }> {\n this.validateMergeFlags(otherLaneId, currentLaneId, options);\n const { currentLane, otherLane, laneToFetchArtifactsFrom, idsToMerge } = await this.resolveMergeContext(\n otherLaneId,\n currentLaneId,\n options\n );\n\n const {\n mergeStrategy,\n noAutoSnap,\n noSnap,\n tag,\n snapMessage,\n existingOnWorkspaceOnly,\n build,\n keepReadme,\n squash,\n noSquash,\n pattern,\n includeDeps,\n skipDependencyInstallation,\n resolveUnrelated,\n ignoreConfigChanges,\n throwIfNotUpToDate,\n detachHead,\n } = options;\n const legacyScope = this.scope.legacyScope;\n const consumer = this.workspace?.consumer;\n\n if (throwIfNotUpToDate) await this.throwIfNotUpToDate(otherLaneId, currentLaneId);\n\n this.logger.debug(`merging the following ids: ${idsToMerge.toString()}`);\n\n const shouldSquash = squash || (currentLaneId.isDefault() && !noSquash);\n let allComponentsStatus = await this.merging.getMergeStatus(\n idsToMerge,\n {\n resolveUnrelated,\n ignoreConfigChanges,\n shouldSquash,\n mergeStrategy,\n handleTargetAheadAsDiverged: noSnap,\n detachHead,\n },\n currentLane,\n otherLane\n );\n\n if (pattern) {\n const componentIds = idsToMerge;\n const compIdsFromPattern = await (this.workspace || this.scope).filterIdsFromPoolIdsByPattern(\n pattern,\n componentIds\n );\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n idsToMerge,\n legacyScope,\n includeDeps,\n otherLane,\n shouldSquash\n );\n idsToMerge.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unchangedLegitimately: true, unchangedMessage: `excluded by pattern` });\n }\n });\n }\n if (existingOnWorkspaceOnly && this.workspace) {\n const workspaceIds = this.workspace.listIds();\n const compIdsFromPattern = workspaceIds.filter((id) =>\n allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id))\n );\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n idsToMerge,\n legacyScope,\n includeDeps,\n otherLane,\n shouldSquash\n );\n idsToMerge.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({\n id: bitId,\n unchangedLegitimately: true,\n unchangedMessage: `not in the workspace`,\n });\n }\n });\n }\n\n throwForFailures(allComponentsStatus);\n\n const succeededComponents = allComponentsStatus.filter((c) => !c.unchangedMessage);\n if (shouldSquash) {\n await squashSnaps(succeededComponents, currentLaneId, otherLaneId, legacyScope, {\n messageTitle: options.snapMessage,\n detachHead,\n });\n }\n\n if (laneToFetchArtifactsFrom) {\n const ids = allComponentsStatus.map((c) => c.id);\n await this.importer.importHeadArtifactsFromLane(laneToFetchArtifactsFrom, ids, true);\n }\n\n const lastMerged = consumer ? new LastMerged(this.scope, consumer, this.logger) : undefined;\n const snapshot = await lastMerged?.takeSnapshot(currentLane);\n\n const mergeResults = await this.merging.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n otherLaneId,\n currentLane,\n noAutoSnap,\n noSnap,\n tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n detachHead,\n });\n\n if (snapshot) await lastMerged?.persistSnapshot(snapshot);\n\n const mergedSuccessfully =\n !mergeResults.failedComponents ||\n mergeResults.failedComponents.length === 0 ||\n mergeResults.failedComponents.every((failedComponent) => failedComponent.unchangedLegitimately);\n\n let deleteResults = {};\n\n if (!keepReadme && otherLane && otherLane.readmeComponent && mergedSuccessfully) {\n const readmeComponentId = otherLane.readmeComponent.id.changeVersion(otherLane.readmeComponent?.head?.hash);\n deleteResults = await this.remove.removeLocallyByIds([readmeComponentId], { reasonForRemoval: 'lane-merge' });\n } else if (otherLane && !otherLane.readmeComponent) {\n deleteResults = { readmeResult: '' };\n }\n const configMergeResults = compact(allComponentsStatus.map((c) => c.configMergeResult));\n\n const mergedSnapIds = ComponentIdList.fromArray(\n mergeResults.mergeSnapResults?.snappedComponents.map((c) => c.id) || []\n );\n const componentsWithConfigConflicts = configMergeResults.filter((c) => c.hasConflicts()).map((c) => c.compIdStr);\n const conflicts: ConflictPerId[] = [];\n const mergedSuccessfullyIds: ComponentID[] = [];\n mergeResults.components?.forEach((c) => {\n const files = Object.keys(c.filesStatus).filter(\n (f) => c.filesStatus[f] === FileStatus.manual || c.filesStatus[f] === FileStatus.binaryConflict\n );\n const config = componentsWithConfigConflicts.includes(c.id.toStringWithoutVersion());\n if (files.length || config) {\n conflicts.push({ id: c.id, files, config });\n } else {\n const snappedId = mergedSnapIds.searchWithoutVersion(c.id);\n mergedSuccessfullyIds.push(snappedId || c.id);\n }\n });\n\n await this.workspace?.consumer.onDestroy(`lane-merge (${otherLaneId.name})`);\n\n return { mergeResults, deleteResults, configMergeResults, mergedSuccessfullyIds, conflicts };\n }\n\n private validateMergeFlags(otherLaneId: LaneId,\n currentLaneId: LaneId,\n options: MergeLaneOptions\n ) {\n const {\n tag,\n resolveUnrelated,\n detachHead,\n } = options;\n\n if (tag && !currentLaneId.isDefault()) {\n throw new BitError(`--tag only possible when on main. currently checked out to ${currentLaneId.toString()}`);\n }\n if (otherLaneId.isEqual(currentLaneId)) {\n throw new BitError(\n `unable to merge lane \"${otherLaneId.toString()}\", you're already at this lane. to get updates, simply run \"bit checkout head\"`\n );\n }\n if (resolveUnrelated && currentLaneId.isDefault()) {\n throw new BitError(\n `unable to resolve unrelated when on main. switch to ${otherLaneId.toString()} and run \"bit lane merge main --resolve-unrelated\"`\n );\n }\n if (detachHead && !isFeatureEnabled(DETACH_HEAD)) {\n throw new BitError(`unable to detach head. the feature is not enabled`);\n }\n if (detachHead && !currentLaneId.isDefault()) {\n throw new BitError(`unable to detach head. the current lane is not main`);\n }\n }\n\n private async resolveMergeContext(\n otherLaneId: LaneId,\n currentLaneId: LaneId,\n options: Partial<MergeLaneOptions>\n ) {\n const {\n skipFetch,\n excludeNonLaneComps,\n shouldIncludeUpdateDependents,\n fetchCurrent,\n } = options;\n const legacyScope = this.scope.legacyScope;\n if (fetchCurrent && !currentLaneId.isDefault()) {\n // if current is default, it'll be fetch later on\n await this.lanes.fetchLaneWithItsComponents(currentLaneId);\n }\n const currentLane = currentLaneId.isDefault() ? undefined : await legacyScope.loadLane(currentLaneId);\n const isDefaultLane = otherLaneId.isDefault();\n if (isDefaultLane) {\n if (!skipFetch) {\n const ids = await this.getMainIdsToMerge(currentLane, !excludeNonLaneComps);\n const compIdList = ComponentIdList.fromArray(ids).toVersionLatest();\n await this.importer.importObjectsFromMainIfExist(compIdList);\n }\n }\n let laneToFetchArtifactsFrom: Lane | undefined;\n const getOtherLane = async () => {\n let lane = await legacyScope.loadLane(otherLaneId);\n const shouldFetch = !lane || (!skipFetch && !lane.isNew);\n if (shouldFetch) {\n // don't assign `lane` to the result of this command. otherwise, if you have local snaps, it'll ignore them and use the remote-lane.\n const otherLane = await this.lanes.fetchLaneWithItsComponents(otherLaneId, shouldIncludeUpdateDependents);\n laneToFetchArtifactsFrom = otherLane;\n lane = await legacyScope.loadLane(otherLaneId);\n }\n return lane;\n };\n const otherLane = isDefaultLane ? undefined : await getOtherLane();\n if (fetchCurrent && otherLane && currentLaneId.isDefault()) {\n const ids = await this.getMainIdsToMerge(otherLane, false, shouldIncludeUpdateDependents);\n const compIdList = ComponentIdList.fromArray(ids).toVersionLatest();\n await this.importer.importObjectsFromMainIfExist(compIdList);\n }\n const getBitIds = async () => {\n if (isDefaultLane) {\n const ids = await this.getMainIdsToMerge(currentLane, !excludeNonLaneComps, shouldIncludeUpdateDependents);\n const modelComponents = await Promise.all(ids.map((id) => this.scope.legacyScope.getModelComponent(id)));\n return compact(\n modelComponents.map((c) => {\n if (!c.head) return null; // probably the component was never merged to main\n return c.toComponentId().changeVersion(c.head.toString());\n })\n );\n }\n if (!otherLane) throw new Error(`lane must be defined for non-default`);\n return shouldIncludeUpdateDependents\n ? otherLane.toComponentIdsIncludeUpdateDependents()\n : otherLane.toComponentIds();\n };\n const idsToMerge = await getBitIds();\n\n return {\n currentLane,\n otherLane,\n laneToFetchArtifactsFrom,\n idsToMerge,\n }\n }\n\n /**\n * check conflicts in case of merging sourceLaneId into targetLaneId\n */\n async checkLaneForConflicts(\n sourceLaneIdStr: string,\n targetLaneIdStr: string,\n options: Partial<MergeLaneOptions>\n ): Promise<{\n conflicts: ConflictPerId[];\n }> {\n const legacyScope = this.scope.legacyScope;\n const otherLaneId: LaneId = await legacyScope.lanes.parseLaneIdFromString(sourceLaneIdStr);\n const currentLaneId: LaneId = await legacyScope.lanes.parseLaneIdFromString(targetLaneIdStr);\n options.excludeNonLaneComps = true;\n const { currentLane, otherLane, idsToMerge } = await this.resolveMergeContext(\n otherLaneId,\n currentLaneId,\n options\n );\n\n const allComponentsStatus = await this.merging.getMergeStatus(\n idsToMerge,\n {\n mergeStrategy: 'manual',\n },\n currentLane,\n otherLane\n );\n\n throwForFailures(allComponentsStatus);\n\n const configMergeResults = compact(allComponentsStatus.map((c) => c.configMergeResult));\n const componentsWithConfigConflicts = configMergeResults.filter((c) => c.hasConflicts()).map((c) => c.compIdStr);\n const conflicts: ConflictPerId[] = [];\n allComponentsStatus.forEach((c) => {\n const files = c.mergeResults?.modifiedFiles.filter((f) => f.conflict || f.isBinaryConflict) || [];\n const config = componentsWithConfigConflicts.includes(c.id.toStringWithoutVersion());\n if (files.length || config) {\n conflicts.push({ id: c.id, files: files.map(f => f.filePath), config });\n }\n });\n\n return { conflicts };\n }\n\n async mergeMove(newLaneName: string, options: { scope?: string }) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const lastMerge = new LastMerged(this.scope, this.workspace.consumer, this.logger);\n await lastMerge.restoreLaneObjectFromLastMerged();\n const newLaneResult = await this.lanes.createLane(newLaneName, { scope: options.scope });\n return newLaneResult;\n }\n\n async abortLaneMerge(checkoutProps: CheckoutProps, mergeAbortOpts: MergeAbortOpts) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const lastMerge = new LastMerged(this.scope, this.workspace.consumer, this.logger);\n const currentLane = await this.lanes.getCurrentLane();\n const { compDirsToRemove } = await lastMerge.restoreFromLastMerged(mergeAbortOpts, currentLane);\n\n await this.workspace._reloadConsumer();\n\n this.workspace.consumer.scope.objects.unmergedComponents.removeAllComponents();\n await this.workspace.consumer.scope.objects.unmergedComponents.write();\n\n const configMergeFile = this.workspace.getConflictMergeFile();\n await configMergeFile.delete();\n\n let checkoutResults: ApplyVersionResults | undefined;\n let checkoutError: Error | undefined;\n checkoutProps.ids = this.workspace.listIds();\n checkoutProps.restoreMissingComponents = true;\n try {\n checkoutResults = await this.checkout.checkout(checkoutProps);\n } catch (err: any) {\n this.logger.error(`merge-abort got an error during the checkout stage`, err);\n checkoutError = err;\n }\n\n const restoredItems = [\n `${path.basename(this.workspace.consumer.bitMap.mapPath)} file`,\n `${path.basename(this.workspace.consumer.config.path)} file`,\n ];\n if (compDirsToRemove.length) {\n restoredItems.push(`deleted components directories: ${compDirsToRemove.join(', ')}`);\n }\n if (currentLane) {\n restoredItems.push(`${currentLane.id()} lane object`);\n }\n\n return { checkoutResults, restoredItems, checkoutError };\n }\n\n private async getMainIdsToMerge(lane?: Lane | null, includeNonLaneComps = true, includeUpdateDependents = false) {\n if (!lane) throw new Error(`unable to merge ${DEFAULT_LANE}, the current lane was not found`);\n const laneIds = includeUpdateDependents ? lane.toComponentIdsIncludeUpdateDependents() : lane.toComponentIds();\n const ids = laneIds.filter((id) => this.scope.isExported(id));\n if (includeNonLaneComps) {\n if (!this.workspace) {\n throw new BitError(`getMainIdsToMerge needs workspace`);\n }\n const workspaceIds = this.workspace.listIds();\n const mainNotOnLane = workspaceIds.filter(\n (id) => !laneIds.find((laneId) => laneId.isEqualWithoutVersion(id)) && this.scope.isExported(id)\n );\n ids.push(...mainNotOnLane);\n }\n return ids;\n }\n\n async mergeFromScope(\n fromLane: string,\n toLane: string,\n options: Partial<MergeLaneOptions> & { push?: boolean; reMerge?: boolean }\n ): Promise<MergeFromScopeResult> {\n if (this.workspace) {\n throw new BitError(\n `unable to run this command from a workspace, please create a new bare-scope and run it from there`\n );\n }\n const fromLaneId = await this.lanes.parseLaneId(fromLane);\n const toLaneId = toLane === DEFAULT_LANE ? this.lanes.getDefaultLaneId() : LaneId.parse(toLane);\n const shouldIncludeUpdateDependents = toLaneId.isDefault();\n\n const pushToScopes = async (idsToExport: ComponentID[], laneToExport?: Lane): Promise<PushToScopesResult> => {\n const shouldSquash = toLaneId.isDefault() && !options.noSquash; // only when merging to main we squash.\n const compIdsList = ComponentIdList.fromArray(idsToExport);\n const exportResult = await this.exporter.pushToScopes({\n scope: this.scope.legacyScope,\n ids: compIdsList,\n laneObject: laneToExport,\n allVersions: false,\n // no need to export anything else other than the head. the normal calculation of what to export won't apply here\n // as it is done from the scope.\n // @todo: if we merge main to a lane, then no need to export all main history, it'll be fetched later by fetchMissingHistory.\n // once a change is done in the exporter about this, uncomment the next line.\n // exportHeadsOnly: shouldSquash || fromLaneId.isDefault(),\n exportHeadsOnly: shouldSquash,\n // when merging main into a lane, because `shouldSquash` is false, we don't export head only, but all the snaps\n // in between. chances are that a) many of them are already exported, b) those that are not head, are not in\n // the local bare-scope, so trying to export them result in VersionNotFoundOnFS error.\n // it's best to filter them out before.\n // there is no risk of leaving modified Version objects behind, because when merging main into a lane, we don't\n // squash, so the Version objects are not modified.\n filterOutExistingVersions: fromLaneId.isDefault(),\n // all artifacts must be pushed. otherwise, they'll be missing from the component-scopes.\n // unless this is a merge from main to a lane, in which case it's not necessary to export the artifacts as\n // the user importing them will get them from main.\n throwForMissingArtifacts: !fromLaneId.isDefault(),\n exportOrigin: 'lane-merge',\n });\n return exportResult;\n };\n\n // current -> target (to)\n // other -> source (from)\n options.mergeStrategy = 'manual';\n options.excludeNonLaneComps = true;\n options.skipDependencyInstallation = true;\n options.shouldIncludeUpdateDependents = shouldIncludeUpdateDependents;\n options.throwIfNotUpToDate = !fromLaneId.isDefault();\n options.fetchCurrent = true;\n this.scope.legacyScope.setCurrentLaneId(toLaneId);\n\n const { mergeResults, configMergeResults, conflicts, mergedSuccessfullyIds } = await this.mergeLane(\n fromLaneId,\n toLaneId,\n options as MergeLaneOptions\n );\n\n const { mergeSnapResults, failedComponents, mergeSnapError } = mergeResults;\n\n if (configMergeResults.length) {\n this.logger.debug(\n `found the following config conflicts: ${configMergeResults\n .map((c) => `\\n${c.compIdStr}\\n${c.generateMergeConflictFile()}`)\n .join('\\n')}`\n );\n }\n\n const snappedIds = mergeSnapResults?.snappedComponents.map((c) => c.id) || [];\n\n const laneToExport = toLaneId.isDefault() ? undefined : await this.lanes.loadLane(toLaneId); // needs to be loaded again after the merge as it changed\n const exportResult =\n conflicts.length || mergeSnapError || !options.push\n ? undefined\n : await pushToScopes(\n mergedSuccessfullyIds.map((id) => id.changeVersion(undefined)),\n laneToExport\n );\n\n return {\n mergedNow: mergedSuccessfullyIds,\n mergedPreviously:\n failedComponents\n ?.filter(({ unchangedMessage }) => unchangedMessage === compIsAlreadyMergedMsg)\n .map((c) => c.id) || [],\n exportResult,\n unmerged: failedComponents?.map((c) => ({ id: c.id, reason: c.unchangedMessage })) || [],\n conflicts,\n snappedIds,\n mergeSnapError,\n };\n }\n private async throwIfNotUpToDate(fromLaneId: LaneId, toLaneId: LaneId) {\n const status = await this.lanes.diffStatus(fromLaneId, toLaneId, { skipChanges: true });\n const compsNotUpToDate = status.componentsStatus.filter((s) => !s.upToDate);\n if (compsNotUpToDate.length) {\n throw new Error(`unable to merge, the following components are not up-to-date:\n${compsNotUpToDate.map((s) => s.componentId.toString()).join('\\n')}`);\n }\n }\n\n static slots = [];\n static dependencies = [\n LanesAspect,\n CLIAspect,\n WorkspaceAspect,\n MergingAspect,\n LoggerAspect,\n RemoveAspect,\n ScopeAspect,\n ExportAspect,\n ImporterAspect,\n CheckoutAspect,\n ConfigStoreAspect,\n ExpressAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([\n lanes,\n cli,\n workspace,\n merging,\n loggerMain,\n remove,\n scope,\n exporter,\n importer,\n checkout,\n configStore,\n express,\n ]: [\n LanesMain,\n CLIMain,\n Workspace,\n MergingMain,\n LoggerMain,\n RemoveMain,\n ScopeMain,\n ExportMain,\n ImporterMain,\n CheckoutMain,\n ConfigStoreMain,\n ExpressMain,\n ]) {\n const logger = loggerMain.createLogger(MergeLanesAspect.id);\n const lanesCommand = cli.getCommand('lane');\n const mergeLanesMain = new MergeLanesMain(\n workspace,\n merging,\n lanes,\n logger,\n remove,\n scope,\n exporter,\n importer,\n checkout\n );\n lanesCommand?.commands?.push(new MergeLaneCmd(mergeLanesMain, configStore));\n lanesCommand?.commands?.push(new MergeAbortLaneCmd(mergeLanesMain));\n lanesCommand?.commands?.push(new MergeMoveLaneCmd(mergeLanesMain));\n cli.register(new MergeLaneFromScopeCmd(mergeLanesMain));\n express.register([new LanesCheckConflictsRoute(mergeLanesMain, logger)]);\n return mergeLanesMain;\n }\n}\n\nasync function filterComponentsStatus(\n allComponentsStatus: ComponentMergeStatus[],\n compIdsToKeep: ComponentID[],\n allBitIds: ComponentID[],\n legacyScope: LegacyScope,\n includeDeps = false,\n otherLane?: Lane, // lane that gets merged into the current lane. if not provided, it's main that gets merged into the current lane\n shouldSquash?: boolean\n): Promise<ComponentMergeStatus[]> {\n const bitIdsFromPattern = ComponentIdList.fromArray(compIdsToKeep);\n const bitIdsNotFromPattern = allBitIds.filter((bitId) => !bitIdsFromPattern.hasWithoutVersion(bitId));\n const filteredComponentStatus: ComponentMergeStatus[] = [];\n const depsToAdd: ComponentID[] = [];\n const missingDepsFromHead = {};\n const missingDepsFromHistory: string[] = [];\n\n const versionsToCheckPerId = await pMapSeries(compIdsToKeep, async (compId) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(compId));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n if (fromStatus.unchangedMessage) {\n return undefined;\n }\n if (!otherLane) {\n // if merging main, no need to check whether the deps are included in the pattern.\n return undefined;\n }\n const { divergeData } = fromStatus;\n if (!divergeData) {\n throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);\n }\n let targetVersions: Ref[] = divergeData.snapsOnTargetOnly;\n if (!targetVersions.length) {\n return undefined;\n }\n const modelComponent = await legacyScope.getModelComponent(compId);\n if (shouldSquash) {\n // no need to check all versions, we merge only the head\n const headOnTarget = otherLane ? otherLane.getComponent(compId)?.head : modelComponent.head;\n if (!headOnTarget) {\n throw new Error(`filterComponentsStatus: unable to find head for ${compId.toString()}`);\n }\n targetVersions = [headOnTarget];\n }\n\n return { compId, targetVersions, modelComponent };\n });\n\n // all these versions needs to be imported to load them later and check whether they have dependencies on the target lane\n const toImport = compact(versionsToCheckPerId)\n .map((c) => c.targetVersions.map((v) => c.compId.changeVersion(v.toString())))\n .flat();\n await legacyScope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(toImport), {\n lane: otherLane,\n cache: true,\n includeVersionHistory: false,\n reason: 'import all history of given patterns components to check whether they have dependencies on the lane',\n });\n\n await pMapSeries(compact(versionsToCheckPerId), async ({ compId, targetVersions, modelComponent }) => {\n await pMapSeries(targetVersions, async (remoteVersion) => {\n const versionObj = await modelComponent.loadVersion(remoteVersion.toString(), legacyScope.objects);\n const flattenedDeps = versionObj.getAllFlattenedDependencies();\n const depsNotIncludeInPattern = flattenedDeps.filter((id) =>\n bitIdsNotFromPattern.find((bitId) => bitId.isEqualWithoutVersion(id))\n );\n if (!depsNotIncludeInPattern.length) {\n return;\n }\n const depsOnLane: ComponentID[] = [];\n await Promise.all(\n depsNotIncludeInPattern.map(async (dep) => {\n const isOnLane = await legacyScope.isIdOnLane(dep, otherLane);\n if (isOnLane) {\n depsOnLane.push(dep);\n }\n })\n );\n if (!depsOnLane.length) {\n return;\n }\n if (includeDeps) {\n depsToAdd.push(...depsOnLane);\n } else {\n const headOnTarget = otherLane ? otherLane.getComponent(compId)?.head : modelComponent.head;\n const depsOnLaneStr = depsOnLane.map((dep) => dep.toStringWithoutVersion());\n if (headOnTarget?.isEqual(remoteVersion)) {\n depsOnLaneStr.forEach((dep) => {\n (missingDepsFromHead[dep] ||= []).push(compId.toStringWithoutVersion());\n });\n } else {\n missingDepsFromHistory.push(...depsOnLaneStr);\n }\n }\n });\n });\n if (Object.keys(missingDepsFromHead).length || missingDepsFromHistory.length) {\n throw new MissingCompsToMerge(missingDepsFromHead, uniq(missingDepsFromHistory));\n }\n\n if (depsToAdd.length) {\n // remove the version, otherwise, the uniq gives duplicate components with different versions.\n const depsWithoutVersion = depsToAdd.map((d) => d.changeVersion(undefined));\n const depsUniqWithoutVersion = ComponentIdList.uniqFromArray(depsWithoutVersion);\n depsUniqWithoutVersion.forEach((id) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n });\n }\n return filteredComponentStatus;\n}\n\nasync function getLogForSquash(otherLaneId: LaneId) {\n const basicLog = await getBasicLog();\n const log = {\n ...basicLog,\n message: `squashed during merge from ${otherLaneId.toString()}`,\n };\n return log;\n}\n\nasync function squashSnaps(\n succeededComponents: ComponentMergeStatus[],\n currentLaneId: LaneId,\n otherLaneId: LaneId,\n scope: LegacyScope,\n opts: { messageTitle?: string; detachHead?: boolean } = {}\n) {\n const currentLaneName = currentLaneId.name;\n const log = await getLogForSquash(otherLaneId);\n\n await Promise.all(\n succeededComponents.map(async ({ id, divergeData, componentFromModel }) => {\n if (!divergeData) {\n throw new Error(`unable to squash. divergeData is missing from ${id.toString()}`);\n }\n\n const modifiedComp = await squashOneComp(\n currentLaneName,\n otherLaneId,\n id,\n divergeData,\n log,\n scope,\n componentFromModel,\n opts\n );\n if (modifiedComp) {\n scope.objects.add(modifiedComp);\n const modelComponent = await scope.getModelComponent(id);\n const versionHistory = await modelComponent.updateRebasedVersionHistory(scope.objects, [modifiedComp]);\n if (versionHistory) scope.objects.add(versionHistory);\n }\n })\n );\n}\n\n/**\n * returns Version object if it was modified. otherwise, returns undefined\n */\nasync function squashOneComp(\n currentLaneName: string,\n otherLaneId: LaneId,\n id: ComponentID,\n divergeData: SnapsDistance,\n log: Log,\n scope: LegacyScope,\n componentFromModel?: Version,\n opts: { messageTitle?: string; detachHead?: boolean } = {}\n): Promise<Version | undefined> {\n const { messageTitle, detachHead } = opts;\n const shouldSquash = () => {\n if (divergeData.isDiverged()) {\n if (detachHead) {\n // for detach head, it's ok to have it as diverged. as long as the target is ahead, we want to squash.\n return true;\n }\n throw new BitError(`unable to squash because ${id.toString()} is diverged in history.\n consider switching to \"${\n otherLaneId.name\n }\" first, merging \"${currentLaneName}\", then switching back to \"${currentLaneName}\" and merging \"${otherLaneId.name}\"\n alternatively, use \"--no-squash\" flag to keep the entire history of \"${otherLaneId.name}\"`);\n }\n if (divergeData.isSourceAhead()) {\n // nothing to do. current is ahead, nothing to merge. (it was probably filtered out already as a \"failedComponent\")\n return false;\n }\n if (!divergeData.isTargetAhead()) {\n // nothing to do. current and remote are the same, nothing to merge. (it was probably filtered out already as a \"failedComponent\")\n return false;\n }\n return true;\n };\n\n if (!shouldSquash()) {\n return undefined;\n }\n\n // remote is ahead and was not diverge.\n const remoteSnaps = divergeData.snapsOnTargetOnly;\n if (remoteSnaps.length === 0) {\n throw new Error(`remote is ahead but it has no snaps. it's impossible`);\n }\n const getAllMessages = async () => {\n if (!messageTitle) return [];\n await scope.scopeImporter.importManyObjects({ [otherLaneId.scope]: remoteSnaps.map((s) => s.toString()) });\n const versionObjects = (await Promise.all(remoteSnaps.map((s) => scope.objects.load(s)))) as Version[];\n return compact(versionObjects).map((v) => v.log.message);\n };\n const getFinalMessage = async (): Promise<string | undefined> => {\n if (!messageTitle) return undefined;\n const allMessage = await getAllMessages();\n const allMessageStr = compact(allMessage)\n .map((m) => `[*] ${m}`)\n .join('\\n');\n return `${messageTitle}\\n${allMessageStr}`;\n };\n if (!componentFromModel) {\n throw new Error('unable to squash, the componentFromModel is missing');\n }\n const currentParents = componentFromModel.parents;\n\n // if the remote has only one snap, there is nothing to squash.\n // other checks here is to make sure `componentFromModel.addAsOnlyParent` call is not needed.\n if (remoteSnaps.length === 1 && divergeData.commonSnapBeforeDiverge && currentParents.length === 1) {\n return undefined;\n }\n\n const doSquash = async () => {\n if (divergeData.commonSnapBeforeDiverge) {\n componentFromModel.addAsOnlyParent(divergeData.commonSnapBeforeDiverge);\n return;\n }\n if (currentLaneName !== DEFAULT_LANE) {\n // when squashing into lane, we have to take main into account\n const modelComponent = await scope.getModelComponentIfExist(id);\n if (!modelComponent) throw new Error(`missing ModelComponent for ${id.toString()}`);\n if (modelComponent.head) {\n componentFromModel.addAsOnlyParent(modelComponent.head);\n return;\n }\n }\n // there is no commonSnapBeforeDiverge. the local has no snaps, all are remote, no need for parents. keep only head.\n componentFromModel.parents.forEach((ref) => componentFromModel.removeParent(ref));\n };\n\n await doSquash();\n\n const finalMessage = await getFinalMessage();\n componentFromModel.setSquashed({ previousParents: currentParents, laneId: otherLaneId }, log, finalMessage);\n return componentFromModel;\n}\n\nMergeLanesAspect.addRuntime(MergeLanesMain);\n\nexport default MergeLanesMain;\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,SAAA,YAAAA,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,MAAMH,QAAQ,CAAC,CAAC;EAEhB,MAAMK,YAAY,GAAG,MAAMZ,eAAe,CAAC,CAAC;EAC5Cd,kBAAkB,CAAC2B,WAAW,CAAC;IAAEC,eAAe,EAAEV,cAAc;IAAEzI,MAAM,EAAE/K;EAAY,CAAC,EAAEkS,GAAG,EAAE8B,YAAY,CAAC;EAC3G,OAAO1B,kBAAkB;AAC3B;AAEA3E,8BAAgB,CAACwG,UAAU,CAACrV,cAAc,CAAC;AAAC,IAAAsV,QAAA,GAAA9F,OAAA,CAAAzR,OAAA,GAE7BiC,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["_bitError","data","require","_path","_interopRequireDefault","_cli","_importer","_lanes","_merging","_workspace","_configStore","_harmonyModules","_componentId","_pMapSeries","_scope","_laneId","_logger","_checkout","_remove","_lodash","_export","_mergeLanes","_mergeLane","_mergeLaneFromScope","_missingCompsToMerge","_mergeAbort","_lastMerged","_mergeMove","_harmonyModules2","_express","_lanesCheckConflicts","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","MergeLanesMain","constructor","workspace","merging","lanes","logger","remove","scope","exporter","importer","checkout","mergeLaneByCLI","laneName","options","BitError","currentLaneId","consumer","getCurrentLaneId","otherLaneId","getParsedLaneId","mergeLane","validateMergeFlags","currentLane","otherLane","laneToFetchArtifactsFrom","idsToMerge","resolveMergeContext","mergeStrategy","noAutoSnap","noSnap","tag","snapMessage","existingOnWorkspaceOnly","build","keepReadme","squash","noSquash","pattern","includeDeps","skipDependencyInstallation","resolveUnrelated","ignoreConfigChanges","throwIfNotUpToDate","detachHead","legacyScope","debug","toString","shouldSquash","isDefault","allComponentsStatus","getMergeStatus","handleTargetAheadAsDiverged","shouldMergeAspectsData","componentIds","compIdsFromPattern","filterIdsFromPoolIdsByPattern","filterComponentsStatus","bitId","find","c","id","isEqualWithoutVersion","unchangedLegitimately","unchangedMessage","workspaceIds","listIds","throwForFailures","succeededComponents","squashSnaps","messageTitle","ids","map","importHeadArtifactsFromLane","lastMerged","LastMerged","undefined","snapshot","takeSnapshot","mergeResults","mergeSnaps","persistSnapshot","mergedSuccessfully","failedComponents","every","failedComponent","deleteResults","readmeComponent","readmeComponentId","changeVersion","head","hash","removeLocallyByIds","reasonForRemoval","readmeResult","configMergeResults","compact","configMergeResult","mergedSnapIds","ComponentIdList","fromArray","mergeSnapResults","snappedComponents","componentsWithConfigConflicts","hasConflicts","compIdStr","conflicts","mergedSuccessfullyIds","components","files","filesStatus","f","FileStatus","manual","binaryConflict","config","includes","toStringWithoutVersion","snappedId","searchWithoutVersion","onDestroy","name","isEqual","isFeatureEnabled","DETACH_HEAD","skipFetch","excludeNonLaneComps","shouldIncludeUpdateDependents","fetchCurrent","fetchLaneWithItsComponents","loadLane","isDefaultLane","getMainIdsToMerge","compIdList","toVersionLatest","importObjectsFromMainIfExist","getOtherLane","lane","shouldFetch","isNew","getBitIds","modelComponents","Promise","all","getModelComponent","toComponentId","Error","toComponentIdsIncludeUpdateDependents","toComponentIds","checkLaneForConflicts","sourceLaneIdStr","targetLaneIdStr","parseLaneIdFromString","modifiedFiles","conflict","isBinaryConflict","filePath","mergeMove","newLaneName","OutsideWorkspaceError","lastMerge","restoreLaneObjectFromLastMerged","newLaneResult","createLane","abortLaneMerge","checkoutProps","mergeAbortOpts","getCurrentLane","compDirsToRemove","restoreFromLastMerged","_reloadConsumer","objects","unmergedComponents","removeAllComponents","write","configMergeFile","getConflictMergeFile","delete","checkoutResults","checkoutError","restoreMissingComponents","err","error","restoredItems","path","basename","bitMap","mapPath","join","includeNonLaneComps","includeUpdateDependents","DEFAULT_LANE","laneIds","isExported","mainNotOnLane","laneId","mergeFromScope","fromLane","toLane","fromLaneId","parseLaneId","toLaneId","getDefaultLaneId","LaneId","parse","pushToScopes","idsToExport","laneToExport","compIdsList","exportResult","laneObject","allVersions","exportHeadsOnly","filterOutExistingVersions","throwForMissingArtifacts","exportOrigin","setCurrentLaneId","mergeSnapError","generateMergeConflictFile","snappedIds","mergedNow","mergedPreviously","compIsAlreadyMergedMsg","unmerged","reason","status","diffStatus","skipChanges","compsNotUpToDate","componentsStatus","s","upToDate","componentId","provider","cli","loggerMain","configStore","express","createLogger","MergeLanesAspect","lanesCommand","getCommand","mergeLanesMain","commands","MergeLaneCmd","MergeAbortLaneCmd","MergeMoveLaneCmd","register","MergeLaneFromScopeCmd","LanesCheckConflictsRoute","exports","LanesAspect","CLIAspect","WorkspaceAspect","MergingAspect","LoggerAspect","RemoveAspect","ScopeAspect","ExportAspect","ImporterAspect","CheckoutAspect","ConfigStoreAspect","ExpressAspect","MainRuntime","compIdsToKeep","allBitIds","bitIdsFromPattern","bitIdsNotFromPattern","hasWithoutVersion","filteredComponentStatus","depsToAdd","missingDepsFromHead","missingDepsFromHistory","versionsToCheckPerId","pMapSeries","compId","fromStatus","divergeData","targetVersions","snapsOnTargetOnly","modelComponent","headOnTarget","getComponent","toImport","v","flat","scopeImporter","importWithoutDeps","cache","includeVersionHistory","remoteVersion","versionObj","loadVersion","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","depsOnLaneStr","MissingCompsToMerge","uniq","depsWithoutVersion","d","depsUniqWithoutVersion","uniqFromArray","getLogForSquash","basicLog","getBasicLog","log","message","opts","currentLaneName","componentFromModel","modifiedComp","squashOneComp","add","versionHistory","updateRebasedVersionHistory","isDiverged","isSourceAhead","isTargetAhead","remoteSnaps","getAllMessages","importManyObjects","versionObjects","load","getFinalMessage","allMessage","allMessageStr","m","currentParents","parents","commonSnapBeforeDiverge","doSquash","addAsOnlyParent","getModelComponentIfExist","ref","removeParent","finalMessage","setSquashed","previousParents","addRuntime","_default"],"sources":["merge-lanes.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport path from 'path';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { LanesAspect, LanesMain } from '@teambit/lanes';\nimport {\n MergingAspect,\n MergingMain,\n ComponentMergeStatus,\n ApplyVersionResults,\n compIsAlreadyMergedMsg,\n FileStatus,\n MergeStrategy,\n} from '@teambit/merging';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { ConfigStoreAspect, ConfigStoreMain } from '@teambit/config-store';\nimport { getBasicLog } from '@teambit/harmony.modules.get-basic-log';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { Ref, Lane, Version, Log } from '@teambit/objects';\nimport pMapSeries from 'p-map-series';\nimport { Scope as LegacyScope } from '@teambit/legacy.scope';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { ConfigMergeResult } from '@teambit/config-merger';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { CheckoutAspect, CheckoutMain, CheckoutProps, throwForFailures } from '@teambit/checkout';\nimport { SnapsDistance } from '@teambit/component.snap-distance';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { compact, uniq } from 'lodash';\nimport { ExportAspect, ExportMain, PushToScopesResult } from '@teambit/export';\nimport { MergeLanesAspect } from './merge-lanes.aspect';\nimport { MergeLaneCmd } from './merge-lane.cmd';\nimport { MergeLaneFromScopeCmd } from './merge-lane-from-scope.cmd';\nimport { MissingCompsToMerge } from './exceptions/missing-comps-to-merge';\nimport { MergeAbortLaneCmd, MergeAbortOpts } from './merge-abort.cmd';\nimport { LastMerged } from './last-merged';\nimport { MergeMoveLaneCmd } from './merge-move.cmd';\nimport { DETACH_HEAD, isFeatureEnabled } from '@teambit/harmony.modules.feature-toggle';\nimport { ExpressAspect, ExpressMain } from '@teambit/express';\nimport { LanesCheckConflictsRoute } from './lanes-check-conflicts.route';\n\nexport type MergeLaneOptions = {\n mergeStrategy: MergeStrategy;\n ours?: boolean;\n theirs?: boolean;\n noAutoSnap?: boolean;\n noSnap?: boolean;\n snapMessage?: string;\n existingOnWorkspaceOnly?: boolean;\n build?: boolean;\n keepReadme?: boolean;\n squash?: boolean;\n noSquash?: boolean;\n tag?: boolean;\n pattern?: string;\n includeDeps?: boolean;\n skipDependencyInstallation?: boolean;\n resolveUnrelated?: MergeStrategy;\n ignoreConfigChanges?: boolean;\n skipFetch?: boolean;\n excludeNonLaneComps?: boolean;\n shouldIncludeUpdateDependents?: boolean;\n throwIfNotUpToDate?: boolean; // relevant when merging from a scope\n fetchCurrent?: boolean; // needed when merging from a bare-scope (because it's empty)\n detachHead?: boolean;\n};\nexport type ConflictPerId = { id: ComponentID; files: string[]; config?: boolean };\nexport type MergeFromScopeResult = {\n mergedNow: ComponentID[];\n exportResult?: PushToScopesResult;\n unmerged: { id: ComponentID; reason: string }[]; // reasons currently are: ahead / already-merge / removed\n conflicts?: ConflictPerId[]; // relevant in case of diverge (currently possible only when merging from main to a lane)\n snappedIds?: ComponentID[]; // relevant in case of diverge (currently possible only when merging from main to a lane)\n mergedPreviously: ComponentID[];\n mergeSnapError?: Error;\n};\n\nexport class MergeLanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private merging: MergingMain,\n readonly lanes: LanesMain,\n readonly logger: Logger,\n private remove: RemoveMain,\n private scope: ScopeMain,\n private exporter: ExportMain,\n private importer: ImporterMain,\n private checkout: CheckoutMain\n ) {}\n\n async mergeLaneByCLI(laneName: string, options: MergeLaneOptions) {\n if (!this.workspace) {\n throw new BitError(`unable to merge a lane outside of Bit workspace`);\n }\n const currentLaneId = this.workspace.consumer.getCurrentLaneId();\n const otherLaneId = await this.workspace.consumer.getParsedLaneId(laneName);\n return this.mergeLane(otherLaneId, currentLaneId, options);\n }\n\n /**\n * merge otherLaneId into currentLaneId\n */\n async mergeLane(\n otherLaneId: LaneId,\n currentLaneId: LaneId,\n options: MergeLaneOptions\n ): Promise<{\n mergeResults: ApplyVersionResults;\n deleteResults: any;\n configMergeResults: ConfigMergeResult[];\n mergedSuccessfullyIds: ComponentID[];\n conflicts: ConflictPerId[];\n }> {\n this.validateMergeFlags(otherLaneId, currentLaneId, options);\n const { currentLane, otherLane, laneToFetchArtifactsFrom, idsToMerge } = await this.resolveMergeContext(\n otherLaneId,\n currentLaneId,\n options\n );\n\n const {\n mergeStrategy,\n noAutoSnap,\n noSnap,\n tag,\n snapMessage,\n existingOnWorkspaceOnly,\n build,\n keepReadme,\n squash,\n noSquash,\n pattern,\n includeDeps,\n skipDependencyInstallation,\n resolveUnrelated,\n ignoreConfigChanges,\n throwIfNotUpToDate,\n detachHead,\n } = options;\n const legacyScope = this.scope.legacyScope;\n const consumer = this.workspace?.consumer;\n\n if (throwIfNotUpToDate) await this.throwIfNotUpToDate(otherLaneId, currentLaneId);\n\n this.logger.debug(`merging the following ids: ${idsToMerge.toString()}`);\n\n const shouldSquash = squash || (currentLaneId.isDefault() && !noSquash);\n let allComponentsStatus = await this.merging.getMergeStatus(\n idsToMerge,\n {\n resolveUnrelated,\n ignoreConfigChanges,\n shouldSquash,\n mergeStrategy,\n handleTargetAheadAsDiverged: noSnap,\n detachHead,\n shouldMergeAspectsData: true,\n },\n currentLane,\n otherLane\n );\n\n if (pattern) {\n const componentIds = idsToMerge;\n const compIdsFromPattern = await (this.workspace || this.scope).filterIdsFromPoolIdsByPattern(\n pattern,\n componentIds\n );\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n idsToMerge,\n legacyScope,\n includeDeps,\n otherLane,\n shouldSquash\n );\n idsToMerge.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unchangedLegitimately: true, unchangedMessage: `excluded by pattern` });\n }\n });\n }\n if (existingOnWorkspaceOnly && this.workspace) {\n const workspaceIds = this.workspace.listIds();\n const compIdsFromPattern = workspaceIds.filter((id) =>\n allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id))\n );\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n idsToMerge,\n legacyScope,\n includeDeps,\n otherLane,\n shouldSquash\n );\n idsToMerge.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({\n id: bitId,\n unchangedLegitimately: true,\n unchangedMessage: `not in the workspace`,\n });\n }\n });\n }\n\n throwForFailures(allComponentsStatus);\n\n const succeededComponents = allComponentsStatus.filter((c) => !c.unchangedMessage);\n if (shouldSquash) {\n await squashSnaps(succeededComponents, currentLaneId, otherLaneId, legacyScope, {\n messageTitle: options.snapMessage,\n detachHead,\n });\n }\n\n if (laneToFetchArtifactsFrom) {\n const ids = allComponentsStatus.map((c) => c.id);\n await this.importer.importHeadArtifactsFromLane(laneToFetchArtifactsFrom, ids, true);\n }\n\n const lastMerged = consumer ? new LastMerged(this.scope, consumer, this.logger) : undefined;\n const snapshot = await lastMerged?.takeSnapshot(currentLane);\n\n const mergeResults = await this.merging.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n otherLaneId,\n currentLane,\n noAutoSnap,\n noSnap,\n tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n detachHead,\n });\n\n if (snapshot) await lastMerged?.persistSnapshot(snapshot);\n\n const mergedSuccessfully =\n !mergeResults.failedComponents ||\n mergeResults.failedComponents.length === 0 ||\n mergeResults.failedComponents.every((failedComponent) => failedComponent.unchangedLegitimately);\n\n let deleteResults = {};\n\n if (!keepReadme && otherLane && otherLane.readmeComponent && mergedSuccessfully) {\n const readmeComponentId = otherLane.readmeComponent.id.changeVersion(otherLane.readmeComponent?.head?.hash);\n deleteResults = await this.remove.removeLocallyByIds([readmeComponentId], { reasonForRemoval: 'lane-merge' });\n } else if (otherLane && !otherLane.readmeComponent) {\n deleteResults = { readmeResult: '' };\n }\n const configMergeResults = compact(allComponentsStatus.map((c) => c.configMergeResult));\n\n const mergedSnapIds = ComponentIdList.fromArray(\n mergeResults.mergeSnapResults?.snappedComponents.map((c) => c.id) || []\n );\n const componentsWithConfigConflicts = configMergeResults.filter((c) => c.hasConflicts()).map((c) => c.compIdStr);\n const conflicts: ConflictPerId[] = [];\n const mergedSuccessfullyIds: ComponentID[] = [];\n mergeResults.components?.forEach((c) => {\n const files = Object.keys(c.filesStatus).filter(\n (f) => c.filesStatus[f] === FileStatus.manual || c.filesStatus[f] === FileStatus.binaryConflict\n );\n const config = componentsWithConfigConflicts.includes(c.id.toStringWithoutVersion());\n if (files.length || config) {\n conflicts.push({ id: c.id, files, config });\n } else {\n const snappedId = mergedSnapIds.searchWithoutVersion(c.id);\n mergedSuccessfullyIds.push(snappedId || c.id);\n }\n });\n\n await this.workspace?.consumer.onDestroy(`lane-merge (${otherLaneId.name})`);\n\n return { mergeResults, deleteResults, configMergeResults, mergedSuccessfullyIds, conflicts };\n }\n\n private validateMergeFlags(otherLaneId: LaneId,\n currentLaneId: LaneId,\n options: MergeLaneOptions\n ) {\n const {\n tag,\n resolveUnrelated,\n detachHead,\n } = options;\n\n if (tag && !currentLaneId.isDefault()) {\n throw new BitError(`--tag only possible when on main. currently checked out to ${currentLaneId.toString()}`);\n }\n if (otherLaneId.isEqual(currentLaneId)) {\n throw new BitError(\n `unable to merge lane \"${otherLaneId.toString()}\", you're already at this lane. to get updates, simply run \"bit checkout head\"`\n );\n }\n if (resolveUnrelated && currentLaneId.isDefault()) {\n throw new BitError(\n `unable to resolve unrelated when on main. switch to ${otherLaneId.toString()} and run \"bit lane merge main --resolve-unrelated\"`\n );\n }\n if (detachHead && !isFeatureEnabled(DETACH_HEAD)) {\n throw new BitError(`unable to detach head. the feature is not enabled`);\n }\n if (detachHead && !currentLaneId.isDefault()) {\n throw new BitError(`unable to detach head. the current lane is not main`);\n }\n }\n\n private async resolveMergeContext(\n otherLaneId: LaneId,\n currentLaneId: LaneId,\n options: Partial<MergeLaneOptions>\n ) {\n const {\n skipFetch,\n excludeNonLaneComps,\n shouldIncludeUpdateDependents,\n fetchCurrent,\n } = options;\n const legacyScope = this.scope.legacyScope;\n if (fetchCurrent && !currentLaneId.isDefault()) {\n // if current is default, it'll be fetch later on\n await this.lanes.fetchLaneWithItsComponents(currentLaneId);\n }\n const currentLane = currentLaneId.isDefault() ? undefined : await legacyScope.loadLane(currentLaneId);\n const isDefaultLane = otherLaneId.isDefault();\n if (isDefaultLane) {\n if (!skipFetch) {\n const ids = await this.getMainIdsToMerge(currentLane, !excludeNonLaneComps);\n const compIdList = ComponentIdList.fromArray(ids).toVersionLatest();\n await this.importer.importObjectsFromMainIfExist(compIdList);\n }\n }\n let laneToFetchArtifactsFrom: Lane | undefined;\n const getOtherLane = async () => {\n let lane = await legacyScope.loadLane(otherLaneId);\n const shouldFetch = !lane || (!skipFetch && !lane.isNew);\n if (shouldFetch) {\n // don't assign `lane` to the result of this command. otherwise, if you have local snaps, it'll ignore them and use the remote-lane.\n const otherLane = await this.lanes.fetchLaneWithItsComponents(otherLaneId, shouldIncludeUpdateDependents);\n laneToFetchArtifactsFrom = otherLane;\n lane = await legacyScope.loadLane(otherLaneId);\n }\n return lane;\n };\n const otherLane = isDefaultLane ? undefined : await getOtherLane();\n if (fetchCurrent && otherLane && currentLaneId.isDefault()) {\n const ids = await this.getMainIdsToMerge(otherLane, false, shouldIncludeUpdateDependents);\n const compIdList = ComponentIdList.fromArray(ids).toVersionLatest();\n await this.importer.importObjectsFromMainIfExist(compIdList);\n }\n const getBitIds = async () => {\n if (isDefaultLane) {\n const ids = await this.getMainIdsToMerge(currentLane, !excludeNonLaneComps, shouldIncludeUpdateDependents);\n const modelComponents = await Promise.all(ids.map((id) => this.scope.legacyScope.getModelComponent(id)));\n return compact(\n modelComponents.map((c) => {\n if (!c.head) return null; // probably the component was never merged to main\n return c.toComponentId().changeVersion(c.head.toString());\n })\n );\n }\n if (!otherLane) throw new Error(`lane must be defined for non-default`);\n return shouldIncludeUpdateDependents\n ? otherLane.toComponentIdsIncludeUpdateDependents()\n : otherLane.toComponentIds();\n };\n const idsToMerge = await getBitIds();\n\n return {\n currentLane,\n otherLane,\n laneToFetchArtifactsFrom,\n idsToMerge,\n }\n }\n\n /**\n * check conflicts in case of merging sourceLaneId into targetLaneId\n */\n async checkLaneForConflicts(\n sourceLaneIdStr: string,\n targetLaneIdStr: string,\n options: Partial<MergeLaneOptions>\n ): Promise<{\n conflicts: ConflictPerId[];\n }> {\n const legacyScope = this.scope.legacyScope;\n const otherLaneId: LaneId = await legacyScope.lanes.parseLaneIdFromString(sourceLaneIdStr);\n const currentLaneId: LaneId = await legacyScope.lanes.parseLaneIdFromString(targetLaneIdStr);\n options.excludeNonLaneComps = true;\n const { currentLane, otherLane, idsToMerge } = await this.resolveMergeContext(\n otherLaneId,\n currentLaneId,\n options\n );\n\n const allComponentsStatus = await this.merging.getMergeStatus(\n idsToMerge,\n {\n mergeStrategy: 'manual',\n },\n currentLane,\n otherLane\n );\n\n throwForFailures(allComponentsStatus);\n\n const configMergeResults = compact(allComponentsStatus.map((c) => c.configMergeResult));\n const componentsWithConfigConflicts = configMergeResults.filter((c) => c.hasConflicts()).map((c) => c.compIdStr);\n const conflicts: ConflictPerId[] = [];\n allComponentsStatus.forEach((c) => {\n const files = c.mergeResults?.modifiedFiles.filter((f) => f.conflict || f.isBinaryConflict) || [];\n const config = componentsWithConfigConflicts.includes(c.id.toStringWithoutVersion());\n if (files.length || config) {\n conflicts.push({ id: c.id, files: files.map(f => f.filePath), config });\n }\n });\n\n return { conflicts };\n }\n\n async mergeMove(newLaneName: string, options: { scope?: string }) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const lastMerge = new LastMerged(this.scope, this.workspace.consumer, this.logger);\n await lastMerge.restoreLaneObjectFromLastMerged();\n const newLaneResult = await this.lanes.createLane(newLaneName, { scope: options.scope });\n return newLaneResult;\n }\n\n async abortLaneMerge(checkoutProps: CheckoutProps, mergeAbortOpts: MergeAbortOpts) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const lastMerge = new LastMerged(this.scope, this.workspace.consumer, this.logger);\n const currentLane = await this.lanes.getCurrentLane();\n const { compDirsToRemove } = await lastMerge.restoreFromLastMerged(mergeAbortOpts, currentLane);\n\n await this.workspace._reloadConsumer();\n\n this.workspace.consumer.scope.objects.unmergedComponents.removeAllComponents();\n await this.workspace.consumer.scope.objects.unmergedComponents.write();\n\n const configMergeFile = this.workspace.getConflictMergeFile();\n await configMergeFile.delete();\n\n let checkoutResults: ApplyVersionResults | undefined;\n let checkoutError: Error | undefined;\n checkoutProps.ids = this.workspace.listIds();\n checkoutProps.restoreMissingComponents = true;\n try {\n checkoutResults = await this.checkout.checkout(checkoutProps);\n } catch (err: any) {\n this.logger.error(`merge-abort got an error during the checkout stage`, err);\n checkoutError = err;\n }\n\n const restoredItems = [\n `${path.basename(this.workspace.consumer.bitMap.mapPath)} file`,\n `${path.basename(this.workspace.consumer.config.path)} file`,\n ];\n if (compDirsToRemove.length) {\n restoredItems.push(`deleted components directories: ${compDirsToRemove.join(', ')}`);\n }\n if (currentLane) {\n restoredItems.push(`${currentLane.id()} lane object`);\n }\n\n return { checkoutResults, restoredItems, checkoutError };\n }\n\n private async getMainIdsToMerge(lane?: Lane | null, includeNonLaneComps = true, includeUpdateDependents = false) {\n if (!lane) throw new Error(`unable to merge ${DEFAULT_LANE}, the current lane was not found`);\n const laneIds = includeUpdateDependents ? lane.toComponentIdsIncludeUpdateDependents() : lane.toComponentIds();\n const ids = laneIds.filter((id) => this.scope.isExported(id));\n if (includeNonLaneComps) {\n if (!this.workspace) {\n throw new BitError(`getMainIdsToMerge needs workspace`);\n }\n const workspaceIds = this.workspace.listIds();\n const mainNotOnLane = workspaceIds.filter(\n (id) => !laneIds.find((laneId) => laneId.isEqualWithoutVersion(id)) && this.scope.isExported(id)\n );\n ids.push(...mainNotOnLane);\n }\n return ids;\n }\n\n async mergeFromScope(\n fromLane: string,\n toLane: string,\n options: Partial<MergeLaneOptions> & { push?: boolean; reMerge?: boolean }\n ): Promise<MergeFromScopeResult> {\n if (this.workspace) {\n throw new BitError(\n `unable to run this command from a workspace, please create a new bare-scope and run it from there`\n );\n }\n const fromLaneId = await this.lanes.parseLaneId(fromLane);\n const toLaneId = toLane === DEFAULT_LANE ? this.lanes.getDefaultLaneId() : LaneId.parse(toLane);\n const shouldIncludeUpdateDependents = toLaneId.isDefault();\n\n const pushToScopes = async (idsToExport: ComponentID[], laneToExport?: Lane): Promise<PushToScopesResult> => {\n const shouldSquash = toLaneId.isDefault() && !options.noSquash; // only when merging to main we squash.\n const compIdsList = ComponentIdList.fromArray(idsToExport);\n const exportResult = await this.exporter.pushToScopes({\n scope: this.scope.legacyScope,\n ids: compIdsList,\n laneObject: laneToExport,\n allVersions: false,\n // no need to export anything else other than the head. the normal calculation of what to export won't apply here\n // as it is done from the scope.\n // @todo: if we merge main to a lane, then no need to export all main history, it'll be fetched later by fetchMissingHistory.\n // once a change is done in the exporter about this, uncomment the next line.\n // exportHeadsOnly: shouldSquash || fromLaneId.isDefault(),\n exportHeadsOnly: shouldSquash,\n // when merging main into a lane, because `shouldSquash` is false, we don't export head only, but all the snaps\n // in between. chances are that a) many of them are already exported, b) those that are not head, are not in\n // the local bare-scope, so trying to export them result in VersionNotFoundOnFS error.\n // it's best to filter them out before.\n // there is no risk of leaving modified Version objects behind, because when merging main into a lane, we don't\n // squash, so the Version objects are not modified.\n filterOutExistingVersions: fromLaneId.isDefault(),\n // all artifacts must be pushed. otherwise, they'll be missing from the component-scopes.\n // unless this is a merge from main to a lane, in which case it's not necessary to export the artifacts as\n // the user importing them will get them from main.\n throwForMissingArtifacts: !fromLaneId.isDefault(),\n exportOrigin: 'lane-merge',\n });\n return exportResult;\n };\n\n // current -> target (to)\n // other -> source (from)\n options.mergeStrategy = 'manual';\n options.excludeNonLaneComps = true;\n options.skipDependencyInstallation = true;\n options.shouldIncludeUpdateDependents = shouldIncludeUpdateDependents;\n options.throwIfNotUpToDate = !fromLaneId.isDefault();\n options.fetchCurrent = true;\n this.scope.legacyScope.setCurrentLaneId(toLaneId);\n\n const { mergeResults, configMergeResults, conflicts, mergedSuccessfullyIds } = await this.mergeLane(\n fromLaneId,\n toLaneId,\n options as MergeLaneOptions\n );\n\n const { mergeSnapResults, failedComponents, mergeSnapError } = mergeResults;\n\n if (configMergeResults.length) {\n this.logger.debug(\n `found the following config conflicts: ${configMergeResults\n .map((c) => `\\n${c.compIdStr}\\n${c.generateMergeConflictFile()}`)\n .join('\\n')}`\n );\n }\n\n const snappedIds = mergeSnapResults?.snappedComponents.map((c) => c.id) || [];\n\n const laneToExport = toLaneId.isDefault() ? undefined : await this.lanes.loadLane(toLaneId); // needs to be loaded again after the merge as it changed\n const exportResult =\n conflicts.length || mergeSnapError || !options.push\n ? undefined\n : await pushToScopes(\n mergedSuccessfullyIds.map((id) => id.changeVersion(undefined)),\n laneToExport\n );\n\n return {\n mergedNow: mergedSuccessfullyIds,\n mergedPreviously:\n failedComponents\n ?.filter(({ unchangedMessage }) => unchangedMessage === compIsAlreadyMergedMsg)\n .map((c) => c.id) || [],\n exportResult,\n unmerged: failedComponents?.map((c) => ({ id: c.id, reason: c.unchangedMessage })) || [],\n conflicts,\n snappedIds,\n mergeSnapError,\n };\n }\n private async throwIfNotUpToDate(fromLaneId: LaneId, toLaneId: LaneId) {\n const status = await this.lanes.diffStatus(fromLaneId, toLaneId, { skipChanges: true });\n const compsNotUpToDate = status.componentsStatus.filter((s) => !s.upToDate);\n if (compsNotUpToDate.length) {\n throw new Error(`unable to merge, the following components are not up-to-date:\n${compsNotUpToDate.map((s) => s.componentId.toString()).join('\\n')}`);\n }\n }\n\n static slots = [];\n static dependencies = [\n LanesAspect,\n CLIAspect,\n WorkspaceAspect,\n MergingAspect,\n LoggerAspect,\n RemoveAspect,\n ScopeAspect,\n ExportAspect,\n ImporterAspect,\n CheckoutAspect,\n ConfigStoreAspect,\n ExpressAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([\n lanes,\n cli,\n workspace,\n merging,\n loggerMain,\n remove,\n scope,\n exporter,\n importer,\n checkout,\n configStore,\n express,\n ]: [\n LanesMain,\n CLIMain,\n Workspace,\n MergingMain,\n LoggerMain,\n RemoveMain,\n ScopeMain,\n ExportMain,\n ImporterMain,\n CheckoutMain,\n ConfigStoreMain,\n ExpressMain,\n ]) {\n const logger = loggerMain.createLogger(MergeLanesAspect.id);\n const lanesCommand = cli.getCommand('lane');\n const mergeLanesMain = new MergeLanesMain(\n workspace,\n merging,\n lanes,\n logger,\n remove,\n scope,\n exporter,\n importer,\n checkout\n );\n lanesCommand?.commands?.push(new MergeLaneCmd(mergeLanesMain, configStore));\n lanesCommand?.commands?.push(new MergeAbortLaneCmd(mergeLanesMain));\n lanesCommand?.commands?.push(new MergeMoveLaneCmd(mergeLanesMain));\n cli.register(new MergeLaneFromScopeCmd(mergeLanesMain));\n express.register([new LanesCheckConflictsRoute(mergeLanesMain, logger)]);\n return mergeLanesMain;\n }\n}\n\nasync function filterComponentsStatus(\n allComponentsStatus: ComponentMergeStatus[],\n compIdsToKeep: ComponentID[],\n allBitIds: ComponentID[],\n legacyScope: LegacyScope,\n includeDeps = false,\n otherLane?: Lane, // lane that gets merged into the current lane. if not provided, it's main that gets merged into the current lane\n shouldSquash?: boolean\n): Promise<ComponentMergeStatus[]> {\n const bitIdsFromPattern = ComponentIdList.fromArray(compIdsToKeep);\n const bitIdsNotFromPattern = allBitIds.filter((bitId) => !bitIdsFromPattern.hasWithoutVersion(bitId));\n const filteredComponentStatus: ComponentMergeStatus[] = [];\n const depsToAdd: ComponentID[] = [];\n const missingDepsFromHead = {};\n const missingDepsFromHistory: string[] = [];\n\n const versionsToCheckPerId = await pMapSeries(compIdsToKeep, async (compId) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(compId));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n if (fromStatus.unchangedMessage) {\n return undefined;\n }\n if (!otherLane) {\n // if merging main, no need to check whether the deps are included in the pattern.\n return undefined;\n }\n const { divergeData } = fromStatus;\n if (!divergeData) {\n throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);\n }\n let targetVersions: Ref[] = divergeData.snapsOnTargetOnly;\n if (!targetVersions.length) {\n return undefined;\n }\n const modelComponent = await legacyScope.getModelComponent(compId);\n if (shouldSquash) {\n // no need to check all versions, we merge only the head\n const headOnTarget = otherLane ? otherLane.getComponent(compId)?.head : modelComponent.head;\n if (!headOnTarget) {\n throw new Error(`filterComponentsStatus: unable to find head for ${compId.toString()}`);\n }\n targetVersions = [headOnTarget];\n }\n\n return { compId, targetVersions, modelComponent };\n });\n\n // all these versions needs to be imported to load them later and check whether they have dependencies on the target lane\n const toImport = compact(versionsToCheckPerId)\n .map((c) => c.targetVersions.map((v) => c.compId.changeVersion(v.toString())))\n .flat();\n await legacyScope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(toImport), {\n lane: otherLane,\n cache: true,\n includeVersionHistory: false,\n reason: 'import all history of given patterns components to check whether they have dependencies on the lane',\n });\n\n await pMapSeries(compact(versionsToCheckPerId), async ({ compId, targetVersions, modelComponent }) => {\n await pMapSeries(targetVersions, async (remoteVersion) => {\n const versionObj = await modelComponent.loadVersion(remoteVersion.toString(), legacyScope.objects);\n const flattenedDeps = versionObj.getAllFlattenedDependencies();\n const depsNotIncludeInPattern = flattenedDeps.filter((id) =>\n bitIdsNotFromPattern.find((bitId) => bitId.isEqualWithoutVersion(id))\n );\n if (!depsNotIncludeInPattern.length) {\n return;\n }\n const depsOnLane: ComponentID[] = [];\n await Promise.all(\n depsNotIncludeInPattern.map(async (dep) => {\n const isOnLane = await legacyScope.isIdOnLane(dep, otherLane);\n if (isOnLane) {\n depsOnLane.push(dep);\n }\n })\n );\n if (!depsOnLane.length) {\n return;\n }\n if (includeDeps) {\n depsToAdd.push(...depsOnLane);\n } else {\n const headOnTarget = otherLane ? otherLane.getComponent(compId)?.head : modelComponent.head;\n const depsOnLaneStr = depsOnLane.map((dep) => dep.toStringWithoutVersion());\n if (headOnTarget?.isEqual(remoteVersion)) {\n depsOnLaneStr.forEach((dep) => {\n (missingDepsFromHead[dep] ||= []).push(compId.toStringWithoutVersion());\n });\n } else {\n missingDepsFromHistory.push(...depsOnLaneStr);\n }\n }\n });\n });\n if (Object.keys(missingDepsFromHead).length || missingDepsFromHistory.length) {\n throw new MissingCompsToMerge(missingDepsFromHead, uniq(missingDepsFromHistory));\n }\n\n if (depsToAdd.length) {\n // remove the version, otherwise, the uniq gives duplicate components with different versions.\n const depsWithoutVersion = depsToAdd.map((d) => d.changeVersion(undefined));\n const depsUniqWithoutVersion = ComponentIdList.uniqFromArray(depsWithoutVersion);\n depsUniqWithoutVersion.forEach((id) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n });\n }\n return filteredComponentStatus;\n}\n\nasync function getLogForSquash(otherLaneId: LaneId) {\n const basicLog = await getBasicLog();\n const log = {\n ...basicLog,\n message: `squashed during merge from ${otherLaneId.toString()}`,\n };\n return log;\n}\n\nasync function squashSnaps(\n succeededComponents: ComponentMergeStatus[],\n currentLaneId: LaneId,\n otherLaneId: LaneId,\n scope: LegacyScope,\n opts: { messageTitle?: string; detachHead?: boolean } = {}\n) {\n const currentLaneName = currentLaneId.name;\n const log = await getLogForSquash(otherLaneId);\n\n await Promise.all(\n succeededComponents.map(async ({ id, divergeData, componentFromModel }) => {\n if (!divergeData) {\n throw new Error(`unable to squash. divergeData is missing from ${id.toString()}`);\n }\n\n const modifiedComp = await squashOneComp(\n currentLaneName,\n otherLaneId,\n id,\n divergeData,\n log,\n scope,\n componentFromModel,\n opts\n );\n if (modifiedComp) {\n scope.objects.add(modifiedComp);\n const modelComponent = await scope.getModelComponent(id);\n const versionHistory = await modelComponent.updateRebasedVersionHistory(scope.objects, [modifiedComp]);\n if (versionHistory) scope.objects.add(versionHistory);\n }\n })\n );\n}\n\n/**\n * returns Version object if it was modified. otherwise, returns undefined\n */\nasync function squashOneComp(\n currentLaneName: string,\n otherLaneId: LaneId,\n id: ComponentID,\n divergeData: SnapsDistance,\n log: Log,\n scope: LegacyScope,\n componentFromModel?: Version,\n opts: { messageTitle?: string; detachHead?: boolean } = {}\n): Promise<Version | undefined> {\n const { messageTitle, detachHead } = opts;\n const shouldSquash = () => {\n if (divergeData.isDiverged()) {\n if (detachHead) {\n // for detach head, it's ok to have it as diverged. as long as the target is ahead, we want to squash.\n return true;\n }\n throw new BitError(`unable to squash because ${id.toString()} is diverged in history.\n consider switching to \"${\n otherLaneId.name\n }\" first, merging \"${currentLaneName}\", then switching back to \"${currentLaneName}\" and merging \"${otherLaneId.name}\"\n alternatively, use \"--no-squash\" flag to keep the entire history of \"${otherLaneId.name}\"`);\n }\n if (divergeData.isSourceAhead()) {\n // nothing to do. current is ahead, nothing to merge. (it was probably filtered out already as a \"failedComponent\")\n return false;\n }\n if (!divergeData.isTargetAhead()) {\n // nothing to do. current and remote are the same, nothing to merge. (it was probably filtered out already as a \"failedComponent\")\n return false;\n }\n return true;\n };\n\n if (!shouldSquash()) {\n return undefined;\n }\n\n // remote is ahead and was not diverge.\n const remoteSnaps = divergeData.snapsOnTargetOnly;\n if (remoteSnaps.length === 0) {\n throw new Error(`remote is ahead but it has no snaps. it's impossible`);\n }\n const getAllMessages = async () => {\n if (!messageTitle) return [];\n await scope.scopeImporter.importManyObjects({ [otherLaneId.scope]: remoteSnaps.map((s) => s.toString()) });\n const versionObjects = (await Promise.all(remoteSnaps.map((s) => scope.objects.load(s)))) as Version[];\n return compact(versionObjects).map((v) => v.log.message);\n };\n const getFinalMessage = async (): Promise<string | undefined> => {\n if (!messageTitle) return undefined;\n const allMessage = await getAllMessages();\n const allMessageStr = compact(allMessage)\n .map((m) => `[*] ${m}`)\n .join('\\n');\n return `${messageTitle}\\n${allMessageStr}`;\n };\n if (!componentFromModel) {\n throw new Error('unable to squash, the componentFromModel is missing');\n }\n const currentParents = componentFromModel.parents;\n\n // if the remote has only one snap, there is nothing to squash.\n // other checks here is to make sure `componentFromModel.addAsOnlyParent` call is not needed.\n if (remoteSnaps.length === 1 && divergeData.commonSnapBeforeDiverge && currentParents.length === 1) {\n return undefined;\n }\n\n const doSquash = async () => {\n if (divergeData.commonSnapBeforeDiverge) {\n componentFromModel.addAsOnlyParent(divergeData.commonSnapBeforeDiverge);\n return;\n }\n if (currentLaneName !== DEFAULT_LANE) {\n // when squashing into lane, we have to take main into account\n const modelComponent = await scope.getModelComponentIfExist(id);\n if (!modelComponent) throw new Error(`missing ModelComponent for ${id.toString()}`);\n if (modelComponent.head) {\n componentFromModel.addAsOnlyParent(modelComponent.head);\n return;\n }\n }\n // there is no commonSnapBeforeDiverge. the local has no snaps, all are remote, no need for parents. keep only head.\n componentFromModel.parents.forEach((ref) => componentFromModel.removeParent(ref));\n };\n\n await doSquash();\n\n const finalMessage = await getFinalMessage();\n componentFromModel.setSquashed({ previousParents: currentParents, laneId: otherLaneId }, log, finalMessage);\n return componentFromModel;\n}\n\nMergeLanesAspect.addRuntime(MergeLanesMain);\n\nexport default MergeLanesMain;\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAA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V,OAAO,CAAEkW,GAAG,IAAKxB,kBAAkB,CAACyB,YAAY,CAACD,GAAG,CAAC,CAAC;EACnF,CAAC;EAED,MAAMH,QAAQ,CAAC,CAAC;EAEhB,MAAMK,YAAY,GAAG,MAAMZ,eAAe,CAAC,CAAC;EAC5Cd,kBAAkB,CAAC2B,WAAW,CAAC;IAAEC,eAAe,EAAEV,cAAc;IAAEzI,MAAM,EAAEhL;EAAY,CAAC,EAAEmS,GAAG,EAAE8B,YAAY,CAAC;EAC3G,OAAO1B,kBAAkB;AAC3B;AAEA3E,8BAAgB,CAACwG,UAAU,CAACtV,cAAc,CAAC;AAAC,IAAAuV,QAAA,GAAA9F,OAAA,CAAA1R,OAAA,GAE7BiC,cAAc","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/merge-lanes",
3
- "version": "1.0.550",
3
+ "version": "1.0.552",
4
4
  "homepage": "https://bit.cloud/teambit/lanes/merge-lanes",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.lanes",
8
8
  "name": "merge-lanes",
9
- "version": "1.0.550"
9
+ "version": "1.0.552"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -19,39 +19,39 @@
19
19
  "@teambit/lane-id": "0.0.312",
20
20
  "@teambit/harmony": "0.4.6",
21
21
  "@teambit/component-id": "1.2.2",
22
- "@teambit/express": "0.0.1225",
23
- "@teambit/logger": "0.0.1219",
24
- "@teambit/legacy.bit-map": "0.0.91",
22
+ "@teambit/express": "0.0.1227",
23
+ "@teambit/logger": "0.0.1221",
24
+ "@teambit/legacy.bit-map": "0.0.92",
25
25
  "@teambit/legacy.cli.prompts": "0.0.16",
26
- "@teambit/legacy.consumer": "0.0.34",
27
- "@teambit/legacy.scope": "0.0.34",
28
- "@teambit/objects": "0.0.56",
29
- "@teambit/scope": "1.0.549",
30
- "@teambit/checkout": "1.0.549",
31
- "@teambit/cli": "0.0.1126",
26
+ "@teambit/legacy.consumer": "0.0.35",
27
+ "@teambit/legacy.scope": "0.0.35",
28
+ "@teambit/objects": "0.0.58",
29
+ "@teambit/scope": "1.0.551",
30
+ "@teambit/checkout": "1.0.551",
31
+ "@teambit/cli": "0.0.1128",
32
32
  "@teambit/legacy.utils": "0.0.17",
33
- "@teambit/config-store": "0.0.6",
33
+ "@teambit/config-store": "0.0.8",
34
34
  "@teambit/legacy.constants": "0.0.11",
35
- "@teambit/merging": "1.0.549",
36
- "@teambit/remove": "1.0.549",
37
- "@teambit/component.snap-distance": "0.0.35",
38
- "@teambit/config-merger": "0.0.416",
39
- "@teambit/export": "1.0.549",
35
+ "@teambit/merging": "1.0.551",
36
+ "@teambit/remove": "1.0.551",
37
+ "@teambit/component.snap-distance": "0.0.36",
38
+ "@teambit/config-merger": "0.0.418",
39
+ "@teambit/export": "1.0.551",
40
40
  "@teambit/harmony.modules.feature-toggle": "0.0.19",
41
- "@teambit/harmony.modules.get-basic-log": "0.0.35",
42
- "@teambit/importer": "1.0.549",
43
- "@teambit/lanes": "1.0.550",
44
- "@teambit/workspace": "1.0.549"
41
+ "@teambit/harmony.modules.get-basic-log": "0.0.36",
42
+ "@teambit/importer": "1.0.551",
43
+ "@teambit/lanes": "1.0.552",
44
+ "@teambit/workspace": "1.0.551"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/fs-extra": "9.0.7",
48
48
  "@types/lodash": "4.14.165",
49
49
  "@types/mocha": "9.1.0",
50
50
  "@teambit/harmony.envs.core-aspect-env": "0.0.69",
51
- "@teambit/component.testing.mock-components": "0.0.294",
52
- "@teambit/harmony.testing.load-aspect": "0.0.289",
53
- "@teambit/snapping": "1.0.549",
54
- "@teambit/workspace.testing.mock-workspace": "0.0.62"
51
+ "@teambit/component.testing.mock-components": "0.0.295",
52
+ "@teambit/harmony.testing.load-aspect": "0.0.290",
53
+ "@teambit/snapping": "1.0.551",
54
+ "@teambit/workspace.testing.mock-workspace": "0.0.63"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "chai": "4.3.0",