@teambit/lanes 0.0.395 → 0.0.396

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.
@@ -102,38 +102,6 @@ export declare class LaneRenameCmd implements Command {
102
102
  constructor(lanes: LanesMain);
103
103
  report([currentName, newName]: [string, string]): Promise<string>;
104
104
  }
105
- export declare class LaneMergeCmd implements Command {
106
- private lanes;
107
- name: string;
108
- description: string;
109
- extendedDescription: string;
110
- arguments: {
111
- name: string;
112
- description: string;
113
- }[];
114
- alias: string;
115
- options: CommandOptions;
116
- loader: boolean;
117
- private: boolean;
118
- migration: boolean;
119
- remoteOp: boolean;
120
- constructor(lanes: LanesMain);
121
- report([name, pattern]: [string, string], { ours, theirs, manual, build, workspace: existingOnWorkspaceOnly, noSnap, message: snapMessage, keepReadme, squash, skipDependencyInstallation, remote, includeDeps, verbose, }: {
122
- ours: boolean;
123
- theirs: boolean;
124
- manual: boolean;
125
- workspace?: boolean;
126
- build?: boolean;
127
- noSnap: boolean;
128
- message: string;
129
- keepReadme?: boolean;
130
- squash: boolean;
131
- skipDependencyInstallation?: boolean;
132
- remote: boolean;
133
- includeDeps?: boolean;
134
- verbose?: boolean;
135
- }): Promise<string>;
136
- }
137
105
  export declare class LaneRemoveCmd implements Command {
138
106
  private lanes;
139
107
  name: string;
package/dist/lane.cmd.js CHANGED
@@ -11,7 +11,7 @@ require("core-js/modules/es.promise.js");
11
11
  Object.defineProperty(exports, "__esModule", {
12
12
  value: true
13
13
  });
14
- exports.LaneShowCmd = exports.LaneRenameCmd = exports.LaneRemoveReadmeCmd = exports.LaneRemoveCmd = exports.LaneMergeCmd = exports.LaneListCmd = exports.LaneImportCmd = exports.LaneCreateCmd = exports.LaneCmd = exports.LaneChangeScopeCmd = exports.LaneAliasCmd = exports.LaneAddReadmeCmd = void 0;
14
+ exports.LaneShowCmd = exports.LaneRenameCmd = exports.LaneRemoveReadmeCmd = exports.LaneRemoveCmd = exports.LaneListCmd = exports.LaneImportCmd = exports.LaneCreateCmd = exports.LaneCmd = exports.LaneChangeScopeCmd = exports.LaneAliasCmd = exports.LaneAddReadmeCmd = void 0;
15
15
 
16
16
  function _defineProperty2() {
17
17
  const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
@@ -43,36 +43,6 @@ function _yn() {
43
43
  return data;
44
44
  }
45
45
 
46
- function _mergeVersion() {
47
- const data = require("@teambit/legacy/dist/consumer/versions-ops/merge-version");
48
-
49
- _mergeVersion = function () {
50
- return data;
51
- };
52
-
53
- return data;
54
- }
55
-
56
- function _merging() {
57
- const data = require("@teambit/merging");
58
-
59
- _merging = function () {
60
- return data;
61
- };
62
-
63
- return data;
64
- }
65
-
66
- function _featureToggle() {
67
- const data = require("@teambit/legacy/dist/api/consumer/lib/feature-toggle");
68
-
69
- _featureToggle = function () {
70
- return data;
71
- };
72
-
73
- return data;
74
- }
75
-
76
46
  function _bitError() {
77
47
  const data = require("@teambit/bit-error");
78
48
 
@@ -93,20 +63,7 @@ function _prompts() {
93
63
  return data;
94
64
  }
95
65
 
96
- function _removeTemplate() {
97
- const data = _interopRequireDefault(require("@teambit/legacy/dist/cli/templates/remove-template"));
98
-
99
- _removeTemplate = function () {
100
- return data;
101
- };
102
-
103
- return data;
104
- }
105
-
106
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
107
-
108
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
109
-
66
+ // eslint-disable-next-line max-classes-per-file
110
67
  class LaneListCmd {
111
68
  constructor(lanes, workspace, scope) {
112
69
  this.lanes = lanes;
@@ -379,80 +336,6 @@ class LaneRenameCmd {
379
336
 
380
337
  exports.LaneRenameCmd = LaneRenameCmd;
381
338
 
382
- class LaneMergeCmd {
383
- constructor(lanes) {
384
- this.lanes = lanes;
385
- (0, _defineProperty2().default)(this, "name", 'merge <lane> [pattern]');
386
- (0, _defineProperty2().default)(this, "description", `merge a local or a remote lane`);
387
- (0, _defineProperty2().default)(this, "extendedDescription", `if the <lane> exists locally, it will be merged from the local lane.
388
- otherwise, it will fetch the lane from the remote and merge it.
389
- in case the <lane> exists locally but you want to merge the remote version of it, use --remote flag`);
390
- (0, _defineProperty2().default)(this, "arguments", [{
391
- name: 'lane',
392
- description: 'lane-name or lane-id (if not exists locally) to merge to the current lane'
393
- }, {
394
- name: 'pattern',
395
- description: 'EXPERIMENTAL. partially merge the lane with the specified component-pattern'
396
- }]);
397
- (0, _defineProperty2().default)(this, "alias", '');
398
- (0, _defineProperty2().default)(this, "options", [['', 'ours', 'in case of a conflict, override the used version with the current modification'], ['', 'theirs', 'in case of a conflict, override the current modification with the specified version'], ['', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'], ['', 'workspace', 'merge only components in a lane that exist in the workspace'], ['', 'no-snap', 'do not auto snap in case the merge completed without conflicts'], ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'], ['m', 'message <message>', 'override the default message for the auto snap'], ['', 'keep-readme', 'skip deleting the lane readme component after merging'], ['', 'squash', 'EXPERIMENTAL. squash multiple snaps. keep the last one only'], ['', 'verbose', 'show details of components that were not merged legitimately'], ['', 'skip-dependency-installation', 'do not install packages of the imported components'], ['', 'remote', 'relevant when the target-lane locally is differ than the remote and you want the remote'], ['', 'include-deps', 'EXPERIMENTAL. relevant for "--pattern" and "--workspace". merge also dependencies of the given components']]);
399
- (0, _defineProperty2().default)(this, "loader", true);
400
- (0, _defineProperty2().default)(this, "private", true);
401
- (0, _defineProperty2().default)(this, "migration", true);
402
- (0, _defineProperty2().default)(this, "remoteOp", true);
403
- }
404
-
405
- async report([name, pattern], {
406
- ours = false,
407
- theirs = false,
408
- manual = false,
409
- build,
410
- workspace: existingOnWorkspaceOnly = false,
411
- noSnap = false,
412
- message: snapMessage = '',
413
- keepReadme = false,
414
- squash = false,
415
- skipDependencyInstallation = false,
416
- remote = false,
417
- includeDeps = false,
418
- verbose = false
419
- }) {
420
- build = (0, _featureToggle().isFeatureEnabled)(_featureToggle().BUILD_ON_CI) ? Boolean(build) : true;
421
- const mergeStrategy = (0, _mergeVersion().getMergeStrategy)(ours, theirs, manual);
422
- if (noSnap && snapMessage) throw new (_bitError().BitError)('unable to use "noSnap" and "message" flags together');
423
-
424
- if (includeDeps && !pattern && !existingOnWorkspaceOnly) {
425
- throw new (_bitError().BitError)(`"--include-deps" flag is relevant only for --workspace and --pattern flags`);
426
- }
427
-
428
- const {
429
- mergeResults,
430
- deleteResults
431
- } = await this.lanes.mergeLane(name, {
432
- build,
433
- // @ts-ignore
434
- mergeStrategy,
435
- existingOnWorkspaceOnly,
436
- noSnap,
437
- snapMessage,
438
- keepReadme,
439
- squash,
440
- pattern,
441
- skipDependencyInstallation,
442
- remote,
443
- includeDeps
444
- });
445
- const mergeResult = (0, _merging().mergeReport)(_objectSpread(_objectSpread({}, mergeResults), {}, {
446
- verbose
447
- }));
448
- const deleteResult = `${deleteResults.localResult ? (0, _removeTemplate().default)(deleteResults.localResult, false) : ''}${(deleteResults.remoteResult || []).map(item => (0, _removeTemplate().default)(item, true))}${deleteResults.readmeResult && _chalk().default.yellow(deleteResults.readmeResult) || ''}\n`;
449
- return mergeResult + deleteResult;
450
- }
451
-
452
- }
453
-
454
- exports.LaneMergeCmd = LaneMergeCmd;
455
-
456
339
  class LaneRemoveCmd {
457
340
  constructor(lanes) {
458
341
  this.lanes = lanes;
@@ -1 +1 @@
1
- {"version":3,"names":["LaneListCmd","constructor","lanes","workspace","scope","report","args","laneOptions","details","remote","merged","notMerged","getLanes","showDefaultLane","mergedLanes","filter","l","isMerged","length","chalk","green","map","m","name","join","unmergedLanes","currentLane","getCurrentLaneId","getDefaultLaneId","laneDataOfCurrentLane","find","isEqual","id","undefined","currentAlias","alias","currentLaneReadmeComponentStr","outputReadmeComponent","readmeComponent","currentLaneStr","remoteOfCurrentLane","currentLaneComponents","outputComponents","components","outputRemoteLane","availableLanes","laneData","readmeComponentStr","aliasStr","laneTitle","bold","concat","outputFooter","footer","outputCurrentLane","outputAvailableLanes","json","getCurrentLaneNameOrAlias","LaneShowCmd","onlyLane","title","author","log","username","email","date","Date","parseInt","toLocaleString","LaneCreateCmd","description","createLaneOptions","result","createLane","remoteScopeOrDefaultScope","remoteScope","localLane","remoteScopeOutput","LaneAliasCmd","laneName","laneId","aliasLane","toString","LaneChangeScopeCmd","localName","remoteScopeBefore","changeScope","LaneRenameCmd","currentName","newName","exported","exportErr","rename","exportedStr","message","LaneMergeCmd","pattern","ours","theirs","manual","build","existingOnWorkspaceOnly","noSnap","snapMessage","keepReadme","squash","skipDependencyInstallation","includeDeps","verbose","isFeatureEnabled","BUILD_ON_CI","Boolean","mergeStrategy","getMergeStrategy","BitError","mergeResults","deleteResults","mergeLane","mergeResult","mergeReport","deleteResult","localResult","paintRemoved","remoteResult","item","readmeResult","yellow","LaneRemoveCmd","names","force","silent","removePromptResult","approveOperation","yn","shouldProceed","laneResults","removeLanes","LaneImportCmd","switchCmd","lane","getAll","LaneCmd","docsDomain","LaneRemoveReadmeCmd","removeLaneReadme","getCurrentLaneName","red","LaneAddReadmeCmd","componentId","addLaneReadme","componentsTitle","componentsStr","c","head","component","remoteLane"],"sources":["lane.cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport chalk from 'chalk';\nimport yn from 'yn';\nimport { ScopeMain } from '@teambit/scope';\nimport { Workspace } from '@teambit/workspace';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { LaneData } from '@teambit/legacy/dist/scope/lanes/lanes';\nimport { getMergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { mergeReport } from '@teambit/merging';\nimport { BUILD_ON_CI, isFeatureEnabled } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';\nimport { BitError } from '@teambit/bit-error';\nimport { approveOperation } from '@teambit/legacy/dist/prompts';\nimport paintRemoved from '@teambit/legacy/dist/cli/templates/remove-template';\nimport { CreateLaneOptions, LanesMain } from './lanes.main.runtime';\nimport { SwitchCmd } from './switch.cmd';\n\ntype LaneOptions = {\n details?: boolean;\n remote?: string;\n merged?: boolean;\n notMerged?: boolean;\n json?: boolean;\n};\n\nexport class LaneListCmd implements Command {\n name = 'list';\n description = `list lanes`;\n alias = '';\n options = [\n ['d', 'details', 'show more details on the state of each component in each lane'],\n ['j', 'json', 'show lanes details in a json format'],\n ['r', 'remote <remote-scope-name>', 'show remote lanes'],\n ['', 'merged', 'show merged lanes'],\n ['', 'not-merged', 'show lanes that are not merged'],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n remoteOp = true;\n skipWorkspace = true;\n\n constructor(private lanes: LanesMain, private workspace: Workspace, private scope: ScopeMain) {}\n\n async report(args, laneOptions: LaneOptions): Promise<string> {\n const { details, remote, merged, notMerged } = laneOptions;\n\n const lanes = await this.lanes.getLanes({\n remote,\n merged,\n notMerged,\n showDefaultLane: true,\n });\n if (merged) {\n const mergedLanes = lanes.filter((l) => l.isMerged);\n if (!mergedLanes.length) return chalk.green('None of the lanes is merged');\n return chalk.green(mergedLanes.map((m) => m.name).join('\\n'));\n }\n if (notMerged) {\n const unmergedLanes = lanes.filter((l) => !l.isMerged);\n if (!unmergedLanes.length) return chalk.green('All lanes are merged');\n return chalk.green(unmergedLanes.map((m) => m.name).join('\\n'));\n }\n const currentLane = this.lanes.getCurrentLaneId() || this.lanes.getDefaultLaneId();\n const laneDataOfCurrentLane = currentLane ? lanes.find((l) => currentLane.isEqual(l.id)) : undefined;\n const currentAlias = laneDataOfCurrentLane ? laneDataOfCurrentLane.alias : undefined;\n const currentLaneReadmeComponentStr = outputReadmeComponent(laneDataOfCurrentLane?.readmeComponent);\n let currentLaneStr = currentLane ? `current lane - ${chalk.green.green(currentAlias || currentLane.name)}` : '';\n currentLaneStr += currentLaneReadmeComponentStr;\n\n if (details) {\n const remoteOfCurrentLane = laneDataOfCurrentLane ? laneDataOfCurrentLane.remote : null;\n const currentLaneComponents = laneDataOfCurrentLane ? outputComponents(laneDataOfCurrentLane.components) : '';\n if (currentLaneStr) {\n currentLaneStr += `${outputRemoteLane(remoteOfCurrentLane)}\\n${currentLaneComponents}`;\n }\n }\n\n const availableLanes = lanes\n .filter((l) => !currentLane.isEqual(l.id))\n .map((laneData) => {\n const readmeComponentStr = outputReadmeComponent(laneData.readmeComponent);\n const aliasStr = laneData.alias ? ` (${laneData.alias})` : '';\n if (details) {\n const laneTitle = `> ${chalk.bold(laneData.name)}${aliasStr}${outputRemoteLane(laneData.remote)}\\n`;\n const components = outputComponents(laneData.components);\n return laneTitle + readmeComponentStr.concat('\\n') + components;\n }\n return ` > ${chalk.green(laneData.name)}${aliasStr} (${\n laneData.components.length\n } components)${readmeComponentStr}`;\n })\n .join('\\n');\n\n const outputFooter = () => {\n let footer = '\\n';\n if (details) {\n footer += 'You can use --merged and --not-merged to see which of the lanes is fully merged.';\n } else {\n footer +=\n \"to get more info on all lanes in workspace use 'bit lane list --details' or 'bit lane show <lane-name>' for a specific lane.\";\n }\n if (!remote && this.workspace) footer += `\\nswitch lanes using 'bit switch <name>'.`;\n\n return footer;\n };\n\n return outputCurrentLane() + outputAvailableLanes() + outputFooter();\n\n function outputCurrentLane() {\n return currentLaneStr ? `${currentLaneStr}\\n` : '';\n }\n\n function outputAvailableLanes() {\n if (!availableLanes) return '';\n return remote ? `${availableLanes}\\n` : `\\nAvailable lanes:\\n${availableLanes}\\n`;\n }\n }\n async json(args, laneOptions: LaneOptions) {\n const { remote, merged = false, notMerged = false } = laneOptions;\n\n const lanes = await this.lanes.getLanes({\n remote,\n showDefaultLane: true,\n merged,\n notMerged,\n });\n const currentLane = this.lanes.getCurrentLaneNameOrAlias();\n return { lanes, currentLane };\n }\n}\n\nexport class LaneShowCmd implements Command {\n name = 'show <lane-name>';\n description = `show lane details`;\n alias = '';\n options = [\n ['j', 'json', 'show the lane details in json format'],\n ['r', 'remote <string>', 'show remote lanes'],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n remoteOp = true;\n skipWorkspace = true;\n\n constructor(private lanes: LanesMain, private workspace: Workspace, private scope: ScopeMain) {}\n\n async report([name]: [string], laneOptions: LaneOptions): Promise<string> {\n const { remote } = laneOptions;\n\n const lanes = await this.lanes.getLanes({\n name,\n remote,\n });\n\n const onlyLane = lanes[0];\n const title = `showing information for ${chalk.bold(name)}${outputRemoteLane(onlyLane.remote)}\\n`;\n const author = `author: ${onlyLane.log?.username || 'N/A'} <${onlyLane.log?.email || 'N/A'}>\\n`;\n const date = onlyLane.log?.date ? `${new Date(parseInt(onlyLane.log.date)).toLocaleString()}\\n` : undefined;\n return title + author + date + outputComponents(onlyLane.components);\n }\n\n async json([name]: [string], laneOptions: LaneOptions) {\n const { remote } = laneOptions;\n\n const lanes = await this.lanes.getLanes({\n name,\n remote,\n });\n return lanes[0];\n }\n}\n\nexport class LaneCreateCmd implements Command {\n name = 'create <lane-name>';\n arguments = [\n {\n name: 'lane-name',\n description: 'the name for the new lane',\n },\n ];\n description = `creates a new lane and switches to it`;\n extendedDescription = `a lane created from main (default-lane) is empty until components are snapped.\na lane created from another lane has all the components of the original lane.`;\n alias = '';\n options = [\n [\n '',\n 'remote-scope <scope-name>',\n 'remote scope where this lane will be exported to, default to the defaultScope (can be changed later with \"bit lane change-scope\")',\n ],\n [\n '',\n 'alias <name>',\n 'a local alias to refer to this lane, defaults to the <lane-name> (can be added later with \"bit lane alias\")',\n ],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report([name]: [string], createLaneOptions: CreateLaneOptions): Promise<string> {\n const result = await this.lanes.createLane(name, createLaneOptions);\n const remoteScopeOrDefaultScope = createLaneOptions.remoteScope\n ? `the remote scope ${chalk.bold(createLaneOptions.remoteScope)}`\n : `the default-scope ${chalk.bold(result.remoteScope)}. to change it, please run \"bit lane track\" command`;\n const title = chalk.green(`successfully added and checked out to a new lane ${chalk.bold(result.localLane)}`);\n const remoteScopeOutput = `this lane will be exported to ${remoteScopeOrDefaultScope}`;\n return `${title}\\n${remoteScopeOutput}`;\n }\n}\n\nexport class LaneAliasCmd implements Command {\n name = 'alias <lane-name> <alias>';\n description = 'adds an alias to a lane';\n extendedDescription = `an alias is a name that can be used to refer to a lane. it is saved locally and never reach the remote.\nit is useful when having multiple lanes with the same name, but with different remote scopes.`;\n alias = '';\n options = [] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report([laneName, alias]: [string, string, string]): Promise<string> {\n const { laneId } = await this.lanes.aliasLane(laneName, alias);\n return `successfully added the alias ${chalk.bold(alias)} to the lane ${chalk.bold(laneId.toString())}`;\n }\n}\n\nexport class LaneChangeScopeCmd implements Command {\n name = 'change-scope <lane-name> <remote-scope-name>';\n description = `changes the remote scope of a lane`;\n alias = '';\n options = [] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report([localName, remoteScope]: [string, string]): Promise<string> {\n const { remoteScopeBefore } = await this.lanes.changeScope(localName, remoteScope);\n return `the remote-scope of ${chalk.bold(localName)} has been changed from ${chalk.bold(\n remoteScopeBefore\n )} to ${chalk.bold(remoteScope)}`;\n }\n}\n\nexport class LaneRenameCmd implements Command {\n name = 'rename <current-name> <new-name>';\n description = `EXPERIMENTAL. change the lane-name locally and on the remote (if exported)`;\n alias = '';\n options = [] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report([currentName, newName]: [string, string]): Promise<string> {\n const { exported, exportErr } = await this.lanes.rename(currentName, newName);\n const exportedStr = exported\n ? `and have been exported successfully to the remote`\n : `however if failed to export the renamed lane to the remote, due to an error: ${\n exportErr?.message || 'unknown'\n }`;\n return `the lane ${chalk.bold(currentName)} has been changed to ${chalk.bold(newName)}, ${exportedStr}`;\n }\n}\n\nexport class LaneMergeCmd implements Command {\n name = 'merge <lane> [pattern]';\n description = `merge a local or a remote lane`;\n extendedDescription = `if the <lane> exists locally, it will be merged from the local lane.\notherwise, it will fetch the lane from the remote and merge it.\nin case the <lane> exists locally but you want to merge the remote version of it, use --remote flag`;\n arguments = [\n {\n name: 'lane',\n description: 'lane-name or lane-id (if not exists locally) to merge to the current lane',\n },\n {\n name: 'pattern',\n description: 'EXPERIMENTAL. partially merge the lane with the specified component-pattern',\n },\n ];\n alias = '';\n options = [\n ['', 'ours', 'in case of a conflict, override the used version with the current modification'],\n ['', 'theirs', 'in case of a conflict, override the current modification with the specified version'],\n ['', 'manual', 'in case of a conflict, leave the files with a conflict state to resolve them manually later'],\n ['', 'workspace', 'merge only components in a lane that exist in the workspace'],\n ['', 'no-snap', 'do not auto snap in case the merge completed without conflicts'],\n ['', 'build', 'in case of snap during the merge, run the build-pipeline (similar to bit snap --build)'],\n ['m', 'message <message>', 'override the default message for the auto snap'],\n ['', 'keep-readme', 'skip deleting the lane readme component after merging'],\n ['', 'squash', 'EXPERIMENTAL. squash multiple snaps. keep the last one only'],\n ['', 'verbose', 'show details of components that were not merged legitimately'],\n ['', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ['', 'remote', 'relevant when the target-lane locally is differ than the remote and you want the remote'],\n [\n '',\n 'include-deps',\n 'EXPERIMENTAL. relevant for \"--pattern\" and \"--workspace\". merge also dependencies of the given components',\n ],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n remoteOp = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report(\n [name, pattern]: [string, string],\n {\n ours = false,\n theirs = false,\n manual = false,\n build,\n workspace: existingOnWorkspaceOnly = false,\n noSnap = false,\n message: snapMessage = '',\n keepReadme = false,\n squash = false,\n skipDependencyInstallation = false,\n remote = false,\n includeDeps = false,\n verbose = false,\n }: {\n ours: boolean;\n theirs: boolean;\n manual: boolean;\n workspace?: boolean;\n build?: boolean;\n noSnap: boolean;\n message: string;\n keepReadme?: boolean;\n squash: boolean;\n skipDependencyInstallation?: boolean;\n remote: boolean;\n includeDeps?: boolean;\n verbose?: boolean;\n }\n ): Promise<string> {\n build = isFeatureEnabled(BUILD_ON_CI) ? Boolean(build) : true;\n const mergeStrategy = getMergeStrategy(ours, theirs, manual);\n if (noSnap && snapMessage) throw new BitError('unable to use \"noSnap\" and \"message\" flags together');\n if (includeDeps && !pattern && !existingOnWorkspaceOnly) {\n throw new BitError(`\"--include-deps\" flag is relevant only for --workspace and --pattern flags`);\n }\n const { mergeResults, deleteResults } = await this.lanes.mergeLane(name, {\n build,\n // @ts-ignore\n mergeStrategy,\n existingOnWorkspaceOnly,\n noSnap,\n snapMessage,\n keepReadme,\n squash,\n pattern,\n skipDependencyInstallation,\n remote,\n includeDeps,\n });\n\n const mergeResult = mergeReport({ ...mergeResults, verbose });\n const deleteResult = `${deleteResults.localResult ? paintRemoved(deleteResults.localResult, false) : ''}${(\n deleteResults.remoteResult || []\n ).map((item) => paintRemoved(item, true))}${\n (deleteResults.readmeResult && chalk.yellow(deleteResults.readmeResult)) || ''\n }\\n`;\n return mergeResult + deleteResult;\n }\n}\n\nexport class LaneRemoveCmd implements Command {\n name = 'remove <lanes...>';\n arguments = [{ name: 'lanes...', description: 'A list of lane names, separated by spaces' }];\n description = `remove lanes`;\n alias = '';\n options = [\n ['r', 'remote', 'remove a remote lane (in the lane arg, use remote/lane-id syntax)'],\n [\n 'f',\n 'force',\n 'removes the component from the scope, even if used as a dependency. WARNING: components that depend on this component will corrupt',\n ],\n ['s', 'silent', 'skip confirmation'],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report(\n [names]: [string[]],\n {\n remote = false,\n force = false,\n silent = false,\n }: {\n remote: boolean;\n force: boolean;\n silent: boolean;\n }\n ): Promise<string> {\n if (!silent) {\n const removePromptResult = await approveOperation();\n // @ts-ignore\n if (!yn(removePromptResult.shouldProceed)) {\n throw new BitError('the operation has been canceled');\n }\n }\n const laneResults = await this.lanes.removeLanes(names, { remote, force });\n return chalk.green(`successfully removed the following lane(s): ${chalk.bold(laneResults.join(', '))}`);\n }\n}\n\nexport class LaneImportCmd implements Command {\n name = 'import <lane>';\n description = `import a remote lane to your workspace`;\n arguments = [{ name: 'lane', description: 'the remote lane name' }];\n alias = '';\n options = [\n ['', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(private switchCmd: SwitchCmd) {}\n\n async report(\n [lane]: [string],\n { skipDependencyInstallation = false }: { skipDependencyInstallation: boolean }\n ): Promise<string> {\n return this.switchCmd.report([lane], { getAll: true, skipDependencyInstallation });\n }\n}\n\nexport class LaneCmd implements Command {\n name = 'lane [lane-name]';\n description = 'show lanes details';\n alias = '';\n options = [\n ['d', 'details', 'show more details on the state of each component in each lane'],\n ['j', 'json', 'show lanes details in json format'],\n ['r', 'remote <string>', 'show remote lanes'],\n ['', 'merged', 'show merged lanes'],\n ['', 'not-merged', 'show not merged lanes'],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n remoteOp = true;\n skipWorkspace = true;\n commands: Command[] = [];\n\n constructor(private lanes: LanesMain, private workspace: Workspace, private scope: ScopeMain, docsDomain: string) {\n this.description = `show lanes details\nhttps://${docsDomain}/components/lanes`;\n }\n\n async report([name]: [string], laneOptions: LaneOptions): Promise<string> {\n return new LaneListCmd(this.lanes, this.workspace, this.scope).report([name], laneOptions);\n }\n}\n\nexport class LaneRemoveReadmeCmd implements Command {\n name = 'remove-readme [laneName]';\n description = 'EXPERIMENTAL. remove lane readme component';\n options = [] as CommandOptions;\n loader = true;\n private = true;\n skipWorkspace = false;\n\n constructor(private lanes: LanesMain) {}\n\n async report([laneName]: [string]): Promise<string> {\n const { result, message } = await this.lanes.removeLaneReadme(laneName);\n\n if (result) {\n return chalk.green(\n `the readme component has been successfully removed from the lane ${\n laneName || this.lanes.getCurrentLaneName()\n }`\n );\n }\n\n return chalk.red(`${message}\\n`);\n }\n}\n\nexport class LaneAddReadmeCmd implements Command {\n name = 'add-readme <component-name> [lane-name]';\n description = 'EXPERIMENTAL. adds a readme component to a lane';\n arguments = [\n { name: 'component-id', description: \"the component name or id of the component to use as the lane's readme\" },\n { name: 'lane-name', description: 'the lane to attach the readme to (defaults to the current lane)' },\n ];\n options = [] as CommandOptions;\n loader = true;\n private = true;\n skipWorkspace = false;\n\n constructor(private lanes: LanesMain) {}\n\n async report([componentId, laneName]: [string, string]): Promise<string> {\n const { result, message } = await this.lanes.addLaneReadme(componentId, laneName);\n\n if (result)\n return chalk.green(\n `the component ${componentId} has been successfully added as the readme component for the lane ${\n laneName || this.lanes.getCurrentLaneName()\n }`\n );\n\n return chalk.red(\n `${message || ''}\\nthe component ${componentId} could not be added as a readme component for the lane ${\n laneName || this.lanes.getCurrentLaneName()\n }`\n );\n }\n}\n\nfunction outputComponents(components: LaneData['components']): string {\n const componentsTitle = `\\t${chalk.bold(`components (${components.length})`)}\\n`;\n const componentsStr = components.map((c) => `\\t ${c.id.toString()} - ${c.head}`).join('\\n');\n return componentsTitle + componentsStr;\n}\n\nfunction outputReadmeComponent(component: LaneData['readmeComponent']): string {\n if (!component) return '';\n return `\\n\\t${`${chalk.yellow('readme component')}\\n\\t ${component.id} - ${\n component.head ||\n `(unsnapped)\\n\\t(\"use bit snap ${component.id.name}\" to snap the readme component on the lane before exporting)`\n }`}\\n`;\n}\n\nfunction outputRemoteLane(remoteLane: string | null | undefined): string {\n if (!remoteLane) return '';\n return ` - (remote lane - ${remoteLane})`;\n}\n"],"mappings":";;;;;;;;;;;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AgB,OAAO,EAAP;EAChB,OAAQ,OAAO,GAAEvI,gBAAA,CAAM2G,MAAN,CAAa,kBAAb,CAAiC,SAAQ4B,SAAS,CAAC1H,EAAG,MACrE0H,SAAS,CAACD,IAAV,IACC,iCAAgCC,SAAS,CAAC1H,EAAV,CAAaT,IAAK,8DACpD,EAAE,IAHH;AAID;;AAED,SAASqB,gBAAT,CAA0B+G,UAA1B,EAAyE;EACvE,IAAI,CAACA,UAAL,EAAiB,OAAO,EAAP;EACjB,OAAQ,qBAAoBA,UAAW,GAAvC;AACD"}
1
+ {"version":3,"names":["LaneListCmd","constructor","lanes","workspace","scope","report","args","laneOptions","details","remote","merged","notMerged","getLanes","showDefaultLane","mergedLanes","filter","l","isMerged","length","chalk","green","map","m","name","join","unmergedLanes","currentLane","getCurrentLaneId","getDefaultLaneId","laneDataOfCurrentLane","find","isEqual","id","undefined","currentAlias","alias","currentLaneReadmeComponentStr","outputReadmeComponent","readmeComponent","currentLaneStr","remoteOfCurrentLane","currentLaneComponents","outputComponents","components","outputRemoteLane","availableLanes","laneData","readmeComponentStr","aliasStr","laneTitle","bold","concat","outputFooter","footer","outputCurrentLane","outputAvailableLanes","json","getCurrentLaneNameOrAlias","LaneShowCmd","onlyLane","title","author","log","username","email","date","Date","parseInt","toLocaleString","LaneCreateCmd","description","createLaneOptions","result","createLane","remoteScopeOrDefaultScope","remoteScope","localLane","remoteScopeOutput","LaneAliasCmd","laneName","laneId","aliasLane","toString","LaneChangeScopeCmd","localName","remoteScopeBefore","changeScope","LaneRenameCmd","currentName","newName","exported","exportErr","rename","exportedStr","message","LaneRemoveCmd","names","force","silent","removePromptResult","approveOperation","yn","shouldProceed","BitError","laneResults","removeLanes","LaneImportCmd","switchCmd","lane","skipDependencyInstallation","getAll","LaneCmd","docsDomain","LaneRemoveReadmeCmd","removeLaneReadme","getCurrentLaneName","red","LaneAddReadmeCmd","componentId","addLaneReadme","componentsTitle","componentsStr","c","head","component","yellow","remoteLane"],"sources":["lane.cmd.ts"],"sourcesContent":["// eslint-disable-next-line max-classes-per-file\nimport chalk from 'chalk';\nimport yn from 'yn';\nimport { ScopeMain } from '@teambit/scope';\nimport { Workspace } from '@teambit/workspace';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { LaneData } from '@teambit/legacy/dist/scope/lanes/lanes';\nimport { BitError } from '@teambit/bit-error';\nimport { approveOperation } from '@teambit/legacy/dist/prompts';\nimport { CreateLaneOptions, LanesMain } from './lanes.main.runtime';\nimport { SwitchCmd } from './switch.cmd';\n\ntype LaneOptions = {\n details?: boolean;\n remote?: string;\n merged?: boolean;\n notMerged?: boolean;\n json?: boolean;\n};\n\nexport class LaneListCmd implements Command {\n name = 'list';\n description = `list lanes`;\n alias = '';\n options = [\n ['d', 'details', 'show more details on the state of each component in each lane'],\n ['j', 'json', 'show lanes details in a json format'],\n ['r', 'remote <remote-scope-name>', 'show remote lanes'],\n ['', 'merged', 'show merged lanes'],\n ['', 'not-merged', 'show lanes that are not merged'],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n remoteOp = true;\n skipWorkspace = true;\n\n constructor(private lanes: LanesMain, private workspace: Workspace, private scope: ScopeMain) {}\n\n async report(args, laneOptions: LaneOptions): Promise<string> {\n const { details, remote, merged, notMerged } = laneOptions;\n\n const lanes = await this.lanes.getLanes({\n remote,\n merged,\n notMerged,\n showDefaultLane: true,\n });\n if (merged) {\n const mergedLanes = lanes.filter((l) => l.isMerged);\n if (!mergedLanes.length) return chalk.green('None of the lanes is merged');\n return chalk.green(mergedLanes.map((m) => m.name).join('\\n'));\n }\n if (notMerged) {\n const unmergedLanes = lanes.filter((l) => !l.isMerged);\n if (!unmergedLanes.length) return chalk.green('All lanes are merged');\n return chalk.green(unmergedLanes.map((m) => m.name).join('\\n'));\n }\n const currentLane = this.lanes.getCurrentLaneId() || this.lanes.getDefaultLaneId();\n const laneDataOfCurrentLane = currentLane ? lanes.find((l) => currentLane.isEqual(l.id)) : undefined;\n const currentAlias = laneDataOfCurrentLane ? laneDataOfCurrentLane.alias : undefined;\n const currentLaneReadmeComponentStr = outputReadmeComponent(laneDataOfCurrentLane?.readmeComponent);\n let currentLaneStr = currentLane ? `current lane - ${chalk.green.green(currentAlias || currentLane.name)}` : '';\n currentLaneStr += currentLaneReadmeComponentStr;\n\n if (details) {\n const remoteOfCurrentLane = laneDataOfCurrentLane ? laneDataOfCurrentLane.remote : null;\n const currentLaneComponents = laneDataOfCurrentLane ? outputComponents(laneDataOfCurrentLane.components) : '';\n if (currentLaneStr) {\n currentLaneStr += `${outputRemoteLane(remoteOfCurrentLane)}\\n${currentLaneComponents}`;\n }\n }\n\n const availableLanes = lanes\n .filter((l) => !currentLane.isEqual(l.id))\n .map((laneData) => {\n const readmeComponentStr = outputReadmeComponent(laneData.readmeComponent);\n const aliasStr = laneData.alias ? ` (${laneData.alias})` : '';\n if (details) {\n const laneTitle = `> ${chalk.bold(laneData.name)}${aliasStr}${outputRemoteLane(laneData.remote)}\\n`;\n const components = outputComponents(laneData.components);\n return laneTitle + readmeComponentStr.concat('\\n') + components;\n }\n return ` > ${chalk.green(laneData.name)}${aliasStr} (${\n laneData.components.length\n } components)${readmeComponentStr}`;\n })\n .join('\\n');\n\n const outputFooter = () => {\n let footer = '\\n';\n if (details) {\n footer += 'You can use --merged and --not-merged to see which of the lanes is fully merged.';\n } else {\n footer +=\n \"to get more info on all lanes in workspace use 'bit lane list --details' or 'bit lane show <lane-name>' for a specific lane.\";\n }\n if (!remote && this.workspace) footer += `\\nswitch lanes using 'bit switch <name>'.`;\n\n return footer;\n };\n\n return outputCurrentLane() + outputAvailableLanes() + outputFooter();\n\n function outputCurrentLane() {\n return currentLaneStr ? `${currentLaneStr}\\n` : '';\n }\n\n function outputAvailableLanes() {\n if (!availableLanes) return '';\n return remote ? `${availableLanes}\\n` : `\\nAvailable lanes:\\n${availableLanes}\\n`;\n }\n }\n async json(args, laneOptions: LaneOptions) {\n const { remote, merged = false, notMerged = false } = laneOptions;\n\n const lanes = await this.lanes.getLanes({\n remote,\n showDefaultLane: true,\n merged,\n notMerged,\n });\n const currentLane = this.lanes.getCurrentLaneNameOrAlias();\n return { lanes, currentLane };\n }\n}\n\nexport class LaneShowCmd implements Command {\n name = 'show <lane-name>';\n description = `show lane details`;\n alias = '';\n options = [\n ['j', 'json', 'show the lane details in json format'],\n ['r', 'remote <string>', 'show remote lanes'],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n remoteOp = true;\n skipWorkspace = true;\n\n constructor(private lanes: LanesMain, private workspace: Workspace, private scope: ScopeMain) {}\n\n async report([name]: [string], laneOptions: LaneOptions): Promise<string> {\n const { remote } = laneOptions;\n\n const lanes = await this.lanes.getLanes({\n name,\n remote,\n });\n\n const onlyLane = lanes[0];\n const title = `showing information for ${chalk.bold(name)}${outputRemoteLane(onlyLane.remote)}\\n`;\n const author = `author: ${onlyLane.log?.username || 'N/A'} <${onlyLane.log?.email || 'N/A'}>\\n`;\n const date = onlyLane.log?.date ? `${new Date(parseInt(onlyLane.log.date)).toLocaleString()}\\n` : undefined;\n return title + author + date + outputComponents(onlyLane.components);\n }\n\n async json([name]: [string], laneOptions: LaneOptions) {\n const { remote } = laneOptions;\n\n const lanes = await this.lanes.getLanes({\n name,\n remote,\n });\n return lanes[0];\n }\n}\n\nexport class LaneCreateCmd implements Command {\n name = 'create <lane-name>';\n arguments = [\n {\n name: 'lane-name',\n description: 'the name for the new lane',\n },\n ];\n description = `creates a new lane and switches to it`;\n extendedDescription = `a lane created from main (default-lane) is empty until components are snapped.\na lane created from another lane has all the components of the original lane.`;\n alias = '';\n options = [\n [\n '',\n 'remote-scope <scope-name>',\n 'remote scope where this lane will be exported to, default to the defaultScope (can be changed later with \"bit lane change-scope\")',\n ],\n [\n '',\n 'alias <name>',\n 'a local alias to refer to this lane, defaults to the <lane-name> (can be added later with \"bit lane alias\")',\n ],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report([name]: [string], createLaneOptions: CreateLaneOptions): Promise<string> {\n const result = await this.lanes.createLane(name, createLaneOptions);\n const remoteScopeOrDefaultScope = createLaneOptions.remoteScope\n ? `the remote scope ${chalk.bold(createLaneOptions.remoteScope)}`\n : `the default-scope ${chalk.bold(result.remoteScope)}. to change it, please run \"bit lane track\" command`;\n const title = chalk.green(`successfully added and checked out to a new lane ${chalk.bold(result.localLane)}`);\n const remoteScopeOutput = `this lane will be exported to ${remoteScopeOrDefaultScope}`;\n return `${title}\\n${remoteScopeOutput}`;\n }\n}\n\nexport class LaneAliasCmd implements Command {\n name = 'alias <lane-name> <alias>';\n description = 'adds an alias to a lane';\n extendedDescription = `an alias is a name that can be used to refer to a lane. it is saved locally and never reach the remote.\nit is useful when having multiple lanes with the same name, but with different remote scopes.`;\n alias = '';\n options = [] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report([laneName, alias]: [string, string, string]): Promise<string> {\n const { laneId } = await this.lanes.aliasLane(laneName, alias);\n return `successfully added the alias ${chalk.bold(alias)} to the lane ${chalk.bold(laneId.toString())}`;\n }\n}\n\nexport class LaneChangeScopeCmd implements Command {\n name = 'change-scope <lane-name> <remote-scope-name>';\n description = `changes the remote scope of a lane`;\n alias = '';\n options = [] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report([localName, remoteScope]: [string, string]): Promise<string> {\n const { remoteScopeBefore } = await this.lanes.changeScope(localName, remoteScope);\n return `the remote-scope of ${chalk.bold(localName)} has been changed from ${chalk.bold(\n remoteScopeBefore\n )} to ${chalk.bold(remoteScope)}`;\n }\n}\n\nexport class LaneRenameCmd implements Command {\n name = 'rename <current-name> <new-name>';\n description = `EXPERIMENTAL. change the lane-name locally and on the remote (if exported)`;\n alias = '';\n options = [] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report([currentName, newName]: [string, string]): Promise<string> {\n const { exported, exportErr } = await this.lanes.rename(currentName, newName);\n const exportedStr = exported\n ? `and have been exported successfully to the remote`\n : `however if failed to export the renamed lane to the remote, due to an error: ${\n exportErr?.message || 'unknown'\n }`;\n return `the lane ${chalk.bold(currentName)} has been changed to ${chalk.bold(newName)}, ${exportedStr}`;\n }\n}\n\nexport class LaneRemoveCmd implements Command {\n name = 'remove <lanes...>';\n arguments = [{ name: 'lanes...', description: 'A list of lane names, separated by spaces' }];\n description = `remove lanes`;\n alias = '';\n options = [\n ['r', 'remote', 'remove a remote lane (in the lane arg, use remote/lane-id syntax)'],\n [\n 'f',\n 'force',\n 'removes the component from the scope, even if used as a dependency. WARNING: components that depend on this component will corrupt',\n ],\n ['s', 'silent', 'skip confirmation'],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report(\n [names]: [string[]],\n {\n remote = false,\n force = false,\n silent = false,\n }: {\n remote: boolean;\n force: boolean;\n silent: boolean;\n }\n ): Promise<string> {\n if (!silent) {\n const removePromptResult = await approveOperation();\n // @ts-ignore\n if (!yn(removePromptResult.shouldProceed)) {\n throw new BitError('the operation has been canceled');\n }\n }\n const laneResults = await this.lanes.removeLanes(names, { remote, force });\n return chalk.green(`successfully removed the following lane(s): ${chalk.bold(laneResults.join(', '))}`);\n }\n}\n\nexport class LaneImportCmd implements Command {\n name = 'import <lane>';\n description = `import a remote lane to your workspace`;\n arguments = [{ name: 'lane', description: 'the remote lane name' }];\n alias = '';\n options = [\n ['', 'skip-dependency-installation', 'do not install packages of the imported components'],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n\n constructor(private switchCmd: SwitchCmd) {}\n\n async report(\n [lane]: [string],\n { skipDependencyInstallation = false }: { skipDependencyInstallation: boolean }\n ): Promise<string> {\n return this.switchCmd.report([lane], { getAll: true, skipDependencyInstallation });\n }\n}\n\nexport class LaneCmd implements Command {\n name = 'lane [lane-name]';\n description = 'show lanes details';\n alias = '';\n options = [\n ['d', 'details', 'show more details on the state of each component in each lane'],\n ['j', 'json', 'show lanes details in json format'],\n ['r', 'remote <string>', 'show remote lanes'],\n ['', 'merged', 'show merged lanes'],\n ['', 'not-merged', 'show not merged lanes'],\n ] as CommandOptions;\n loader = true;\n private = true;\n migration = true;\n remoteOp = true;\n skipWorkspace = true;\n commands: Command[] = [];\n\n constructor(private lanes: LanesMain, private workspace: Workspace, private scope: ScopeMain, docsDomain: string) {\n this.description = `show lanes details\nhttps://${docsDomain}/components/lanes`;\n }\n\n async report([name]: [string], laneOptions: LaneOptions): Promise<string> {\n return new LaneListCmd(this.lanes, this.workspace, this.scope).report([name], laneOptions);\n }\n}\n\nexport class LaneRemoveReadmeCmd implements Command {\n name = 'remove-readme [laneName]';\n description = 'EXPERIMENTAL. remove lane readme component';\n options = [] as CommandOptions;\n loader = true;\n private = true;\n skipWorkspace = false;\n\n constructor(private lanes: LanesMain) {}\n\n async report([laneName]: [string]): Promise<string> {\n const { result, message } = await this.lanes.removeLaneReadme(laneName);\n\n if (result) {\n return chalk.green(\n `the readme component has been successfully removed from the lane ${\n laneName || this.lanes.getCurrentLaneName()\n }`\n );\n }\n\n return chalk.red(`${message}\\n`);\n }\n}\n\nexport class LaneAddReadmeCmd implements Command {\n name = 'add-readme <component-name> [lane-name]';\n description = 'EXPERIMENTAL. adds a readme component to a lane';\n arguments = [\n { name: 'component-id', description: \"the component name or id of the component to use as the lane's readme\" },\n { name: 'lane-name', description: 'the lane to attach the readme to (defaults to the current lane)' },\n ];\n options = [] as CommandOptions;\n loader = true;\n private = true;\n skipWorkspace = false;\n\n constructor(private lanes: LanesMain) {}\n\n async report([componentId, laneName]: [string, string]): Promise<string> {\n const { result, message } = await this.lanes.addLaneReadme(componentId, laneName);\n\n if (result)\n return chalk.green(\n `the component ${componentId} has been successfully added as the readme component for the lane ${\n laneName || this.lanes.getCurrentLaneName()\n }`\n );\n\n return chalk.red(\n `${message || ''}\\nthe component ${componentId} could not be added as a readme component for the lane ${\n laneName || this.lanes.getCurrentLaneName()\n }`\n );\n }\n}\n\nfunction outputComponents(components: LaneData['components']): string {\n const componentsTitle = `\\t${chalk.bold(`components (${components.length})`)}\\n`;\n const componentsStr = components.map((c) => `\\t ${c.id.toString()} - ${c.head}`).join('\\n');\n return componentsTitle + componentsStr;\n}\n\nfunction outputReadmeComponent(component: LaneData['readmeComponent']): string {\n if (!component) return '';\n return `\\n\\t${`${chalk.yellow('readme component')}\\n\\t ${component.id} - ${\n component.head ||\n `(unsnapped)\\n\\t(\"use bit snap ${component.id.name}\" to snap the readme component on the lane before exporting)`\n }`}\\n`;\n}\n\nfunction outputRemoteLane(remoteLane: string | null | undefined): string {\n if (!remoteLane) return '';\n return ` - (remote lane - ${remoteLane})`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAKA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AARA;AAoBO,MAAMA,WAAN,CAAqC;EAiB1CC,WAAW,CAASC,KAAT,EAAmCC,SAAnC,EAAiEC,KAAjE,EAAmF;IAAA,KAA1EF,KAA0E,GAA1EA,KAA0E;IAAA,KAAhDC,SAAgD,GAAhDA,SAAgD;IAAA,KAAlBC,KAAkB,GAAlBA,KAAkB;IAAA,8CAhBvF,MAgBuF;IAAA,qDAf/E,YAe+E;IAAA,+CAdtF,EAcsF;IAAA,iDAbpF,CACR,CAAC,GAAD,EAAM,SAAN,EAAiB,+DAAjB,CADQ,EAER,CAAC,GAAD,EAAM,MAAN,EAAc,qCAAd,CAFQ,EAGR,CAAC,GAAD,EAAM,4BAAN,EAAoC,mBAApC,CAHQ,EAIR,CAAC,EAAD,EAAK,QAAL,EAAe,mBAAf,CAJQ,EAKR,CAAC,EAAD,EAAK,YAAL,EAAmB,gCAAnB,CALQ,CAaoF;IAA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OAAO,EAAP;EAChB,OAAQ,OAAO,GAAEzG,gBAAA,CAAM0G,MAAN,CAAa,kBAAb,CAAiC,SAAQD,SAAS,CAAC5F,EAAG,MACrE4F,SAAS,CAACD,IAAV,IACC,iCAAgCC,SAAS,CAAC5F,EAAV,CAAaT,IAAK,8DACpD,EAAE,IAHH;AAID;;AAED,SAASqB,gBAAT,CAA0BkF,UAA1B,EAAyE;EACvE,IAAI,CAACA,UAAL,EAAiB,OAAO,EAAP;EACjB,OAAQ,qBAAoBA,UAAW,GAAvC;AACD"}
@@ -7,7 +7,7 @@ import { LaneData } from '@teambit/legacy/dist/scope/lanes/lanes';
7
7
  import { LaneId } from '@teambit/lane-id';
8
8
  import { Logger, LoggerMain } from '@teambit/logger';
9
9
  import { DiffOptions } from '@teambit/legacy/dist/consumer/component-ops/components-diff';
10
- import { MergeStrategy, ApplyVersionResults } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';
10
+ import { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';
11
11
  import { TrackLane } from '@teambit/legacy/dist/scope/scope-json';
12
12
  import type { CommunityMain } from '@teambit/community';
13
13
  import { Component, ComponentMain } from '@teambit/component';
@@ -18,19 +18,6 @@ export declare type LaneResults = {
18
18
  lanes: LaneData[];
19
19
  currentLane?: string | null;
20
20
  };
21
- export declare type MergeLaneOptions = {
22
- mergeStrategy: MergeStrategy;
23
- noSnap: boolean;
24
- snapMessage: string;
25
- existingOnWorkspaceOnly: boolean;
26
- build: boolean;
27
- keepReadme: boolean;
28
- squash: boolean;
29
- pattern?: string;
30
- includeDeps?: boolean;
31
- skipDependencyInstallation?: boolean;
32
- remote?: boolean;
33
- };
34
21
  export declare type CreateLaneOptions = {
35
22
  remoteScope?: string;
36
23
  alias?: string;
@@ -92,17 +79,13 @@ export declare class LanesMain {
92
79
  remote: boolean;
93
80
  force: boolean;
94
81
  }): Promise<string[]>;
95
- mergeLane(laneName: string, options: MergeLaneOptions): Promise<{
96
- mergeResults: ApplyVersionResults;
97
- deleteResults: any;
98
- }>;
99
82
  /**
100
83
  * switch to a different local or remote lane.
101
84
  * switching to a remote lane also imports and writes the components of that remote lane.
102
85
  * by default, only the components existing on the workspace will be imported from that lane, unless the "getAll"
103
86
  * flag is true.
104
87
  */
105
- switchLanes(laneName: string, { alias, merge, getAll, skipDependencyInstallation }: SwitchLaneOptions): Promise<ApplyVersionResults>;
88
+ switchLanes(laneName: string, { alias, merge, getAll, skipDependencyInstallation }: SwitchLaneOptions): Promise<import("@teambit/legacy/dist/consumer/versions-ops/merge-version").ApplyVersionResults>;
106
89
  /**
107
90
  * the values array may include zero to two values and will be processed as following:
108
91
  * [] => diff between the current lane and default lane. (only inside workspace).
@@ -259,16 +259,6 @@ function _switch() {
259
259
  return data;
260
260
  }
261
261
 
262
- function _mergeLanes() {
263
- const data = require("./merge-lanes");
264
-
265
- _mergeLanes = function () {
266
- return data;
267
- };
268
-
269
- return data;
270
- }
271
-
272
262
  function _switchLanes() {
273
263
  const data = require("./switch-lanes");
274
264
 
@@ -617,21 +607,6 @@ class LanesMain {
617
607
  if (this.workspace) await this.workspace.consumer.onDestroy();
618
608
  return results.laneResults;
619
609
  }
620
-
621
- async mergeLane(laneName, options) {
622
- if (!this.workspace) {
623
- throw new (_bitError().BitError)(`unable to merge a lane outside of Bit workspace`);
624
- }
625
-
626
- const results = await (0, _mergeLanes().mergeLanes)(_objectSpread({
627
- merging: this.merging,
628
- workspace: this.workspace,
629
- lanesMain: this,
630
- laneName
631
- }, options));
632
- await this.workspace.consumer.onDestroy();
633
- return results;
634
- }
635
610
  /**
636
611
  * switch to a different local or remote lane.
637
612
  * switching to a remote lane also imports and writes the components of that remote lane.
@@ -836,7 +811,7 @@ class LanesMain {
836
811
  const lanesMain = new LanesMain(workspace, scope, merging, component, logger);
837
812
  const switchCmd = new (_switch().SwitchCmd)(lanesMain);
838
813
  const laneCmd = new (_lane().LaneCmd)(lanesMain, workspace, scope, community.getDocsDomain());
839
- laneCmd.commands = [new (_lane().LaneListCmd)(lanesMain, workspace, scope), switchCmd, new (_lane().LaneShowCmd)(lanesMain, workspace, scope), new (_lane().LaneCreateCmd)(lanesMain), new (_lane().LaneMergeCmd)(lanesMain), new (_lane().LaneRemoveCmd)(lanesMain), new (_lane().LaneChangeScopeCmd)(lanesMain), new (_lane().LaneAliasCmd)(lanesMain), new (_lane().LaneRenameCmd)(lanesMain), new (_lanesModules().LaneDiffCmd)(workspace, scope), new (_lane().LaneAddReadmeCmd)(lanesMain), new (_lane().LaneRemoveReadmeCmd)(lanesMain), new (_lane().LaneImportCmd)(switchCmd)];
814
+ laneCmd.commands = [new (_lane().LaneListCmd)(lanesMain, workspace, scope), switchCmd, new (_lane().LaneShowCmd)(lanesMain, workspace, scope), new (_lane().LaneCreateCmd)(lanesMain), new (_lane().LaneRemoveCmd)(lanesMain), new (_lane().LaneChangeScopeCmd)(lanesMain), new (_lane().LaneAliasCmd)(lanesMain), new (_lane().LaneRenameCmd)(lanesMain), new (_lanesModules().LaneDiffCmd)(workspace, scope), new (_lane().LaneAddReadmeCmd)(lanesMain), new (_lane().LaneRemoveReadmeCmd)(lanesMain), new (_lane().LaneImportCmd)(switchCmd)];
840
815
  cli.register(laneCmd, switchCmd);
841
816
  graphql.register((0, _lanes2().lanesSchema)(lanesMain));
842
817
  return lanesMain;
@@ -1 +1 @@
1
- {"version":3,"names":["LanesMain","constructor","workspace","scope","merging","componentAspect","logger","getLanes","name","remote","merged","showDefaultLane","notMerged","showMergeData","Boolean","consumer","remoteObj","getRemoteByName","lanes","listLanes","DEFAULT_LANE","defaultLane","getLaneDataOfDefaultLane","legacyScope","getLanesData","push","getCurrentLaneName","getCurrentLaneId","getCurrentLaneNameOrAlias","currentLaneId","trackingData","getLocalTrackedLaneByRemoteName","getDefaultLaneId","LaneId","from","setCurrentLane","laneId","alias","exported","createLane","remoteScope","BitError","throwForInvalidLaneName","defaultScope","trackLaneData","localLane","remoteLane","trackLane","scopeJson","setLaneAsNew","onDestroy","localName","remoteName","parseLaneIdFromString","lane","loadLane","beforeTrackData","getRemoteTrackedDataByLocalLane","beforeTrackDataCloned","undefined","afterTrackData","aliasLane","laneName","includes","LANE_REMOTE_DELIMITER","trackData","laneNameWithoutScope","split","removeTrackLane","changeScope","remoteScopeBefore","newLaneId","saveLane","bitMap","rename","currentName","newName","existingAliasWithNewName","remoteIdStr","objects","remoteLanes","renameRefByNewLaneName","currentLaneName","isExported","isLaneExported","clonedLaneToExport","clone","components","exportErr","exportLane","err","error","id","toString","message","exportMany","laneObject","ids","BitIds","idsWithFutureScope","allVersions","importLaneObject","scopeComponentImporter","ScopeComponentsImporter","getInstance","results","importLanes","fetchLaneWithItsComponents","debug","Error","importOptions","objectsOnly","verbose","writeConfig","override","installNpmPackages","laneIds","importComponents","ImportComponents","dependencies","length","removeLanes","laneNames","force","laneResults","mergeLane","options","mergeLanes","lanesMain","switchLanes","merge","getAll","skipDependencyInstallation","mergeStrategy","mergeOptions","Object","keys","MergeOptions","join","switchProps","existingOnWorkspaceOnly","checkoutProps","skipNpmInstall","ignorePackageJson","ignoreDist","isLane","promptMergeOptions","reset","all","LaneSwitcher","switch","getDiff","values","diffOptions","pattern","laneDiffGenerator","LaneDiffGenerator","generate","getLaneComponentModels","laneComponents","host","getHost","laneComponentIds","Promise","map","laneComponent","legacyIdWithVersion","changeVersion","head","resolveComponentId","getMany","getLaneReadmeComponent","laneReadmeComponent","readmeComponent","laneReadmeComponentId","get","removeLaneReadme","result","readmeComponentId","existingLaneConfig","getSpecificComponentConfig","LanesAspect","remoteLaneIdStr","toLaneId","readme","removeSpecificComponentConfig","addSpecificComponentConfig","setReadmeComponent","write","addLaneReadme","readmeComponentIdStr","readmeComponentBitId","_legacy","bitIds","scopeComponents","list","filter","component","getIdsOfDefaultLane","bitId","version","isMerged","provider","cli","graphql","community","loggerMain","createLogger","switchCmd","SwitchCmd","laneCmd","LaneCmd","getDocsDomain","commands","LaneListCmd","LaneShowCmd","LaneCreateCmd","LaneMergeCmd","LaneRemoveCmd","LaneChangeScopeCmd","LaneAliasCmd","LaneRenameCmd","LaneDiffCmd","LaneAddReadmeCmd","LaneRemoveReadmeCmd","LaneImportCmd","register","lanesSchema","CLIAspect","ScopeAspect","WorkspaceAspect","GraphqlAspect","CommunityAspect","MergingAspect","ComponentAspect","LoggerAspect","MainRuntime","addRuntime"],"sources":["lanes.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ScopeMain, ScopeAspect } from '@teambit/scope';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport getRemoteByName from '@teambit/legacy/dist/remotes/get-remote-by-name';\nimport { LaneDiffCmd, LaneDiffGenerator, LaneDiffResults } from '@teambit/lanes.modules.diff';\nimport { LaneData } from '@teambit/legacy/dist/scope/lanes/lanes';\nimport { LaneId, DEFAULT_LANE, LANE_REMOTE_DELIMITER } from '@teambit/lane-id';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { DiffOptions } from '@teambit/legacy/dist/consumer/component-ops/components-diff';\nimport ImportComponents, { ImportOptions } from '@teambit/legacy/dist/consumer/component-ops/import-components';\nimport { exportMany } from '@teambit/legacy/dist/scope/component-ops/export-scope-components';\nimport {\n MergeStrategy,\n ApplyVersionResults,\n MergeOptions,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { TrackLane } from '@teambit/legacy/dist/scope/scope-json';\nimport { CommunityAspect } from '@teambit/community';\nimport type { CommunityMain } from '@teambit/community';\nimport ComponentAspect, { Component, ComponentMain } from '@teambit/component';\nimport removeLanes from '@teambit/legacy/dist/consumer/lanes/remove-lanes';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport { Scope as LegacyScope } from '@teambit/legacy/dist/scope';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { MergingMain, MergingAspect } from '@teambit/merging';\nimport { LanesAspect } from './lanes.aspect';\nimport {\n LaneCmd,\n LaneCreateCmd,\n LaneImportCmd,\n LaneListCmd,\n LaneMergeCmd,\n LaneRemoveCmd,\n LaneShowCmd,\n LaneChangeScopeCmd,\n LaneAliasCmd,\n LaneRenameCmd,\n LaneAddReadmeCmd,\n LaneRemoveReadmeCmd,\n} from './lane.cmd';\nimport { lanesSchema } from './lanes.graphql';\nimport { SwitchCmd } from './switch.cmd';\nimport { mergeLanes } from './merge-lanes';\nimport { LaneSwitcher } from './switch-lanes';\nimport { createLane, throwForInvalidLaneName } from './create-lane';\n\nexport { Lane };\n\nexport type LaneResults = {\n lanes: LaneData[];\n currentLane?: string | null;\n};\n\nexport type MergeLaneOptions = {\n mergeStrategy: MergeStrategy;\n noSnap: boolean;\n snapMessage: string;\n existingOnWorkspaceOnly: boolean;\n build: boolean;\n keepReadme: boolean;\n squash: boolean;\n pattern?: string;\n includeDeps?: boolean;\n skipDependencyInstallation?: boolean;\n remote?: boolean;\n};\n\nexport type CreateLaneOptions = {\n remoteScope?: string; // default to the defaultScope in workspace.jsonc\n alias?: string; // default to the remote name\n};\n\nexport type SwitchLaneOptions = {\n alias?: string;\n merge?: MergeStrategy;\n getAll?: boolean;\n skipDependencyInstallation?: boolean;\n verbose?: boolean;\n override?: boolean;\n};\n\nexport class LanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private scope: ScopeMain,\n private merging: MergingMain,\n private componentAspect: ComponentMain,\n public logger: Logger\n ) {}\n\n async getLanes({\n name,\n remote,\n merged,\n showDefaultLane,\n notMerged,\n }: {\n name?: string;\n remote?: string;\n merged?: boolean;\n showDefaultLane?: boolean;\n notMerged?: boolean;\n }): Promise<LaneData[]> {\n const showMergeData = Boolean(merged || notMerged);\n const consumer = this.workspace?.consumer;\n if (remote) {\n const remoteObj = await getRemoteByName(remote, consumer);\n const lanes = await remoteObj.listLanes(name, showMergeData);\n return lanes;\n }\n\n if (name === DEFAULT_LANE) {\n const defaultLane = await this.getLaneDataOfDefaultLane();\n return defaultLane ? [defaultLane] : [];\n }\n\n const lanes = await this.scope.legacyScope.lanes.getLanesData(this.scope.legacyScope, name, showMergeData);\n\n if (showDefaultLane) {\n const defaultLane = await this.getLaneDataOfDefaultLane();\n if (defaultLane) lanes.push(defaultLane);\n }\n\n return lanes;\n }\n\n getCurrentLaneName(): string | null {\n return this.getCurrentLaneId()?.name || null;\n }\n\n getCurrentLaneNameOrAlias(): string | null {\n const currentLaneId = this.getCurrentLaneId();\n if (!currentLaneId) return null;\n const trackingData = this.scope.legacyScope.lanes.getLocalTrackedLaneByRemoteName(\n currentLaneId.name,\n currentLaneId.scope\n );\n return trackingData || currentLaneId.name;\n }\n\n getCurrentLaneId(): LaneId | null {\n if (!this.workspace) return null;\n return this.workspace.consumer.getCurrentLaneId();\n }\n\n getDefaultLaneId(): LaneId {\n return LaneId.from(DEFAULT_LANE, this.scope.name);\n }\n\n setCurrentLane(laneId: LaneId, alias?: string, exported?: boolean) {\n this.workspace?.consumer.setCurrentLane(laneId, exported);\n }\n\n async createLane(name: string, { remoteScope, alias }: CreateLaneOptions = {}): Promise<TrackLane> {\n if (!this.workspace) {\n throw new BitError(`unable to create a lane outside of Bit workspace`);\n }\n if (alias) {\n throwForInvalidLaneName(alias);\n }\n const scope = remoteScope || this.workspace.defaultScope;\n await createLane(this.workspace.consumer, name, scope);\n const laneId = LaneId.from(name, scope);\n this.setCurrentLane(laneId, alias, false);\n const trackLaneData = {\n localLane: alias || name,\n remoteLane: name,\n remoteScope: scope,\n };\n this.scope.legacyScope.lanes.trackLane(trackLaneData);\n this.scope.legacyScope.scopeJson.setLaneAsNew(name);\n await this.workspace.consumer.onDestroy();\n\n return trackLaneData;\n }\n\n async trackLane(\n localName: string,\n remoteScope: string,\n remoteName?: string\n ): Promise<{ beforeTrackData?: TrackLane; afterTrackData: TrackLane }> {\n if (!this.workspace) {\n throw new BitError(`unable to track a lane outside of Bit workspace`);\n }\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(localName);\n const lane = await this.scope.legacyScope.lanes.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${localName}\"`);\n }\n const beforeTrackData = this.scope.legacyScope.lanes.getRemoteTrackedDataByLocalLane(localName);\n const beforeTrackDataCloned = beforeTrackData ? { ...beforeTrackData } : undefined;\n const afterTrackData = {\n localLane: localName,\n remoteLane: remoteName || beforeTrackData?.remoteLane || localName,\n remoteScope,\n };\n this.scope.legacyScope.lanes.trackLane(afterTrackData);\n await this.workspace.consumer.onDestroy();\n\n return { beforeTrackData: beforeTrackDataCloned, afterTrackData };\n }\n\n async aliasLane(laneName: string, alias: string): Promise<{ laneId: LaneId }> {\n if (!this.workspace) {\n throw new BitError(`unable to alias a lane outside of Bit workspace`);\n }\n if (alias.includes(LANE_REMOTE_DELIMITER)) {\n throw new BitError(`an alias cannot include a delimiter \"${LANE_REMOTE_DELIMITER}\"`);\n }\n if (alias === laneName) {\n throw new BitError(`an alias cannot be the same as the lane name`);\n }\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(laneName);\n const lane = await this.scope.legacyScope.lanes.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${laneName}\"`);\n }\n const trackData = {\n localLane: alias,\n remoteLane: laneId.name,\n remoteScope: laneId.scope,\n };\n const laneNameWithoutScope = laneName.includes(LANE_REMOTE_DELIMITER)\n ? laneName.split(LANE_REMOTE_DELIMITER)[1]\n : laneName;\n this.scope.legacyScope.lanes.removeTrackLane(laneNameWithoutScope);\n this.scope.legacyScope.lanes.trackLane(trackData);\n await this.workspace.consumer.onDestroy();\n\n return { laneId };\n }\n\n async changeScope(laneName: string, remoteScope: string): Promise<{ remoteScopeBefore: string }> {\n if (!this.workspace) {\n throw new BitError(`unable to change-scope of a lane outside of Bit workspace`);\n }\n const laneNameWithoutScope = laneName.includes(LANE_REMOTE_DELIMITER)\n ? laneName.split(LANE_REMOTE_DELIMITER)[1]\n : laneName;\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(laneName);\n const lane = await this.scope.legacyScope.lanes.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${laneName}\"`);\n }\n const remoteScopeBefore = lane.scope;\n lane.scope = remoteScope;\n const newLaneId = LaneId.from(laneId.name, remoteScope);\n const trackData = {\n localLane: laneNameWithoutScope,\n remoteLane: laneId.name,\n remoteScope,\n };\n this.scope.legacyScope.lanes.trackLane(trackData);\n await this.scope.legacyScope.lanes.saveLane(lane);\n this.workspace.consumer.bitMap.setCurrentLane(newLaneId);\n await this.workspace.consumer.onDestroy();\n\n return { remoteScopeBefore };\n }\n\n /**\n * change a lane-name and if possible, export the lane to the remote\n */\n async rename(currentName: string, newName: string): Promise<{ exported: boolean; exportErr?: Error }> {\n if (!this.workspace) {\n throw new BitError(`unable to rename a lane outside of Bit workspace`);\n }\n throwForInvalidLaneName(newName);\n const existingAliasWithNewName = this.scope.legacyScope.lanes.getRemoteTrackedDataByLocalLane(newName);\n if (existingAliasWithNewName) {\n const remoteIdStr = `${existingAliasWithNewName.remoteLane}/${existingAliasWithNewName.remoteScope}`;\n throw new BitError(`unable to rename to ${newName}. this name is already used to track: ${remoteIdStr}`);\n }\n const laneNameWithoutScope = currentName.includes(LANE_REMOTE_DELIMITER)\n ? currentName.split(LANE_REMOTE_DELIMITER)[1]\n : currentName;\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(currentName);\n const lane = await this.scope.legacyScope.lanes.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${currentName}\"`);\n }\n\n // rename the ref file\n await this.scope.legacyScope.objects.remoteLanes.renameRefByNewLaneName(laneNameWithoutScope, newName, lane.scope);\n\n // change tracking data\n const afterTrackData = {\n localLane: newName,\n remoteLane: newName,\n remoteScope: lane.scope,\n };\n this.scope.legacyScope.lanes.trackLane(afterTrackData);\n this.scope.legacyScope.lanes.removeTrackLane(laneNameWithoutScope);\n\n // change the lane object\n lane.name = newName;\n await this.scope.legacyScope.lanes.saveLane(lane);\n\n // change current-lane if needed\n const currentLaneName = this.getCurrentLaneName();\n if (currentLaneName === laneNameWithoutScope) {\n const newLaneId = LaneId.from(newName, lane.scope);\n const isExported = this.workspace.consumer.bitMap.isLaneExported;\n this.setCurrentLane(newLaneId, undefined, isExported);\n }\n\n // export the lane with only the name-change\n const clonedLaneToExport = lane.clone();\n clonedLaneToExport.components = []; // otherwise, it'll export the changes done on the components.\n let exported = false;\n let exportErr: Error | undefined;\n try {\n await this.exportLane(clonedLaneToExport);\n exported = true;\n } catch (err: any) {\n this.logger.error(`unable to export ${lane.id.toString()}: ${err.message}`);\n exportErr = err;\n }\n\n await this.workspace.consumer.onDestroy();\n\n return { exported, exportErr };\n }\n\n async exportLane(lane: Lane) {\n await exportMany({\n scope: this.scope.legacyScope,\n laneObject: lane,\n ids: new BitIds(),\n idsWithFutureScope: new BitIds(),\n allVersions: false,\n });\n }\n\n async importLaneObject(laneId: LaneId): Promise<Lane> {\n const scopeComponentImporter = ScopeComponentsImporter.getInstance(this.scope.legacyScope);\n const results = await scopeComponentImporter.importLanes([laneId]);\n return results[0];\n }\n\n /**\n * fetch the lane object and its components from the remote.\n * save the objects to the local scope.\n * this method doesn't change anything in the workspace.\n */\n async fetchLaneWithItsComponents(laneId: LaneId): Promise<Lane> {\n this.logger.debug(`fetching lane ${laneId.toString()}`);\n if (!this.workspace) {\n throw new BitError('unable to fetch lanes outside of Bit workspace');\n }\n const lane = await this.importLaneObject(laneId);\n if (!lane) throw new Error(`unable to import lane ${laneId.toString()} from the remote`);\n const importOptions: ImportOptions = {\n ids: [],\n objectsOnly: true,\n verbose: false,\n writeConfig: false,\n override: false,\n installNpmPackages: false,\n lanes: { laneIds: [laneId], lanes: [lane] },\n };\n const importComponents = new ImportComponents(this.workspace.consumer, importOptions);\n const { dependencies } = await importComponents.importComponents();\n this.logger.debug(`fetching lane ${laneId.toString()} done, fetched ${dependencies.length} components`);\n return lane;\n }\n\n async removeLanes(laneNames: string[], { remote, force }: { remote: boolean; force: boolean }): Promise<string[]> {\n const results = await removeLanes(this.workspace?.consumer, laneNames, remote, force);\n if (this.workspace) await this.workspace.consumer.onDestroy();\n\n return results.laneResults;\n }\n\n async mergeLane(\n laneName: string,\n options: MergeLaneOptions\n ): Promise<{ mergeResults: ApplyVersionResults; deleteResults: any }> {\n if (!this.workspace) {\n throw new BitError(`unable to merge a lane outside of Bit workspace`);\n }\n const results = await mergeLanes({\n merging: this.merging,\n workspace: this.workspace,\n lanesMain: this,\n laneName,\n ...options,\n });\n\n await this.workspace.consumer.onDestroy();\n return results;\n }\n\n /**\n * switch to a different local or remote lane.\n * switching to a remote lane also imports and writes the components of that remote lane.\n * by default, only the components existing on the workspace will be imported from that lane, unless the \"getAll\"\n * flag is true.\n */\n async switchLanes(\n laneName: string,\n { alias, merge, getAll = false, skipDependencyInstallation = false }: SwitchLaneOptions\n ) {\n if (!this.workspace) {\n throw new BitError(`unable to switch lanes outside of Bit workspace`);\n }\n let mergeStrategy;\n if (merge && typeof merge === 'string') {\n const mergeOptions = Object.keys(MergeOptions);\n if (!mergeOptions.includes(merge)) {\n throw new BitError(`merge must be one of the following: ${mergeOptions.join(', ')}`);\n }\n mergeStrategy = merge;\n }\n if (alias) {\n throwForInvalidLaneName(alias);\n }\n\n const switchProps = {\n laneName,\n existingOnWorkspaceOnly: !getAll,\n alias,\n };\n const checkoutProps = {\n mergeStrategy,\n skipNpmInstall: skipDependencyInstallation,\n verbose: false, // not relevant in Harmony\n ignorePackageJson: true, // not relevant in Harmony\n ignoreDist: true, // not relevant in Harmony\n isLane: true,\n promptMergeOptions: false,\n writeConfig: false,\n reset: false,\n all: false,\n };\n return new LaneSwitcher(this.workspace, this.logger, switchProps, checkoutProps).switch();\n }\n\n /**\n * the values array may include zero to two values and will be processed as following:\n * [] => diff between the current lane and default lane. (only inside workspace).\n * [to] => diff between the current lane (or default-lane when in scope) and \"to\" lane.\n * [from, to] => diff between \"from\" lane and \"to\" lane.\n */\n public async getDiff(values: string[], diffOptions: DiffOptions = {}, pattern?: string): Promise<LaneDiffResults> {\n const laneDiffGenerator = new LaneDiffGenerator(this.workspace, this.scope);\n return laneDiffGenerator.generate(values, diffOptions, pattern);\n }\n\n async getLaneComponentModels(lane: LaneData): Promise<Component[]> {\n if (!lane) return [];\n\n const laneComponents = lane.components;\n const host = this.componentAspect.getHost();\n const laneComponentIds = await Promise.all(\n laneComponents.map((laneComponent) => {\n const legacyIdWithVersion = laneComponent.id.changeVersion(laneComponent.head);\n return host.resolveComponentId(legacyIdWithVersion);\n })\n );\n const components = await host.getMany(laneComponentIds);\n return components;\n }\n\n async getLaneReadmeComponent(lane: LaneData): Promise<Component | undefined> {\n if (!lane) return undefined;\n const laneReadmeComponent = lane.readmeComponent;\n if (!laneReadmeComponent) return undefined;\n const host = this.componentAspect.getHost();\n const laneReadmeComponentId = await host.resolveComponentId(\n laneReadmeComponent.id.changeVersion(laneReadmeComponent.head)\n );\n const readmeComponent = await host.get(laneReadmeComponentId);\n return readmeComponent;\n }\n\n async removeLaneReadme(laneName?: string): Promise<{ result: boolean; message?: string }> {\n if (!this.workspace) {\n throw new BitError('unable to remove the lane readme component outside of Bit workspace');\n }\n const currentLaneName = this.getCurrentLaneName();\n\n if (!laneName && !currentLaneName) {\n return {\n result: false,\n message: 'unable to remove the lane readme component. Either pass a laneName or switch to a lane',\n };\n }\n\n const scope: LegacyScope = this.workspace.scope.legacyScope;\n const laneId: LaneId = laneName\n ? await scope.lanes.parseLaneIdFromString(laneName)\n : (this.getCurrentLaneId() as LaneId);\n const lane: Lane | null | undefined = await scope.loadLane(laneId);\n\n if (!lane?.readmeComponent) {\n throw new BitError(`there is no readme component added to the lane ${laneName || currentLaneName}`);\n }\n\n const readmeComponentId = await this.workspace.resolveComponentId(lane.readmeComponent.id);\n const existingLaneConfig =\n (await this.workspace.getSpecificComponentConfig(readmeComponentId, LanesAspect.id)) || {};\n\n const remoteLaneIdStr = lane.toLaneId().toString();\n\n if (existingLaneConfig.readme) {\n delete existingLaneConfig.readme[remoteLaneIdStr];\n await this.workspace.removeSpecificComponentConfig(readmeComponentId, LanesAspect.id, false);\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, existingLaneConfig);\n }\n\n lane.setReadmeComponent(undefined);\n await scope.lanes.saveLane(lane);\n await this.workspace.bitMap.write();\n\n return { result: true };\n }\n\n async addLaneReadme(readmeComponentIdStr: string, laneName?: string): Promise<{ result: boolean; message?: string }> {\n if (!this.workspace) {\n throw new BitError(`unable to track a lane readme component outside of Bit workspace`);\n }\n const readmeComponentId = await this.workspace.resolveComponentId(readmeComponentIdStr);\n\n const readmeComponentBitId = readmeComponentId._legacy;\n const scope: LegacyScope = this.workspace.scope.legacyScope;\n const laneId: LaneId = laneName\n ? await scope.lanes.parseLaneIdFromString(laneName)\n : (this.getCurrentLaneId() as LaneId);\n\n const lane: Lane | null | undefined = await scope.loadLane(laneId);\n\n if (!lane) {\n return { result: false, message: `cannot find lane ${laneName}` };\n }\n\n lane.setReadmeComponent(readmeComponentBitId);\n await scope.lanes.saveLane(lane);\n\n const existingLaneConfig =\n (await this.workspace.getSpecificComponentConfig(readmeComponentId, LanesAspect.id)) || {};\n\n const remoteLaneIdStr = lane.toLaneId().toString();\n\n if (existingLaneConfig.readme) {\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, {\n ...existingLaneConfig,\n readme: {\n ...existingLaneConfig.readme,\n [remoteLaneIdStr]: true,\n },\n });\n } else {\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, {\n ...existingLaneConfig,\n readme: {\n [remoteLaneIdStr]: true,\n },\n });\n }\n await this.workspace.bitMap.write();\n return { result: true };\n }\n\n private async getLaneDataOfDefaultLane(): Promise<LaneData | null> {\n const consumer = this.workspace?.consumer;\n let bitIds: BitId[] = [];\n if (!consumer) {\n const scopeComponents = await this.scope.list();\n bitIds = scopeComponents.filter((component) => component.head).map((component) => component.id._legacy);\n } else {\n bitIds = await consumer.getIdsOfDefaultLane();\n }\n\n return {\n name: DEFAULT_LANE,\n remote: null,\n id: this.getDefaultLaneId(),\n components: bitIds.map((bitId) => ({ id: bitId, head: bitId.version as string })),\n isMerged: null,\n };\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n ScopeAspect,\n WorkspaceAspect,\n GraphqlAspect,\n CommunityAspect,\n MergingAspect,\n ComponentAspect,\n LoggerAspect,\n ];\n static runtime = MainRuntime;\n static async provider([cli, scope, workspace, graphql, community, merging, component, loggerMain]: [\n CLIMain,\n ScopeMain,\n Workspace,\n GraphqlMain,\n CommunityMain,\n MergingMain,\n ComponentMain,\n LoggerMain\n ]) {\n const logger = loggerMain.createLogger(LanesAspect.id);\n const lanesMain = new LanesMain(workspace, scope, merging, component, logger);\n const switchCmd = new SwitchCmd(lanesMain);\n const laneCmd = new LaneCmd(lanesMain, workspace, scope, community.getDocsDomain());\n laneCmd.commands = [\n new LaneListCmd(lanesMain, workspace, scope),\n switchCmd,\n new LaneShowCmd(lanesMain, workspace, scope),\n new LaneCreateCmd(lanesMain),\n new LaneMergeCmd(lanesMain),\n new LaneRemoveCmd(lanesMain),\n new LaneChangeScopeCmd(lanesMain),\n new LaneAliasCmd(lanesMain),\n new LaneRenameCmd(lanesMain),\n new LaneDiffCmd(workspace, scope),\n new LaneAddReadmeCmd(lanesMain),\n new LaneRemoveReadmeCmd(lanesMain),\n new LaneImportCmd(switchCmd),\n ];\n cli.register(laneCmd, switchCmd);\n graphql.register(lanesSchema(lanesMain));\n return lanesMain;\n }\n}\n\nLanesAspect.addRuntime(LanesMain);\n\nexport default LanesMain;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;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","showDefaultLane","notMerged","showMergeData","Boolean","consumer","remoteObj","getRemoteByName","lanes","listLanes","DEFAULT_LANE","defaultLane","getLaneDataOfDefaultLane","legacyScope","getLanesData","push","getCurrentLaneName","getCurrentLaneId","getCurrentLaneNameOrAlias","currentLaneId","trackingData","getLocalTrackedLaneByRemoteName","getDefaultLaneId","LaneId","from","setCurrentLane","laneId","alias","exported","createLane","remoteScope","BitError","throwForInvalidLaneName","defaultScope","trackLaneData","localLane","remoteLane","trackLane","scopeJson","setLaneAsNew","onDestroy","localName","remoteName","parseLaneIdFromString","lane","loadLane","beforeTrackData","getRemoteTrackedDataByLocalLane","beforeTrackDataCloned","undefined","afterTrackData","aliasLane","laneName","includes","LANE_REMOTE_DELIMITER","trackData","laneNameWithoutScope","split","removeTrackLane","changeScope","remoteScopeBefore","newLaneId","saveLane","bitMap","rename","currentName","newName","existingAliasWithNewName","remoteIdStr","objects","remoteLanes","renameRefByNewLaneName","currentLaneName","isExported","isLaneExported","clonedLaneToExport","clone","components","exportErr","exportLane","err","error","id","toString","message","exportMany","laneObject","ids","BitIds","idsWithFutureScope","allVersions","importLaneObject","scopeComponentImporter","ScopeComponentsImporter","getInstance","results","importLanes","fetchLaneWithItsComponents","debug","Error","importOptions","objectsOnly","verbose","writeConfig","override","installNpmPackages","laneIds","importComponents","ImportComponents","dependencies","length","removeLanes","laneNames","force","laneResults","switchLanes","merge","getAll","skipDependencyInstallation","mergeStrategy","mergeOptions","Object","keys","MergeOptions","join","switchProps","existingOnWorkspaceOnly","checkoutProps","skipNpmInstall","ignorePackageJson","ignoreDist","isLane","promptMergeOptions","reset","all","LaneSwitcher","switch","getDiff","values","diffOptions","pattern","laneDiffGenerator","LaneDiffGenerator","generate","getLaneComponentModels","laneComponents","host","getHost","laneComponentIds","Promise","map","laneComponent","legacyIdWithVersion","changeVersion","head","resolveComponentId","getMany","getLaneReadmeComponent","laneReadmeComponent","readmeComponent","laneReadmeComponentId","get","removeLaneReadme","result","readmeComponentId","existingLaneConfig","getSpecificComponentConfig","LanesAspect","remoteLaneIdStr","toLaneId","readme","removeSpecificComponentConfig","addSpecificComponentConfig","setReadmeComponent","write","addLaneReadme","readmeComponentIdStr","readmeComponentBitId","_legacy","bitIds","scopeComponents","list","filter","component","getIdsOfDefaultLane","bitId","version","isMerged","provider","cli","graphql","community","loggerMain","createLogger","lanesMain","switchCmd","SwitchCmd","laneCmd","LaneCmd","getDocsDomain","commands","LaneListCmd","LaneShowCmd","LaneCreateCmd","LaneRemoveCmd","LaneChangeScopeCmd","LaneAliasCmd","LaneRenameCmd","LaneDiffCmd","LaneAddReadmeCmd","LaneRemoveReadmeCmd","LaneImportCmd","register","lanesSchema","CLIAspect","ScopeAspect","WorkspaceAspect","GraphqlAspect","CommunityAspect","MergingAspect","ComponentAspect","LoggerAspect","MainRuntime","addRuntime"],"sources":["lanes.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ScopeMain, ScopeAspect } from '@teambit/scope';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport getRemoteByName from '@teambit/legacy/dist/remotes/get-remote-by-name';\nimport { LaneDiffCmd, LaneDiffGenerator, LaneDiffResults } from '@teambit/lanes.modules.diff';\nimport { LaneData } from '@teambit/legacy/dist/scope/lanes/lanes';\nimport { LaneId, DEFAULT_LANE, LANE_REMOTE_DELIMITER } from '@teambit/lane-id';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { DiffOptions } from '@teambit/legacy/dist/consumer/component-ops/components-diff';\nimport ImportComponents, { ImportOptions } from '@teambit/legacy/dist/consumer/component-ops/import-components';\nimport { exportMany } from '@teambit/legacy/dist/scope/component-ops/export-scope-components';\nimport { MergeStrategy, MergeOptions } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { TrackLane } from '@teambit/legacy/dist/scope/scope-json';\nimport { CommunityAspect } from '@teambit/community';\nimport type { CommunityMain } from '@teambit/community';\nimport ComponentAspect, { Component, ComponentMain } from '@teambit/component';\nimport removeLanes from '@teambit/legacy/dist/consumer/lanes/remove-lanes';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport { Scope as LegacyScope } from '@teambit/legacy/dist/scope';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { MergingMain, MergingAspect } from '@teambit/merging';\nimport { LanesAspect } from './lanes.aspect';\nimport {\n LaneCmd,\n LaneCreateCmd,\n LaneImportCmd,\n LaneListCmd,\n LaneRemoveCmd,\n LaneShowCmd,\n LaneChangeScopeCmd,\n LaneAliasCmd,\n LaneRenameCmd,\n LaneAddReadmeCmd,\n LaneRemoveReadmeCmd,\n} from './lane.cmd';\nimport { lanesSchema } from './lanes.graphql';\nimport { SwitchCmd } from './switch.cmd';\nimport { LaneSwitcher } from './switch-lanes';\nimport { createLane, throwForInvalidLaneName } from './create-lane';\n\nexport { Lane };\n\nexport type LaneResults = {\n lanes: LaneData[];\n currentLane?: string | null;\n};\n\nexport type CreateLaneOptions = {\n remoteScope?: string; // default to the defaultScope in workspace.jsonc\n alias?: string; // default to the remote name\n};\n\nexport type SwitchLaneOptions = {\n alias?: string;\n merge?: MergeStrategy;\n getAll?: boolean;\n skipDependencyInstallation?: boolean;\n verbose?: boolean;\n override?: boolean;\n};\n\nexport class LanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private scope: ScopeMain,\n private merging: MergingMain,\n private componentAspect: ComponentMain,\n public logger: Logger\n ) {}\n\n async getLanes({\n name,\n remote,\n merged,\n showDefaultLane,\n notMerged,\n }: {\n name?: string;\n remote?: string;\n merged?: boolean;\n showDefaultLane?: boolean;\n notMerged?: boolean;\n }): Promise<LaneData[]> {\n const showMergeData = Boolean(merged || notMerged);\n const consumer = this.workspace?.consumer;\n if (remote) {\n const remoteObj = await getRemoteByName(remote, consumer);\n const lanes = await remoteObj.listLanes(name, showMergeData);\n return lanes;\n }\n\n if (name === DEFAULT_LANE) {\n const defaultLane = await this.getLaneDataOfDefaultLane();\n return defaultLane ? [defaultLane] : [];\n }\n\n const lanes = await this.scope.legacyScope.lanes.getLanesData(this.scope.legacyScope, name, showMergeData);\n\n if (showDefaultLane) {\n const defaultLane = await this.getLaneDataOfDefaultLane();\n if (defaultLane) lanes.push(defaultLane);\n }\n\n return lanes;\n }\n\n getCurrentLaneName(): string | null {\n return this.getCurrentLaneId()?.name || null;\n }\n\n getCurrentLaneNameOrAlias(): string | null {\n const currentLaneId = this.getCurrentLaneId();\n if (!currentLaneId) return null;\n const trackingData = this.scope.legacyScope.lanes.getLocalTrackedLaneByRemoteName(\n currentLaneId.name,\n currentLaneId.scope\n );\n return trackingData || currentLaneId.name;\n }\n\n getCurrentLaneId(): LaneId | null {\n if (!this.workspace) return null;\n return this.workspace.consumer.getCurrentLaneId();\n }\n\n getDefaultLaneId(): LaneId {\n return LaneId.from(DEFAULT_LANE, this.scope.name);\n }\n\n setCurrentLane(laneId: LaneId, alias?: string, exported?: boolean) {\n this.workspace?.consumer.setCurrentLane(laneId, exported);\n }\n\n async createLane(name: string, { remoteScope, alias }: CreateLaneOptions = {}): Promise<TrackLane> {\n if (!this.workspace) {\n throw new BitError(`unable to create a lane outside of Bit workspace`);\n }\n if (alias) {\n throwForInvalidLaneName(alias);\n }\n const scope = remoteScope || this.workspace.defaultScope;\n await createLane(this.workspace.consumer, name, scope);\n const laneId = LaneId.from(name, scope);\n this.setCurrentLane(laneId, alias, false);\n const trackLaneData = {\n localLane: alias || name,\n remoteLane: name,\n remoteScope: scope,\n };\n this.scope.legacyScope.lanes.trackLane(trackLaneData);\n this.scope.legacyScope.scopeJson.setLaneAsNew(name);\n await this.workspace.consumer.onDestroy();\n\n return trackLaneData;\n }\n\n async trackLane(\n localName: string,\n remoteScope: string,\n remoteName?: string\n ): Promise<{ beforeTrackData?: TrackLane; afterTrackData: TrackLane }> {\n if (!this.workspace) {\n throw new BitError(`unable to track a lane outside of Bit workspace`);\n }\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(localName);\n const lane = await this.scope.legacyScope.lanes.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${localName}\"`);\n }\n const beforeTrackData = this.scope.legacyScope.lanes.getRemoteTrackedDataByLocalLane(localName);\n const beforeTrackDataCloned = beforeTrackData ? { ...beforeTrackData } : undefined;\n const afterTrackData = {\n localLane: localName,\n remoteLane: remoteName || beforeTrackData?.remoteLane || localName,\n remoteScope,\n };\n this.scope.legacyScope.lanes.trackLane(afterTrackData);\n await this.workspace.consumer.onDestroy();\n\n return { beforeTrackData: beforeTrackDataCloned, afterTrackData };\n }\n\n async aliasLane(laneName: string, alias: string): Promise<{ laneId: LaneId }> {\n if (!this.workspace) {\n throw new BitError(`unable to alias a lane outside of Bit workspace`);\n }\n if (alias.includes(LANE_REMOTE_DELIMITER)) {\n throw new BitError(`an alias cannot include a delimiter \"${LANE_REMOTE_DELIMITER}\"`);\n }\n if (alias === laneName) {\n throw new BitError(`an alias cannot be the same as the lane name`);\n }\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(laneName);\n const lane = await this.scope.legacyScope.lanes.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${laneName}\"`);\n }\n const trackData = {\n localLane: alias,\n remoteLane: laneId.name,\n remoteScope: laneId.scope,\n };\n const laneNameWithoutScope = laneName.includes(LANE_REMOTE_DELIMITER)\n ? laneName.split(LANE_REMOTE_DELIMITER)[1]\n : laneName;\n this.scope.legacyScope.lanes.removeTrackLane(laneNameWithoutScope);\n this.scope.legacyScope.lanes.trackLane(trackData);\n await this.workspace.consumer.onDestroy();\n\n return { laneId };\n }\n\n async changeScope(laneName: string, remoteScope: string): Promise<{ remoteScopeBefore: string }> {\n if (!this.workspace) {\n throw new BitError(`unable to change-scope of a lane outside of Bit workspace`);\n }\n const laneNameWithoutScope = laneName.includes(LANE_REMOTE_DELIMITER)\n ? laneName.split(LANE_REMOTE_DELIMITER)[1]\n : laneName;\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(laneName);\n const lane = await this.scope.legacyScope.lanes.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${laneName}\"`);\n }\n const remoteScopeBefore = lane.scope;\n lane.scope = remoteScope;\n const newLaneId = LaneId.from(laneId.name, remoteScope);\n const trackData = {\n localLane: laneNameWithoutScope,\n remoteLane: laneId.name,\n remoteScope,\n };\n this.scope.legacyScope.lanes.trackLane(trackData);\n await this.scope.legacyScope.lanes.saveLane(lane);\n this.workspace.consumer.bitMap.setCurrentLane(newLaneId);\n await this.workspace.consumer.onDestroy();\n\n return { remoteScopeBefore };\n }\n\n /**\n * change a lane-name and if possible, export the lane to the remote\n */\n async rename(currentName: string, newName: string): Promise<{ exported: boolean; exportErr?: Error }> {\n if (!this.workspace) {\n throw new BitError(`unable to rename a lane outside of Bit workspace`);\n }\n throwForInvalidLaneName(newName);\n const existingAliasWithNewName = this.scope.legacyScope.lanes.getRemoteTrackedDataByLocalLane(newName);\n if (existingAliasWithNewName) {\n const remoteIdStr = `${existingAliasWithNewName.remoteLane}/${existingAliasWithNewName.remoteScope}`;\n throw new BitError(`unable to rename to ${newName}. this name is already used to track: ${remoteIdStr}`);\n }\n const laneNameWithoutScope = currentName.includes(LANE_REMOTE_DELIMITER)\n ? currentName.split(LANE_REMOTE_DELIMITER)[1]\n : currentName;\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(currentName);\n const lane = await this.scope.legacyScope.lanes.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${currentName}\"`);\n }\n\n // rename the ref file\n await this.scope.legacyScope.objects.remoteLanes.renameRefByNewLaneName(laneNameWithoutScope, newName, lane.scope);\n\n // change tracking data\n const afterTrackData = {\n localLane: newName,\n remoteLane: newName,\n remoteScope: lane.scope,\n };\n this.scope.legacyScope.lanes.trackLane(afterTrackData);\n this.scope.legacyScope.lanes.removeTrackLane(laneNameWithoutScope);\n\n // change the lane object\n lane.name = newName;\n await this.scope.legacyScope.lanes.saveLane(lane);\n\n // change current-lane if needed\n const currentLaneName = this.getCurrentLaneName();\n if (currentLaneName === laneNameWithoutScope) {\n const newLaneId = LaneId.from(newName, lane.scope);\n const isExported = this.workspace.consumer.bitMap.isLaneExported;\n this.setCurrentLane(newLaneId, undefined, isExported);\n }\n\n // export the lane with only the name-change\n const clonedLaneToExport = lane.clone();\n clonedLaneToExport.components = []; // otherwise, it'll export the changes done on the components.\n let exported = false;\n let exportErr: Error | undefined;\n try {\n await this.exportLane(clonedLaneToExport);\n exported = true;\n } catch (err: any) {\n this.logger.error(`unable to export ${lane.id.toString()}: ${err.message}`);\n exportErr = err;\n }\n\n await this.workspace.consumer.onDestroy();\n\n return { exported, exportErr };\n }\n\n async exportLane(lane: Lane) {\n await exportMany({\n scope: this.scope.legacyScope,\n laneObject: lane,\n ids: new BitIds(),\n idsWithFutureScope: new BitIds(),\n allVersions: false,\n });\n }\n\n async importLaneObject(laneId: LaneId): Promise<Lane> {\n const scopeComponentImporter = ScopeComponentsImporter.getInstance(this.scope.legacyScope);\n const results = await scopeComponentImporter.importLanes([laneId]);\n return results[0];\n }\n\n /**\n * fetch the lane object and its components from the remote.\n * save the objects to the local scope.\n * this method doesn't change anything in the workspace.\n */\n async fetchLaneWithItsComponents(laneId: LaneId): Promise<Lane> {\n this.logger.debug(`fetching lane ${laneId.toString()}`);\n if (!this.workspace) {\n throw new BitError('unable to fetch lanes outside of Bit workspace');\n }\n const lane = await this.importLaneObject(laneId);\n if (!lane) throw new Error(`unable to import lane ${laneId.toString()} from the remote`);\n const importOptions: ImportOptions = {\n ids: [],\n objectsOnly: true,\n verbose: false,\n writeConfig: false,\n override: false,\n installNpmPackages: false,\n lanes: { laneIds: [laneId], lanes: [lane] },\n };\n const importComponents = new ImportComponents(this.workspace.consumer, importOptions);\n const { dependencies } = await importComponents.importComponents();\n this.logger.debug(`fetching lane ${laneId.toString()} done, fetched ${dependencies.length} components`);\n return lane;\n }\n\n async removeLanes(laneNames: string[], { remote, force }: { remote: boolean; force: boolean }): Promise<string[]> {\n const results = await removeLanes(this.workspace?.consumer, laneNames, remote, force);\n if (this.workspace) await this.workspace.consumer.onDestroy();\n\n return results.laneResults;\n }\n\n /**\n * switch to a different local or remote lane.\n * switching to a remote lane also imports and writes the components of that remote lane.\n * by default, only the components existing on the workspace will be imported from that lane, unless the \"getAll\"\n * flag is true.\n */\n async switchLanes(\n laneName: string,\n { alias, merge, getAll = false, skipDependencyInstallation = false }: SwitchLaneOptions\n ) {\n if (!this.workspace) {\n throw new BitError(`unable to switch lanes outside of Bit workspace`);\n }\n let mergeStrategy;\n if (merge && typeof merge === 'string') {\n const mergeOptions = Object.keys(MergeOptions);\n if (!mergeOptions.includes(merge)) {\n throw new BitError(`merge must be one of the following: ${mergeOptions.join(', ')}`);\n }\n mergeStrategy = merge;\n }\n if (alias) {\n throwForInvalidLaneName(alias);\n }\n\n const switchProps = {\n laneName,\n existingOnWorkspaceOnly: !getAll,\n alias,\n };\n const checkoutProps = {\n mergeStrategy,\n skipNpmInstall: skipDependencyInstallation,\n verbose: false, // not relevant in Harmony\n ignorePackageJson: true, // not relevant in Harmony\n ignoreDist: true, // not relevant in Harmony\n isLane: true,\n promptMergeOptions: false,\n writeConfig: false,\n reset: false,\n all: false,\n };\n return new LaneSwitcher(this.workspace, this.logger, switchProps, checkoutProps).switch();\n }\n\n /**\n * the values array may include zero to two values and will be processed as following:\n * [] => diff between the current lane and default lane. (only inside workspace).\n * [to] => diff between the current lane (or default-lane when in scope) and \"to\" lane.\n * [from, to] => diff between \"from\" lane and \"to\" lane.\n */\n public async getDiff(values: string[], diffOptions: DiffOptions = {}, pattern?: string): Promise<LaneDiffResults> {\n const laneDiffGenerator = new LaneDiffGenerator(this.workspace, this.scope);\n return laneDiffGenerator.generate(values, diffOptions, pattern);\n }\n\n async getLaneComponentModels(lane: LaneData): Promise<Component[]> {\n if (!lane) return [];\n\n const laneComponents = lane.components;\n const host = this.componentAspect.getHost();\n const laneComponentIds = await Promise.all(\n laneComponents.map((laneComponent) => {\n const legacyIdWithVersion = laneComponent.id.changeVersion(laneComponent.head);\n return host.resolveComponentId(legacyIdWithVersion);\n })\n );\n const components = await host.getMany(laneComponentIds);\n return components;\n }\n\n async getLaneReadmeComponent(lane: LaneData): Promise<Component | undefined> {\n if (!lane) return undefined;\n const laneReadmeComponent = lane.readmeComponent;\n if (!laneReadmeComponent) return undefined;\n const host = this.componentAspect.getHost();\n const laneReadmeComponentId = await host.resolveComponentId(\n laneReadmeComponent.id.changeVersion(laneReadmeComponent.head)\n );\n const readmeComponent = await host.get(laneReadmeComponentId);\n return readmeComponent;\n }\n\n async removeLaneReadme(laneName?: string): Promise<{ result: boolean; message?: string }> {\n if (!this.workspace) {\n throw new BitError('unable to remove the lane readme component outside of Bit workspace');\n }\n const currentLaneName = this.getCurrentLaneName();\n\n if (!laneName && !currentLaneName) {\n return {\n result: false,\n message: 'unable to remove the lane readme component. Either pass a laneName or switch to a lane',\n };\n }\n\n const scope: LegacyScope = this.workspace.scope.legacyScope;\n const laneId: LaneId = laneName\n ? await scope.lanes.parseLaneIdFromString(laneName)\n : (this.getCurrentLaneId() as LaneId);\n const lane: Lane | null | undefined = await scope.loadLane(laneId);\n\n if (!lane?.readmeComponent) {\n throw new BitError(`there is no readme component added to the lane ${laneName || currentLaneName}`);\n }\n\n const readmeComponentId = await this.workspace.resolveComponentId(lane.readmeComponent.id);\n const existingLaneConfig =\n (await this.workspace.getSpecificComponentConfig(readmeComponentId, LanesAspect.id)) || {};\n\n const remoteLaneIdStr = lane.toLaneId().toString();\n\n if (existingLaneConfig.readme) {\n delete existingLaneConfig.readme[remoteLaneIdStr];\n await this.workspace.removeSpecificComponentConfig(readmeComponentId, LanesAspect.id, false);\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, existingLaneConfig);\n }\n\n lane.setReadmeComponent(undefined);\n await scope.lanes.saveLane(lane);\n await this.workspace.bitMap.write();\n\n return { result: true };\n }\n\n async addLaneReadme(readmeComponentIdStr: string, laneName?: string): Promise<{ result: boolean; message?: string }> {\n if (!this.workspace) {\n throw new BitError(`unable to track a lane readme component outside of Bit workspace`);\n }\n const readmeComponentId = await this.workspace.resolveComponentId(readmeComponentIdStr);\n\n const readmeComponentBitId = readmeComponentId._legacy;\n const scope: LegacyScope = this.workspace.scope.legacyScope;\n const laneId: LaneId = laneName\n ? await scope.lanes.parseLaneIdFromString(laneName)\n : (this.getCurrentLaneId() as LaneId);\n\n const lane: Lane | null | undefined = await scope.loadLane(laneId);\n\n if (!lane) {\n return { result: false, message: `cannot find lane ${laneName}` };\n }\n\n lane.setReadmeComponent(readmeComponentBitId);\n await scope.lanes.saveLane(lane);\n\n const existingLaneConfig =\n (await this.workspace.getSpecificComponentConfig(readmeComponentId, LanesAspect.id)) || {};\n\n const remoteLaneIdStr = lane.toLaneId().toString();\n\n if (existingLaneConfig.readme) {\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, {\n ...existingLaneConfig,\n readme: {\n ...existingLaneConfig.readme,\n [remoteLaneIdStr]: true,\n },\n });\n } else {\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, {\n ...existingLaneConfig,\n readme: {\n [remoteLaneIdStr]: true,\n },\n });\n }\n await this.workspace.bitMap.write();\n return { result: true };\n }\n\n private async getLaneDataOfDefaultLane(): Promise<LaneData | null> {\n const consumer = this.workspace?.consumer;\n let bitIds: BitId[] = [];\n if (!consumer) {\n const scopeComponents = await this.scope.list();\n bitIds = scopeComponents.filter((component) => component.head).map((component) => component.id._legacy);\n } else {\n bitIds = await consumer.getIdsOfDefaultLane();\n }\n\n return {\n name: DEFAULT_LANE,\n remote: null,\n id: this.getDefaultLaneId(),\n components: bitIds.map((bitId) => ({ id: bitId, head: bitId.version as string })),\n isMerged: null,\n };\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n ScopeAspect,\n WorkspaceAspect,\n GraphqlAspect,\n CommunityAspect,\n MergingAspect,\n ComponentAspect,\n LoggerAspect,\n ];\n static runtime = MainRuntime;\n static async provider([cli, scope, workspace, graphql, community, merging, component, loggerMain]: [\n CLIMain,\n ScopeMain,\n Workspace,\n GraphqlMain,\n CommunityMain,\n MergingMain,\n ComponentMain,\n LoggerMain\n ]) {\n const logger = loggerMain.createLogger(LanesAspect.id);\n const lanesMain = new LanesMain(workspace, scope, merging, component, logger);\n const switchCmd = new SwitchCmd(lanesMain);\n const laneCmd = new LaneCmd(lanesMain, workspace, scope, community.getDocsDomain());\n laneCmd.commands = [\n new LaneListCmd(lanesMain, workspace, scope),\n switchCmd,\n new LaneShowCmd(lanesMain, workspace, scope),\n new LaneCreateCmd(lanesMain),\n new LaneRemoveCmd(lanesMain),\n new LaneChangeScopeCmd(lanesMain),\n new LaneAliasCmd(lanesMain),\n new LaneRenameCmd(lanesMain),\n new LaneDiffCmd(workspace, scope),\n new LaneAddReadmeCmd(lanesMain),\n new LaneRemoveReadmeCmd(lanesMain),\n new LaneImportCmd(switchCmd),\n ];\n cli.register(laneCmd, switchCmd);\n graphql.register(lanesSchema(lanesMain));\n return lanesMain;\n }\n}\n\nLanesAspect.addRuntime(LanesMain);\n\nexport default LanesMain;\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;;AACA;EAAA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B,CAZiB,CAAnB;IAcAN,GAAG,CAACuB,QAAJ,CAAaf,OAAb,EAAsBF,SAAtB;IACAL,OAAO,CAACsB,QAAR,CAAiB,IAAAC,qBAAA,EAAYnB,SAAZ,CAAjB;IACA,OAAOA,SAAP;EACD;;AA9gBoB;;;gCAAV5M,S,WAmeI,E;gCAneJA,S,kBAoeW,CACpBgO,gBADoB,EAEpBC,oBAFoB,EAGpBC,4BAHoB,EAIpBC,wBAJoB,EAKpBC,4BALoB,EAMpBC,wBANoB,EAOpBC,oBAPoB,EAQpBC,sBARoB,C;gCApeXvO,S,aA8eMwO,kB;;AAmCnBvD,oBAAA,CAAYwD,UAAZ,CAAuBzO,SAAvB;;eAEeA,S"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/lanes",
3
- "version": "0.0.395",
3
+ "version": "0.0.396",
4
4
  "homepage": "https://bit.dev/teambit/lanes/lanes",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.lanes",
8
8
  "name": "lanes",
9
- "version": "0.0.395"
9
+ "version": "0.0.396"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -18,30 +18,29 @@
18
18
  "core-js": "^3.0.0",
19
19
  "@teambit/harmony": "0.3.3",
20
20
  "@teambit/bit-error": "0.0.394",
21
- "@teambit/lane-id": "0.0.70",
22
- "@teambit/cli": "0.0.551",
23
- "@teambit/merging": "0.0.138",
24
- "@teambit/scope": "0.0.823",
25
- "@teambit/workspace": "0.0.823",
26
- "@teambit/graphql": "0.0.823",
27
- "@teambit/community": "0.0.99",
28
- "@teambit/component": "0.0.823",
29
- "@teambit/lanes.modules.diff": "0.0.180",
21
+ "@teambit/lane-id": "0.0.71",
22
+ "@teambit/cli": "0.0.552",
23
+ "@teambit/scope": "0.0.824",
24
+ "@teambit/workspace": "0.0.824",
25
+ "@teambit/graphql": "0.0.824",
26
+ "@teambit/community": "0.0.100",
27
+ "@teambit/component": "0.0.824",
28
+ "@teambit/lanes.modules.diff": "0.0.181",
30
29
  "@teambit/legacy-bit-id": "0.0.402",
31
- "@teambit/logger": "0.0.644",
30
+ "@teambit/logger": "0.0.645",
31
+ "@teambit/merging": "0.0.139",
32
32
  "@teambit/design.ui.pages.not-found": "0.0.357",
33
- "@teambit/lanes.hooks.use-lanes": "0.0.4",
34
- "@teambit/lanes.ui.drawer": "0.0.4",
35
- "@teambit/lanes.ui.gallery": "0.0.4",
36
- "@teambit/lanes.ui.menus": "0.0.4",
37
- "@teambit/lanes.ui.models": "0.0.4",
38
- "@teambit/lanes.ui.readme": "0.0.4",
39
- "@teambit/lanes.ui.viewed-lane": "0.0.4",
40
- "@teambit/sidebar": "0.0.823",
33
+ "@teambit/lanes.hooks.use-lanes": "0.0.5",
34
+ "@teambit/lanes.ui.drawer": "0.0.5",
35
+ "@teambit/lanes.ui.gallery": "0.0.5",
36
+ "@teambit/lanes.ui.menus": "0.0.5",
37
+ "@teambit/lanes.ui.models": "0.0.5",
38
+ "@teambit/lanes.ui.readme": "0.0.5",
39
+ "@teambit/lanes.ui.viewed-lane": "0.0.5",
40
+ "@teambit/sidebar": "0.0.824",
41
41
  "@teambit/ui-foundation.ui.menu": "0.0.487",
42
42
  "@teambit/ui-foundation.ui.react-router.slot-router": "0.0.490",
43
- "@teambit/ui": "0.0.823",
44
- "@teambit/component-id": "0.0.405"
43
+ "@teambit/ui": "0.0.824"
45
44
  },
46
45
  "devDependencies": {
47
46
  "@types/react": "^17.0.8",
@@ -57,7 +56,7 @@
57
56
  },
58
57
  "peerDependencies": {
59
58
  "react-router-dom": "^6.0.0",
60
- "@teambit/legacy": "1.0.334",
59
+ "@teambit/legacy": "1.0.335",
61
60
  "react-dom": "^16.8.0 || ^17.0.0",
62
61
  "react": "^16.8.0 || ^17.0.0"
63
62
  },
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.395/dist/lanes.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.395/dist/lanes.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.396/dist/lanes.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.396/dist/lanes.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -1,13 +0,0 @@
1
- import { ApplyVersionResults } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';
2
- import { Workspace } from '@teambit/workspace';
3
- import { MergingMain } from '@teambit/merging';
4
- import { LanesMain, MergeLaneOptions } from './lanes.main.runtime';
5
- export declare function mergeLanes({ lanesMain, merging, workspace, laneName, mergeStrategy, noSnap, snapMessage, existingOnWorkspaceOnly, build, keepReadme, squash, pattern, includeDeps, skipDependencyInstallation, remote, }: {
6
- lanesMain: LanesMain;
7
- merging: MergingMain;
8
- workspace: Workspace;
9
- laneName: string;
10
- } & MergeLaneOptions): Promise<{
11
- mergeResults: ApplyVersionResults;
12
- deleteResults: any;
13
- }>;
@@ -1,380 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- require("core-js/modules/es.array.iterator.js");
6
-
7
- require("core-js/modules/es.promise.js");
8
-
9
- Object.defineProperty(exports, "__esModule", {
10
- value: true
11
- });
12
- exports.mergeLanes = mergeLanes;
13
-
14
- function _chalk() {
15
- const data = _interopRequireDefault(require("chalk"));
16
-
17
- _chalk = function () {
18
- return data;
19
- };
20
-
21
- return data;
22
- }
23
-
24
- function _bitError() {
25
- const data = require("@teambit/bit-error");
26
-
27
- _bitError = function () {
28
- return data;
29
- };
30
-
31
- return data;
32
- }
33
-
34
- function _pMapSeries() {
35
- const data = _interopRequireDefault(require("p-map-series"));
36
-
37
- _pMapSeries = function () {
38
- return data;
39
- };
40
-
41
- return data;
42
- }
43
-
44
- function _bitId() {
45
- const data = require("@teambit/legacy/dist/bit-id");
46
-
47
- _bitId = function () {
48
- return data;
49
- };
50
-
51
- return data;
52
- }
53
-
54
- function _laneId() {
55
- const data = require("@teambit/lane-id");
56
-
57
- _laneId = function () {
58
- return data;
59
- };
60
-
61
- return data;
62
- }
63
-
64
- function _repositories() {
65
- const data = require("@teambit/legacy/dist/scope/repositories");
66
-
67
- _repositories = function () {
68
- return data;
69
- };
70
-
71
- return data;
72
- }
73
-
74
- function _consumer() {
75
- const data = require("@teambit/legacy/dist/api/consumer");
76
-
77
- _consumer = function () {
78
- return data;
79
- };
80
-
81
- return data;
82
- }
83
-
84
- async function mergeLanes({
85
- lanesMain,
86
- merging,
87
- workspace,
88
- laneName,
89
- mergeStrategy,
90
- noSnap,
91
- snapMessage,
92
- existingOnWorkspaceOnly,
93
- build,
94
- keepReadme,
95
- squash,
96
- pattern,
97
- includeDeps,
98
- skipDependencyInstallation,
99
- remote
100
- }) {
101
- const consumer = workspace.consumer;
102
- const currentLaneId = consumer.getCurrentLaneId();
103
- const otherLaneId = await consumer.getParsedLaneId(laneName);
104
-
105
- if (otherLaneId.isEqual(currentLaneId)) {
106
- throw new (_bitError().BitError)(`unable to merge lane "${otherLaneId.toString()}", you're already at this lane. to get updates, simply run "bit checkout head"`);
107
- }
108
-
109
- const currentLane = currentLaneId.isDefault() ? null : await consumer.scope.loadLane(currentLaneId);
110
- const isDefaultLane = otherLaneId.isDefault();
111
-
112
- const getOtherLane = async () => {
113
- if (isDefaultLane) {
114
- return undefined;
115
- }
116
-
117
- const lane = await consumer.scope.loadLane(otherLaneId);
118
-
119
- if (remote || !lane) {
120
- return lanesMain.fetchLaneWithItsComponents(otherLaneId);
121
- }
122
-
123
- return lane;
124
- };
125
-
126
- const otherLane = await getOtherLane();
127
-
128
- const getBitIds = async () => {
129
- if (isDefaultLane) {
130
- if (!currentLane) throw new Error(`unable to merge ${_laneId().DEFAULT_LANE}, the current lane was not found`);
131
- return consumer.scope.getDefaultLaneIdsFromLane(currentLane);
132
- }
133
-
134
- if (!otherLane) throw new Error(`lane must be defined for non-default`);
135
- return otherLane.toBitIds();
136
- };
137
-
138
- const bitIds = await getBitIds();
139
- lanesMain.logger.debug(`merging the following bitIds: ${bitIds.toString()}`);
140
- const otherLaneName = isDefaultLane ? _laneId().DEFAULT_LANE : otherLaneId.toString();
141
- let allComponentsStatus = await getAllComponentsStatus();
142
-
143
- if (pattern) {
144
- const componentIds = await workspace.resolveMultipleComponentIds(bitIds);
145
- const compIdsFromPattern = workspace.scope.filterIdsFromPoolIdsByPattern(pattern, componentIds);
146
- allComponentsStatus = await filterComponentsStatus(allComponentsStatus, compIdsFromPattern, bitIds, workspace, includeDeps, otherLane || undefined);
147
- bitIds.forEach(bitId => {
148
- if (!allComponentsStatus.find(c => c.id.isEqualWithoutVersion(bitId))) {
149
- allComponentsStatus.push({
150
- id: bitId,
151
- unmergedLegitimately: true,
152
- unmergedMessage: `excluded by pattern`
153
- });
154
- }
155
- });
156
- }
157
-
158
- if (existingOnWorkspaceOnly) {
159
- const workspaceIds = await workspace.listIds();
160
- const compIdsFromPattern = workspaceIds.filter(id => allComponentsStatus.find(c => c.id.isEqualWithoutVersion(id._legacy)));
161
- allComponentsStatus = await filterComponentsStatus(allComponentsStatus, compIdsFromPattern, bitIds, workspace, includeDeps);
162
- bitIds.forEach(bitId => {
163
- if (!allComponentsStatus.find(c => c.id.isEqualWithoutVersion(bitId))) {
164
- allComponentsStatus.push({
165
- id: bitId,
166
- unmergedLegitimately: true,
167
- unmergedMessage: `not in the workspace`
168
- });
169
- }
170
- });
171
- }
172
-
173
- throwForFailures();
174
-
175
- if (squash) {
176
- squashSnaps(allComponentsStatus, laneName, consumer);
177
- }
178
-
179
- const mergeResults = await merging.mergeSnaps({
180
- mergeStrategy,
181
- allComponentsStatus,
182
- remoteName: otherLane ? otherLane.scope : null,
183
- laneId: otherLaneId,
184
- localLane: currentLane,
185
- noSnap,
186
- snapMessage,
187
- build,
188
- skipDependencyInstallation
189
- });
190
- const mergedSuccessfully = !mergeResults.failedComponents || mergeResults.failedComponents.length === 0 || mergeResults.failedComponents.every(failedComponent => failedComponent.unchangedLegitimately);
191
- let deleteResults = {};
192
-
193
- if (!keepReadme && otherLane && otherLane.readmeComponent && mergedSuccessfully) {
194
- var _otherLane$readmeComp, _otherLane$readmeComp2;
195
-
196
- // await consumer.bitMap.syncWithLanes(consumer.bitMap.workspaceLane);
197
- const readmeComponentId = [otherLane.readmeComponent.id.changeVersion((_otherLane$readmeComp = otherLane.readmeComponent) === null || _otherLane$readmeComp === void 0 ? void 0 : (_otherLane$readmeComp2 = _otherLane$readmeComp.head) === null || _otherLane$readmeComp2 === void 0 ? void 0 : _otherLane$readmeComp2.hash).toString()];
198
- deleteResults = await (0, _consumer().remove)({
199
- ids: readmeComponentId,
200
- force: false,
201
- remote: false,
202
- track: false,
203
- deleteFiles: true
204
- });
205
- } else if (otherLane && !otherLane.readmeComponent) {
206
- deleteResults = {
207
- readmeResult: `\nlane ${otherLane.name} doesn't have a readme component`
208
- };
209
- }
210
-
211
- return {
212
- mergeResults,
213
- deleteResults
214
- };
215
-
216
- async function getAllComponentsStatus() {
217
- const tmp = new (_repositories().Tmp)(consumer.scope);
218
-
219
- try {
220
- const componentsStatus = await Promise.all(bitIds.map(bitId => merging.getComponentMergeStatus(bitId, currentLane, otherLaneName)));
221
- await tmp.clear();
222
- return componentsStatus;
223
- } catch (err) {
224
- await tmp.clear();
225
- throw err;
226
- }
227
- }
228
-
229
- function throwForFailures() {
230
- const failedComponents = allComponentsStatus.filter(c => c.unmergedMessage && !c.unmergedLegitimately);
231
-
232
- if (failedComponents.length) {
233
- const failureMsgs = failedComponents.map(failedComponent => `${_chalk().default.bold(failedComponent.id.toString())} - ${_chalk().default.red(failedComponent.unmergedMessage)}`).join('\n');
234
- throw new (_bitError().BitError)(`unable to merge due to the following failures:\n${failureMsgs}`);
235
- }
236
- }
237
- }
238
-
239
- async function filterComponentsStatus(allComponentsStatus, compIdsToKeep, allBitIds, workspace, includeDeps = false, lane) {
240
- const bitIdsFromPattern = _bitId().BitIds.fromArray(compIdsToKeep.map(c => c._legacy));
241
-
242
- const bitIdsNotFromPattern = allBitIds.filter(bitId => !bitIdsFromPattern.hasWithoutVersion(bitId));
243
- const filteredComponentStatus = [];
244
- const depsToAdd = [];
245
- await (0, _pMapSeries().default)(compIdsToKeep, async compId => {
246
- const fromStatus = allComponentsStatus.find(c => c.id.isEqualWithoutVersion(compId._legacy));
247
-
248
- if (!fromStatus) {
249
- throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);
250
- }
251
-
252
- filteredComponentStatus.push(fromStatus);
253
-
254
- if (fromStatus.unmergedMessage) {
255
- return;
256
- }
257
-
258
- const {
259
- divergeData
260
- } = fromStatus;
261
-
262
- if (!divergeData) {
263
- throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);
264
- }
265
-
266
- const remoteVersions = divergeData.snapsOnRemoteOnly;
267
-
268
- if (!remoteVersions.length) {
269
- return;
270
- }
271
-
272
- const modelComponent = await workspace.consumer.scope.getModelComponent(compId._legacy); // optimization suggestion: if squash is given, check only the last version.
273
-
274
- const laneIds = lane === null || lane === void 0 ? void 0 : lane.toBitIds();
275
- await (0, _pMapSeries().default)(remoteVersions, async remoteVersion => {
276
- const versionObj = await modelComponent.loadVersion(remoteVersion.toString(), workspace.consumer.scope.objects);
277
- const flattenedDeps = versionObj.getAllFlattenedDependencies();
278
- const depsNotIncludeInPattern = flattenedDeps.filter(id => bitIdsNotFromPattern.find(bitId => bitId.isEqualWithoutVersion(id)));
279
-
280
- if (!depsNotIncludeInPattern.length) {
281
- return;
282
- }
283
-
284
- const depsOnLane = [];
285
- await Promise.all(depsNotIncludeInPattern.map(async dep => {
286
- const isOnLane = await workspace.consumer.scope.isIdOnLane(dep, lane, laneIds);
287
-
288
- if (isOnLane) {
289
- depsOnLane.push(dep);
290
- }
291
- }));
292
-
293
- if (!depsOnLane.length) {
294
- return;
295
- }
296
-
297
- if (!includeDeps) {
298
- throw new (_bitError().BitError)(`unable to merge ${compId.toString()}.
299
- it has (in version ${remoteVersion.toString()}) the following dependencies which were not included in the pattern. consider adding "--include-deps" flag
300
- ${depsOnLane.map(d => d.toString()).join('\n')}`);
301
- }
302
-
303
- depsToAdd.push(...depsOnLane);
304
- });
305
- });
306
-
307
- if (depsToAdd.length) {
308
- const depsUniq = _bitId().BitIds.uniqFromArray(depsToAdd);
309
-
310
- depsUniq.forEach(id => {
311
- const fromStatus = allComponentsStatus.find(c => c.id.isEqualWithoutVersion(id));
312
-
313
- if (!fromStatus) {
314
- throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);
315
- }
316
-
317
- filteredComponentStatus.push(fromStatus);
318
- });
319
- }
320
-
321
- return filteredComponentStatus;
322
- }
323
-
324
- function squashSnaps(allComponentsStatus, laneName, consumer) {
325
- const succeededComponents = allComponentsStatus.filter(c => !c.unmergedMessage);
326
- succeededComponents.forEach(({
327
- id,
328
- divergeData,
329
- componentFromModel
330
- }) => {
331
- if (!divergeData) {
332
- throw new Error(`unable to squash. divergeData is missing from ${id.toString()}`);
333
- }
334
-
335
- if (divergeData.isDiverged()) {
336
- throw new (_bitError().BitError)(`unable to squash because ${id.toString()} is diverged in history.
337
- consider switching to ${laneName} first, merging this lane, then switching back to this lane and merging ${laneName}`);
338
- }
339
-
340
- if (divergeData.isLocalAhead()) {
341
- // nothing to do. current is ahead, nothing to merge. (it was probably filtered out already as a "failedComponent")
342
- return;
343
- }
344
-
345
- if (!divergeData.isRemoteAhead()) {
346
- // nothing to do. current and remote are the same, nothing to merge. (it was probably filtered out already as a "failedComponent")
347
- return;
348
- } // remote is ahead and was not diverge.
349
-
350
-
351
- const remoteSnaps = divergeData.snapsOnRemoteOnly;
352
-
353
- if (remoteSnaps.length === 0) {
354
- throw new Error(`remote is ahead but it has no snaps. it's impossible`);
355
- }
356
-
357
- if (remoteSnaps.length === 1) {
358
- // nothing to squash. it has only one commit.
359
- return;
360
- }
361
-
362
- if (!componentFromModel) {
363
- throw new Error('unable to squash, the componentFromModel is missing');
364
- } // do the squash.
365
-
366
-
367
- if (divergeData.commonSnapBeforeDiverge) {
368
- componentFromModel.addAsOnlyParent(divergeData.commonSnapBeforeDiverge);
369
- } else {
370
- // there is no commonSnapBeforeDiverge. the local has no snaps, all are remote, no need for parents. keep only head.
371
- componentFromModel.parents.forEach(ref => componentFromModel.removeParent(ref));
372
- }
373
-
374
- const squashedSnaps = remoteSnaps.filter(snap => !snap.isEqual(componentFromModel.hash()));
375
- componentFromModel.setSquashed(squashedSnaps);
376
- consumer.scope.objects.add(componentFromModel);
377
- });
378
- }
379
-
380
- //# sourceMappingURL=merge-lanes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["mergeLanes","lanesMain","merging","workspace","laneName","mergeStrategy","noSnap","snapMessage","existingOnWorkspaceOnly","build","keepReadme","squash","pattern","includeDeps","skipDependencyInstallation","remote","consumer","currentLaneId","getCurrentLaneId","otherLaneId","getParsedLaneId","isEqual","BitError","toString","currentLane","isDefault","scope","loadLane","isDefaultLane","getOtherLane","undefined","lane","fetchLaneWithItsComponents","otherLane","getBitIds","Error","DEFAULT_LANE","getDefaultLaneIdsFromLane","toBitIds","bitIds","logger","debug","otherLaneName","allComponentsStatus","getAllComponentsStatus","componentIds","resolveMultipleComponentIds","compIdsFromPattern","filterIdsFromPoolIdsByPattern","filterComponentsStatus","forEach","bitId","find","c","id","isEqualWithoutVersion","push","unmergedLegitimately","unmergedMessage","workspaceIds","listIds","filter","_legacy","throwForFailures","squashSnaps","mergeResults","mergeSnaps","remoteName","laneId","localLane","mergedSuccessfully","failedComponents","length","every","failedComponent","unchangedLegitimately","deleteResults","readmeComponent","readmeComponentId","changeVersion","head","hash","remove","ids","force","track","deleteFiles","readmeResult","name","tmp","Tmp","componentsStatus","Promise","all","map","getComponentMergeStatus","clear","err","failureMsgs","chalk","bold","red","join","compIdsToKeep","allBitIds","bitIdsFromPattern","BitIds","fromArray","bitIdsNotFromPattern","hasWithoutVersion","filteredComponentStatus","depsToAdd","pMapSeries","compId","fromStatus","divergeData","remoteVersions","snapsOnRemoteOnly","modelComponent","getModelComponent","laneIds","remoteVersion","versionObj","loadVersion","objects","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","depsOnLane","dep","isOnLane","isIdOnLane","d","depsUniq","uniqFromArray","succeededComponents","componentFromModel","isDiverged","isLocalAhead","isRemoteAhead","remoteSnaps","commonSnapBeforeDiverge","addAsOnlyParent","parents","ref","removeParent","squashedSnaps","snap","setSquashed","add"],"sources":["merge-lanes.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { BitError } from '@teambit/bit-error';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport pMapSeries from 'p-map-series';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { ApplyVersionResults } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { ComponentID } from '@teambit/component-id';\nimport { Workspace } from '@teambit/workspace';\nimport { DEFAULT_LANE } from '@teambit/lane-id';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport { MergingMain, ComponentMergeStatus } from '@teambit/merging';\nimport { remove } from '@teambit/legacy/dist/api/consumer';\nimport { LanesMain, MergeLaneOptions } from './lanes.main.runtime';\n\nexport async function mergeLanes({\n lanesMain,\n merging,\n workspace,\n laneName,\n mergeStrategy,\n noSnap,\n snapMessage,\n existingOnWorkspaceOnly,\n build,\n keepReadme,\n squash,\n pattern,\n includeDeps,\n skipDependencyInstallation,\n remote,\n}: {\n lanesMain: LanesMain;\n merging: MergingMain;\n workspace: Workspace;\n laneName: string;\n} & MergeLaneOptions): Promise<{ mergeResults: ApplyVersionResults; deleteResults: any }> {\n const consumer = workspace.consumer;\n const currentLaneId = consumer.getCurrentLaneId();\n const otherLaneId = await consumer.getParsedLaneId(laneName);\n if (otherLaneId.isEqual(currentLaneId)) {\n throw new BitError(\n `unable to merge lane \"${otherLaneId.toString()}\", you're already at this lane. to get updates, simply run \"bit checkout head\"`\n );\n }\n const currentLane = currentLaneId.isDefault() ? null : await consumer.scope.loadLane(currentLaneId);\n const isDefaultLane = otherLaneId.isDefault();\n const getOtherLane = async () => {\n if (isDefaultLane) {\n return undefined;\n }\n const lane = await consumer.scope.loadLane(otherLaneId);\n if (remote || !lane) {\n return lanesMain.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 lanesMain.logger.debug(`merging the following bitIds: ${bitIds.toString()}`);\n const otherLaneName = isDefaultLane ? DEFAULT_LANE : otherLaneId.toString();\n\n let allComponentsStatus = await getAllComponentsStatus();\n\n if (pattern) {\n const componentIds = await workspace.resolveMultipleComponentIds(bitIds);\n const compIdsFromPattern = workspace.scope.filterIdsFromPoolIdsByPattern(pattern, componentIds);\n allComponentsStatus = await filterComponentsStatus(\n allComponentsStatus,\n compIdsFromPattern,\n bitIds,\n workspace,\n includeDeps,\n otherLane || undefined\n );\n bitIds.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unmergedLegitimately: true, unmergedMessage: `excluded by pattern` });\n }\n });\n }\n if (existingOnWorkspaceOnly) {\n const workspaceIds = await 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 workspace,\n includeDeps\n );\n bitIds.forEach((bitId) => {\n if (!allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(bitId))) {\n allComponentsStatus.push({ id: bitId, unmergedLegitimately: true, unmergedMessage: `not in the workspace` });\n }\n });\n }\n\n throwForFailures();\n\n if (squash) {\n squashSnaps(allComponentsStatus, laneName, consumer);\n }\n\n const mergeResults = await merging.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n remoteName: otherLane ? otherLane.scope : null,\n laneId: otherLaneId,\n localLane: currentLane,\n noSnap,\n snapMessage,\n build,\n skipDependencyInstallation,\n });\n\n const mergedSuccessfully =\n !mergeResults.failedComponents ||\n mergeResults.failedComponents.length === 0 ||\n mergeResults.failedComponents.every((failedComponent) => failedComponent.unchangedLegitimately);\n\n let deleteResults = {};\n\n if (!keepReadme && otherLane && otherLane.readmeComponent && mergedSuccessfully) {\n // await consumer.bitMap.syncWithLanes(consumer.bitMap.workspaceLane);\n\n const readmeComponentId = [\n otherLane.readmeComponent.id.changeVersion(otherLane.readmeComponent?.head?.hash).toString(),\n ];\n\n deleteResults = await remove({\n ids: readmeComponentId,\n force: false,\n remote: false,\n track: false,\n deleteFiles: true,\n });\n } else if (otherLane && !otherLane.readmeComponent) {\n deleteResults = { readmeResult: `\\nlane ${otherLane.name} doesn't have a readme component` };\n }\n\n return { mergeResults, deleteResults };\n\n async function getAllComponentsStatus(): Promise<ComponentMergeStatus[]> {\n const tmp = new Tmp(consumer.scope);\n try {\n const componentsStatus = await Promise.all(\n bitIds.map((bitId) => merging.getComponentMergeStatus(bitId, currentLane, otherLaneName))\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n }\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\nasync function filterComponentsStatus(\n allComponentsStatus: ComponentMergeStatus[],\n compIdsToKeep: ComponentID[],\n allBitIds: BitId[],\n workspace: Workspace,\n includeDeps = false,\n lane?: Lane\n): Promise<ComponentMergeStatus[]> {\n const bitIdsFromPattern = BitIds.fromArray(compIdsToKeep.map((c) => c._legacy));\n const bitIdsNotFromPattern = allBitIds.filter((bitId) => !bitIdsFromPattern.hasWithoutVersion(bitId));\n const filteredComponentStatus: ComponentMergeStatus[] = [];\n const depsToAdd: BitId[] = [];\n await pMapSeries(compIdsToKeep, async (compId) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(compId._legacy));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n if (fromStatus.unmergedMessage) {\n return;\n }\n const { divergeData } = fromStatus;\n if (!divergeData) {\n throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);\n }\n const remoteVersions = divergeData.snapsOnRemoteOnly;\n if (!remoteVersions.length) {\n return;\n }\n const modelComponent = await workspace.consumer.scope.getModelComponent(compId._legacy);\n // optimization suggestion: if squash is given, check only the last version.\n const laneIds = lane?.toBitIds();\n await pMapSeries(remoteVersions, async (remoteVersion) => {\n const versionObj = await modelComponent.loadVersion(remoteVersion.toString(), workspace.consumer.scope.objects);\n const flattenedDeps = versionObj.getAllFlattenedDependencies();\n const depsNotIncludeInPattern = flattenedDeps.filter((id) =>\n bitIdsNotFromPattern.find((bitId) => bitId.isEqualWithoutVersion(id))\n );\n if (!depsNotIncludeInPattern.length) {\n return;\n }\n const depsOnLane: BitId[] = [];\n await Promise.all(\n depsNotIncludeInPattern.map(async (dep) => {\n const isOnLane = await workspace.consumer.scope.isIdOnLane(dep, lane, laneIds);\n if (isOnLane) {\n depsOnLane.push(dep);\n }\n })\n );\n if (!depsOnLane.length) {\n return;\n }\n if (!includeDeps) {\n throw new BitError(`unable to merge ${compId.toString()}.\nit has (in version ${remoteVersion.toString()}) the following dependencies which were not included in the pattern. consider adding \"--include-deps\" flag\n${depsOnLane.map((d) => d.toString()).join('\\n')}`);\n }\n depsToAdd.push(...depsOnLane);\n });\n });\n if (depsToAdd.length) {\n const depsUniq = BitIds.uniqFromArray(depsToAdd);\n depsUniq.forEach((id) => {\n const fromStatus = allComponentsStatus.find((c) => c.id.isEqualWithoutVersion(id));\n if (!fromStatus) {\n throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);\n }\n filteredComponentStatus.push(fromStatus);\n });\n }\n return filteredComponentStatus;\n}\n\nfunction squashSnaps(allComponentsStatus: ComponentMergeStatus[], laneName: string, consumer: Consumer) {\n const succeededComponents = allComponentsStatus.filter((c) => !c.unmergedMessage);\n succeededComponents.forEach(({ id, divergeData, componentFromModel }) => {\n if (!divergeData) {\n throw new Error(`unable to squash. divergeData is missing from ${id.toString()}`);\n }\n if (divergeData.isDiverged()) {\n throw new BitError(`unable to squash because ${id.toString()} is diverged in history.\nconsider switching to ${laneName} first, merging this lane, then switching back to this lane and merging ${laneName}`);\n }\n if (divergeData.isLocalAhead()) {\n // nothing to do. current is ahead, nothing to merge. (it was probably filtered out already as a \"failedComponent\")\n return;\n }\n if (!divergeData.isRemoteAhead()) {\n // nothing to do. current and remote are the same, nothing to merge. (it was probably filtered out already as a \"failedComponent\")\n return;\n }\n // remote is ahead and was not diverge.\n const remoteSnaps = divergeData.snapsOnRemoteOnly;\n if (remoteSnaps.length === 0) {\n throw new Error(`remote is ahead but it has no snaps. it's impossible`);\n }\n if (remoteSnaps.length === 1) {\n // nothing to squash. it has only one commit.\n return;\n }\n if (!componentFromModel) {\n throw new Error('unable to squash, the componentFromModel is missing');\n }\n\n // 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 const squashedSnaps = remoteSnaps.filter((snap) => !snap.isEqual(componentFromModel.hash()));\n componentFromModel.setSquashed(squashedSnaps);\n consumer.scope.objects.add(componentFromModel);\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;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,eAAeA,UAAf,CAA0B;EAC/BC,SAD+B;EAE/BC,OAF+B;EAG/BC,SAH+B;EAI/BC,QAJ+B;EAK/BC,aAL+B;EAM/BC,MAN+B;EAO/BC,WAP+B;EAQ/BC,uBAR+B;EAS/BC,KAT+B;EAU/BC,UAV+B;EAW/BC,MAX+B;EAY/BC,OAZ+B;EAa/BC,WAb+B;EAc/BC,0BAd+B;EAe/BC;AAf+B,CAA1B,EAqBmF;EACxF,MAAMC,QAAQ,GAAGb,SAAS,CAACa,QAA3B;EACA,MAAMC,aAAa,GAAGD,QAAQ,CAACE,gBAAT,EAAtB;EACA,MAAMC,WAAW,GAAG,MAAMH,QAAQ,CAACI,eAAT,CAAyBhB,QAAzB,CAA1B;;EACA,IAAIe,WAAW,CAACE,OAAZ,CAAoBJ,aAApB,CAAJ,EAAwC;IACtC,MAAM,KAAIK,oBAA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