@teambit/merge-lanes 0.0.240 → 0.0.242

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.
@@ -16,7 +16,7 @@ export declare class MergeLaneCmd implements Command {
16
16
  migration: boolean;
17
17
  remoteOp: boolean;
18
18
  constructor(mergeLanes: MergeLanesMain);
19
- report([name, pattern]: [string, string], { ours, theirs, manual, build, workspace: existingOnWorkspaceOnly, noSnap, tag, message: snapMessage, keepReadme, noSquash, skipDependencyInstallation, skipFetch, includeDeps, resolveUnrelated, ignoreConfigChanges, verbose, }: {
19
+ report([name, pattern]: [string, string], { ours, theirs, manual, build, workspace: existingOnWorkspaceOnly, squash, noSnap, tag, message: snapMessage, keepReadme, noSquash, skipDependencyInstallation, skipFetch, includeDeps, resolveUnrelated, ignoreConfigChanges, verbose, }: {
20
20
  ours: boolean;
21
21
  theirs: boolean;
22
22
  manual: boolean;
@@ -26,6 +26,7 @@ export declare class MergeLaneCmd implements Command {
26
26
  tag: boolean;
27
27
  message: string;
28
28
  keepReadme?: boolean;
29
+ squash?: boolean;
29
30
  noSquash: boolean;
30
31
  skipDependencyInstallation?: boolean;
31
32
  skipFetch: boolean;
@@ -76,7 +76,7 @@ it will snap-merge these components to complete the merge. use "no-snap" to opt-
76
76
  description: 'EXPERIMENTAL. partially merge the lane with the specified component-pattern'
77
77
  }]);
78
78
  (0, _defineProperty2().default)(this, "alias", '');
79
- (0, _defineProperty2().default)(this, "options", [['', 'ours', 'in case of a conflict, override the used version with the current modification'], ['', 'theirs', 'in case of a conflict, override the current modification with the specified version'], ['', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'], ['', 'workspace', 'merge only components in a lane that exist in the workspace'], ['', 'no-snap', 'do not auto snap in case the merge completed without conflicts'], ['', 'tag', 'tag all lane components after merging into main (also tag-merge in case of snap-merge)'], ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'], ['m', 'message <message>', 'override the default message for the auto snap'], ['', 'keep-readme', 'skip deleting the lane readme component after merging'], ['', 'no-squash', 'EXPERIMENTAL. relevant for merging lanes into main, which by default squash.'], ['', 'ignore-config-changes', 'allow merging when component are modified due to config changes (such as dependencies) only and not files'], ['', 'verbose', 'show details of components that were not merged legitimately'], ['x', 'skip-dependency-installation', 'do not install packages of the imported components'], ['', 'skip-fetch', 'use the current target-lane if exits locally without updating it from the remote'], ['', 'include-deps', 'EXPERIMENTAL. relevant for "--pattern" and "--workspace". merge also dependencies of the given components'], ['', 'resolve-unrelated [merge-strategy]', 'EXPERIMENTAL. relevant when a component on a lane and the component on main has nothing in common. merge-strategy can be "ours" (default) or "theirs"']]);
79
+ (0, _defineProperty2().default)(this, "options", [['', 'ours', 'in case of a conflict, override the used version with the current modification'], ['', 'theirs', 'in case of a conflict, override the current modification with the specified version'], ['', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'], ['', 'workspace', 'merge only components in a lane that exist in the workspace'], ['', 'no-snap', 'do not auto snap in case the merge completed without conflicts'], ['', 'tag', 'tag all lane components after merging into main (also tag-merge in case of snap-merge)'], ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'], ['m', 'message <message>', 'override the default message for the auto snap'], ['', 'keep-readme', 'skip deleting the lane readme component after merging'], ['', 'no-squash', 'relevant for merging lanes into main, which by default squash'], ['', 'squash', 'EXPERIMENTAL. relevant for merging a lane into another lane, which by default does not squash'], ['', 'ignore-config-changes', 'allow merging when component are modified due to config changes (such as dependencies) only and not files'], ['', 'verbose', 'show details of components that were not merged legitimately'], ['x', 'skip-dependency-installation', 'do not install packages of the imported components'], ['', 'skip-fetch', 'use the current target-lane if exits locally without updating it from the remote'], ['', 'include-deps', 'EXPERIMENTAL. relevant for "--pattern" and "--workspace". merge also dependencies of the given components'], ['', 'resolve-unrelated [merge-strategy]', 'EXPERIMENTAL. relevant when a component on a lane and the component on main has nothing in common. merge-strategy can be "ours" (default) or "theirs"']]);
80
80
  (0, _defineProperty2().default)(this, "loader", true);
81
81
  (0, _defineProperty2().default)(this, "private", true);
82
82
  (0, _defineProperty2().default)(this, "migration", true);
@@ -88,6 +88,7 @@ it will snap-merge these components to complete the merge. use "no-snap" to opt-
88
88
  manual = false,
89
89
  build,
90
90
  workspace: existingOnWorkspaceOnly = false,
91
+ squash = false,
91
92
  noSnap = false,
92
93
  tag = false,
93
94
  message: snapMessage = '',
@@ -129,6 +130,7 @@ it will snap-merge these components to complete the merge. use "no-snap" to opt-
129
130
  noSnap,
130
131
  snapMessage,
131
132
  keepReadme,
133
+ squash,
132
134
  noSquash,
133
135
  tag,
134
136
  pattern,
@@ -1 +1 @@
1
- {"version":3,"names":["MergeLaneCmd","constructor","mergeLanes","name","description","report","pattern","ours","theirs","manual","build","workspace","existingOnWorkspaceOnly","noSnap","tag","message","snapMessage","keepReadme","noSquash","skipDependencyInstallation","skipFetch","includeDeps","resolveUnrelated","ignoreConfigChanges","verbose","isFeatureEnabled","BUILD_ON_CI","Boolean","mergeStrategy","getMergeStrategy","BitError","getResolveUnrelated","undefined","Error","mergeResults","deleteResults","configMergeResults","mergeLane","mergeResult","mergeReport","deleteResult","localResult","paintRemoved","remoteResult","map","item","readmeResult","chalk","yellow"],"sources":["merge-lane.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { getMergeStrategy, MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { mergeReport } from '@teambit/merging';\nimport { BUILD_ON_CI, isFeatureEnabled } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';\nimport { BitError } from '@teambit/bit-error';\nimport paintRemoved from '@teambit/legacy/dist/cli/templates/remove-template';\nimport { MergeLanesMain } from './merge-lanes.main.runtime';\n\nexport class MergeLaneCmd implements Command {\n name = 'merge <lane> [pattern]';\n description = `merge a local or a remote lane`;\n extendedDescription = `by default, the provided lane will be fetched from the remote before merging.\nto merge the lane from the local scope without updating it first, use \"--skip-fetch\" flag.\n\nwhen the current and the other lanes are diverged in history and the files could be merged with no conflicts,\nit will snap-merge these components to complete the merge. use \"no-snap\" to opt-out, or \"tag\" to tag instead`;\n arguments = [\n {\n name: 'lane',\n description: 'lane-name or lane-id (if not exists locally) to merge to the current lane',\n },\n {\n name: 'pattern',\n description: 'EXPERIMENTAL. partially merge the lane with the specified component-pattern',\n },\n ];\n alias = '';\n options = [\n ['', 'ours', 'in case of a conflict, override the used version with the current modification'],\n ['', 'theirs', 'in case of a conflict, override the current modification with the specified version'],\n ['', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'],\n ['', 'workspace', 'merge only components in a lane that exist in the workspace'],\n ['', 'no-snap', 'do not auto snap in case the merge completed without conflicts'],\n ['', 'tag', 'tag all lane components after merging into main (also tag-merge in case of snap-merge)'],\n ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'],\n ['m', 'message <message>', 'override the default message for the auto snap'],\n ['', 'keep-readme', 'skip deleting the lane readme component after merging'],\n ['', 'no-squash', 'EXPERIMENTAL. relevant for merging lanes into main, which by default squash.'],\n [\n '',\n 'ignore-config-changes',\n 'allow merging when component are modified due to config changes (such as dependencies) only and not files',\n ],\n ['', 'verbose', 'show details of components that were not merged legitimately'],\n ['x', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ['', 'skip-fetch', 'use the current target-lane if exits locally without updating it from the remote'],\n [\n '',\n 'include-deps',\n 'EXPERIMENTAL. relevant for \"--pattern\" and \"--workspace\". merge also dependencies of the given components',\n ],\n [\n '',\n 'resolve-unrelated [merge-strategy]',\n 'EXPERIMENTAL. relevant when a component on a lane and the component on main has nothing in common. merge-strategy can be \"ours\" (default) or \"theirs\"',\n ],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n remoteOp = true;\n\n constructor(private mergeLanes: MergeLanesMain) {}\n\n async report(\n [name, pattern]: [string, string],\n {\n ours = false,\n theirs = false,\n manual = false,\n build,\n workspace: existingOnWorkspaceOnly = false,\n noSnap = false,\n tag = false,\n message: snapMessage = '',\n keepReadme = false,\n noSquash = false,\n skipDependencyInstallation = false,\n skipFetch = false,\n includeDeps = false,\n resolveUnrelated,\n ignoreConfigChanges,\n verbose = false,\n }: {\n ours: boolean;\n theirs: boolean;\n manual: boolean;\n workspace?: boolean;\n build?: boolean;\n noSnap: boolean;\n tag: boolean;\n message: string;\n keepReadme?: boolean;\n noSquash: boolean;\n skipDependencyInstallation?: boolean;\n skipFetch: boolean;\n includeDeps?: boolean;\n resolveUnrelated?: string | boolean;\n ignoreConfigChanges?: boolean;\n verbose?: boolean;\n }\n ): Promise<string> {\n build = isFeatureEnabled(BUILD_ON_CI) ? Boolean(build) : true;\n const mergeStrategy = getMergeStrategy(ours, theirs, manual);\n if (noSnap && snapMessage) throw new BitError('unable to use \"noSnap\" and \"message\" flags together');\n if (includeDeps && !pattern && !existingOnWorkspaceOnly) {\n throw new BitError(`\"--include-deps\" flag is relevant only for --workspace and --pattern flags`);\n }\n const getResolveUnrelated = (): MergeStrategy | undefined => {\n if (!resolveUnrelated) return undefined;\n if (typeof resolveUnrelated === 'boolean') return 'ours';\n if (resolveUnrelated !== 'ours' && resolveUnrelated !== 'theirs' && resolveUnrelated !== 'manual') {\n throw new Error('--resolve-unrelated must be one of the following: [ours, theirs, manual]');\n }\n return resolveUnrelated;\n };\n if (resolveUnrelated && typeof resolveUnrelated === 'boolean') {\n resolveUnrelated = 'ours';\n }\n const { mergeResults, deleteResults, configMergeResults } = await this.mergeLanes.mergeLane(name, {\n build,\n // @ts-ignore\n mergeStrategy,\n existingOnWorkspaceOnly,\n noSnap,\n snapMessage,\n keepReadme,\n noSquash,\n tag,\n pattern,\n skipDependencyInstallation,\n skipFetch,\n resolveUnrelated: getResolveUnrelated(),\n ignoreConfigChanges,\n includeDeps,\n });\n\n const mergeResult = mergeReport({ ...mergeResults, configMergeResults, verbose });\n const deleteResult = `${deleteResults.localResult ? paintRemoved(deleteResults.localResult, false) : ''}${(\n deleteResults.remoteResult || []\n ).map((item) => paintRemoved(item, true))}${\n (deleteResults.readmeResult && chalk.yellow(deleteResults.readmeResult)) || ''\n }\\n`;\n return mergeResult + deleteResult;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;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;AAA8E;AAAA;AAGvE,MAAMA,YAAY,CAAoB;EAsD3CC,WAAW,CAASC,UAA0B,EAAE;IAAA,KAA5BA,UAA0B,GAA1BA,UAA0B;IAAA,8CArDvC,wBAAwB;IAAA,qDAChB,gCAA+B;IAAA,6DACvB;AACzB;AACA;AACA;AACA,6GAA6G;IAAA,mDAC/F,CACV;MACEC,IAAI,EAAE,MAAM;MACZC,WAAW,EAAE;IACf,CAAC,EACD;MACED,IAAI,EAAE,SAAS;MACfC,WAAW,EAAE;IACf,CAAC,CACF;IAAA,+CACO,EAAE;IAAA,iDACA,CACR,CAAC,EAAE,EAAE,MAAM,EAAE,gFAAgF,CAAC,EAC9F,CAAC,EAAE,EAAE,QAAQ,EAAE,qFAAqF,CAAC,EACrG,CAAC,EAAE,EAAE,QAAQ,EAAE,6FAA6F,CAAC,EAC7G,CAAC,EAAE,EAAE,WAAW,EAAE,6DAA6D,CAAC,EAChF,CAAC,EAAE,EAAE,SAAS,EAAE,gEAAgE,CAAC,EACjF,CAAC,EAAE,EAAE,KAAK,EAAE,wFAAwF,CAAC,EACrG,CAAC,EAAE,EAAE,OAAO,EAAE,wFAAwF,CAAC,EACvG,CAAC,GAAG,EAAE,mBAAmB,EAAE,gDAAgD,CAAC,EAC5E,CAAC,EAAE,EAAE,aAAa,EAAE,uDAAuD,CAAC,EAC5E,CAAC,EAAE,EAAE,WA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,CAAC,IAAK,EAC7E,IAAG;IACJ,OAAOR,WAAW,GAAGE,YAAY;EACnC;AACF;AAAC"}
1
+ {"version":3,"names":["MergeLaneCmd","constructor","mergeLanes","name","description","report","pattern","ours","theirs","manual","build","workspace","existingOnWorkspaceOnly","squash","noSnap","tag","message","snapMessage","keepReadme","noSquash","skipDependencyInstallation","skipFetch","includeDeps","resolveUnrelated","ignoreConfigChanges","verbose","isFeatureEnabled","BUILD_ON_CI","Boolean","mergeStrategy","getMergeStrategy","BitError","getResolveUnrelated","undefined","Error","mergeResults","deleteResults","configMergeResults","mergeLane","mergeResult","mergeReport","deleteResult","localResult","paintRemoved","remoteResult","map","item","readmeResult","chalk","yellow"],"sources":["merge-lane.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { getMergeStrategy, MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { mergeReport } from '@teambit/merging';\nimport { BUILD_ON_CI, isFeatureEnabled } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';\nimport { BitError } from '@teambit/bit-error';\nimport paintRemoved from '@teambit/legacy/dist/cli/templates/remove-template';\nimport { MergeLanesMain } from './merge-lanes.main.runtime';\n\nexport class MergeLaneCmd implements Command {\n name = 'merge <lane> [pattern]';\n description = `merge a local or a remote lane`;\n extendedDescription = `by default, the provided lane will be fetched from the remote before merging.\nto merge the lane from the local scope without updating it first, use \"--skip-fetch\" flag.\n\nwhen the current and the other lanes are diverged in history and the files could be merged with no conflicts,\nit will snap-merge these components to complete the merge. use \"no-snap\" to opt-out, or \"tag\" to tag instead`;\n arguments = [\n {\n name: 'lane',\n description: 'lane-name or lane-id (if not exists locally) to merge to the current lane',\n },\n {\n name: 'pattern',\n description: 'EXPERIMENTAL. partially merge the lane with the specified component-pattern',\n },\n ];\n alias = '';\n options = [\n ['', 'ours', 'in case of a conflict, override the used version with the current modification'],\n ['', 'theirs', 'in case of a conflict, override the current modification with the specified version'],\n ['', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'],\n ['', 'workspace', 'merge only components in a lane that exist in the workspace'],\n ['', 'no-snap', 'do not auto snap in case the merge completed without conflicts'],\n ['', 'tag', 'tag all lane components after merging into main (also tag-merge in case of snap-merge)'],\n ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'],\n ['m', 'message <message>', 'override the default message for the auto snap'],\n ['', 'keep-readme', 'skip deleting the lane readme component after merging'],\n ['', 'no-squash', 'relevant for merging lanes into main, which by default squash'],\n ['', 'squash', 'EXPERIMENTAL. relevant for merging a lane into another lane, which by default does not squash'],\n [\n '',\n 'ignore-config-changes',\n 'allow merging when component are modified due to config changes (such as dependencies) only and not files',\n ],\n ['', 'verbose', 'show details of components that were not merged legitimately'],\n ['x', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ['', 'skip-fetch', 'use the current target-lane if exits locally without updating it from the remote'],\n [\n '',\n 'include-deps',\n 'EXPERIMENTAL. relevant for \"--pattern\" and \"--workspace\". merge also dependencies of the given components',\n ],\n [\n '',\n 'resolve-unrelated [merge-strategy]',\n 'EXPERIMENTAL. relevant when a component on a lane and the component on main has nothing in common. merge-strategy can be \"ours\" (default) or \"theirs\"',\n ],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n remoteOp = true;\n\n constructor(private mergeLanes: MergeLanesMain) {}\n\n async report(\n [name, pattern]: [string, string],\n {\n ours = false,\n theirs = false,\n manual = false,\n build,\n workspace: existingOnWorkspaceOnly = false,\n squash = false,\n noSnap = false,\n tag = false,\n message: snapMessage = '',\n keepReadme = false,\n noSquash = false,\n skipDependencyInstallation = false,\n skipFetch = false,\n includeDeps = false,\n resolveUnrelated,\n ignoreConfigChanges,\n verbose = false,\n }: {\n ours: boolean;\n theirs: boolean;\n manual: boolean;\n workspace?: boolean;\n build?: boolean;\n noSnap: boolean;\n tag: boolean;\n message: string;\n keepReadme?: boolean;\n squash?: boolean;\n noSquash: boolean;\n skipDependencyInstallation?: boolean;\n skipFetch: boolean;\n includeDeps?: boolean;\n resolveUnrelated?: string | boolean;\n ignoreConfigChanges?: boolean;\n verbose?: boolean;\n }\n ): Promise<string> {\n build = isFeatureEnabled(BUILD_ON_CI) ? Boolean(build) : true;\n const mergeStrategy = getMergeStrategy(ours, theirs, manual);\n if (noSnap && snapMessage) throw new BitError('unable to use \"noSnap\" and \"message\" flags together');\n if (includeDeps && !pattern && !existingOnWorkspaceOnly) {\n throw new BitError(`\"--include-deps\" flag is relevant only for --workspace and --pattern flags`);\n }\n const getResolveUnrelated = (): MergeStrategy | undefined => {\n if (!resolveUnrelated) return undefined;\n if (typeof resolveUnrelated === 'boolean') return 'ours';\n if (resolveUnrelated !== 'ours' && resolveUnrelated !== 'theirs' && resolveUnrelated !== 'manual') {\n throw new Error('--resolve-unrelated must be one of the following: [ours, theirs, manual]');\n }\n return resolveUnrelated;\n };\n if (resolveUnrelated && typeof resolveUnrelated === 'boolean') {\n resolveUnrelated = 'ours';\n }\n const { mergeResults, deleteResults, configMergeResults } = await this.mergeLanes.mergeLane(name, {\n build,\n // @ts-ignore\n mergeStrategy,\n existingOnWorkspaceOnly,\n noSnap,\n snapMessage,\n keepReadme,\n squash,\n noSquash,\n tag,\n pattern,\n skipDependencyInstallation,\n skipFetch,\n resolveUnrelated: getResolveUnrelated(),\n ignoreConfigChanges,\n includeDeps,\n });\n\n const mergeResult = mergeReport({ ...mergeResults, configMergeResults, verbose });\n const deleteResult = `${deleteResults.localResult ? paintRemoved(deleteResults.localResult, false) : ''}${(\n deleteResults.remoteResult || []\n ).map((item) => paintRemoved(item, true))}${\n (deleteResults.readmeResult && chalk.yellow(deleteResults.readmeResult)) || ''\n }\\n`;\n return mergeResult + deleteResult;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;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;
17
17
  keepReadme: boolean;
18
+ squash?: boolean;
18
19
  noSquash: boolean;
19
20
  tag?: boolean;
20
21
  pattern?: string;
@@ -189,6 +189,7 @@ class MergeLanesMain {
189
189
  existingOnWorkspaceOnly,
190
190
  build,
191
191
  keepReadme,
192
+ squash,
192
193
  noSquash,
193
194
  pattern,
194
195
  includeDeps,
@@ -242,7 +243,7 @@ class MergeLanesMain {
242
243
  resolveUnrelated,
243
244
  ignoreConfigChanges
244
245
  });
245
- const shouldSquash = currentLaneId.isDefault() && !noSquash;
246
+ const shouldSquash = squash || currentLaneId.isDefault() && !noSquash;
246
247
  if (pattern) {
247
248
  const componentIds = await this.workspace.resolveMultipleComponentIds(bitIds);
248
249
  const compIdsFromPattern = this.workspace.scope.filterIdsFromPoolIdsByPattern(pattern, componentIds);
@@ -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","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","compId","fromStatus","targetVersions","snapsOnTargetOnly","headOnTarget","remoteVersion","versionObj","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","d","depsUniq","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 } from 'lodash';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { BitObject } from '@teambit/legacy/dist/scope/objects';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { MergeLanesAspect } from './merge-lanes.aspect';\nimport { MergeLaneCmd } from './merge-lane.cmd';\nimport { MergeLaneFromScopeCmd } from './merge-lane-from-scope.cmd';\n\nexport type MergeLaneOptions = {\n mergeStrategy: MergeStrategy;\n noSnap: boolean;\n snapMessage: string;\n existingOnWorkspaceOnly: boolean;\n build: boolean;\n keepReadme: boolean;\n noSquash: boolean;\n tag?: boolean;\n pattern?: string;\n includeDeps?: boolean;\n skipDependencyInstallation?: boolean;\n resolveUnrelated?: MergeStrategy;\n ignoreConfigChanges?: boolean;\n skipFetch?: boolean;\n};\n\nexport class MergeLanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private merging: MergingMain,\n private lanes: LanesMain,\n private logger: Logger,\n private remove: RemoveMain,\n private scope: ScopeMain,\n private exporter: ExportMain,\n 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 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 = 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 await pMapSeries(compIdsToKeep, async (compId) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(compId._legacy));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n if (fromStatus.unmergedMessage) {\n return;\n }\n if (!otherLane) {\n // if merging main, no need to check whether the deps are included in the pattern.\n return;\n }\n const { divergeData } = fromStatus;\n if (!divergeData) {\n throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);\n }\n let targetVersions = divergeData.snapsOnTargetOnly;\n if (!targetVersions.length) {\n return;\n }\n const modelComponent = await workspace.consumer.scope.getModelComponent(compId._legacy);\n if (shouldSquash) {\n // no need to check all versions, we merge only the head\n const headOnTarget = otherLane ? otherLane.getComponent(compId._legacy)?.head : modelComponent.head;\n if (!headOnTarget) {\n throw new Error(`filterComponentsStatus: unable to find head for ${compId.toString()}`);\n }\n targetVersions = [headOnTarget];\n }\n\n await pMapSeries(targetVersions, async (remoteVersion) => {\n const versionObj = await modelComponent.loadVersion(remoteVersion.toString(), workspace.consumer.scope.objects);\n const flattenedDeps = versionObj.getAllFlattenedDependencies();\n const depsNotIncludeInPattern = flattenedDeps.filter((id) =>\n bitIdsNotFromPattern.find((bitId) => bitId.isEqualWithoutVersion(id))\n );\n if (!depsNotIncludeInPattern.length) {\n return;\n }\n const depsOnLane: BitId[] = [];\n await Promise.all(\n depsNotIncludeInPattern.map(async (dep) => {\n const isOnLane = await workspace.consumer.scope.isIdOnLane(dep, otherLane);\n if (isOnLane) {\n depsOnLane.push(dep);\n }\n })\n );\n if (!depsOnLane.length) {\n return;\n }\n if (!includeDeps) {\n throw new BitError(`unable to merge ${compId.toString()}.\nit has (in version ${remoteVersion.toString()}) the following dependencies which were not included in the pattern. consider adding \"--include-deps\" flag\n${depsOnLane.map((d) => d.toString()).join('\\n')}`);\n }\n depsToAdd.push(...depsOnLane);\n });\n });\n if (depsToAdd.length) {\n const depsUniq = BitIds.uniqFromArray(depsToAdd);\n depsUniq.forEach((id) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n });\n }\n return filteredComponentStatus;\n}\n\nasync function 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;EA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AEiH,GAAG,CAAC;EAC7F,OAAO6F,kBAAkB;AAC3B;AAEA/C,8BAAgB,CAACgE,UAAU,CAAChQ,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","compId","fromStatus","targetVersions","snapsOnTargetOnly","headOnTarget","remoteVersion","versionObj","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","d","depsUniq","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 } 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 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 await pMapSeries(compIdsToKeep, async (compId) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(compId._legacy));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n if (fromStatus.unmergedMessage) {\n return;\n }\n if (!otherLane) {\n // if merging main, no need to check whether the deps are included in the pattern.\n return;\n }\n const { divergeData } = fromStatus;\n if (!divergeData) {\n throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);\n }\n let targetVersions = divergeData.snapsOnTargetOnly;\n if (!targetVersions.length) {\n return;\n }\n const modelComponent = await workspace.consumer.scope.getModelComponent(compId._legacy);\n if (shouldSquash) {\n // no need to check all versions, we merge only the head\n const headOnTarget = otherLane ? otherLane.getComponent(compId._legacy)?.head : modelComponent.head;\n if (!headOnTarget) {\n throw new Error(`filterComponentsStatus: unable to find head for ${compId.toString()}`);\n }\n targetVersions = [headOnTarget];\n }\n\n await pMapSeries(targetVersions, async (remoteVersion) => {\n const versionObj = await modelComponent.loadVersion(remoteVersion.toString(), workspace.consumer.scope.objects);\n const flattenedDeps = versionObj.getAllFlattenedDependencies();\n const depsNotIncludeInPattern = flattenedDeps.filter((id) =>\n bitIdsNotFromPattern.find((bitId) => bitId.isEqualWithoutVersion(id))\n );\n if (!depsNotIncludeInPattern.length) {\n return;\n }\n const depsOnLane: BitId[] = [];\n await Promise.all(\n depsNotIncludeInPattern.map(async (dep) => {\n const isOnLane = await workspace.consumer.scope.isIdOnLane(dep, otherLane);\n if (isOnLane) {\n depsOnLane.push(dep);\n }\n })\n );\n if (!depsOnLane.length) {\n return;\n }\n if (!includeDeps) {\n throw new BitError(`unable to merge ${compId.toString()}.\nit has (in version ${remoteVersion.toString()}) the following dependencies which were not included in the pattern. consider adding \"--include-deps\" flag\n${depsOnLane.map((d) => d.toString()).join('\\n')}`);\n }\n depsToAdd.push(...depsOnLane);\n });\n });\n if (depsToAdd.length) {\n const depsUniq = BitIds.uniqFromArray(depsToAdd);\n depsUniq.forEach((id) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n });\n }\n return filteredComponentStatus;\n}\n\nasync function 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;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAMA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;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AW,CAACgE,IACb;AACL,uEAAuEhE,WAAW,CAACgE,IAAK,GAAE,CAAC;EACzF;EACA,IAAI8D,WAAW,CAACsF,aAAa,EAAE,EAAE;IAC/B;IACA,OAAO1M,SAAS;EAClB;EACA,IAAI,CAACoH,WAAW,CAACuF,aAAa,EAAE,EAAE;IAChC;IACA,OAAO3M,SAAS;EAClB;EACA;EACA,MAAM4M,WAAW,GAAGxF,WAAW,CAAC6D,iBAAiB;EACjD,IAAI2B,WAAW,CAAClK,MAAM,KAAK,CAAC,EAAE;IAC5B,MAAM,IAAIlC,KAAK,CAAE,sDAAqD,CAAC;EACzE;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAI,CAAC4L,kBAAkB,EAAE;IACvB,MAAM,IAAI5L,KAAK,CAAC,qDAAqD,CAAC;EACxE;EAEA,MAAMqM,cAAc,GAAGT,kBAAkB,CAACU,OAAO;;EAEjD;EACA,IAAI1F,WAAW,CAAC2F,uBAAuB,EAAE;IACvCX,kBAAkB,CAACY,eAAe,CAAC5F,WAAW,CAAC2F,uBAAuB,CAAC;EACzE,CAAC,MAAM;IACL;IACAX,kBAAkB,CAACU,OAAO,CAACzL,OAAO,CAAE4L,GAAG,IAAKb,kBAAkB,CAACc,YAAY,CAACD,GAAG,CAAC,CAAC;EACnF;EACAb,kBAAkB,CAACe,WAAW,CAAC;IAAEC,eAAe,EAAEP,cAAc;IAAEvK,MAAM,EAAEhD;EAAY,CAAC,EAAEiH,GAAG,CAAC;EAC7F,OAAO6F,kBAAkB;AAC3B;AAEA/C,8BAAgB,CAACgE,UAAU,CAACjQ,cAAc,CAAC;AAAC,eAE7BA,cAAc;AAAA"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/merge-lanes",
3
- "version": "0.0.240",
3
+ "version": "0.0.242",
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.240"
9
+ "version": "0.0.242"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -18,17 +18,17 @@
18
18
  "@teambit/component-id": "0.0.427",
19
19
  "@teambit/legacy-bit-id": "0.0.423",
20
20
  "@teambit/bit-error": "0.0.402",
21
- "@teambit/cli": "0.0.716",
22
- "@teambit/lane-id": "0.0.233",
23
- "@teambit/merging": "0.0.378",
24
- "@teambit/export": "0.0.1063",
25
- "@teambit/importer": "0.0.492",
26
- "@teambit/lanes": "0.0.635",
27
- "@teambit/logger": "0.0.809",
28
- "@teambit/remove": "0.0.240",
29
- "@teambit/scope": "0.0.1063",
30
- "@teambit/snapping": "0.0.378",
31
- "@teambit/workspace": "0.0.1063"
21
+ "@teambit/cli": "0.0.718",
22
+ "@teambit/lane-id": "0.0.235",
23
+ "@teambit/merging": "0.0.380",
24
+ "@teambit/export": "0.0.1065",
25
+ "@teambit/importer": "0.0.494",
26
+ "@teambit/lanes": "0.0.637",
27
+ "@teambit/logger": "0.0.811",
28
+ "@teambit/remove": "0.0.242",
29
+ "@teambit/scope": "0.0.1065",
30
+ "@teambit/snapping": "0.0.380",
31
+ "@teambit/workspace": "0.0.1065"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/lodash": "4.14.165",
@@ -40,7 +40,7 @@
40
40
  "@types/testing-library__jest-dom": "5.9.5"
41
41
  },
42
42
  "peerDependencies": {
43
- "@teambit/legacy": "1.0.496",
43
+ "@teambit/legacy": "1.0.498",
44
44
  "react": "^16.8.0 || ^17.0.0",
45
45
  "react-dom": "^16.8.0 || ^17.0.0"
46
46
  },