@teambit/merge-lanes 1.0.1099 → 1.0.1101
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.
|
@@ -534,6 +534,18 @@ class MergeLanesMain {
|
|
|
534
534
|
const getBitIds = async () => {
|
|
535
535
|
if (isDefaultLane) {
|
|
536
536
|
const ids = await this.getMainIdsToMerge(currentLane, !excludeNonLaneComps, shouldIncludeUpdateDependents);
|
|
537
|
+
if (options.resolveMainHeadsFromRemote) {
|
|
538
|
+
// opt-in: resolve each head on main falling back to the remote scope, so a base that lives on
|
|
539
|
+
// the remote but wasn't fetched locally is still included instead of being skipped. a component
|
|
540
|
+
// with no head on main at all is genuinely new and dropped.
|
|
541
|
+
const idsWithHead = await Promise.all(ids.map(async id => {
|
|
542
|
+
const head = await this.lanes.getHeadOnMain(id);
|
|
543
|
+
return head ? id.changeVersion(head) : null;
|
|
544
|
+
}));
|
|
545
|
+
return (0, _lodash().compact)(idsWithHead);
|
|
546
|
+
}
|
|
547
|
+
// default: resolve heads from the local scope only (historical behavior). a component not in the
|
|
548
|
+
// local scope throws, and one with no local head was never merged to main and is dropped.
|
|
537
549
|
const modelComponents = await Promise.all(ids.map(id => this.scope.legacyScope.getModelComponent(id)));
|
|
538
550
|
return (0, _lodash().compact)(modelComponents.map(c => {
|
|
539
551
|
if (!c.head) return null; // probably the component was never merged to main
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_bitError","data","require","_path","_interopRequireDefault","_cli","_importer","_lanes","_merging","_componentModules","_workspace","_configStore","_harmonyModules","_componentId","_objects","_componentVersion","_pMapSeries","_scope","_laneId","_logger","_checkout","_remove","_lodash","_export","_mergeLanes","_mergeLane","_missingCompsToMerge","_mergeAbort","_lastMerged","_mergeMove","_express","_lanesCheckConflicts","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","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","shouldIncludeUpdateDependents","undefined","mergeLane","validateMergeFlags","currentLane","otherLane","laneToFetchArtifactsFrom","idsToMerge","resolveMergeContext","mergeStrategy","noAutoSnap","noSnap","tag","snapMessage","existingOnWorkspaceOnly","build","loose","keepReadme","squash","noSquash","pattern","includeDeps","skipDependencyInstallation","resolveUnrelated","ignoreConfigChanges","throwIfNotUpToDate","detachHead","legacyScope","debug","toString","shouldSquash","isDefault","allComponentsStatus","getMergeStatus","handleTargetAheadAsDiverged","shouldMergeAspectsData","componentIds","compIdsFromPattern","filterIdsFromPoolIdsByPattern","filterComponentsStatus","forEach","bitId","find","c","id","isEqualWithoutVersion","push","unchangedLegitimately","unchangedMessage","workspaceIds","listIds","filter","throwForFailures","succeededComponents","squashSnaps","messageTitle","ids","map","importHeadArtifactsFromLane","lastMerged","LastMerged","snapshot","takeSnapshot","mergeResults","mergeSnaps","persistSnapshot","mergedSuccessfully","failedComponents","length","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","keys","filesStatus","f","FileStatus","manual","binaryConflict","config","includes","toStringWithoutVersion","snappedId","searchWithoutVersion","importMissingReferencedDeps","onDestroy","name","checkedHashes","Set","candidateRefs","pMapSeries","modelComponent","getModelComponentIfExist","headVersion","loadVersion","objects","getAllFlattenedDependencies","depId","version","isSnap","has","add","Ref","from","existingRefs","hasMultiple","existingHashes","ref","missingHashes","scopeImporter","importManyObjects","subRefs","versionObject","load","refsWithOptions","existingSubRefs","missingSubRefs","isEqual","skipFetch","excludeNonLaneComps","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","configData","co","configConflict","generateMergeConflictFile","filePath","mergeMove","newLaneName","OutsideWorkspaceError","lastMerge","restoreLaneObjectFromLastMerged","newLaneResult","createLane","abortLaneMerge","checkoutProps","mergeAbortOpts","getCurrentLane","compDirsToRemove","restoreFromLastMerged","_reloadConsumer","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","fromLaneId","toLaneId","status","diffStatus","skipChanges","compsNotUpToDate","componentsStatus","s","upToDate","componentId","provider","cli","loggerMain","configStore","express","createLogger","MergeLanesAspect","lanesCommand","getCommand","mergeLanesMain","commands","MergeLaneCmd","MergeAbortLaneCmd","MergeMoveLaneCmd","register","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","compId","fromStatus","divergeData","targetVersions","snapsOnTargetOnly","headOnTarget","getCompHeadIncludeUpdateDependents","toImport","v","flat","importWithoutDeps","cache","includeVersionHistory","reason","remoteVersion","versionObj","flattenedDeps","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","depsOnLaneStr","MissingCompsToMerge","uniq","depsWithoutVersion","d","depsUniqWithoutVersion","uniqFromArray","opts","currentLaneName","log","getLogForSquash","componentFromModel","modifiedComp","squashOneComp","versionHistory","updateRebasedVersionHistory","isDiverged","isSourceAhead","isTargetAhead","remoteSnaps","getAllMessages","versionObjects","message","getFinalMessage","allMessage","allMessageStr","m","currentParents","parents","commonSnapBeforeDiverge","doSquash","addAsOnlyParent","removeParent","finalMessage","setSquashed","previousParents","addRuntime","_default"],"sources":["merge-lanes.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport path from 'path';\nimport type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport type { ImporterMain } from '@teambit/importer';\nimport { ImporterAspect } from '@teambit/importer';\nimport type { LanesMain } from '@teambit/lanes';\nimport { LanesAspect } from '@teambit/lanes';\nimport type { MergingMain, ComponentMergeStatus } from '@teambit/merging';\nimport type { ApplyVersionResults, MergeStrategy } from '@teambit/component.modules.merge-helper';\nimport { MergingAspect } from '@teambit/merging';\nimport { FileStatus } from '@teambit/component.modules.merge-helper';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect, OutsideWorkspaceError } from '@teambit/workspace';\nimport type { ConfigStoreMain } from '@teambit/config-store';\nimport { ConfigStoreAspect } from '@teambit/config-store';\nimport { getLogForSquash } from '@teambit/harmony.modules.get-basic-log';\nimport type { ComponentID } from '@teambit/component-id';\nimport { ComponentIdList } from '@teambit/component-id';\nimport type { Lane, Version, Log } from '@teambit/objects';\nimport { Ref } from '@teambit/objects';\nimport { isSnap } from '@teambit/component-version';\nimport pMapSeries from 'p-map-series';\nimport type { Scope as LegacyScope } from '@teambit/legacy.scope';\nimport type { ScopeMain } from '@teambit/scope';\nimport { ScopeAspect } from '@teambit/scope';\nimport type { LaneId } from '@teambit/lane-id';\nimport { DEFAULT_LANE } from '@teambit/lane-id';\nimport type { ConfigMergeResult } from '@teambit/config-merger';\nimport type { Logger, LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { CheckoutMain, CheckoutProps } from '@teambit/checkout';\nimport { CheckoutAspect, throwForFailures } from '@teambit/checkout';\nimport type { SnapsDistance } from '@teambit/component.snap-distance';\nimport type { RemoveMain } from '@teambit/remove';\nimport { RemoveAspect } from '@teambit/remove';\nimport { compact, uniq } from 'lodash';\nimport type { ExportMain } from '@teambit/export';\nimport { ExportAspect } from '@teambit/export';\nimport { MergeLanesAspect } from './merge-lanes.aspect';\nimport { MergeLaneCmd } from './merge-lane.cmd';\nimport { MissingCompsToMerge } from './exceptions/missing-comps-to-merge';\nimport type { MergeAbortOpts } from './merge-abort.cmd';\nimport { MergeAbortLaneCmd } from './merge-abort.cmd';\nimport { LastMerged } from './last-merged';\nimport { MergeMoveLaneCmd } from './merge-move.cmd';\nimport type { ExpressMain } from '@teambit/express';\nimport { ExpressAspect } 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 loose?: boolean; // relevant for --build, to allow build to succeed even if tasks like tests or lint fail\n};\nexport type ConflictPerId = { id: ComponentID; files: string[]; config?: boolean; configConflict?: string };\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 // Hidden lane updateDependents must participate in every merge — otherwise main→lane refresh\n // (`bit lane merge main`) leaves the lane's cascaded entries stuck on their old main-head\n // base, and lane→main merge would push a partially-consistent lane state. The bare-scope\n // counterpart (`bit _merge-lane`, used by Ripple / the UI's \"update lane\" button) already\n // sets this; the workspace path was the missing leg.\n if (options.shouldIncludeUpdateDependents === undefined) {\n options.shouldIncludeUpdateDependents = true;\n }\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 loose,\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 loose,\n shouldSquash,\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 // A merged head may reference — via its flattened dependencies — a non-head snap of another\n // component. When merging to main the squash removes intermediate snaps from each component's own\n // chain, and a bare-scope merge (`bit _merge-lane --push`) exports heads only; in both cases such a\n // referenced snap wouldn't be exported, and on lean lanes it lives only on the lane scope. Import\n // any missing one now so the export can ship it (otherwise the remote's dependency-integrity check\n // would reject the push). Not needed for non-squash workspace merges, which export full history.\n if (shouldSquash || !this.workspace) {\n await this.importMissingReferencedDeps(mergedSuccessfullyIds, otherLane);\n }\n\n await this.workspace?.consumer.onDestroy(`lane-merge (${otherLaneId.name})`);\n\n return { mergeResults, deleteResults, configMergeResults, mergedSuccessfullyIds, conflicts };\n }\n\n /**\n * A merged component head may reference, via its flattened dependencies, a non-head snap of another\n * component — e.g. a deleted component that keeps pinning an older snap of a dependency that has\n * since advanced. On lean lanes those snaps live only on the lane scope and are not fetched by the\n * merge, so the heads-only export (used by `bit _merge-lane --push`) would leave them out and the\n * remote's dependency-integrity check would fail. Import any such missing snap from the lane scope.\n */\n private async importMissingReferencedDeps(ids: ComponentID[], otherLane?: Lane) {\n // the missing snaps live on the lane scope (lean lanes). without the source lane we don't know\n // where to fetch them from, so there's nothing to do.\n if (!otherLane) return;\n const legacyScope = this.scope.legacyScope;\n // one existence check per unique hash — the same snap appears in the flattened list of many heads\n const checkedHashes = new Set<string>();\n const candidateRefs: Ref[] = [];\n await pMapSeries(ids, async (id) => {\n // strip the version — a versioned lookup (sources.get) returns undefined when that Version\n // object is missing locally, and only the model is needed here anyway (for its head).\n const modelComponent = await legacyScope.getModelComponentIfExist(id.changeVersion(undefined));\n const head = modelComponent?.head;\n if (!modelComponent || !head) return;\n const headVersion = await modelComponent.loadVersion(head.toString(), legacyScope.objects, false);\n if (!headVersion) return;\n // flattened (not only direct) to mirror the remote-side check, which validates the flattened\n // dependencies of every exported head (see throwForMissingLocalDependencies). cheap: only the\n // heads are loaded and each unique hash is stat-ed once.\n headVersion.getAllFlattenedDependencies().forEach((depId) => {\n // the remote check validates only same-scope deps (it skips `depId.scope !== scope.name`,\n // cross-scope deps are fetched later by the remote itself), so same-scope is all the export\n // needs to ship. this also filters out the vast majority of the flattened list.\n if (depId.scope !== id.scope) return;\n // only snaps can go missing this way — tags live on the home scope and are never squashed\n // off a lane. (a tag version is a semver string, not an object hash, so Ref.from would be\n // bogus for it anyway.)\n if (!depId.version || !isSnap(depId.version)) return;\n if (checkedHashes.has(depId.version)) return;\n checkedHashes.add(depId.version);\n candidateRefs.push(Ref.from(depId.version));\n });\n });\n // hasMultiple bounds the I/O concurrency, unlike a Promise.all of has() calls\n const existingRefs = await legacyScope.objects.hasMultiple(candidateRefs);\n const existingHashes = new Set(existingRefs.map((ref) => ref.toString()));\n const missingHashes = candidateRefs.map((ref) => ref.toString()).filter((hash) => !existingHashes.has(hash));\n if (!missingHashes.length) return;\n this.logger.debug(\n `importMissingReferencedDeps, importing ${missingHashes.length} non-head dependency snaps referenced by the merged heads from ${otherLane.scope}`\n );\n // fetch the raw objects only (by hash, from the lane scope). importManyObjects does not touch\n // component models/heads, so it can't leave a component pointing at a version whose object is\n // missing — unlike a component-level import.\n await legacyScope.scopeImporter.importManyObjects({ [otherLane.scope]: missingHashes });\n // a Version object references other objects the export must ship along with it — the file\n // sources and the flattened-edges/dependencies-graph. fetch the missing ones too. (parents are\n // not needed — the export doesn't collect them for these versions. artifacts are not needed\n // either — the export tolerates missing artifacts for such non-local versions.)\n const subRefs: Ref[] = [];\n await pMapSeries(missingHashes, async (hash) => {\n const versionObject = (await legacyScope.objects.load(Ref.from(hash))) as Version | null;\n if (!versionObject) return; // the hash could not be fetched after all\n versionObject.refsWithOptions(false, false).forEach((ref) => {\n if (checkedHashes.has(ref.toString())) return;\n checkedHashes.add(ref.toString());\n subRefs.push(ref);\n });\n });\n const existingSubRefs = new Set((await legacyScope.objects.hasMultiple(subRefs)).map((ref) => ref.toString()));\n const missingSubRefs = subRefs.map((ref) => ref.toString()).filter((hash) => !existingSubRefs.has(hash));\n if (!missingSubRefs.length) return;\n await legacyScope.scopeImporter.importManyObjects({ [otherLane.scope]: missingSubRefs });\n }\n\n private validateMergeFlags(otherLaneId: LaneId, currentLaneId: LaneId, options: MergeLaneOptions) {\n const { tag, resolveUnrelated, detachHead } = 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 && !currentLaneId.isDefault()) {\n throw new BitError(`unable to detach head. the current lane is not main`);\n }\n }\n\n private async resolveMergeContext(otherLaneId: LaneId, currentLaneId: LaneId, options: Partial<MergeLaneOptions>) {\n const { skipFetch, excludeNonLaneComps, shouldIncludeUpdateDependents, fetchCurrent } = 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 // pass `shouldIncludeUpdateDependents` so the prefetch covers main objects for the\n // lane's hidden entries too — the per-component merge engine needs main-side Version\n // objects locally to compute divergence against the hidden cascade snaps.\n const ids = await this.getMainIdsToMerge(currentLane, !excludeNonLaneComps, shouldIncludeUpdateDependents);\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 // note: fetching always includes the lane's hidden updateDependents (and routes them to the\n // lane's scope); `shouldIncludeUpdateDependents` still governs whether they take part in the\n // merge itself, via `idsToMerge` below.\n const otherLane = await this.lanes.fetchLaneWithItsComponents(otherLaneId);\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(otherLaneId, currentLaneId, options);\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 const configData = configMergeResults.find((co) => co.compIdStr === c.id.toStringWithoutVersion());\n const configConflict = configData?.generateMergeConflictFile() || undefined;\n conflicts.push({ id: c.id, files: files.map((f) => f.filePath), config, configConflict });\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 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 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.getCompHeadIncludeUpdateDependents(compId) : 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.getCompHeadIncludeUpdateDependents(compId) : 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 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 // diverged + --squash: skip the parent-rewrite path here. the merge snap will be created\n // by snapForMerge with a single parent (and squashed metadata) because the corresponding\n // UnmergedComponent entry has `shouldSquash: true`. see snapping.main.runtime.ts.\n return false;\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;AAEA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,MAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,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N,kBAAkB,CAACoB,eAAe,CAAC3M,cAAc,CAACtC,IAAI,CAAC;QACvD;MACF;IACF;IACA;IACA6N,kBAAkB,CAACiB,OAAO,CAACjR,OAAO,CAAEyF,GAAG,IAAKuK,kBAAkB,CAACqB,YAAY,CAAC5L,GAAG,CAAC,CAAC;EACnF,CAAC;EAED,MAAM0L,QAAQ,CAAC,CAAC;EAEhB,MAAMG,YAAY,GAAG,MAAMV,eAAe,CAAC,CAAC;EAC5CZ,kBAAkB,CAACuB,WAAW,CAAC;IAAEC,eAAe,EAAER,cAAc;IAAEpG,MAAM,EAAEtN;EAAY,CAAC,EAAEwS,GAAG,EAAEwB,YAAY,CAAC;EAC3G,OAAOtB,kBAAkB;AAC3B;AAEAnE,8BAAgB,CAAC4F,UAAU,CAACrV,cAAc,CAAC;AAAC,IAAAsV,QAAA,GAAAnF,OAAA,CAAAtR,OAAA,GAE7BmB,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_bitError","data","require","_path","_interopRequireDefault","_cli","_importer","_lanes","_merging","_componentModules","_workspace","_configStore","_harmonyModules","_componentId","_objects","_componentVersion","_pMapSeries","_scope","_laneId","_logger","_checkout","_remove","_lodash","_export","_mergeLanes","_mergeLane","_missingCompsToMerge","_mergeAbort","_lastMerged","_mergeMove","_express","_lanesCheckConflicts","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","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","shouldIncludeUpdateDependents","undefined","mergeLane","validateMergeFlags","currentLane","otherLane","laneToFetchArtifactsFrom","idsToMerge","resolveMergeContext","mergeStrategy","noAutoSnap","noSnap","tag","snapMessage","existingOnWorkspaceOnly","build","loose","keepReadme","squash","noSquash","pattern","includeDeps","skipDependencyInstallation","resolveUnrelated","ignoreConfigChanges","throwIfNotUpToDate","detachHead","legacyScope","debug","toString","shouldSquash","isDefault","allComponentsStatus","getMergeStatus","handleTargetAheadAsDiverged","shouldMergeAspectsData","componentIds","compIdsFromPattern","filterIdsFromPoolIdsByPattern","filterComponentsStatus","forEach","bitId","find","c","id","isEqualWithoutVersion","push","unchangedLegitimately","unchangedMessage","workspaceIds","listIds","filter","throwForFailures","succeededComponents","squashSnaps","messageTitle","ids","map","importHeadArtifactsFromLane","lastMerged","LastMerged","snapshot","takeSnapshot","mergeResults","mergeSnaps","persistSnapshot","mergedSuccessfully","failedComponents","length","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","keys","filesStatus","f","FileStatus","manual","binaryConflict","config","includes","toStringWithoutVersion","snappedId","searchWithoutVersion","importMissingReferencedDeps","onDestroy","name","checkedHashes","Set","candidateRefs","pMapSeries","modelComponent","getModelComponentIfExist","headVersion","loadVersion","objects","getAllFlattenedDependencies","depId","version","isSnap","has","add","Ref","from","existingRefs","hasMultiple","existingHashes","ref","missingHashes","scopeImporter","importManyObjects","subRefs","versionObject","load","refsWithOptions","existingSubRefs","missingSubRefs","isEqual","skipFetch","excludeNonLaneComps","fetchCurrent","fetchLaneWithItsComponents","loadLane","isDefaultLane","getMainIdsToMerge","compIdList","toVersionLatest","importObjectsFromMainIfExist","getOtherLane","lane","shouldFetch","isNew","getBitIds","resolveMainHeadsFromRemote","idsWithHead","Promise","all","getHeadOnMain","modelComponents","getModelComponent","toComponentId","Error","toComponentIdsIncludeUpdateDependents","toComponentIds","checkLaneForConflicts","sourceLaneIdStr","targetLaneIdStr","parseLaneIdFromString","modifiedFiles","conflict","isBinaryConflict","configData","co","configConflict","generateMergeConflictFile","filePath","mergeMove","newLaneName","OutsideWorkspaceError","lastMerge","restoreLaneObjectFromLastMerged","newLaneResult","createLane","abortLaneMerge","checkoutProps","mergeAbortOpts","getCurrentLane","compDirsToRemove","restoreFromLastMerged","_reloadConsumer","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","fromLaneId","toLaneId","status","diffStatus","skipChanges","compsNotUpToDate","componentsStatus","s","upToDate","componentId","provider","cli","loggerMain","configStore","express","createLogger","MergeLanesAspect","lanesCommand","getCommand","mergeLanesMain","commands","MergeLaneCmd","MergeAbortLaneCmd","MergeMoveLaneCmd","register","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","compId","fromStatus","divergeData","targetVersions","snapsOnTargetOnly","headOnTarget","getCompHeadIncludeUpdateDependents","toImport","v","flat","importWithoutDeps","cache","includeVersionHistory","reason","remoteVersion","versionObj","flattenedDeps","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","depsOnLaneStr","MissingCompsToMerge","uniq","depsWithoutVersion","d","depsUniqWithoutVersion","uniqFromArray","opts","currentLaneName","log","getLogForSquash","componentFromModel","modifiedComp","squashOneComp","versionHistory","updateRebasedVersionHistory","isDiverged","isSourceAhead","isTargetAhead","remoteSnaps","getAllMessages","versionObjects","message","getFinalMessage","allMessage","allMessageStr","m","currentParents","parents","commonSnapBeforeDiverge","doSquash","addAsOnlyParent","removeParent","finalMessage","setSquashed","previousParents","addRuntime","_default"],"sources":["merge-lanes.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport path from 'path';\nimport type { CLIMain } from '@teambit/cli';\nimport { CLIAspect, MainRuntime } from '@teambit/cli';\nimport type { ImporterMain } from '@teambit/importer';\nimport { ImporterAspect } from '@teambit/importer';\nimport type { LanesMain } from '@teambit/lanes';\nimport { LanesAspect } from '@teambit/lanes';\nimport type { MergingMain, ComponentMergeStatus } from '@teambit/merging';\nimport type { ApplyVersionResults, MergeStrategy } from '@teambit/component.modules.merge-helper';\nimport { MergingAspect } from '@teambit/merging';\nimport { FileStatus } from '@teambit/component.modules.merge-helper';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect, OutsideWorkspaceError } from '@teambit/workspace';\nimport type { ConfigStoreMain } from '@teambit/config-store';\nimport { ConfigStoreAspect } from '@teambit/config-store';\nimport { getLogForSquash } from '@teambit/harmony.modules.get-basic-log';\nimport type { ComponentID } from '@teambit/component-id';\nimport { ComponentIdList } from '@teambit/component-id';\nimport type { Lane, Version, Log } from '@teambit/objects';\nimport { Ref } from '@teambit/objects';\nimport { isSnap } from '@teambit/component-version';\nimport pMapSeries from 'p-map-series';\nimport type { Scope as LegacyScope } from '@teambit/legacy.scope';\nimport type { ScopeMain } from '@teambit/scope';\nimport { ScopeAspect } from '@teambit/scope';\nimport type { LaneId } from '@teambit/lane-id';\nimport { DEFAULT_LANE } from '@teambit/lane-id';\nimport type { ConfigMergeResult } from '@teambit/config-merger';\nimport type { Logger, LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { CheckoutMain, CheckoutProps } from '@teambit/checkout';\nimport { CheckoutAspect, throwForFailures } from '@teambit/checkout';\nimport type { SnapsDistance } from '@teambit/component.snap-distance';\nimport type { RemoveMain } from '@teambit/remove';\nimport { RemoveAspect } from '@teambit/remove';\nimport { compact, uniq } from 'lodash';\nimport type { ExportMain } from '@teambit/export';\nimport { ExportAspect } from '@teambit/export';\nimport { MergeLanesAspect } from './merge-lanes.aspect';\nimport { MergeLaneCmd } from './merge-lane.cmd';\nimport { MissingCompsToMerge } from './exceptions/missing-comps-to-merge';\nimport type { MergeAbortOpts } from './merge-abort.cmd';\nimport { MergeAbortLaneCmd } from './merge-abort.cmd';\nimport { LastMerged } from './last-merged';\nimport { MergeMoveLaneCmd } from './merge-move.cmd';\nimport type { ExpressMain } from '@teambit/express';\nimport { ExpressAspect } 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 loose?: boolean; // relevant for --build, to allow build to succeed even if tasks like tests or lint fail\n // opt in to resolving each component's head on main from the REMOTE scope (via getHeadOnMain) when\n // merging from main, so a base that lives only on the remote is still merged. off by default: the\n // merge resolves heads from the local scope only (matches the historical behavior), so this remote\n // round-trip is paid solely by callers that explicitly need it, not every merge-from-main consumer.\n resolveMainHeadsFromRemote?: boolean;\n};\nexport type ConflictPerId = { id: ComponentID; files: string[]; config?: boolean; configConflict?: string };\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 // Hidden lane updateDependents must participate in every merge — otherwise main→lane refresh\n // (`bit lane merge main`) leaves the lane's cascaded entries stuck on their old main-head\n // base, and lane→main merge would push a partially-consistent lane state. The bare-scope\n // counterpart (`bit _merge-lane`, used by Ripple / the UI's \"update lane\" button) already\n // sets this; the workspace path was the missing leg.\n if (options.shouldIncludeUpdateDependents === undefined) {\n options.shouldIncludeUpdateDependents = true;\n }\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 loose,\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 loose,\n shouldSquash,\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 // A merged head may reference — via its flattened dependencies — a non-head snap of another\n // component. When merging to main the squash removes intermediate snaps from each component's own\n // chain, and a bare-scope merge (`bit _merge-lane --push`) exports heads only; in both cases such a\n // referenced snap wouldn't be exported, and on lean lanes it lives only on the lane scope. Import\n // any missing one now so the export can ship it (otherwise the remote's dependency-integrity check\n // would reject the push). Not needed for non-squash workspace merges, which export full history.\n if (shouldSquash || !this.workspace) {\n await this.importMissingReferencedDeps(mergedSuccessfullyIds, otherLane);\n }\n\n await this.workspace?.consumer.onDestroy(`lane-merge (${otherLaneId.name})`);\n\n return { mergeResults, deleteResults, configMergeResults, mergedSuccessfullyIds, conflicts };\n }\n\n /**\n * A merged component head may reference, via its flattened dependencies, a non-head snap of another\n * component — e.g. a deleted component that keeps pinning an older snap of a dependency that has\n * since advanced. On lean lanes those snaps live only on the lane scope and are not fetched by the\n * merge, so the heads-only export (used by `bit _merge-lane --push`) would leave them out and the\n * remote's dependency-integrity check would fail. Import any such missing snap from the lane scope.\n */\n private async importMissingReferencedDeps(ids: ComponentID[], otherLane?: Lane) {\n // the missing snaps live on the lane scope (lean lanes). without the source lane we don't know\n // where to fetch them from, so there's nothing to do.\n if (!otherLane) return;\n const legacyScope = this.scope.legacyScope;\n // one existence check per unique hash — the same snap appears in the flattened list of many heads\n const checkedHashes = new Set<string>();\n const candidateRefs: Ref[] = [];\n await pMapSeries(ids, async (id) => {\n // strip the version — a versioned lookup (sources.get) returns undefined when that Version\n // object is missing locally, and only the model is needed here anyway (for its head).\n const modelComponent = await legacyScope.getModelComponentIfExist(id.changeVersion(undefined));\n const head = modelComponent?.head;\n if (!modelComponent || !head) return;\n const headVersion = await modelComponent.loadVersion(head.toString(), legacyScope.objects, false);\n if (!headVersion) return;\n // flattened (not only direct) to mirror the remote-side check, which validates the flattened\n // dependencies of every exported head (see throwForMissingLocalDependencies). cheap: only the\n // heads are loaded and each unique hash is stat-ed once.\n headVersion.getAllFlattenedDependencies().forEach((depId) => {\n // the remote check validates only same-scope deps (it skips `depId.scope !== scope.name`,\n // cross-scope deps are fetched later by the remote itself), so same-scope is all the export\n // needs to ship. this also filters out the vast majority of the flattened list.\n if (depId.scope !== id.scope) return;\n // only snaps can go missing this way — tags live on the home scope and are never squashed\n // off a lane. (a tag version is a semver string, not an object hash, so Ref.from would be\n // bogus for it anyway.)\n if (!depId.version || !isSnap(depId.version)) return;\n if (checkedHashes.has(depId.version)) return;\n checkedHashes.add(depId.version);\n candidateRefs.push(Ref.from(depId.version));\n });\n });\n // hasMultiple bounds the I/O concurrency, unlike a Promise.all of has() calls\n const existingRefs = await legacyScope.objects.hasMultiple(candidateRefs);\n const existingHashes = new Set(existingRefs.map((ref) => ref.toString()));\n const missingHashes = candidateRefs.map((ref) => ref.toString()).filter((hash) => !existingHashes.has(hash));\n if (!missingHashes.length) return;\n this.logger.debug(\n `importMissingReferencedDeps, importing ${missingHashes.length} non-head dependency snaps referenced by the merged heads from ${otherLane.scope}`\n );\n // fetch the raw objects only (by hash, from the lane scope). importManyObjects does not touch\n // component models/heads, so it can't leave a component pointing at a version whose object is\n // missing — unlike a component-level import.\n await legacyScope.scopeImporter.importManyObjects({ [otherLane.scope]: missingHashes });\n // a Version object references other objects the export must ship along with it — the file\n // sources and the flattened-edges/dependencies-graph. fetch the missing ones too. (parents are\n // not needed — the export doesn't collect them for these versions. artifacts are not needed\n // either — the export tolerates missing artifacts for such non-local versions.)\n const subRefs: Ref[] = [];\n await pMapSeries(missingHashes, async (hash) => {\n const versionObject = (await legacyScope.objects.load(Ref.from(hash))) as Version | null;\n if (!versionObject) return; // the hash could not be fetched after all\n versionObject.refsWithOptions(false, false).forEach((ref) => {\n if (checkedHashes.has(ref.toString())) return;\n checkedHashes.add(ref.toString());\n subRefs.push(ref);\n });\n });\n const existingSubRefs = new Set((await legacyScope.objects.hasMultiple(subRefs)).map((ref) => ref.toString()));\n const missingSubRefs = subRefs.map((ref) => ref.toString()).filter((hash) => !existingSubRefs.has(hash));\n if (!missingSubRefs.length) return;\n await legacyScope.scopeImporter.importManyObjects({ [otherLane.scope]: missingSubRefs });\n }\n\n private validateMergeFlags(otherLaneId: LaneId, currentLaneId: LaneId, options: MergeLaneOptions) {\n const { tag, resolveUnrelated, detachHead } = 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 && !currentLaneId.isDefault()) {\n throw new BitError(`unable to detach head. the current lane is not main`);\n }\n }\n\n private async resolveMergeContext(otherLaneId: LaneId, currentLaneId: LaneId, options: Partial<MergeLaneOptions>) {\n const { skipFetch, excludeNonLaneComps, shouldIncludeUpdateDependents, fetchCurrent } = 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 // pass `shouldIncludeUpdateDependents` so the prefetch covers main objects for the\n // lane's hidden entries too — the per-component merge engine needs main-side Version\n // objects locally to compute divergence against the hidden cascade snaps.\n const ids = await this.getMainIdsToMerge(currentLane, !excludeNonLaneComps, shouldIncludeUpdateDependents);\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 // note: fetching always includes the lane's hidden updateDependents (and routes them to the\n // lane's scope); `shouldIncludeUpdateDependents` still governs whether they take part in the\n // merge itself, via `idsToMerge` below.\n const otherLane = await this.lanes.fetchLaneWithItsComponents(otherLaneId);\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 if (options.resolveMainHeadsFromRemote) {\n // opt-in: resolve each head on main falling back to the remote scope, so a base that lives on\n // the remote but wasn't fetched locally is still included instead of being skipped. a component\n // with no head on main at all is genuinely new and dropped.\n const idsWithHead = await Promise.all(\n ids.map(async (id) => {\n const head = await this.lanes.getHeadOnMain(id);\n return head ? id.changeVersion(head) : null;\n })\n );\n return compact(idsWithHead);\n }\n // default: resolve heads from the local scope only (historical behavior). a component not in the\n // local scope throws, and one with no local head was never merged to main and is dropped.\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(otherLaneId, currentLaneId, options);\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 const configData = configMergeResults.find((co) => co.compIdStr === c.id.toStringWithoutVersion());\n const configConflict = configData?.generateMergeConflictFile() || undefined;\n conflicts.push({ id: c.id, files: files.map((f) => f.filePath), config, configConflict });\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 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 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.getCompHeadIncludeUpdateDependents(compId) : 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.getCompHeadIncludeUpdateDependents(compId) : 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 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 // diverged + --squash: skip the parent-rewrite path here. the merge snap will be created\n // by snapForMerge with a single parent (and squashed metadata) because the corresponding\n // UnmergedComponent entry has `shouldSquash: true`. see snapping.main.runtime.ts.\n return false;\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;AAEA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,UAAA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/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/merge-lanes",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1101",
|
|
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.
|
|
9
|
+
"version": "1.0.1101"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "4.1.2",
|
|
@@ -20,33 +20,33 @@
|
|
|
20
20
|
"@teambit/component-id": "1.2.4",
|
|
21
21
|
"@teambit/component-version": "1.0.4",
|
|
22
22
|
"@teambit/lane-id": "0.0.312",
|
|
23
|
-
"@teambit/express": "0.0.
|
|
24
|
-
"@teambit/logger": "0.0.
|
|
25
|
-
"@teambit/legacy.bit-map": "0.0.
|
|
26
|
-
"@teambit/legacy.consumer": "0.0.
|
|
27
|
-
"@teambit/legacy.scope": "0.0.
|
|
28
|
-
"@teambit/objects": "0.0.
|
|
29
|
-
"@teambit/scope": "1.0.
|
|
30
|
-
"@teambit/checkout": "1.0.
|
|
31
|
-
"@teambit/cli": "0.0.
|
|
32
|
-
"@teambit/component.modules.merge-helper": "0.0.
|
|
33
|
-
"@teambit/config-store": "0.0.
|
|
34
|
-
"@teambit/legacy.constants": "0.0.
|
|
35
|
-
"@teambit/merging": "1.0.
|
|
36
|
-
"@teambit/remove": "1.0.
|
|
37
|
-
"@teambit/component.snap-distance": "0.0.
|
|
38
|
-
"@teambit/config-merger": "0.0.
|
|
39
|
-
"@teambit/export": "1.0.
|
|
40
|
-
"@teambit/harmony.modules.get-basic-log": "0.0.
|
|
41
|
-
"@teambit/importer": "1.0.
|
|
42
|
-
"@teambit/lanes": "1.0.
|
|
43
|
-
"@teambit/workspace": "1.0.
|
|
23
|
+
"@teambit/express": "0.0.1457",
|
|
24
|
+
"@teambit/logger": "0.0.1451",
|
|
25
|
+
"@teambit/legacy.bit-map": "0.0.198",
|
|
26
|
+
"@teambit/legacy.consumer": "0.0.141",
|
|
27
|
+
"@teambit/legacy.scope": "0.0.141",
|
|
28
|
+
"@teambit/objects": "0.0.588",
|
|
29
|
+
"@teambit/scope": "1.0.1081",
|
|
30
|
+
"@teambit/checkout": "1.0.1082",
|
|
31
|
+
"@teambit/cli": "0.0.1358",
|
|
32
|
+
"@teambit/component.modules.merge-helper": "0.0.84",
|
|
33
|
+
"@teambit/config-store": "0.0.239",
|
|
34
|
+
"@teambit/legacy.constants": "0.0.38",
|
|
35
|
+
"@teambit/merging": "1.0.1084",
|
|
36
|
+
"@teambit/remove": "1.0.1081",
|
|
37
|
+
"@teambit/component.snap-distance": "0.0.142",
|
|
38
|
+
"@teambit/config-merger": "0.0.948",
|
|
39
|
+
"@teambit/export": "1.0.1081",
|
|
40
|
+
"@teambit/harmony.modules.get-basic-log": "0.0.142",
|
|
41
|
+
"@teambit/importer": "1.0.1081",
|
|
42
|
+
"@teambit/lanes": "1.0.1101",
|
|
43
|
+
"@teambit/workspace": "1.0.1081"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/fs-extra": "9.0.7",
|
|
47
47
|
"@types/lodash": "4.14.165",
|
|
48
48
|
"@types/mocha": "9.1.0",
|
|
49
|
-
"@teambit/harmony.envs.core-aspect-env": "2.0.
|
|
49
|
+
"@teambit/harmony.envs.core-aspect-env": "2.0.3"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {},
|
|
52
52
|
"license": "Apache-2.0",
|
|
File without changes
|