@teambit/merge-lanes 0.0.29 → 0.0.30

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,13 +16,14 @@ 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, message: snapMessage, keepReadme, noSquash, skipDependencyInstallation, remote, includeDeps, resolveUnrelated, ignoreConfigChanges, verbose, }: {
19
+ report([name, pattern]: [string, string], { ours, theirs, manual, build, workspace: existingOnWorkspaceOnly, noSnap, tag, message: snapMessage, keepReadme, noSquash, skipDependencyInstallation, remote, includeDeps, resolveUnrelated, ignoreConfigChanges, verbose, }: {
20
20
  ours: boolean;
21
21
  theirs: boolean;
22
22
  manual: boolean;
23
23
  workspace?: boolean;
24
24
  build?: boolean;
25
25
  noSnap: boolean;
26
+ tag: boolean;
26
27
  message: string;
27
28
  keepReadme?: boolean;
28
29
  noSquash: boolean;
@@ -92,7 +92,9 @@ class MergeLaneCmd {
92
92
  (0, _defineProperty2().default)(this, "description", `merge a local or a remote lane`);
93
93
  (0, _defineProperty2().default)(this, "extendedDescription", `if the <lane> exists locally, it will be merged from the local lane.
94
94
  otherwise, it will fetch the lane from the remote and merge it.
95
- in case the <lane> exists locally but you want to merge the remote version of it, use --remote flag`);
95
+ in case the <lane> exists locally but you want to merge the remote version of it, use --remote flag.
96
+ when the current and the other lanes are diverged in history and the files could be merged with no conflicts,
97
+ it will snap-merge these components to complete the merge. use "no-snap" to opt-out, or "tag" to tag instead`);
96
98
  (0, _defineProperty2().default)(this, "arguments", [{
97
99
  name: 'lane',
98
100
  description: 'lane-name or lane-id (if not exists locally) to merge to the current lane'
@@ -101,7 +103,7 @@ in case the <lane> exists locally but you want to merge the remote version of it
101
103
  description: 'EXPERIMENTAL. partially merge the lane with the specified component-pattern'
102
104
  }]);
103
105
  (0, _defineProperty2().default)(this, "alias", '');
104
- (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'], ['', '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'], ['', 'skip-dependency-installation', 'do not install packages of the imported components'], ['', 'remote', 'relevant when the target-lane locally is differ than the remote and you want 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"']]);
106
+ (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'], ['', 'skip-dependency-installation', 'do not install packages of the imported components'], ['', 'remote', 'relevant when the target-lane locally is differ than the remote and you want 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"']]);
105
107
  (0, _defineProperty2().default)(this, "loader", true);
106
108
  (0, _defineProperty2().default)(this, "private", true);
107
109
  (0, _defineProperty2().default)(this, "migration", true);
@@ -115,6 +117,7 @@ in case the <lane> exists locally but you want to merge the remote version of it
115
117
  build,
116
118
  workspace: existingOnWorkspaceOnly = false,
117
119
  noSnap = false,
120
+ tag = false,
118
121
  message: snapMessage = '',
119
122
  keepReadme = false,
120
123
  noSquash = false,
@@ -160,6 +163,7 @@ in case the <lane> exists locally but you want to merge the remote version of it
160
163
  snapMessage,
161
164
  keepReadme,
162
165
  noSquash,
166
+ tag,
163
167
  pattern,
164
168
  skipDependencyInstallation,
165
169
  remote,
@@ -1 +1 @@
1
- {"version":3,"names":["MergeLaneCmd","constructor","mergeLanes","name","description","report","pattern","ours","theirs","manual","build","workspace","existingOnWorkspaceOnly","noSnap","message","snapMessage","keepReadme","noSquash","skipDependencyInstallation","remote","includeDeps","resolveUnrelated","ignoreConfigChanges","verbose","isFeatureEnabled","BUILD_ON_CI","Boolean","mergeStrategy","getMergeStrategy","BitError","getResolveUnrelated","undefined","Error","mergeResults","deleteResults","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 = `if the <lane> exists locally, it will be merged from the local lane.\notherwise, it will fetch the lane from the remote and merge it.\nin case the <lane> exists locally but you want to merge the remote version of it, use --remote flag`;\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 ['', '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 ['', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ['', 'remote', 'relevant when the target-lane locally is differ than the remote and you want 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 message: snapMessage = '',\n keepReadme = false,\n noSquash = false,\n skipDependencyInstallation = false,\n remote = 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 message: string;\n keepReadme?: boolean;\n noSquash: boolean;\n skipDependencyInstallation?: boolean;\n remote: 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 } = await this.mergeLanes.mergeLane(name, {\n build,\n // @ts-ignore\n mergeStrategy,\n existingOnWorkspaceOnly,\n noSnap,\n snapMessage,\n keepReadme,\n noSquash,\n pattern,\n skipDependencyInstallation,\n remote,\n resolveUnrelated: getResolveUnrelated(),\n ignoreConfigChanges,\n includeDeps,\n });\n\n const mergeResult = mergeReport({ ...mergeResults, 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;;;;;;AAGO,MAAMA,YAAN,CAAsC;EAmD3CC,WAAW,CAASC,UAAT,EAAqC;IAAA,KAA5BA,UAA4B,GAA5BA,UAA4B;IAAA,8CAlDzC,wBAkDyC;IAAA,qDAjDjC,gCAiDiC;IAAA,6DAhDzB;AACzB;AACA,oGA8CkD;IAAA,mDA7CpC,CACV;MACEC,IAAI,EAAE,MADR;MAEEC,WAAW,EAAE;IAFf,CADU,EAKV;MACED,IAAI,EAAE,SADR;MAEEC,WAAW,EAAE;IAFf,CALU,CA6CoC;IAAA,+CAnCxC,EAmCwC;IAAA,iDAlCtC,CACR,CAAC,EAAD,EAAK,MAAL,EAAa,gFAAb,CADQ,EAER,CAAC,EAAD,EAAK,QAAL,EAAe,qFAAf,CAFQ,EAGR,CAAC,EAAD,EAAK,QAAL,EAAe,6FAAf,CAHQ,EAIR,CAAC,EAAD,EAAK,WAAL,EAAkB,6DAAlB,CAJQ,EAKR,CAAC,EAAD,EAAK,SAAL,EAAgB,gEAAhB,CALQ,EAMR,CAAC,EAAD,EAAK,OAAL,EAAc,wFAAd,CANQ,EAOR,CAAC,GAAD,EAAM,mBAAN,EAA2B,gDAA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AAA,EAAaG,IAAb,EAAmB,IAAnB,CAF0F,CAEhE,GACvCT,aAAa,CAACU,YAAd,IAA8BC,gBAAA,CAAMC,MAAN,CAAaZ,aAAa,CAACU,YAA3B,CAA/B,IAA4E,EAC7E,IAJD;IAKA,OAAOR,WAAW,GAAGE,YAArB;EACD;;AAlI0C"}
1
+ {"version":3,"names":["MergeLaneCmd","constructor","mergeLanes","name","description","report","pattern","ours","theirs","manual","build","workspace","existingOnWorkspaceOnly","noSnap","tag","message","snapMessage","keepReadme","noSquash","skipDependencyInstallation","remote","includeDeps","resolveUnrelated","ignoreConfigChanges","verbose","isFeatureEnabled","BUILD_ON_CI","Boolean","mergeStrategy","getMergeStrategy","BitError","getResolveUnrelated","undefined","Error","mergeResults","deleteResults","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 = `if the <lane> exists locally, it will be merged from the local lane.\notherwise, it will fetch the lane from the remote and merge it.\nin case the <lane> exists locally but you want to merge the remote version of it, use --remote flag.\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 ['', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ['', 'remote', 'relevant when the target-lane locally is differ than the remote and you want 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 remote = 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 remote: 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 } = 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 remote,\n resolveUnrelated: getResolveUnrelated(),\n ignoreConfigChanges,\n includeDeps,\n });\n\n const mergeResult = mergeReport({ ...mergeResults, 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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13,6 +13,7 @@ export declare type MergeLaneOptions = {
13
13
  build: boolean;
14
14
  keepReadme: boolean;
15
15
  noSquash: boolean;
16
+ tag?: boolean;
16
17
  pattern?: string;
17
18
  includeDeps?: boolean;
18
19
  skipDependencyInstallation?: boolean;
@@ -179,6 +179,7 @@ class MergeLanesMain {
179
179
  const {
180
180
  mergeStrategy,
181
181
  noSnap,
182
+ tag,
182
183
  snapMessage,
183
184
  existingOnWorkspaceOnly,
184
185
  build,
@@ -192,6 +193,11 @@ class MergeLanesMain {
192
193
  remote
193
194
  } = options;
194
195
  const currentLaneId = consumer.getCurrentLaneId();
196
+
197
+ if (tag && !currentLaneId.isDefault()) {
198
+ throw new (_bitError().BitError)(`--tag only possible when on main. currently checked out to ${currentLaneId.toString()}`);
199
+ }
200
+
195
201
  const otherLaneId = await consumer.getParsedLaneId(laneName);
196
202
 
197
203
  if (otherLaneId.isEqual(currentLaneId)) {
@@ -291,6 +297,7 @@ class MergeLanesMain {
291
297
  laneId: otherLaneId,
292
298
  localLane: currentLane,
293
299
  noSnap,
300
+ tag,
294
301
  snapMessage,
295
302
  build,
296
303
  skipDependencyInstallation
@@ -1 +1 @@
1
- {"version":3,"names":["MergeLanesMain","constructor","workspace","merging","lanes","logger","remove","mergeLane","laneName","options","BitError","consumer","mergeStrategy","noSnap","snapMessage","existingOnWorkspaceOnly","build","keepReadme","noSquash","pattern","includeDeps","skipDependencyInstallation","resolveUnrelated","ignoreConfigChanges","remote","currentLaneId","getCurrentLaneId","otherLaneId","getParsedLaneId","isEqual","toString","currentLane","isDefault","scope","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","provider","cli","loggerMain","createLogger","MergeLanesAspect","lanesCommand","getCommand","mergeLanesMain","commands","MergeLaneCmd","LanesAspect","CLIAspect","WorkspaceAspect","MergingAspect","LoggerAspect","RemoveAspect","MainRuntime","compIdsToKeep","allBitIds","bitIdsFromPattern","BitIds","fromArray","bitIdsNotFromPattern","hasWithoutVersion","filteredComponentStatus","depsToAdd","pMapSeries","compId","fromStatus","divergeData","remoteVersions","snapsOnRemoteOnly","modelComponent","getModelComponent","laneIds","remoteVersion","versionObj","loadVersion","objects","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","d","depsUniq","uniqFromArray","currentLaneName","succeededComponents","componentFromModel","isDiverged","isLocalAhead","isRemoteAhead","remoteSnaps","currentParents","parents","commonSnapBeforeDiverge","addAsOnlyParent","ref","removeParent","setSquashed","previousParents","add","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 { ComponentID } from '@teambit/component-id';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { MergeLanesAspect } from './merge-lanes.aspect';\nimport { MergeLaneCmd } from './merge-lane.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 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 ) {}\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 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 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 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 static slots = [];\n static dependencies = [LanesAspect, CLIAspect, WorkspaceAspect, MergingAspect, LoggerAspect, RemoveAspect];\n static runtime = MainRuntime;\n\n static async provider([lanes, cli, workspace, merging, loggerMain, remove]: [\n LanesMain,\n CLIMain,\n Workspace,\n MergingMain,\n LoggerMain,\n RemoveMain\n ]) {\n const logger = loggerMain.createLogger(MergeLanesAspect.id);\n const lanesCommand = cli.getCommand('lane');\n const mergeLanesMain = new MergeLanesMain(workspace, merging, lanes, logger, remove);\n lanesCommand?.commands?.push(new MergeLaneCmd(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 const laneIds = lane?.toBitIds();\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, laneIds);\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 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;\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;\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 // 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 consumer.scope.objects.add(componentFromModel);\n });\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;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;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;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ACD,CAzBsE,CA0BvE;IACA;IACA;IACA;;;IACA,IAAI,CAACsH,kBAAL,EAAyB;MACvB,MAAM,IAAItH,KAAJ,CAAU,qDAAV,CAAN;IACD;;IAED,MAAM2H,cAAc,GAAGL,kBAAkB,CAACM,OAA1C,CAlCuE,CAoCvE;;IACA,IAAI5B,WAAW,CAAC6B,uBAAhB,EAAyC;MACvCP,kBAAkB,CAACQ,eAAnB,CAAmC9B,WAAW,CAAC6B,uBAA/C;IACD,CAFD,MAEO;MACL;MACAP,kBAAkB,CAACM,OAAnB,CAA2BpG,OAA3B,CAAoCuG,GAAD,IAAST,kBAAkB,CAACU,YAAnB,CAAgCD,GAAhC,CAA5C;IACD;;IACDT,kBAAkB,CAACW,WAAnB,CAA+B;MAAEC,eAAe,EAAEP,cAAnB;MAAmCnF,MAAM,EAAEvD;IAA3C,CAA/B;IACAhB,QAAQ,CAACsB,KAAT,CAAekH,OAAf,CAAuB0B,GAAvB,CAA2Bb,kBAA3B;EACD,CA7CD;AA8CD;;AAED/C,8BAAA,CAAiB6D,UAAjB,CAA4B9K,cAA5B;;eAEeA,c"}
1
+ {"version":3,"names":["MergeLanesMain","constructor","workspace","merging","lanes","logger","remove","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","scope","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","provider","cli","loggerMain","createLogger","MergeLanesAspect","lanesCommand","getCommand","mergeLanesMain","commands","MergeLaneCmd","LanesAspect","CLIAspect","WorkspaceAspect","MergingAspect","LoggerAspect","RemoveAspect","MainRuntime","compIdsToKeep","allBitIds","bitIdsFromPattern","BitIds","fromArray","bitIdsNotFromPattern","hasWithoutVersion","filteredComponentStatus","depsToAdd","pMapSeries","compId","fromStatus","divergeData","remoteVersions","snapsOnRemoteOnly","modelComponent","getModelComponent","laneIds","remoteVersion","versionObj","loadVersion","objects","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","d","depsUniq","uniqFromArray","currentLaneName","succeededComponents","componentFromModel","isDiverged","isLocalAhead","isRemoteAhead","remoteSnaps","currentParents","parents","commonSnapBeforeDiverge","addAsOnlyParent","ref","removeParent","setSquashed","previousParents","add","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 { ComponentID } from '@teambit/component-id';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { MergeLanesAspect } from './merge-lanes.aspect';\nimport { MergeLaneCmd } from './merge-lane.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 ) {}\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 static slots = [];\n static dependencies = [LanesAspect, CLIAspect, WorkspaceAspect, MergingAspect, LoggerAspect, RemoveAspect];\n static runtime = MainRuntime;\n\n static async provider([lanes, cli, workspace, merging, loggerMain, remove]: [\n LanesMain,\n CLIMain,\n Workspace,\n MergingMain,\n LoggerMain,\n RemoveMain\n ]) {\n const logger = loggerMain.createLogger(MergeLanesAspect.id);\n const lanesCommand = cli.getCommand('lane');\n const mergeLanesMain = new MergeLanesMain(workspace, merging, lanes, logger, remove);\n lanesCommand?.commands?.push(new MergeLaneCmd(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 const laneIds = lane?.toBitIds();\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, laneIds);\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 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;\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;\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 // 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 consumer.scope.objects.add(componentFromModel);\n });\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;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;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;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AC9B;MACA;IACD;;IACD,IAAI,CAACxB,WAAW,CAACyB,aAAZ,EAAL,EAAkC;MAChC;MACA;IACD,CApBsE,CAqBvE;;;IACA,MAAMC,WAAW,GAAG1B,WAAW,CAACE,iBAAhC;;IACA,IAAIwB,WAAW,CAAC9E,MAAZ,KAAuB,CAA3B,EAA8B;MAC5B,MAAM,IAAI5C,KAAJ,CAAW,sDAAX,CAAN;IACD,CAzBsE,CA0BvE;IACA;IACA;IACA;;;IACA,IAAI,CAACsH,kBAAL,EAAyB;MACvB,MAAM,IAAItH,KAAJ,CAAU,qDAAV,CAAN;IACD;;IAED,MAAM2H,cAAc,GAAGL,kBAAkB,CAACM,OAA1C,CAlCuE,CAoCvE;;IACA,IAAI5B,WAAW,CAAC6B,uBAAhB,EAAyC;MACvCP,kBAAkB,CAACQ,eAAnB,CAAmC9B,WAAW,CAAC6B,uBAA/C;IACD,CAFD,MAEO;MACL;MACAP,kBAAkB,CAACM,OAAnB,CAA2BpG,OAA3B,CAAoCuG,GAAD,IAAST,kBAAkB,CAACU,YAAnB,CAAgCD,GAAhC,CAA5C;IACD;;IACDT,kBAAkB,CAACW,WAAnB,CAA+B;MAAEC,eAAe,EAAEP,cAAnB;MAAmCnF,MAAM,EAAErD;IAA3C,CAA/B;IACAnB,QAAQ,CAACuB,KAAT,CAAekH,OAAf,CAAuB0B,GAAvB,CAA2Bb,kBAA3B;EACD,CA7CD;AA8CD;;AAED/C,8BAAA,CAAiB6D,UAAjB,CAA4B/K,cAA5B;;eAEeA,c"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/merge-lanes",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
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.29"
9
+ "version": "0.0.30"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -15,15 +15,15 @@
15
15
  "core-js": "^3.0.0",
16
16
  "@teambit/bit-error": "0.0.400",
17
17
  "@teambit/cli": "0.0.566",
18
- "@teambit/merging": "0.0.167",
18
+ "@teambit/merging": "0.0.168",
19
19
  "@teambit/harmony": "0.3.3",
20
20
  "@teambit/component-id": "0.0.417",
21
21
  "@teambit/lane-id": "0.0.85",
22
- "@teambit/lanes": "0.0.424",
22
+ "@teambit/lanes": "0.0.425",
23
23
  "@teambit/legacy-bit-id": "0.0.414",
24
24
  "@teambit/logger": "0.0.659",
25
- "@teambit/remove": "0.0.29",
26
- "@teambit/workspace": "0.0.852"
25
+ "@teambit/remove": "0.0.30",
26
+ "@teambit/workspace": "0.0.853"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/mocha": "9.1.0",