@teambit/lanes 0.0.347 → 0.0.350

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.
@@ -109,7 +109,7 @@ export declare class LaneMergeCmd implements Command {
109
109
  migration: boolean;
110
110
  remoteOp: boolean;
111
111
  constructor(lanes: LanesMain);
112
- report([name]: [string], { ours, theirs, manual, remote: remoteName, build, existing: existingOnWorkspaceOnly, noSnap, message: snapMessage, keepReadme, squash, }: {
112
+ report([name]: [string], { ours, theirs, manual, remote: remoteName, build, existing: existingOnWorkspaceOnly, noSnap, message: snapMessage, keepReadme, squash, pattern, includeDeps, }: {
113
113
  ours: boolean;
114
114
  theirs: boolean;
115
115
  manual: boolean;
@@ -120,6 +120,8 @@ export declare class LaneMergeCmd implements Command {
120
120
  message: string;
121
121
  keepReadme?: boolean;
122
122
  squash: boolean;
123
+ pattern?: string;
124
+ includeDeps?: boolean;
123
125
  }): Promise<string>;
124
126
  }
125
127
  export declare class LaneRemoveCmd implements Command {
package/dist/lane.cmd.js CHANGED
@@ -377,7 +377,7 @@ class LaneMergeCmd {
377
377
  (0, _defineProperty2().default)(this, "name", 'merge <lane>');
378
378
  (0, _defineProperty2().default)(this, "description", `merge a local or a remote lane`);
379
379
  (0, _defineProperty2().default)(this, "alias", '');
380
- (0, _defineProperty2().default)(this, "options", [['', 'remote <scope-name>', 'remote scope name'], ['', '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'], ['', 'existing', 'checkout 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', 'squash multiple snaps. keep the last one only']]);
380
+ (0, _defineProperty2().default)(this, "options", [['', 'remote <scope-name>', 'remote scope name'], ['', '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'], ['', 'existing', 'checkout 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'], ['', 'pattern <component-pattern>', 'EXPERIMENTAL. partially merge the lane with the specified component-pattern'], ['', 'include-deps', 'EXPERIMENTAL. relevant for "--pattern" and "--existing". merge also dependencies of the given components']]);
381
381
  (0, _defineProperty2().default)(this, "loader", true);
382
382
  (0, _defineProperty2().default)(this, "private", true);
383
383
  (0, _defineProperty2().default)(this, "migration", true);
@@ -394,11 +394,18 @@ class LaneMergeCmd {
394
394
  noSnap = false,
395
395
  message: snapMessage = '',
396
396
  keepReadme = false,
397
- squash = false
397
+ squash = false,
398
+ pattern,
399
+ includeDeps = false
398
400
  }) {
399
401
  build = (0, _featureToggle().isFeatureEnabled)(_featureToggle().BUILD_ON_CI) ? Boolean(build) : true;
400
402
  const mergeStrategy = (0, _mergeVersion().getMergeStrategy)(ours, theirs, manual);
401
403
  if (noSnap && snapMessage) throw new (_bitError().BitError)('unable to use "noSnap" and "message" flags together');
404
+
405
+ if (includeDeps && !pattern && !existingOnWorkspaceOnly) {
406
+ throw new (_bitError().BitError)(`"--include-deps" flag is relevant only for --existing and --pattern flags`);
407
+ }
408
+
402
409
  const {
403
410
  mergeResults,
404
411
  deleteResults
@@ -412,7 +419,9 @@ class LaneMergeCmd {
412
419
  noSnap,
413
420
  snapMessage,
414
421
  keepReadme,
415
- squash
422
+ squash,
423
+ pattern,
424
+ includeDeps
416
425
  });
417
426
  const mergeResult = `${(0, _merging().mergeReport)(mergeResults)}`;
418
427
  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`;
@@ -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","getCurrentLane","laneDataOfCurrentLane","find","undefined","currentLaneReadmeComponentStr","outputReadmeComponent","readmeComponent","currentLaneStr","remoteOfCurrentLane","currentLaneComponents","outputComponents","components","outputRemoteLane","availableLanes","laneData","readmeComponentStr","laneTitle","bold","concat","outputFooter","footer","outputCurrentLane","outputAvailableLanes","json","LaneShowCmd","onlyLane","title","author","log","username","email","date","Date","parseInt","toLocaleString","LaneCreateCmd","createLaneOptions","result","createLane","remoteScopeOrDefaultScope","remoteScope","localLane","remoteScopeOutput","LaneAliasCmd","laneName","alias","laneId","aliasLane","toString","LaneChangeScopeCmd","localName","remoteScopeBefore","changeScope","LaneRenameCmd","currentName","newName","exported","exportErr","rename","exportedStr","message","LaneMergeCmd","ours","theirs","manual","remoteName","build","existing","existingOnWorkspaceOnly","noSnap","snapMessage","keepReadme","squash","isFeatureEnabled","BUILD_ON_CI","Boolean","mergeStrategy","getMergeStrategy","BitError","mergeResults","deleteResults","mergeLane","mergeResult","mergeReport","deleteResult","localResult","paintRemoved","remoteResult","item","readmeResult","yellow","LaneRemoveCmd","description","names","force","silent","removePromptResult","approveOperation","yn","shouldProceed","laneResults","removeLanes","LaneImportCmd","switchCmd","lane","skipDependencyInstallation","getAll","LaneCmd","docsDomain","LaneRemoveReadmeCmd","removeLaneReadme","red","LaneAddReadmeCmd","componentId","addLaneReadme","componentsTitle","componentsStr","c","id","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.getCurrentLane();\n const laneDataOfCurrentLane = currentLane ? lanes.find((l) => l.name === currentLane) : undefined;\n const currentLaneReadmeComponentStr = outputReadmeComponent(laneDataOfCurrentLane?.readmeComponent);\n let currentLaneStr = currentLane ? `current lane - ${chalk.green.green(currentLane as string)}` : '';\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) => l.name !== currentLane)\n // @ts-ignore\n .map((laneData) => {\n const readmeComponentStr = outputReadmeComponent(laneData.readmeComponent);\n if (details) {\n const laneTitle = `> ${chalk.bold(laneData.name)}${outputRemoteLane(laneData.remote)}\\n`;\n const components = outputComponents(laneData.components);\n return laneTitle + readmeComponentStr.concat('\\n') + components;\n }\n return ` > ${chalk.green(laneData.name)} (${laneData.components.length} 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.getCurrentLane();\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 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>';\n description = `merge a local or a remote lane`;\n alias = '';\n options = [\n ['', 'remote <scope-name>', 'remote scope name'],\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 ['', 'existing', 'checkout 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', 'squash multiple snaps. keep the last one only'],\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]: [string],\n {\n ours = false,\n theirs = false,\n manual = false,\n remote: remoteName,\n build,\n existing: existingOnWorkspaceOnly = false,\n noSnap = false,\n message: snapMessage = '',\n keepReadme = false,\n squash = false,\n }: {\n ours: boolean;\n theirs: boolean;\n manual: boolean;\n remote?: string;\n existing?: boolean;\n build?: boolean;\n noSnap: boolean;\n message: string;\n keepReadme?: boolean;\n squash: 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\n const { mergeResults, deleteResults } = await this.lanes.mergeLane(name, {\n // @ts-ignore\n remoteName,\n build,\n // @ts-ignore\n mergeStrategy,\n existingOnWorkspaceOnly,\n noSnap,\n snapMessage,\n keepReadme,\n squash,\n });\n\n const mergeResult = `${mergeReport(mergeResults)}`;\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 ${laneName || this.lanes.getCurrentLane()}`\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.getCurrentLane()\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.getCurrentLane()\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;;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;;AAZA;AAwBO,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,CAD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AAA,CAAMC,KAAN,CACJ,iBAAgBwH,WAAY,qEAC3BrE,QAAQ,IAAI,KAAKrE,KAAL,CAAWyB,cAAX,EACb,EAHI,CAAP;IAMF,OAAOR,gBAAA,CAAMuH,GAAN,CACJ,GAAEnD,OAAO,IAAI,EAAG,mBAAkBqD,WAAY,0DAC7CrE,QAAQ,IAAI,KAAKrE,KAAL,CAAWyB,cAAX,EACb,EAHI,CAAP;EAKD;;AA7B8C;;;;AAgCjD,SAASU,gBAAT,CAA0BC,UAA1B,EAAsE;EACpE,MAAMwG,eAAe,GAAI,KAAI3H,gBAAA,CAAMyB,IAAN,CAAY,eAAcN,UAAU,CAACpB,MAAO,GAA5C,CAAgD,IAA7E;EACA,MAAM6H,aAAa,GAAGzG,UAAU,CAACjB,GAAX,CAAgB2H,CAAD,IAAQ,OAAMA,CAAC,CAACC,EAAF,CAAKtE,QAAL,EAAgB,MAAKqE,CAAC,CAACE,IAAK,EAAzD,EAA4D1H,IAA5D,CAAiE,IAAjE,CAAtB;EACA,OAAOsH,eAAe,GAAGC,aAAzB;AACD;;AAED,SAAS/G,qBAAT,CAA+BmH,SAA/B,EAA+E;EAC7E,IAAI,CAACA,SAAL,EAAgB,OAAO,EAAP;EAChB,OAAQ,OAAO,GAAEhI,gBAAA,CAAMkG,MAAN,CAAa,kBAAb,CAAiC,SAAQ8B,SAAS,CAACF,EAAG,MACrEE,SAAS,CAACD,IAAV,IACC,iCAAgCC,SAAS,CAACF,EAAV,CAAa1H,IAAK,8DACpD,EAAE,IAHH;AAID;;AAED,SAASgB,gBAAT,CAA0B6G,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","getCurrentLane","laneDataOfCurrentLane","find","undefined","currentLaneReadmeComponentStr","outputReadmeComponent","readmeComponent","currentLaneStr","remoteOfCurrentLane","currentLaneComponents","outputComponents","components","outputRemoteLane","availableLanes","laneData","readmeComponentStr","laneTitle","bold","concat","outputFooter","footer","outputCurrentLane","outputAvailableLanes","json","LaneShowCmd","onlyLane","title","author","log","username","email","date","Date","parseInt","toLocaleString","LaneCreateCmd","createLaneOptions","result","createLane","remoteScopeOrDefaultScope","remoteScope","localLane","remoteScopeOutput","LaneAliasCmd","laneName","alias","laneId","aliasLane","toString","LaneChangeScopeCmd","localName","remoteScopeBefore","changeScope","LaneRenameCmd","currentName","newName","exported","exportErr","rename","exportedStr","message","LaneMergeCmd","ours","theirs","manual","remoteName","build","existing","existingOnWorkspaceOnly","noSnap","snapMessage","keepReadme","squash","pattern","includeDeps","isFeatureEnabled","BUILD_ON_CI","Boolean","mergeStrategy","getMergeStrategy","BitError","mergeResults","deleteResults","mergeLane","mergeResult","mergeReport","deleteResult","localResult","paintRemoved","remoteResult","item","readmeResult","yellow","LaneRemoveCmd","description","names","force","silent","removePromptResult","approveOperation","yn","shouldProceed","laneResults","removeLanes","LaneImportCmd","switchCmd","lane","skipDependencyInstallation","getAll","LaneCmd","docsDomain","LaneRemoveReadmeCmd","removeLaneReadme","red","LaneAddReadmeCmd","componentId","addLaneReadme","componentsTitle","componentsStr","c","id","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.getCurrentLane();\n const laneDataOfCurrentLane = currentLane ? lanes.find((l) => l.name === currentLane) : undefined;\n const currentLaneReadmeComponentStr = outputReadmeComponent(laneDataOfCurrentLane?.readmeComponent);\n let currentLaneStr = currentLane ? `current lane - ${chalk.green.green(currentLane as string)}` : '';\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) => l.name !== currentLane)\n // @ts-ignore\n .map((laneData) => {\n const readmeComponentStr = outputReadmeComponent(laneData.readmeComponent);\n if (details) {\n const laneTitle = `> ${chalk.bold(laneData.name)}${outputRemoteLane(laneData.remote)}\\n`;\n const components = outputComponents(laneData.components);\n return laneTitle + readmeComponentStr.concat('\\n') + components;\n }\n return ` > ${chalk.green(laneData.name)} (${laneData.components.length} 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.getCurrentLane();\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 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>';\n description = `merge a local or a remote lane`;\n alias = '';\n options = [\n ['', 'remote <scope-name>', 'remote scope name'],\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 ['', 'existing', 'checkout 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 ['', 'pattern <component-pattern>', 'EXPERIMENTAL. partially merge the lane with the specified component-pattern'],\n [\n '',\n 'include-deps',\n 'EXPERIMENTAL. relevant for \"--pattern\" and \"--existing\". 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]: [string],\n {\n ours = false,\n theirs = false,\n manual = false,\n remote: remoteName,\n build,\n existing: existingOnWorkspaceOnly = false,\n noSnap = false,\n message: snapMessage = '',\n keepReadme = false,\n squash = false,\n pattern,\n includeDeps = false,\n }: {\n ours: boolean;\n theirs: boolean;\n manual: boolean;\n remote?: string;\n existing?: boolean;\n build?: boolean;\n noSnap: boolean;\n message: string;\n keepReadme?: boolean;\n squash: boolean;\n pattern?: string;\n includeDeps?: 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 --existing and --pattern flags`);\n }\n const { mergeResults, deleteResults } = await this.lanes.mergeLane(name, {\n // @ts-ignore\n remoteName,\n build,\n // @ts-ignore\n mergeStrategy,\n existingOnWorkspaceOnly,\n noSnap,\n snapMessage,\n keepReadme,\n squash,\n pattern,\n includeDeps,\n });\n\n const mergeResult = `${mergeReport(mergeResults)}`;\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 ${laneName || this.lanes.getCurrentLane()}`\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.getCurrentLane()\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.getCurrentLane()\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;;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;;AAZA;AAwBO,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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A1B,EAAyE;EACvE,IAAI,CAACA,UAAL,EAAiB,OAAO,EAAP;EACjB,OAAQ,qBAAoBA,UAAW,GAAvC;AACD"}
@@ -26,6 +26,8 @@ export declare type MergeLaneOptions = {
26
26
  build: boolean;
27
27
  keepReadme: boolean;
28
28
  squash: boolean;
29
+ pattern?: string;
30
+ includeDeps?: boolean;
29
31
  };
30
32
  export declare type CreateLaneOptions = {
31
33
  remoteScope?: string;
@@ -567,7 +567,7 @@ class LanesMain {
567
567
 
568
568
  const results = await (0, _mergeLanes().mergeLanes)(_objectSpread({
569
569
  merging: this.merging,
570
- consumer: this.workspace.consumer,
570
+ workspace: this.workspace,
571
571
  laneName
572
572
  }, options));
573
573
  await this.workspace.consumer.onDestroy();
@@ -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","getCurrentLane","getCurrentLaneName","getCurrentLaneId","createLane","remoteScope","alias","BitError","throwForInvalidLaneName","defaultScope","setCurrentLane","trackLaneData","localLane","remoteLane","trackLane","onDestroy","localName","remoteName","laneId","parseLaneIdFromString","lane","loadLane","beforeTrackData","getRemoteTrackedDataByLocalLane","beforeTrackDataCloned","undefined","afterTrackData","aliasLane","laneName","includes","LANE_REMOTE_DELIMITER","trackData","laneNameWithoutScope","split","removeTrackLane","changeScope","remoteScopeBefore","saveLane","rename","currentName","newName","existingAliasWithNewName","remoteIdStr","previousAlias","getAliasByLaneId","WorkspaceLane","getPath","objects","remoteLanes","renameRefByNewLaneName","currentLaneName","clonedLaneToExport","clone","components","exported","exportErr","exportLane","err","error","id","toString","message","exportMany","isLegacy","laneObject","ids","BitIds","idsWithFutureScope","allVersions","importLane","scopeComponentImporter","ScopeComponentsImporter","getInstance","results","importLanes","removeLanes","laneNames","force","laneResults","mergeLane","options","mergeLanes","bitMap","syncWithLanes","workspaceLane","switchLanes","merge","getAll","skipDependencyInstallation","mergeStrategy","mergeOptions","Object","keys","MergeOptions","join","switchProps","existingOnWorkspaceOnly","checkoutProps","skipNpmInstall","verbose","ignorePackageJson","ignoreDist","isLane","promptMergeOptions","writeConfig","reset","all","LaneSwitcher","switch","getDiff","values","diffOptions","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","getAuthoredAndImportedBitIdsOfDefaultLane","bitId","version","isMerged","provider","cli","graphql","community","loggerMain","createLogger","lanesMain","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 } 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 { 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 WorkspaceLane from '@teambit/legacy/dist/consumer/bit-map/workspace-lane';\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 remoteName: string | null;\n mergeStrategy: MergeStrategy;\n noSnap: boolean;\n snapMessage: string;\n existingOnWorkspaceOnly: boolean;\n build: boolean;\n keepReadme: boolean;\n squash: 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 private 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 getCurrentLane(): string | null {\n if (!this.workspace?.consumer) return null;\n return this.scope.legacyScope.lanes.getCurrentLaneName();\n }\n\n getCurrentLaneId(): LaneId | null {\n if (!this.workspace) return null;\n return this.scope.legacyScope.lanes.getCurrentLaneId();\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 this.scope.legacyScope.lanes.setCurrentLane(name);\n const trackLaneData = {\n localLane: alias || name,\n remoteLane: name,\n remoteScope: scope,\n };\n this.scope.legacyScope.lanes.trackLane(trackLaneData);\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 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 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 workspace-lane file\n const previousAlias = this.scope.legacyScope.lanes.getAliasByLaneId(laneId);\n if (previousAlias) {\n await WorkspaceLane.rename(this.scope.legacyScope.getPath(), previousAlias, newName);\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.getCurrentLane();\n if (currentLaneName === laneNameWithoutScope) this.scope.legacyScope.lanes.setCurrentLane(newName);\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 isLegacy: false,\n laneObject: lane,\n ids: new BitIds(),\n idsWithFutureScope: new BitIds(),\n allVersions: false,\n });\n }\n\n async importLane(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 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 consumer: this.workspace.consumer,\n laneName,\n ...options,\n });\n\n await this.workspace.consumer.onDestroy();\n this.workspace.consumer.bitMap.syncWithLanes(this.workspace.consumer.bitMap.workspaceLane);\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 getDiff(values: string[], diffOptions: DiffOptions = {}) {\n const laneDiffGenerator = new LaneDiffGenerator(this.workspace, this.scope);\n return laneDiffGenerator.generate(values, diffOptions);\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.getCurrentLane();\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 = consumer.bitMap.getAuthoredAndImportedBitIdsOfDefaultLane();\n }\n\n return {\n name: DEFAULT_LANE,\n remote: null,\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 isLegacy = workspace && workspace.consumer.isLegacy;\n const switchCmd = new SwitchCmd(lanesMain);\n if (!isLegacy) {\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 }\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;E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SAAjB,CARiB,EASjB,KAAIc,qBAAJ,EAAkBd,SAAlB,CATiB,EAUjB,KAAIe,2BAAJ,EAAgB3M,SAAhB,EAA2BC,KAA3B,CAViB,EAWjB,KAAI2M,wBAAJ,EAAqBhB,SAArB,CAXiB,EAYjB,KAAIiB,2BAAJ,EAAwBjB,SAAxB,CAZiB,EAajB,KAAIkB,qBAAJ,EAAkBjB,SAAlB,CAbiB,CAAnB;MAeAN,GAAG,CAACwB,QAAJ,CAAahB,OAAb,EAAsBF,SAAtB;MACAL,OAAO,CAACuB,QAAR,CAAiB,IAAAC,qBAAA,EAAYpB,SAAZ,CAAjB;IACD;;IACD,OAAOA,SAAP;EACD;;AAvfoB;;;gCAAV9L,S,WAwcI,E;gCAxcJA,S,kBAycW,CACpBmN,gBADoB,EAEpBC,oBAFoB,EAGpBC,4BAHoB,EAIpBC,wBAJoB,EAKpBC,4BALoB,EAMpBC,wBANoB,EAOpBC,oBAPoB,EAQpBC,sBARoB,C;gCAzcX1N,S,aAmdM2N,kB;;AAuCnBxD,oBAAA,CAAYyD,UAAZ,CAAuB5N,SAAvB;;eAEeA,S"}
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","getCurrentLane","getCurrentLaneName","getCurrentLaneId","createLane","remoteScope","alias","BitError","throwForInvalidLaneName","defaultScope","setCurrentLane","trackLaneData","localLane","remoteLane","trackLane","onDestroy","localName","remoteName","laneId","parseLaneIdFromString","lane","loadLane","beforeTrackData","getRemoteTrackedDataByLocalLane","beforeTrackDataCloned","undefined","afterTrackData","aliasLane","laneName","includes","LANE_REMOTE_DELIMITER","trackData","laneNameWithoutScope","split","removeTrackLane","changeScope","remoteScopeBefore","saveLane","rename","currentName","newName","existingAliasWithNewName","remoteIdStr","previousAlias","getAliasByLaneId","WorkspaceLane","getPath","objects","remoteLanes","renameRefByNewLaneName","currentLaneName","clonedLaneToExport","clone","components","exported","exportErr","exportLane","err","error","id","toString","message","exportMany","isLegacy","laneObject","ids","BitIds","idsWithFutureScope","allVersions","importLane","scopeComponentImporter","ScopeComponentsImporter","getInstance","results","importLanes","removeLanes","laneNames","force","laneResults","mergeLane","options","mergeLanes","bitMap","syncWithLanes","workspaceLane","switchLanes","merge","getAll","skipDependencyInstallation","mergeStrategy","mergeOptions","Object","keys","MergeOptions","join","switchProps","existingOnWorkspaceOnly","checkoutProps","skipNpmInstall","verbose","ignorePackageJson","ignoreDist","isLane","promptMergeOptions","writeConfig","reset","all","LaneSwitcher","switch","getDiff","values","diffOptions","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","getAuthoredAndImportedBitIdsOfDefaultLane","bitId","version","isMerged","provider","cli","graphql","community","loggerMain","createLogger","lanesMain","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 } 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 { 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 WorkspaceLane from '@teambit/legacy/dist/consumer/bit-map/workspace-lane';\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 remoteName: string | null;\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};\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 private 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 getCurrentLane(): string | null {\n if (!this.workspace?.consumer) return null;\n return this.scope.legacyScope.lanes.getCurrentLaneName();\n }\n\n getCurrentLaneId(): LaneId | null {\n if (!this.workspace) return null;\n return this.scope.legacyScope.lanes.getCurrentLaneId();\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 this.scope.legacyScope.lanes.setCurrentLane(name);\n const trackLaneData = {\n localLane: alias || name,\n remoteLane: name,\n remoteScope: scope,\n };\n this.scope.legacyScope.lanes.trackLane(trackLaneData);\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 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 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 workspace-lane file\n const previousAlias = this.scope.legacyScope.lanes.getAliasByLaneId(laneId);\n if (previousAlias) {\n await WorkspaceLane.rename(this.scope.legacyScope.getPath(), previousAlias, newName);\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.getCurrentLane();\n if (currentLaneName === laneNameWithoutScope) this.scope.legacyScope.lanes.setCurrentLane(newName);\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 isLegacy: false,\n laneObject: lane,\n ids: new BitIds(),\n idsWithFutureScope: new BitIds(),\n allVersions: false,\n });\n }\n\n async importLane(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 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 laneName,\n ...options,\n });\n\n await this.workspace.consumer.onDestroy();\n this.workspace.consumer.bitMap.syncWithLanes(this.workspace.consumer.bitMap.workspaceLane);\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 getDiff(values: string[], diffOptions: DiffOptions = {}) {\n const laneDiffGenerator = new LaneDiffGenerator(this.workspace, this.scope);\n return laneDiffGenerator.generate(values, diffOptions);\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.getCurrentLane();\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 = consumer.bitMap.getAuthoredAndImportedBitIdsOfDefaultLane();\n }\n\n return {\n name: DEFAULT_LANE,\n remote: null,\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 isLegacy = workspace && workspace.consumer.isLegacy;\n const switchCmd = new SwitchCmd(lanesMain);\n if (!isLegacy) {\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 }\n return lanesMain;\n }\n}\n\nLanesAspect.addRuntime(LanesMain);\n\nexport default LanesMain;\n"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AAsCC,KAAtC,CAHiB,EAIjB,KAAIoM,qBAAJ,EAAkBT,SAAlB,CAJiB,EAKjB,KAAIU,oBAAJ,EAAiBV,SAAjB,CALiB,EAMjB,KAAIW,qBAAJ,EAAkBX,SAAlB,CANiB,EAOjB,KAAIY,0BAAJ,EAAuBZ,SAAvB,CAPiB,EAQjB,KAAIa,oBAAJ,EAAiBb,SAAjB,CARiB,EASjB,KAAIc,qBAAJ,EAAkBd,SAAlB,CATiB,EAUjB,KAAIe,2BAAJ,EAAgB3M,SAAhB,EAA2BC,KAA3B,CAViB,EAWjB,KAAI2M,wBAAJ,EAAqBhB,SAArB,CAXiB,EAYjB,KAAIiB,2BAAJ,EAAwBjB,SAAxB,CAZiB,EAajB,KAAIkB,qBAAJ,EAAkBjB,SAAlB,CAbiB,CAAnB;MAeAN,GAAG,CAACwB,QAAJ,CAAahB,OAAb,EAAsBF,SAAtB;MACAL,OAAO,CAACuB,QAAR,CAAiB,IAAAC,qBAAA,EAAYpB,SAAZ,CAAjB;IACD;;IACD,OAAOA,SAAP;EACD;;AAvfoB;;;gCAAV9L,S,WAwcI,E;gCAxcJA,S,kBAycW,CACpBmN,gBADoB,EAEpBC,oBAFoB,EAGpBC,4BAHoB,EAIpBC,wBAJoB,EAKpBC,4BALoB,EAMpBC,wBANoB,EAOpBC,oBAPoB,EAQpBC,sBARoB,C;gCAzcX1N,S,aAmdM2N,kB;;AAuCnBxD,oBAAA,CAAYyD,UAAZ,CAAuB5N,SAAvB;;eAEeA,S"}
@@ -1,10 +1,10 @@
1
- import { Consumer } from '@teambit/legacy/dist/consumer';
2
1
  import { ApplyVersionResults } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';
2
+ import { Workspace } from '@teambit/workspace';
3
3
  import { MergingMain } from '@teambit/merging';
4
4
  import { MergeLaneOptions } from './lanes.main.runtime';
5
- export declare function mergeLanes({ merging, consumer, laneName, mergeStrategy, remoteName, noSnap, snapMessage, existingOnWorkspaceOnly, build, keepReadme, squash, }: {
5
+ export declare function mergeLanes({ merging, workspace, laneName, mergeStrategy, remoteName, noSnap, snapMessage, existingOnWorkspaceOnly, build, keepReadme, squash, pattern, includeDeps, }: {
6
6
  merging: MergingMain;
7
- consumer: Consumer;
7
+ workspace: Workspace;
8
8
  laneName: string;
9
9
  } & MergeLaneOptions): Promise<{
10
10
  mergeResults: ApplyVersionResults;
@@ -31,6 +31,26 @@ function _bitError() {
31
31
  return data;
32
32
  }
33
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
+
34
54
  function _laneId() {
35
55
  const data = require("@teambit/lane-id");
36
56
 
@@ -63,7 +83,7 @@ function _consumer() {
63
83
 
64
84
  async function mergeLanes({
65
85
  merging,
66
- consumer,
86
+ workspace,
67
87
  laneName,
68
88
  mergeStrategy,
69
89
  remoteName,
@@ -72,15 +92,18 @@ async function mergeLanes({
72
92
  existingOnWorkspaceOnly,
73
93
  build,
74
94
  keepReadme,
75
- squash
95
+ squash,
96
+ pattern,
97
+ includeDeps
76
98
  }) {
99
+ const consumer = workspace.consumer;
77
100
  const currentLaneId = consumer.getCurrentLaneId();
78
101
 
79
102
  if (!remoteName && laneName === currentLaneId.name) {
80
103
  throw new (_bitError().BitError)(`unable to switch to lane "${laneName}", you're already checked out to this lane`);
81
104
  }
82
105
 
83
- const laneId = await consumer.getParsedLaneId(laneName);
106
+ const parsedLaneId = await consumer.getParsedLaneId(laneName);
84
107
  const localLane = currentLaneId.isDefault() ? null : await consumer.scope.loadLane(currentLaneId);
85
108
  let bitIds;
86
109
  let otherLane;
@@ -93,7 +116,7 @@ async function mergeLanes({
93
116
  bitIds = consumer.bitMap.getAuthoredAndImportedBitIdsOfDefaultLane().filter(id => id.hasVersion());
94
117
  otherLaneName = _laneId().DEFAULT_LANE;
95
118
  } else if (remoteName) {
96
- const remoteLaneId = _laneId().LaneId.from(laneId.name, remoteName);
119
+ const remoteLaneId = _laneId().LaneId.from(parsedLaneId.name, remoteName);
97
120
 
98
121
  remoteLane = await consumer.scope.objects.remoteLanes.getRemoteLane(remoteLaneId);
99
122
 
@@ -102,15 +125,46 @@ async function mergeLanes({
102
125
  }
103
126
 
104
127
  bitIds = await consumer.scope.objects.remoteLanes.getRemoteBitIds(remoteLaneId);
105
- otherLaneName = `${remoteName}/${laneId.name}`;
128
+ otherLaneName = `${remoteName}/${parsedLaneId.name}`;
106
129
  } else {
107
- otherLane = await consumer.scope.loadLane(laneId);
130
+ otherLane = await consumer.scope.loadLane(parsedLaneId);
108
131
  if (!otherLane) throw new (_bitError().BitError)(`unable to switch to "${laneName}", the lane was not found`);
109
132
  bitIds = otherLane.components.map(c => c.id.changeVersion(c.head.toString()));
110
- otherLaneName = laneId.name;
133
+ otherLaneName = parsedLaneId.name;
111
134
  }
112
135
 
113
- const allComponentsStatus = await getAllComponentsStatus();
136
+ let allComponentsStatus = await getAllComponentsStatus();
137
+ throwForFailures();
138
+
139
+ if (pattern) {
140
+ const componentIds = await workspace.resolveMultipleComponentIds(bitIds);
141
+ const compIdsFromPattern = workspace.scope.filterIdsFromPoolIdsByPattern(pattern, componentIds);
142
+ allComponentsStatus = await filterComponentsStatus(allComponentsStatus, compIdsFromPattern, bitIds, workspace, includeDeps);
143
+ bitIds.forEach(bitId => {
144
+ if (!allComponentsStatus.find(c => c.id.isEqualWithoutVersion(bitId))) {
145
+ allComponentsStatus.push({
146
+ id: bitId,
147
+ unmergedLegitimately: true,
148
+ unmergedMessage: `excluded by pattern`
149
+ });
150
+ }
151
+ });
152
+ }
153
+
154
+ if (existingOnWorkspaceOnly) {
155
+ const workspaceIds = await workspace.listIds();
156
+ const compIdsFromPattern = workspaceIds.filter(id => allComponentsStatus.find(c => c.id.isEqualWithoutVersion(id._legacy)));
157
+ allComponentsStatus = await filterComponentsStatus(allComponentsStatus, compIdsFromPattern, bitIds, workspace, includeDeps);
158
+ bitIds.forEach(bitId => {
159
+ if (!allComponentsStatus.find(c => c.id.isEqualWithoutVersion(bitId))) {
160
+ allComponentsStatus.push({
161
+ id: bitId,
162
+ unmergedLegitimately: true,
163
+ unmergedMessage: `not in the workspace`
164
+ });
165
+ }
166
+ });
167
+ }
114
168
 
115
169
  if (squash) {
116
170
  squashSnaps(allComponentsStatus, laneName, consumer);
@@ -120,7 +174,7 @@ async function mergeLanes({
120
174
  mergeStrategy,
121
175
  allComponentsStatus,
122
176
  remoteName,
123
- laneId,
177
+ laneId: parsedLaneId,
124
178
  localLane,
125
179
  noSnap,
126
180
  snapMessage,
@@ -156,7 +210,7 @@ async function mergeLanes({
156
210
  const tmp = new (_repositories().Tmp)(consumer.scope);
157
211
 
158
212
  try {
159
- const componentsStatus = await Promise.all(bitIds.map(bitId => merging.getComponentMergeStatus(bitId, localLane, otherLaneName, existingOnWorkspaceOnly)));
213
+ const componentsStatus = await Promise.all(bitIds.map(bitId => merging.getComponentMergeStatus(bitId, localLane, otherLaneName)));
160
214
  await tmp.clear();
161
215
  return componentsStatus;
162
216
  } catch (err) {
@@ -164,17 +218,90 @@ async function mergeLanes({
164
218
  throw err;
165
219
  }
166
220
  }
221
+
222
+ function throwForFailures() {
223
+ const failedComponents = allComponentsStatus.filter(c => c.unmergedMessage && !c.unmergedLegitimately);
224
+
225
+ if (failedComponents.length) {
226
+ const failureMsgs = failedComponents.map(failedComponent => `${_chalk().default.bold(failedComponent.id.toString())} - ${_chalk().default.red(failedComponent.unmergedMessage)}`).join('\n');
227
+ throw new (_bitError().BitError)(`unable to merge due to the following failures:\n${failureMsgs}`);
228
+ }
229
+ }
167
230
  }
168
231
 
169
- function squashSnaps(allComponentsStatus, laneName, consumer) {
170
- const failedComponents = allComponentsStatus.filter(c => c.failureMessage && !c.unchangedLegitimately);
232
+ async function filterComponentsStatus(allComponentsStatus, compIdsToKeep, allBitIds, workspace, includeDeps = false) {
233
+ const bitIdsFromPattern = _bitId().BitIds.fromArray(compIdsToKeep.map(c => c._legacy));
234
+
235
+ const bitIdsNotFromPattern = allBitIds.filter(bitId => !bitIdsFromPattern.hasWithoutVersion(bitId));
236
+ const filteredComponentStatus = [];
237
+ const depsToAdd = [];
238
+ await (0, _pMapSeries().default)(compIdsToKeep, async compId => {
239
+ const fromStatus = allComponentsStatus.find(c => c.id.isEqualWithoutVersion(compId._legacy));
240
+
241
+ if (!fromStatus) {
242
+ throw new Error(`filterComponentsStatus: unable to find ${compId.toString()} in component-status`);
243
+ }
171
244
 
172
- if (failedComponents.length) {
173
- const failureMsgs = failedComponents.map(failedComponent => `${_chalk().default.bold(failedComponent.id.toString())} - ${_chalk().default.red(failedComponent.failureMessage)}`).join('\n');
174
- throw new (_bitError().BitError)(`unable to squash due to the following failures:\n${failureMsgs}`);
245
+ filteredComponentStatus.push(fromStatus);
246
+
247
+ if (fromStatus.unmergedMessage) {
248
+ return;
249
+ }
250
+
251
+ const {
252
+ divergeData
253
+ } = fromStatus;
254
+
255
+ if (!divergeData) {
256
+ throw new Error(`filterComponentsStatus: unable to find divergeData for ${compId.toString()}`);
257
+ }
258
+
259
+ const remoteVersions = divergeData.snapsOnRemoteOnly;
260
+
261
+ if (!remoteVersions.length) {
262
+ return;
263
+ }
264
+
265
+ const modelComponent = await workspace.consumer.scope.getModelComponent(compId._legacy); // optimization suggestion: if squash is given, check only the last version.
266
+
267
+ await (0, _pMapSeries().default)(remoteVersions, async localVersion => {
268
+ const versionObj = await modelComponent.loadVersion(localVersion.toString(), workspace.consumer.scope.objects);
269
+ const flattenedDeps = versionObj.getAllFlattenedDependencies();
270
+ const depsNotIncludeInPattern = bitIdsNotFromPattern.filter(id => flattenedDeps.hasWithoutVersion(id));
271
+
272
+ if (!depsNotIncludeInPattern.length) {
273
+ return;
274
+ }
275
+
276
+ if (!includeDeps) {
277
+ throw new (_bitError().BitError)(`unable to merge ${compId.toString()}.
278
+ it has the following dependencies which were not included in the pattern. consider adding "--include-deps" flag
279
+ ${depsNotIncludeInPattern.map(d => d.toString()).join('\n')}`);
280
+ }
281
+
282
+ depsToAdd.push(...depsNotIncludeInPattern);
283
+ });
284
+ });
285
+
286
+ if (depsToAdd.length) {
287
+ const depsUniq = _bitId().BitIds.uniqFromArray(depsToAdd);
288
+
289
+ depsUniq.forEach(id => {
290
+ const fromStatus = allComponentsStatus.find(c => c.id.isEqualWithoutVersion(id));
291
+
292
+ if (!fromStatus) {
293
+ throw new Error(`filterComponentsStatus: unable to find ${id.toString()} in component-status`);
294
+ }
295
+
296
+ filteredComponentStatus.push(fromStatus);
297
+ });
175
298
  }
176
299
 
177
- const succeededComponents = allComponentsStatus.filter(c => !c.failureMessage);
300
+ return filteredComponentStatus;
301
+ }
302
+
303
+ function squashSnaps(allComponentsStatus, laneName, consumer) {
304
+ const succeededComponents = allComponentsStatus.filter(c => !c.unmergedMessage);
178
305
  succeededComponents.forEach(({
179
306
  id,
180
307
  divergeData,
@@ -1 +1 @@
1
- {"version":3,"names":["mergeLanes","merging","consumer","laneName","mergeStrategy","remoteName","noSnap","snapMessage","existingOnWorkspaceOnly","build","keepReadme","squash","currentLaneId","getCurrentLaneId","name","BitError","laneId","getParsedLaneId","localLane","isDefault","scope","loadLane","bitIds","otherLane","remoteLane","otherLaneName","isDefaultLane","DEFAULT_LANE","bitMap","getAuthoredAndImportedBitIdsOfDefaultLane","filter","id","hasVersion","remoteLaneId","LaneId","from","objects","remoteLanes","getRemoteLane","length","getRemoteBitIds","components","map","c","changeVersion","head","toString","allComponentsStatus","getAllComponentsStatus","squashSnaps","mergeResults","mergeSnaps","mergedSuccessfully","failedComponents","every","failedComponent","unchangedLegitimately","deleteResults","readmeComponent","syncWithLanes","workspaceLane","readmeComponentId","hash","remove","ids","force","remote","track","deleteFiles","readmeResult","tmp","Tmp","componentsStatus","Promise","all","bitId","getComponentMergeStatus","clear","err","failureMessage","failureMsgs","chalk","bold","red","join","succeededComponents","forEach","divergeData","componentFromModel","Error","isDiverged","isLocalAhead","isRemoteAhead","remoteSnaps","snapsOnRemoteOnly","commonSnapBeforeDiverge","addAsOnlyParent","parents","ref","removeParent","squashedSnaps","snap","isEqual","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 { Consumer } from '@teambit/legacy/dist/consumer';\nimport { ApplyVersionResults } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { LaneId, DEFAULT_LANE } from '@teambit/lane-id';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport { MergingMain, ComponentStatus } from '@teambit/merging';\nimport { remove } from '@teambit/legacy/dist/api/consumer';\nimport { MergeLaneOptions } from './lanes.main.runtime';\n\nexport async function mergeLanes({\n merging,\n consumer,\n laneName,\n mergeStrategy,\n remoteName,\n noSnap,\n snapMessage,\n existingOnWorkspaceOnly,\n build,\n keepReadme,\n squash,\n}: {\n merging: MergingMain;\n consumer: Consumer;\n laneName: string;\n} & MergeLaneOptions): Promise<{ mergeResults: ApplyVersionResults; deleteResults: any }> {\n const currentLaneId = consumer.getCurrentLaneId();\n if (!remoteName && laneName === currentLaneId.name) {\n throw new BitError(`unable to switch to lane \"${laneName}\", you're already checked out to this lane`);\n }\n const laneId = await consumer.getParsedLaneId(laneName);\n const localLane = currentLaneId.isDefault() ? null : await consumer.scope.loadLane(currentLaneId);\n let bitIds: BitId[];\n let otherLane: Lane | null | undefined;\n let remoteLane;\n let otherLaneName: string;\n const isDefaultLane = laneName === DEFAULT_LANE;\n\n if (isDefaultLane) {\n bitIds = consumer.bitMap.getAuthoredAndImportedBitIdsOfDefaultLane().filter((id) => id.hasVersion());\n otherLaneName = DEFAULT_LANE;\n } else if (remoteName) {\n const remoteLaneId = LaneId.from(laneId.name, remoteName);\n remoteLane = await consumer.scope.objects.remoteLanes.getRemoteLane(remoteLaneId);\n if (!remoteLane.length) {\n throw new BitError(\n `unable to switch to \"${laneName}\" of \"${remoteName}\", the remote lane was not found or not fetched locally`\n );\n }\n bitIds = await consumer.scope.objects.remoteLanes.getRemoteBitIds(remoteLaneId);\n otherLaneName = `${remoteName}/${laneId.name}`;\n } else {\n otherLane = await consumer.scope.loadLane(laneId);\n if (!otherLane) throw new BitError(`unable to switch to \"${laneName}\", the lane was not found`);\n bitIds = otherLane.components.map((c) => c.id.changeVersion(c.head.toString()));\n otherLaneName = laneId.name;\n }\n\n const allComponentsStatus = await getAllComponentsStatus();\n\n if (squash) {\n squashSnaps(allComponentsStatus, laneName, consumer);\n }\n\n const mergeResults = await merging.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n remoteName,\n laneId,\n localLane,\n noSnap,\n snapMessage,\n build,\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: `lane ${otherLane.name} doesn't have a readme component` };\n }\n\n return { mergeResults, deleteResults };\n\n async function getAllComponentsStatus(): Promise<ComponentStatus[]> {\n const tmp = new Tmp(consumer.scope);\n try {\n const componentsStatus = await Promise.all(\n bitIds.map((bitId) => merging.getComponentMergeStatus(bitId, localLane, otherLaneName, existingOnWorkspaceOnly))\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n }\n}\n\nfunction squashSnaps(allComponentsStatus: ComponentStatus[], laneName: string, consumer: Consumer) {\n const failedComponents = allComponentsStatus.filter((c) => c.failureMessage && !c.unchangedLegitimately);\n if (failedComponents.length) {\n const failureMsgs = failedComponents\n .map(\n (failedComponent) =>\n `${chalk.bold(failedComponent.id.toString())} - ${chalk.red(failedComponent.failureMessage as string)}`\n )\n .join('\\n');\n throw new BitError(`unable to squash due to the following failures:\\n${failureMsgs}`);\n }\n const succeededComponents = allComponentsStatus.filter((c) => !c.failureMessage);\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}\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Name","mergeStrategy","remoteName","noSnap","snapMessage","existingOnWorkspaceOnly","build","keepReadme","squash","pattern","includeDeps","consumer","currentLaneId","getCurrentLaneId","name","BitError","parsedLaneId","getParsedLaneId","localLane","isDefault","scope","loadLane","bitIds","otherLane","remoteLane","otherLaneName","isDefaultLane","DEFAULT_LANE","bitMap","getAuthoredAndImportedBitIdsOfDefaultLane","filter","id","hasVersion","remoteLaneId","LaneId","from","objects","remoteLanes","getRemoteLane","length","getRemoteBitIds","components","map","c","changeVersion","head","toString","allComponentsStatus","getAllComponentsStatus","throwForFailures","componentIds","resolveMultipleComponentIds","compIdsFromPattern","filterIdsFromPoolIdsByPattern","filterComponentsStatus","forEach","bitId","find","isEqualWithoutVersion","push","unmergedLegitimately","unmergedMessage","workspaceIds","listIds","_legacy","squashSnaps","mergeResults","mergeSnaps","laneId","mergedSuccessfully","failedComponents","every","failedComponent","unchangedLegitimately","deleteResults","readmeComponent","syncWithLanes","workspaceLane","readmeComponentId","hash","remove","ids","force","remote","track","deleteFiles","readmeResult","tmp","Tmp","componentsStatus","Promise","all","getComponentMergeStatus","clear","err","failureMsgs","chalk","bold","red","join","compIdsToKeep","allBitIds","bitIdsFromPattern","BitIds","fromArray","bitIdsNotFromPattern","hasWithoutVersion","filteredComponentStatus","depsToAdd","pMapSeries","compId","fromStatus","Error","divergeData","remoteVersions","snapsOnRemoteOnly","modelComponent","getModelComponent","localVersion","versionObj","loadVersion","flattenedDeps","getAllFlattenedDependencies","depsNotIncludeInPattern","d","depsUniq","uniqFromArray","succeededComponents","componentFromModel","isDiverged","isLocalAhead","isRemoteAhead","remoteSnaps","commonSnapBeforeDiverge","addAsOnlyParent","parents","ref","removeParent","squashedSnaps","snap","isEqual","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 { LaneId, 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 { MergeLaneOptions } from './lanes.main.runtime';\n\nexport async function mergeLanes({\n merging,\n workspace,\n laneName,\n mergeStrategy,\n remoteName,\n noSnap,\n snapMessage,\n existingOnWorkspaceOnly,\n build,\n keepReadme,\n squash,\n pattern,\n includeDeps,\n}: {\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 if (!remoteName && laneName === currentLaneId.name) {\n throw new BitError(`unable to switch to lane \"${laneName}\", you're already checked out to this lane`);\n }\n const parsedLaneId = await consumer.getParsedLaneId(laneName);\n const localLane = currentLaneId.isDefault() ? null : await consumer.scope.loadLane(currentLaneId);\n let bitIds: BitId[];\n let otherLane: Lane | null | undefined;\n let remoteLane;\n let otherLaneName: string;\n const isDefaultLane = laneName === DEFAULT_LANE;\n\n if (isDefaultLane) {\n bitIds = consumer.bitMap.getAuthoredAndImportedBitIdsOfDefaultLane().filter((id) => id.hasVersion());\n otherLaneName = DEFAULT_LANE;\n } else if (remoteName) {\n const remoteLaneId = LaneId.from(parsedLaneId.name, remoteName);\n remoteLane = await consumer.scope.objects.remoteLanes.getRemoteLane(remoteLaneId);\n if (!remoteLane.length) {\n throw new BitError(\n `unable to switch to \"${laneName}\" of \"${remoteName}\", the remote lane was not found or not fetched locally`\n );\n }\n bitIds = await consumer.scope.objects.remoteLanes.getRemoteBitIds(remoteLaneId);\n otherLaneName = `${remoteName}/${parsedLaneId.name}`;\n } else {\n otherLane = await consumer.scope.loadLane(parsedLaneId);\n if (!otherLane) throw new BitError(`unable to switch to \"${laneName}\", the lane was not found`);\n bitIds = otherLane.components.map((c) => c.id.changeVersion(c.head.toString()));\n otherLaneName = parsedLaneId.name;\n }\n\n let allComponentsStatus = await getAllComponentsStatus();\n\n throwForFailures();\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 );\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 if (squash) {\n squashSnaps(allComponentsStatus, laneName, consumer);\n }\n\n const mergeResults = await merging.mergeSnaps({\n mergeStrategy,\n allComponentsStatus,\n remoteName,\n laneId: parsedLaneId,\n localLane,\n noSnap,\n snapMessage,\n build,\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: `lane ${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, localLane, 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): 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 await pMapSeries(remoteVersions, async (localVersion) => {\n const versionObj = await modelComponent.loadVersion(localVersion.toString(), workspace.consumer.scope.objects);\n const flattenedDeps = versionObj.getAllFlattenedDependencies();\n const depsNotIncludeInPattern = bitIdsNotFromPattern.filter((id) => flattenedDeps.hasWithoutVersion(id));\n if (!depsNotIncludeInPattern.length) {\n return;\n }\n if (!includeDeps) {\n throw new BitError(`unable to merge ${compId.toString()}.\nit has the following dependencies which were not included in the pattern. consider adding \"--include-deps\" flag\n${depsNotIncludeInPattern.map((d) => d.toString()).join('\\n')}`);\n }\n depsToAdd.push(...depsNotIncludeInPattern);\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,OAD+B;EAE/BC,SAF+B;EAG/BC,QAH+B;EAI/BC,aAJ+B;EAK/BC,UAL+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/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
1
  {
2
2
  "name": "@teambit/lanes",
3
- "version": "0.0.347",
3
+ "version": "0.0.350",
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.347"
9
+ "version": "0.0.350"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -18,23 +18,24 @@
18
18
  "core-js": "^3.0.0",
19
19
  "@teambit/harmony": "0.3.3",
20
20
  "@teambit/bit-error": "0.0.394",
21
- "@teambit/cli": "0.0.513",
22
- "@teambit/merging": "0.0.90",
23
- "@teambit/scope": "0.0.775",
24
- "@teambit/workspace": "0.0.775",
25
- "@teambit/graphql": "0.0.775",
26
- "@teambit/community": "0.0.61",
27
- "@teambit/component": "0.0.775",
28
- "@teambit/lane-id": "0.0.32",
29
- "@teambit/lanes.modules.diff": "0.0.141",
21
+ "@teambit/cli": "0.0.515",
22
+ "@teambit/merging": "0.0.93",
23
+ "@teambit/scope": "0.0.778",
24
+ "@teambit/workspace": "0.0.778",
25
+ "@teambit/graphql": "0.0.778",
26
+ "@teambit/community": "0.0.63",
27
+ "@teambit/component": "0.0.778",
28
+ "@teambit/lane-id": "0.0.34",
29
+ "@teambit/lanes.modules.diff": "0.0.143",
30
30
  "@teambit/legacy-bit-id": "0.0.399",
31
- "@teambit/logger": "0.0.606",
31
+ "@teambit/logger": "0.0.608",
32
32
  "@teambit/design.ui.pages.not-found": "0.0.355",
33
- "@teambit/lanes.ui.lanes": "0.0.80",
34
- "@teambit/sidebar": "0.0.775",
33
+ "@teambit/lanes.ui.lanes": "0.0.82",
34
+ "@teambit/sidebar": "0.0.778",
35
35
  "@teambit/ui-foundation.ui.menu": "0.0.487",
36
36
  "@teambit/ui-foundation.ui.react-router.slot-router": "0.0.490",
37
- "@teambit/ui": "0.0.775"
37
+ "@teambit/ui": "0.0.778",
38
+ "@teambit/component-id": "0.0.402"
38
39
  },
39
40
  "devDependencies": {
40
41
  "@types/react": "^17.0.8",
@@ -50,7 +51,7 @@
50
51
  },
51
52
  "peerDependencies": {
52
53
  "react-router-dom": "^6.0.0",
53
- "@teambit/legacy": "1.0.294",
54
+ "@teambit/legacy": "1.0.296",
54
55
  "react-dom": "^16.8.0 || ^17.0.0",
55
56
  "react": "^16.8.0 || ^17.0.0"
56
57
  },
@@ -78,7 +79,7 @@
78
79
  "react": "-"
79
80
  },
80
81
  "peerDependencies": {
81
- "@teambit/legacy": "1.0.294",
82
+ "@teambit/legacy": "1.0.296",
82
83
  "react-dom": "^16.8.0 || ^17.0.0",
83
84
  "react": "^16.8.0 || ^17.0.0"
84
85
  }
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.347/dist/lanes.composition.js'
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.347/dist/lanes.docs.mdx'
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.350/dist/lanes.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.350/dist/lanes.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
- export const overview = [overview_0]
5
+ export const overview = [overview_0];