@teambit/lanes 0.0.492 → 0.0.494

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.
@@ -14,6 +14,7 @@ import { ImporterMain } from '@teambit/importer';
14
14
  import { Component, ComponentID, ComponentMain } from '@teambit/component';
15
15
  import { Lane } from '@teambit/legacy/dist/scope/models';
16
16
  import { ExportMain } from '@teambit/export';
17
+ import { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';
17
18
  import { MergingMain } from '@teambit/merging';
18
19
  export { Lane };
19
20
  export declare type LaneResults = {
@@ -85,6 +86,18 @@ export declare class LanesMain {
85
86
  * in this case, because we only bring the lane object and not the components, it's not easy to do the merge.
86
87
  */
87
88
  importLaneObject(laneId: LaneId, persistIfNotExists?: boolean): Promise<Lane>;
89
+ /**
90
+ * get the distance for a component between two lanes. for example, lane-b forked from lane-a and lane-b added some new snaps
91
+ * @param componentId
92
+ * @param sourceHead head on the source lane. leave empty if the source is main
93
+ * @param targetHead head on the target lane. leave empty if the target is main
94
+ * @returns
95
+ */
96
+ getSnapsDistance(componentId: ComponentID, sourceHead?: string, targetHead?: string): Promise<SnapsDistance>;
97
+ /**
98
+ * get the head hash (snap) of main. return undefined if the component exists only on a lane and was never merged to main
99
+ */
100
+ getHeadOnMain(componentId: ComponentID): Promise<string | undefined>;
88
101
  /**
89
102
  * fetch the lane object and its components from the remote.
90
103
  * save the objects to the local scope.
@@ -161,6 +161,13 @@ function _bitId() {
161
161
  };
162
162
  return data;
163
163
  }
164
+ function _objects() {
165
+ const data = require("@teambit/legacy/dist/scope/objects");
166
+ _objects = function () {
167
+ return data;
168
+ };
169
+ return data;
170
+ }
164
171
  function _merging() {
165
172
  const data = require("@teambit/merging");
166
173
  _merging = function () {
@@ -496,6 +503,33 @@ class LanesMain {
496
503
  return laneObject;
497
504
  }
498
505
 
506
+ /**
507
+ * get the distance for a component between two lanes. for example, lane-b forked from lane-a and lane-b added some new snaps
508
+ * @param componentId
509
+ * @param sourceHead head on the source lane. leave empty if the source is main
510
+ * @param targetHead head on the target lane. leave empty if the target is main
511
+ * @returns
512
+ */
513
+ async getSnapsDistance(componentId, sourceHead, targetHead) {
514
+ if (!sourceHead && !targetHead) throw new Error(`getDivergeData got sourceHead and targetHead empty. at least one of them should be populated`);
515
+ const modelComponent = await this.scope.legacyScope.getModelComponent(componentId._legacy);
516
+ return (0, _getDivergeData().getDivergeData)({
517
+ modelComponent,
518
+ repo: this.scope.legacyScope.objects,
519
+ sourceHead: sourceHead ? _objects().Ref.from(sourceHead) : modelComponent.head || null,
520
+ targetHead: targetHead ? _objects().Ref.from(targetHead) : modelComponent.head || null
521
+ });
522
+ }
523
+
524
+ /**
525
+ * get the head hash (snap) of main. return undefined if the component exists only on a lane and was never merged to main
526
+ */
527
+ async getHeadOnMain(componentId) {
528
+ var _modelComponent$head;
529
+ const modelComponent = await this.scope.legacyScope.getModelComponent(componentId._legacy);
530
+ return (_modelComponent$head = modelComponent.head) === null || _modelComponent$head === void 0 ? void 0 : _modelComponent$head.toString();
531
+ }
532
+
499
533
  /**
500
534
  * fetch the lane object and its components from the remote.
501
535
  * save the objects to the local scope.
@@ -614,14 +648,14 @@ class LanesMain {
614
648
  const divergeData = await (0, _getDivergeData().getDivergeData)({
615
649
  repo: this.scope.legacyScope.objects,
616
650
  modelComponent,
617
- remoteHead: refOnOtherLane,
618
- checkedOutLocalHead: comp.head
651
+ sourceHead: comp.head,
652
+ targetHead: refOnOtherLane
619
653
  });
620
- if (divergeData.isRemoteAhead() || divergeData.isDiverged()) {
654
+ if (divergeData.isTargetAhead() || divergeData.isDiverged()) {
621
655
  notUpToDateIds.push(comp.id);
622
656
  return;
623
657
  }
624
- if (!divergeData.isLocalAhead()) {
658
+ if (!divergeData.isSourceAhead()) {
625
659
  throw new Error(`invalid state - component ${comp.id.toString()} is not diverged, not local-ahead and not-remote-ahead.`);
626
660
  }
627
661
  upToDateIds.push(comp.id);
@@ -1 +1 @@
1
- {"version":3,"names":["LanesMain","constructor","workspace","scope","merging","componentAspect","logger","importer","exporter","getLanes","name","remote","merged","showDefaultLane","notMerged","showMergeData","Boolean","consumer","remoteObj","getRemoteByName","lanes","listLanes","DEFAULT_LANE","defaultLane","getLaneDataOfDefaultLane","legacyScope","getLanesData","push","getCurrentLaneName","getCurrentLaneId","getCurrentLaneNameOrAlias","currentLaneId","trackingData","getLocalTrackedLaneByRemoteName","getCurrentLane","laneId","isDefault","loadLane","getDefaultLaneId","LaneId","from","setCurrentLane","alias","exported","createLane","remoteScope","newLane","createLaneInScope","localLane","remoteLane","throwForInvalidLaneName","defaultScope","trackLaneData","trackLane","scopeJson","setLaneAsNew","onDestroy","id","localName","remoteName","BitError","parseLaneIdFromString","lane","beforeTrackData","getRemoteTrackedDataByLocalLane","beforeTrackDataCloned","undefined","afterTrackData","aliasLane","laneName","includes","LANE_REMOTE_DELIMITER","trackData","laneNameWithoutScope","split","removeTrackLane","changeScope","remoteScopeBefore","newLaneId","saveLane","bitMap","rename","currentName","newName","existingAliasWithNewName","remoteIdStr","objects","remoteLanes","renameRefByNewLaneName","currentLaneName","isExported","isLaneExported","clonedLaneToExport","clone","components","exportErr","exportLane","err","error","toString","message","exportMany","laneObject","ids","BitIds","idsWithFutureScope","allVersions","importLaneObject","persistIfNotExists","scopeComponentImporter","ScopeComponentsImporter","getInstance","results","importLanes","LaneNotFound","exists","fetchLaneWithItsComponents","debug","Error","importOptions","objectsOnly","verbose","writeConfig","override","installNpmPackages","laneIds","importedIds","importWithOptions","length","removeLanes","laneNames","opts","force","laneResults","switchLanes","merge","getAll","skipDependencyInstallation","mergeStrategy","mergeOptions","Object","keys","MergeOptions","join","switchProps","existingOnWorkspaceOnly","checkoutProps","skipNpmInstall","ignorePackageJson","ignoreDist","isLane","promptMergeOptions","reset","all","LaneSwitcher","switch","isLaneUpToDate","laneToCheck","checkAgainst","upToDateIds","notUpToDateIds","getHashOnAnotherLane","idOnLane","getComponent","head","modelComp","getModelComponent","Promise","map","comp","refOnOtherLane","isEqual","modelComponent","divergeData","getDivergeData","repo","remoteHead","checkedOutLocalHead","isRemoteAhead","isDiverged","isLocalAhead","isUpToDate","getDiff","values","diffOptions","pattern","laneDiffGenerator","LaneDiffGenerator","generate","getLaneComponentModels","host","getHost","laneComponentIds","getLaneComponentIds","getMany","laneComponents","bitIdsFromBitmap","getAllBitIdsFromAllLanes","filteredComponentIds","filter","laneComponent","some","bitmapComponentId","isEqualWithoutVersion","legacyIdWithVersion","changeVersion","resolveComponentId","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","component","getIdsOfDefaultLane","bitId","version","isMerged","hash","createRoutePath","deleteRoutePath","provider","cli","graphql","loggerMain","express","createLogger","lanesMain","switchCmd","SwitchCmd","laneCmd","LaneCmd","commands","LaneListCmd","LaneShowCmd","LaneCreateCmd","LaneRemoveCmd","LaneChangeScopeCmd","LaneAliasCmd","LaneRenameCmd","LaneDiffCmd","LaneAddReadmeCmd","LaneRemoveReadmeCmd","LaneImportCmd","register","lanesSchema","LanesCreateRoute","LanesDeleteRoute","CLIAspect","ScopeAspect","WorkspaceAspect","GraphqlAspect","MergingAspect","ComponentAspect","LoggerAspect","ImporterAspect","ExportAspect","ExpressAspect","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 { ExpressAspect, ExpressMain } from '@teambit/express';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport getRemoteByName from '@teambit/legacy/dist/remotes/get-remote-by-name';\nimport { LaneDiffCmd, LaneDiffGenerator, LaneDiffResults } from '@teambit/lanes.modules.diff';\nimport { LaneData } from '@teambit/legacy/dist/scope/lanes/lanes';\nimport { LaneId, DEFAULT_LANE, LANE_REMOTE_DELIMITER } from '@teambit/lane-id';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { DiffOptions } from '@teambit/legacy/dist/consumer/component-ops/components-diff';\nimport { MergeStrategy, MergeOptions } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { TrackLane } from '@teambit/legacy/dist/scope/scope-json';\nimport { ImporterAspect, ImporterMain, ImportOptions } from '@teambit/importer';\nimport ComponentAspect, { Component, ComponentID, ComponentMain } from '@teambit/component';\nimport removeLanes from '@teambit/legacy/dist/consumer/lanes/remove-lanes';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { LaneNotFound } from '@teambit/legacy/dist/api/scope/lib/exceptions/lane-not-found';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\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 { ExportAspect, ExportMain } from '@teambit/export';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport { MergingMain, MergingAspect } from '@teambit/merging';\nimport { LanesAspect } from './lanes.aspect';\nimport {\n LaneCmd,\n LaneCreateCmd,\n LaneImportCmd,\n LaneListCmd,\n LaneRemoveCmd,\n LaneShowCmd,\n LaneChangeScopeCmd,\n LaneAliasCmd,\n LaneRenameCmd,\n LaneAddReadmeCmd,\n LaneRemoveReadmeCmd,\n} from './lane.cmd';\nimport { lanesSchema } from './lanes.graphql';\nimport { SwitchCmd } from './switch.cmd';\nimport { LaneSwitcher } from './switch-lanes';\nimport { createLane, createLaneInScope, throwForInvalidLaneName } from './create-lane';\nimport { LanesCreateRoute } from './lanes.create.route';\nimport { LanesDeleteRoute } from './lanes.delete.route';\n\nexport { Lane };\n\nexport type LaneResults = {\n lanes: LaneData[];\n currentLane?: string | null;\n};\n\nexport type CreateLaneOptions = {\n remoteScope?: string; // default to the defaultScope in workspace.jsonc\n alias?: string; // default to the remote name\n};\n\nexport type SwitchLaneOptions = {\n alias?: string;\n merge?: MergeStrategy;\n getAll?: boolean;\n skipDependencyInstallation?: boolean;\n verbose?: boolean;\n override?: boolean;\n};\n\nexport class LanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private scope: ScopeMain,\n private merging: MergingMain,\n private componentAspect: ComponentMain,\n public logger: Logger,\n private importer: ImporterMain,\n private exporter: ExportMain\n ) {}\n\n async getLanes({\n name,\n remote,\n merged,\n showDefaultLane,\n notMerged,\n }: {\n name?: string;\n remote?: string;\n merged?: boolean;\n showDefaultLane?: boolean;\n notMerged?: boolean;\n }): Promise<LaneData[]> {\n const showMergeData = Boolean(merged || notMerged);\n const consumer = this.workspace?.consumer;\n if (remote) {\n const remoteObj = await getRemoteByName(remote, consumer);\n const lanes = await remoteObj.listLanes(name, showMergeData);\n return lanes;\n }\n\n if (name === DEFAULT_LANE) {\n const defaultLane = await this.getLaneDataOfDefaultLane();\n return defaultLane ? [defaultLane] : [];\n }\n\n const lanes = await this.scope.legacyScope.lanes.getLanesData(this.scope.legacyScope, name, showMergeData);\n\n if (showDefaultLane) {\n const defaultLane = await this.getLaneDataOfDefaultLane();\n if (defaultLane) lanes.push(defaultLane);\n }\n\n return lanes;\n }\n\n getCurrentLaneName(): string | null {\n return this.getCurrentLaneId()?.name || null;\n }\n\n getCurrentLaneNameOrAlias(): string | null {\n const currentLaneId = this.getCurrentLaneId();\n if (!currentLaneId) return null;\n const trackingData = this.scope.legacyScope.lanes.getLocalTrackedLaneByRemoteName(\n currentLaneId.name,\n currentLaneId.scope\n );\n return trackingData || currentLaneId.name;\n }\n\n getCurrentLaneId(): LaneId | null {\n if (!this.workspace) return null;\n return this.workspace.consumer.getCurrentLaneId();\n }\n\n /**\n * get the currently checked out lane object, if on main - return null.\n */\n async getCurrentLane(): Promise<Lane | null> {\n const laneId = this.getCurrentLaneId();\n if (!laneId || laneId.isDefault()) return null;\n return this.loadLane(laneId);\n }\n\n getDefaultLaneId(): LaneId {\n return LaneId.from(DEFAULT_LANE, this.scope.name);\n }\n\n setCurrentLane(laneId: LaneId, alias?: string, exported?: boolean) {\n this.workspace?.consumer.setCurrentLane(laneId, exported);\n }\n\n async createLane(name: string, { remoteScope, alias }: CreateLaneOptions = {}): Promise<TrackLane> {\n if (!this.workspace) {\n const newLane = await createLaneInScope(name, this.scope);\n return {\n localLane: newLane.name,\n remoteLane: newLane.name,\n remoteScope: this.scope.name,\n };\n }\n if (alias) {\n throwForInvalidLaneName(alias);\n }\n const scope = remoteScope || this.workspace.defaultScope;\n await createLane(this.workspace.consumer, name, scope);\n const laneId = LaneId.from(name, scope);\n this.setCurrentLane(laneId, alias, false);\n const trackLaneData = {\n localLane: alias || name,\n remoteLane: name,\n remoteScope: scope,\n };\n this.scope.legacyScope.lanes.trackLane(trackLaneData);\n this.scope.legacyScope.scopeJson.setLaneAsNew(name);\n await this.workspace.consumer.onDestroy();\n\n return trackLaneData;\n }\n\n async loadLane(id: LaneId): Promise<Lane | null> {\n return this.scope.legacyScope.lanes.loadLane(id);\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.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.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.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${laneName}\"`);\n }\n const remoteScopeBefore = lane.scope;\n lane.scope = remoteScope;\n const newLaneId = LaneId.from(laneId.name, remoteScope);\n const trackData = {\n localLane: laneNameWithoutScope,\n remoteLane: laneId.name,\n remoteScope,\n };\n this.scope.legacyScope.lanes.trackLane(trackData);\n await this.scope.legacyScope.lanes.saveLane(lane);\n this.workspace.consumer.bitMap.setCurrentLane(newLaneId, false);\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.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${currentName}\"`);\n }\n\n // rename the ref file\n await this.scope.legacyScope.objects.remoteLanes.renameRefByNewLaneName(laneNameWithoutScope, newName, lane.scope);\n\n // change tracking data\n const afterTrackData = {\n localLane: newName,\n remoteLane: newName,\n remoteScope: lane.scope,\n };\n this.scope.legacyScope.lanes.trackLane(afterTrackData);\n this.scope.legacyScope.lanes.removeTrackLane(laneNameWithoutScope);\n\n // change the lane object\n lane.name = newName;\n await this.scope.legacyScope.lanes.saveLane(lane);\n\n // change current-lane if needed\n const currentLaneName = this.getCurrentLaneName();\n if (currentLaneName === laneNameWithoutScope) {\n const newLaneId = LaneId.from(newName, lane.scope);\n const isExported = this.workspace.consumer.bitMap.isLaneExported;\n this.setCurrentLane(newLaneId, undefined, isExported);\n }\n\n // export the lane with only the name-change\n const clonedLaneToExport = lane.clone();\n clonedLaneToExport.components = []; // otherwise, it'll export the changes done on the components.\n let exported = false;\n let exportErr: Error | undefined;\n try {\n await this.exportLane(clonedLaneToExport);\n exported = true;\n } catch (err: any) {\n this.logger.error(`unable to export ${lane.id.toString()}: ${err.message}`);\n exportErr = err;\n }\n\n await this.workspace.consumer.onDestroy();\n\n return { exported, exportErr };\n }\n\n async exportLane(lane: Lane) {\n await this.exporter.exportMany({\n scope: this.scope.legacyScope,\n laneObject: lane,\n ids: new BitIds(),\n idsWithFutureScope: new BitIds(),\n allVersions: false,\n });\n }\n\n /**\n * get a Lane object from the remote.\n * `persistIfNotExists` saves the object in the local scope only if the lane is not there yet.\n * otherwise, it needs some merging mechanism, which is done differently whether it's export or import.\n * see `sources.mergeLane()` for export and `import-components._saveLaneDataIfNeeded()` for import.\n * in this case, because we only bring the lane object and not the components, it's not easy to do the merge.\n */\n async importLaneObject(laneId: LaneId, persistIfNotExists = true): Promise<Lane> {\n const legacyScope = this.scope.legacyScope;\n const scopeComponentImporter = ScopeComponentsImporter.getInstance(legacyScope);\n const results = await scopeComponentImporter.importLanes([laneId]);\n const laneObject = results[0];\n if (!laneObject) throw new LaneNotFound(laneId.scope, laneId.name);\n\n if (persistIfNotExists) {\n const exists = await legacyScope.loadLane(laneId);\n if (!exists) {\n await legacyScope.lanes.saveLane(laneObject);\n }\n }\n\n return laneObject;\n }\n\n /**\n * fetch the lane object and its components from the remote.\n * save the objects to the local scope.\n * this method doesn't change anything in the workspace.\n */\n async fetchLaneWithItsComponents(laneId: LaneId): Promise<Lane> {\n this.logger.debug(`fetching lane ${laneId.toString()}`);\n if (!this.workspace) {\n throw new BitError('unable to fetch lanes outside of Bit workspace');\n }\n const lane = await this.importLaneObject(laneId);\n if (!lane) throw new Error(`unable to import lane ${laneId.toString()} from the remote`);\n const importOptions: ImportOptions = {\n ids: [],\n objectsOnly: true,\n verbose: false,\n writeConfig: false,\n override: false,\n installNpmPackages: false,\n lanes: { laneIds: [laneId], lanes: [lane] },\n };\n const { importedIds } = await this.importer.importWithOptions(importOptions);\n this.logger.debug(`fetching lane ${laneId.toString()} done, fetched ${importedIds.length} components`);\n return lane;\n }\n\n async removeLanes(laneNames: string[], opts?: { remote: boolean; force: boolean }): Promise<string[]> {\n if (!this.workspace && !opts?.remote) {\n await this.scope.legacyScope.lanes.removeLanes(this.scope.legacyScope, laneNames, true);\n return laneNames;\n }\n const results = await removeLanes(this.workspace?.consumer, laneNames, !!opts?.remote, !!opts?.force);\n if (this.workspace) await this.workspace.consumer.onDestroy();\n\n return results.laneResults;\n }\n\n /**\n * switch to a different local or remote lane.\n * switching to a remote lane also imports and writes the components of that remote lane.\n * by default, only the components existing on the workspace will be imported from that lane, unless the \"getAll\"\n * flag is true.\n */\n async switchLanes(\n laneName: string,\n { alias, merge, getAll = false, skipDependencyInstallation = false }: SwitchLaneOptions\n ) {\n if (!this.workspace) {\n throw new BitError(`unable to switch lanes outside of Bit workspace`);\n }\n let mergeStrategy;\n if (merge && typeof merge === 'string') {\n const mergeOptions = Object.keys(MergeOptions);\n if (!mergeOptions.includes(merge)) {\n throw new BitError(`merge must be one of the following: ${mergeOptions.join(', ')}`);\n }\n mergeStrategy = merge;\n }\n if (alias) {\n throwForInvalidLaneName(alias);\n }\n\n const switchProps = {\n laneName,\n existingOnWorkspaceOnly: !getAll,\n alias,\n };\n const checkoutProps = {\n mergeStrategy,\n skipNpmInstall: skipDependencyInstallation,\n verbose: false, // not relevant in Harmony\n ignorePackageJson: true, // not relevant in Harmony\n ignoreDist: true, // not relevant in Harmony\n isLane: true,\n promptMergeOptions: false,\n writeConfig: false,\n reset: false,\n all: false,\n };\n return new LaneSwitcher(this.workspace, this.logger, switchProps, checkoutProps, this).switch();\n }\n\n /**\n * check whether the given lane is up-to-date against \"checkAgainst\", if this param is null, it checks it against main.\n */\n async isLaneUpToDate(laneToCheck: Lane, checkAgainst?: Lane): Promise<boolean> {\n const upToDateIds: BitId[] = [];\n const notUpToDateIds: BitId[] = [];\n const getHashOnAnotherLane = async (id: BitId): Promise<Ref | undefined> => {\n if (checkAgainst) {\n const idOnLane = checkAgainst.getComponent(id);\n return idOnLane?.head;\n }\n const modelComp = await this.scope.legacyScope.getModelComponent(id);\n return modelComp.head;\n };\n await Promise.all(\n laneToCheck.components.map(async (comp) => {\n const refOnOtherLane = await getHashOnAnotherLane(comp.id);\n if (!refOnOtherLane) {\n upToDateIds.push(comp.id);\n return;\n }\n if (comp.head.isEqual(refOnOtherLane)) {\n upToDateIds.push(comp.id);\n return;\n }\n const modelComponent = await this.scope.legacyScope.getModelComponent(comp.id);\n const divergeData = await getDivergeData({\n repo: this.scope.legacyScope.objects,\n modelComponent,\n remoteHead: refOnOtherLane,\n checkedOutLocalHead: comp.head,\n });\n if (divergeData.isRemoteAhead() || divergeData.isDiverged()) {\n notUpToDateIds.push(comp.id);\n return;\n }\n if (!divergeData.isLocalAhead()) {\n throw new Error(\n `invalid state - component ${comp.id.toString()} is not diverged, not local-ahead and not-remote-ahead.`\n );\n }\n upToDateIds.push(comp.id);\n })\n );\n\n const isUpToDate = !notUpToDateIds.length;\n\n return isUpToDate;\n }\n\n /**\n * the values array may include zero to two values and will be processed as following:\n * [] => diff between the current lane and default lane. (only inside workspace).\n * [to] => diff between the current lane (or default-lane when in scope) and \"to\" lane.\n * [from, to] => diff between \"from\" lane and \"to\" lane.\n */\n public async getDiff(values: string[], diffOptions: DiffOptions = {}, pattern?: string): Promise<LaneDiffResults> {\n const laneDiffGenerator = new LaneDiffGenerator(this.workspace, this.scope);\n return laneDiffGenerator.generate(values, diffOptions, pattern);\n }\n\n async getLaneComponentModels(lane: LaneData): Promise<Component[]> {\n const host = this.componentAspect.getHost();\n const laneComponentIds = await this.getLaneComponentIds(lane);\n const components = await host.getMany(laneComponentIds);\n return components;\n }\n\n async getLaneComponentIds(lane: LaneData): Promise<ComponentID[]> {\n if (!lane) return [];\n\n const laneComponents = lane.components;\n const workspace = this.workspace;\n const bitIdsFromBitmap = workspace ? workspace.consumer.bitMap.getAllBitIdsFromAllLanes() : [];\n\n const filteredComponentIds = workspace\n ? laneComponents.filter((laneComponent) =>\n bitIdsFromBitmap.some((bitmapComponentId) => bitmapComponentId.isEqualWithoutVersion(laneComponent.id))\n )\n : laneComponents;\n\n const host = this.componentAspect.getHost();\n\n return Promise.all(\n filteredComponentIds.map((laneComponent) => {\n const legacyIdWithVersion = laneComponent.id.changeVersion(laneComponent.head);\n return host.resolveComponentId(legacyIdWithVersion);\n })\n );\n }\n\n async getLaneReadmeComponent(lane: LaneData): Promise<Component | undefined> {\n if (!lane) return undefined;\n const laneReadmeComponent = lane.readmeComponent;\n if (!laneReadmeComponent) return undefined;\n const host = this.componentAspect.getHost();\n const laneReadmeComponentId = await host.resolveComponentId(\n laneReadmeComponent.id.changeVersion(laneReadmeComponent.head)\n );\n const readmeComponent = await host.get(laneReadmeComponentId);\n return readmeComponent;\n }\n\n async removeLaneReadme(laneName?: string): Promise<{ result: boolean; message?: string }> {\n if (!this.workspace) {\n throw new BitError('unable to remove the lane readme component outside of Bit workspace');\n }\n const currentLaneName = this.getCurrentLaneName();\n\n if (!laneName && !currentLaneName) {\n return {\n result: false,\n message: 'unable to remove the lane readme component. Either pass a laneName or switch to a lane',\n };\n }\n\n const scope: LegacyScope = this.workspace.scope.legacyScope;\n const laneId: LaneId = laneName\n ? await scope.lanes.parseLaneIdFromString(laneName)\n : (this.getCurrentLaneId() as LaneId);\n const lane: Lane | null | undefined = await scope.loadLane(laneId);\n\n if (!lane?.readmeComponent) {\n throw new BitError(`there is no readme component added to the lane ${laneName || currentLaneName}`);\n }\n\n const readmeComponentId = await this.workspace.resolveComponentId(lane.readmeComponent.id);\n const existingLaneConfig =\n (await this.workspace.getSpecificComponentConfig(readmeComponentId, LanesAspect.id)) || {};\n\n const remoteLaneIdStr = lane.toLaneId().toString();\n\n if (existingLaneConfig.readme) {\n delete existingLaneConfig.readme[remoteLaneIdStr];\n await this.workspace.removeSpecificComponentConfig(readmeComponentId, LanesAspect.id, false);\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, existingLaneConfig);\n }\n\n lane.setReadmeComponent(undefined);\n await scope.lanes.saveLane(lane);\n await this.workspace.bitMap.write();\n\n return { result: true };\n }\n\n async addLaneReadme(readmeComponentIdStr: string, laneName?: string): Promise<{ result: boolean; message?: string }> {\n if (!this.workspace) {\n throw new BitError(`unable to track a lane readme component outside of Bit workspace`);\n }\n const readmeComponentId = await this.workspace.resolveComponentId(readmeComponentIdStr);\n\n const readmeComponentBitId = readmeComponentId._legacy;\n const scope: LegacyScope = this.workspace.scope.legacyScope;\n const laneId: LaneId = laneName\n ? await scope.lanes.parseLaneIdFromString(laneName)\n : (this.getCurrentLaneId() as LaneId);\n\n const lane: Lane | null | undefined = await scope.loadLane(laneId);\n\n if (!lane) {\n return { result: false, message: `cannot find lane ${laneName}` };\n }\n\n lane.setReadmeComponent(readmeComponentBitId);\n await scope.lanes.saveLane(lane);\n\n const existingLaneConfig =\n (await this.workspace.getSpecificComponentConfig(readmeComponentId, LanesAspect.id)) || {};\n\n const remoteLaneIdStr = lane.toLaneId().toString();\n\n if (existingLaneConfig.readme) {\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, {\n ...existingLaneConfig,\n readme: {\n ...existingLaneConfig.readme,\n [remoteLaneIdStr]: true,\n },\n });\n } else {\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, {\n ...existingLaneConfig,\n readme: {\n [remoteLaneIdStr]: true,\n },\n });\n }\n await this.workspace.bitMap.write();\n return { result: true };\n }\n\n private async getLaneDataOfDefaultLane(): Promise<LaneData | null> {\n const consumer = this.workspace?.consumer;\n let bitIds: BitId[] = [];\n if (!consumer) {\n const scopeComponents = await this.scope.list();\n bitIds = scopeComponents.filter((component) => component.head).map((component) => component.id._legacy);\n } else {\n bitIds = await consumer.getIdsOfDefaultLane();\n }\n\n return {\n name: DEFAULT_LANE,\n remote: null,\n id: this.getDefaultLaneId(),\n components: bitIds.map((bitId) => ({ id: bitId, head: bitId.version as string })),\n isMerged: null,\n hash: '',\n };\n }\n\n get createRoutePath() {\n return '/lanes/create';\n }\n\n get deleteRoutePath() {\n return '/lanes/delete';\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n ScopeAspect,\n WorkspaceAspect,\n GraphqlAspect,\n MergingAspect,\n ComponentAspect,\n LoggerAspect,\n ImporterAspect,\n ExportAspect,\n ExpressAspect,\n ];\n static runtime = MainRuntime;\n static async provider([cli, scope, workspace, graphql, merging, component, loggerMain, importer, exporter, express]: [\n CLIMain,\n ScopeMain,\n Workspace,\n GraphqlMain,\n MergingMain,\n ComponentMain,\n LoggerMain,\n ImporterMain,\n ExportMain,\n ExpressMain\n ]) {\n const logger = loggerMain.createLogger(LanesAspect.id);\n const lanesMain = new LanesMain(workspace, scope, merging, component, logger, importer, exporter);\n const switchCmd = new SwitchCmd(lanesMain);\n const laneCmd = new LaneCmd(lanesMain, workspace, scope);\n laneCmd.commands = [\n new LaneListCmd(lanesMain, workspace, scope),\n switchCmd,\n new LaneShowCmd(lanesMain, workspace, scope),\n new LaneCreateCmd(lanesMain),\n new LaneRemoveCmd(lanesMain),\n new LaneChangeScopeCmd(lanesMain),\n new LaneAliasCmd(lanesMain),\n new LaneRenameCmd(lanesMain),\n new LaneDiffCmd(workspace, scope),\n new LaneAddReadmeCmd(lanesMain),\n new LaneRemoveReadmeCmd(lanesMain),\n new LaneImportCmd(switchCmd),\n ];\n cli.register(laneCmd, switchCmd);\n graphql.register(lanesSchema(lanesMain));\n express.register([new LanesCreateRoute(lanesMain, logger), new LanesDeleteRoute(lanesMain, logger)]);\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;I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,SAAS,CAAC,EAC3B,KAAIY,qBAAa,EAACZ,SAAS,CAAC,EAC5B,KAAIa,2BAAW,EAACjQ,SAAS,EAAEC,KAAK,CAAC,EACjC,KAAIiQ,wBAAgB,EAACd,SAAS,CAAC,EAC/B,KAAIe,2BAAmB,EAACf,SAAS,CAAC,EAClC,KAAIgB,qBAAa,EAACf,SAAS,CAAC,CAC7B;IACDN,GAAG,CAACsB,QAAQ,CAACd,OAAO,EAAEF,SAAS,CAAC;IAChCL,OAAO,CAACqB,QAAQ,CAAC,IAAAC,qBAAW,EAAClB,SAAS,CAAC,CAAC;IACxCF,OAAO,CAACmB,QAAQ,CAAC,CAAC,KAAIE,+BAAgB,EAACnB,SAAS,EAAEhP,MAAM,CAAC,EAAE,KAAIoQ,+BAAgB,EAACpB,SAAS,EAAEhP,MAAM,CAAC,CAAC,CAAC;IACpG,OAAOgP,SAAS;EAClB;AACF;AAAC;AAAA,gCAvoBYtP,SAAS,WAslBL,EAAE;AAAA,gCAtlBNA,SAAS,kBAulBE,CACpB2Q,gBAAS,EACTC,oBAAW,EACXC,4BAAe,EACfC,wBAAa,EACbC,wBAAa,EACbC,oBAAe,EACfC,sBAAY,EACZC,0BAAc,EACdC,sBAAY,EACZC,wBAAa,CACd;AAAA,gCAlmBUpR,SAAS,aAmmBHqR,kBAAW;AAsC9B5D,oBAAW,CAAC6D,UAAU,CAACtR,SAAS,CAAC;AAAC,eAEnBA,SAAS;AAAA"}
1
+ {"version":3,"names":["LanesMain","constructor","workspace","scope","merging","componentAspect","logger","importer","exporter","getLanes","name","remote","merged","showDefaultLane","notMerged","showMergeData","Boolean","consumer","remoteObj","getRemoteByName","lanes","listLanes","DEFAULT_LANE","defaultLane","getLaneDataOfDefaultLane","legacyScope","getLanesData","push","getCurrentLaneName","getCurrentLaneId","getCurrentLaneNameOrAlias","currentLaneId","trackingData","getLocalTrackedLaneByRemoteName","getCurrentLane","laneId","isDefault","loadLane","getDefaultLaneId","LaneId","from","setCurrentLane","alias","exported","createLane","remoteScope","newLane","createLaneInScope","localLane","remoteLane","throwForInvalidLaneName","defaultScope","trackLaneData","trackLane","scopeJson","setLaneAsNew","onDestroy","id","localName","remoteName","BitError","parseLaneIdFromString","lane","beforeTrackData","getRemoteTrackedDataByLocalLane","beforeTrackDataCloned","undefined","afterTrackData","aliasLane","laneName","includes","LANE_REMOTE_DELIMITER","trackData","laneNameWithoutScope","split","removeTrackLane","changeScope","remoteScopeBefore","newLaneId","saveLane","bitMap","rename","currentName","newName","existingAliasWithNewName","remoteIdStr","objects","remoteLanes","renameRefByNewLaneName","currentLaneName","isExported","isLaneExported","clonedLaneToExport","clone","components","exportErr","exportLane","err","error","toString","message","exportMany","laneObject","ids","BitIds","idsWithFutureScope","allVersions","importLaneObject","persistIfNotExists","scopeComponentImporter","ScopeComponentsImporter","getInstance","results","importLanes","LaneNotFound","exists","getSnapsDistance","componentId","sourceHead","targetHead","Error","modelComponent","getModelComponent","_legacy","getDivergeData","repo","Ref","head","getHeadOnMain","fetchLaneWithItsComponents","debug","importOptions","objectsOnly","verbose","writeConfig","override","installNpmPackages","laneIds","importedIds","importWithOptions","length","removeLanes","laneNames","opts","force","laneResults","switchLanes","merge","getAll","skipDependencyInstallation","mergeStrategy","mergeOptions","Object","keys","MergeOptions","join","switchProps","existingOnWorkspaceOnly","checkoutProps","skipNpmInstall","ignorePackageJson","ignoreDist","isLane","promptMergeOptions","reset","all","LaneSwitcher","switch","isLaneUpToDate","laneToCheck","checkAgainst","upToDateIds","notUpToDateIds","getHashOnAnotherLane","idOnLane","getComponent","modelComp","Promise","map","comp","refOnOtherLane","isEqual","divergeData","isTargetAhead","isDiverged","isSourceAhead","isUpToDate","getDiff","values","diffOptions","pattern","laneDiffGenerator","LaneDiffGenerator","generate","getLaneComponentModels","host","getHost","laneComponentIds","getLaneComponentIds","getMany","laneComponents","bitIdsFromBitmap","getAllBitIdsFromAllLanes","filteredComponentIds","filter","laneComponent","some","bitmapComponentId","isEqualWithoutVersion","legacyIdWithVersion","changeVersion","resolveComponentId","getLaneReadmeComponent","laneReadmeComponent","readmeComponent","laneReadmeComponentId","get","removeLaneReadme","result","readmeComponentId","existingLaneConfig","getSpecificComponentConfig","LanesAspect","remoteLaneIdStr","toLaneId","readme","removeSpecificComponentConfig","addSpecificComponentConfig","setReadmeComponent","write","addLaneReadme","readmeComponentIdStr","readmeComponentBitId","bitIds","scopeComponents","list","component","getIdsOfDefaultLane","bitId","version","isMerged","hash","createRoutePath","deleteRoutePath","provider","cli","graphql","loggerMain","express","createLogger","lanesMain","switchCmd","SwitchCmd","laneCmd","LaneCmd","commands","LaneListCmd","LaneShowCmd","LaneCreateCmd","LaneRemoveCmd","LaneChangeScopeCmd","LaneAliasCmd","LaneRenameCmd","LaneDiffCmd","LaneAddReadmeCmd","LaneRemoveReadmeCmd","LaneImportCmd","register","lanesSchema","LanesCreateRoute","LanesDeleteRoute","CLIAspect","ScopeAspect","WorkspaceAspect","GraphqlAspect","MergingAspect","ComponentAspect","LoggerAspect","ImporterAspect","ExportAspect","ExpressAspect","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 { ExpressAspect, ExpressMain } from '@teambit/express';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport getRemoteByName from '@teambit/legacy/dist/remotes/get-remote-by-name';\nimport { LaneDiffCmd, LaneDiffGenerator, LaneDiffResults } from '@teambit/lanes.modules.diff';\nimport { LaneData } from '@teambit/legacy/dist/scope/lanes/lanes';\nimport { LaneId, DEFAULT_LANE, LANE_REMOTE_DELIMITER } from '@teambit/lane-id';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { DiffOptions } from '@teambit/legacy/dist/consumer/component-ops/components-diff';\nimport { MergeStrategy, MergeOptions } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { TrackLane } from '@teambit/legacy/dist/scope/scope-json';\nimport { ImporterAspect, ImporterMain, ImportOptions } from '@teambit/importer';\nimport ComponentAspect, { Component, ComponentID, ComponentMain } from '@teambit/component';\nimport removeLanes from '@teambit/legacy/dist/consumer/lanes/remove-lanes';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { LaneNotFound } from '@teambit/legacy/dist/api/scope/lib/exceptions/lane-not-found';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\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 { ExportAspect, ExportMain } from '@teambit/export';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport { MergingMain, MergingAspect } from '@teambit/merging';\nimport { LanesAspect } from './lanes.aspect';\nimport {\n LaneCmd,\n LaneCreateCmd,\n LaneImportCmd,\n LaneListCmd,\n LaneRemoveCmd,\n LaneShowCmd,\n LaneChangeScopeCmd,\n LaneAliasCmd,\n LaneRenameCmd,\n LaneAddReadmeCmd,\n LaneRemoveReadmeCmd,\n} from './lane.cmd';\nimport { lanesSchema } from './lanes.graphql';\nimport { SwitchCmd } from './switch.cmd';\nimport { LaneSwitcher } from './switch-lanes';\nimport { createLane, createLaneInScope, throwForInvalidLaneName } from './create-lane';\nimport { LanesCreateRoute } from './lanes.create.route';\nimport { LanesDeleteRoute } from './lanes.delete.route';\n\nexport { Lane };\n\nexport type LaneResults = {\n lanes: LaneData[];\n currentLane?: string | null;\n};\n\nexport type CreateLaneOptions = {\n remoteScope?: string; // default to the defaultScope in workspace.jsonc\n alias?: string; // default to the remote name\n};\n\nexport type SwitchLaneOptions = {\n alias?: string;\n merge?: MergeStrategy;\n getAll?: boolean;\n skipDependencyInstallation?: boolean;\n verbose?: boolean;\n override?: boolean;\n};\n\nexport class LanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private scope: ScopeMain,\n private merging: MergingMain,\n private componentAspect: ComponentMain,\n public logger: Logger,\n private importer: ImporterMain,\n private exporter: ExportMain\n ) {}\n\n async getLanes({\n name,\n remote,\n merged,\n showDefaultLane,\n notMerged,\n }: {\n name?: string;\n remote?: string;\n merged?: boolean;\n showDefaultLane?: boolean;\n notMerged?: boolean;\n }): Promise<LaneData[]> {\n const showMergeData = Boolean(merged || notMerged);\n const consumer = this.workspace?.consumer;\n if (remote) {\n const remoteObj = await getRemoteByName(remote, consumer);\n const lanes = await remoteObj.listLanes(name, showMergeData);\n return lanes;\n }\n\n if (name === DEFAULT_LANE) {\n const defaultLane = await this.getLaneDataOfDefaultLane();\n return defaultLane ? [defaultLane] : [];\n }\n\n const lanes = await this.scope.legacyScope.lanes.getLanesData(this.scope.legacyScope, name, showMergeData);\n\n if (showDefaultLane) {\n const defaultLane = await this.getLaneDataOfDefaultLane();\n if (defaultLane) lanes.push(defaultLane);\n }\n\n return lanes;\n }\n\n getCurrentLaneName(): string | null {\n return this.getCurrentLaneId()?.name || null;\n }\n\n getCurrentLaneNameOrAlias(): string | null {\n const currentLaneId = this.getCurrentLaneId();\n if (!currentLaneId) return null;\n const trackingData = this.scope.legacyScope.lanes.getLocalTrackedLaneByRemoteName(\n currentLaneId.name,\n currentLaneId.scope\n );\n return trackingData || currentLaneId.name;\n }\n\n getCurrentLaneId(): LaneId | null {\n if (!this.workspace) return null;\n return this.workspace.consumer.getCurrentLaneId();\n }\n\n /**\n * get the currently checked out lane object, if on main - return null.\n */\n async getCurrentLane(): Promise<Lane | null> {\n const laneId = this.getCurrentLaneId();\n if (!laneId || laneId.isDefault()) return null;\n return this.loadLane(laneId);\n }\n\n getDefaultLaneId(): LaneId {\n return LaneId.from(DEFAULT_LANE, this.scope.name);\n }\n\n setCurrentLane(laneId: LaneId, alias?: string, exported?: boolean) {\n this.workspace?.consumer.setCurrentLane(laneId, exported);\n }\n\n async createLane(name: string, { remoteScope, alias }: CreateLaneOptions = {}): Promise<TrackLane> {\n if (!this.workspace) {\n const newLane = await createLaneInScope(name, this.scope);\n return {\n localLane: newLane.name,\n remoteLane: newLane.name,\n remoteScope: this.scope.name,\n };\n }\n if (alias) {\n throwForInvalidLaneName(alias);\n }\n const scope = remoteScope || this.workspace.defaultScope;\n await createLane(this.workspace.consumer, name, scope);\n const laneId = LaneId.from(name, scope);\n this.setCurrentLane(laneId, alias, false);\n const trackLaneData = {\n localLane: alias || name,\n remoteLane: name,\n remoteScope: scope,\n };\n this.scope.legacyScope.lanes.trackLane(trackLaneData);\n this.scope.legacyScope.scopeJson.setLaneAsNew(name);\n await this.workspace.consumer.onDestroy();\n\n return trackLaneData;\n }\n\n async loadLane(id: LaneId): Promise<Lane | null> {\n return this.scope.legacyScope.lanes.loadLane(id);\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.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.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.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${laneName}\"`);\n }\n const remoteScopeBefore = lane.scope;\n lane.scope = remoteScope;\n const newLaneId = LaneId.from(laneId.name, remoteScope);\n const trackData = {\n localLane: laneNameWithoutScope,\n remoteLane: laneId.name,\n remoteScope,\n };\n this.scope.legacyScope.lanes.trackLane(trackData);\n await this.scope.legacyScope.lanes.saveLane(lane);\n this.workspace.consumer.bitMap.setCurrentLane(newLaneId, false);\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.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${currentName}\"`);\n }\n\n // rename the ref file\n await this.scope.legacyScope.objects.remoteLanes.renameRefByNewLaneName(laneNameWithoutScope, newName, lane.scope);\n\n // change tracking data\n const afterTrackData = {\n localLane: newName,\n remoteLane: newName,\n remoteScope: lane.scope,\n };\n this.scope.legacyScope.lanes.trackLane(afterTrackData);\n this.scope.legacyScope.lanes.removeTrackLane(laneNameWithoutScope);\n\n // change the lane object\n lane.name = newName;\n await this.scope.legacyScope.lanes.saveLane(lane);\n\n // change current-lane if needed\n const currentLaneName = this.getCurrentLaneName();\n if (currentLaneName === laneNameWithoutScope) {\n const newLaneId = LaneId.from(newName, lane.scope);\n const isExported = this.workspace.consumer.bitMap.isLaneExported;\n this.setCurrentLane(newLaneId, undefined, isExported);\n }\n\n // export the lane with only the name-change\n const clonedLaneToExport = lane.clone();\n clonedLaneToExport.components = []; // otherwise, it'll export the changes done on the components.\n let exported = false;\n let exportErr: Error | undefined;\n try {\n await this.exportLane(clonedLaneToExport);\n exported = true;\n } catch (err: any) {\n this.logger.error(`unable to export ${lane.id.toString()}: ${err.message}`);\n exportErr = err;\n }\n\n await this.workspace.consumer.onDestroy();\n\n return { exported, exportErr };\n }\n\n async exportLane(lane: Lane) {\n await this.exporter.exportMany({\n scope: this.scope.legacyScope,\n laneObject: lane,\n ids: new BitIds(),\n idsWithFutureScope: new BitIds(),\n allVersions: false,\n });\n }\n\n /**\n * get a Lane object from the remote.\n * `persistIfNotExists` saves the object in the local scope only if the lane is not there yet.\n * otherwise, it needs some merging mechanism, which is done differently whether it's export or import.\n * see `sources.mergeLane()` for export and `import-components._saveLaneDataIfNeeded()` for import.\n * in this case, because we only bring the lane object and not the components, it's not easy to do the merge.\n */\n async importLaneObject(laneId: LaneId, persistIfNotExists = true): Promise<Lane> {\n const legacyScope = this.scope.legacyScope;\n const scopeComponentImporter = ScopeComponentsImporter.getInstance(legacyScope);\n const results = await scopeComponentImporter.importLanes([laneId]);\n const laneObject = results[0];\n if (!laneObject) throw new LaneNotFound(laneId.scope, laneId.name);\n\n if (persistIfNotExists) {\n const exists = await legacyScope.loadLane(laneId);\n if (!exists) {\n await legacyScope.lanes.saveLane(laneObject);\n }\n }\n\n return laneObject;\n }\n\n /**\n * get the distance for a component between two lanes. for example, lane-b forked from lane-a and lane-b added some new snaps\n * @param componentId\n * @param sourceHead head on the source lane. leave empty if the source is main\n * @param targetHead head on the target lane. leave empty if the target is main\n * @returns\n */\n async getSnapsDistance(componentId: ComponentID, sourceHead?: string, targetHead?: string): Promise<SnapsDistance> {\n if (!sourceHead && !targetHead)\n throw new Error(`getDivergeData got sourceHead and targetHead empty. at least one of them should be populated`);\n const modelComponent = await this.scope.legacyScope.getModelComponent(componentId._legacy);\n return getDivergeData({\n modelComponent,\n repo: this.scope.legacyScope.objects,\n sourceHead: sourceHead ? Ref.from(sourceHead) : modelComponent.head || null,\n targetHead: targetHead ? Ref.from(targetHead) : modelComponent.head || null,\n });\n }\n\n /**\n * get the head hash (snap) of main. return undefined if the component exists only on a lane and was never merged to main\n */\n async getHeadOnMain(componentId: ComponentID): Promise<string | undefined> {\n const modelComponent = await this.scope.legacyScope.getModelComponent(componentId._legacy);\n return modelComponent.head?.toString();\n }\n\n /**\n * fetch the lane object and its components from the remote.\n * save the objects to the local scope.\n * this method doesn't change anything in the workspace.\n */\n async fetchLaneWithItsComponents(laneId: LaneId): Promise<Lane> {\n this.logger.debug(`fetching lane ${laneId.toString()}`);\n if (!this.workspace) {\n throw new BitError('unable to fetch lanes outside of Bit workspace');\n }\n const lane = await this.importLaneObject(laneId);\n if (!lane) throw new Error(`unable to import lane ${laneId.toString()} from the remote`);\n const importOptions: ImportOptions = {\n ids: [],\n objectsOnly: true,\n verbose: false,\n writeConfig: false,\n override: false,\n installNpmPackages: false,\n lanes: { laneIds: [laneId], lanes: [lane] },\n };\n const { importedIds } = await this.importer.importWithOptions(importOptions);\n this.logger.debug(`fetching lane ${laneId.toString()} done, fetched ${importedIds.length} components`);\n return lane;\n }\n\n async removeLanes(laneNames: string[], opts?: { remote: boolean; force: boolean }): Promise<string[]> {\n if (!this.workspace && !opts?.remote) {\n await this.scope.legacyScope.lanes.removeLanes(this.scope.legacyScope, laneNames, true);\n return laneNames;\n }\n const results = await removeLanes(this.workspace?.consumer, laneNames, !!opts?.remote, !!opts?.force);\n if (this.workspace) await this.workspace.consumer.onDestroy();\n\n return results.laneResults;\n }\n\n /**\n * switch to a different local or remote lane.\n * switching to a remote lane also imports and writes the components of that remote lane.\n * by default, only the components existing on the workspace will be imported from that lane, unless the \"getAll\"\n * flag is true.\n */\n async switchLanes(\n laneName: string,\n { alias, merge, getAll = false, skipDependencyInstallation = false }: SwitchLaneOptions\n ) {\n if (!this.workspace) {\n throw new BitError(`unable to switch lanes outside of Bit workspace`);\n }\n let mergeStrategy;\n if (merge && typeof merge === 'string') {\n const mergeOptions = Object.keys(MergeOptions);\n if (!mergeOptions.includes(merge)) {\n throw new BitError(`merge must be one of the following: ${mergeOptions.join(', ')}`);\n }\n mergeStrategy = merge;\n }\n if (alias) {\n throwForInvalidLaneName(alias);\n }\n\n const switchProps = {\n laneName,\n existingOnWorkspaceOnly: !getAll,\n alias,\n };\n const checkoutProps = {\n mergeStrategy,\n skipNpmInstall: skipDependencyInstallation,\n verbose: false, // not relevant in Harmony\n ignorePackageJson: true, // not relevant in Harmony\n ignoreDist: true, // not relevant in Harmony\n isLane: true,\n promptMergeOptions: false,\n writeConfig: false,\n reset: false,\n all: false,\n };\n return new LaneSwitcher(this.workspace, this.logger, switchProps, checkoutProps, this).switch();\n }\n\n /**\n * check whether the given lane is up-to-date against \"checkAgainst\", if this param is null, it checks it against main.\n */\n async isLaneUpToDate(laneToCheck: Lane, checkAgainst?: Lane): Promise<boolean> {\n const upToDateIds: BitId[] = [];\n const notUpToDateIds: BitId[] = [];\n const getHashOnAnotherLane = async (id: BitId): Promise<Ref | undefined> => {\n if (checkAgainst) {\n const idOnLane = checkAgainst.getComponent(id);\n return idOnLane?.head;\n }\n const modelComp = await this.scope.legacyScope.getModelComponent(id);\n return modelComp.head;\n };\n await Promise.all(\n laneToCheck.components.map(async (comp) => {\n const refOnOtherLane = await getHashOnAnotherLane(comp.id);\n if (!refOnOtherLane) {\n upToDateIds.push(comp.id);\n return;\n }\n if (comp.head.isEqual(refOnOtherLane)) {\n upToDateIds.push(comp.id);\n return;\n }\n const modelComponent = await this.scope.legacyScope.getModelComponent(comp.id);\n const divergeData = await getDivergeData({\n repo: this.scope.legacyScope.objects,\n modelComponent,\n sourceHead: comp.head,\n targetHead: refOnOtherLane,\n });\n if (divergeData.isTargetAhead() || divergeData.isDiverged()) {\n notUpToDateIds.push(comp.id);\n return;\n }\n if (!divergeData.isSourceAhead()) {\n throw new Error(\n `invalid state - component ${comp.id.toString()} is not diverged, not local-ahead and not-remote-ahead.`\n );\n }\n upToDateIds.push(comp.id);\n })\n );\n\n const isUpToDate = !notUpToDateIds.length;\n\n return isUpToDate;\n }\n\n /**\n * the values array may include zero to two values and will be processed as following:\n * [] => diff between the current lane and default lane. (only inside workspace).\n * [to] => diff between the current lane (or default-lane when in scope) and \"to\" lane.\n * [from, to] => diff between \"from\" lane and \"to\" lane.\n */\n public async getDiff(values: string[], diffOptions: DiffOptions = {}, pattern?: string): Promise<LaneDiffResults> {\n const laneDiffGenerator = new LaneDiffGenerator(this.workspace, this.scope);\n return laneDiffGenerator.generate(values, diffOptions, pattern);\n }\n\n async getLaneComponentModels(lane: LaneData): Promise<Component[]> {\n const host = this.componentAspect.getHost();\n const laneComponentIds = await this.getLaneComponentIds(lane);\n const components = await host.getMany(laneComponentIds);\n return components;\n }\n\n async getLaneComponentIds(lane: LaneData): Promise<ComponentID[]> {\n if (!lane) return [];\n\n const laneComponents = lane.components;\n const workspace = this.workspace;\n const bitIdsFromBitmap = workspace ? workspace.consumer.bitMap.getAllBitIdsFromAllLanes() : [];\n\n const filteredComponentIds = workspace\n ? laneComponents.filter((laneComponent) =>\n bitIdsFromBitmap.some((bitmapComponentId) => bitmapComponentId.isEqualWithoutVersion(laneComponent.id))\n )\n : laneComponents;\n\n const host = this.componentAspect.getHost();\n\n return Promise.all(\n filteredComponentIds.map((laneComponent) => {\n const legacyIdWithVersion = laneComponent.id.changeVersion(laneComponent.head);\n return host.resolveComponentId(legacyIdWithVersion);\n })\n );\n }\n\n async getLaneReadmeComponent(lane: LaneData): Promise<Component | undefined> {\n if (!lane) return undefined;\n const laneReadmeComponent = lane.readmeComponent;\n if (!laneReadmeComponent) return undefined;\n const host = this.componentAspect.getHost();\n const laneReadmeComponentId = await host.resolveComponentId(\n laneReadmeComponent.id.changeVersion(laneReadmeComponent.head)\n );\n const readmeComponent = await host.get(laneReadmeComponentId);\n return readmeComponent;\n }\n\n async removeLaneReadme(laneName?: string): Promise<{ result: boolean; message?: string }> {\n if (!this.workspace) {\n throw new BitError('unable to remove the lane readme component outside of Bit workspace');\n }\n const currentLaneName = this.getCurrentLaneName();\n\n if (!laneName && !currentLaneName) {\n return {\n result: false,\n message: 'unable to remove the lane readme component. Either pass a laneName or switch to a lane',\n };\n }\n\n const scope: LegacyScope = this.workspace.scope.legacyScope;\n const laneId: LaneId = laneName\n ? await scope.lanes.parseLaneIdFromString(laneName)\n : (this.getCurrentLaneId() as LaneId);\n const lane: Lane | null | undefined = await scope.loadLane(laneId);\n\n if (!lane?.readmeComponent) {\n throw new BitError(`there is no readme component added to the lane ${laneName || currentLaneName}`);\n }\n\n const readmeComponentId = await this.workspace.resolveComponentId(lane.readmeComponent.id);\n const existingLaneConfig =\n (await this.workspace.getSpecificComponentConfig(readmeComponentId, LanesAspect.id)) || {};\n\n const remoteLaneIdStr = lane.toLaneId().toString();\n\n if (existingLaneConfig.readme) {\n delete existingLaneConfig.readme[remoteLaneIdStr];\n await this.workspace.removeSpecificComponentConfig(readmeComponentId, LanesAspect.id, false);\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, existingLaneConfig);\n }\n\n lane.setReadmeComponent(undefined);\n await scope.lanes.saveLane(lane);\n await this.workspace.bitMap.write();\n\n return { result: true };\n }\n\n async addLaneReadme(readmeComponentIdStr: string, laneName?: string): Promise<{ result: boolean; message?: string }> {\n if (!this.workspace) {\n throw new BitError(`unable to track a lane readme component outside of Bit workspace`);\n }\n const readmeComponentId = await this.workspace.resolveComponentId(readmeComponentIdStr);\n\n const readmeComponentBitId = readmeComponentId._legacy;\n const scope: LegacyScope = this.workspace.scope.legacyScope;\n const laneId: LaneId = laneName\n ? await scope.lanes.parseLaneIdFromString(laneName)\n : (this.getCurrentLaneId() as LaneId);\n\n const lane: Lane | null | undefined = await scope.loadLane(laneId);\n\n if (!lane) {\n return { result: false, message: `cannot find lane ${laneName}` };\n }\n\n lane.setReadmeComponent(readmeComponentBitId);\n await scope.lanes.saveLane(lane);\n\n const existingLaneConfig =\n (await this.workspace.getSpecificComponentConfig(readmeComponentId, LanesAspect.id)) || {};\n\n const remoteLaneIdStr = lane.toLaneId().toString();\n\n if (existingLaneConfig.readme) {\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, {\n ...existingLaneConfig,\n readme: {\n ...existingLaneConfig.readme,\n [remoteLaneIdStr]: true,\n },\n });\n } else {\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, {\n ...existingLaneConfig,\n readme: {\n [remoteLaneIdStr]: true,\n },\n });\n }\n await this.workspace.bitMap.write();\n return { result: true };\n }\n\n private async getLaneDataOfDefaultLane(): Promise<LaneData | null> {\n const consumer = this.workspace?.consumer;\n let bitIds: BitId[] = [];\n if (!consumer) {\n const scopeComponents = await this.scope.list();\n bitIds = scopeComponents.filter((component) => component.head).map((component) => component.id._legacy);\n } else {\n bitIds = await consumer.getIdsOfDefaultLane();\n }\n\n return {\n name: DEFAULT_LANE,\n remote: null,\n id: this.getDefaultLaneId(),\n components: bitIds.map((bitId) => ({ id: bitId, head: bitId.version as string })),\n isMerged: null,\n hash: '',\n };\n }\n\n get createRoutePath() {\n return '/lanes/create';\n }\n\n get deleteRoutePath() {\n return '/lanes/delete';\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n ScopeAspect,\n WorkspaceAspect,\n GraphqlAspect,\n MergingAspect,\n ComponentAspect,\n LoggerAspect,\n ImporterAspect,\n ExportAspect,\n ExpressAspect,\n ];\n static runtime = MainRuntime;\n static async provider([cli, scope, workspace, graphql, merging, component, loggerMain, importer, exporter, express]: [\n CLIMain,\n ScopeMain,\n Workspace,\n GraphqlMain,\n MergingMain,\n ComponentMain,\n LoggerMain,\n ImporterMain,\n ExportMain,\n ExpressMain\n ]) {\n const logger = loggerMain.createLogger(LanesAspect.id);\n const lanesMain = new LanesMain(workspace, scope, merging, component, logger, importer, exporter);\n const switchCmd = new SwitchCmd(lanesMain);\n const laneCmd = new LaneCmd(lanesMain, workspace, scope);\n laneCmd.commands = [\n new LaneListCmd(lanesMain, workspace, scope),\n switchCmd,\n new LaneShowCmd(lanesMain, workspace, scope),\n new LaneCreateCmd(lanesMain),\n new LaneRemoveCmd(lanesMain),\n new LaneChangeScopeCmd(lanesMain),\n new LaneAliasCmd(lanesMain),\n new LaneRenameCmd(lanesMain),\n new LaneDiffCmd(workspace, scope),\n new LaneAddReadmeCmd(lanesMain),\n new LaneRemoveReadmeCmd(lanesMain),\n new LaneImportCmd(switchCmd),\n ];\n cli.register(laneCmd, switchCmd);\n graphql.register(lanesSchema(lanesMain));\n express.register([new LanesCreateRoute(lanesMain, logger), new LanesDeleteRoute(lanesMain, logger)]);\n return lanesMain;\n }\n}\n\nLanesAspect.addRuntime(LanesMain);\n\nexport default LanesMain;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAaA;EAAA;EAAA;IAAA;EAAA;EAAA;A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EAACT,SAAS,CAAC,EAC5B,KAAIU,0BAAkB,EAACV,SAAS,CAAC,EACjC,KAAIW,oBAAY,EAACX,SAAS,CAAC,EAC3B,KAAIY,qBAAa,EAACZ,SAAS,CAAC,EAC5B,KAAIa,2BAAW,EAACrQ,SAAS,EAAEC,KAAK,CAAC,EACjC,KAAIqQ,wBAAgB,EAACd,SAAS,CAAC,EAC/B,KAAIe,2BAAmB,EAACf,SAAS,CAAC,EAClC,KAAIgB,qBAAa,EAACf,SAAS,CAAC,CAC7B;IACDN,GAAG,CAACsB,QAAQ,CAACd,OAAO,EAAEF,SAAS,CAAC;IAChCL,OAAO,CAACqB,QAAQ,CAAC,IAAAC,qBAAW,EAAClB,SAAS,CAAC,CAAC;IACxCF,OAAO,CAACmB,QAAQ,CAAC,CAAC,KAAIE,+BAAgB,EAACnB,SAAS,EAAEpP,MAAM,CAAC,EAAE,KAAIwQ,+BAAgB,EAACpB,SAAS,EAAEpP,MAAM,CAAC,CAAC,CAAC;IACpG,OAAOoP,SAAS;EAClB;AACF;AAAC;AAAA,gCAlqBY1P,SAAS,WAinBL,EAAE;AAAA,gCAjnBNA,SAAS,kBAknBE,CACpB+Q,gBAAS,EACTC,oBAAW,EACXC,4BAAe,EACfC,wBAAa,EACbC,wBAAa,EACbC,oBAAe,EACfC,sBAAY,EACZC,0BAAc,EACdC,sBAAY,EACZC,wBAAa,CACd;AAAA,gCA7nBUxR,SAAS,aA8nBHyR,kBAAW;AAsC9B3D,oBAAW,CAAC4D,UAAU,CAAC1R,SAAS,CAAC;AAAC,eAEnBA,SAAS;AAAA"}
@@ -84,10 +84,10 @@ describe('LanesAspect', function () {
84
84
  });
85
85
  lanes = await (0, _harmonyTesting().loadAspect)(_lanes().LanesAspect, workspacePath);
86
86
  await lanes.createLane('stage');
87
+ await (0, _componentTesting().modifyMockedComponents)(workspacePath, 'v2');
87
88
  const result = await snapping.snap({
88
89
  pattern: 'comp1',
89
- build: false,
90
- unmodified: true
90
+ build: false
91
91
  });
92
92
  // intermediate step, make sure it is snapped
93
93
  (0, _chai().expect)(result === null || result === void 0 ? void 0 : result.snappedComponents.length).to.equal(1);
@@ -1 +1 @@
1
- {"version":3,"names":["describe","timeout","lanes","workspaceData","before","mockWorkspace","workspacePath","mockComponents","loadAspect","LanesAspect","createLane","after","destroyWorkspace","it","currentLanes","getLanes","expect","to","have","lengthOf","name","equal","snapping","SnappingAspect","tag","ids","build","result","snap","pattern","unmodified","snappedComponents","length","currentLane","getCurrentLane","Error","isUpToDate","isLaneUpToDate","be","true","switchLanes","skipDependencyInstallation","false"],"sources":["lanes.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport { loadAspect } from '@teambit/harmony.testing.load-aspect';\nimport SnappingAspect, { SnappingMain } from '@teambit/snapping';\nimport { mockWorkspace, destroyWorkspace, WorkspaceData } from '@teambit/workspace.testing.mock-workspace';\nimport { mockComponents } from '@teambit/component.testing.mock-components';\nimport { LanesAspect } from './lanes.aspect';\nimport { LanesMain } from './lanes.main.runtime';\n\ndescribe('LanesAspect', function () {\n this.timeout(0);\n\n describe('getLanes()', () => {\n let lanes: LanesMain;\n let workspaceData: WorkspaceData;\n before(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n await mockComponents(workspacePath);\n lanes = await loadAspect(LanesAspect, workspacePath);\n await lanes.createLane('stage');\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n it('should list all lanes', async () => {\n const currentLanes = await lanes.getLanes({});\n expect(currentLanes).to.have.lengthOf(1);\n expect(currentLanes[0].name).to.equal('stage');\n });\n });\n\n describe('isLaneUpToDate', () => {\n let lanes: LanesMain;\n let snapping: SnappingMain;\n let workspaceData: WorkspaceData;\n before(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n await mockComponents(workspacePath);\n snapping = await loadAspect(SnappingAspect, workspacePath);\n await snapping.tag({ ids: ['comp1'], build: false });\n lanes = await loadAspect(LanesAspect, workspacePath);\n await lanes.createLane('stage');\n const result = await snapping.snap({ pattern: 'comp1', build: false, unmodified: true });\n // intermediate step, make sure it is snapped\n expect(result?.snappedComponents.length).to.equal(1);\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n it('should return that the lane is up to date when the lane is ahead of main', async () => {\n const currentLane = await lanes.getCurrentLane();\n if (!currentLane) throw new Error('unable to get the current lane');\n const isUpToDate = await lanes.isLaneUpToDate(currentLane);\n expect(isUpToDate).to.be.true;\n });\n it('should return that the lane is not up to date when main is ahead', async () => {\n const currentLane = await lanes.getCurrentLane();\n if (!currentLane) throw new Error('unable to get the current lane');\n await lanes.switchLanes('main', { skipDependencyInstallation: true });\n await snapping.snap({ pattern: 'comp1', build: false, unmodified: true });\n const isUpToDate = await lanes.isLaneUpToDate(currentLane);\n expect(isUpToDate).to.be.false;\n });\n });\n});\n"],"mappings":";;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGAA,QAAQ,CAAC,aAAa,EAAE,YAAY;EAClC,IAAI,CAACC,OAAO,CAAC,CAAC,CAAC;EAEfD,QAAQ,CAAC,YAAY,EAAE,MAAM;IAC3B,IAAIE,KAAgB;IACpB,IAAIC,aAA4B;IAChCC,MAAM,CAAC,YAAY;MACjBD,aAAa,GAAG,IAAAE,iCAAa,GAAE;MAC/B,MAAM;QAAEC;MAAc,CAAC,GAAGH,aAAa;MACvC,MAAM,IAAAI,kCAAc,EAACD,aAAa,CAAC;MACnCJ,KAAK,GAAG,MAAM,IAAAM,4BAAU,EAACC,oBAAW,EAAEH,aAAa,CAAC;MACpD,MAAMJ,KAAK,CAACQ,UAAU,CAAC,OAAO,CAAC;IACjC,CAAC,CAAC;IACF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,iBAAiB,CAACC,MAAM,CAAC,CAACf,EAAE,CAACI,KAAK,CAAC,CAAC,CAAC;IACtD,CAAC,CAAC;IACFV,KAAK,CAAC,YAAY;MAChB,MAAM,IAAAC,oCAAgB,EAACT,aAAa,CAAC;IACvC,CAAC,CAAC;IACFU,EAAE,CAAC,0EAA0E,EAAE,YAAY;MACzF,MAAMoB,WAAW,GAAG,MAAM/B,KAAK,CAACgC,cAAc,EAAE;MAChD,IAAI,CAACD,WAAW,EAAE,MAAM,IAAIE,KAAK,CAAC,gCAAgC,CAAC;MACnE,MAAMC,UAAU,GAAG,MAAMlC,KAAK,CAACmC,cAAc,CAACJ,WAAW,CAAC;MAC1D,IAAAjB,cAAM,EAACoB,UAAU,CAAC,CAACnB,EAAE,CAACqB,EAAE,CAACC,IAAI;IAC/B,CAAC,CAAC;IACF1B,EAAE,CAAC,kEAAkE,EAAE,YAAY;MACjF,MAAMoB,WAAW,GAAG,MAAM/B,KAAK,CAACgC,cAAc,EAAE;MAChD,IAAI,CAACD,WAAW,EAAE,MAAM,IAAIE,KAAK,CAAC,gCAAgC,CAAC;MACnE,MAAMjC,KAAK,CAACsC,WAAW,CAAC,MAAM,EAAE;QAAEC,0BAA0B,EAAE;MAAK,CAAC,CAAC;MACrE,MAAMnB,QAAQ,CAACM,IAAI,CAAC;QAAEC,OAAO,EAAE,OAAO;QAAEH,KAAK,EAAE,KAAK;QAAEI,UAAU,EAAE;MAAK,CAAC,CAAC;MACzE,MAAMM,UAAU,GAAG,MAAMlC,KAAK,CAACmC,cAAc,CAACJ,WAAW,CAAC;MAC1D,IAAAjB,cAAM,EAACoB,UAAU,CAAC,CAACnB,EAAE,CAACqB,EAAE,CAACI,KAAK;IAChC,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["describe","timeout","lanes","workspaceData","before","mockWorkspace","workspacePath","mockComponents","loadAspect","LanesAspect","createLane","after","destroyWorkspace","it","currentLanes","getLanes","expect","to","have","lengthOf","name","equal","snapping","SnappingAspect","tag","ids","build","modifyMockedComponents","result","snap","pattern","snappedComponents","length","currentLane","getCurrentLane","Error","isUpToDate","isLaneUpToDate","be","true","switchLanes","skipDependencyInstallation","unmodified","false"],"sources":["lanes.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport { loadAspect } from '@teambit/harmony.testing.load-aspect';\nimport SnappingAspect, { SnappingMain } from '@teambit/snapping';\nimport { mockWorkspace, destroyWorkspace, WorkspaceData } from '@teambit/workspace.testing.mock-workspace';\nimport { mockComponents, modifyMockedComponents } from '@teambit/component.testing.mock-components';\nimport { LanesAspect } from './lanes.aspect';\nimport { LanesMain } from './lanes.main.runtime';\n\ndescribe('LanesAspect', function () {\n this.timeout(0);\n\n describe('getLanes()', () => {\n let lanes: LanesMain;\n let workspaceData: WorkspaceData;\n before(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n await mockComponents(workspacePath);\n lanes = await loadAspect(LanesAspect, workspacePath);\n await lanes.createLane('stage');\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n it('should list all lanes', async () => {\n const currentLanes = await lanes.getLanes({});\n expect(currentLanes).to.have.lengthOf(1);\n expect(currentLanes[0].name).to.equal('stage');\n });\n });\n\n describe('isLaneUpToDate', () => {\n let lanes: LanesMain;\n let snapping: SnappingMain;\n let workspaceData: WorkspaceData;\n before(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n await mockComponents(workspacePath);\n snapping = await loadAspect(SnappingAspect, workspacePath);\n await snapping.tag({ ids: ['comp1'], build: false });\n lanes = await loadAspect(LanesAspect, workspacePath);\n await lanes.createLane('stage');\n await modifyMockedComponents(workspacePath, 'v2');\n const result = await snapping.snap({ pattern: 'comp1', build: false });\n // intermediate step, make sure it is snapped\n expect(result?.snappedComponents.length).to.equal(1);\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n it('should return that the lane is up to date when the lane is ahead of main', async () => {\n const currentLane = await lanes.getCurrentLane();\n if (!currentLane) throw new Error('unable to get the current lane');\n const isUpToDate = await lanes.isLaneUpToDate(currentLane);\n expect(isUpToDate).to.be.true;\n });\n it('should return that the lane is not up to date when main is ahead', async () => {\n const currentLane = await lanes.getCurrentLane();\n if (!currentLane) throw new Error('unable to get the current lane');\n await lanes.switchLanes('main', { skipDependencyInstallation: true });\n await snapping.snap({ pattern: 'comp1', build: false, unmodified: true });\n const isUpToDate = await lanes.isLaneUpToDate(currentLane);\n expect(isUpToDate).to.be.false;\n });\n });\n});\n"],"mappings":";;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGAA,QAAQ,CAAC,aAAa,EAAE,YAAY;EAClC,IAAI,CAACC,OAAO,CAAC,CAAC,CAAC;EAEfD,QAAQ,CAAC,YAAY,EAAE,MAAM;IAC3B,IAAIE,KAAgB;IACpB,IAAIC,aAA4B;IAChCC,MAAM,CAAC,YAAY;MACjBD,aAAa,GAAG,IAAAE,iCAAa,GAAE;MAC/B,MAAM;QAAEC;MAAc,CAAC,GAAGH,aAAa;MACvC,MAAM,IAAAI,kCAAc,EAACD,aAAa,CAAC;MACnCJ,KAAK,GAAG,MAAM,IAAAM,4BAAU,EAACC,oBAAW,EAAEH,aAAa,CAAC;MACpD,MAAMJ,KAAK,CAACQ,UAAU,CAAC,OAAO,CAAC;IACjC,CAAC,CAAC;IACFC,KAAK,CAAC,YAAY;MAChB,MAAM,IAAAC,oCAAgB,EAACT,aAAa,CAAC;IACvC,CAAC,CAAC;IACFU,EAAE,CAAC,uBAAuB,EAAE,YAAY;MACtC,MAAMC,YAAY,GAAG,MAAMZ,KAAK,CAACa,QAAQ,CA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AACT,aAAa,CAAC;IACvC,CAAC,CAAC;IACFU,EAAE,CAAC,0EAA0E,EAAE,YAAY;MACzF,MAAMoB,WAAW,GAAG,MAAM/B,KAAK,CAACgC,cAAc,EAAE;MAChD,IAAI,CAACD,WAAW,EAAE,MAAM,IAAIE,KAAK,CAAC,gCAAgC,CAAC;MACnE,MAAMC,UAAU,GAAG,MAAMlC,KAAK,CAACmC,cAAc,CAACJ,WAAW,CAAC;MAC1D,IAAAjB,cAAM,EAACoB,UAAU,CAAC,CAACnB,EAAE,CAACqB,EAAE,CAACC,IAAI;IAC/B,CAAC,CAAC;IACF1B,EAAE,CAAC,kEAAkE,EAAE,YAAY;MACjF,MAAMoB,WAAW,GAAG,MAAM/B,KAAK,CAACgC,cAAc,EAAE;MAChD,IAAI,CAACD,WAAW,EAAE,MAAM,IAAIE,KAAK,CAAC,gCAAgC,CAAC;MACnE,MAAMjC,KAAK,CAACsC,WAAW,CAAC,MAAM,EAAE;QAAEC,0BAA0B,EAAE;MAAK,CAAC,CAAC;MACrE,MAAMnB,QAAQ,CAACO,IAAI,CAAC;QAAEC,OAAO,EAAE,OAAO;QAAEJ,KAAK,EAAE,KAAK;QAAEgB,UAAU,EAAE;MAAK,CAAC,CAAC;MACzE,MAAMN,UAAU,GAAG,MAAMlC,KAAK,CAACmC,cAAc,CAACJ,WAAW,CAAC;MAC1D,IAAAjB,cAAM,EAACoB,UAAU,CAAC,CAACnB,EAAE,CAACqB,EAAE,CAACK,KAAK;IAChC,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.492/dist/lanes.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.492/dist/lanes.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.494/dist/lanes.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.494/dist/lanes.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/lanes",
3
- "version": "0.0.492",
3
+ "version": "0.0.494",
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.492"
9
+ "version": "0.0.494"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -18,31 +18,31 @@
18
18
  "core-js": "^3.0.0",
19
19
  "@teambit/harmony": "0.3.3",
20
20
  "@teambit/bit-error": "0.0.402",
21
- "@teambit/lane-id": "0.0.134",
22
- "@teambit/scope": "0.0.920",
23
- "@teambit/lanes.ui.models.lanes-model": "0.0.41",
24
- "@teambit/cli": "0.0.616",
25
- "@teambit/workspace": "0.0.920",
26
- "@teambit/express": "0.0.714",
27
- "@teambit/logger": "0.0.709",
28
- "@teambit/graphql": "0.0.920",
29
- "@teambit/component": "0.0.920",
30
- "@teambit/export": "0.0.920",
31
- "@teambit/importer": "0.0.349",
32
- "@teambit/lanes.modules.diff": "0.0.252",
21
+ "@teambit/lane-id": "0.0.135",
22
+ "@teambit/scope": "0.0.922",
23
+ "@teambit/lanes.ui.models.lanes-model": "0.0.42",
24
+ "@teambit/cli": "0.0.617",
25
+ "@teambit/workspace": "0.0.922",
26
+ "@teambit/express": "0.0.715",
27
+ "@teambit/logger": "0.0.710",
28
+ "@teambit/graphql": "0.0.922",
29
+ "@teambit/component": "0.0.922",
30
+ "@teambit/export": "0.0.922",
31
+ "@teambit/importer": "0.0.351",
32
+ "@teambit/lanes.modules.diff": "0.0.253",
33
33
  "@teambit/legacy-bit-id": "0.0.421",
34
- "@teambit/merging": "0.0.235",
34
+ "@teambit/merging": "0.0.237",
35
35
  "@teambit/design.ui.pages.not-found": "0.0.365",
36
- "@teambit/lanes.hooks.use-lanes": "0.0.79",
37
- "@teambit/lanes.hooks.use-viewed-lane-from-url": "0.0.41",
38
- "@teambit/lanes.ui.lane-overview": "0.0.41",
36
+ "@teambit/lanes.hooks.use-lanes": "0.0.80",
37
+ "@teambit/lanes.hooks.use-viewed-lane-from-url": "0.0.42",
38
+ "@teambit/lanes.ui.lane-overview": "0.0.42",
39
39
  "@teambit/lanes.ui.menus.lanes-overview-menu": "0.0.3",
40
- "@teambit/lanes.ui.menus.use-lanes-menu": "0.0.41",
41
- "@teambit/lanes.ui.navigation.lane-switcher": "0.0.41",
42
- "@teambit/sidebar": "0.0.920",
40
+ "@teambit/lanes.ui.menus.use-lanes-menu": "0.0.42",
41
+ "@teambit/lanes.ui.navigation.lane-switcher": "0.0.42",
42
+ "@teambit/sidebar": "0.0.922",
43
43
  "@teambit/ui-foundation.ui.menu": "0.0.495",
44
44
  "@teambit/ui-foundation.ui.react-router.slot-router": "0.0.498",
45
- "@teambit/ui": "0.0.920"
45
+ "@teambit/ui": "0.0.922"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/react": "^17.0.8",
@@ -54,14 +54,14 @@
54
54
  "@types/jest": "^26.0.0",
55
55
  "@types/react-dom": "^17.0.5",
56
56
  "@types/node": "12.20.4",
57
- "@teambit/component.testing.mock-components": "0.0.16",
58
- "@teambit/harmony.testing.load-aspect": "0.0.15",
59
- "@teambit/snapping": "0.0.235",
57
+ "@teambit/component.testing.mock-components": "0.0.17",
58
+ "@teambit/harmony.testing.load-aspect": "0.0.16",
59
+ "@teambit/snapping": "0.0.237",
60
60
  "@teambit/workspace.testing.mock-workspace": "0.0.14"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "react-router-dom": "^6.0.0",
64
- "@teambit/legacy": "1.0.397",
64
+ "@teambit/legacy": "1.0.398",
65
65
  "react-dom": "^16.8.0 || ^17.0.0",
66
66
  "react": "^16.8.0 || ^17.0.0"
67
67
  },