@teambit/merge-lanes 0.0.245 → 0.0.247
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.
- package/dist/merge-lanes.main.runtime.js +19 -9
- package/dist/merge-lanes.main.runtime.js.map +1 -1
- package/package-tar/teambit-merge-lanes-0.0.247.tgz +0 -0
- package/package.json +10 -10
- package/package-tar/teambit-merge-lanes-0.0.245.tgz +0 -0
- /package/dist/{preview-1685503265901.js → preview-1685960855192.js} +0 -0
@@ -395,7 +395,7 @@ class MergeLanesMain {
|
|
395
395
|
sourceHead: toLaneHead,
|
396
396
|
targetHead: fromLaneHead
|
397
397
|
});
|
398
|
-
const modifiedVersion = shouldSquash ? squashOneComp(_laneId().DEFAULT_LANE, fromLaneId, id, divergeData, log, fromVersionObj) : undefined;
|
398
|
+
const modifiedVersion = shouldSquash ? await squashOneComp(_laneId().DEFAULT_LANE, fromLaneId, id, divergeData, log, this.scope.legacyScope, fromVersionObj) : undefined;
|
399
399
|
const objects = [];
|
400
400
|
if (modifiedVersion) objects.push(modifiedVersion);
|
401
401
|
if (toLaneObj) {
|
@@ -579,7 +579,7 @@ async function squashSnaps(allComponentsStatus, otherLaneId, consumer) {
|
|
579
579
|
if (!divergeData) {
|
580
580
|
throw new Error(`unable to squash. divergeData is missing from ${id.toString()}`);
|
581
581
|
}
|
582
|
-
const modifiedComp = squashOneComp(currentLaneName, otherLaneId, id, divergeData, log, componentFromModel);
|
582
|
+
const modifiedComp = await squashOneComp(currentLaneName, otherLaneId, id, divergeData, log, consumer.scope, componentFromModel);
|
583
583
|
if (modifiedComp) {
|
584
584
|
consumer.scope.objects.add(modifiedComp);
|
585
585
|
const modelComponent = await consumer.scope.getModelComponent(id);
|
@@ -592,7 +592,7 @@ async function squashSnaps(allComponentsStatus, otherLaneId, consumer) {
|
|
592
592
|
/**
|
593
593
|
* returns Version object if it was modified. otherwise, returns undefined
|
594
594
|
*/
|
595
|
-
function squashOneComp(currentLaneName, otherLaneId, id, divergeData, log, componentFromModel) {
|
595
|
+
async function squashOneComp(currentLaneName, otherLaneId, id, divergeData, log, scope, componentFromModel) {
|
596
596
|
if (divergeData.isDiverged()) {
|
597
597
|
throw new (_bitError().BitError)(`unable to squash because ${id.toString()} is diverged in history.
|
598
598
|
consider switching to "${otherLaneId.name}" first, merging "${currentLaneName}", then switching back to "${currentLaneName}" and merging "${otherLaneId.name}"
|
@@ -621,14 +621,24 @@ alternatively, use "--no-squash" flag to keep the entire history of "${otherLane
|
|
621
621
|
throw new Error('unable to squash, the componentFromModel is missing');
|
622
622
|
}
|
623
623
|
const currentParents = componentFromModel.parents;
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
624
|
+
const doSquash = async () => {
|
625
|
+
if (divergeData.commonSnapBeforeDiverge) {
|
626
|
+
componentFromModel.addAsOnlyParent(divergeData.commonSnapBeforeDiverge);
|
627
|
+
return;
|
628
|
+
}
|
629
|
+
if (currentLaneName !== _laneId().DEFAULT_LANE) {
|
630
|
+
// when squashing into lane, we have to take main into account
|
631
|
+
const modelComponent = await scope.getModelComponentIfExist(id);
|
632
|
+
if (!modelComponent) throw new Error(`missing ModelComponent for ${id.toString()}`);
|
633
|
+
if (modelComponent.head) {
|
634
|
+
componentFromModel.addAsOnlyParent(modelComponent.head);
|
635
|
+
return;
|
636
|
+
}
|
637
|
+
}
|
629
638
|
// there is no commonSnapBeforeDiverge. the local has no snaps, all are remote, no need for parents. keep only head.
|
630
639
|
componentFromModel.parents.forEach(ref => componentFromModel.removeParent(ref));
|
631
|
-
}
|
640
|
+
};
|
641
|
+
await doSquash();
|
632
642
|
componentFromModel.setSquashed({
|
633
643
|
previousParents: currentParents,
|
634
644
|
laneId: otherLaneId
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["MergeLanesMain","constructor","workspace","merging","lanes","logger","remove","scope","exporter","importer","mergeLane","laneName","options","BitError","consumer","mergeStrategy","noSnap","tag","snapMessage","existingOnWorkspaceOnly","build","keepReadme","squash","noSquash","pattern","includeDeps","skipDependencyInstallation","resolveUnrelated","ignoreConfigChanges","skipFetch","currentLaneId","getCurrentLaneId","isDefault","toString","otherLaneId","getParsedLaneId","isEqual","currentLane","loadLane","isDefaultLane","getOtherLane","importObjectsFromMainIfExist","toBitIds","toVersionLatest","undefined","lane","shouldFetch","isNew","otherLane","fetchLaneWithItsComponents","importHeadArtifactsFromLane","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","removeLocallyByIds","readmeResult","name","configMergeResults","map","configMergeResult","onDestroy","compact","failureMsgs","chalk","bold","red","join","laneIds","mainNotOnLane","ids","hasScope","modelComponents","Promise","all","legacyScope","getModelComponent","toBitId","mergeFromScope","fromLane","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","log","getLogForSquash","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","ignoreMissingExternalArtifacts","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","ImporterAspect","MainRuntime","compIdsToKeep","allBitIds","bitIdsFromPattern","bitIdsNotFromPattern","hasWithoutVersion","filteredComponentStatus","depsToAdd","missingDepsFromHead","missingDepsFromHistory","compId","fromStatus","targetVersions","snapsOnTargetOnly","headOnTarget","remoteVersion","versionObj","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","depsOnLaneStr","toStringWithoutVersion","Object","keys","MissingCompsToMerge","uniq","depsWithoutVersion","d","depsUniqWithoutVersion","uniqFromArray","basicLog","getBasicLog","message","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 ImporterAspect, { ImporterMain } from '@teambit/importer';\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 { getBasicLog } from '@teambit/snapping';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { Log } from '@teambit/legacy/dist/scope/models/version';\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, 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';\nimport { MissingCompsToMerge } from './exceptions/missing-comps-to-merge';\n\nexport type MergeLaneOptions = {\n mergeStrategy: MergeStrategy;\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};\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 private importer: ImporterMain\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 squash,\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 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 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.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 await this.importer.importHeadArtifactsFromLane(otherLane, true);\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 = squash || (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.changeVersion(otherLane.readmeComponent?.head?.hash);\n deleteResults = await this.remove.removeLocallyByIds([readmeComponentId]);\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.importer.importHeadArtifactsFromLane(fromLaneObj, true);\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 log = await getLogForSquash(fromLaneId);\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, log, 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 // all artifacts must be pushed. they're all considered \"external\" in this case, because it's running from a\n // bare-scope, but we don't want to ignore them, otherwise, they'll be missing from the component-scopes.\n ignoreMissingExternalArtifacts: false,\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 ImporterAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([lanes, cli, workspace, merging, loggerMain, remove, scope, exporter, importer]: [\n LanesMain,\n CLIMain,\n Workspace,\n MergingMain,\n LoggerMain,\n RemoveMain,\n ScopeMain,\n ExportMain,\n ImporterMain\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, importer);\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 const missingDepsFromHead = {};\n const missingDepsFromHistory: string[] = [];\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 depsToAdd.push(...depsOnLane);\n } else {\n const headOnTarget = otherLane ? otherLane.getComponent(compId._legacy)?.head : modelComponent.head;\n const depsOnLaneStr = depsOnLane.map((dep) => dep.toStringWithoutVersion());\n if (headOnTarget?.isEqual(remoteVersion)) {\n depsOnLaneStr.forEach((dep) => {\n (missingDepsFromHead[dep] ||= []).push(compId.toStringWithoutVersion());\n });\n } else {\n missingDepsFromHistory.push(...depsOnLaneStr);\n }\n }\n });\n });\n if (Object.keys(missingDepsFromHead).length || missingDepsFromHistory.length) {\n throw new MissingCompsToMerge(missingDepsFromHead, uniq(missingDepsFromHistory));\n }\n\n if (depsToAdd.length) {\n // remove the version, otherwise, the uniq gives duplicate components with different versions.\n const depsWithoutVersion = depsToAdd.map((d) => d.changeVersion(undefined));\n const depsUniqWithoutVersion = BitIds.uniqFromArray(depsWithoutVersion);\n depsUniqWithoutVersion.forEach((id) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n });\n }\n return filteredComponentStatus;\n}\n\nasync function getLogForSquash(otherLaneId: LaneId) {\n const basicLog = await getBasicLog();\n const log = {\n ...basicLog,\n message: `squashed during merge from ${otherLaneId.toString()}`,\n };\n return log;\n}\n\nasync function squashSnaps(allComponentsStatus: ComponentMergeStatus[], otherLaneId: LaneId, consumer: Consumer) {\n const currentLaneName = consumer.getCurrentLaneId().name;\n const succeededComponents = allComponentsStatus.filter((c) => !c.unmergedMessage);\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 = squashOneComp(currentLaneName, otherLaneId, id, divergeData, log, 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 log: Log,\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 }, log);\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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AAS;EAClB;EACA,IAAI,CAACoH,WAAW,CAACgG,aAAa,EAAE,EAAE;IAChC;IACA,OAAOpN,SAAS;EAClB;EACA;EACA,MAAMqN,WAAW,GAAGjG,WAAW,CAAC+D,iBAAiB;EACjD,IAAIkC,WAAW,CAAC3K,MAAM,KAAK,CAAC,EAAE;IAC5B,MAAM,IAAIlC,KAAK,CAAE,sDAAqD,CAAC;EACzE;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAI,CAACqM,kBAAkB,EAAE;IACvB,MAAM,IAAIrM,KAAK,CAAC,qDAAqD,CAAC;EACxE;EAEA,MAAM8M,cAAc,GAAGT,kBAAkB,CAACU,OAAO;;EAEjD;EACA,IAAInG,WAAW,CAACoG,uBAAuB,EAAE;IACvCX,kBAAkB,CAACY,eAAe,CAACrG,WAAW,CAACoG,uBAAuB,CAAC;EACzE,CAAC,MAAM;IACL;IACAX,kBAAkB,CAACU,OAAO,CAAClM,OAAO,CAAEqM,GAAG,IAAKb,kBAAkB,CAACc,YAAY,CAACD,GAAG,CAAC,CAAC;EACnF;EACAb,kBAAkB,CAACe,WAAW,CAAC;IAAEC,eAAe,EAAEP,cAAc;IAAEhL,MAAM,EAAEhD;EAAY,CAAC,EAAEiH,GAAG,CAAC;EAC7F,OAAOsG,kBAAkB;AAC3B;AAEAxD,8BAAgB,CAACyE,UAAU,CAAC1Q,cAAc,CAAC;AAAC,eAE7BA,cAAc;AAAA"}
|
1
|
+
{"version":3,"names":["MergeLanesMain","constructor","workspace","merging","lanes","logger","remove","scope","exporter","importer","mergeLane","laneName","options","BitError","consumer","mergeStrategy","noSnap","tag","snapMessage","existingOnWorkspaceOnly","build","keepReadme","squash","noSquash","pattern","includeDeps","skipDependencyInstallation","resolveUnrelated","ignoreConfigChanges","skipFetch","currentLaneId","getCurrentLaneId","isDefault","toString","otherLaneId","getParsedLaneId","isEqual","currentLane","loadLane","isDefaultLane","getOtherLane","importObjectsFromMainIfExist","toBitIds","toVersionLatest","undefined","lane","shouldFetch","isNew","otherLane","fetchLaneWithItsComponents","importHeadArtifactsFromLane","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","removeLocallyByIds","readmeResult","name","configMergeResults","map","configMergeResult","onDestroy","compact","failureMsgs","chalk","bold","red","join","laneIds","mainNotOnLane","ids","hasScope","modelComponents","Promise","all","legacyScope","getModelComponent","toBitId","mergeFromScope","fromLane","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","log","getLogForSquash","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","ignoreMissingExternalArtifacts","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","ImporterAspect","MainRuntime","compIdsToKeep","allBitIds","bitIdsFromPattern","bitIdsNotFromPattern","hasWithoutVersion","filteredComponentStatus","depsToAdd","missingDepsFromHead","missingDepsFromHistory","compId","fromStatus","targetVersions","snapsOnTargetOnly","headOnTarget","remoteVersion","versionObj","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","depsOnLaneStr","toStringWithoutVersion","Object","keys","MissingCompsToMerge","uniq","depsWithoutVersion","d","depsUniqWithoutVersion","uniqFromArray","basicLog","getBasicLog","message","currentLaneName","succeededComponents","componentFromModel","modifiedComp","add","versionHistory","updateRebasedVersionHistory","isDiverged","isSourceAhead","isTargetAhead","remoteSnaps","currentParents","parents","doSquash","commonSnapBeforeDiverge","addAsOnlyParent","getModelComponentIfExist","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 ImporterAspect, { ImporterMain } from '@teambit/importer';\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 { getBasicLog } from '@teambit/snapping';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { Log } from '@teambit/legacy/dist/scope/models/version';\nimport pMapSeries from 'p-map-series';\nimport { Scope as LegacyScope } from '@teambit/legacy/dist/scope';\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, 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';\nimport { MissingCompsToMerge } from './exceptions/missing-comps-to-merge';\n\nexport type MergeLaneOptions = {\n mergeStrategy: MergeStrategy;\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};\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 private importer: ImporterMain\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 squash,\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 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 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.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 await this.importer.importHeadArtifactsFromLane(otherLane, true);\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 = squash || (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.changeVersion(otherLane.readmeComponent?.head?.hash);\n deleteResults = await this.remove.removeLocallyByIds([readmeComponentId]);\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.importer.importHeadArtifactsFromLane(fromLaneObj, true);\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 log = await getLogForSquash(fromLaneId);\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 ? await squashOneComp(DEFAULT_LANE, fromLaneId, id, divergeData, log, this.scope.legacyScope, 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 // all artifacts must be pushed. they're all considered \"external\" in this case, because it's running from a\n // bare-scope, but we don't want to ignore them, otherwise, they'll be missing from the component-scopes.\n ignoreMissingExternalArtifacts: false,\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 ImporterAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([lanes, cli, workspace, merging, loggerMain, remove, scope, exporter, importer]: [\n LanesMain,\n CLIMain,\n Workspace,\n MergingMain,\n LoggerMain,\n RemoveMain,\n ScopeMain,\n ExportMain,\n ImporterMain\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, importer);\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 const missingDepsFromHead = {};\n const missingDepsFromHistory: string[] = [];\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 depsToAdd.push(...depsOnLane);\n } else {\n const headOnTarget = otherLane ? otherLane.getComponent(compId._legacy)?.head : modelComponent.head;\n const depsOnLaneStr = depsOnLane.map((dep) => dep.toStringWithoutVersion());\n if (headOnTarget?.isEqual(remoteVersion)) {\n depsOnLaneStr.forEach((dep) => {\n (missingDepsFromHead[dep] ||= []).push(compId.toStringWithoutVersion());\n });\n } else {\n missingDepsFromHistory.push(...depsOnLaneStr);\n }\n }\n });\n });\n if (Object.keys(missingDepsFromHead).length || missingDepsFromHistory.length) {\n throw new MissingCompsToMerge(missingDepsFromHead, uniq(missingDepsFromHistory));\n }\n\n if (depsToAdd.length) {\n // remove the version, otherwise, the uniq gives duplicate components with different versions.\n const depsWithoutVersion = depsToAdd.map((d) => d.changeVersion(undefined));\n const depsUniqWithoutVersion = BitIds.uniqFromArray(depsWithoutVersion);\n depsUniqWithoutVersion.forEach((id) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n });\n }\n return filteredComponentStatus;\n}\n\nasync function getLogForSquash(otherLaneId: LaneId) {\n const basicLog = await getBasicLog();\n const log = {\n ...basicLog,\n message: `squashed during merge from ${otherLaneId.toString()}`,\n };\n return log;\n}\n\nasync function squashSnaps(allComponentsStatus: ComponentMergeStatus[], otherLaneId: LaneId, consumer: Consumer) {\n const currentLaneName = consumer.getCurrentLaneId().name;\n const succeededComponents = allComponentsStatus.filter((c) => !c.unmergedMessage);\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 consumer.scope,\n componentFromModel\n );\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 */\nasync function squashOneComp(\n currentLaneName: string,\n otherLaneId: LaneId,\n id: BitId,\n divergeData: SnapsDistance,\n log: Log,\n scope: LegacyScope,\n componentFromModel?: Version\n): Promise<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 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 componentFromModel.setSquashed({ previousParents: currentParents, laneId: otherLaneId }, log);\n return componentFromModel;\n}\n\nMergeLanesAspect.addRuntime(MergeLanesMain);\n\nexport default MergeLanesMain;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;EAAA;EA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,CAAC;EACnF,CAAC;EAED,MAAMJ,QAAQ,EAAE;EAEhBX,kBAAkB,CAACiB,WAAW,CAAC;IAAEC,eAAe,EAAET,cAAc;IAAEhL,MAAM,EAAEhD;EAAY,CAAC,EAAEiH,GAAG,CAAC;EAC7F,OAAOsG,kBAAkB;AAC3B;AAEAxD,8BAAgB,CAAC2E,UAAU,CAAC5Q,cAAc,CAAC;AAAC,eAE7BA,cAAc;AAAA"}
|
Binary file
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/merge-lanes",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.247",
|
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": "0.0.
|
9
|
+
"version": "0.0.247"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "2.4.2",
|
@@ -20,15 +20,15 @@
|
|
20
20
|
"@teambit/bit-error": "0.0.402",
|
21
21
|
"@teambit/cli": "0.0.721",
|
22
22
|
"@teambit/lane-id": "0.0.238",
|
23
|
-
"@teambit/merging": "0.0.
|
24
|
-
"@teambit/export": "0.0.
|
25
|
-
"@teambit/importer": "0.0.
|
26
|
-
"@teambit/lanes": "0.0.
|
23
|
+
"@teambit/merging": "0.0.385",
|
24
|
+
"@teambit/export": "0.0.1070",
|
25
|
+
"@teambit/importer": "0.0.499",
|
26
|
+
"@teambit/lanes": "0.0.642",
|
27
27
|
"@teambit/logger": "0.0.814",
|
28
|
-
"@teambit/remove": "0.0.
|
29
|
-
"@teambit/scope": "0.0.
|
30
|
-
"@teambit/snapping": "0.0.
|
31
|
-
"@teambit/workspace": "0.0.
|
28
|
+
"@teambit/remove": "0.0.247",
|
29
|
+
"@teambit/scope": "0.0.1070",
|
30
|
+
"@teambit/snapping": "0.0.385",
|
31
|
+
"@teambit/workspace": "0.0.1070"
|
32
32
|
},
|
33
33
|
"devDependencies": {
|
34
34
|
"@types/lodash": "4.14.165",
|
Binary file
|
File without changes
|