@teambit/merge-lanes 0.0.74 → 0.0.75
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 -26
- package/dist/merge-lanes.main.runtime.js.map +1 -1
- package/package-tar/teambit-merge-lanes-0.0.75.tgz +0 -0
- package/package.json +12 -12
- /package/{preview-1668224352835.js → preview-1668310914843.js} +0 -0
- package/package-tar/teambit-merge-lanes-0.0.74.tgz +0 -0
@@ -93,13 +93,6 @@ function _laneId() {
|
|
93
93
|
};
|
94
94
|
return data;
|
95
95
|
}
|
96
|
-
function _repositories() {
|
97
|
-
const data = require("@teambit/legacy/dist/scope/repositories");
|
98
|
-
_repositories = function () {
|
99
|
-
return data;
|
100
|
-
};
|
101
|
-
return data;
|
102
|
-
}
|
103
96
|
function _logger() {
|
104
97
|
const data = require("@teambit/logger");
|
105
98
|
_logger = function () {
|
@@ -218,22 +211,10 @@ class MergeLanesMain {
|
|
218
211
|
};
|
219
212
|
const bitIds = await getBitIds();
|
220
213
|
this.logger.debug(`merging the following bitIds: ${bitIds.toString()}`);
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
const componentsStatus = await Promise.all(bitIds.map(bitId => this.merging.getComponentMergeStatus(bitId, currentLane, otherLaneName, {
|
226
|
-
resolveUnrelated,
|
227
|
-
ignoreConfigChanges
|
228
|
-
})));
|
229
|
-
await tmp.clear();
|
230
|
-
return componentsStatus;
|
231
|
-
} catch (err) {
|
232
|
-
await tmp.clear();
|
233
|
-
throw err;
|
234
|
-
}
|
235
|
-
};
|
236
|
-
let allComponentsStatus = await getAllComponentsStatus();
|
214
|
+
let allComponentsStatus = await this.merging.getMergeStatus(bitIds, currentLane, otherLane, {
|
215
|
+
resolveUnrelated,
|
216
|
+
ignoreConfigChanges
|
217
|
+
});
|
237
218
|
if (pattern) {
|
238
219
|
const componentIds = await this.workspace.resolveMultipleComponentIds(bitIds);
|
239
220
|
const compIdsFromPattern = this.workspace.scope.filterIdsFromPoolIdsByPattern(pattern, componentIds);
|
@@ -314,9 +295,18 @@ class MergeLanesMain {
|
|
314
295
|
const lane = await this.lanes.importLaneObject(laneId);
|
315
296
|
const laneIds = lane.toBitIds();
|
316
297
|
const scopeComponentsImporter = _scopeComponentsImporter().default.getInstance(this.scope.legacyScope);
|
317
|
-
await scopeComponentsImporter.importManyDeltaWithoutDeps(
|
298
|
+
await scopeComponentsImporter.importManyDeltaWithoutDeps({
|
299
|
+
ids: laneIds,
|
300
|
+
fromHead: true,
|
301
|
+
lane,
|
302
|
+
ignoreMissingHead: true
|
303
|
+
});
|
318
304
|
// get their main as well
|
319
|
-
await scopeComponentsImporter.importManyDeltaWithoutDeps(
|
305
|
+
await scopeComponentsImporter.importManyDeltaWithoutDeps({
|
306
|
+
ids: laneIds.toVersionLatest(),
|
307
|
+
fromHead: true,
|
308
|
+
ignoreMissingHead: true
|
309
|
+
});
|
320
310
|
const repo = this.scope.legacyScope.objects;
|
321
311
|
// loop through all components, make sure they're all ahead of main (it might not be on main yet).
|
322
312
|
// then, change the version object to include an extra parent to point to the main.
|
@@ -360,7 +350,10 @@ class MergeLanesMain {
|
|
360
350
|
scope: this.scope.legacyScope,
|
361
351
|
ids: bitIds,
|
362
352
|
idsWithFutureScope: bitIds,
|
363
|
-
allVersions: false
|
353
|
+
allVersions: false,
|
354
|
+
// no need to export anything else other than the head. the normal calculation of what to export won't apply here
|
355
|
+
// as it is done from the scope.
|
356
|
+
exportHeadsOnly: true
|
364
357
|
});
|
365
358
|
exportedIds = exported.map(id => id.toString());
|
366
359
|
}
|
@@ -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","remote","currentLaneId","getCurrentLaneId","isDefault","toString","otherLaneId","getParsedLaneId","isEqual","currentLane","loadLane","isDefaultLane","getOtherLane","undefined","lane","fetchLaneWithItsComponents","otherLane","getBitIds","Error","DEFAULT_LANE","getDefaultLaneIdsFromLane","toBitIds","bitIds","debug","otherLaneName","getAllComponentsStatus","tmp","Tmp","componentsStatus","Promise","all","map","bitId","getComponentMergeStatus","clear","err","allComponentsStatus","componentIds","resolveMultipleComponentIds","compIdsFromPattern","filterIdsFromPoolIdsByPattern","filterComponentsStatus","forEach","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","track","deleteFiles","fromLane","readmeResult","name","onDestroy","failureMsgs","chalk","bold","red","join","mergeFromScope","LaneId","parse","importLaneObject","laneIds","scopeComponentsImporter","ScopeComponentsImporter","getInstance","legacyScope","importManyDeltaWithoutDeps","toVersionLatest","repo","objects","mergedPreviously","mergedNow","bitObjectsPerComp","pMapSeries","modelComponent","getModelComponent","versionObj","loadVersion","version","laneHead","getRef","mainHead","divergeData","getDivergeData","remoteHead","checkedOutLocalHead","modifiedVersion","squashOneComp","setHead","bitObjects","compact","b","writeObjectsToTheFS","flat","exportedIds","ids","BitIds","fromArray","exported","exportMany","idsWithFutureScope","allVersions","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","remoteVersions","snapsOnRemoteOnly","remoteVersion","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","d","depsUniq","uniqFromArray","currentLaneName","succeededComponents","componentFromModel","modifiedComp","add","isDiverged","isLocalAhead","isRemoteAhead","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, { MergingMain, ComponentMergeStatus } 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, ApplyVersionResults } 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 { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { DivergeData } from '@teambit/legacy/dist/scope/component-ops/diverge-data';\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 remote?: 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 }> {\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 remote,\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 return undefined;\n }\n const lane = await consumer.scope.loadLane(otherLaneId);\n if (remote || !lane) {\n return this.lanes.fetchLaneWithItsComponents(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 consumer.scope.getDefaultLaneIdsFromLane(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 const otherLaneName = isDefaultLane ? DEFAULT_LANE : otherLaneId.toString();\n\n const getAllComponentsStatus = async (): Promise<ComponentMergeStatus[]> => {\n const tmp = new Tmp(consumer.scope);\n try {\n const componentsStatus = await Promise.all(\n bitIds.map((bitId) =>\n this.merging.getComponentMergeStatus(bitId, currentLane, otherLaneName, {\n resolveUnrelated,\n ignoreConfigChanges,\n })\n )\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n };\n let allComponentsStatus = await getAllComponentsStatus();\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 );\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 );\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 (currentLaneId.isDefault() && !noSquash) {\n 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\n await this.workspace.consumer.onDestroy();\n\n return { mergeResults, deleteResults };\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 async mergeFromScope(\n laneName: 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 const laneId = LaneId.parse(laneName);\n const lane = await this.lanes.importLaneObject(laneId);\n const laneIds = lane.toBitIds();\n const scopeComponentsImporter = ScopeComponentsImporter.getInstance(this.scope.legacyScope);\n await scopeComponentsImporter.importManyDeltaWithoutDeps(laneIds, true, lane, true);\n // get their main as well\n await scopeComponentsImporter.importManyDeltaWithoutDeps(laneIds.toVersionLatest(), true, undefined, true);\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 bitObjectsPerComp = await pMapSeries(laneIds, async (id) => {\n const modelComponent = await this.scope.legacyScope.getModelComponent(id);\n const versionObj = await modelComponent.loadVersion(id.version as string, repo);\n const laneHead = modelComponent.getRef(id.version as string);\n if (!laneHead) throw new Error(`lane head must be defined for ${id.toString()}`);\n const mainHead = modelComponent.head || null;\n if (mainHead?.isEqual(laneHead)) {\n mergedPreviously.push(id);\n return undefined;\n }\n const divergeData = await getDivergeData({\n repo,\n modelComponent,\n remoteHead: laneHead,\n checkedOutLocalHead: mainHead,\n });\n const modifiedVersion = squashOneComp(DEFAULT_LANE, laneId, id, divergeData, versionObj);\n modelComponent.setHead(laneHead);\n const objects = [modelComponent, modifiedVersion];\n mergedNow.push(id);\n return { id, objects };\n });\n const bitObjects = compact(bitObjectsPerComp).map((b) => b.objects);\n await repo.writeObjectsToTheFS(bitObjects.flat() as BitObject[]);\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: bitIds,\n idsWithFutureScope: bitIds,\n allVersions: 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\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 lane?: Lane\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 const { divergeData } = fromStatus;\n if (!divergeData) {\n throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);\n }\n const remoteVersions = divergeData.snapsOnRemoteOnly;\n if (!remoteVersions.length) {\n return;\n }\n const modelComponent = await workspace.consumer.scope.getModelComponent(compId._legacy);\n // optimization suggestion: if squash is given, check only the last version.\n await pMapSeries(remoteVersions, 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, lane);\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\nfunction squashSnaps(allComponentsStatus: ComponentMergeStatus[], otherLaneId: LaneId, consumer: Consumer) {\n const currentLaneName = consumer.getCurrentLaneId().name;\n const succeededComponents = allComponentsStatus.filter((c) => !c.unmergedMessage);\n succeededComponents.forEach(({ 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) consumer.scope.objects.add(modifiedComp);\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: DivergeData,\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.isLocalAhead()) {\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.isRemoteAhead()) {\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.snapsOnRemoteOnly;\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;AACA;EAAA;EAAA;IAAA;EAAA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E,CAACxC,QAAQ,EAAG;AACjE,yBACMC,WAAW,CAACwE,IACb,qBAAoB+F,eAAgB,8BAA6BA,eAAgB,kBAChFvK,WAAW,CAACwE,IACb;AACL,uEAAuExE,WAAW,CAACwE,IAAK,GAAE,CAAC;EACzF;EACA,IAAIgC,WAAW,CAACqE,YAAY,EAAE,EAAE;IAC9B;IACA,OAAOtK,SAAS;EAClB;EACA,IAAI,CAACiG,WAAW,CAACsE,aAAa,EAAE,EAAE;IAChC;IACA,OAAOvK,SAAS;EAClB;EACA;EACA,MAAMwK,WAAW,GAAGvE,WAAW,CAACmD,iBAAiB;EACjD,IAAIoB,WAAW,CAACvH,MAAM,KAAK,CAAC,EAAE;IAC5B,MAAM,IAAI5C,KAAK,CAAE,sDAAqD,CAAC;EACzE;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAI,CAAC6J,kBAAkB,EAAE;IACvB,MAAM,IAAI7J,KAAK,CAAC,qDAAqD,CAAC;EACxE;EAEA,MAAMoK,cAAc,GAAGP,kBAAkB,CAACQ,OAAO;;EAEjD;EACA,IAAIzE,WAAW,CAAC0E,uBAAuB,EAAE;IACvCT,kBAAkB,CAACU,eAAe,CAAC3E,WAAW,CAAC0E,uBAAuB,CAAC;EACzE,CAAC,MAAM;IACL;IACAT,kBAAkB,CAACQ,OAAO,CAAC7I,OAAO,CAAEgJ,GAAG,IAAKX,kBAAkB,CAACY,YAAY,CAACD,GAAG,CAAC,CAAC;EACnF;EACAX,kBAAkB,CAACa,WAAW,CAAC;IAAEC,eAAe,EAAEP,cAAc;IAAE5H,MAAM,EAAEpD;EAAY,CAAC,CAAC;EACxF,OAAOyK,kBAAkB;AAC3B;AAEAzC,8BAAgB,CAACwD,UAAU,CAACxN,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","remote","currentLaneId","getCurrentLaneId","isDefault","toString","otherLaneId","getParsedLaneId","isEqual","currentLane","loadLane","isDefaultLane","getOtherLane","undefined","lane","fetchLaneWithItsComponents","otherLane","getBitIds","Error","DEFAULT_LANE","getDefaultLaneIdsFromLane","toBitIds","bitIds","debug","allComponentsStatus","getMergeStatus","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","track","deleteFiles","fromLane","readmeResult","name","onDestroy","failureMsgs","map","chalk","bold","red","join","mergeFromScope","LaneId","parse","importLaneObject","laneIds","scopeComponentsImporter","ScopeComponentsImporter","getInstance","legacyScope","importManyDeltaWithoutDeps","ids","fromHead","ignoreMissingHead","toVersionLatest","repo","objects","mergedPreviously","mergedNow","bitObjectsPerComp","pMapSeries","modelComponent","getModelComponent","versionObj","loadVersion","version","laneHead","getRef","mainHead","divergeData","getDivergeData","remoteHead","checkedOutLocalHead","modifiedVersion","squashOneComp","setHead","bitObjects","compact","b","writeObjectsToTheFS","flat","exportedIds","BitIds","fromArray","exported","exportMany","idsWithFutureScope","allVersions","exportHeadsOnly","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","remoteVersions","snapsOnRemoteOnly","remoteVersion","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","Promise","all","dep","isOnLane","isIdOnLane","d","depsUniq","uniqFromArray","currentLaneName","succeededComponents","componentFromModel","modifiedComp","add","isDiverged","isLocalAhead","isRemoteAhead","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, { MergingMain, ComponentMergeStatus } 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, ApplyVersionResults } 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 { DivergeData } from '@teambit/legacy/dist/scope/component-ops/diverge-data';\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 remote?: 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 }> {\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 remote,\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 return undefined;\n }\n const lane = await consumer.scope.loadLane(otherLaneId);\n if (remote || !lane) {\n return this.lanes.fetchLaneWithItsComponents(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 consumer.scope.getDefaultLaneIdsFromLane(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\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 );\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 );\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 (currentLaneId.isDefault() && !noSquash) {\n 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\n await this.workspace.consumer.onDestroy();\n\n return { mergeResults, deleteResults };\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 async mergeFromScope(\n laneName: 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 const laneId = LaneId.parse(laneName);\n const lane = await this.lanes.importLaneObject(laneId);\n const laneIds = lane.toBitIds();\n const scopeComponentsImporter = ScopeComponentsImporter.getInstance(this.scope.legacyScope);\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids: laneIds,\n fromHead: true,\n lane,\n ignoreMissingHead: true,\n });\n // get their main as well\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids: laneIds.toVersionLatest(),\n fromHead: true,\n ignoreMissingHead: true,\n });\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 bitObjectsPerComp = await pMapSeries(laneIds, async (id) => {\n const modelComponent = await this.scope.legacyScope.getModelComponent(id);\n const versionObj = await modelComponent.loadVersion(id.version as string, repo);\n const laneHead = modelComponent.getRef(id.version as string);\n if (!laneHead) throw new Error(`lane head must be defined for ${id.toString()}`);\n const mainHead = modelComponent.head || null;\n if (mainHead?.isEqual(laneHead)) {\n mergedPreviously.push(id);\n return undefined;\n }\n const divergeData = await getDivergeData({\n repo,\n modelComponent,\n remoteHead: laneHead,\n checkedOutLocalHead: mainHead,\n });\n const modifiedVersion = squashOneComp(DEFAULT_LANE, laneId, id, divergeData, versionObj);\n modelComponent.setHead(laneHead);\n const objects = [modelComponent, modifiedVersion];\n mergedNow.push(id);\n return { id, objects };\n });\n const bitObjects = compact(bitObjectsPerComp).map((b) => b.objects);\n await repo.writeObjectsToTheFS(bitObjects.flat() as BitObject[]);\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: bitIds,\n idsWithFutureScope: bitIds,\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: true,\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\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 lane?: Lane\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 const { divergeData } = fromStatus;\n if (!divergeData) {\n throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);\n }\n const remoteVersions = divergeData.snapsOnRemoteOnly;\n if (!remoteVersions.length) {\n return;\n }\n const modelComponent = await workspace.consumer.scope.getModelComponent(compId._legacy);\n // optimization suggestion: if squash is given, check only the last version.\n await pMapSeries(remoteVersions, 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, lane);\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\nfunction squashSnaps(allComponentsStatus: ComponentMergeStatus[], otherLaneId: LaneId, consumer: Consumer) {\n const currentLaneName = consumer.getCurrentLaneId().name;\n const succeededComponents = allComponentsStatus.filter((c) => !c.unmergedMessage);\n succeededComponents.forEach(({ 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) consumer.scope.objects.add(modifiedComp);\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: DivergeData,\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.isLocalAhead()) {\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.isRemoteAhead()) {\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.snapsOnRemoteOnly;\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;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAA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EACA;EACA;EACA,IAAI,CAACyJ,kBAAkB,EAAE;IACvB,MAAM,IAAIzJ,KAAK,CAAC,qDAAqD,CAAC;EACxE;EAEA,MAAMgK,cAAc,GAAGP,kBAAkB,CAACQ,OAAO;;EAEjD;EACA,IAAI3E,WAAW,CAAC4E,uBAAuB,EAAE;IACvCT,kBAAkB,CAACU,eAAe,CAAC7E,WAAW,CAAC4E,uBAAuB,CAAC;EACzE,CAAC,MAAM;IACL;IACAT,kBAAkB,CAACQ,OAAO,CAACpJ,OAAO,CAAEuJ,GAAG,IAAKX,kBAAkB,CAACY,YAAY,CAACD,GAAG,CAAC,CAAC;EACnF;EACAX,kBAAkB,CAACa,WAAW,CAAC;IAAEC,eAAe,EAAEP,cAAc;IAAElI,MAAM,EAAE1C;EAAY,CAAC,CAAC;EACxF,OAAOqK,kBAAkB;AAC3B;AAEA3C,8BAAgB,CAAC0D,UAAU,CAACpN,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.75",
|
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.
|
9
|
+
"version": "0.0.75"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "2.4.2",
|
@@ -16,17 +16,17 @@
|
|
16
16
|
"core-js": "^3.0.0",
|
17
17
|
"@teambit/harmony": "0.3.3",
|
18
18
|
"@teambit/bit-error": "0.0.402",
|
19
|
-
"@teambit/cli": "0.0.
|
20
|
-
"@teambit/merging": "0.0.
|
19
|
+
"@teambit/cli": "0.0.600",
|
20
|
+
"@teambit/merging": "0.0.213",
|
21
21
|
"@teambit/component-id": "0.0.425",
|
22
|
-
"@teambit/export": "0.0.
|
23
|
-
"@teambit/lane-id": "0.0.
|
24
|
-
"@teambit/lanes": "0.0.
|
22
|
+
"@teambit/export": "0.0.898",
|
23
|
+
"@teambit/lane-id": "0.0.118",
|
24
|
+
"@teambit/lanes": "0.0.470",
|
25
25
|
"@teambit/legacy-bit-id": "0.0.421",
|
26
|
-
"@teambit/logger": "0.0.
|
27
|
-
"@teambit/remove": "0.0.
|
28
|
-
"@teambit/scope": "0.0.
|
29
|
-
"@teambit/workspace": "0.0.
|
26
|
+
"@teambit/logger": "0.0.693",
|
27
|
+
"@teambit/remove": "0.0.75",
|
28
|
+
"@teambit/scope": "0.0.898",
|
29
|
+
"@teambit/workspace": "0.0.898"
|
30
30
|
},
|
31
31
|
"devDependencies": {
|
32
32
|
"@types/lodash": "4.14.165",
|
@@ -38,7 +38,7 @@
|
|
38
38
|
"@types/node": "12.20.4"
|
39
39
|
},
|
40
40
|
"peerDependencies": {
|
41
|
-
"@teambit/legacy": "1.0.
|
41
|
+
"@teambit/legacy": "1.0.383",
|
42
42
|
"react-dom": "^16.8.0 || ^17.0.0",
|
43
43
|
"react": "^16.8.0 || ^17.0.0"
|
44
44
|
},
|
File without changes
|
Binary file
|