@teambit/merge-lanes 1.0.535 → 1.0.536

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.
@@ -0,0 +1,12 @@
1
+ import { Route, Verb, Request, Response } from '@teambit/express';
2
+ import { Logger } from '@teambit/logger';
3
+ import { MergeLanesMain } from './merge-lanes.main.runtime';
4
+ export declare class LanesCheckConflictsRoute implements Route {
5
+ private mergeLanes;
6
+ private logger;
7
+ constructor(mergeLanes: MergeLanesMain, logger: Logger);
8
+ method: string;
9
+ route: string;
10
+ verb: Verb;
11
+ middlewares: ((req: Request, res: Response) => Promise<import("express").Response<any, Record<string, any>>>)[];
12
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LanesCheckConflictsRoute = void 0;
7
+ function _express() {
8
+ const data = require("@teambit/express");
9
+ _express = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
15
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
16
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
18
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
19
+ class LanesCheckConflictsRoute {
20
+ constructor(mergeLanes, logger) {
21
+ this.mergeLanes = mergeLanes;
22
+ this.logger = logger;
23
+ _defineProperty(this, "method", 'post');
24
+ _defineProperty(this, "route", '/lanes/check-conflicts');
25
+ _defineProperty(this, "verb", _express().Verb.WRITE);
26
+ _defineProperty(this, "middlewares", [async (req, res) => {
27
+ const {
28
+ body
29
+ } = req;
30
+ const sourceLane = body.sourceLane;
31
+ const targetLane = body.targetLane;
32
+ if (!sourceLane) {
33
+ return res.status(400).send('Missing sourceLane in body');
34
+ }
35
+ if (!targetLane) {
36
+ return res.status(400).send('Missing targetLane in body');
37
+ }
38
+ try {
39
+ const {
40
+ conflicts
41
+ } = await this.mergeLanes.checkLaneForConflicts(sourceLane, targetLane, {});
42
+ const conflictsOutput = conflicts.map(conflict => {
43
+ return _objectSpread(_objectSpread({}, conflict), {}, {
44
+ id: conflict.id.toString()
45
+ });
46
+ });
47
+ return res.json({
48
+ conflicts: conflictsOutput
49
+ });
50
+ } catch (e) {
51
+ this.logger.error(e.toString());
52
+ return res.status(500).send(e.toString());
53
+ }
54
+ }]);
55
+ }
56
+ }
57
+ exports.LanesCheckConflictsRoute = LanesCheckConflictsRoute;
58
+
59
+ //# sourceMappingURL=lanes-check-conflicts.route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_express","data","require","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LanesCheckConflictsRoute","constructor","mergeLanes","logger","Verb","WRITE","req","res","body","sourceLane","targetLane","status","send","conflicts","checkLaneForConflicts","conflictsOutput","map","conflict","id","toString","json","error","exports"],"sources":["lanes-check-conflicts.route.ts"],"sourcesContent":["import { Route, Verb, Request, Response } from '@teambit/express';\nimport { Logger } from '@teambit/logger';\nimport { MergeLanesMain } from './merge-lanes.main.runtime';\n\nexport class LanesCheckConflictsRoute implements Route {\n constructor(\n private mergeLanes: MergeLanesMain,\n private logger: Logger\n ) {}\n\n method = 'post';\n route = '/lanes/check-conflicts';\n verb = Verb.WRITE;\n\n middlewares = [\n async (req: Request, res: Response) => {\n const { body } = req;\n const sourceLane = body.sourceLane;\n const targetLane = body.targetLane;\n if (!sourceLane) {\n return res.status(400).send('Missing sourceLane in body');\n }\n if (!targetLane) {\n return res.status(400).send('Missing targetLane in body');\n }\n try {\n const { conflicts } = await this.mergeLanes.checkLaneForConflicts(sourceLane, targetLane, {});\n const conflictsOutput = conflicts.map((conflict) => {\n return {\n ...conflict,\n id: conflict.id.toString(),\n };\n });\n return res.json({ conflicts: conflictsOutput });\n } catch (e: any) {\n this.logger.error(e.toString());\n return res.status(500).send(e.toString());\n }\n },\n ];\n}\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAkE,SAAAE,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,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AE;QACf,IAAI,CAACmC,MAAM,CAACkB,KAAK,CAACrD,CAAC,CAACmD,QAAQ,CAAC,CAAC,CAAC;QAC/B,OAAOZ,GAAG,CAACI,MAAM,CAAC,GAAG,CAAC,CAACC,IAAI,CAAC5C,CAAC,CAACmD,QAAQ,CAAC,CAAC,CAAC;MAC3C;IACF,CAAC,CACF;EA/BE;AAgCL;AAACG,OAAA,CAAAtB,wBAAA,GAAAA,wBAAA","ignoreList":[]}
@@ -3,6 +3,7 @@ import { MergeLanesMain } from './merge-lanes.main.runtime';
3
3
  type Flags = {
4
4
  pattern?: string;
5
5
  push?: boolean;
6
+ build?: boolean;
6
7
  keepReadme?: boolean;
7
8
  noSquash: boolean;
8
9
  includeDeps?: boolean;
@@ -28,7 +29,7 @@ export declare class MergeLaneFromScopeCmd implements Command {
28
29
  private: boolean;
29
30
  remoteOp: boolean;
30
31
  constructor(mergeLanes: MergeLanesMain);
31
- report([fromLane, toLane]: [string, string], { pattern, push, keepReadme, noSquash, includeDeps, title, titleBase64, reMerge, }: Flags): Promise<string>;
32
+ report([fromLane, toLane]: [string, string], { pattern, push, build, keepReadme, noSquash, includeDeps, title, titleBase64, reMerge, }: Flags): Promise<string>;
32
33
  json([fromLane, toLane]: [string, string], { pattern, push, keepReadme, noSquash, includeDeps, reMerge }: Flags): Promise<{
33
34
  code: number;
34
35
  data: {
@@ -67,7 +67,7 @@ the lane must be up-to-date with the other lane, otherwise, conflicts might occu
67
67
  description: `lane-id to merge to. default is "${_laneId().DEFAULT_LANE}"`
68
68
  }]);
69
69
  _defineProperty(this, "alias", '');
70
- _defineProperty(this, "options", [['', 'pattern <string>', 'partially merge the lane with the specified component-pattern'], ['', 'title <string>', 'if provided, it replaces the original message with this title and append squashed snaps messages'], ['', 'title-base64 <string>', 'same as --title flag but the title is base64 encoded'], ['', 'push', 'export the updated objects to the original scopes once done'], ['', 'keep-readme', 'skip deleting the lane readme component after merging'], ['', 'no-squash', 'relevant for merging lanes into main, which by default squash.'], ['', 'include-deps', 'relevant for "--pattern". merge also dependencies of the given components'], ['', 're-merge', 'helpful when last merge failed during export. do not skip components that seemed to be merged'], ['j', 'json', 'output as json format']]);
70
+ _defineProperty(this, "options", [['', 'pattern <string>', 'partially merge the lane with the specified component-pattern'], ['', 'title <string>', 'if provided, it replaces the original message with this title and append squashed snaps messages'], ['', 'title-base64 <string>', 'same as --title flag but the title is base64 encoded'], ['', 'push', 'export the updated objects to the original scopes once done'], ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'], ['', 'keep-readme', 'skip deleting the lane readme component after merging'], ['', 'no-squash', 'relevant for merging lanes into main, which by default squash.'], ['', 'include-deps', 'relevant for "--pattern". merge also dependencies of the given components'], ['', 're-merge', 'helpful when last merge failed during export. do not skip components that seemed to be merged'], ['j', 'json', 'output as json format']]);
71
71
  _defineProperty(this, "loader", true);
72
72
  _defineProperty(this, "private", true);
73
73
  _defineProperty(this, "remoteOp", true);
@@ -75,6 +75,7 @@ the lane must be up-to-date with the other lane, otherwise, conflicts might occu
75
75
  async report([fromLane, toLane], {
76
76
  pattern,
77
77
  push = false,
78
+ build,
78
79
  keepReadme = false,
79
80
  noSquash = false,
80
81
  includeDeps = false,
@@ -97,6 +98,7 @@ the lane must be up-to-date with the other lane, otherwise, conflicts might occu
97
98
  mergeSnapError
98
99
  } = await this.mergeLanes.mergeFromScope(fromLane, toLane || _laneId().DEFAULT_LANE, {
99
100
  push,
101
+ build,
100
102
  keepReadme,
101
103
  noSquash,
102
104
  pattern,
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_laneId","_lodash","_legacy","_bitError","_excluded","e","__esModule","default","_objectWithoutProperties","t","o","r","i","_objectWithoutPropertiesLoose","Object","getOwnPropertySymbols","n","length","indexOf","propertyIsEnumerable","call","hasOwnProperty","ownKeys","keys","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","MergeLaneFromScopeCmd","constructor","mergeLanes","name","description","DEFAULT_LANE","report","fromLane","toLane","pattern","keepReadme","noSquash","includeDeps","title","titleBase64","reMerge","BitError","titleBase64Decoded","fromBase64","undefined","mergedNow","unmerged","exportedIds","conflicts","mergeSnapError","mergeFromScope","snapMessage","mergedTitle","chalk","green","mergedOutput","join","nonMergedTitle","bold","nonMergedOutput","map","u","id","reason","conflictsTitle","conflictsOutput","files","config","mergeSnapErrorTitle","mergeSnapErrorOutput","red","message","exportedTitle","exportedOutput","compact","json","results","code","toString","mergedPreviously","_ref","rest","snappedIds","stack","err","logger","error","exports"],"sources":["merge-lane-from-scope.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { DEFAULT_LANE } from '@teambit/lane-id';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { compact } from 'lodash';\nimport { fromBase64 } from '@teambit/legacy.utils';\nimport { BitError } from '@teambit/bit-error';\nimport { MergeFromScopeResult, MergeLanesMain } from './merge-lanes.main.runtime';\n\ntype Flags = {\n pattern?: string;\n push?: boolean;\n keepReadme?: boolean;\n noSquash: boolean;\n includeDeps?: boolean;\n title?: string;\n titleBase64?: string;\n reMerge?: boolean;\n};\n\n/**\n * private command. the underscore prefix is intended.\n */\nexport class MergeLaneFromScopeCmd implements Command {\n name = '_merge-lane <from-lane> [to-lane]';\n description = `merge a remote lane into another lane or main via a bare-scope (not workspace)`;\n extendedDescription = `to merge from a workspace, use \"bit lane merge\" command.\nthis is intended to use from the UI, which will have a button to merge an existing lane.\nthe lane must be up-to-date with the other lane, otherwise, conflicts might occur which are not handled in this command`;\n arguments = [\n {\n name: 'from-lane',\n description: `lane-id to merge from or \"${DEFAULT_LANE}\"`,\n },\n {\n name: 'to-lane',\n description: `lane-id to merge to. default is \"${DEFAULT_LANE}\"`,\n },\n ];\n alias = '';\n options = [\n ['', 'pattern <string>', 'partially merge the lane with the specified component-pattern'],\n [\n '',\n 'title <string>',\n 'if provided, it replaces the original message with this title and append squashed snaps messages',\n ],\n ['', 'title-base64 <string>', 'same as --title flag but the title is base64 encoded'],\n ['', 'push', 'export the updated objects to the original scopes once done'],\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 ['', 'include-deps', 'relevant for \"--pattern\". merge also dependencies of the given components'],\n ['', 're-merge', 'helpful when last merge failed during export. do not skip components that seemed to be merged'],\n ['j', 'json', 'output as json format'],\n ] as CommandOptions;\n loader = true;\n private = true;\n remoteOp = true;\n\n constructor(private mergeLanes: MergeLanesMain) {}\n\n async report(\n [fromLane, toLane]: [string, string],\n {\n pattern,\n push = false,\n keepReadme = false,\n noSquash = false,\n includeDeps = false,\n title,\n titleBase64,\n reMerge,\n }: Flags\n ): Promise<string> {\n if (includeDeps && !pattern) {\n throw new BitError(`\"--include-deps\" flag is relevant only for --pattern flag`);\n }\n if (fromLane === DEFAULT_LANE && !toLane) {\n throw new BitError('to merge from the main lane, specify the target lane');\n }\n\n const titleBase64Decoded = titleBase64 ? fromBase64(titleBase64) : undefined;\n\n const { mergedNow, unmerged, exportedIds, conflicts, mergeSnapError } = await this.mergeLanes.mergeFromScope(\n fromLane,\n toLane || DEFAULT_LANE,\n {\n push,\n keepReadme,\n noSquash,\n pattern,\n includeDeps,\n snapMessage: titleBase64Decoded || title,\n reMerge,\n }\n );\n\n const mergedTitle = chalk.green(\n `successfully merged ${mergedNow.length} components from ${fromLane} to ${toLane || DEFAULT_LANE}`\n );\n const mergedOutput = mergedNow.length ? `${mergedTitle}\\n${mergedNow.join('\\n')}` : '';\n\n const nonMergedTitle = chalk.bold(`the following ${unmerged.length} components were not merged`);\n const nonMergedOutput = unmerged.length\n ? `${nonMergedTitle}\\n${unmerged.map((u) => `${u.id} (${u.reason})`).join('\\n')}`\n : '';\n\n const conflictsTitle = chalk.bold(\n `the following ${conflicts?.length} components have conflicts, the merge was not completed`\n );\n const conflictsOutput = conflicts?.length\n ? `${conflictsTitle}\\n${conflicts\n .map((u) => `${u.id} (files: ${u.files.join(', ') || 'N/A'}) (config: ${u.config})`)\n .join('\\n')}`\n : '';\n\n const mergeSnapErrorTitle = chalk.bold(`the following error was thrown while snapping the components:`);\n const mergeSnapErrorOutput = mergeSnapError ? `${mergeSnapErrorTitle}\\n${chalk.red(mergeSnapError.message)}` : '';\n\n const exportedTitle = chalk.bold(`successfully exported ${exportedIds.length} components`);\n const exportedOutput = exportedIds.length ? `${exportedTitle}\\n${exportedIds.join('\\n')}` : '';\n\n return compact([mergedOutput, nonMergedOutput, conflictsOutput, mergeSnapErrorOutput, exportedOutput]).join('\\n\\n');\n }\n async json(\n [fromLane, toLane]: [string, string],\n { pattern, push = false, keepReadme = false, noSquash = false, includeDeps = false, reMerge }: Flags\n ) {\n if (includeDeps && !pattern) {\n throw new BitError(`\"--include-deps\" flag is relevant only for --pattern flag`);\n }\n let results: MergeFromScopeResult;\n try {\n results = await this.mergeLanes.mergeFromScope(fromLane, toLane || DEFAULT_LANE, {\n push,\n keepReadme,\n noSquash,\n pattern,\n includeDeps,\n reMerge,\n });\n return {\n code: 0,\n data: {\n ...results,\n mergedNow: results.mergedNow.map((id) => id.toString()),\n mergedPreviously: results.mergedPreviously.map((id) => id.toString()),\n exportedIds: results.exportedIds.map((id) => id.toString()),\n unmerged: results.unmerged.map(({ id, reason }) => ({ id: id.toString(), reason })),\n conflicts: results.conflicts?.map(({ id, ...rest }) => ({ id: id.toString(), ...rest })),\n snappedIds: results.snappedIds?.map((id) => id.toString()),\n mergeSnapError: results.mergeSnapError\n ? { message: results.mergeSnapError.message, stack: results.mergeSnapError.stack }\n : undefined,\n },\n };\n } catch (err: any) {\n this.mergeLanes.logger.error('merge-lane-from-scope.json, error: ', err);\n return {\n code: 1,\n error: err.message,\n };\n }\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC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List":[]}
1
+ {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_laneId","_lodash","_legacy","_bitError","_excluded","e","__esModule","default","_objectWithoutProperties","t","o","r","i","_objectWithoutPropertiesLoose","Object","getOwnPropertySymbols","n","length","indexOf","propertyIsEnumerable","call","hasOwnProperty","ownKeys","keys","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","MergeLaneFromScopeCmd","constructor","mergeLanes","name","description","DEFAULT_LANE","report","fromLane","toLane","pattern","build","keepReadme","noSquash","includeDeps","title","titleBase64","reMerge","BitError","titleBase64Decoded","fromBase64","undefined","mergedNow","unmerged","exportedIds","conflicts","mergeSnapError","mergeFromScope","snapMessage","mergedTitle","chalk","green","mergedOutput","join","nonMergedTitle","bold","nonMergedOutput","map","u","id","reason","conflictsTitle","conflictsOutput","files","config","mergeSnapErrorTitle","mergeSnapErrorOutput","red","message","exportedTitle","exportedOutput","compact","json","results","code","toString","mergedPreviously","_ref","rest","snappedIds","stack","err","logger","error","exports"],"sources":["merge-lane-from-scope.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { DEFAULT_LANE } from '@teambit/lane-id';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { compact } from 'lodash';\nimport { fromBase64 } from '@teambit/legacy.utils';\nimport { BitError } from '@teambit/bit-error';\nimport { MergeFromScopeResult, MergeLanesMain } from './merge-lanes.main.runtime';\n\ntype Flags = {\n pattern?: string;\n push?: boolean;\n build?: boolean;\n keepReadme?: boolean;\n noSquash: boolean;\n includeDeps?: boolean;\n title?: string;\n titleBase64?: string;\n reMerge?: boolean;\n};\n\n/**\n * private command. the underscore prefix is intended.\n */\nexport class MergeLaneFromScopeCmd implements Command {\n name = '_merge-lane <from-lane> [to-lane]';\n description = `merge a remote lane into another lane or main via a bare-scope (not workspace)`;\n extendedDescription = `to merge from a workspace, use \"bit lane merge\" command.\nthis is intended to use from the UI, which will have a button to merge an existing lane.\nthe lane must be up-to-date with the other lane, otherwise, conflicts might occur which are not handled in this command`;\n arguments = [\n {\n name: 'from-lane',\n description: `lane-id to merge from or \"${DEFAULT_LANE}\"`,\n },\n {\n name: 'to-lane',\n description: `lane-id to merge to. default is \"${DEFAULT_LANE}\"`,\n },\n ];\n alias = '';\n options = [\n ['', 'pattern <string>', 'partially merge the lane with the specified component-pattern'],\n [\n '',\n 'title <string>',\n 'if provided, it replaces the original message with this title and append squashed snaps messages',\n ],\n ['', 'title-base64 <string>', 'same as --title flag but the title is base64 encoded'],\n ['', 'push', 'export the updated objects to the original scopes once done'],\n ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'],\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 ['', 'include-deps', 'relevant for \"--pattern\". merge also dependencies of the given components'],\n ['', 're-merge', 'helpful when last merge failed during export. do not skip components that seemed to be merged'],\n ['j', 'json', 'output as json format'],\n ] as CommandOptions;\n loader = true;\n private = true;\n remoteOp = true;\n\n constructor(private mergeLanes: MergeLanesMain) {}\n\n async report(\n [fromLane, toLane]: [string, string],\n {\n pattern,\n push = false,\n build,\n keepReadme = false,\n noSquash = false,\n includeDeps = false,\n title,\n titleBase64,\n reMerge,\n }: Flags\n ): Promise<string> {\n if (includeDeps && !pattern) {\n throw new BitError(`\"--include-deps\" flag is relevant only for --pattern flag`);\n }\n if (fromLane === DEFAULT_LANE && !toLane) {\n throw new BitError('to merge from the main lane, specify the target lane');\n }\n\n const titleBase64Decoded = titleBase64 ? fromBase64(titleBase64) : undefined;\n\n const { mergedNow, unmerged, exportedIds, conflicts, mergeSnapError } = await this.mergeLanes.mergeFromScope(\n fromLane,\n toLane || DEFAULT_LANE,\n {\n push,\n build,\n keepReadme,\n noSquash,\n pattern,\n includeDeps,\n snapMessage: titleBase64Decoded || title,\n reMerge,\n }\n );\n\n const mergedTitle = chalk.green(\n `successfully merged ${mergedNow.length} components from ${fromLane} to ${toLane || DEFAULT_LANE}`\n );\n const mergedOutput = mergedNow.length ? `${mergedTitle}\\n${mergedNow.join('\\n')}` : '';\n\n const nonMergedTitle = chalk.bold(`the following ${unmerged.length} components were not merged`);\n const nonMergedOutput = unmerged.length\n ? `${nonMergedTitle}\\n${unmerged.map((u) => `${u.id} (${u.reason})`).join('\\n')}`\n : '';\n\n const conflictsTitle = chalk.bold(\n `the following ${conflicts?.length} components have conflicts, the merge was not completed`\n );\n const conflictsOutput = conflicts?.length\n ? `${conflictsTitle}\\n${conflicts\n .map((u) => `${u.id} (files: ${u.files.join(', ') || 'N/A'}) (config: ${u.config})`)\n .join('\\n')}`\n : '';\n\n const mergeSnapErrorTitle = chalk.bold(`the following error was thrown while snapping the components:`);\n const mergeSnapErrorOutput = mergeSnapError ? `${mergeSnapErrorTitle}\\n${chalk.red(mergeSnapError.message)}` : '';\n\n const exportedTitle = chalk.bold(`successfully exported ${exportedIds.length} components`);\n const exportedOutput = exportedIds.length ? `${exportedTitle}\\n${exportedIds.join('\\n')}` : '';\n\n return compact([mergedOutput, nonMergedOutput, conflictsOutput, mergeSnapErrorOutput, exportedOutput]).join('\\n\\n');\n }\n async json(\n [fromLane, toLane]: [string, string],\n { pattern, push = false, keepReadme = false, noSquash = false, includeDeps = false, reMerge }: Flags\n ) {\n if (includeDeps && !pattern) {\n throw new BitError(`\"--include-deps\" flag is relevant only for --pattern flag`);\n }\n let results: MergeFromScopeResult;\n try {\n results = await this.mergeLanes.mergeFromScope(fromLane, toLane || DEFAULT_LANE, {\n push,\n keepReadme,\n noSquash,\n pattern,\n includeDeps,\n reMerge,\n });\n return {\n code: 0,\n data: {\n ...results,\n mergedNow: results.mergedNow.map((id) => id.toString()),\n mergedPreviously: results.mergedPreviously.map((id) => id.toString()),\n exportedIds: results.exportedIds.map((id) => id.toString()),\n unmerged: results.unmerged.map(({ id, reason }) => ({ id: id.toString(), reason })),\n conflicts: results.conflicts?.map(({ id, ...rest }) => ({ id: id.toString(), ...rest })),\n snappedIds: results.snappedIds?.map((id) => id.toString()),\n mergeSnapError: results.mergeSnapError\n ? { message: results.mergeSnapError.message, stack: results.mergeSnapError.stack }\n : undefined,\n },\n };\n } catch (err: any) {\n this.mergeLanes.logger.error('merge-lane-from-scope.json, error: ', err);\n return {\n code: 1,\n error: err.message,\n };\n }\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,UAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,MAAAO,SAAA;AAAA,SAAAN,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,EAAAI,CAAA,gBAAAJ,CAAA,iBAAAK,CAAA,EAAAC,CAAA,EAAAC,CAAA,GAAAC,6BAAA,CAAAR,CAAA,EAAAI,CAAA,OAAAK,M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OAAO,CAAC3B,cAAc,GAClC;YAAEsB,OAAO,EAAEK,OAAO,CAAC3B,cAAc,CAACsB,OAAO;YAAEY,KAAK,EAAEP,OAAO,CAAC3B,cAAc,CAACkC;UAAM,CAAC,GAChFvC;QAAS;MAEjB,CAAC;IACH,CAAC,CAAC,OAAOwC,GAAQ,EAAE;MACjB,IAAI,CAAC1D,UAAU,CAAC2D,MAAM,CAACC,KAAK,CAAC,qCAAqC,EAAEF,GAAG,CAAC;MACxE,OAAO;QACLP,IAAI,EAAE,CAAC;QACPS,KAAK,EAAEF,GAAG,CAACb;MACb,CAAC;IACH;EACF;AACF;AAACgB,OAAA,CAAA/D,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -13,6 +13,7 @@ import { RemoveMain } from '@teambit/remove';
13
13
  import { ExportMain } from '@teambit/export';
14
14
  import { GlobalConfigMain } from '@teambit/global-config';
15
15
  import { MergeAbortOpts } from './merge-abort.cmd';
16
+ import { ExpressMain } from '@teambit/express';
16
17
  export type MergeLaneOptions = {
17
18
  mergeStrategy: MergeStrategy;
18
19
  ours?: boolean;
@@ -73,6 +74,9 @@ export declare class MergeLanesMain {
73
74
  mergedSuccessfullyIds: ComponentID[];
74
75
  conflicts: ConflictPerId[];
75
76
  }>;
77
+ /**
78
+ * merge otherLaneId into currentLaneId
79
+ */
76
80
  mergeLane(otherLaneId: LaneId, currentLaneId: LaneId, options: MergeLaneOptions): Promise<{
77
81
  mergeResults: ApplyVersionResults;
78
82
  deleteResults: any;
@@ -80,6 +84,14 @@ export declare class MergeLanesMain {
80
84
  mergedSuccessfullyIds: ComponentID[];
81
85
  conflicts: ConflictPerId[];
82
86
  }>;
87
+ private validateMergeFlags;
88
+ private resolveMergeContext;
89
+ /**
90
+ * check conflicts in case of merging sourceLaneId into targetLaneId
91
+ */
92
+ checkLaneForConflicts(sourceLaneIdStr: string, targetLaneIdStr: string, options: Partial<MergeLaneOptions>): Promise<{
93
+ conflicts: ConflictPerId[];
94
+ }>;
83
95
  mergeMove(newLaneName: string, options: {
84
96
  scope?: string;
85
97
  }): Promise<import("@teambit/lanes").CreateLaneResult>;
@@ -97,7 +109,7 @@ export declare class MergeLanesMain {
97
109
  static slots: never[];
98
110
  static dependencies: import("@teambit/harmony").Aspect[];
99
111
  static runtime: import("@teambit/harmony").RuntimeDefinition;
100
- static provider([lanes, cli, workspace, merging, loggerMain, remove, scope, exporter, importer, checkout, globalConfig,]: [
112
+ static provider([lanes, cli, workspace, merging, loggerMain, remove, scope, exporter, importer, checkout, globalConfig, express,]: [
101
113
  LanesMain,
102
114
  CLIMain,
103
115
  Workspace,
@@ -108,7 +120,8 @@ export declare class MergeLanesMain {
108
120
  ExportMain,
109
121
  ImporterMain,
110
122
  CheckoutMain,
111
- GlobalConfigMain
123
+ GlobalConfigMain,
124
+ ExpressMain
112
125
  ]): Promise<MergeLanesMain>;
113
126
  }
114
127
  export default MergeLanesMain;
@@ -186,6 +186,20 @@ function _harmonyModules2() {
186
186
  };
187
187
  return data;
188
188
  }
189
+ function _express() {
190
+ const data = require("@teambit/express");
191
+ _express = function () {
192
+ return data;
193
+ };
194
+ return data;
195
+ }
196
+ function _lanesCheckConflicts() {
197
+ const data = require("./lanes-check-conflicts.route");
198
+ _lanesCheckConflicts = function () {
199
+ return data;
200
+ };
201
+ return data;
202
+ }
189
203
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
190
204
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
191
205
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -213,9 +227,17 @@ class MergeLanesMain {
213
227
  return this.mergeLane(otherLaneId, currentLaneId, options);
214
228
  }
215
229
 
216
- // eslint-disable-next-line complexity
230
+ /**
231
+ * merge otherLaneId into currentLaneId
232
+ */
217
233
  async mergeLane(otherLaneId, currentLaneId, options) {
218
- const consumer = this.workspace?.consumer;
234
+ this.validateMergeFlags(otherLaneId, currentLaneId, options);
235
+ const {
236
+ currentLane,
237
+ otherLane,
238
+ laneToFetchArtifactsFrom,
239
+ idsToMerge
240
+ } = await this.resolveMergeContext(otherLaneId, currentLaneId, options);
219
241
  const {
220
242
  mergeStrategy,
221
243
  noAutoSnap,
@@ -232,73 +254,11 @@ class MergeLanesMain {
232
254
  skipDependencyInstallation,
233
255
  resolveUnrelated,
234
256
  ignoreConfigChanges,
235
- skipFetch,
236
- excludeNonLaneComps,
237
- shouldIncludeUpdateDependents,
238
257
  throwIfNotUpToDate,
239
- fetchCurrent,
240
258
  detachHead
241
259
  } = options;
242
260
  const legacyScope = this.scope.legacyScope;
243
- if (tag && !currentLaneId.isDefault()) {
244
- throw new (_bitError().BitError)(`--tag only possible when on main. currently checked out to ${currentLaneId.toString()}`);
245
- }
246
- if (otherLaneId.isEqual(currentLaneId)) {
247
- throw new (_bitError().BitError)(`unable to merge lane "${otherLaneId.toString()}", you're already at this lane. to get updates, simply run "bit checkout head"`);
248
- }
249
- if (resolveUnrelated && currentLaneId.isDefault()) {
250
- throw new (_bitError().BitError)(`unable to resolve unrelated when on main. switch to ${otherLaneId.toString()} and run "bit lane merge main --resolve-unrelated"`);
251
- }
252
- if (detachHead && !(0, _harmonyModules2().isFeatureEnabled)(_harmonyModules2().DETACH_HEAD)) {
253
- throw new (_bitError().BitError)(`unable to detach head. the feature is not enabled`);
254
- }
255
- if (detachHead && !currentLaneId.isDefault()) {
256
- throw new (_bitError().BitError)(`unable to detach head. the current lane is not main`);
257
- }
258
- if (fetchCurrent && !currentLaneId.isDefault()) {
259
- // if current is default, it'll be fetch later on
260
- await this.lanes.fetchLaneWithItsComponents(currentLaneId);
261
- }
262
- const currentLane = currentLaneId.isDefault() ? undefined : await legacyScope.loadLane(currentLaneId);
263
- const isDefaultLane = otherLaneId.isDefault();
264
- if (isDefaultLane) {
265
- if (!skipFetch) {
266
- const ids = await this.getMainIdsToMerge(currentLane, !excludeNonLaneComps);
267
- const compIdList = _componentId().ComponentIdList.fromArray(ids).toVersionLatest();
268
- await this.importer.importObjectsFromMainIfExist(compIdList);
269
- }
270
- }
271
- let laneToFetchArtifactsFrom;
272
- const getOtherLane = async () => {
273
- let lane = await legacyScope.loadLane(otherLaneId);
274
- const shouldFetch = !lane || !skipFetch && !lane.isNew;
275
- if (shouldFetch) {
276
- // 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.
277
- const otherLane = await this.lanes.fetchLaneWithItsComponents(otherLaneId, shouldIncludeUpdateDependents);
278
- laneToFetchArtifactsFrom = otherLane;
279
- lane = await legacyScope.loadLane(otherLaneId);
280
- }
281
- return lane;
282
- };
283
- const otherLane = isDefaultLane ? undefined : await getOtherLane();
284
- if (fetchCurrent && otherLane && currentLaneId.isDefault()) {
285
- const ids = await this.getMainIdsToMerge(otherLane, false, shouldIncludeUpdateDependents);
286
- const compIdList = _componentId().ComponentIdList.fromArray(ids).toVersionLatest();
287
- await this.importer.importObjectsFromMainIfExist(compIdList);
288
- }
289
- const getBitIds = async () => {
290
- if (isDefaultLane) {
291
- const ids = await this.getMainIdsToMerge(currentLane, !excludeNonLaneComps, shouldIncludeUpdateDependents);
292
- const modelComponents = await Promise.all(ids.map(id => this.scope.legacyScope.getModelComponent(id)));
293
- return (0, _lodash().compact)(modelComponents.map(c => {
294
- if (!c.head) return null; // probably the component was never merged to main
295
- return c.toComponentId().changeVersion(c.head.toString());
296
- }));
297
- }
298
- if (!otherLane) throw new Error(`lane must be defined for non-default`);
299
- return shouldIncludeUpdateDependents ? otherLane.toComponentIdsIncludeUpdateDependents() : otherLane.toComponentIds();
300
- };
301
- const idsToMerge = await getBitIds();
261
+ const consumer = this.workspace?.consumer;
302
262
  if (throwIfNotUpToDate) await this.throwIfNotUpToDate(otherLaneId, currentLaneId);
303
263
  this.logger.debug(`merging the following ids: ${idsToMerge.toString()}`);
304
264
  const shouldSquash = squash || currentLaneId.isDefault() && !noSquash;
@@ -406,6 +366,123 @@ class MergeLanesMain {
406
366
  conflicts
407
367
  };
408
368
  }
369
+ validateMergeFlags(otherLaneId, currentLaneId, options) {
370
+ const {
371
+ tag,
372
+ resolveUnrelated,
373
+ detachHead
374
+ } = options;
375
+ if (tag && !currentLaneId.isDefault()) {
376
+ throw new (_bitError().BitError)(`--tag only possible when on main. currently checked out to ${currentLaneId.toString()}`);
377
+ }
378
+ if (otherLaneId.isEqual(currentLaneId)) {
379
+ throw new (_bitError().BitError)(`unable to merge lane "${otherLaneId.toString()}", you're already at this lane. to get updates, simply run "bit checkout head"`);
380
+ }
381
+ if (resolveUnrelated && currentLaneId.isDefault()) {
382
+ throw new (_bitError().BitError)(`unable to resolve unrelated when on main. switch to ${otherLaneId.toString()} and run "bit lane merge main --resolve-unrelated"`);
383
+ }
384
+ if (detachHead && !(0, _harmonyModules2().isFeatureEnabled)(_harmonyModules2().DETACH_HEAD)) {
385
+ throw new (_bitError().BitError)(`unable to detach head. the feature is not enabled`);
386
+ }
387
+ if (detachHead && !currentLaneId.isDefault()) {
388
+ throw new (_bitError().BitError)(`unable to detach head. the current lane is not main`);
389
+ }
390
+ }
391
+ async resolveMergeContext(otherLaneId, currentLaneId, options) {
392
+ const {
393
+ skipFetch,
394
+ excludeNonLaneComps,
395
+ shouldIncludeUpdateDependents,
396
+ fetchCurrent
397
+ } = options;
398
+ const legacyScope = this.scope.legacyScope;
399
+ if (fetchCurrent && !currentLaneId.isDefault()) {
400
+ // if current is default, it'll be fetch later on
401
+ await this.lanes.fetchLaneWithItsComponents(currentLaneId);
402
+ }
403
+ const currentLane = currentLaneId.isDefault() ? undefined : await legacyScope.loadLane(currentLaneId);
404
+ const isDefaultLane = otherLaneId.isDefault();
405
+ if (isDefaultLane) {
406
+ if (!skipFetch) {
407
+ const ids = await this.getMainIdsToMerge(currentLane, !excludeNonLaneComps);
408
+ const compIdList = _componentId().ComponentIdList.fromArray(ids).toVersionLatest();
409
+ await this.importer.importObjectsFromMainIfExist(compIdList);
410
+ }
411
+ }
412
+ let laneToFetchArtifactsFrom;
413
+ const getOtherLane = async () => {
414
+ let lane = await legacyScope.loadLane(otherLaneId);
415
+ const shouldFetch = !lane || !skipFetch && !lane.isNew;
416
+ if (shouldFetch) {
417
+ // 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.
418
+ const otherLane = await this.lanes.fetchLaneWithItsComponents(otherLaneId, shouldIncludeUpdateDependents);
419
+ laneToFetchArtifactsFrom = otherLane;
420
+ lane = await legacyScope.loadLane(otherLaneId);
421
+ }
422
+ return lane;
423
+ };
424
+ const otherLane = isDefaultLane ? undefined : await getOtherLane();
425
+ if (fetchCurrent && otherLane && currentLaneId.isDefault()) {
426
+ const ids = await this.getMainIdsToMerge(otherLane, false, shouldIncludeUpdateDependents);
427
+ const compIdList = _componentId().ComponentIdList.fromArray(ids).toVersionLatest();
428
+ await this.importer.importObjectsFromMainIfExist(compIdList);
429
+ }
430
+ const getBitIds = async () => {
431
+ if (isDefaultLane) {
432
+ const ids = await this.getMainIdsToMerge(currentLane, !excludeNonLaneComps, shouldIncludeUpdateDependents);
433
+ const modelComponents = await Promise.all(ids.map(id => this.scope.legacyScope.getModelComponent(id)));
434
+ return (0, _lodash().compact)(modelComponents.map(c => {
435
+ if (!c.head) return null; // probably the component was never merged to main
436
+ return c.toComponentId().changeVersion(c.head.toString());
437
+ }));
438
+ }
439
+ if (!otherLane) throw new Error(`lane must be defined for non-default`);
440
+ return shouldIncludeUpdateDependents ? otherLane.toComponentIdsIncludeUpdateDependents() : otherLane.toComponentIds();
441
+ };
442
+ const idsToMerge = await getBitIds();
443
+ return {
444
+ currentLane,
445
+ otherLane,
446
+ laneToFetchArtifactsFrom,
447
+ idsToMerge
448
+ };
449
+ }
450
+
451
+ /**
452
+ * check conflicts in case of merging sourceLaneId into targetLaneId
453
+ */
454
+ async checkLaneForConflicts(sourceLaneIdStr, targetLaneIdStr, options) {
455
+ const legacyScope = this.scope.legacyScope;
456
+ const otherLaneId = await legacyScope.lanes.parseLaneIdFromString(sourceLaneIdStr);
457
+ const currentLaneId = await legacyScope.lanes.parseLaneIdFromString(targetLaneIdStr);
458
+ options.excludeNonLaneComps = true;
459
+ const {
460
+ currentLane,
461
+ otherLane,
462
+ idsToMerge
463
+ } = await this.resolveMergeContext(otherLaneId, currentLaneId, options);
464
+ const allComponentsStatus = await this.merging.getMergeStatus(idsToMerge, {
465
+ mergeStrategy: 'manual'
466
+ }, currentLane, otherLane);
467
+ (0, _checkout().throwForFailures)(allComponentsStatus);
468
+ const configMergeResults = (0, _lodash().compact)(allComponentsStatus.map(c => c.configMergeResult));
469
+ const componentsWithConfigConflicts = configMergeResults.filter(c => c.hasConflicts()).map(c => c.compIdStr);
470
+ const conflicts = [];
471
+ allComponentsStatus.forEach(c => {
472
+ const files = c.mergeResults?.modifiedFiles.filter(f => f.conflict || f.isBinaryConflict) || [];
473
+ const config = componentsWithConfigConflicts.includes(c.id.toStringWithoutVersion());
474
+ if (files.length || config) {
475
+ conflicts.push({
476
+ id: c.id,
477
+ files: files.map(f => f.filePath),
478
+ config
479
+ });
480
+ }
481
+ });
482
+ return {
483
+ conflicts
484
+ };
485
+ }
409
486
  async mergeMove(newLaneName, options) {
410
487
  if (!this.workspace) throw new (_workspace().OutsideWorkspaceError)();
411
488
  const lastMerge = new (_lastMerged().LastMerged)(this.scope, this.workspace.consumer, this.logger);
@@ -555,7 +632,7 @@ class MergeLanesMain {
555
632
  ${compsNotUpToDate.map(s => s.componentId.toString()).join('\n')}`);
556
633
  }
557
634
  }
558
- static async provider([lanes, cli, workspace, merging, loggerMain, remove, scope, exporter, importer, checkout, globalConfig]) {
635
+ static async provider([lanes, cli, workspace, merging, loggerMain, remove, scope, exporter, importer, checkout, globalConfig, express]) {
559
636
  const logger = loggerMain.createLogger(_mergeLanes().MergeLanesAspect.id);
560
637
  const lanesCommand = cli.getCommand('lane');
561
638
  const mergeLanesMain = new MergeLanesMain(workspace, merging, lanes, logger, remove, scope, exporter, importer, checkout);
@@ -563,12 +640,13 @@ ${compsNotUpToDate.map(s => s.componentId.toString()).join('\n')}`);
563
640
  lanesCommand?.commands?.push(new (_mergeAbort().MergeAbortLaneCmd)(mergeLanesMain));
564
641
  lanesCommand?.commands?.push(new (_mergeMove().MergeMoveLaneCmd)(mergeLanesMain));
565
642
  cli.register(new (_mergeLaneFromScope().MergeLaneFromScopeCmd)(mergeLanesMain));
643
+ express.register([new (_lanesCheckConflicts().LanesCheckConflictsRoute)(mergeLanesMain, logger)]);
566
644
  return mergeLanesMain;
567
645
  }
568
646
  }
569
647
  exports.MergeLanesMain = MergeLanesMain;
570
648
  _defineProperty(MergeLanesMain, "slots", []);
571
- _defineProperty(MergeLanesMain, "dependencies", [_lanes().LanesAspect, _cli().CLIAspect, _workspace().WorkspaceAspect, _merging().MergingAspect, _logger().LoggerAspect, _remove().RemoveAspect, _scope().ScopeAspect, _export().ExportAspect, _importer().ImporterAspect, _checkout().CheckoutAspect, _globalConfig().GlobalConfigAspect]);
649
+ _defineProperty(MergeLanesMain, "dependencies", [_lanes().LanesAspect, _cli().CLIAspect, _workspace().WorkspaceAspect, _merging().MergingAspect, _logger().LoggerAspect, _remove().RemoveAspect, _scope().ScopeAspect, _export().ExportAspect, _importer().ImporterAspect, _checkout().CheckoutAspect, _globalConfig().GlobalConfigAspect, _express().ExpressAspect]);
572
650
  _defineProperty(MergeLanesMain, "runtime", _cli().MainRuntime);
573
651
  async function filterComponentsStatus(allComponentsStatus, compIdsToKeep, allBitIds, legacyScope, includeDeps = false, otherLane,
574
652
  // lane that gets merged into the current lane. if not provided, it's main that gets merged into the current lane
@@ -1 +1 @@
1
- {"version":3,"names":["_bitError","data","require","_path","_interopRequireDefault","_cli","_importer","_lanes","_merging","_workspace","_harmonyModules","_componentId","_pMapSeries","_scope","_laneId","_logger","_checkout","_remove","_lodash","_export","_globalConfig","_mergeLanes","_mergeLane","_mergeLaneFromScope","_missingCompsToMerge","_mergeAbort","_lastMerged","_mergeMove","_harmonyModules2","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","MergeLanesMain","constructor","workspace","merging","lanes","logger","remove","scope","exporter","importer","checkout","mergeLaneByCLI","laneName","options","BitError","currentLaneId","consumer","getCurrentLaneId","otherLaneId","getParsedLaneId","mergeLane","mergeStrategy","noAutoSnap","noSnap","tag","snapMessage","existingOnWorkspaceOnly","build","keepReadme","squash","noSquash","pattern","includeDeps","skipDependencyInstallation","resolveUnrelated","ignoreConfigChanges","skipFetch","excludeNonLaneComps","shouldIncludeUpdateDependents","throwIfNotUpToDate","fetchCurrent","detachHead","legacyScope","isDefault","toString","isEqual","isFeatureEnabled","DETACH_HEAD","fetchLaneWithItsComponents","currentLane","undefined","loadLane","isDefaultLane","ids","getMainIdsToMerge","compIdList","ComponentIdList","fromArray","toVersionLatest","importObjectsFromMainIfExist","laneToFetchArtifactsFrom","getOtherLane","lane","shouldFetch","isNew","otherLane","getBitIds","modelComponents","Promise","all","map","id","getModelComponent","compact","c","head","toComponentId","changeVersion","Error","toComponentIdsIncludeUpdateDependents","toComponentIds","idsToMerge","debug","shouldSquash","allComponentsStatus","getMergeStatus","handleTargetAheadAsDiverged","componentIds","compIdsFromPattern","filterIdsFromPoolIdsByPattern","filterComponentsStatus","bitId","find","isEqualWithoutVersion","unchangedLegitimately","unchangedMessage","workspaceIds","listIds","throwForFailures","succeededComponents","squashSnaps","messageTitle","importHeadArtifactsFromLane","lastMerged","LastMerged","snapshot","takeSnapshot","mergeResults","mergeSnaps","persistSnapshot","mergedSuccessfully","failedComponents","every","failedComponent","deleteResults","readmeComponent","readmeComponentId","hash","removeLocallyByIds","reasonForRemoval","readmeResult","configMergeResults","configMergeResult","mergedSnapIds","mergeSnapResults","snappedComponents","componentsWithConfigConflicts","hasConflicts","compIdStr","conflicts","mergedSuccessfullyIds","components","files","filesStatus","f","FileStatus","manual","binaryConflict","config","includes","toStringWithoutVersion","snappedId","searchWithoutVersion","onDestroy","name","mergeMove","newLaneName","OutsideWorkspaceError","lastMerge","restoreLaneObjectFromLastMerged","newLaneResult","createLane","abortLaneMerge","checkoutProps","mergeAbortOpts","getCurrentLane","compDirsToRemove","restoreFromLastMerged","_reloadConsumer","objects","unmergedComponents","removeAllComponents","write","configMergeFile","getConflictMergeFile","delete","checkoutResults","checkoutError","restoreMissingComponents","err","error","restoredItems","path","basename","bitMap","mapPath","join","includeNonLaneComps","includeUpdateDependents","DEFAULT_LANE","laneIds","isExported","mainNotOnLane","laneId","mergeFromScope","fromLane","toLane","fromLaneId","parseLaneId","toLaneId","getDefaultLaneId","LaneId","parse","exportIfNeeded","idsToExport","laneToExport","compIdsList","exported","exportMany","laneObject","allVersions","exportHeadsOnly","filterOutExistingVersions","throwForMissingArtifacts","exportOrigin","setCurrentLaneId","mergeSnapError","generateMergeConflictFile","snappedIds","exportedIds","mergedNow","mergedPreviously","compIsAlreadyMergedMsg","unmerged","reason","status","diffStatus","skipChanges","compsNotUpToDate","componentsStatus","s","upToDate","componentId","provider","cli","loggerMain","globalConfig","createLogger","MergeLanesAspect","lanesCommand","getCommand","mergeLanesMain","commands","MergeLaneCmd","MergeAbortLaneCmd","MergeMoveLaneCmd","register","MergeLaneFromScopeCmd","exports","LanesAspect","CLIAspect","WorkspaceAspect","MergingAspect","LoggerAspect","RemoveAspect","ScopeAspect","ExportAspect","ImporterAspect","CheckoutAspect","GlobalConfigAspect","MainRuntime","compIdsToKeep","allBitIds","bitIdsFromPattern","bitIdsNotFromPattern","hasWithoutVersion","filteredComponentStatus","depsToAdd","missingDepsFromHead","missingDepsFromHistory","versionsToCheckPerId","pMapSeries","compId","fromStatus","divergeData","targetVersions","snapsOnTargetOnly","modelComponent","headOnTarget","getComponent","toImport","v","flat","scopeImporter","importWithoutDeps","cache","includeVersionHistory","remoteVersion","versionObj","loadVersion","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","depsOnLaneStr","MissingCompsToMerge","uniq","depsWithoutVersion","d","depsUniqWithoutVersion","uniqFromArray","getLogForSquash","basicLog","getBasicLog","log","message","opts","currentLaneName","componentFromModel","modifiedComp","squashOneComp","add","versionHistory","updateRebasedVersionHistory","isDiverged","isSourceAhead","isTargetAhead","remoteSnaps","getAllMessages","importManyObjects","versionObjects","load","getFinalMessage","allMessage","allMessageStr","m","currentParents","parents","commonSnapBeforeDiverge","doSquash","addAsOnlyParent","getModelComponentIfExist","ref","removeParent","finalMessage","setSquashed","previousParents","addRuntime","_default"],"sources":["merge-lanes.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport path from 'path';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { LanesAspect, LanesMain } from '@teambit/lanes';\nimport {\n MergingAspect,\n MergingMain,\n ComponentMergeStatus,\n ApplyVersionResults,\n compIsAlreadyMergedMsg,\n FileStatus,\n MergeStrategy,\n} from '@teambit/merging';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { getBasicLog } from '@teambit/harmony.modules.get-basic-log';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { Ref, Lane, Version, Log } from '@teambit/objects';\nimport pMapSeries from 'p-map-series';\nimport { Scope as LegacyScope } from '@teambit/legacy.scope';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { ConfigMergeResult } from '@teambit/config-merger';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { CheckoutAspect, CheckoutMain, CheckoutProps, throwForFailures } from '@teambit/checkout';\nimport { SnapsDistance } from '@teambit/component.snap-distance';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { compact, uniq } from 'lodash';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { GlobalConfigAspect, GlobalConfigMain } from '@teambit/global-config';\nimport { MergeLanesAspect } from './merge-lanes.aspect';\nimport { MergeLaneCmd } from './merge-lane.cmd';\nimport { MergeLaneFromScopeCmd } from './merge-lane-from-scope.cmd';\nimport { MissingCompsToMerge } from './exceptions/missing-comps-to-merge';\nimport { MergeAbortLaneCmd, MergeAbortOpts } from './merge-abort.cmd';\nimport { LastMerged } from './last-merged';\nimport { MergeMoveLaneCmd } from './merge-move.cmd';\nimport { DETACH_HEAD, isFeatureEnabled } from '@teambit/harmony.modules.feature-toggle';\n\nexport type MergeLaneOptions = {\n mergeStrategy: MergeStrategy;\n ours?: boolean;\n theirs?: boolean;\n noAutoSnap?: boolean;\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 excludeNonLaneComps?: boolean;\n shouldIncludeUpdateDependents?: boolean;\n throwIfNotUpToDate?: boolean; // relevant when merging from a scope\n fetchCurrent?: boolean; // needed when merging from a bare-scope (because it's empty)\n detachHead?: boolean;\n};\nexport type ConflictPerId = { id: ComponentID; files: string[]; config?: boolean };\nexport type MergeFromScopeResult = {\n mergedNow: ComponentID[];\n exportedIds: ComponentID[];\n unmerged: { id: ComponentID; reason: string }[]; // reasons currently are: ahead / already-merge / removed\n conflicts?: ConflictPerId[]; // relevant in case of diverge (currently possible only when merging from main to a lane)\n snappedIds?: ComponentID[]; // relevant in case of diverge (currently possible only when merging from main to a lane)\n mergedPreviously: ComponentID[];\n mergeSnapError?: Error;\n};\n\nexport class MergeLanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private merging: MergingMain,\n readonly lanes: LanesMain,\n readonly logger: Logger,\n private remove: RemoveMain,\n private scope: ScopeMain,\n private exporter: ExportMain,\n private importer: ImporterMain,\n private checkout: CheckoutMain\n ) {}\n\n async mergeLaneByCLI(laneName: string, options: MergeLaneOptions) {\n if (!this.workspace) {\n throw new BitError(`unable to merge a lane outside of Bit workspace`);\n }\n const currentLaneId = this.workspace.consumer.getCurrentLaneId();\n const otherLaneId = await this.workspace.consumer.getParsedLaneId(laneName);\n return this.mergeLane(otherLaneId, currentLaneId, options);\n }\n\n // eslint-disable-next-line complexity\n async mergeLane(\n otherLaneId: LaneId,\n currentLaneId: LaneId,\n options: MergeLaneOptions\n ): Promise<{\n mergeResults: ApplyVersionResults;\n deleteResults: any;\n configMergeResults: ConfigMergeResult[];\n mergedSuccessfullyIds: ComponentID[];\n conflicts: ConflictPerId[];\n }> {\n const consumer = this.workspace?.consumer;\n\n const {\n mergeStrategy,\n noAutoSnap,\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 excludeNonLaneComps,\n shouldIncludeUpdateDependents,\n throwIfNotUpToDate,\n fetchCurrent,\n detachHead,\n } = options;\n const legacyScope = this.scope.legacyScope;\n if (tag && !currentLaneId.isDefault()) {\n throw new BitError(`--tag only possible when on main. currently checked out to ${currentLaneId.toString()}`);\n }\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 if (detachHead && !isFeatureEnabled(DETACH_HEAD)) {\n throw new BitError(`unable to detach head. the feature is not enabled`);\n }\n if (detachHead && !currentLaneId.isDefault()) {\n throw new BitError(`unable to detach head. the current lane is not main`);\n }\n if (fetchCurrent && !currentLaneId.isDefault()) {\n // if current is default, it'll be fetch later on\n await this.lanes.fetchLaneWithItsComponents(currentLaneId);\n }\n const currentLane = currentLaneId.isDefault() ? undefined : await legacyScope.loadLane(currentLaneId);\n const isDefaultLane = otherLaneId.isDefault();\n if (isDefaultLane) {\n if (!skipFetch) {\n const ids = await this.getMainIdsToMerge(currentLane, !excludeNonLaneComps);\n const compIdList = ComponentIdList.fromArray(ids).toVersionLatest();\n await this.importer.importObjectsFromMainIfExist(compIdList);\n }\n }\n let laneToFetchArtifactsFrom: Lane | undefined;\n const getOtherLane = async () => {\n let lane = await legacyScope.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, shouldIncludeUpdateDependents);\n laneToFetchArtifactsFrom = otherLane;\n lane = await legacyScope.loadLane(otherLaneId);\n }\n return lane;\n };\n const otherLane = isDefaultLane ? undefined : await getOtherLane();\n if (fetchCurrent && otherLane && currentLaneId.isDefault()) {\n const ids = await this.getMainIdsToMerge(otherLane, false, shouldIncludeUpdateDependents);\n const compIdList = ComponentIdList.fromArray(ids).toVersionLatest();\n await this.importer.importObjectsFromMainIfExist(compIdList);\n }\n const getBitIds = async () => {\n if (isDefaultLane) {\n const ids = await this.getMainIdsToMerge(currentLane, !excludeNonLaneComps, shouldIncludeUpdateDependents);\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.toComponentId().changeVersion(c.head.toString());\n })\n );\n }\n if (!otherLane) throw new Error(`lane must be defined for non-default`);\n return shouldIncludeUpdateDependents\n ? otherLane.toComponentIdsIncludeUpdateDependents()\n : otherLane.toComponentIds();\n };\n const idsToMerge = await getBitIds();\n\n if (throwIfNotUpToDate) await this.throwIfNotUpToDate(otherLaneId, currentLaneId);\n\n this.logger.debug(`merging the following ids: ${idsToMerge.toString()}`);\n\n const shouldSquash = squash || (currentLaneId.isDefault() && !noSquash);\n let allComponentsStatus = await this.merging.getMergeStatus(\n idsToMerge,\n {\n resolveUnrelated,\n ignoreConfigChanges,\n shouldSquash,\n mergeStrategy,\n handleTargetAheadAsDiverged: noSnap,\n detachHead,\n },\n currentLane,\n otherLane\n );\n\n if (pattern) {\n const componentIds = idsToMerge;\n const compIdsFromPattern = await (this.workspace || this.scope).filterIdsFromPoolIdsByPattern(\n pattern,\n componentIds\n );\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n idsToMerge,\n legacyScope,\n includeDeps,\n otherLane,\n shouldSquash\n );\n idsToMerge.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unchangedLegitimately: true, unchangedMessage: `excluded by pattern` });\n }\n });\n }\n if (existingOnWorkspaceOnly && this.workspace) {\n const workspaceIds = this.workspace.listIds();\n const compIdsFromPattern = workspaceIds.filter((id) =>\n allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id))\n );\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n idsToMerge,\n legacyScope,\n includeDeps,\n otherLane,\n shouldSquash\n );\n idsToMerge.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({\n id: bitId,\n unchangedLegitimately: true,\n unchangedMessage: `not in the workspace`,\n });\n }\n });\n }\n\n throwForFailures(allComponentsStatus);\n\n const succeededComponents = allComponentsStatus.filter((c) => !c.unchangedMessage);\n if (shouldSquash) {\n await squashSnaps(succeededComponents, currentLaneId, otherLaneId, legacyScope, {\n messageTitle: options.snapMessage,\n detachHead,\n });\n }\n\n if (laneToFetchArtifactsFrom) {\n const ids = allComponentsStatus.map((c) => c.id);\n await this.importer.importHeadArtifactsFromLane(laneToFetchArtifactsFrom, ids, true);\n }\n\n const lastMerged = consumer ? new LastMerged(this.scope, consumer, this.logger) : undefined;\n const snapshot = await lastMerged?.takeSnapshot(currentLane);\n\n const mergeResults = await this.merging.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n otherLaneId,\n currentLane,\n noAutoSnap,\n noSnap,\n tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n detachHead,\n });\n\n if (snapshot) await lastMerged?.persistSnapshot(snapshot);\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], { reasonForRemoval: 'lane-merge' });\n } else if (otherLane && !otherLane.readmeComponent) {\n deleteResults = { readmeResult: '' };\n }\n const configMergeResults = compact(allComponentsStatus.map((c) => c.configMergeResult));\n\n const mergedSnapIds = ComponentIdList.fromArray(\n mergeResults.mergeSnapResults?.snappedComponents.map((c) => c.id) || []\n );\n const componentsWithConfigConflicts = configMergeResults.filter((c) => c.hasConflicts()).map((c) => c.compIdStr);\n const conflicts: ConflictPerId[] = [];\n const mergedSuccessfullyIds: ComponentID[] = [];\n mergeResults.components?.forEach((c) => {\n const files = Object.keys(c.filesStatus).filter(\n (f) => c.filesStatus[f] === FileStatus.manual || c.filesStatus[f] === FileStatus.binaryConflict\n );\n const config = componentsWithConfigConflicts.includes(c.id.toStringWithoutVersion());\n if (files.length || config) {\n conflicts.push({ id: c.id, files, config });\n } else {\n const snappedId = mergedSnapIds.searchWithoutVersion(c.id);\n mergedSuccessfullyIds.push(snappedId || c.id);\n }\n });\n\n await this.workspace?.consumer.onDestroy(`lane-merge (${otherLaneId.name})`);\n\n return { mergeResults, deleteResults, configMergeResults, mergedSuccessfullyIds, conflicts };\n }\n\n async mergeMove(newLaneName: string, options: { scope?: string }) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const lastMerge = new LastMerged(this.scope, this.workspace.consumer, this.logger);\n await lastMerge.restoreLaneObjectFromLastMerged();\n const newLaneResult = await this.lanes.createLane(newLaneName, { scope: options.scope });\n return newLaneResult;\n }\n\n async abortLaneMerge(checkoutProps: CheckoutProps, mergeAbortOpts: MergeAbortOpts) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const lastMerge = new LastMerged(this.scope, this.workspace.consumer, this.logger);\n const currentLane = await this.lanes.getCurrentLane();\n const { compDirsToRemove } = await lastMerge.restoreFromLastMerged(mergeAbortOpts, currentLane);\n\n await this.workspace._reloadConsumer();\n\n this.workspace.consumer.scope.objects.unmergedComponents.removeAllComponents();\n await this.workspace.consumer.scope.objects.unmergedComponents.write();\n\n const configMergeFile = this.workspace.getConflictMergeFile();\n await configMergeFile.delete();\n\n let checkoutResults: ApplyVersionResults | undefined;\n let checkoutError: Error | undefined;\n checkoutProps.ids = this.workspace.listIds();\n checkoutProps.restoreMissingComponents = true;\n try {\n checkoutResults = await this.checkout.checkout(checkoutProps);\n } catch (err: any) {\n this.logger.error(`merge-abort got an error during the checkout stage`, err);\n checkoutError = err;\n }\n\n const restoredItems = [\n `${path.basename(this.workspace.consumer.bitMap.mapPath)} file`,\n `${path.basename(this.workspace.consumer.config.path)} file`,\n ];\n if (compDirsToRemove.length) {\n restoredItems.push(`deleted components directories: ${compDirsToRemove.join(', ')}`);\n }\n if (currentLane) {\n restoredItems.push(`${currentLane.id()} lane object`);\n }\n\n return { checkoutResults, restoredItems, checkoutError };\n }\n\n private async getMainIdsToMerge(lane?: Lane | null, includeNonLaneComps = true, includeUpdateDependents = false) {\n if (!lane) throw new Error(`unable to merge ${DEFAULT_LANE}, the current lane was not found`);\n const laneIds = includeUpdateDependents ? lane.toComponentIdsIncludeUpdateDependents() : lane.toComponentIds();\n const ids = laneIds.filter((id) => this.scope.isExported(id));\n if (includeNonLaneComps) {\n if (!this.workspace) {\n throw new BitError(`getMainIdsToMerge needs workspace`);\n }\n const workspaceIds = this.workspace.listIds();\n const mainNotOnLane = workspaceIds.filter(\n (id) => !laneIds.find((laneId) => laneId.isEqualWithoutVersion(id)) && this.scope.isExported(id)\n );\n ids.push(...mainNotOnLane);\n }\n return ids;\n }\n\n async mergeFromScope(\n fromLane: string,\n toLane: string,\n options: Partial<MergeLaneOptions> & { push?: boolean; reMerge?: boolean }\n ): Promise<MergeFromScopeResult> {\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 = await this.lanes.parseLaneId(fromLane);\n const toLaneId = toLane === DEFAULT_LANE ? this.lanes.getDefaultLaneId() : LaneId.parse(toLane);\n const shouldIncludeUpdateDependents = toLaneId.isDefault();\n\n const exportIfNeeded = async (idsToExport: ComponentID[], laneToExport?: Lane): Promise<ComponentID[]> => {\n if (!options.push) return [];\n const shouldSquash = toLaneId.isDefault() && !options.noSquash; // only when merging to main we squash.\n const compIdsList = ComponentIdList.fromArray(idsToExport);\n const { exported } = await this.exporter.exportMany({\n scope: this.scope.legacyScope,\n ids: compIdsList,\n laneObject: laneToExport,\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 // @todo: if we merge main to a lane, then no need to export all main history, it'll be fetched later by fetchMissingHistory.\n // once a change is done in the exporter about this, uncomment the next line.\n // exportHeadsOnly: shouldSquash || fromLaneId.isDefault(),\n exportHeadsOnly: shouldSquash,\n // when merging main into a lane, because `shouldSquash` is false, we don't export head only, but all the snaps\n // in between. chances are that a) many of them are already exported, b) those that are not head, are not in\n // the local bare-scope, so trying to export them result in VersionNotFoundOnFS error.\n // it's best to filter them out before.\n // there is no risk of leaving modified Version objects behind, because when merging main into a lane, we don't\n // squash, so the Version objects are not modified.\n filterOutExistingVersions: fromLaneId.isDefault(),\n // all artifacts must be pushed. otherwise, they'll be missing from the component-scopes.\n // unless this is a merge from main to a lane, in which case it's not necessary to export the artifacts as\n // the user importing them will get them from main.\n throwForMissingArtifacts: !fromLaneId.isDefault(),\n exportOrigin: 'lane-merge',\n });\n return exported;\n };\n\n // current -> target (to)\n // other -> source (from)\n options.mergeStrategy = 'manual';\n options.excludeNonLaneComps = true;\n options.skipDependencyInstallation = true;\n options.shouldIncludeUpdateDependents = shouldIncludeUpdateDependents;\n options.throwIfNotUpToDate = !fromLaneId.isDefault();\n options.fetchCurrent = true;\n this.scope.legacyScope.setCurrentLaneId(toLaneId);\n\n const { mergeResults, configMergeResults, conflicts, mergedSuccessfullyIds } = await this.mergeLane(\n fromLaneId,\n toLaneId,\n options as MergeLaneOptions\n );\n\n const { mergeSnapResults, failedComponents, mergeSnapError } = mergeResults;\n\n if (configMergeResults.length) {\n this.logger.debug(\n `found the following config conflicts: ${configMergeResults\n .map((c) => `\\n${c.compIdStr}\\n${c.generateMergeConflictFile()}`)\n .join('\\n')}`\n );\n }\n\n const snappedIds = mergeSnapResults?.snappedComponents.map((c) => c.id) || [];\n\n const laneToExport = toLaneId.isDefault() ? undefined : await this.lanes.loadLane(toLaneId); // needs to be loaded again after the merge as it changed\n const exportedIds =\n conflicts.length || mergeSnapError\n ? []\n : await exportIfNeeded(\n mergedSuccessfullyIds.map((id) => id.changeVersion(undefined)),\n laneToExport\n );\n\n return {\n mergedNow: mergedSuccessfullyIds,\n mergedPreviously:\n failedComponents\n ?.filter(({ unchangedMessage }) => unchangedMessage === compIsAlreadyMergedMsg)\n .map((c) => c.id) || [],\n exportedIds,\n unmerged: failedComponents?.map((c) => ({ id: c.id, reason: c.unchangedMessage })) || [],\n conflicts,\n snappedIds,\n mergeSnapError,\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 CheckoutAspect,\n GlobalConfigAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([\n lanes,\n cli,\n workspace,\n merging,\n loggerMain,\n remove,\n scope,\n exporter,\n importer,\n checkout,\n globalConfig,\n ]: [\n LanesMain,\n CLIMain,\n Workspace,\n MergingMain,\n LoggerMain,\n RemoveMain,\n ScopeMain,\n ExportMain,\n ImporterMain,\n CheckoutMain,\n GlobalConfigMain,\n ]) {\n const logger = loggerMain.createLogger(MergeLanesAspect.id);\n const lanesCommand = cli.getCommand('lane');\n const mergeLanesMain = new MergeLanesMain(\n workspace,\n merging,\n lanes,\n logger,\n remove,\n scope,\n exporter,\n importer,\n checkout\n );\n lanesCommand?.commands?.push(new MergeLaneCmd(mergeLanesMain, globalConfig));\n lanesCommand?.commands?.push(new MergeAbortLaneCmd(mergeLanesMain));\n lanesCommand?.commands?.push(new MergeMoveLaneCmd(mergeLanesMain));\n cli.register(new MergeLaneFromScopeCmd(mergeLanesMain));\n return mergeLanesMain;\n }\n}\n\nasync function filterComponentsStatus(\n allComponentsStatus: ComponentMergeStatus[],\n compIdsToKeep: ComponentID[],\n allBitIds: ComponentID[],\n legacyScope: LegacyScope,\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 = ComponentIdList.fromArray(compIdsToKeep);\n const bitIdsNotFromPattern = allBitIds.filter((bitId) => !bitIdsFromPattern.hasWithoutVersion(bitId));\n const filteredComponentStatus: ComponentMergeStatus[] = [];\n const depsToAdd: ComponentID[] = [];\n const missingDepsFromHead = {};\n const missingDepsFromHistory: string[] = [];\n\n const versionsToCheckPerId = await pMapSeries(compIdsToKeep, async (compId) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(compId));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n if (fromStatus.unchangedMessage) {\n return undefined;\n }\n if (!otherLane) {\n // if merging main, no need to check whether the deps are included in the pattern.\n return undefined;\n }\n const { divergeData } = fromStatus;\n if (!divergeData) {\n throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);\n }\n let targetVersions: Ref[] = divergeData.snapsOnTargetOnly;\n if (!targetVersions.length) {\n return undefined;\n }\n const modelComponent = await legacyScope.getModelComponent(compId);\n if (shouldSquash) {\n // no need to check all versions, we merge only the head\n const headOnTarget = otherLane ? otherLane.getComponent(compId)?.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 return { compId, targetVersions, modelComponent };\n });\n\n // all these versions needs to be imported to load them later and check whether they have dependencies on the target lane\n const toImport = compact(versionsToCheckPerId)\n .map((c) => c.targetVersions.map((v) => c.compId.changeVersion(v.toString())))\n .flat();\n await legacyScope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(toImport), {\n lane: otherLane,\n cache: true,\n includeVersionHistory: false,\n reason: 'import all history of given patterns components to check whether they have dependencies on the lane',\n });\n\n await pMapSeries(compact(versionsToCheckPerId), async ({ compId, targetVersions, modelComponent }) => {\n await pMapSeries(targetVersions, async (remoteVersion) => {\n const versionObj = await modelComponent.loadVersion(remoteVersion.toString(), legacyScope.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: ComponentID[] = [];\n await Promise.all(\n depsNotIncludeInPattern.map(async (dep) => {\n const isOnLane = await legacyScope.isIdOnLane(dep, otherLane);\n if (isOnLane) {\n depsOnLane.push(dep);\n }\n })\n );\n if (!depsOnLane.length) {\n return;\n }\n if (includeDeps) {\n depsToAdd.push(...depsOnLane);\n } else {\n const headOnTarget = otherLane ? otherLane.getComponent(compId)?.head : modelComponent.head;\n const depsOnLaneStr = depsOnLane.map((dep) => dep.toStringWithoutVersion());\n if (headOnTarget?.isEqual(remoteVersion)) {\n depsOnLaneStr.forEach((dep) => {\n (missingDepsFromHead[dep] ||= []).push(compId.toStringWithoutVersion());\n });\n } else {\n missingDepsFromHistory.push(...depsOnLaneStr);\n }\n }\n });\n });\n if (Object.keys(missingDepsFromHead).length || missingDepsFromHistory.length) {\n throw new MissingCompsToMerge(missingDepsFromHead, uniq(missingDepsFromHistory));\n }\n\n if (depsToAdd.length) {\n // remove the version, otherwise, the uniq gives duplicate components with different versions.\n const depsWithoutVersion = depsToAdd.map((d) => d.changeVersion(undefined));\n const depsUniqWithoutVersion = ComponentIdList.uniqFromArray(depsWithoutVersion);\n depsUniqWithoutVersion.forEach((id) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n });\n }\n return filteredComponentStatus;\n}\n\nasync function getLogForSquash(otherLaneId: LaneId) {\n const basicLog = await getBasicLog();\n const log = {\n ...basicLog,\n message: `squashed during merge from ${otherLaneId.toString()}`,\n };\n return log;\n}\n\nasync function squashSnaps(\n succeededComponents: ComponentMergeStatus[],\n currentLaneId: LaneId,\n otherLaneId: LaneId,\n scope: LegacyScope,\n opts: { messageTitle?: string; detachHead?: boolean } = {}\n) {\n const currentLaneName = currentLaneId.name;\n const log = await getLogForSquash(otherLaneId);\n\n await Promise.all(\n succeededComponents.map(async ({ id, divergeData, componentFromModel }) => {\n if (!divergeData) {\n throw new Error(`unable to squash. divergeData is missing from ${id.toString()}`);\n }\n\n const modifiedComp = await squashOneComp(\n currentLaneName,\n otherLaneId,\n id,\n divergeData,\n log,\n scope,\n componentFromModel,\n opts\n );\n if (modifiedComp) {\n scope.objects.add(modifiedComp);\n const modelComponent = await scope.getModelComponent(id);\n const versionHistory = await modelComponent.updateRebasedVersionHistory(scope.objects, [modifiedComp]);\n if (versionHistory) scope.objects.add(versionHistory);\n }\n })\n );\n}\n\n/**\n * returns Version object if it was modified. otherwise, returns undefined\n */\nasync function squashOneComp(\n currentLaneName: string,\n otherLaneId: LaneId,\n id: ComponentID,\n divergeData: SnapsDistance,\n log: Log,\n scope: LegacyScope,\n componentFromModel?: Version,\n opts: { messageTitle?: string; detachHead?: boolean } = {}\n): Promise<Version | undefined> {\n const { messageTitle, detachHead } = opts;\n const shouldSquash = () => {\n if (divergeData.isDiverged()) {\n if (detachHead) {\n // for detach head, it's ok to have it as diverged. as long as the target is ahead, we want to squash.\n return true;\n }\n throw new BitError(`unable to squash because ${id.toString()} is diverged in history.\n consider switching to \"${\n otherLaneId.name\n }\" first, merging \"${currentLaneName}\", then switching back to \"${currentLaneName}\" and merging \"${otherLaneId.name}\"\n alternatively, 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 false;\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 false;\n }\n return true;\n };\n\n if (!shouldSquash()) {\n return undefined;\n }\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 const getAllMessages = async () => {\n if (!messageTitle) return [];\n await scope.scopeImporter.importManyObjects({ [otherLaneId.scope]: remoteSnaps.map((s) => s.toString()) });\n const versionObjects = (await Promise.all(remoteSnaps.map((s) => scope.objects.load(s)))) as Version[];\n return compact(versionObjects).map((v) => v.log.message);\n };\n const getFinalMessage = async (): Promise<string | undefined> => {\n if (!messageTitle) return undefined;\n const allMessage = await getAllMessages();\n const allMessageStr = compact(allMessage)\n .map((m) => `[*] ${m}`)\n .join('\\n');\n return `${messageTitle}\\n${allMessageStr}`;\n };\n if (!componentFromModel) {\n throw new Error('unable to squash, the componentFromModel is missing');\n }\n const currentParents = componentFromModel.parents;\n\n // if the remote has only one snap, there is nothing to squash.\n // other checks here is to make sure `componentFromModel.addAsOnlyParent` call is not needed.\n if (remoteSnaps.length === 1 && divergeData.commonSnapBeforeDiverge && currentParents.length === 1) {\n return undefined;\n }\n\n const doSquash = async () => {\n if (divergeData.commonSnapBeforeDiverge) {\n componentFromModel.addAsOnlyParent(divergeData.commonSnapBeforeDiverge);\n return;\n }\n if (currentLaneName !== DEFAULT_LANE) {\n // when squashing into lane, we have to take main into account\n const modelComponent = await scope.getModelComponentIfExist(id);\n if (!modelComponent) throw new Error(`missing ModelComponent for ${id.toString()}`);\n if (modelComponent.head) {\n componentFromModel.addAsOnlyParent(modelComponent.head);\n return;\n }\n }\n // there is no commonSnapBeforeDiverge. the local has no snaps, all are remote, no need for parents. keep only head.\n componentFromModel.parents.forEach((ref) => componentFromModel.removeParent(ref));\n };\n\n await doSquash();\n\n const finalMessage = await getFinalMessage();\n componentFromModel.setSquashed({ previousParents: currentParents, laneId: otherLaneId }, log, finalMessage);\n return componentFromModel;\n}\n\nMergeLanesAspect.addRuntime(MergeLanesMain);\n\nexport default MergeLanesMain;\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,MAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,OAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,MAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,SAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,QAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AASA,SAAAQ,WAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,UAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,gBAAA;EAAA,MAAAT,IAAA,GAAAC,OAAA;EAAAQ,eAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAU,aAAA;EA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MACA,MAAMwF,cAAc,GAAG,MAAMpQ,KAAK,CAAC6T,wBAAwB,CAAC7P,EAAE,CAAC;MAC/D,IAAI,CAACoM,cAAc,EAAE,MAAM,IAAI7L,KAAK,CAAC,8BAA8BP,EAAE,CAAC3B,QAAQ,CAAC,CAAC,EAAE,CAAC;MACnF,IAAI+N,cAAc,CAAChM,IAAI,EAAE;QACvBkO,kBAAkB,CAACsB,eAAe,CAACxD,cAAc,CAAChM,IAAI,CAAC;QACvD;MACF;IACF;IACA;IACAkO,kBAAkB,CAACmB,OAAO,CAACjV,OAAO,CAAEsV,GAAG,IAAKxB,kBAAkB,CAACyB,YAAY,CAACD,GAAG,CAAC,CAAC;EACnF,CAAC;EAED,MAAMH,QAAQ,CAAC,CAAC;EAEhB,MAAMK,YAAY,GAAG,MAAMZ,eAAe,CAAC,CAAC;EAC5Cd,kBAAkB,CAAC2B,WAAW,CAAC;IAAEC,eAAe,EAAEV,cAAc;IAAExI,MAAM,EAAErK;EAAY,CAAC,EAAEuR,GAAG,EAAE8B,YAAY,CAAC;EAC3G,OAAO1B,kBAAkB;AAC3B;AAEAzE,8BAAgB,CAACsG,UAAU,CAAC1U,cAAc,CAAC;AAAC,IAAA2U,QAAA,GAAA7F,OAAA,CAAA/Q,OAAA,GAE7BiC,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["_bitError","data","require","_path","_interopRequireDefault","_cli","_importer","_lanes","_merging","_workspace","_harmonyModules","_componentId","_pMapSeries","_scope","_laneId","_logger","_checkout","_remove","_lodash","_export","_globalConfig","_mergeLanes","_mergeLane","_mergeLaneFromScope","_missingCompsToMerge","_mergeAbort","_lastMerged","_mergeMove","_harmonyModules2","_express","_lanesCheckConflicts","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","MergeLanesMain","constructor","workspace","merging","lanes","logger","remove","scope","exporter","importer","checkout","mergeLaneByCLI","laneName","options","BitError","currentLaneId","consumer","getCurrentLaneId","otherLaneId","getParsedLaneId","mergeLane","validateMergeFlags","currentLane","otherLane","laneToFetchArtifactsFrom","idsToMerge","resolveMergeContext","mergeStrategy","noAutoSnap","noSnap","tag","snapMessage","existingOnWorkspaceOnly","build","keepReadme","squash","noSquash","pattern","includeDeps","skipDependencyInstallation","resolveUnrelated","ignoreConfigChanges","throwIfNotUpToDate","detachHead","legacyScope","debug","toString","shouldSquash","isDefault","allComponentsStatus","getMergeStatus","handleTargetAheadAsDiverged","componentIds","compIdsFromPattern","filterIdsFromPoolIdsByPattern","filterComponentsStatus","bitId","find","c","id","isEqualWithoutVersion","unchangedLegitimately","unchangedMessage","workspaceIds","listIds","throwForFailures","succeededComponents","squashSnaps","messageTitle","ids","map","importHeadArtifactsFromLane","lastMerged","LastMerged","undefined","snapshot","takeSnapshot","mergeResults","mergeSnaps","persistSnapshot","mergedSuccessfully","failedComponents","every","failedComponent","deleteResults","readmeComponent","readmeComponentId","changeVersion","head","hash","removeLocallyByIds","reasonForRemoval","readmeResult","configMergeResults","compact","configMergeResult","mergedSnapIds","ComponentIdList","fromArray","mergeSnapResults","snappedComponents","componentsWithConfigConflicts","hasConflicts","compIdStr","conflicts","mergedSuccessfullyIds","components","files","filesStatus","f","FileStatus","manual","binaryConflict","config","includes","toStringWithoutVersion","snappedId","searchWithoutVersion","onDestroy","name","isEqual","isFeatureEnabled","DETACH_HEAD","skipFetch","excludeNonLaneComps","shouldIncludeUpdateDependents","fetchCurrent","fetchLaneWithItsComponents","loadLane","isDefaultLane","getMainIdsToMerge","compIdList","toVersionLatest","importObjectsFromMainIfExist","getOtherLane","lane","shouldFetch","isNew","getBitIds","modelComponents","Promise","all","getModelComponent","toComponentId","Error","toComponentIdsIncludeUpdateDependents","toComponentIds","checkLaneForConflicts","sourceLaneIdStr","targetLaneIdStr","parseLaneIdFromString","modifiedFiles","conflict","isBinaryConflict","filePath","mergeMove","newLaneName","OutsideWorkspaceError","lastMerge","restoreLaneObjectFromLastMerged","newLaneResult","createLane","abortLaneMerge","checkoutProps","mergeAbortOpts","getCurrentLane","compDirsToRemove","restoreFromLastMerged","_reloadConsumer","objects","unmergedComponents","removeAllComponents","write","configMergeFile","getConflictMergeFile","delete","checkoutResults","checkoutError","restoreMissingComponents","err","error","restoredItems","path","basename","bitMap","mapPath","join","includeNonLaneComps","includeUpdateDependents","DEFAULT_LANE","laneIds","isExported","mainNotOnLane","laneId","mergeFromScope","fromLane","toLane","fromLaneId","parseLaneId","toLaneId","getDefaultLaneId","LaneId","parse","exportIfNeeded","idsToExport","laneToExport","compIdsList","exported","exportMany","laneObject","allVersions","exportHeadsOnly","filterOutExistingVersions","throwForMissingArtifacts","exportOrigin","setCurrentLaneId","mergeSnapError","generateMergeConflictFile","snappedIds","exportedIds","mergedNow","mergedPreviously","compIsAlreadyMergedMsg","unmerged","reason","status","diffStatus","skipChanges","compsNotUpToDate","componentsStatus","s","upToDate","componentId","provider","cli","loggerMain","globalConfig","express","createLogger","MergeLanesAspect","lanesCommand","getCommand","mergeLanesMain","commands","MergeLaneCmd","MergeAbortLaneCmd","MergeMoveLaneCmd","register","MergeLaneFromScopeCmd","LanesCheckConflictsRoute","exports","LanesAspect","CLIAspect","WorkspaceAspect","MergingAspect","LoggerAspect","RemoveAspect","ScopeAspect","ExportAspect","ImporterAspect","CheckoutAspect","GlobalConfigAspect","ExpressAspect","MainRuntime","compIdsToKeep","allBitIds","bitIdsFromPattern","bitIdsNotFromPattern","hasWithoutVersion","filteredComponentStatus","depsToAdd","missingDepsFromHead","missingDepsFromHistory","versionsToCheckPerId","pMapSeries","compId","fromStatus","divergeData","targetVersions","snapsOnTargetOnly","modelComponent","headOnTarget","getComponent","toImport","v","flat","scopeImporter","importWithoutDeps","cache","includeVersionHistory","remoteVersion","versionObj","loadVersion","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","depsOnLaneStr","MissingCompsToMerge","uniq","depsWithoutVersion","d","depsUniqWithoutVersion","uniqFromArray","getLogForSquash","basicLog","getBasicLog","log","message","opts","currentLaneName","componentFromModel","modifiedComp","squashOneComp","add","versionHistory","updateRebasedVersionHistory","isDiverged","isSourceAhead","isTargetAhead","remoteSnaps","getAllMessages","importManyObjects","versionObjects","load","getFinalMessage","allMessage","allMessageStr","m","currentParents","parents","commonSnapBeforeDiverge","doSquash","addAsOnlyParent","getModelComponentIfExist","ref","removeParent","finalMessage","setSquashed","previousParents","addRuntime","_default"],"sources":["merge-lanes.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport path from 'path';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ImporterAspect, ImporterMain } from '@teambit/importer';\nimport { LanesAspect, LanesMain } from '@teambit/lanes';\nimport {\n MergingAspect,\n MergingMain,\n ComponentMergeStatus,\n ApplyVersionResults,\n compIsAlreadyMergedMsg,\n FileStatus,\n MergeStrategy,\n} from '@teambit/merging';\nimport { WorkspaceAspect, OutsideWorkspaceError, Workspace } from '@teambit/workspace';\nimport { getBasicLog } from '@teambit/harmony.modules.get-basic-log';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { Ref, Lane, Version, Log } from '@teambit/objects';\nimport pMapSeries from 'p-map-series';\nimport { Scope as LegacyScope } from '@teambit/legacy.scope';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { ConfigMergeResult } from '@teambit/config-merger';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { CheckoutAspect, CheckoutMain, CheckoutProps, throwForFailures } from '@teambit/checkout';\nimport { SnapsDistance } from '@teambit/component.snap-distance';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { compact, uniq } from 'lodash';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { GlobalConfigAspect, GlobalConfigMain } from '@teambit/global-config';\nimport { MergeLanesAspect } from './merge-lanes.aspect';\nimport { MergeLaneCmd } from './merge-lane.cmd';\nimport { MergeLaneFromScopeCmd } from './merge-lane-from-scope.cmd';\nimport { MissingCompsToMerge } from './exceptions/missing-comps-to-merge';\nimport { MergeAbortLaneCmd, MergeAbortOpts } from './merge-abort.cmd';\nimport { LastMerged } from './last-merged';\nimport { MergeMoveLaneCmd } from './merge-move.cmd';\nimport { DETACH_HEAD, isFeatureEnabled } from '@teambit/harmony.modules.feature-toggle';\nimport { ExpressAspect, ExpressMain } from '@teambit/express';\nimport { LanesCheckConflictsRoute } from './lanes-check-conflicts.route';\n\nexport type MergeLaneOptions = {\n mergeStrategy: MergeStrategy;\n ours?: boolean;\n theirs?: boolean;\n noAutoSnap?: boolean;\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 excludeNonLaneComps?: boolean;\n shouldIncludeUpdateDependents?: boolean;\n throwIfNotUpToDate?: boolean; // relevant when merging from a scope\n fetchCurrent?: boolean; // needed when merging from a bare-scope (because it's empty)\n detachHead?: boolean;\n};\nexport type ConflictPerId = { id: ComponentID; files: string[]; config?: boolean };\nexport type MergeFromScopeResult = {\n mergedNow: ComponentID[];\n exportedIds: ComponentID[];\n unmerged: { id: ComponentID; reason: string }[]; // reasons currently are: ahead / already-merge / removed\n conflicts?: ConflictPerId[]; // relevant in case of diverge (currently possible only when merging from main to a lane)\n snappedIds?: ComponentID[]; // relevant in case of diverge (currently possible only when merging from main to a lane)\n mergedPreviously: ComponentID[];\n mergeSnapError?: Error;\n};\n\nexport class MergeLanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private merging: MergingMain,\n readonly lanes: LanesMain,\n readonly logger: Logger,\n private remove: RemoveMain,\n private scope: ScopeMain,\n private exporter: ExportMain,\n private importer: ImporterMain,\n private checkout: CheckoutMain\n ) {}\n\n async mergeLaneByCLI(laneName: string, options: MergeLaneOptions) {\n if (!this.workspace) {\n throw new BitError(`unable to merge a lane outside of Bit workspace`);\n }\n const currentLaneId = this.workspace.consumer.getCurrentLaneId();\n const otherLaneId = await this.workspace.consumer.getParsedLaneId(laneName);\n return this.mergeLane(otherLaneId, currentLaneId, options);\n }\n\n /**\n * merge otherLaneId into currentLaneId\n */\n async mergeLane(\n otherLaneId: LaneId,\n currentLaneId: LaneId,\n options: MergeLaneOptions\n ): Promise<{\n mergeResults: ApplyVersionResults;\n deleteResults: any;\n configMergeResults: ConfigMergeResult[];\n mergedSuccessfullyIds: ComponentID[];\n conflicts: ConflictPerId[];\n }> {\n this.validateMergeFlags(otherLaneId, currentLaneId, options);\n const { currentLane, otherLane, laneToFetchArtifactsFrom, idsToMerge } = await this.resolveMergeContext(\n otherLaneId,\n currentLaneId,\n options\n );\n\n const {\n mergeStrategy,\n noAutoSnap,\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 throwIfNotUpToDate,\n detachHead,\n } = options;\n const legacyScope = this.scope.legacyScope;\n const consumer = this.workspace?.consumer;\n\n if (throwIfNotUpToDate) await this.throwIfNotUpToDate(otherLaneId, currentLaneId);\n\n this.logger.debug(`merging the following ids: ${idsToMerge.toString()}`);\n\n const shouldSquash = squash || (currentLaneId.isDefault() && !noSquash);\n let allComponentsStatus = await this.merging.getMergeStatus(\n idsToMerge,\n {\n resolveUnrelated,\n ignoreConfigChanges,\n shouldSquash,\n mergeStrategy,\n handleTargetAheadAsDiverged: noSnap,\n detachHead,\n },\n currentLane,\n otherLane\n );\n\n if (pattern) {\n const componentIds = idsToMerge;\n const compIdsFromPattern = await (this.workspace || this.scope).filterIdsFromPoolIdsByPattern(\n pattern,\n componentIds\n );\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n idsToMerge,\n legacyScope,\n includeDeps,\n otherLane,\n shouldSquash\n );\n idsToMerge.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unchangedLegitimately: true, unchangedMessage: `excluded by pattern` });\n }\n });\n }\n if (existingOnWorkspaceOnly && this.workspace) {\n const workspaceIds = this.workspace.listIds();\n const compIdsFromPattern = workspaceIds.filter((id) =>\n allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id))\n );\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n idsToMerge,\n legacyScope,\n includeDeps,\n otherLane,\n shouldSquash\n );\n idsToMerge.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({\n id: bitId,\n unchangedLegitimately: true,\n unchangedMessage: `not in the workspace`,\n });\n }\n });\n }\n\n throwForFailures(allComponentsStatus);\n\n const succeededComponents = allComponentsStatus.filter((c) => !c.unchangedMessage);\n if (shouldSquash) {\n await squashSnaps(succeededComponents, currentLaneId, otherLaneId, legacyScope, {\n messageTitle: options.snapMessage,\n detachHead,\n });\n }\n\n if (laneToFetchArtifactsFrom) {\n const ids = allComponentsStatus.map((c) => c.id);\n await this.importer.importHeadArtifactsFromLane(laneToFetchArtifactsFrom, ids, true);\n }\n\n const lastMerged = consumer ? new LastMerged(this.scope, consumer, this.logger) : undefined;\n const snapshot = await lastMerged?.takeSnapshot(currentLane);\n\n const mergeResults = await this.merging.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n otherLaneId,\n currentLane,\n noAutoSnap,\n noSnap,\n tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n detachHead,\n });\n\n if (snapshot) await lastMerged?.persistSnapshot(snapshot);\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], { reasonForRemoval: 'lane-merge' });\n } else if (otherLane && !otherLane.readmeComponent) {\n deleteResults = { readmeResult: '' };\n }\n const configMergeResults = compact(allComponentsStatus.map((c) => c.configMergeResult));\n\n const mergedSnapIds = ComponentIdList.fromArray(\n mergeResults.mergeSnapResults?.snappedComponents.map((c) => c.id) || []\n );\n const componentsWithConfigConflicts = configMergeResults.filter((c) => c.hasConflicts()).map((c) => c.compIdStr);\n const conflicts: ConflictPerId[] = [];\n const mergedSuccessfullyIds: ComponentID[] = [];\n mergeResults.components?.forEach((c) => {\n const files = Object.keys(c.filesStatus).filter(\n (f) => c.filesStatus[f] === FileStatus.manual || c.filesStatus[f] === FileStatus.binaryConflict\n );\n const config = componentsWithConfigConflicts.includes(c.id.toStringWithoutVersion());\n if (files.length || config) {\n conflicts.push({ id: c.id, files, config });\n } else {\n const snappedId = mergedSnapIds.searchWithoutVersion(c.id);\n mergedSuccessfullyIds.push(snappedId || c.id);\n }\n });\n\n await this.workspace?.consumer.onDestroy(`lane-merge (${otherLaneId.name})`);\n\n return { mergeResults, deleteResults, configMergeResults, mergedSuccessfullyIds, conflicts };\n }\n\n private validateMergeFlags(otherLaneId: LaneId,\n currentLaneId: LaneId,\n options: MergeLaneOptions\n ) {\n const {\n tag,\n resolveUnrelated,\n detachHead,\n } = options;\n\n if (tag && !currentLaneId.isDefault()) {\n throw new BitError(`--tag only possible when on main. currently checked out to ${currentLaneId.toString()}`);\n }\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 if (detachHead && !isFeatureEnabled(DETACH_HEAD)) {\n throw new BitError(`unable to detach head. the feature is not enabled`);\n }\n if (detachHead && !currentLaneId.isDefault()) {\n throw new BitError(`unable to detach head. the current lane is not main`);\n }\n }\n\n private async resolveMergeContext(\n otherLaneId: LaneId,\n currentLaneId: LaneId,\n options: Partial<MergeLaneOptions>\n ) {\n const {\n skipFetch,\n excludeNonLaneComps,\n shouldIncludeUpdateDependents,\n fetchCurrent,\n } = options;\n const legacyScope = this.scope.legacyScope;\n if (fetchCurrent && !currentLaneId.isDefault()) {\n // if current is default, it'll be fetch later on\n await this.lanes.fetchLaneWithItsComponents(currentLaneId);\n }\n const currentLane = currentLaneId.isDefault() ? undefined : await legacyScope.loadLane(currentLaneId);\n const isDefaultLane = otherLaneId.isDefault();\n if (isDefaultLane) {\n if (!skipFetch) {\n const ids = await this.getMainIdsToMerge(currentLane, !excludeNonLaneComps);\n const compIdList = ComponentIdList.fromArray(ids).toVersionLatest();\n await this.importer.importObjectsFromMainIfExist(compIdList);\n }\n }\n let laneToFetchArtifactsFrom: Lane | undefined;\n const getOtherLane = async () => {\n let lane = await legacyScope.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, shouldIncludeUpdateDependents);\n laneToFetchArtifactsFrom = otherLane;\n lane = await legacyScope.loadLane(otherLaneId);\n }\n return lane;\n };\n const otherLane = isDefaultLane ? undefined : await getOtherLane();\n if (fetchCurrent && otherLane && currentLaneId.isDefault()) {\n const ids = await this.getMainIdsToMerge(otherLane, false, shouldIncludeUpdateDependents);\n const compIdList = ComponentIdList.fromArray(ids).toVersionLatest();\n await this.importer.importObjectsFromMainIfExist(compIdList);\n }\n const getBitIds = async () => {\n if (isDefaultLane) {\n const ids = await this.getMainIdsToMerge(currentLane, !excludeNonLaneComps, shouldIncludeUpdateDependents);\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.toComponentId().changeVersion(c.head.toString());\n })\n );\n }\n if (!otherLane) throw new Error(`lane must be defined for non-default`);\n return shouldIncludeUpdateDependents\n ? otherLane.toComponentIdsIncludeUpdateDependents()\n : otherLane.toComponentIds();\n };\n const idsToMerge = await getBitIds();\n\n return {\n currentLane,\n otherLane,\n laneToFetchArtifactsFrom,\n idsToMerge,\n }\n }\n\n /**\n * check conflicts in case of merging sourceLaneId into targetLaneId\n */\n async checkLaneForConflicts(\n sourceLaneIdStr: string,\n targetLaneIdStr: string,\n options: Partial<MergeLaneOptions>\n ): Promise<{\n conflicts: ConflictPerId[];\n }> {\n const legacyScope = this.scope.legacyScope;\n const otherLaneId: LaneId = await legacyScope.lanes.parseLaneIdFromString(sourceLaneIdStr);\n const currentLaneId: LaneId = await legacyScope.lanes.parseLaneIdFromString(targetLaneIdStr);\n options.excludeNonLaneComps = true;\n const { currentLane, otherLane, idsToMerge } = await this.resolveMergeContext(\n otherLaneId,\n currentLaneId,\n options\n );\n\n const allComponentsStatus = await this.merging.getMergeStatus(\n idsToMerge,\n {\n mergeStrategy: 'manual',\n },\n currentLane,\n otherLane\n );\n\n throwForFailures(allComponentsStatus);\n\n const configMergeResults = compact(allComponentsStatus.map((c) => c.configMergeResult));\n const componentsWithConfigConflicts = configMergeResults.filter((c) => c.hasConflicts()).map((c) => c.compIdStr);\n const conflicts: ConflictPerId[] = [];\n allComponentsStatus.forEach((c) => {\n const files = c.mergeResults?.modifiedFiles.filter((f) => f.conflict || f.isBinaryConflict) || [];\n const config = componentsWithConfigConflicts.includes(c.id.toStringWithoutVersion());\n if (files.length || config) {\n conflicts.push({ id: c.id, files: files.map(f => f.filePath), config });\n }\n });\n\n return { conflicts };\n }\n\n async mergeMove(newLaneName: string, options: { scope?: string }) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const lastMerge = new LastMerged(this.scope, this.workspace.consumer, this.logger);\n await lastMerge.restoreLaneObjectFromLastMerged();\n const newLaneResult = await this.lanes.createLane(newLaneName, { scope: options.scope });\n return newLaneResult;\n }\n\n async abortLaneMerge(checkoutProps: CheckoutProps, mergeAbortOpts: MergeAbortOpts) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const lastMerge = new LastMerged(this.scope, this.workspace.consumer, this.logger);\n const currentLane = await this.lanes.getCurrentLane();\n const { compDirsToRemove } = await lastMerge.restoreFromLastMerged(mergeAbortOpts, currentLane);\n\n await this.workspace._reloadConsumer();\n\n this.workspace.consumer.scope.objects.unmergedComponents.removeAllComponents();\n await this.workspace.consumer.scope.objects.unmergedComponents.write();\n\n const configMergeFile = this.workspace.getConflictMergeFile();\n await configMergeFile.delete();\n\n let checkoutResults: ApplyVersionResults | undefined;\n let checkoutError: Error | undefined;\n checkoutProps.ids = this.workspace.listIds();\n checkoutProps.restoreMissingComponents = true;\n try {\n checkoutResults = await this.checkout.checkout(checkoutProps);\n } catch (err: any) {\n this.logger.error(`merge-abort got an error during the checkout stage`, err);\n checkoutError = err;\n }\n\n const restoredItems = [\n `${path.basename(this.workspace.consumer.bitMap.mapPath)} file`,\n `${path.basename(this.workspace.consumer.config.path)} file`,\n ];\n if (compDirsToRemove.length) {\n restoredItems.push(`deleted components directories: ${compDirsToRemove.join(', ')}`);\n }\n if (currentLane) {\n restoredItems.push(`${currentLane.id()} lane object`);\n }\n\n return { checkoutResults, restoredItems, checkoutError };\n }\n\n private async getMainIdsToMerge(lane?: Lane | null, includeNonLaneComps = true, includeUpdateDependents = false) {\n if (!lane) throw new Error(`unable to merge ${DEFAULT_LANE}, the current lane was not found`);\n const laneIds = includeUpdateDependents ? lane.toComponentIdsIncludeUpdateDependents() : lane.toComponentIds();\n const ids = laneIds.filter((id) => this.scope.isExported(id));\n if (includeNonLaneComps) {\n if (!this.workspace) {\n throw new BitError(`getMainIdsToMerge needs workspace`);\n }\n const workspaceIds = this.workspace.listIds();\n const mainNotOnLane = workspaceIds.filter(\n (id) => !laneIds.find((laneId) => laneId.isEqualWithoutVersion(id)) && this.scope.isExported(id)\n );\n ids.push(...mainNotOnLane);\n }\n return ids;\n }\n\n async mergeFromScope(\n fromLane: string,\n toLane: string,\n options: Partial<MergeLaneOptions> & { push?: boolean; reMerge?: boolean }\n ): Promise<MergeFromScopeResult> {\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 = await this.lanes.parseLaneId(fromLane);\n const toLaneId = toLane === DEFAULT_LANE ? this.lanes.getDefaultLaneId() : LaneId.parse(toLane);\n const shouldIncludeUpdateDependents = toLaneId.isDefault();\n\n const exportIfNeeded = async (idsToExport: ComponentID[], laneToExport?: Lane): Promise<ComponentID[]> => {\n if (!options.push) return [];\n const shouldSquash = toLaneId.isDefault() && !options.noSquash; // only when merging to main we squash.\n const compIdsList = ComponentIdList.fromArray(idsToExport);\n const { exported } = await this.exporter.exportMany({\n scope: this.scope.legacyScope,\n ids: compIdsList,\n laneObject: laneToExport,\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 // @todo: if we merge main to a lane, then no need to export all main history, it'll be fetched later by fetchMissingHistory.\n // once a change is done in the exporter about this, uncomment the next line.\n // exportHeadsOnly: shouldSquash || fromLaneId.isDefault(),\n exportHeadsOnly: shouldSquash,\n // when merging main into a lane, because `shouldSquash` is false, we don't export head only, but all the snaps\n // in between. chances are that a) many of them are already exported, b) those that are not head, are not in\n // the local bare-scope, so trying to export them result in VersionNotFoundOnFS error.\n // it's best to filter them out before.\n // there is no risk of leaving modified Version objects behind, because when merging main into a lane, we don't\n // squash, so the Version objects are not modified.\n filterOutExistingVersions: fromLaneId.isDefault(),\n // all artifacts must be pushed. otherwise, they'll be missing from the component-scopes.\n // unless this is a merge from main to a lane, in which case it's not necessary to export the artifacts as\n // the user importing them will get them from main.\n throwForMissingArtifacts: !fromLaneId.isDefault(),\n exportOrigin: 'lane-merge',\n });\n return exported;\n };\n\n // current -> target (to)\n // other -> source (from)\n options.mergeStrategy = 'manual';\n options.excludeNonLaneComps = true;\n options.skipDependencyInstallation = true;\n options.shouldIncludeUpdateDependents = shouldIncludeUpdateDependents;\n options.throwIfNotUpToDate = !fromLaneId.isDefault();\n options.fetchCurrent = true;\n this.scope.legacyScope.setCurrentLaneId(toLaneId);\n\n const { mergeResults, configMergeResults, conflicts, mergedSuccessfullyIds } = await this.mergeLane(\n fromLaneId,\n toLaneId,\n options as MergeLaneOptions\n );\n\n const { mergeSnapResults, failedComponents, mergeSnapError } = mergeResults;\n\n if (configMergeResults.length) {\n this.logger.debug(\n `found the following config conflicts: ${configMergeResults\n .map((c) => `\\n${c.compIdStr}\\n${c.generateMergeConflictFile()}`)\n .join('\\n')}`\n );\n }\n\n const snappedIds = mergeSnapResults?.snappedComponents.map((c) => c.id) || [];\n\n const laneToExport = toLaneId.isDefault() ? undefined : await this.lanes.loadLane(toLaneId); // needs to be loaded again after the merge as it changed\n const exportedIds =\n conflicts.length || mergeSnapError\n ? []\n : await exportIfNeeded(\n mergedSuccessfullyIds.map((id) => id.changeVersion(undefined)),\n laneToExport\n );\n\n return {\n mergedNow: mergedSuccessfullyIds,\n mergedPreviously:\n failedComponents\n ?.filter(({ unchangedMessage }) => unchangedMessage === compIsAlreadyMergedMsg)\n .map((c) => c.id) || [],\n exportedIds,\n unmerged: failedComponents?.map((c) => ({ id: c.id, reason: c.unchangedMessage })) || [],\n conflicts,\n snappedIds,\n mergeSnapError,\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 CheckoutAspect,\n GlobalConfigAspect,\n ExpressAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([\n lanes,\n cli,\n workspace,\n merging,\n loggerMain,\n remove,\n scope,\n exporter,\n importer,\n checkout,\n globalConfig,\n express,\n ]: [\n LanesMain,\n CLIMain,\n Workspace,\n MergingMain,\n LoggerMain,\n RemoveMain,\n ScopeMain,\n ExportMain,\n ImporterMain,\n CheckoutMain,\n GlobalConfigMain,\n ExpressMain,\n ]) {\n const logger = loggerMain.createLogger(MergeLanesAspect.id);\n const lanesCommand = cli.getCommand('lane');\n const mergeLanesMain = new MergeLanesMain(\n workspace,\n merging,\n lanes,\n logger,\n remove,\n scope,\n exporter,\n importer,\n checkout\n );\n lanesCommand?.commands?.push(new MergeLaneCmd(mergeLanesMain, globalConfig));\n lanesCommand?.commands?.push(new MergeAbortLaneCmd(mergeLanesMain));\n lanesCommand?.commands?.push(new MergeMoveLaneCmd(mergeLanesMain));\n cli.register(new MergeLaneFromScopeCmd(mergeLanesMain));\n express.register([new LanesCheckConflictsRoute(mergeLanesMain, logger)]);\n return mergeLanesMain;\n }\n}\n\nasync function filterComponentsStatus(\n allComponentsStatus: ComponentMergeStatus[],\n compIdsToKeep: ComponentID[],\n allBitIds: ComponentID[],\n legacyScope: LegacyScope,\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 = ComponentIdList.fromArray(compIdsToKeep);\n const bitIdsNotFromPattern = allBitIds.filter((bitId) => !bitIdsFromPattern.hasWithoutVersion(bitId));\n const filteredComponentStatus: ComponentMergeStatus[] = [];\n const depsToAdd: ComponentID[] = [];\n const missingDepsFromHead = {};\n const missingDepsFromHistory: string[] = [];\n\n const versionsToCheckPerId = await pMapSeries(compIdsToKeep, async (compId) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(compId));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n if (fromStatus.unchangedMessage) {\n return undefined;\n }\n if (!otherLane) {\n // if merging main, no need to check whether the deps are included in the pattern.\n return undefined;\n }\n const { divergeData } = fromStatus;\n if (!divergeData) {\n throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);\n }\n let targetVersions: Ref[] = divergeData.snapsOnTargetOnly;\n if (!targetVersions.length) {\n return undefined;\n }\n const modelComponent = await legacyScope.getModelComponent(compId);\n if (shouldSquash) {\n // no need to check all versions, we merge only the head\n const headOnTarget = otherLane ? otherLane.getComponent(compId)?.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 return { compId, targetVersions, modelComponent };\n });\n\n // all these versions needs to be imported to load them later and check whether they have dependencies on the target lane\n const toImport = compact(versionsToCheckPerId)\n .map((c) => c.targetVersions.map((v) => c.compId.changeVersion(v.toString())))\n .flat();\n await legacyScope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(toImport), {\n lane: otherLane,\n cache: true,\n includeVersionHistory: false,\n reason: 'import all history of given patterns components to check whether they have dependencies on the lane',\n });\n\n await pMapSeries(compact(versionsToCheckPerId), async ({ compId, targetVersions, modelComponent }) => {\n await pMapSeries(targetVersions, async (remoteVersion) => {\n const versionObj = await modelComponent.loadVersion(remoteVersion.toString(), legacyScope.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: ComponentID[] = [];\n await Promise.all(\n depsNotIncludeInPattern.map(async (dep) => {\n const isOnLane = await legacyScope.isIdOnLane(dep, otherLane);\n if (isOnLane) {\n depsOnLane.push(dep);\n }\n })\n );\n if (!depsOnLane.length) {\n return;\n }\n if (includeDeps) {\n depsToAdd.push(...depsOnLane);\n } else {\n const headOnTarget = otherLane ? otherLane.getComponent(compId)?.head : modelComponent.head;\n const depsOnLaneStr = depsOnLane.map((dep) => dep.toStringWithoutVersion());\n if (headOnTarget?.isEqual(remoteVersion)) {\n depsOnLaneStr.forEach((dep) => {\n (missingDepsFromHead[dep] ||= []).push(compId.toStringWithoutVersion());\n });\n } else {\n missingDepsFromHistory.push(...depsOnLaneStr);\n }\n }\n });\n });\n if (Object.keys(missingDepsFromHead).length || missingDepsFromHistory.length) {\n throw new MissingCompsToMerge(missingDepsFromHead, uniq(missingDepsFromHistory));\n }\n\n if (depsToAdd.length) {\n // remove the version, otherwise, the uniq gives duplicate components with different versions.\n const depsWithoutVersion = depsToAdd.map((d) => d.changeVersion(undefined));\n const depsUniqWithoutVersion = ComponentIdList.uniqFromArray(depsWithoutVersion);\n depsUniqWithoutVersion.forEach((id) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n });\n }\n return filteredComponentStatus;\n}\n\nasync function getLogForSquash(otherLaneId: LaneId) {\n const basicLog = await getBasicLog();\n const log = {\n ...basicLog,\n message: `squashed during merge from ${otherLaneId.toString()}`,\n };\n return log;\n}\n\nasync function squashSnaps(\n succeededComponents: ComponentMergeStatus[],\n currentLaneId: LaneId,\n otherLaneId: LaneId,\n scope: LegacyScope,\n opts: { messageTitle?: string; detachHead?: boolean } = {}\n) {\n const currentLaneName = currentLaneId.name;\n const log = await getLogForSquash(otherLaneId);\n\n await Promise.all(\n succeededComponents.map(async ({ id, divergeData, componentFromModel }) => {\n if (!divergeData) {\n throw new Error(`unable to squash. divergeData is missing from ${id.toString()}`);\n }\n\n const modifiedComp = await squashOneComp(\n currentLaneName,\n otherLaneId,\n id,\n divergeData,\n log,\n scope,\n componentFromModel,\n opts\n );\n if (modifiedComp) {\n scope.objects.add(modifiedComp);\n const modelComponent = await scope.getModelComponent(id);\n const versionHistory = await modelComponent.updateRebasedVersionHistory(scope.objects, [modifiedComp]);\n if (versionHistory) scope.objects.add(versionHistory);\n }\n })\n );\n}\n\n/**\n * returns Version object if it was modified. otherwise, returns undefined\n */\nasync function squashOneComp(\n currentLaneName: string,\n otherLaneId: LaneId,\n id: ComponentID,\n divergeData: SnapsDistance,\n log: Log,\n scope: LegacyScope,\n componentFromModel?: Version,\n opts: { messageTitle?: string; detachHead?: boolean } = {}\n): Promise<Version | undefined> {\n const { messageTitle, detachHead } = opts;\n const shouldSquash = () => {\n if (divergeData.isDiverged()) {\n if (detachHead) {\n // for detach head, it's ok to have it as diverged. as long as the target is ahead, we want to squash.\n return true;\n }\n throw new BitError(`unable to squash because ${id.toString()} is diverged in history.\n consider switching to \"${\n otherLaneId.name\n }\" first, merging \"${currentLaneName}\", then switching back to \"${currentLaneName}\" and merging \"${otherLaneId.name}\"\n alternatively, 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 false;\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 false;\n }\n return true;\n };\n\n if (!shouldSquash()) {\n return undefined;\n }\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 const getAllMessages = async () => {\n if (!messageTitle) return [];\n await scope.scopeImporter.importManyObjects({ [otherLaneId.scope]: remoteSnaps.map((s) => s.toString()) });\n const versionObjects = (await Promise.all(remoteSnaps.map((s) => scope.objects.load(s)))) as Version[];\n return compact(versionObjects).map((v) => v.log.message);\n };\n const getFinalMessage = async (): Promise<string | undefined> => {\n if (!messageTitle) return undefined;\n const allMessage = await getAllMessages();\n const allMessageStr = compact(allMessage)\n .map((m) => `[*] ${m}`)\n .join('\\n');\n return `${messageTitle}\\n${allMessageStr}`;\n };\n if (!componentFromModel) {\n throw new Error('unable to squash, the componentFromModel is missing');\n }\n const currentParents = componentFromModel.parents;\n\n // if the remote has only one snap, there is nothing to squash.\n // other checks here is to make sure `componentFromModel.addAsOnlyParent` call is not needed.\n if (remoteSnaps.length === 1 && divergeData.commonSnapBeforeDiverge && currentParents.length === 1) {\n return undefined;\n }\n\n const doSquash = async () => {\n if (divergeData.commonSnapBeforeDiverge) {\n componentFromModel.addAsOnlyParent(divergeData.commonSnapBeforeDiverge);\n return;\n }\n if (currentLaneName !== DEFAULT_LANE) {\n // when squashing into lane, we have to take main into account\n const modelComponent = await scope.getModelComponentIfExist(id);\n if (!modelComponent) throw new Error(`missing ModelComponent for ${id.toString()}`);\n if (modelComponent.head) {\n componentFromModel.addAsOnlyParent(modelComponent.head);\n return;\n }\n }\n // there is no commonSnapBeforeDiverge. the local has no snaps, all are remote, no need for parents. keep only head.\n componentFromModel.parents.forEach((ref) => componentFromModel.removeParent(ref));\n };\n\n await doSquash();\n\n const finalMessage = await getFinalMessage();\n componentFromModel.setSquashed({ previousParents: currentParents, laneId: otherLaneId }, log, finalMessage);\n return componentFromModel;\n}\n\nMergeLanesAspect.addRuntime(MergeLanesMain);\n\n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CAAC3D,WAAW,CAACyD,uBAAuB,CAAC;MACvE;IACF;IACA,IAAIrB,eAAe,KAAK5H,sBAAY,EAAE;MACpC;MACA,MAAM2F,cAAc,GAAG,MAAMjR,KAAK,CAAC0U,wBAAwB,CAACtR,EAAE,CAAC;MAC/D,IAAI,CAAC6N,cAAc,EAAE,MAAM,IAAIxI,KAAK,CAAC,8BAA8BrF,EAAE,CAACb,QAAQ,CAAC,CAAC,EAAE,CAAC;MACnF,IAAI0O,cAAc,CAAChM,IAAI,EAAE;QACvBkO,kBAAkB,CAACsB,eAAe,CAACxD,cAAc,CAAChM,IAAI,CAAC;QACvD;MACF;IACF;IACA;IACAkO,kBAAkB,CAACmB,OAAO,CAAC9V,OAAO,CAAEmW,GAAG,IAAKxB,kBAAkB,CAACyB,YAAY,CAACD,GAAG,CAAC,CAAC;EACnF,CAAC;EAED,MAAMH,QAAQ,CAAC,CAAC;EAEhB,MAAMK,YAAY,GAAG,MAAMZ,eAAe,CAAC,CAAC;EAC5Cd,kBAAkB,CAAC2B,WAAW,CAAC;IAAEC,eAAe,EAAEV,cAAc;IAAE3I,MAAM,EAAE/K;EAAY,CAAC,EAAEoS,GAAG,EAAE8B,YAAY,CAAC;EAC3G,OAAO1B,kBAAkB;AAC3B;AAEA3E,8BAAgB,CAACwG,UAAU,CAACvV,cAAc,CAAC;AAAC,IAAAwV,QAAA,GAAA9F,OAAA,CAAA3R,OAAA,GAE7BiC,cAAc","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/merge-lanes",
3
- "version": "1.0.535",
3
+ "version": "1.0.536",
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": "1.0.535"
9
+ "version": "1.0.536"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -19,11 +19,12 @@
19
19
  "@teambit/lane-id": "0.0.312",
20
20
  "@teambit/harmony": "0.4.6",
21
21
  "@teambit/component-id": "1.2.2",
22
+ "@teambit/express": "0.0.1211",
23
+ "@teambit/logger": "0.0.1205",
22
24
  "@teambit/legacy.bit-map": "0.0.84",
23
25
  "@teambit/legacy.cli.prompts": "0.0.14",
24
26
  "@teambit/legacy.consumer": "0.0.27",
25
27
  "@teambit/legacy.scope": "0.0.27",
26
- "@teambit/logger": "0.0.1205",
27
28
  "@teambit/objects": "0.0.42",
28
29
  "@teambit/scope": "1.0.535",
29
30
  "@teambit/checkout": "1.0.535",
@@ -39,7 +40,7 @@
39
40
  "@teambit/harmony.modules.feature-toggle": "0.0.17",
40
41
  "@teambit/harmony.modules.get-basic-log": "0.0.28",
41
42
  "@teambit/importer": "1.0.535",
42
- "@teambit/lanes": "1.0.535",
43
+ "@teambit/lanes": "1.0.536",
43
44
  "@teambit/workspace": "1.0.535"
44
45
  },
45
46
  "devDependencies": {