@teambit/merge-lanes 0.0.176 → 0.0.178

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.
@@ -93,6 +93,13 @@ function _laneId() {
93
93
  };
94
94
  return data;
95
95
  }
96
+ function _artifactFiles() {
97
+ const data = require("@teambit/legacy/dist/consumer/component/sources/artifact-files");
98
+ _artifactFiles = function () {
99
+ return data;
100
+ };
101
+ return data;
102
+ }
96
103
  function _logger() {
97
104
  const data = require("@teambit/logger");
98
105
  _logger = function () {
@@ -201,7 +208,20 @@ class MergeLanesMain {
201
208
  const shouldFetch = !lane || !skipFetch && !lane.isNew;
202
209
  if (shouldFetch) {
203
210
  // 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.
204
- await this.lanes.fetchLaneWithItsComponents(otherLaneId);
211
+ const otherLane = await this.lanes.fetchLaneWithItsComponents(otherLaneId);
212
+
213
+ // get all artifacts
214
+ const allIds = otherLane.toBitIds();
215
+ const laneComps = await consumer.scope.getManyConsumerComponents(allIds);
216
+ const allRefs = laneComps.map(comp => (0, _artifactFiles().getRefsFromExtensions)(comp.extensions)).flat();
217
+ const allRefsUniq = (0, _lodash().uniq)(allRefs.map(r => r.toString()));
218
+ try {
219
+ await consumer.scope.scopeImporter.importManyObjects({
220
+ [otherLaneId.scope]: allRefsUniq
221
+ });
222
+ } catch (err) {
223
+ this.logger.error(`failed fetching artifacts for lane ${otherLaneId.toString()}`, err);
224
+ }
205
225
  lane = await consumer.scope.loadLane(otherLaneId);
206
226
  }
207
227
  return lane;
@@ -1 +1 @@
1
- {"version":3,"names":["MergeLanesMain","constructor","workspace","merging","lanes","logger","remove","scope","exporter","mergeLane","laneName","options","BitError","consumer","mergeStrategy","noSnap","tag","snapMessage","existingOnWorkspaceOnly","build","keepReadme","noSquash","pattern","includeDeps","skipDependencyInstallation","resolveUnrelated","ignoreConfigChanges","skipFetch","currentLaneId","getCurrentLaneId","isDefault","toString","otherLaneId","getParsedLaneId","isEqual","currentLane","loadLane","isDefaultLane","getOtherLane","importer","importObjectsFromMainIfExist","toBitIds","toVersionLatest","undefined","lane","shouldFetch","isNew","fetchLaneWithItsComponents","otherLane","getBitIds","Error","DEFAULT_LANE","getMainIdsToMerge","bitIds","debug","allComponentsStatus","getMergeStatus","shouldSquash","componentIds","resolveMultipleComponentIds","compIdsFromPattern","filterIdsFromPoolIdsByPattern","filterComponentsStatus","forEach","bitId","find","c","id","isEqualWithoutVersion","push","unmergedLegitimately","unmergedMessage","workspaceIds","listIds","filter","_legacy","throwForFailures","squashSnaps","mergeResults","mergeSnaps","laneId","localLane","mergedSuccessfully","failedComponents","length","every","failedComponent","unchangedLegitimately","deleteResults","readmeComponent","readmeComponentId","changeVersion","head","hash","componentsPattern","force","remote","track","deleteFiles","fromLane","readmeResult","name","configMergeResults","map","configMergeResult","onDestroy","compact","failureMsgs","chalk","bold","red","join","laneIds","mainNotOnLane","ids","hasScope","modelComponents","Promise","all","legacyScope","getModelComponent","toBitId","mergeFromScope","toLane","fromLaneId","LaneId","parse","fromLaneObj","importLaneObject","toLaneId","getDefaultLaneId","toLaneObj","fromLaneBitIds","getIdsToMerge","laneCompIds","BitIds","fromArray","idsToMerge","scopeComponentsImporter","ScopeComponentsImporter","getInstance","importManyDeltaWithoutDeps","fromHead","ignoreMissingHead","throwIfNotUpToDate","repo","objects","mergedPreviously","mergedNow","bitObjectsPerComp","pMapSeries","modelComponent","fromVersionObj","loadVersion","version","isRemoved","fromLaneHead","getRef","toLaneHead","getComponent","divergeData","getDivergeData","sourceHead","targetHead","modifiedVersion","squashOneComp","addComponent","setHead","bitObjects","b","bitObjectsFlat","flat","writeObjectsToTheFS","exportedIds","exported","exportMany","idsWithFutureScope","laneObject","allVersions","exportHeadsOnly","status","diffStatus","skipChanges","compsNotUpToDate","componentsStatus","s","upToDate","componentId","provider","cli","loggerMain","createLogger","MergeLanesAspect","lanesCommand","getCommand","mergeLanesMain","commands","MergeLaneCmd","register","MergeLaneFromScopeCmd","LanesAspect","CLIAspect","WorkspaceAspect","MergingAspect","LoggerAspect","RemoveAspect","ScopeAspect","ExportAspect","MainRuntime","compIdsToKeep","allBitIds","bitIdsFromPattern","bitIdsNotFromPattern","hasWithoutVersion","filteredComponentStatus","depsToAdd","compId","fromStatus","targetVersions","snapsOnTargetOnly","headOnTarget","remoteVersion","versionObj","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","d","depsUniq","uniqFromArray","currentLaneName","succeededComponents","componentFromModel","modifiedComp","add","versionHistory","updateRebasedVersionHistory","isDiverged","isSourceAhead","isTargetAhead","remoteSnaps","currentParents","parents","commonSnapBeforeDiverge","addAsOnlyParent","ref","removeParent","setSquashed","previousParents","addRuntime"],"sources":["merge-lanes.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { LanesAspect, LanesMain } from '@teambit/lanes';\nimport MergingAspect, {\n MergingMain,\n ComponentMergeStatus,\n ConfigMergeResult,\n ApplyVersionResults,\n} from '@teambit/merging';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport chalk from 'chalk';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport pMapSeries from 'p-map-series';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport { ComponentID } from '@teambit/component-id';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { Lane, Version } from '@teambit/legacy/dist/scope/models';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { compact } from 'lodash';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { BitObject } from '@teambit/legacy/dist/scope/objects';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { MergeLanesAspect } from './merge-lanes.aspect';\nimport { MergeLaneCmd } from './merge-lane.cmd';\nimport { MergeLaneFromScopeCmd } from './merge-lane-from-scope.cmd';\n\nexport type MergeLaneOptions = {\n mergeStrategy: MergeStrategy;\n noSnap: boolean;\n snapMessage: string;\n existingOnWorkspaceOnly: boolean;\n build: boolean;\n keepReadme: 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};\n\nexport class MergeLanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private merging: MergingMain,\n private lanes: LanesMain,\n private logger: Logger,\n private remove: RemoveMain,\n private scope: ScopeMain,\n private exporter: ExportMain\n ) {}\n\n async mergeLane(\n laneName: string,\n options: MergeLaneOptions\n ): Promise<{ mergeResults: ApplyVersionResults; deleteResults: any; configMergeResults: ConfigMergeResult[] }> {\n if (!this.workspace) {\n throw new BitError(`unable to merge a lane outside of Bit workspace`);\n }\n const consumer = this.workspace.consumer;\n\n const {\n mergeStrategy,\n noSnap,\n tag,\n snapMessage,\n existingOnWorkspaceOnly,\n build,\n keepReadme,\n noSquash,\n pattern,\n includeDeps,\n skipDependencyInstallation,\n resolveUnrelated,\n ignoreConfigChanges,\n skipFetch,\n } = options;\n\n const currentLaneId = consumer.getCurrentLaneId();\n if (tag && !currentLaneId.isDefault()) {\n throw new BitError(`--tag only possible when on main. currently checked out to ${currentLaneId.toString()}`);\n }\n const otherLaneId = await consumer.getParsedLaneId(laneName);\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 const currentLane = currentLaneId.isDefault() ? null : await consumer.scope.loadLane(currentLaneId);\n const isDefaultLane = otherLaneId.isDefault();\n const getOtherLane = async () => {\n if (isDefaultLane) {\n if (!skipFetch) {\n await this.lanes.importer.importObjectsFromMainIfExist(currentLane?.toBitIds().toVersionLatest() || []);\n }\n return undefined;\n }\n let lane = await consumer.scope.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 await this.lanes.fetchLaneWithItsComponents(otherLaneId);\n lane = await consumer.scope.loadLane(otherLaneId);\n }\n return lane;\n };\n const otherLane = await getOtherLane();\n const getBitIds = async () => {\n if (isDefaultLane) {\n if (!currentLane) throw new Error(`unable to merge ${DEFAULT_LANE}, the current lane was not found`);\n return this.getMainIdsToMerge(currentLane);\n }\n if (!otherLane) throw new Error(`lane must be defined for non-default`);\n return otherLane.toBitIds();\n };\n const bitIds = await getBitIds();\n this.logger.debug(`merging the following bitIds: ${bitIds.toString()}`);\n\n let allComponentsStatus = await this.merging.getMergeStatus(bitIds, currentLane, otherLane, {\n resolveUnrelated,\n ignoreConfigChanges,\n });\n const shouldSquash = currentLaneId.isDefault() && !noSquash;\n\n if (pattern) {\n const componentIds = await this.workspace.resolveMultipleComponentIds(bitIds);\n const compIdsFromPattern = this.workspace.scope.filterIdsFromPoolIdsByPattern(pattern, componentIds);\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n bitIds,\n this.workspace,\n includeDeps,\n otherLane || undefined,\n shouldSquash\n );\n bitIds.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unmergedLegitimately: true, unmergedMessage: `excluded by pattern` });\n }\n });\n }\n if (existingOnWorkspaceOnly) {\n const workspaceIds = await this.workspace.listIds();\n const compIdsFromPattern = workspaceIds.filter((id) =>\n allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id._legacy))\n );\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n bitIds,\n this.workspace,\n includeDeps,\n otherLane || undefined,\n shouldSquash\n );\n bitIds.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unmergedLegitimately: true, unmergedMessage: `not in the workspace` });\n }\n });\n }\n\n throwForFailures();\n\n if (shouldSquash) {\n await squashSnaps(allComponentsStatus, otherLaneId, consumer);\n }\n\n const mergeResults = await this.merging.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n laneId: otherLaneId,\n localLane: currentLane,\n noSnap,\n tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n });\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\n .changeVersion(otherLane.readmeComponent?.head?.hash)\n .toString();\n\n deleteResults = await this.remove.remove({\n componentsPattern: readmeComponentId,\n force: false,\n remote: false,\n track: false,\n deleteFiles: true,\n fromLane: false,\n });\n } else if (otherLane && !otherLane.readmeComponent) {\n deleteResults = { readmeResult: `\\nlane ${otherLane.name} doesn't have a readme component` };\n }\n const configMergeResults = allComponentsStatus.map((c) => c.configMergeResult);\n\n await this.workspace.consumer.onDestroy();\n\n return { mergeResults, deleteResults, configMergeResults: compact(configMergeResults) };\n\n function throwForFailures() {\n const failedComponents = allComponentsStatus.filter((c) => c.unmergedMessage && !c.unmergedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unmergedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to merge due to the following failures:\\n${failureMsgs}`);\n }\n }\n }\n\n private async getMainIdsToMerge(lane: Lane) {\n const laneIds = lane.toBitIds();\n if (!this.workspace) {\n throw new BitError(`getMainIdsToMerge needs workspace`);\n }\n const workspaceIds = (await this.workspace.listIds()).map((id) => id._legacy);\n const mainNotOnLane = workspaceIds.filter((id) => !laneIds.find((laneId) => laneId.isEqualWithoutVersion(id)));\n const ids = [...laneIds, ...mainNotOnLane].filter((id) => id.hasScope());\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.toBitId().changeVersion(c.head.toString());\n })\n );\n }\n\n async mergeFromScope(\n fromLane: string,\n toLane: string,\n options: Partial<MergeLaneOptions> & { push?: boolean }\n ): Promise<{\n mergedPreviously: string[];\n mergedNow: string[];\n exportedIds: string[];\n }> {\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 = LaneId.parse(fromLane);\n const fromLaneObj = await this.lanes.importLaneObject(fromLaneId);\n const toLaneId = toLane === DEFAULT_LANE ? this.lanes.getDefaultLaneId() : LaneId.parse(toLane);\n const toLaneObj = toLaneId.isDefault() ? undefined : await this.lanes.importLaneObject(toLaneId);\n const fromLaneBitIds = fromLaneObj.toBitIds();\n const getIdsToMerge = async (): Promise<BitIds> => {\n if (!options.pattern) return fromLaneBitIds;\n const laneCompIds = await this.scope.resolveMultipleComponentIds(fromLaneBitIds);\n const ids = this.scope.filterIdsFromPoolIdsByPattern(options.pattern, laneCompIds);\n return BitIds.fromArray(ids.map((id) => id._legacy));\n };\n const idsToMerge = await getIdsToMerge();\n const scopeComponentsImporter = ScopeComponentsImporter.getInstance(this.scope.legacyScope);\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids: idsToMerge,\n fromHead: true,\n lane: fromLaneObj,\n ignoreMissingHead: true,\n });\n // get their main/to-lane as well\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids: idsToMerge.toVersionLatest(),\n fromHead: true,\n ignoreMissingHead: true,\n lane: toLaneObj,\n });\n await this.throwIfNotUpToDate(fromLaneId, toLaneId);\n const repo = this.scope.legacyScope.objects;\n // loop through all components, make sure they're all ahead of main (it might not be on main yet).\n // then, change the version object to include an extra parent to point to the main.\n // then, change the component object head to point to this changed version\n const mergedPreviously: BitId[] = [];\n const mergedNow: BitId[] = [];\n const shouldSquash = !toLaneObj && !options.noSquash; // only when merging to main we squash.\n const bitObjectsPerComp = await pMapSeries(idsToMerge, async (id) => {\n const modelComponent = await this.scope.legacyScope.getModelComponent(id);\n const fromVersionObj = await modelComponent.loadVersion(id.version as string, repo);\n if (fromVersionObj.isRemoved()) return undefined;\n const fromLaneHead = modelComponent.getRef(id.version as string);\n if (!fromLaneHead) throw new Error(`lane head must be defined for ${id.toString()}`);\n const toLaneHead = toLaneObj ? toLaneObj.getComponent(id)?.head : modelComponent.head || null;\n if (toLaneHead?.isEqual(fromLaneHead)) {\n mergedPreviously.push(id);\n return undefined;\n }\n // this might be confusing, we pass the toLaneHead as the sourceHead and the fromLaneHead as the targetHead.\n // this is because normally, in the workspace, we merge another lane (target) into the current lane (source).\n // so effectively, in the workspace, we merge fromLane=target into toLane=source.\n const divergeData = await getDivergeData({\n repo,\n modelComponent,\n sourceHead: toLaneHead,\n targetHead: fromLaneHead,\n });\n const modifiedVersion = shouldSquash\n ? squashOneComp(DEFAULT_LANE, fromLaneId, id, divergeData, fromVersionObj)\n : undefined;\n const objects: BitObject[] = [];\n if (modifiedVersion) objects.push(modifiedVersion);\n if (toLaneObj) {\n toLaneObj.addComponent({ id: id.changeVersion(undefined), head: fromLaneHead });\n } else {\n modelComponent.setHead(fromLaneHead);\n objects.push(modelComponent);\n }\n mergedNow.push(id);\n return { id, objects };\n });\n const bitObjects = compact(bitObjectsPerComp).map((b) => b.objects);\n const bitObjectsFlat = bitObjects.flat();\n if (toLaneObj) bitObjectsFlat.push(toLaneObj);\n await repo.writeObjectsToTheFS(bitObjectsFlat);\n let exportedIds: string[] = [];\n if (options.push) {\n const ids = compact(bitObjectsPerComp).map((b) => b.id);\n const bitIds = BitIds.fromArray(ids);\n const { exported } = await this.exporter.exportMany({\n scope: this.scope.legacyScope,\n ids: shouldSquash ? bitIds : new BitIds(),\n idsWithFutureScope: shouldSquash ? bitIds : new BitIds(),\n laneObject: toLaneObj,\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 exportHeadsOnly: shouldSquash,\n });\n exportedIds = exported.map((id) => id.toString());\n }\n\n return {\n mergedPreviously: mergedPreviously.map((id) => id.toString()),\n mergedNow: mergedNow.map((id) => id.toString()),\n exportedIds,\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 ];\n static runtime = MainRuntime;\n\n static async provider([lanes, cli, workspace, merging, loggerMain, remove, scope, exporter]: [\n LanesMain,\n CLIMain,\n Workspace,\n MergingMain,\n LoggerMain,\n RemoveMain,\n ScopeMain,\n ExportMain\n ]) {\n const logger = loggerMain.createLogger(MergeLanesAspect.id);\n const lanesCommand = cli.getCommand('lane');\n const mergeLanesMain = new MergeLanesMain(workspace, merging, lanes, logger, remove, scope, exporter);\n lanesCommand?.commands?.push(new MergeLaneCmd(mergeLanesMain));\n cli.register(new MergeLaneFromScopeCmd(mergeLanesMain));\n return mergeLanesMain;\n }\n}\n\nasync function filterComponentsStatus(\n allComponentsStatus: ComponentMergeStatus[],\n compIdsToKeep: ComponentID[],\n allBitIds: BitId[],\n workspace: Workspace,\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 = BitIds.fromArray(compIdsToKeep.map((c) => c._legacy));\n const bitIdsNotFromPattern = allBitIds.filter((bitId) => !bitIdsFromPattern.hasWithoutVersion(bitId));\n const filteredComponentStatus: ComponentMergeStatus[] = [];\n const depsToAdd: BitId[] = [];\n await pMapSeries(compIdsToKeep, async (compId) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(compId._legacy));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n if (fromStatus.unmergedMessage) {\n return;\n }\n if (!otherLane) {\n // if merging main, no need to check whether the deps are included in the pattern.\n return;\n }\n const { divergeData } = fromStatus;\n if (!divergeData) {\n throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);\n }\n let targetVersions = divergeData.snapsOnTargetOnly;\n if (!targetVersions.length) {\n return;\n }\n const modelComponent = await workspace.consumer.scope.getModelComponent(compId._legacy);\n if (shouldSquash) {\n // no need to check all versions, we merge only the head\n const headOnTarget = otherLane ? otherLane.getComponent(compId._legacy)?.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 await pMapSeries(targetVersions, async (remoteVersion) => {\n const versionObj = await modelComponent.loadVersion(remoteVersion.toString(), workspace.consumer.scope.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: BitId[] = [];\n await Promise.all(\n depsNotIncludeInPattern.map(async (dep) => {\n const isOnLane = await workspace.consumer.scope.isIdOnLane(dep, otherLane);\n if (isOnLane) {\n depsOnLane.push(dep);\n }\n })\n );\n if (!depsOnLane.length) {\n return;\n }\n if (!includeDeps) {\n throw new BitError(`unable to merge ${compId.toString()}.\nit has (in version ${remoteVersion.toString()}) the following dependencies which were not included in the pattern. consider adding \"--include-deps\" flag\n${depsOnLane.map((d) => d.toString()).join('\\n')}`);\n }\n depsToAdd.push(...depsOnLane);\n });\n });\n if (depsToAdd.length) {\n const depsUniq = BitIds.uniqFromArray(depsToAdd);\n depsUniq.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(allComponentsStatus: ComponentMergeStatus[], otherLaneId: LaneId, consumer: Consumer) {\n const currentLaneName = consumer.getCurrentLaneId().name;\n const succeededComponents = allComponentsStatus.filter((c) => !c.unmergedMessage);\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 const modifiedComp = squashOneComp(currentLaneName, otherLaneId, id, divergeData, componentFromModel);\n if (modifiedComp) {\n consumer.scope.objects.add(modifiedComp);\n const modelComponent = await consumer.scope.getModelComponent(id);\n const versionHistory = await modelComponent.updateRebasedVersionHistory(consumer.scope.objects, [modifiedComp]);\n if (versionHistory) consumer.scope.objects.add(versionHistory);\n }\n })\n );\n}\n\n/**\n * returns Version object if it was modified. otherwise, returns undefined\n */\nfunction squashOneComp(\n currentLaneName: string,\n otherLaneId: LaneId,\n id: BitId,\n divergeData: SnapsDistance,\n componentFromModel?: Version\n): Version | undefined {\n if (divergeData.isDiverged()) {\n throw new BitError(`unable to squash because ${id.toString()} is diverged in history.\nconsider switching to \"${\n otherLaneId.name\n }\" first, merging \"${currentLaneName}\", then switching back to \"${currentLaneName}\" and merging \"${\n otherLaneId.name\n }\"\nalternatively, 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 undefined;\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 undefined;\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 // no need to check this case. even if it has only one snap ahead, we want to do the \"squash\", and run \"addAsOnlyParent\"\n // to make sure it doesn't not have two parents.\n // if (remoteSnaps.length === 1) {\n // // nothing to squash. it has only one commit.\n // return;\n // }\n if (!componentFromModel) {\n throw new Error('unable to squash, the componentFromModel is missing');\n }\n\n const currentParents = componentFromModel.parents;\n\n // do the squash.\n if (divergeData.commonSnapBeforeDiverge) {\n componentFromModel.addAsOnlyParent(divergeData.commonSnapBeforeDiverge);\n } else {\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 componentFromModel.setSquashed({ previousParents: currentParents, laneId: otherLaneId });\n return componentFromModel;\n}\n\nMergeLanesAspect.addRuntime(MergeLanesMain);\n\nexport default MergeLanesMain;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAMA;EAAA;EAAA;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AAE;IACvCX,kBAAkB,CAACY,eAAe,CAACvF,WAAW,CAACsF,uBAAuB,CAAC;EACzE,CAAC,MAAM;IACL;IACAX,kBAAkB,CAACU,OAAO,CAACtL,OAAO,CAAEyL,GAAG,IAAKb,kBAAkB,CAACc,YAAY,CAACD,GAAG,CAAC,CAAC;EACnF;EACAb,kBAAkB,CAACe,WAAW,CAAC;IAAEC,eAAe,EAAEP,cAAc;IAAEpK,MAAM,EAAEhD;EAAY,CAAC,CAAC;EACxF,OAAO2M,kBAAkB;AAC3B;AAEA3C,8BAAgB,CAAC4D,UAAU,CAAC5P,cAAc,CAAC;AAAC,eAE7BA,cAAc;AAAA"}
1
+ {"version":3,"names":["MergeLanesMain","constructor","workspace","merging","lanes","logger","remove","scope","exporter","mergeLane","laneName","options","BitError","consumer","mergeStrategy","noSnap","tag","snapMessage","existingOnWorkspaceOnly","build","keepReadme","noSquash","pattern","includeDeps","skipDependencyInstallation","resolveUnrelated","ignoreConfigChanges","skipFetch","currentLaneId","getCurrentLaneId","isDefault","toString","otherLaneId","getParsedLaneId","isEqual","currentLane","loadLane","isDefaultLane","getOtherLane","importer","importObjectsFromMainIfExist","toBitIds","toVersionLatest","undefined","lane","shouldFetch","isNew","otherLane","fetchLaneWithItsComponents","allIds","laneComps","getManyConsumerComponents","allRefs","map","comp","getRefsFromExtensions","extensions","flat","allRefsUniq","uniq","r","scopeImporter","importManyObjects","err","error","getBitIds","Error","DEFAULT_LANE","getMainIdsToMerge","bitIds","debug","allComponentsStatus","getMergeStatus","shouldSquash","componentIds","resolveMultipleComponentIds","compIdsFromPattern","filterIdsFromPoolIdsByPattern","filterComponentsStatus","forEach","bitId","find","c","id","isEqualWithoutVersion","push","unmergedLegitimately","unmergedMessage","workspaceIds","listIds","filter","_legacy","throwForFailures","squashSnaps","mergeResults","mergeSnaps","laneId","localLane","mergedSuccessfully","failedComponents","length","every","failedComponent","unchangedLegitimately","deleteResults","readmeComponent","readmeComponentId","changeVersion","head","hash","componentsPattern","force","remote","track","deleteFiles","fromLane","readmeResult","name","configMergeResults","configMergeResult","onDestroy","compact","failureMsgs","chalk","bold","red","join","laneIds","mainNotOnLane","ids","hasScope","modelComponents","Promise","all","legacyScope","getModelComponent","toBitId","mergeFromScope","toLane","fromLaneId","LaneId","parse","fromLaneObj","importLaneObject","toLaneId","getDefaultLaneId","toLaneObj","fromLaneBitIds","getIdsToMerge","laneCompIds","BitIds","fromArray","idsToMerge","scopeComponentsImporter","ScopeComponentsImporter","getInstance","importManyDeltaWithoutDeps","fromHead","ignoreMissingHead","throwIfNotUpToDate","repo","objects","mergedPreviously","mergedNow","bitObjectsPerComp","pMapSeries","modelComponent","fromVersionObj","loadVersion","version","isRemoved","fromLaneHead","getRef","toLaneHead","getComponent","divergeData","getDivergeData","sourceHead","targetHead","modifiedVersion","squashOneComp","addComponent","setHead","bitObjects","b","bitObjectsFlat","writeObjectsToTheFS","exportedIds","exported","exportMany","idsWithFutureScope","laneObject","allVersions","exportHeadsOnly","status","diffStatus","skipChanges","compsNotUpToDate","componentsStatus","s","upToDate","componentId","provider","cli","loggerMain","createLogger","MergeLanesAspect","lanesCommand","getCommand","mergeLanesMain","commands","MergeLaneCmd","register","MergeLaneFromScopeCmd","LanesAspect","CLIAspect","WorkspaceAspect","MergingAspect","LoggerAspect","RemoveAspect","ScopeAspect","ExportAspect","MainRuntime","compIdsToKeep","allBitIds","bitIdsFromPattern","bitIdsNotFromPattern","hasWithoutVersion","filteredComponentStatus","depsToAdd","compId","fromStatus","targetVersions","snapsOnTargetOnly","headOnTarget","remoteVersion","versionObj","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","d","depsUniq","uniqFromArray","currentLaneName","succeededComponents","componentFromModel","modifiedComp","add","versionHistory","updateRebasedVersionHistory","isDiverged","isSourceAhead","isTargetAhead","remoteSnaps","currentParents","parents","commonSnapBeforeDiverge","addAsOnlyParent","ref","removeParent","setSquashed","previousParents","addRuntime"],"sources":["merge-lanes.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { LanesAspect, LanesMain } from '@teambit/lanes';\nimport MergingAspect, {\n MergingMain,\n ComponentMergeStatus,\n ConfigMergeResult,\n ApplyVersionResults,\n} from '@teambit/merging';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport chalk from 'chalk';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport pMapSeries from 'p-map-series';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport { ComponentID } from '@teambit/component-id';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { Lane, Version } from '@teambit/legacy/dist/scope/models';\nimport { getRefsFromExtensions } from '@teambit/legacy/dist/consumer/component/sources/artifact-files';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { compact, uniq } from 'lodash';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { BitObject } from '@teambit/legacy/dist/scope/objects';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { MergeLanesAspect } from './merge-lanes.aspect';\nimport { MergeLaneCmd } from './merge-lane.cmd';\nimport { MergeLaneFromScopeCmd } from './merge-lane-from-scope.cmd';\n\nexport type MergeLaneOptions = {\n mergeStrategy: MergeStrategy;\n noSnap: boolean;\n snapMessage: string;\n existingOnWorkspaceOnly: boolean;\n build: boolean;\n keepReadme: 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};\n\nexport class MergeLanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private merging: MergingMain,\n private lanes: LanesMain,\n private logger: Logger,\n private remove: RemoveMain,\n private scope: ScopeMain,\n private exporter: ExportMain\n ) {}\n\n async mergeLane(\n laneName: string,\n options: MergeLaneOptions\n ): Promise<{ mergeResults: ApplyVersionResults; deleteResults: any; configMergeResults: ConfigMergeResult[] }> {\n if (!this.workspace) {\n throw new BitError(`unable to merge a lane outside of Bit workspace`);\n }\n const consumer = this.workspace.consumer;\n\n const {\n mergeStrategy,\n noSnap,\n tag,\n snapMessage,\n existingOnWorkspaceOnly,\n build,\n keepReadme,\n noSquash,\n pattern,\n includeDeps,\n skipDependencyInstallation,\n resolveUnrelated,\n ignoreConfigChanges,\n skipFetch,\n } = options;\n\n const currentLaneId = consumer.getCurrentLaneId();\n if (tag && !currentLaneId.isDefault()) {\n throw new BitError(`--tag only possible when on main. currently checked out to ${currentLaneId.toString()}`);\n }\n const otherLaneId = await consumer.getParsedLaneId(laneName);\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 const currentLane = currentLaneId.isDefault() ? null : await consumer.scope.loadLane(currentLaneId);\n const isDefaultLane = otherLaneId.isDefault();\n const getOtherLane = async () => {\n if (isDefaultLane) {\n if (!skipFetch) {\n await this.lanes.importer.importObjectsFromMainIfExist(currentLane?.toBitIds().toVersionLatest() || []);\n }\n return undefined;\n }\n let lane = await consumer.scope.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);\n\n // get all artifacts\n const allIds = otherLane.toBitIds();\n const laneComps = await consumer.scope.getManyConsumerComponents(allIds);\n const allRefs = laneComps.map((comp) => getRefsFromExtensions(comp.extensions)).flat();\n const allRefsUniq = uniq(allRefs.map((r) => r.toString()));\n try {\n await consumer.scope.scopeImporter.importManyObjects({ [otherLaneId.scope]: allRefsUniq });\n } catch (err) {\n this.logger.error(`failed fetching artifacts for lane ${otherLaneId.toString()}`, err);\n }\n\n lane = await consumer.scope.loadLane(otherLaneId);\n }\n return lane;\n };\n const otherLane = await getOtherLane();\n const getBitIds = async () => {\n if (isDefaultLane) {\n if (!currentLane) throw new Error(`unable to merge ${DEFAULT_LANE}, the current lane was not found`);\n return this.getMainIdsToMerge(currentLane);\n }\n if (!otherLane) throw new Error(`lane must be defined for non-default`);\n return otherLane.toBitIds();\n };\n const bitIds = await getBitIds();\n this.logger.debug(`merging the following bitIds: ${bitIds.toString()}`);\n\n let allComponentsStatus = await this.merging.getMergeStatus(bitIds, currentLane, otherLane, {\n resolveUnrelated,\n ignoreConfigChanges,\n });\n const shouldSquash = currentLaneId.isDefault() && !noSquash;\n\n if (pattern) {\n const componentIds = await this.workspace.resolveMultipleComponentIds(bitIds);\n const compIdsFromPattern = this.workspace.scope.filterIdsFromPoolIdsByPattern(pattern, componentIds);\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n bitIds,\n this.workspace,\n includeDeps,\n otherLane || undefined,\n shouldSquash\n );\n bitIds.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unmergedLegitimately: true, unmergedMessage: `excluded by pattern` });\n }\n });\n }\n if (existingOnWorkspaceOnly) {\n const workspaceIds = await this.workspace.listIds();\n const compIdsFromPattern = workspaceIds.filter((id) =>\n allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id._legacy))\n );\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n bitIds,\n this.workspace,\n includeDeps,\n otherLane || undefined,\n shouldSquash\n );\n bitIds.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unmergedLegitimately: true, unmergedMessage: `not in the workspace` });\n }\n });\n }\n\n throwForFailures();\n\n if (shouldSquash) {\n await squashSnaps(allComponentsStatus, otherLaneId, consumer);\n }\n\n const mergeResults = await this.merging.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n laneId: otherLaneId,\n localLane: currentLane,\n noSnap,\n tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n });\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\n .changeVersion(otherLane.readmeComponent?.head?.hash)\n .toString();\n\n deleteResults = await this.remove.remove({\n componentsPattern: readmeComponentId,\n force: false,\n remote: false,\n track: false,\n deleteFiles: true,\n fromLane: false,\n });\n } else if (otherLane && !otherLane.readmeComponent) {\n deleteResults = { readmeResult: `\\nlane ${otherLane.name} doesn't have a readme component` };\n }\n const configMergeResults = allComponentsStatus.map((c) => c.configMergeResult);\n\n await this.workspace.consumer.onDestroy();\n\n return { mergeResults, deleteResults, configMergeResults: compact(configMergeResults) };\n\n function throwForFailures() {\n const failedComponents = allComponentsStatus.filter((c) => c.unmergedMessage && !c.unmergedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unmergedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to merge due to the following failures:\\n${failureMsgs}`);\n }\n }\n }\n\n private async getMainIdsToMerge(lane: Lane) {\n const laneIds = lane.toBitIds();\n if (!this.workspace) {\n throw new BitError(`getMainIdsToMerge needs workspace`);\n }\n const workspaceIds = (await this.workspace.listIds()).map((id) => id._legacy);\n const mainNotOnLane = workspaceIds.filter((id) => !laneIds.find((laneId) => laneId.isEqualWithoutVersion(id)));\n const ids = [...laneIds, ...mainNotOnLane].filter((id) => id.hasScope());\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.toBitId().changeVersion(c.head.toString());\n })\n );\n }\n\n async mergeFromScope(\n fromLane: string,\n toLane: string,\n options: Partial<MergeLaneOptions> & { push?: boolean }\n ): Promise<{\n mergedPreviously: string[];\n mergedNow: string[];\n exportedIds: string[];\n }> {\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 = LaneId.parse(fromLane);\n const fromLaneObj = await this.lanes.importLaneObject(fromLaneId);\n const toLaneId = toLane === DEFAULT_LANE ? this.lanes.getDefaultLaneId() : LaneId.parse(toLane);\n const toLaneObj = toLaneId.isDefault() ? undefined : await this.lanes.importLaneObject(toLaneId);\n const fromLaneBitIds = fromLaneObj.toBitIds();\n const getIdsToMerge = async (): Promise<BitIds> => {\n if (!options.pattern) return fromLaneBitIds;\n const laneCompIds = await this.scope.resolveMultipleComponentIds(fromLaneBitIds);\n const ids = this.scope.filterIdsFromPoolIdsByPattern(options.pattern, laneCompIds);\n return BitIds.fromArray(ids.map((id) => id._legacy));\n };\n const idsToMerge = await getIdsToMerge();\n const scopeComponentsImporter = ScopeComponentsImporter.getInstance(this.scope.legacyScope);\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids: idsToMerge,\n fromHead: true,\n lane: fromLaneObj,\n ignoreMissingHead: true,\n });\n // get their main/to-lane as well\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids: idsToMerge.toVersionLatest(),\n fromHead: true,\n ignoreMissingHead: true,\n lane: toLaneObj,\n });\n await this.throwIfNotUpToDate(fromLaneId, toLaneId);\n const repo = this.scope.legacyScope.objects;\n // loop through all components, make sure they're all ahead of main (it might not be on main yet).\n // then, change the version object to include an extra parent to point to the main.\n // then, change the component object head to point to this changed version\n const mergedPreviously: BitId[] = [];\n const mergedNow: BitId[] = [];\n const shouldSquash = !toLaneObj && !options.noSquash; // only when merging to main we squash.\n const bitObjectsPerComp = await pMapSeries(idsToMerge, async (id) => {\n const modelComponent = await this.scope.legacyScope.getModelComponent(id);\n const fromVersionObj = await modelComponent.loadVersion(id.version as string, repo);\n if (fromVersionObj.isRemoved()) return undefined;\n const fromLaneHead = modelComponent.getRef(id.version as string);\n if (!fromLaneHead) throw new Error(`lane head must be defined for ${id.toString()}`);\n const toLaneHead = toLaneObj ? toLaneObj.getComponent(id)?.head : modelComponent.head || null;\n if (toLaneHead?.isEqual(fromLaneHead)) {\n mergedPreviously.push(id);\n return undefined;\n }\n // this might be confusing, we pass the toLaneHead as the sourceHead and the fromLaneHead as the targetHead.\n // this is because normally, in the workspace, we merge another lane (target) into the current lane (source).\n // so effectively, in the workspace, we merge fromLane=target into toLane=source.\n const divergeData = await getDivergeData({\n repo,\n modelComponent,\n sourceHead: toLaneHead,\n targetHead: fromLaneHead,\n });\n const modifiedVersion = shouldSquash\n ? squashOneComp(DEFAULT_LANE, fromLaneId, id, divergeData, fromVersionObj)\n : undefined;\n const objects: BitObject[] = [];\n if (modifiedVersion) objects.push(modifiedVersion);\n if (toLaneObj) {\n toLaneObj.addComponent({ id: id.changeVersion(undefined), head: fromLaneHead });\n } else {\n modelComponent.setHead(fromLaneHead);\n objects.push(modelComponent);\n }\n mergedNow.push(id);\n return { id, objects };\n });\n const bitObjects = compact(bitObjectsPerComp).map((b) => b.objects);\n const bitObjectsFlat = bitObjects.flat();\n if (toLaneObj) bitObjectsFlat.push(toLaneObj);\n await repo.writeObjectsToTheFS(bitObjectsFlat);\n let exportedIds: string[] = [];\n if (options.push) {\n const ids = compact(bitObjectsPerComp).map((b) => b.id);\n const bitIds = BitIds.fromArray(ids);\n const { exported } = await this.exporter.exportMany({\n scope: this.scope.legacyScope,\n ids: shouldSquash ? bitIds : new BitIds(),\n idsWithFutureScope: shouldSquash ? bitIds : new BitIds(),\n laneObject: toLaneObj,\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 exportHeadsOnly: shouldSquash,\n });\n exportedIds = exported.map((id) => id.toString());\n }\n\n return {\n mergedPreviously: mergedPreviously.map((id) => id.toString()),\n mergedNow: mergedNow.map((id) => id.toString()),\n exportedIds,\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 ];\n static runtime = MainRuntime;\n\n static async provider([lanes, cli, workspace, merging, loggerMain, remove, scope, exporter]: [\n LanesMain,\n CLIMain,\n Workspace,\n MergingMain,\n LoggerMain,\n RemoveMain,\n ScopeMain,\n ExportMain\n ]) {\n const logger = loggerMain.createLogger(MergeLanesAspect.id);\n const lanesCommand = cli.getCommand('lane');\n const mergeLanesMain = new MergeLanesMain(workspace, merging, lanes, logger, remove, scope, exporter);\n lanesCommand?.commands?.push(new MergeLaneCmd(mergeLanesMain));\n cli.register(new MergeLaneFromScopeCmd(mergeLanesMain));\n return mergeLanesMain;\n }\n}\n\nasync function filterComponentsStatus(\n allComponentsStatus: ComponentMergeStatus[],\n compIdsToKeep: ComponentID[],\n allBitIds: BitId[],\n workspace: Workspace,\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 = BitIds.fromArray(compIdsToKeep.map((c) => c._legacy));\n const bitIdsNotFromPattern = allBitIds.filter((bitId) => !bitIdsFromPattern.hasWithoutVersion(bitId));\n const filteredComponentStatus: ComponentMergeStatus[] = [];\n const depsToAdd: BitId[] = [];\n await pMapSeries(compIdsToKeep, async (compId) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(compId._legacy));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n if (fromStatus.unmergedMessage) {\n return;\n }\n if (!otherLane) {\n // if merging main, no need to check whether the deps are included in the pattern.\n return;\n }\n const { divergeData } = fromStatus;\n if (!divergeData) {\n throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);\n }\n let targetVersions = divergeData.snapsOnTargetOnly;\n if (!targetVersions.length) {\n return;\n }\n const modelComponent = await workspace.consumer.scope.getModelComponent(compId._legacy);\n if (shouldSquash) {\n // no need to check all versions, we merge only the head\n const headOnTarget = otherLane ? otherLane.getComponent(compId._legacy)?.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 await pMapSeries(targetVersions, async (remoteVersion) => {\n const versionObj = await modelComponent.loadVersion(remoteVersion.toString(), workspace.consumer.scope.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: BitId[] = [];\n await Promise.all(\n depsNotIncludeInPattern.map(async (dep) => {\n const isOnLane = await workspace.consumer.scope.isIdOnLane(dep, otherLane);\n if (isOnLane) {\n depsOnLane.push(dep);\n }\n })\n );\n if (!depsOnLane.length) {\n return;\n }\n if (!includeDeps) {\n throw new BitError(`unable to merge ${compId.toString()}.\nit has (in version ${remoteVersion.toString()}) the following dependencies which were not included in the pattern. consider adding \"--include-deps\" flag\n${depsOnLane.map((d) => d.toString()).join('\\n')}`);\n }\n depsToAdd.push(...depsOnLane);\n });\n });\n if (depsToAdd.length) {\n const depsUniq = BitIds.uniqFromArray(depsToAdd);\n depsUniq.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(allComponentsStatus: ComponentMergeStatus[], otherLaneId: LaneId, consumer: Consumer) {\n const currentLaneName = consumer.getCurrentLaneId().name;\n const succeededComponents = allComponentsStatus.filter((c) => !c.unmergedMessage);\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 const modifiedComp = squashOneComp(currentLaneName, otherLaneId, id, divergeData, componentFromModel);\n if (modifiedComp) {\n consumer.scope.objects.add(modifiedComp);\n const modelComponent = await consumer.scope.getModelComponent(id);\n const versionHistory = await modelComponent.updateRebasedVersionHistory(consumer.scope.objects, [modifiedComp]);\n if (versionHistory) consumer.scope.objects.add(versionHistory);\n }\n })\n );\n}\n\n/**\n * returns Version object if it was modified. otherwise, returns undefined\n */\nfunction squashOneComp(\n currentLaneName: string,\n otherLaneId: LaneId,\n id: BitId,\n divergeData: SnapsDistance,\n componentFromModel?: Version\n): Version | undefined {\n if (divergeData.isDiverged()) {\n throw new BitError(`unable to squash because ${id.toString()} is diverged in history.\nconsider switching to \"${\n otherLaneId.name\n }\" first, merging \"${currentLaneName}\", then switching back to \"${currentLaneName}\" and merging \"${\n otherLaneId.name\n }\"\nalternatively, 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 undefined;\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 undefined;\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 // no need to check this case. even if it has only one snap ahead, we want to do the \"squash\", and run \"addAsOnlyParent\"\n // to make sure it doesn't not have two parents.\n // if (remoteSnaps.length === 1) {\n // // nothing to squash. it has only one commit.\n // return;\n // }\n if (!componentFromModel) {\n throw new Error('unable to squash, the componentFromModel is missing');\n }\n\n const currentParents = componentFromModel.parents;\n\n // do the squash.\n if (divergeData.commonSnapBeforeDiverge) {\n componentFromModel.addAsOnlyParent(divergeData.commonSnapBeforeDiverge);\n } else {\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 componentFromModel.setSquashed({ previousParents: currentParents, laneId: otherLaneId });\n return componentFromModel;\n}\n\nMergeLanesAspect.addRuntime(MergeLanesMain);\n\nexport default MergeLanesMain;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAMA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAA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qF,IACb,qBAAoBkI,eAAgB,8BAA6BA,eAAgB,kBAChFvN,WAAW,CAACqF,IACb;AACL,uEAAuErF,WAAW,CAACqF,IAAK,GAAE,CAAC;EACzF;EACA,IAAI0D,WAAW,CAACgF,aAAa,EAAE,EAAE;IAC/B;IACA,OAAOpN,SAAS;EAClB;EACA,IAAI,CAACoI,WAAW,CAACiF,aAAa,EAAE,EAAE;IAChC;IACA,OAAOrN,SAAS;EAClB;EACA;EACA,MAAMsN,WAAW,GAAGlF,WAAW,CAAC0D,iBAAiB;EACjD,IAAIwB,WAAW,CAAC7J,MAAM,KAAK,CAAC,EAAE;IAC5B,MAAM,IAAIlC,KAAK,CAAE,sDAAqD,CAAC;EACzE;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAI,CAACuL,kBAAkB,EAAE;IACvB,MAAM,IAAIvL,KAAK,CAAC,qDAAqD,CAAC;EACxE;EAEA,MAAMgM,cAAc,GAAGT,kBAAkB,CAACU,OAAO;;EAEjD;EACA,IAAIpF,WAAW,CAACqF,uBAAuB,EAAE;IACvCX,kBAAkB,CAACY,eAAe,CAACtF,WAAW,CAACqF,uBAAuB,CAAC;EACzE,CAAC,MAAM;IACL;IACAX,kBAAkB,CAACU,OAAO,CAACpL,OAAO,CAAEuL,GAAG,IAAKb,kBAAkB,CAACc,YAAY,CAACD,GAAG,CAAC,CAAC;EACnF;EACAb,kBAAkB,CAACe,WAAW,CAAC;IAAEC,eAAe,EAAEP,cAAc;IAAElK,MAAM,EAAEhE;EAAY,CAAC,CAAC;EACxF,OAAOyN,kBAAkB;AAC3B;AAEA3C,8BAAgB,CAAC4D,UAAU,CAAC1Q,cAAc,CAAC;AAAC,eAE7BA,cAAc;AAAA"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/merge-lanes",
3
- "version": "0.0.176",
3
+ "version": "0.0.178",
4
4
  "homepage": "https://bit.dev/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": "0.0.176"
9
+ "version": "0.0.178"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -16,17 +16,17 @@
16
16
  "@babel/runtime": "7.20.0",
17
17
  "@teambit/harmony": "0.4.6",
18
18
  "@teambit/bit-error": "0.0.402",
19
- "@teambit/cli": "0.0.670",
20
- "@teambit/lane-id": "0.0.187",
21
- "@teambit/merging": "0.0.314",
19
+ "@teambit/cli": "0.0.672",
20
+ "@teambit/lane-id": "0.0.189",
21
+ "@teambit/merging": "0.0.316",
22
22
  "@teambit/component-id": "0.0.427",
23
- "@teambit/export": "0.0.999",
24
- "@teambit/lanes": "0.0.571",
23
+ "@teambit/export": "0.0.1001",
24
+ "@teambit/lanes": "0.0.573",
25
25
  "@teambit/legacy-bit-id": "0.0.423",
26
- "@teambit/logger": "0.0.763",
27
- "@teambit/remove": "0.0.176",
28
- "@teambit/scope": "0.0.999",
29
- "@teambit/workspace": "0.0.999"
26
+ "@teambit/logger": "0.0.765",
27
+ "@teambit/remove": "0.0.178",
28
+ "@teambit/scope": "0.0.1001",
29
+ "@teambit/workspace": "0.0.1001"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/lodash": "4.14.165",
@@ -38,7 +38,7 @@
38
38
  "@types/testing-library__jest-dom": "5.9.5"
39
39
  },
40
40
  "peerDependencies": {
41
- "@teambit/legacy": "1.0.452",
41
+ "@teambit/legacy": "1.0.454",
42
42
  "react": "^16.8.0 || ^17.0.0",
43
43
  "react-dom": "^16.8.0 || ^17.0.0"
44
44
  },