@teambit/merge-lanes 0.0.123 → 0.0.125

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.
@@ -1,5 +1,12 @@
1
1
  import { Command, CommandOptions } from '@teambit/cli';
2
2
  import { MergeLanesMain } from './merge-lanes.main.runtime';
3
+ declare type Flags = {
4
+ pattern?: string;
5
+ push?: boolean;
6
+ keepReadme?: boolean;
7
+ noSquash: boolean;
8
+ includeDeps?: boolean;
9
+ };
3
10
  /**
4
11
  * private command. the underscore prefix is intended.
5
12
  */
@@ -19,18 +26,8 @@ export declare class MergeLaneFromScopeCmd implements Command {
19
26
  migration: boolean;
20
27
  remoteOp: boolean;
21
28
  constructor(mergeLanes: MergeLanesMain);
22
- report([name, pattern]: [string, string], { push, keepReadme, noSquash, includeDeps, }: {
23
- push?: boolean;
24
- keepReadme?: boolean;
25
- noSquash: boolean;
26
- includeDeps?: boolean;
27
- }): Promise<string>;
28
- json([name, pattern]: [string, string], { push, keepReadme, noSquash, includeDeps, }: {
29
- push?: boolean;
30
- keepReadme?: boolean;
31
- noSquash: boolean;
32
- includeDeps?: boolean;
33
- }): Promise<{
29
+ report([fromLane, toLane]: [string, string], { pattern, push, keepReadme, noSquash, includeDeps }: Flags): Promise<string>;
30
+ json([fromLane, toLane]: [string, string], { pattern, push, keepReadme, noSquash, includeDeps }: Flags): Promise<{
34
31
  code: number;
35
32
  data: any;
36
33
  error?: undefined;
@@ -40,3 +37,4 @@ export declare class MergeLaneFromScopeCmd implements Command {
40
37
  data?: undefined;
41
38
  }>;
42
39
  }
40
+ export {};
@@ -21,6 +21,13 @@ function _chalk() {
21
21
  };
22
22
  return data;
23
23
  }
24
+ function _laneId() {
25
+ const data = require("@teambit/lane-id");
26
+ _laneId = function () {
27
+ return data;
28
+ };
29
+ return data;
30
+ }
24
31
  function _bitError() {
25
32
  const data = require("@teambit/bit-error");
26
33
  _bitError = function () {
@@ -34,26 +41,27 @@ function _bitError() {
34
41
  class MergeLaneFromScopeCmd {
35
42
  constructor(mergeLanes) {
36
43
  this.mergeLanes = mergeLanes;
37
- (0, _defineProperty2().default)(this, "name", '_merge-lane <lane> [pattern]');
38
- (0, _defineProperty2().default)(this, "description", `merge a remote lane into main via a bare-scope (not workspace)`);
44
+ (0, _defineProperty2().default)(this, "name", '_merge-lane <from-lane> [to-lane]');
45
+ (0, _defineProperty2().default)(this, "description", `merge a remote lane into another lane or main via a bare-scope (not workspace)`);
39
46
  (0, _defineProperty2().default)(this, "extendedDescription", `to merge from a workspace, use "bit lane merge" command.
40
- this is intended to use from the UI, which will have a button to merge an existing lane into main.
41
- the lane must be up-to-date with main, otherwise, conflicts might occur which are not handled in this command`);
47
+ this is intended to use from the UI, which will have a button to merge an existing lane.
48
+ the lane must be up-to-date with the other lane, otherwise, conflicts might occur which are not handled in this command`);
42
49
  (0, _defineProperty2().default)(this, "arguments", [{
43
- name: 'lane',
44
- description: 'lane-id to merge to main'
50
+ name: 'from-lane',
51
+ description: 'lane-id to merge from'
45
52
  }, {
46
- name: 'pattern',
47
- description: 'EXPERIMENTAL. partially merge the lane with the specified component-pattern'
53
+ name: 'to-lane',
54
+ description: `lane-id to merge to. default is "${_laneId().DEFAULT_LANE}"`
48
55
  }]);
49
56
  (0, _defineProperty2().default)(this, "alias", '');
50
- (0, _defineProperty2().default)(this, "options", [['', 'push', 'export the updated objects to the original scopes once done'], ['', 'keep-readme', 'skip deleting the lane readme component after merging'], ['', 'no-squash', 'EXPERIMENTAL. relevant for merging lanes into main, which by default squash.'], ['', 'include-deps', 'EXPERIMENTAL. relevant for "--pattern". merge also dependencies of the given components'], ['j', 'json', 'output as json format']]);
57
+ (0, _defineProperty2().default)(this, "options", [['', 'pattern <string>', 'partially merge the lane with the specified component-pattern'], ['', 'push', 'export the updated objects to the original scopes once done'], ['', 'keep-readme', 'skip deleting the lane readme component after merging'], ['', 'no-squash', 'EXPERIMENTAL. relevant for merging lanes into main, which by default squash.'], ['', 'include-deps', 'EXPERIMENTAL. relevant for "--pattern". merge also dependencies of the given components'], ['j', 'json', 'output as json format']]);
51
58
  (0, _defineProperty2().default)(this, "loader", true);
52
59
  (0, _defineProperty2().default)(this, "private", true);
53
60
  (0, _defineProperty2().default)(this, "migration", true);
54
61
  (0, _defineProperty2().default)(this, "remoteOp", true);
55
62
  }
56
- async report([name, pattern], {
63
+ async report([fromLane, toLane], {
64
+ pattern,
57
65
  push = false,
58
66
  keepReadme = false,
59
67
  noSquash = false,
@@ -66,14 +74,14 @@ the lane must be up-to-date with main, otherwise, conflicts might occur which ar
66
74
  mergedNow,
67
75
  mergedPreviously,
68
76
  exportedIds
69
- } = await this.mergeLanes.mergeFromScope(name, {
77
+ } = await this.mergeLanes.mergeFromScope(fromLane, toLane || _laneId().DEFAULT_LANE, {
70
78
  push,
71
79
  keepReadme,
72
80
  noSquash,
73
81
  pattern,
74
82
  includeDeps
75
83
  });
76
- const mergedTitle = _chalk().default.green(`successfully merged ${mergedNow.length} components from ${name} to main`);
84
+ const mergedTitle = _chalk().default.green(`successfully merged ${mergedNow.length} components from ${fromLane} to ${toLane || _laneId().DEFAULT_LANE}`);
77
85
  const mergedOutput = mergedNow.length ? `${mergedTitle}\n${mergedNow.join('\n')}` : '';
78
86
  const nonMergedTitle = _chalk().default.bold(`the following ${mergedPreviously.length} components were already merged before, they were left intact`);
79
87
  const nonMergedOutput = mergedPreviously.length ? `\n${nonMergedTitle}\n${mergedPreviously.join('\n')}` : '';
@@ -81,7 +89,8 @@ the lane must be up-to-date with main, otherwise, conflicts might occur which ar
81
89
  const exportedOutput = exportedIds.length ? `\n${exportedTitle}\n${exportedIds.join('\n')}` : '';
82
90
  return mergedOutput + nonMergedOutput + exportedOutput;
83
91
  }
84
- async json([name, pattern], {
92
+ async json([fromLane, toLane], {
93
+ pattern,
85
94
  push = false,
86
95
  keepReadme = false,
87
96
  noSquash = false,
@@ -92,7 +101,7 @@ the lane must be up-to-date with main, otherwise, conflicts might occur which ar
92
101
  }
93
102
  let results;
94
103
  try {
95
- results = await this.mergeLanes.mergeFromScope(name, {
104
+ results = await this.mergeLanes.mergeFromScope(fromLane, toLane || _laneId().DEFAULT_LANE, {
96
105
  push,
97
106
  keepReadme,
98
107
  noSquash,
@@ -1 +1 @@
1
- {"version":3,"names":["MergeLaneFromScopeCmd","constructor","mergeLanes","name","description","report","pattern","push","keepReadme","noSquash","includeDeps","BitError","mergedNow","mergedPreviously","exportedIds","mergeFromScope","mergedTitle","chalk","green","length","mergedOutput","join","nonMergedTitle","bold","nonMergedOutput","exportedTitle","exportedOutput","json","results","code","data","err","error","message"],"sources":["merge-lane-from-scope.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { BitError } from '@teambit/bit-error';\nimport { MergeLanesMain } from './merge-lanes.main.runtime';\n\n/**\n * private command. the underscore prefix is intended.\n */\nexport class MergeLaneFromScopeCmd implements Command {\n name = '_merge-lane <lane> [pattern]';\n description = `merge a remote lane into 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 into main.\nthe lane must be up-to-date with main, otherwise, conflicts might occur which are not handled in this command`;\n arguments = [\n {\n name: 'lane',\n description: 'lane-id to merge to main',\n },\n {\n name: 'pattern',\n description: 'EXPERIMENTAL. partially merge the lane with the specified component-pattern',\n },\n ];\n alias = '';\n options = [\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', 'EXPERIMENTAL. relevant for merging lanes into main, which by default squash.'],\n ['', 'include-deps', 'EXPERIMENTAL. relevant for \"--pattern\". merge also dependencies of the given components'],\n ['j', 'json', 'output as json format'],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n remoteOp = true;\n\n constructor(private mergeLanes: MergeLanesMain) {}\n\n async report(\n [name, pattern]: [string, string],\n {\n push = false,\n keepReadme = false,\n noSquash = false,\n includeDeps = false,\n }: {\n push?: boolean;\n keepReadme?: boolean;\n noSquash: boolean;\n includeDeps?: boolean;\n }\n ): Promise<string> {\n if (includeDeps && !pattern) {\n throw new BitError(`\"--include-deps\" flag is relevant only for --pattern flag`);\n }\n const { mergedNow, mergedPreviously, exportedIds } = await this.mergeLanes.mergeFromScope(name, {\n push,\n keepReadme,\n noSquash,\n pattern,\n includeDeps,\n });\n\n const mergedTitle = chalk.green(`successfully merged ${mergedNow.length} components from ${name} to main`);\n const mergedOutput = mergedNow.length ? `${mergedTitle}\\n${mergedNow.join('\\n')}` : '';\n\n const nonMergedTitle = chalk.bold(\n `the following ${mergedPreviously.length} components were already merged before, they were left intact`\n );\n const nonMergedOutput = mergedPreviously.length ? `\\n${nonMergedTitle}\\n${mergedPreviously.join('\\n')}` : '';\n\n const exportedTitle = chalk.green(`successfully exported ${exportedIds.length} components`);\n const exportedOutput = exportedIds.length ? `\\n${exportedTitle}\\n${exportedIds.join('\\n')}` : '';\n\n return mergedOutput + nonMergedOutput + exportedOutput;\n }\n async json(\n [name, pattern]: [string, string],\n {\n push = false,\n keepReadme = false,\n noSquash = false,\n includeDeps = false,\n }: {\n push?: boolean;\n keepReadme?: boolean;\n noSquash: boolean;\n includeDeps?: boolean;\n }\n ) {\n if (includeDeps && !pattern) {\n throw new BitError(`\"--include-deps\" flag is relevant only for --pattern flag`);\n }\n let results: any;\n try {\n results = await this.mergeLanes.mergeFromScope(name, {\n push,\n keepReadme,\n noSquash,\n pattern,\n includeDeps,\n });\n return {\n code: 0,\n data: results,\n };\n } catch (err: any) {\n return {\n code: 1,\n error: err.message,\n };\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;AACA;AACA;AACO,MAAMA,qBAAqB,CAAoB;EA6BpDC,WAAW,CAASC,UAA0B,EAAE;IAAA,KAA5BA,UAA0B,GAA1BA,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{"version":3,"names":["MergeLaneFromScopeCmd","constructor","mergeLanes","name","description","DEFAULT_LANE","report","fromLane","toLane","pattern","push","keepReadme","noSquash","includeDeps","BitError","mergedNow","mergedPreviously","exportedIds","mergeFromScope","mergedTitle","chalk","green","length","mergedOutput","join","nonMergedTitle","bold","nonMergedOutput","exportedTitle","exportedOutput","json","results","code","data","err","error","message"],"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 { BitError } from '@teambit/bit-error';\nimport { 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};\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',\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 ['', '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', 'EXPERIMENTAL. relevant for merging lanes into main, which by default squash.'],\n ['', 'include-deps', 'EXPERIMENTAL. relevant for \"--pattern\". merge also dependencies of the given components'],\n ['j', 'json', 'output as json format'],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n remoteOp = true;\n\n constructor(private mergeLanes: MergeLanesMain) {}\n\n async report(\n [fromLane, toLane]: [string, string],\n { pattern, push = false, keepReadme = false, noSquash = false, includeDeps = false }: Flags\n ): Promise<string> {\n if (includeDeps && !pattern) {\n throw new BitError(`\"--include-deps\" flag is relevant only for --pattern flag`);\n }\n\n const { mergedNow, mergedPreviously, exportedIds } = await this.mergeLanes.mergeFromScope(\n fromLane,\n toLane || DEFAULT_LANE,\n {\n push,\n keepReadme,\n noSquash,\n pattern,\n includeDeps,\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(\n `the following ${mergedPreviously.length} components were already merged before, they were left intact`\n );\n const nonMergedOutput = mergedPreviously.length ? `\\n${nonMergedTitle}\\n${mergedPreviously.join('\\n')}` : '';\n\n const exportedTitle = chalk.green(`successfully exported ${exportedIds.length} components`);\n const exportedOutput = exportedIds.length ? `\\n${exportedTitle}\\n${exportedIds.join('\\n')}` : '';\n\n return mergedOutput + nonMergedOutput + exportedOutput;\n }\n async json(\n [fromLane, toLane]: [string, string],\n { pattern, push = false, keepReadme = false, noSquash = false, includeDeps = false }: Flags\n ) {\n if (includeDeps && !pattern) {\n throw new BitError(`\"--include-deps\" flag is relevant only for --pattern flag`);\n }\n let results: any;\n try {\n results = await this.mergeLanes.mergeFromScope(fromLane, toLane || DEFAULT_LANE, {\n push,\n keepReadme,\n noSquash,\n pattern,\n includeDeps,\n });\n return {\n code: 0,\n data: results,\n };\n } catch (err: any) {\n return {\n code: 1,\n error: err.message,\n };\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAWA;AACA;AACA;AACO,MAAMA,qBAAqB,CAAoB;EA8BpDC,WAAW,CAASC,UAA0B,EAA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,CAAC,CAAC;MACF,OAAO;QACLmB,IAAI,EAAE,CAAC;QACPC,IAAI,EAAEF;MACR,CAAC;IACH,CAAC,CAAC,OAAOG,GAAQ,EAAE;MACjB,OAAO;QACLF,IAAI,EAAE,CAAC;QACPG,KAAK,EAAED,GAAG,CAACE;MACb,CAAC;IACH;EACF;AACF;AAAC"}
@@ -37,13 +37,15 @@ export declare class MergeLanesMain {
37
37
  deleteResults: any;
38
38
  configMergeResults: ConfigMergeResult[];
39
39
  }>;
40
- mergeFromScope(laneName: string, options: Partial<MergeLaneOptions> & {
40
+ private getMainIdsToMerge;
41
+ mergeFromScope(fromLane: string, toLane: string, options: Partial<MergeLaneOptions> & {
41
42
  push?: boolean;
42
43
  }): Promise<{
43
44
  mergedPreviously: string[];
44
45
  mergedNow: string[];
45
46
  exportedIds: string[];
46
47
  }>;
48
+ private throwIfNotUpToDate;
47
49
  static slots: never[];
48
50
  static dependencies: import("@teambit/harmony").Aspect[];
49
51
  static runtime: import("@teambit/harmony").RuntimeDefinition;
@@ -204,7 +204,7 @@ class MergeLanesMain {
204
204
  const getBitIds = async () => {
205
205
  if (isDefaultLane) {
206
206
  if (!currentLane) throw new Error(`unable to merge ${_laneId().DEFAULT_LANE}, the current lane was not found`);
207
- return consumer.scope.getDefaultLaneIdsFromLane(currentLane);
207
+ return this.getMainIdsToMerge(currentLane);
208
208
  }
209
209
  if (!otherLane) throw new Error(`lane must be defined for non-default`);
210
210
  return otherLane.toBitIds();
@@ -292,14 +292,32 @@ class MergeLanesMain {
292
292
  }
293
293
  }
294
294
  }
295
- async mergeFromScope(laneName, options) {
296
- if (this.workspace) throw new (_bitError().BitError)(`unable to run this command from a workspace, please create a new bare-scope and run it from there`);
297
- const laneId = _laneId().LaneId.parse(laneName);
298
- const lane = await this.lanes.importLaneObject(laneId);
295
+ async getMainIdsToMerge(lane) {
299
296
  const laneIds = lane.toBitIds();
297
+ if (!this.workspace) {
298
+ throw new (_bitError().BitError)(`getMainIdsToMerge needs workspace`);
299
+ }
300
+ const workspaceIds = (await this.workspace.listIds()).map(id => id._legacy);
301
+ const mainNotOnLane = workspaceIds.filter(id => !laneIds.find(laneId => laneId.isEqualWithoutVersion(id)));
302
+ const ids = [...laneIds, ...mainNotOnLane].filter(id => id.hasScope());
303
+ const modelComponents = await Promise.all(ids.map(id => this.scope.legacyScope.getModelComponent(id)));
304
+ return (0, _lodash().compact)(modelComponents.map(c => {
305
+ if (!c.head) return null; // probably the component was never merged to main
306
+ return c.toBitId().changeVersion(c.head.toString());
307
+ }));
308
+ }
309
+ async mergeFromScope(fromLane, toLane, options) {
310
+ if (this.workspace) {
311
+ throw new (_bitError().BitError)(`unable to run this command from a workspace, please create a new bare-scope and run it from there`);
312
+ }
313
+ const fromLaneId = _laneId().LaneId.parse(fromLane);
314
+ const fromLaneObj = await this.lanes.importLaneObject(fromLaneId);
315
+ const toLaneId = toLane === _laneId().DEFAULT_LANE ? this.lanes.getDefaultLaneId() : _laneId().LaneId.parse(toLane);
316
+ const toLaneObj = toLaneId.isDefault() ? undefined : await this.lanes.importLaneObject(toLaneId);
317
+ const fromLaneBitIds = fromLaneObj.toBitIds();
300
318
  const getIdsToMerge = async () => {
301
- if (!options.pattern) return laneIds;
302
- const laneCompIds = await this.scope.resolveMultipleComponentIds(laneIds);
319
+ if (!options.pattern) return fromLaneBitIds;
320
+ const laneCompIds = await this.scope.resolveMultipleComponentIds(fromLaneBitIds);
303
321
  const ids = this.scope.filterIdsFromPoolIdsByPattern(options.pattern, laneCompIds);
304
322
  return _bitId().BitIds.fromArray(ids.map(id => id._legacy));
305
323
  };
@@ -308,40 +326,56 @@ class MergeLanesMain {
308
326
  await scopeComponentsImporter.importManyDeltaWithoutDeps({
309
327
  ids: idsToMerge,
310
328
  fromHead: true,
311
- lane,
329
+ lane: fromLaneObj,
312
330
  ignoreMissingHead: true
313
331
  });
314
- // get their main as well
332
+ // get their main/to-lane as well
315
333
  await scopeComponentsImporter.importManyDeltaWithoutDeps({
316
334
  ids: idsToMerge.toVersionLatest(),
317
335
  fromHead: true,
318
- ignoreMissingHead: true
336
+ ignoreMissingHead: true,
337
+ lane: toLaneObj
319
338
  });
339
+ await this.throwIfNotUpToDate(fromLaneId, toLaneId);
320
340
  const repo = this.scope.legacyScope.objects;
321
341
  // loop through all components, make sure they're all ahead of main (it might not be on main yet).
322
342
  // then, change the version object to include an extra parent to point to the main.
323
343
  // then, change the component object head to point to this changed version
324
344
  const mergedPreviously = [];
325
345
  const mergedNow = [];
346
+ const shouldSquash = !toLaneObj && !options.noSquash; // only when merging to main we squash.
326
347
  const bitObjectsPerComp = await (0, _pMapSeries().default)(idsToMerge, async id => {
348
+ var _toLaneObj$getCompone;
327
349
  const modelComponent = await this.scope.legacyScope.getModelComponent(id);
328
- const versionObj = await modelComponent.loadVersion(id.version, repo);
329
- const laneHead = modelComponent.getRef(id.version);
330
- if (!laneHead) throw new Error(`lane head must be defined for ${id.toString()}`);
331
- const mainHead = modelComponent.head || null;
332
- if (mainHead !== null && mainHead !== void 0 && mainHead.isEqual(laneHead)) {
350
+ const fromVersionObj = await modelComponent.loadVersion(id.version, repo);
351
+ const fromLaneHead = modelComponent.getRef(id.version);
352
+ if (!fromLaneHead) throw new Error(`lane head must be defined for ${id.toString()}`);
353
+ const toLaneHead = toLaneObj ? (_toLaneObj$getCompone = toLaneObj.getComponent(id)) === null || _toLaneObj$getCompone === void 0 ? void 0 : _toLaneObj$getCompone.head : modelComponent.head || null;
354
+ if (toLaneHead !== null && toLaneHead !== void 0 && toLaneHead.isEqual(fromLaneHead)) {
333
355
  mergedPreviously.push(id);
334
356
  return undefined;
335
357
  }
358
+ // this might be confusing, we pass the toLaneHead as the sourceHead and the fromLaneHead as the targetHead.
359
+ // this is because normally, in the workspace, we merge another lane (target) into the current lane (source).
360
+ // so effectively, in the workspace, we merge fromLane=target into toLane=source.
336
361
  const divergeData = await (0, _getDivergeData().getDivergeData)({
337
362
  repo,
338
363
  modelComponent,
339
- sourceHead: mainHead,
340
- targetHead: laneHead
364
+ sourceHead: toLaneHead,
365
+ targetHead: fromLaneHead
341
366
  });
342
- const modifiedVersion = squashOneComp(_laneId().DEFAULT_LANE, laneId, id, divergeData, versionObj);
343
- modelComponent.setHead(laneHead);
344
- const objects = [modelComponent, modifiedVersion];
367
+ const modifiedVersion = shouldSquash ? squashOneComp(_laneId().DEFAULT_LANE, fromLaneId, id, divergeData, fromVersionObj) : undefined;
368
+ const objects = [];
369
+ if (modifiedVersion) objects.push(modifiedVersion);
370
+ if (toLaneObj) {
371
+ toLaneObj.addComponent({
372
+ id: id.changeVersion(undefined),
373
+ head: fromLaneHead
374
+ });
375
+ } else {
376
+ modelComponent.setHead(fromLaneHead);
377
+ objects.push(modelComponent);
378
+ }
345
379
  mergedNow.push(id);
346
380
  return {
347
381
  id,
@@ -349,7 +383,9 @@ class MergeLanesMain {
349
383
  };
350
384
  });
351
385
  const bitObjects = (0, _lodash().compact)(bitObjectsPerComp).map(b => b.objects);
352
- await repo.writeObjectsToTheFS(bitObjects.flat());
386
+ const bitObjectsFlat = bitObjects.flat();
387
+ if (toLaneObj) bitObjectsFlat.push(toLaneObj);
388
+ await repo.writeObjectsToTheFS(bitObjectsFlat);
353
389
  let exportedIds = [];
354
390
  if (options.push) {
355
391
  const ids = (0, _lodash().compact)(bitObjectsPerComp).map(b => b.id);
@@ -358,12 +394,13 @@ class MergeLanesMain {
358
394
  exported
359
395
  } = await this.exporter.exportMany({
360
396
  scope: this.scope.legacyScope,
361
- ids: bitIds,
362
- idsWithFutureScope: bitIds,
397
+ ids: shouldSquash ? bitIds : new (_bitId().BitIds)(),
398
+ idsWithFutureScope: shouldSquash ? bitIds : new (_bitId().BitIds)(),
399
+ laneObject: toLaneObj,
363
400
  allVersions: false,
364
401
  // no need to export anything else other than the head. the normal calculation of what to export won't apply here
365
402
  // as it is done from the scope.
366
- exportHeadsOnly: true
403
+ exportHeadsOnly: shouldSquash
367
404
  });
368
405
  exportedIds = exported.map(id => id.toString());
369
406
  }
@@ -373,6 +410,16 @@ class MergeLanesMain {
373
410
  exportedIds
374
411
  };
375
412
  }
413
+ async throwIfNotUpToDate(fromLaneId, toLaneId) {
414
+ const status = await this.lanes.diffStatus(fromLaneId, toLaneId, {
415
+ skipChanges: true
416
+ });
417
+ const compsNotUpToDate = status.componentsStatus.filter(s => !s.upToDate);
418
+ if (compsNotUpToDate.length) {
419
+ throw new Error(`unable to merge, the following components are not up-to-date:
420
+ ${compsNotUpToDate.map(s => s.componentId.toString()).join('\n')}`);
421
+ }
422
+ }
376
423
  static async provider([lanes, cli, workspace, merging, loggerMain, remove, scope, exporter]) {
377
424
  var _lanesCommand$command;
378
425
  const logger = loggerMain.createLogger(_mergeLanes().MergeLanesAspect.id);
@@ -1 +1 @@
1
- {"version":3,"names":["MergeLanesMain","constructor","workspace","merging","lanes","logger","remove","scope","exporter","mergeLane","laneName","options","BitError","consumer","mergeStrategy","noSnap","tag","snapMessage","existingOnWorkspaceOnly","build","keepReadme","noSquash","pattern","includeDeps","skipDependencyInstallation","resolveUnrelated","ignoreConfigChanges","remote","currentLaneId","getCurrentLaneId","isDefault","toString","otherLaneId","getParsedLaneId","isEqual","currentLane","loadLane","isDefaultLane","getOtherLane","undefined","lane","fetchLaneWithItsComponents","otherLane","getBitIds","Error","DEFAULT_LANE","getDefaultLaneIdsFromLane","toBitIds","bitIds","debug","allComponentsStatus","getMergeStatus","shouldSquash","componentIds","resolveMultipleComponentIds","compIdsFromPattern","filterIdsFromPoolIdsByPattern","filterComponentsStatus","forEach","bitId","find","c","id","isEqualWithoutVersion","push","unmergedLegitimately","unmergedMessage","workspaceIds","listIds","filter","_legacy","throwForFailures","squashSnaps","mergeResults","mergeSnaps","laneId","localLane","mergedSuccessfully","failedComponents","length","every","failedComponent","unchangedLegitimately","deleteResults","readmeComponent","readmeComponentId","changeVersion","head","hash","componentsPattern","force","track","deleteFiles","fromLane","readmeResult","name","configMergeResults","map","configMergeResult","onDestroy","compact","failureMsgs","chalk","bold","red","join","mergeFromScope","LaneId","parse","importLaneObject","laneIds","getIdsToMerge","laneCompIds","ids","BitIds","fromArray","idsToMerge","scopeComponentsImporter","ScopeComponentsImporter","getInstance","legacyScope","importManyDeltaWithoutDeps","fromHead","ignoreMissingHead","toVersionLatest","repo","objects","mergedPreviously","mergedNow","bitObjectsPerComp","pMapSeries","modelComponent","getModelComponent","versionObj","loadVersion","version","laneHead","getRef","mainHead","divergeData","getDivergeData","sourceHead","targetHead","modifiedVersion","squashOneComp","setHead","bitObjects","b","writeObjectsToTheFS","flat","exportedIds","exported","exportMany","idsWithFutureScope","allVersions","exportHeadsOnly","provider","cli","loggerMain","createLogger","MergeLanesAspect","lanesCommand","getCommand","mergeLanesMain","commands","MergeLaneCmd","register","MergeLaneFromScopeCmd","LanesAspect","CLIAspect","WorkspaceAspect","MergingAspect","LoggerAspect","RemoveAspect","ScopeAspect","ExportAspect","MainRuntime","compIdsToKeep","allBitIds","bitIdsFromPattern","bitIdsNotFromPattern","hasWithoutVersion","filteredComponentStatus","depsToAdd","compId","fromStatus","targetVersions","snapsOnTargetOnly","headOnTarget","getComponent","remoteVersion","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","Promise","all","dep","isOnLane","isIdOnLane","d","depsUniq","uniqFromArray","currentLaneName","succeededComponents","componentFromModel","modifiedComp","add","versionHistory","updateRebasedVersionHistory","isDiverged","isSourceAhead","isTargetAhead","remoteSnaps","currentParents","parents","commonSnapBeforeDiverge","addAsOnlyParent","ref","removeParent","setSquashed","previousParents","addRuntime"],"sources":["merge-lanes.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { LanesAspect, LanesMain } from '@teambit/lanes';\nimport MergingAspect, { MergingMain, ComponentMergeStatus, ConfigMergeResult } from '@teambit/merging';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport chalk from 'chalk';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport pMapSeries from 'p-map-series';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { MergeStrategy, ApplyVersionResults } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport { ComponentID } from '@teambit/component-id';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { Lane, Version } from '@teambit/legacy/dist/scope/models';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { compact } from 'lodash';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { BitObject } from '@teambit/legacy/dist/scope/objects';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { MergeLanesAspect } from './merge-lanes.aspect';\nimport { MergeLaneCmd } from './merge-lane.cmd';\nimport { MergeLaneFromScopeCmd } from './merge-lane-from-scope.cmd';\n\nexport type MergeLaneOptions = {\n mergeStrategy: MergeStrategy;\n noSnap: boolean;\n snapMessage: string;\n existingOnWorkspaceOnly: boolean;\n build: boolean;\n keepReadme: boolean;\n noSquash: boolean;\n tag?: boolean;\n pattern?: string;\n includeDeps?: boolean;\n skipDependencyInstallation?: boolean;\n resolveUnrelated?: MergeStrategy;\n ignoreConfigChanges?: boolean;\n remote?: boolean;\n};\n\nexport class MergeLanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private merging: MergingMain,\n private lanes: LanesMain,\n private logger: Logger,\n private remove: RemoveMain,\n private scope: ScopeMain,\n private exporter: ExportMain\n ) {}\n\n async mergeLane(\n laneName: string,\n options: MergeLaneOptions\n ): Promise<{ mergeResults: ApplyVersionResults; deleteResults: any; configMergeResults: ConfigMergeResult[] }> {\n if (!this.workspace) {\n throw new BitError(`unable to merge a lane outside of Bit workspace`);\n }\n const consumer = this.workspace.consumer;\n\n const {\n mergeStrategy,\n noSnap,\n tag,\n snapMessage,\n existingOnWorkspaceOnly,\n build,\n keepReadme,\n noSquash,\n pattern,\n includeDeps,\n skipDependencyInstallation,\n resolveUnrelated,\n ignoreConfigChanges,\n remote,\n } = options;\n\n const currentLaneId = consumer.getCurrentLaneId();\n if (tag && !currentLaneId.isDefault()) {\n throw new BitError(`--tag only possible when on main. currently checked out to ${currentLaneId.toString()}`);\n }\n const otherLaneId = await consumer.getParsedLaneId(laneName);\n if (otherLaneId.isEqual(currentLaneId)) {\n throw new BitError(\n `unable to merge lane \"${otherLaneId.toString()}\", you're already at this lane. to get updates, simply run \"bit checkout head\"`\n );\n }\n const currentLane = currentLaneId.isDefault() ? null : await consumer.scope.loadLane(currentLaneId);\n const isDefaultLane = otherLaneId.isDefault();\n const getOtherLane = async () => {\n if (isDefaultLane) {\n return undefined;\n }\n const lane = await consumer.scope.loadLane(otherLaneId);\n if (remote || !lane) {\n return this.lanes.fetchLaneWithItsComponents(otherLaneId);\n }\n return lane;\n };\n const otherLane = await getOtherLane();\n const getBitIds = async () => {\n if (isDefaultLane) {\n if (!currentLane) throw new Error(`unable to merge ${DEFAULT_LANE}, the current lane was not found`);\n return consumer.scope.getDefaultLaneIdsFromLane(currentLane);\n }\n if (!otherLane) throw new Error(`lane must be defined for non-default`);\n return otherLane.toBitIds();\n };\n const bitIds = await getBitIds();\n this.logger.debug(`merging the following bitIds: ${bitIds.toString()}`);\n\n let allComponentsStatus = await this.merging.getMergeStatus(bitIds, currentLane, otherLane, {\n resolveUnrelated,\n ignoreConfigChanges,\n });\n const shouldSquash = currentLaneId.isDefault() && !noSquash;\n\n if (pattern) {\n const componentIds = await this.workspace.resolveMultipleComponentIds(bitIds);\n const compIdsFromPattern = this.workspace.scope.filterIdsFromPoolIdsByPattern(pattern, componentIds);\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n bitIds,\n this.workspace,\n includeDeps,\n otherLane || undefined,\n shouldSquash\n );\n bitIds.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unmergedLegitimately: true, unmergedMessage: `excluded by pattern` });\n }\n });\n }\n if (existingOnWorkspaceOnly) {\n const workspaceIds = await this.workspace.listIds();\n const compIdsFromPattern = workspaceIds.filter((id) =>\n allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id._legacy))\n );\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n bitIds,\n this.workspace,\n includeDeps,\n otherLane || undefined,\n shouldSquash\n );\n bitIds.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unmergedLegitimately: true, unmergedMessage: `not in the workspace` });\n }\n });\n }\n\n throwForFailures();\n\n if (shouldSquash) {\n await squashSnaps(allComponentsStatus, otherLaneId, consumer);\n }\n\n const mergeResults = await this.merging.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n laneId: otherLaneId,\n localLane: currentLane,\n noSnap,\n tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n });\n\n const mergedSuccessfully =\n !mergeResults.failedComponents ||\n mergeResults.failedComponents.length === 0 ||\n mergeResults.failedComponents.every((failedComponent) => failedComponent.unchangedLegitimately);\n\n let deleteResults = {};\n\n if (!keepReadme && otherLane && otherLane.readmeComponent && mergedSuccessfully) {\n const readmeComponentId = otherLane.readmeComponent.id\n .changeVersion(otherLane.readmeComponent?.head?.hash)\n .toString();\n\n deleteResults = await this.remove.remove({\n componentsPattern: readmeComponentId,\n force: false,\n remote: false,\n track: false,\n deleteFiles: true,\n fromLane: false,\n });\n } else if (otherLane && !otherLane.readmeComponent) {\n deleteResults = { readmeResult: `\\nlane ${otherLane.name} doesn't have a readme component` };\n }\n const configMergeResults = allComponentsStatus.map((c) => c.configMergeResult);\n\n await this.workspace.consumer.onDestroy();\n\n return { mergeResults, deleteResults, configMergeResults: compact(configMergeResults) };\n\n function throwForFailures() {\n const failedComponents = allComponentsStatus.filter((c) => c.unmergedMessage && !c.unmergedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unmergedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to merge due to the following failures:\\n${failureMsgs}`);\n }\n }\n }\n\n async mergeFromScope(\n laneName: string,\n options: Partial<MergeLaneOptions> & { push?: boolean }\n ): Promise<{\n mergedPreviously: string[];\n mergedNow: string[];\n exportedIds: string[];\n }> {\n if (this.workspace)\n throw new BitError(\n `unable to run this command from a workspace, please create a new bare-scope and run it from there`\n );\n const laneId = LaneId.parse(laneName);\n const lane = await this.lanes.importLaneObject(laneId);\n const laneIds = lane.toBitIds();\n const getIdsToMerge = async (): Promise<BitIds> => {\n if (!options.pattern) return laneIds;\n const laneCompIds = await this.scope.resolveMultipleComponentIds(laneIds);\n const ids = this.scope.filterIdsFromPoolIdsByPattern(options.pattern, laneCompIds);\n return BitIds.fromArray(ids.map((id) => id._legacy));\n };\n const idsToMerge = await getIdsToMerge();\n const scopeComponentsImporter = ScopeComponentsImporter.getInstance(this.scope.legacyScope);\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids: idsToMerge,\n fromHead: true,\n lane,\n ignoreMissingHead: true,\n });\n // get their main as well\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids: idsToMerge.toVersionLatest(),\n fromHead: true,\n ignoreMissingHead: true,\n });\n const repo = this.scope.legacyScope.objects;\n // loop through all components, make sure they're all ahead of main (it might not be on main yet).\n // then, change the version object to include an extra parent to point to the main.\n // then, change the component object head to point to this changed version\n const mergedPreviously: BitId[] = [];\n const mergedNow: BitId[] = [];\n const bitObjectsPerComp = await pMapSeries(idsToMerge, async (id) => {\n const modelComponent = await this.scope.legacyScope.getModelComponent(id);\n const versionObj = await modelComponent.loadVersion(id.version as string, repo);\n const laneHead = modelComponent.getRef(id.version as string);\n if (!laneHead) throw new Error(`lane head must be defined for ${id.toString()}`);\n const mainHead = modelComponent.head || null;\n if (mainHead?.isEqual(laneHead)) {\n mergedPreviously.push(id);\n return undefined;\n }\n const divergeData = await getDivergeData({\n repo,\n modelComponent,\n sourceHead: mainHead,\n targetHead: laneHead,\n });\n const modifiedVersion = squashOneComp(DEFAULT_LANE, laneId, id, divergeData, versionObj);\n modelComponent.setHead(laneHead);\n const objects = [modelComponent, modifiedVersion];\n mergedNow.push(id);\n return { id, objects };\n });\n const bitObjects = compact(bitObjectsPerComp).map((b) => b.objects);\n await repo.writeObjectsToTheFS(bitObjects.flat() as BitObject[]);\n let exportedIds: string[] = [];\n if (options.push) {\n const ids = compact(bitObjectsPerComp).map((b) => b.id);\n const bitIds = BitIds.fromArray(ids);\n const { exported } = await this.exporter.exportMany({\n scope: this.scope.legacyScope,\n ids: bitIds,\n idsWithFutureScope: bitIds,\n allVersions: false,\n // no need to export anything else other than the head. the normal calculation of what to export won't apply here\n // as it is done from the scope.\n exportHeadsOnly: true,\n });\n exportedIds = exported.map((id) => id.toString());\n }\n\n return {\n mergedPreviously: mergedPreviously.map((id) => id.toString()),\n mergedNow: mergedNow.map((id) => id.toString()),\n exportedIds,\n };\n }\n\n static slots = [];\n static dependencies = [\n LanesAspect,\n CLIAspect,\n WorkspaceAspect,\n MergingAspect,\n LoggerAspect,\n RemoveAspect,\n ScopeAspect,\n ExportAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([lanes, cli, workspace, merging, loggerMain, remove, scope, exporter]: [\n LanesMain,\n CLIMain,\n Workspace,\n MergingMain,\n LoggerMain,\n RemoveMain,\n ScopeMain,\n ExportMain\n ]) {\n const logger = loggerMain.createLogger(MergeLanesAspect.id);\n const lanesCommand = cli.getCommand('lane');\n const mergeLanesMain = new MergeLanesMain(workspace, merging, lanes, logger, remove, scope, exporter);\n lanesCommand?.commands?.push(new MergeLaneCmd(mergeLanesMain));\n cli.register(new MergeLaneFromScopeCmd(mergeLanesMain));\n return mergeLanesMain;\n }\n}\n\nasync function filterComponentsStatus(\n allComponentsStatus: ComponentMergeStatus[],\n compIdsToKeep: ComponentID[],\n allBitIds: BitId[],\n workspace: Workspace,\n includeDeps = false,\n otherLane?: Lane, // lane that gets merged into the current lane. if not provided, it's main that gets merged into the current lane\n shouldSquash?: boolean\n): Promise<ComponentMergeStatus[]> {\n const bitIdsFromPattern = BitIds.fromArray(compIdsToKeep.map((c) => c._legacy));\n const bitIdsNotFromPattern = allBitIds.filter((bitId) => !bitIdsFromPattern.hasWithoutVersion(bitId));\n const filteredComponentStatus: ComponentMergeStatus[] = [];\n const depsToAdd: BitId[] = [];\n await pMapSeries(compIdsToKeep, async (compId) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(compId._legacy));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n if (fromStatus.unmergedMessage) {\n return;\n }\n if (!otherLane) {\n // if merging main, no need to check whether the deps are included in the pattern.\n return;\n }\n const { divergeData } = fromStatus;\n if (!divergeData) {\n throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);\n }\n let targetVersions = divergeData.snapsOnTargetOnly;\n if (!targetVersions.length) {\n return;\n }\n const modelComponent = await workspace.consumer.scope.getModelComponent(compId._legacy);\n if (shouldSquash) {\n // no need to check all versions, we merge only the head\n const headOnTarget = otherLane ? otherLane.getComponent(compId._legacy)?.head : modelComponent.head;\n if (!headOnTarget) {\n throw new Error(`filterComponentsStatus: unable to find head for ${compId.toString()}`);\n }\n targetVersions = [headOnTarget];\n }\n\n await pMapSeries(targetVersions, async (remoteVersion) => {\n const versionObj = await modelComponent.loadVersion(remoteVersion.toString(), workspace.consumer.scope.objects);\n const flattenedDeps = versionObj.getAllFlattenedDependencies();\n const depsNotIncludeInPattern = flattenedDeps.filter((id) =>\n bitIdsNotFromPattern.find((bitId) => bitId.isEqualWithoutVersion(id))\n );\n if (!depsNotIncludeInPattern.length) {\n return;\n }\n const depsOnLane: BitId[] = [];\n await Promise.all(\n depsNotIncludeInPattern.map(async (dep) => {\n const isOnLane = await workspace.consumer.scope.isIdOnLane(dep, otherLane);\n if (isOnLane) {\n depsOnLane.push(dep);\n }\n })\n );\n if (!depsOnLane.length) {\n return;\n }\n if (!includeDeps) {\n throw new BitError(`unable to merge ${compId.toString()}.\nit has (in version ${remoteVersion.toString()}) the following dependencies which were not included in the pattern. consider adding \"--include-deps\" flag\n${depsOnLane.map((d) => d.toString()).join('\\n')}`);\n }\n depsToAdd.push(...depsOnLane);\n });\n });\n if (depsToAdd.length) {\n const depsUniq = BitIds.uniqFromArray(depsToAdd);\n depsUniq.forEach((id) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n });\n }\n return filteredComponentStatus;\n}\n\nasync function squashSnaps(allComponentsStatus: ComponentMergeStatus[], otherLaneId: LaneId, consumer: Consumer) {\n const currentLaneName = consumer.getCurrentLaneId().name;\n const succeededComponents = allComponentsStatus.filter((c) => !c.unmergedMessage);\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 const modifiedComp = squashOneComp(currentLaneName, otherLaneId, id, divergeData, componentFromModel);\n if (modifiedComp) {\n consumer.scope.objects.add(modifiedComp);\n const modelComponent = await consumer.scope.getModelComponent(id);\n const versionHistory = await modelComponent.updateRebasedVersionHistory(consumer.scope.objects, [modifiedComp]);\n if (versionHistory) consumer.scope.objects.add(versionHistory);\n }\n })\n );\n}\n\n/**\n * returns Version object if it was modified. otherwise, returns undefined\n */\nfunction squashOneComp(\n currentLaneName: string,\n otherLaneId: LaneId,\n id: BitId,\n divergeData: SnapsDistance,\n componentFromModel?: Version\n): Version | undefined {\n if (divergeData.isDiverged()) {\n throw new BitError(`unable to squash because ${id.toString()} is diverged in history.\nconsider switching to \"${\n otherLaneId.name\n }\" first, merging \"${currentLaneName}\", then switching back to \"${currentLaneName}\" and merging \"${\n otherLaneId.name\n }\"\nalternatively, use \"--no-squash\" flag to keep the entire history of \"${otherLaneId.name}\"`);\n }\n if (divergeData.isSourceAhead()) {\n // nothing to do. current is ahead, nothing to merge. (it was probably filtered out already as a \"failedComponent\")\n return undefined;\n }\n if (!divergeData.isTargetAhead()) {\n // nothing to do. current and remote are the same, nothing to merge. (it was probably filtered out already as a \"failedComponent\")\n return undefined;\n }\n // remote is ahead and was not diverge.\n const remoteSnaps = divergeData.snapsOnTargetOnly;\n if (remoteSnaps.length === 0) {\n throw new Error(`remote is ahead but it has no snaps. it's impossible`);\n }\n // no need to check this case. even if it has only one snap ahead, we want to do the \"squash\", and run \"addAsOnlyParent\"\n // to make sure it doesn't not have two parents.\n // if (remoteSnaps.length === 1) {\n // // nothing to squash. it has only one commit.\n // return;\n // }\n if (!componentFromModel) {\n throw new Error('unable to squash, the componentFromModel is missing');\n }\n\n const currentParents = componentFromModel.parents;\n\n // do the squash.\n if (divergeData.commonSnapBeforeDiverge) {\n componentFromModel.addAsOnlyParent(divergeData.commonSnapBeforeDiverge);\n } else {\n // there is no commonSnapBeforeDiverge. the local has no snaps, all are remote, no need for parents. keep only head.\n componentFromModel.parents.forEach((ref) => componentFromModel.removeParent(ref));\n }\n componentFromModel.setSquashed({ previousParents: currentParents, laneId: otherLaneId });\n return componentFromModel;\n}\n\nMergeLanesAspect.addRuntime(MergeLanesMain);\n\nexport default MergeLanesMain;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA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WAAW,CAAC+D,IACb;AACL,uEAAuE/D,WAAW,CAAC+D,IAAK,GAAE,CAAC;EACzF;EACA,IAAI4C,WAAW,CAACwE,aAAa,EAAE,EAAE;IAC/B;IACA,OAAO5K,SAAS;EAClB;EACA,IAAI,CAACoG,WAAW,CAACyE,aAAa,EAAE,EAAE;IAChC;IACA,OAAO7K,SAAS;EAClB;EACA;EACA,MAAM8K,WAAW,GAAG1E,WAAW,CAACgD,iBAAiB;EACjD,IAAI0B,WAAW,CAACtI,MAAM,KAAK,CAAC,EAAE;IAC5B,MAAM,IAAInC,KAAK,CAAE,sDAAqD,CAAC;EACzE;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAI,CAACiK,kBAAkB,EAAE;IACvB,MAAM,IAAIjK,KAAK,CAAC,qDAAqD,CAAC;EACxE;EAEA,MAAM0K,cAAc,GAAGT,kBAAkB,CAACU,OAAO;;EAEjD;EACA,IAAI5E,WAAW,CAAC6E,uBAAuB,EAAE;IACvCX,kBAAkB,CAACY,eAAe,CAAC9E,WAAW,CAAC6E,uBAAuB,CAAC;EACzE,CAAC,MAAM;IACL;IACAX,kBAAkB,CAACU,OAAO,CAAC7J,OAAO,CAAEgK,GAAG,IAAKb,kBAAkB,CAACc,YAAY,CAACD,GAAG,CAAC,CAAC;EACnF;EACAb,kBAAkB,CAACe,WAAW,CAAC;IAAEC,eAAe,EAAEP,cAAc;IAAE3I,MAAM,EAAE3C;EAAY,CAAC,CAAC;EACxF,OAAO6K,kBAAkB;AAC3B;AAEA7C,8BAAgB,CAAC8D,UAAU,CAAC9N,cAAc,CAAC;AAAC,eAE7BA,cAAc;AAAA"}
1
+ {"version":3,"names":["MergeLanesMain","constructor","workspace","merging","lanes","logger","remove","scope","exporter","mergeLane","laneName","options","BitError","consumer","mergeStrategy","noSnap","tag","snapMessage","existingOnWorkspaceOnly","build","keepReadme","noSquash","pattern","includeDeps","skipDependencyInstallation","resolveUnrelated","ignoreConfigChanges","remote","currentLaneId","getCurrentLaneId","isDefault","toString","otherLaneId","getParsedLaneId","isEqual","currentLane","loadLane","isDefaultLane","getOtherLane","undefined","lane","fetchLaneWithItsComponents","otherLane","getBitIds","Error","DEFAULT_LANE","getMainIdsToMerge","toBitIds","bitIds","debug","allComponentsStatus","getMergeStatus","shouldSquash","componentIds","resolveMultipleComponentIds","compIdsFromPattern","filterIdsFromPoolIdsByPattern","filterComponentsStatus","forEach","bitId","find","c","id","isEqualWithoutVersion","push","unmergedLegitimately","unmergedMessage","workspaceIds","listIds","filter","_legacy","throwForFailures","squashSnaps","mergeResults","mergeSnaps","laneId","localLane","mergedSuccessfully","failedComponents","length","every","failedComponent","unchangedLegitimately","deleteResults","readmeComponent","readmeComponentId","changeVersion","head","hash","componentsPattern","force","track","deleteFiles","fromLane","readmeResult","name","configMergeResults","map","configMergeResult","onDestroy","compact","failureMsgs","chalk","bold","red","join","laneIds","mainNotOnLane","ids","hasScope","modelComponents","Promise","all","legacyScope","getModelComponent","toBitId","mergeFromScope","toLane","fromLaneId","LaneId","parse","fromLaneObj","importLaneObject","toLaneId","getDefaultLaneId","toLaneObj","fromLaneBitIds","getIdsToMerge","laneCompIds","BitIds","fromArray","idsToMerge","scopeComponentsImporter","ScopeComponentsImporter","getInstance","importManyDeltaWithoutDeps","fromHead","ignoreMissingHead","toVersionLatest","throwIfNotUpToDate","repo","objects","mergedPreviously","mergedNow","bitObjectsPerComp","pMapSeries","modelComponent","fromVersionObj","loadVersion","version","fromLaneHead","getRef","toLaneHead","getComponent","divergeData","getDivergeData","sourceHead","targetHead","modifiedVersion","squashOneComp","addComponent","setHead","bitObjects","b","bitObjectsFlat","flat","writeObjectsToTheFS","exportedIds","exported","exportMany","idsWithFutureScope","laneObject","allVersions","exportHeadsOnly","status","diffStatus","skipChanges","compsNotUpToDate","componentsStatus","s","upToDate","componentId","provider","cli","loggerMain","createLogger","MergeLanesAspect","lanesCommand","getCommand","mergeLanesMain","commands","MergeLaneCmd","register","MergeLaneFromScopeCmd","LanesAspect","CLIAspect","WorkspaceAspect","MergingAspect","LoggerAspect","RemoveAspect","ScopeAspect","ExportAspect","MainRuntime","compIdsToKeep","allBitIds","bitIdsFromPattern","bitIdsNotFromPattern","hasWithoutVersion","filteredComponentStatus","depsToAdd","compId","fromStatus","targetVersions","snapsOnTargetOnly","headOnTarget","remoteVersion","versionObj","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","d","depsUniq","uniqFromArray","currentLaneName","succeededComponents","componentFromModel","modifiedComp","add","versionHistory","updateRebasedVersionHistory","isDiverged","isSourceAhead","isTargetAhead","remoteSnaps","currentParents","parents","commonSnapBeforeDiverge","addAsOnlyParent","ref","removeParent","setSquashed","previousParents","addRuntime"],"sources":["merge-lanes.main.runtime.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { LanesAspect, LanesMain } from '@teambit/lanes';\nimport MergingAspect, { MergingMain, ComponentMergeStatus, ConfigMergeResult } from '@teambit/merging';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport chalk from 'chalk';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport pMapSeries from 'p-map-series';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { MergeStrategy, ApplyVersionResults } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { ScopeAspect, ScopeMain } from '@teambit/scope';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport { ComponentID } from '@teambit/component-id';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { Lane, Version } from '@teambit/legacy/dist/scope/models';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { compact } from 'lodash';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { BitObject } from '@teambit/legacy/dist/scope/objects';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { MergeLanesAspect } from './merge-lanes.aspect';\nimport { MergeLaneCmd } from './merge-lane.cmd';\nimport { MergeLaneFromScopeCmd } from './merge-lane-from-scope.cmd';\n\nexport type MergeLaneOptions = {\n mergeStrategy: MergeStrategy;\n noSnap: boolean;\n snapMessage: string;\n existingOnWorkspaceOnly: boolean;\n build: boolean;\n keepReadme: boolean;\n noSquash: boolean;\n tag?: boolean;\n pattern?: string;\n includeDeps?: boolean;\n skipDependencyInstallation?: boolean;\n resolveUnrelated?: MergeStrategy;\n ignoreConfigChanges?: boolean;\n remote?: boolean;\n};\n\nexport class MergeLanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private merging: MergingMain,\n private lanes: LanesMain,\n private logger: Logger,\n private remove: RemoveMain,\n private scope: ScopeMain,\n private exporter: ExportMain\n ) {}\n\n async mergeLane(\n laneName: string,\n options: MergeLaneOptions\n ): Promise<{ mergeResults: ApplyVersionResults; deleteResults: any; configMergeResults: ConfigMergeResult[] }> {\n if (!this.workspace) {\n throw new BitError(`unable to merge a lane outside of Bit workspace`);\n }\n const consumer = this.workspace.consumer;\n\n const {\n mergeStrategy,\n noSnap,\n tag,\n snapMessage,\n existingOnWorkspaceOnly,\n build,\n keepReadme,\n noSquash,\n pattern,\n includeDeps,\n skipDependencyInstallation,\n resolveUnrelated,\n ignoreConfigChanges,\n remote,\n } = options;\n\n const currentLaneId = consumer.getCurrentLaneId();\n if (tag && !currentLaneId.isDefault()) {\n throw new BitError(`--tag only possible when on main. currently checked out to ${currentLaneId.toString()}`);\n }\n const otherLaneId = await consumer.getParsedLaneId(laneName);\n if (otherLaneId.isEqual(currentLaneId)) {\n throw new BitError(\n `unable to merge lane \"${otherLaneId.toString()}\", you're already at this lane. to get updates, simply run \"bit checkout head\"`\n );\n }\n const currentLane = currentLaneId.isDefault() ? null : await consumer.scope.loadLane(currentLaneId);\n const isDefaultLane = otherLaneId.isDefault();\n const getOtherLane = async () => {\n if (isDefaultLane) {\n return undefined;\n }\n const lane = await consumer.scope.loadLane(otherLaneId);\n if (remote || !lane) {\n return this.lanes.fetchLaneWithItsComponents(otherLaneId);\n }\n return lane;\n };\n const otherLane = await getOtherLane();\n const getBitIds = async () => {\n if (isDefaultLane) {\n if (!currentLane) throw new Error(`unable to merge ${DEFAULT_LANE}, the current lane was not found`);\n return this.getMainIdsToMerge(currentLane);\n }\n if (!otherLane) throw new Error(`lane must be defined for non-default`);\n return otherLane.toBitIds();\n };\n const bitIds = await getBitIds();\n this.logger.debug(`merging the following bitIds: ${bitIds.toString()}`);\n\n let allComponentsStatus = await this.merging.getMergeStatus(bitIds, currentLane, otherLane, {\n resolveUnrelated,\n ignoreConfigChanges,\n });\n const shouldSquash = currentLaneId.isDefault() && !noSquash;\n\n if (pattern) {\n const componentIds = await this.workspace.resolveMultipleComponentIds(bitIds);\n const compIdsFromPattern = this.workspace.scope.filterIdsFromPoolIdsByPattern(pattern, componentIds);\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n bitIds,\n this.workspace,\n includeDeps,\n otherLane || undefined,\n shouldSquash\n );\n bitIds.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unmergedLegitimately: true, unmergedMessage: `excluded by pattern` });\n }\n });\n }\n if (existingOnWorkspaceOnly) {\n const workspaceIds = await this.workspace.listIds();\n const compIdsFromPattern = workspaceIds.filter((id) =>\n allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id._legacy))\n );\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n bitIds,\n this.workspace,\n includeDeps,\n otherLane || undefined,\n shouldSquash\n );\n bitIds.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unmergedLegitimately: true, unmergedMessage: `not in the workspace` });\n }\n });\n }\n\n throwForFailures();\n\n if (shouldSquash) {\n await squashSnaps(allComponentsStatus, otherLaneId, consumer);\n }\n\n const mergeResults = await this.merging.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n laneId: otherLaneId,\n localLane: currentLane,\n noSnap,\n tag,\n snapMessage,\n build,\n skipDependencyInstallation,\n });\n\n const mergedSuccessfully =\n !mergeResults.failedComponents ||\n mergeResults.failedComponents.length === 0 ||\n mergeResults.failedComponents.every((failedComponent) => failedComponent.unchangedLegitimately);\n\n let deleteResults = {};\n\n if (!keepReadme && otherLane && otherLane.readmeComponent && mergedSuccessfully) {\n const readmeComponentId = otherLane.readmeComponent.id\n .changeVersion(otherLane.readmeComponent?.head?.hash)\n .toString();\n\n deleteResults = await this.remove.remove({\n componentsPattern: readmeComponentId,\n force: false,\n remote: false,\n track: false,\n deleteFiles: true,\n fromLane: false,\n });\n } else if (otherLane && !otherLane.readmeComponent) {\n deleteResults = { readmeResult: `\\nlane ${otherLane.name} doesn't have a readme component` };\n }\n const configMergeResults = allComponentsStatus.map((c) => c.configMergeResult);\n\n await this.workspace.consumer.onDestroy();\n\n return { mergeResults, deleteResults, configMergeResults: compact(configMergeResults) };\n\n function throwForFailures() {\n const failedComponents = allComponentsStatus.filter((c) => c.unmergedMessage && !c.unmergedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.unmergedMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to merge due to the following failures:\\n${failureMsgs}`);\n }\n }\n }\n\n private async getMainIdsToMerge(lane: Lane) {\n const laneIds = lane.toBitIds();\n if (!this.workspace) {\n throw new BitError(`getMainIdsToMerge needs workspace`);\n }\n const workspaceIds = (await this.workspace.listIds()).map((id) => id._legacy);\n const mainNotOnLane = workspaceIds.filter((id) => !laneIds.find((laneId) => laneId.isEqualWithoutVersion(id)));\n const ids = [...laneIds, ...mainNotOnLane].filter((id) => id.hasScope());\n const modelComponents = await Promise.all(ids.map((id) => this.scope.legacyScope.getModelComponent(id)));\n return compact(\n modelComponents.map((c) => {\n if (!c.head) return null; // probably the component was never merged to main\n return c.toBitId().changeVersion(c.head.toString());\n })\n );\n }\n\n async mergeFromScope(\n fromLane: string,\n toLane: string,\n options: Partial<MergeLaneOptions> & { push?: boolean }\n ): Promise<{\n mergedPreviously: string[];\n mergedNow: string[];\n exportedIds: string[];\n }> {\n if (this.workspace) {\n throw new BitError(\n `unable to run this command from a workspace, please create a new bare-scope and run it from there`\n );\n }\n const fromLaneId = LaneId.parse(fromLane);\n const fromLaneObj = await this.lanes.importLaneObject(fromLaneId);\n const toLaneId = toLane === DEFAULT_LANE ? this.lanes.getDefaultLaneId() : LaneId.parse(toLane);\n const toLaneObj = toLaneId.isDefault() ? undefined : await this.lanes.importLaneObject(toLaneId);\n const fromLaneBitIds = fromLaneObj.toBitIds();\n const getIdsToMerge = async (): Promise<BitIds> => {\n if (!options.pattern) return fromLaneBitIds;\n const laneCompIds = await this.scope.resolveMultipleComponentIds(fromLaneBitIds);\n const ids = this.scope.filterIdsFromPoolIdsByPattern(options.pattern, laneCompIds);\n return BitIds.fromArray(ids.map((id) => id._legacy));\n };\n const idsToMerge = await getIdsToMerge();\n const scopeComponentsImporter = ScopeComponentsImporter.getInstance(this.scope.legacyScope);\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids: idsToMerge,\n fromHead: true,\n lane: fromLaneObj,\n ignoreMissingHead: true,\n });\n // get their main/to-lane as well\n await scopeComponentsImporter.importManyDeltaWithoutDeps({\n ids: idsToMerge.toVersionLatest(),\n fromHead: true,\n ignoreMissingHead: true,\n lane: toLaneObj,\n });\n await this.throwIfNotUpToDate(fromLaneId, toLaneId);\n const repo = this.scope.legacyScope.objects;\n // loop through all components, make sure they're all ahead of main (it might not be on main yet).\n // then, change the version object to include an extra parent to point to the main.\n // then, change the component object head to point to this changed version\n const mergedPreviously: BitId[] = [];\n const mergedNow: BitId[] = [];\n const shouldSquash = !toLaneObj && !options.noSquash; // only when merging to main we squash.\n const bitObjectsPerComp = await pMapSeries(idsToMerge, async (id) => {\n const modelComponent = await this.scope.legacyScope.getModelComponent(id);\n const fromVersionObj = await modelComponent.loadVersion(id.version as string, repo);\n const fromLaneHead = modelComponent.getRef(id.version as string);\n if (!fromLaneHead) throw new Error(`lane head must be defined for ${id.toString()}`);\n const toLaneHead = toLaneObj ? toLaneObj.getComponent(id)?.head : modelComponent.head || null;\n if (toLaneHead?.isEqual(fromLaneHead)) {\n mergedPreviously.push(id);\n return undefined;\n }\n // this might be confusing, we pass the toLaneHead as the sourceHead and the fromLaneHead as the targetHead.\n // this is because normally, in the workspace, we merge another lane (target) into the current lane (source).\n // so effectively, in the workspace, we merge fromLane=target into toLane=source.\n const divergeData = await getDivergeData({\n repo,\n modelComponent,\n sourceHead: toLaneHead,\n targetHead: fromLaneHead,\n });\n const modifiedVersion = shouldSquash\n ? squashOneComp(DEFAULT_LANE, fromLaneId, id, divergeData, fromVersionObj)\n : undefined;\n const objects: BitObject[] = [];\n if (modifiedVersion) objects.push(modifiedVersion);\n if (toLaneObj) {\n toLaneObj.addComponent({ id: id.changeVersion(undefined), head: fromLaneHead });\n } else {\n modelComponent.setHead(fromLaneHead);\n objects.push(modelComponent);\n }\n mergedNow.push(id);\n return { id, objects };\n });\n const bitObjects = compact(bitObjectsPerComp).map((b) => b.objects);\n const bitObjectsFlat = bitObjects.flat();\n if (toLaneObj) bitObjectsFlat.push(toLaneObj);\n await repo.writeObjectsToTheFS(bitObjectsFlat);\n let exportedIds: string[] = [];\n if (options.push) {\n const ids = compact(bitObjectsPerComp).map((b) => b.id);\n const bitIds = BitIds.fromArray(ids);\n const { exported } = await this.exporter.exportMany({\n scope: this.scope.legacyScope,\n ids: shouldSquash ? bitIds : new BitIds(),\n idsWithFutureScope: shouldSquash ? bitIds : new BitIds(),\n laneObject: toLaneObj,\n allVersions: false,\n // no need to export anything else other than the head. the normal calculation of what to export won't apply here\n // as it is done from the scope.\n exportHeadsOnly: shouldSquash,\n });\n exportedIds = exported.map((id) => id.toString());\n }\n\n return {\n mergedPreviously: mergedPreviously.map((id) => id.toString()),\n mergedNow: mergedNow.map((id) => id.toString()),\n exportedIds,\n };\n }\n private async throwIfNotUpToDate(fromLaneId: LaneId, toLaneId: LaneId) {\n const status = await this.lanes.diffStatus(fromLaneId, toLaneId, { skipChanges: true });\n const compsNotUpToDate = status.componentsStatus.filter((s) => !s.upToDate);\n if (compsNotUpToDate.length) {\n throw new Error(`unable to merge, the following components are not up-to-date:\n${compsNotUpToDate.map((s) => s.componentId.toString()).join('\\n')}`);\n }\n }\n\n static slots = [];\n static dependencies = [\n LanesAspect,\n CLIAspect,\n WorkspaceAspect,\n MergingAspect,\n LoggerAspect,\n RemoveAspect,\n ScopeAspect,\n ExportAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider([lanes, cli, workspace, merging, loggerMain, remove, scope, exporter]: [\n LanesMain,\n CLIMain,\n Workspace,\n MergingMain,\n LoggerMain,\n RemoveMain,\n ScopeMain,\n ExportMain\n ]) {\n const logger = loggerMain.createLogger(MergeLanesAspect.id);\n const lanesCommand = cli.getCommand('lane');\n const mergeLanesMain = new MergeLanesMain(workspace, merging, lanes, logger, remove, scope, exporter);\n lanesCommand?.commands?.push(new MergeLaneCmd(mergeLanesMain));\n cli.register(new MergeLaneFromScopeCmd(mergeLanesMain));\n return mergeLanesMain;\n }\n}\n\nasync function filterComponentsStatus(\n allComponentsStatus: ComponentMergeStatus[],\n compIdsToKeep: ComponentID[],\n allBitIds: BitId[],\n workspace: Workspace,\n includeDeps = false,\n otherLane?: Lane, // lane that gets merged into the current lane. if not provided, it's main that gets merged into the current lane\n shouldSquash?: boolean\n): Promise<ComponentMergeStatus[]> {\n const bitIdsFromPattern = BitIds.fromArray(compIdsToKeep.map((c) => c._legacy));\n const bitIdsNotFromPattern = allBitIds.filter((bitId) => !bitIdsFromPattern.hasWithoutVersion(bitId));\n const filteredComponentStatus: ComponentMergeStatus[] = [];\n const depsToAdd: BitId[] = [];\n await pMapSeries(compIdsToKeep, async (compId) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(compId._legacy));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n if (fromStatus.unmergedMessage) {\n return;\n }\n if (!otherLane) {\n // if merging main, no need to check whether the deps are included in the pattern.\n return;\n }\n const { divergeData } = fromStatus;\n if (!divergeData) {\n throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);\n }\n let targetVersions = divergeData.snapsOnTargetOnly;\n if (!targetVersions.length) {\n return;\n }\n const modelComponent = await workspace.consumer.scope.getModelComponent(compId._legacy);\n if (shouldSquash) {\n // no need to check all versions, we merge only the head\n const headOnTarget = otherLane ? otherLane.getComponent(compId._legacy)?.head : modelComponent.head;\n if (!headOnTarget) {\n throw new Error(`filterComponentsStatus: unable to find head for ${compId.toString()}`);\n }\n targetVersions = [headOnTarget];\n }\n\n await pMapSeries(targetVersions, async (remoteVersion) => {\n const versionObj = await modelComponent.loadVersion(remoteVersion.toString(), workspace.consumer.scope.objects);\n const flattenedDeps = versionObj.getAllFlattenedDependencies();\n const depsNotIncludeInPattern = flattenedDeps.filter((id) =>\n bitIdsNotFromPattern.find((bitId) => bitId.isEqualWithoutVersion(id))\n );\n if (!depsNotIncludeInPattern.length) {\n return;\n }\n const depsOnLane: BitId[] = [];\n await Promise.all(\n depsNotIncludeInPattern.map(async (dep) => {\n const isOnLane = await workspace.consumer.scope.isIdOnLane(dep, otherLane);\n if (isOnLane) {\n depsOnLane.push(dep);\n }\n })\n );\n if (!depsOnLane.length) {\n return;\n }\n if (!includeDeps) {\n throw new BitError(`unable to merge ${compId.toString()}.\nit has (in version ${remoteVersion.toString()}) the following dependencies which were not included in the pattern. consider adding \"--include-deps\" flag\n${depsOnLane.map((d) => d.toString()).join('\\n')}`);\n }\n depsToAdd.push(...depsOnLane);\n });\n });\n if (depsToAdd.length) {\n const depsUniq = BitIds.uniqFromArray(depsToAdd);\n depsUniq.forEach((id) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n });\n }\n return filteredComponentStatus;\n}\n\nasync function squashSnaps(allComponentsStatus: ComponentMergeStatus[], otherLaneId: LaneId, consumer: Consumer) {\n const currentLaneName = consumer.getCurrentLaneId().name;\n const succeededComponents = allComponentsStatus.filter((c) => !c.unmergedMessage);\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 const modifiedComp = squashOneComp(currentLaneName, otherLaneId, id, divergeData, componentFromModel);\n if (modifiedComp) {\n consumer.scope.objects.add(modifiedComp);\n const modelComponent = await consumer.scope.getModelComponent(id);\n const versionHistory = await modelComponent.updateRebasedVersionHistory(consumer.scope.objects, [modifiedComp]);\n if (versionHistory) consumer.scope.objects.add(versionHistory);\n }\n })\n );\n}\n\n/**\n * returns Version object if it was modified. otherwise, returns undefined\n */\nfunction squashOneComp(\n currentLaneName: string,\n otherLaneId: LaneId,\n id: BitId,\n divergeData: SnapsDistance,\n componentFromModel?: Version\n): Version | undefined {\n if (divergeData.isDiverged()) {\n throw new BitError(`unable to squash because ${id.toString()} is diverged in history.\nconsider switching to \"${\n otherLaneId.name\n }\" first, merging \"${currentLaneName}\", then switching back to \"${currentLaneName}\" and merging \"${\n otherLaneId.name\n }\"\nalternatively, use \"--no-squash\" flag to keep the entire history of \"${otherLaneId.name}\"`);\n }\n if (divergeData.isSourceAhead()) {\n // nothing to do. current is ahead, nothing to merge. (it was probably filtered out already as a \"failedComponent\")\n return undefined;\n }\n if (!divergeData.isTargetAhead()) {\n // nothing to do. current and remote are the same, nothing to merge. (it was probably filtered out already as a \"failedComponent\")\n return undefined;\n }\n // remote is ahead and was not diverge.\n const remoteSnaps = divergeData.snapsOnTargetOnly;\n if (remoteSnaps.length === 0) {\n throw new Error(`remote is ahead but it has no snaps. it's impossible`);\n }\n // no need to check this case. even if it has only one snap ahead, we want to do the \"squash\", and run \"addAsOnlyParent\"\n // to make sure it doesn't not have two parents.\n // if (remoteSnaps.length === 1) {\n // // nothing to squash. it has only one commit.\n // return;\n // }\n if (!componentFromModel) {\n throw new Error('unable to squash, the componentFromModel is missing');\n }\n\n const currentParents = componentFromModel.parents;\n\n // do the squash.\n if (divergeData.commonSnapBeforeDiverge) {\n componentFromModel.addAsOnlyParent(divergeData.commonSnapBeforeDiverge);\n } else {\n // there is no commonSnapBeforeDiverge. the local has no snaps, all are remote, no need for parents. keep only head.\n componentFromModel.parents.forEach((ref) => componentFromModel.removeParent(ref));\n }\n componentFromModel.setSquashed({ previousParents: currentParents, laneId: otherLaneId });\n return componentFromModel;\n}\n\nMergeLanesAspect.addRuntime(MergeLanesMain);\n\nexport default MergeLanesMain;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EA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D,IAAK,GAAE,CAAC;EACzF;EACA,IAAI2D,WAAW,CAACiF,aAAa,EAAE,EAAE;IAC/B;IACA,OAAOpM,SAAS;EAClB;EACA,IAAI,CAACmH,WAAW,CAACkF,aAAa,EAAE,EAAE;IAChC;IACA,OAAOrM,SAAS;EAClB;EACA;EACA,MAAMsM,WAAW,GAAGnF,WAAW,CAAC2D,iBAAiB;EACjD,IAAIwB,WAAW,CAAC9J,MAAM,KAAK,CAAC,EAAE;IAC5B,MAAM,IAAInC,KAAK,CAAE,sDAAqD,CAAC;EACzE;EACA;EACA;EACA;EACA;EACA;EACA;EACA,IAAI,CAACyL,kBAAkB,EAAE;IACvB,MAAM,IAAIzL,KAAK,CAAC,qDAAqD,CAAC;EACxE;EAEA,MAAMkM,cAAc,GAAGT,kBAAkB,CAACU,OAAO;;EAEjD;EACA,IAAIrF,WAAW,CAACsF,uBAAuB,EAAE;IACvCX,kBAAkB,CAACY,eAAe,CAACvF,WAAW,CAACsF,uBAAuB,CAAC;EACzE,CAAC,MAAM;IACL;IACAX,kBAAkB,CAACU,OAAO,CAACrL,OAAO,CAAEwL,GAAG,IAAKb,kBAAkB,CAACc,YAAY,CAACD,GAAG,CAAC,CAAC;EACnF;EACAb,kBAAkB,CAACe,WAAW,CAAC;IAAEC,eAAe,EAAEP,cAAc;IAAEnK,MAAM,EAAE3C;EAAY,CAAC,CAAC;EACxF,OAAOqM,kBAAkB;AAC3B;AAEA3C,8BAAgB,CAAC4D,UAAU,CAACtP,cAAc,CAAC;AAAC,eAE7BA,cAAc;AAAA"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/merge-lanes",
3
- "version": "0.0.123",
3
+ "version": "0.0.125",
4
4
  "homepage": "https://bit.dev/teambit/lanes/merge-lanes",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.lanes",
8
8
  "name": "merge-lanes",
9
- "version": "0.0.123"
9
+ "version": "0.0.125"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -16,17 +16,17 @@
16
16
  "@babel/runtime": "7.20.0",
17
17
  "@teambit/harmony": "0.4.6",
18
18
  "@teambit/bit-error": "0.0.402",
19
- "@teambit/cli": "0.0.633",
20
- "@teambit/merging": "0.0.261",
19
+ "@teambit/cli": "0.0.635",
20
+ "@teambit/lane-id": "0.0.153",
21
+ "@teambit/merging": "0.0.263",
21
22
  "@teambit/component-id": "0.0.425",
22
- "@teambit/export": "0.0.946",
23
- "@teambit/lane-id": "0.0.151",
24
- "@teambit/lanes": "0.0.518",
23
+ "@teambit/export": "0.0.948",
24
+ "@teambit/lanes": "0.0.520",
25
25
  "@teambit/legacy-bit-id": "0.0.421",
26
- "@teambit/logger": "0.0.726",
27
- "@teambit/remove": "0.0.123",
28
- "@teambit/scope": "0.0.946",
29
- "@teambit/workspace": "0.0.946"
26
+ "@teambit/logger": "0.0.728",
27
+ "@teambit/remove": "0.0.125",
28
+ "@teambit/scope": "0.0.948",
29
+ "@teambit/workspace": "0.0.948"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/lodash": "4.14.165",
@@ -38,7 +38,7 @@
38
38
  "@types/testing-library__jest-dom": "5.9.5"
39
39
  },
40
40
  "peerDependencies": {
41
- "@teambit/legacy": "1.0.414",
41
+ "@teambit/legacy": "1.0.416",
42
42
  "react": "^16.8.0 || ^17.0.0",
43
43
  "react-dom": "^16.8.0 || ^17.0.0"
44
44
  },