@teambit/lanes 1.0.1121 → 1.0.1126

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.lanes_lanes@1.0.1121/dist/lanes.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.lanes_lanes@1.0.1121/dist/lanes.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.lanes_lanes@1.0.1126/dist/lanes.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.lanes_lanes@1.0.1126/dist/lanes.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -28,6 +28,14 @@ export declare class LaneSwitcher {
28
28
  constructor(workspace: Workspace, logger: Logger, switchProps: SwitchProps, checkoutProps: CheckoutProps, lanes: LanesMain);
29
29
  switch(): Promise<ApplyVersionResults>;
30
30
  private populateSwitchProps;
31
+ /**
32
+ * `--workspace-only`: switch only the components the workspace already tracks. a lane can carry
33
+ * components this workspace doesn't have - e.g. one that was removed from the source after it was
34
+ * snapped onto the lane - and checking those out would write them back into .bitmap and to the
35
+ * filesystem. this flag is how a caller says "move the lane pointer, leave my working tree as is"
36
+ * (`bit ci pr` relies on it: the git checkout is the source of truth there).
37
+ */
38
+ private filterIdsNotInWorkspaceIfNeeded;
31
39
  private populateIdsAccordingToPattern;
32
40
  private populatePropsAccordingToRemoteLane;
33
41
  private populatePropsAccordingToDefaultLane;
@@ -123,6 +123,22 @@ class LaneSwitcher {
123
123
  this.switchProps.laneBitIds = idsOnLaneOnly;
124
124
  }
125
125
  await this.populateIdsAccordingToPattern();
126
+ this.filterIdsNotInWorkspaceIfNeeded();
127
+ }
128
+
129
+ /**
130
+ * `--workspace-only`: switch only the components the workspace already tracks. a lane can carry
131
+ * components this workspace doesn't have - e.g. one that was removed from the source after it was
132
+ * snapped onto the lane - and checking those out would write them back into .bitmap and to the
133
+ * filesystem. this flag is how a caller says "move the lane pointer, leave my working tree as is"
134
+ * (`bit ci pr` relies on it: the git checkout is the source of truth there).
135
+ */
136
+ filterIdsNotInWorkspaceIfNeeded() {
137
+ if (!this.switchProps.existingOnWorkspaceOnly) return;
138
+ const bitMapIds = this.consumer.bitmapIdsFromCurrentLaneIncludeRemoved;
139
+ const isInWorkspace = id => Boolean(bitMapIds.searchWithoutVersion(id));
140
+ this.switchProps.ids = (this.switchProps.ids || []).filter(isInWorkspace);
141
+ this.switchProps.laneBitIds = (this.switchProps.laneBitIds || []).filter(isInWorkspace);
126
142
  }
127
143
  async populateIdsAccordingToPattern() {
128
144
  if (!this.switchProps.pattern) {
@@ -1 +1 @@
1
- {"version":3,"names":["_laneId","data","require","_componentId","_bitError","_lanesModules","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LaneSwitcher","constructor","workspace","logger","switchProps","checkoutProps","lanes","consumer","switch","setStatusLine","isOnMain","throwForStagedComponents","populateSwitchProps","bitMapIds","bitmapIdsFromCurrentLaneIncludeRemoved","idsToSwitch","ids","map","id","bitMapId","searchWithoutVersion","allowAddingComponentsFromScope","versionPerId","resolveMultipleComponentIds","lane","laneToSwitchTo","results","checkout","saveLanesData","onDestroy","laneId","scope","parseLaneIdFromString","laneName","skipFetch","localLane","loadLane","getMainIds","allIds","listIds","toVersionLatest","legacyScope","scopeImporter","importWithoutDeps","cache","ignoreMissingHead","err","consoleWarning","message","getIdsOfDefaultLane","mainIds","isDefault","populatePropsAccordingToDefaultLane","laneIds","BitError","toString","populatePropsAccordingToLocalLane","populatePropsAccordingToRemoteLane","idsOnLaneOnly","find","isEqualWithoutVersion","idsOnMainOnly","laneBitIds","populateIdsAccordingToPattern","pattern","bitMap","getAllBitIdsFromAllLanes","filterIdsFromPoolIdsByPattern","remoteLaneId","laneIdToSwitchTo","debug","throwForSwitchingToCurrentLane","remoteLane","fetchLaneWithItsComponents","name","localTrackedLane","getAliasByLaneId","undefined","toComponentIds","LaneId","from","DEFAULT_LANE","toLaneId","getCurrentLaneId","isEqual","laneIdStr","localLaneName","alias","trackLane","remoteScope","setCurrentLane","isNew","syncWithIds","ComponentIdList","fromArray","objects","clearObjectsFromCache","exports"],"sources":["switch-lanes.ts"],"sourcesContent":["import type { Consumer } from '@teambit/legacy.consumer';\nimport { LaneId, DEFAULT_LANE } from '@teambit/lane-id';\nimport type { ComponentID } from '@teambit/component-id';\nimport { ComponentIdList } from '@teambit/component-id';\nimport type { ApplyVersionResults } from '@teambit/component.modules.merge-helper';\nimport type { Lane } from '@teambit/objects';\nimport type { CheckoutProps } from '@teambit/checkout';\nimport type { Workspace } from '@teambit/workspace';\nimport type { Logger } from '@teambit/logger';\nimport { BitError } from '@teambit/bit-error';\nimport { throwForStagedComponents } from '@teambit/lanes.modules.create-lane';\nimport type { LanesMain } from './lanes.main.runtime';\n\nexport type SwitchProps = {\n laneName: string;\n ids?: ComponentID[];\n laneBitIds?: ComponentID[]; // only needed for the deprecated onLanesOnly prop. once this prop is removed, this prop can be removed as well.\n pattern?: string;\n skipFetch?: boolean;\n existingOnWorkspaceOnly?: boolean;\n remoteLane?: Lane;\n localTrackedLane?: string;\n alias?: string;\n};\n\nexport class LaneSwitcher {\n private consumer: Consumer;\n private laneIdToSwitchTo: LaneId; // populated by `this.populateSwitchProps()`\n private laneToSwitchTo: Lane | undefined; // populated by `this.populateSwitchProps()`, if default-lane, it's undefined\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private switchProps: SwitchProps,\n private checkoutProps: CheckoutProps,\n private lanes: LanesMain\n ) {\n this.consumer = this.workspace.consumer;\n }\n\n async switch(): Promise<ApplyVersionResults> {\n this.logger.setStatusLine(`switching lanes`);\n if (this.workspace.isOnMain()) {\n await throwForStagedComponents(this.workspace);\n }\n await this.populateSwitchProps();\n const bitMapIds = this.workspace.consumer.bitmapIdsFromCurrentLaneIncludeRemoved;\n const idsToSwitch = this.switchProps.ids || [];\n const ids = idsToSwitch.map((id) => {\n const bitMapId = bitMapIds.searchWithoutVersion(id);\n return bitMapId || id;\n });\n\n const checkoutProps: CheckoutProps = {\n ...this.checkoutProps,\n ids,\n allowAddingComponentsFromScope: true,\n versionPerId: await this.workspace.resolveMultipleComponentIds(idsToSwitch),\n lane: this.laneToSwitchTo,\n };\n\n const results = await this.lanes.checkout.checkout(checkoutProps);\n\n await this.saveLanesData();\n await this.consumer.onDestroy('lane-switch');\n\n return results;\n }\n\n private async populateSwitchProps() {\n const laneId = await this.consumer.scope.lanes.parseLaneIdFromString(this.switchProps.laneName);\n const skipFetch = this.switchProps.skipFetch;\n\n const localLane = await this.consumer.scope.loadLane(laneId);\n const getMainIds = async () => {\n if (!skipFetch) {\n // fetch by \"latest\" and without a lane, so the remote resolves each id against the head on\n // main of its original scope. passing the ids as-is would send the versions from .bitmap,\n // which on a lane are snap hashes that live on the lane's scope, not on the component's\n // original scope. the original scope can't resolve them, drops them from the response\n // silently, and the local head on main is left stale.\n const allIds = this.workspace.listIds().toVersionLatest();\n try {\n await this.workspace.scope.legacyScope.scopeImporter.importWithoutDeps(allIds, {\n cache: false,\n ignoreMissingHead: true,\n });\n } catch (err: any) {\n this.logger.consoleWarning(\n `failed to fetch the latest from the remote, falling back to local state. ${err.message}\\nuse --skip-fetch to skip this step.`\n );\n }\n }\n return this.consumer.getIdsOfDefaultLane();\n };\n const mainIds = await getMainIds();\n if (laneId.isDefault()) {\n await this.populatePropsAccordingToDefaultLane();\n this.switchProps.ids = mainIds;\n } else {\n let laneIds: ComponentID[];\n if (skipFetch) {\n if (!localLane) {\n throw new BitError(\n `unable to switch to lane \"${laneId.toString()}\" with --skip-fetch: the lane doesn't exist in the local scope. run without --skip-fetch to fetch it from the remote.`\n );\n }\n laneIds = this.populatePropsAccordingToLocalLane(localLane);\n } else {\n try {\n laneIds = await this.populatePropsAccordingToRemoteLane(laneId);\n } catch (err: any) {\n if (!localLane) throw err;\n this.logger.consoleWarning(\n `failed to fetch lane \"${laneId.toString()}\" from the remote, falling back to local state. ${err.message}\\nuse --skip-fetch to skip this step.`\n );\n laneIds = this.populatePropsAccordingToLocalLane(localLane);\n }\n }\n const idsOnLaneOnly = laneIds.filter((id) => !mainIds.find((i) => i.isEqualWithoutVersion(id)));\n const idsOnMainOnly = mainIds.filter((id) => !laneIds.find((i) => i.isEqualWithoutVersion(id)));\n this.switchProps.ids = [...idsOnMainOnly, ...laneIds];\n this.switchProps.laneBitIds = idsOnLaneOnly;\n }\n await this.populateIdsAccordingToPattern();\n }\n\n private async populateIdsAccordingToPattern() {\n if (!this.switchProps.pattern) {\n return;\n }\n if (this.consumer.bitMap.getAllBitIdsFromAllLanes().length) {\n // if the workspace is not empty, it's possible that it has components from lane-x, and is now switching\n // partially to lane-y, while lane-y has the same components as lane-x. in which case, the user ends up with\n // an invalid state of components from lane-x and lane-y together.\n throw new BitError('error: use --pattern only when the workspace is empty');\n }\n const allIds = this.switchProps.ids || [];\n this.switchProps.ids = await this.workspace.filterIdsFromPoolIdsByPattern(this.switchProps.pattern, allIds);\n }\n\n private async populatePropsAccordingToRemoteLane(remoteLaneId: LaneId): Promise<ComponentID[]> {\n this.laneIdToSwitchTo = remoteLaneId;\n this.logger.debug(`populatePropsAccordingToRemoteLane, remoteLaneId: ${remoteLaneId.toString()}`);\n this.throwForSwitchingToCurrentLane();\n const remoteLane = await this.lanes.fetchLaneWithItsComponents(remoteLaneId);\n this.switchProps.laneName = remoteLaneId.name;\n this.switchProps.localTrackedLane = this.consumer.scope.lanes.getAliasByLaneId(remoteLaneId) || undefined;\n this.switchProps.remoteLane = remoteLane;\n this.laneToSwitchTo = remoteLane;\n this.logger.debug(`populatePropsAccordingToRemoteLane, completed`);\n return [...remoteLane.toComponentIds()];\n }\n\n private async populatePropsAccordingToDefaultLane() {\n this.laneIdToSwitchTo = LaneId.from(DEFAULT_LANE, this.consumer.scope.name);\n this.throwForSwitchingToCurrentLane();\n }\n\n private populatePropsAccordingToLocalLane(localLane: Lane): ComponentID[] {\n this.laneIdToSwitchTo = localLane.toLaneId();\n this.laneToSwitchTo = localLane;\n this.throwForSwitchingToCurrentLane();\n return [...localLane.toComponentIds()];\n }\n\n private throwForSwitchingToCurrentLane() {\n if (this.consumer.getCurrentLaneId().isEqual(this.laneIdToSwitchTo)) {\n const laneIdStr = this.laneIdToSwitchTo.isDefault()\n ? this.laneIdToSwitchTo.name\n : this.laneIdToSwitchTo.toString();\n throw new BitError(`already checked out to \"${laneIdStr}\".\nto be up to date with the remote lane, please run \"bit checkout head\"`);\n }\n }\n\n private async saveLanesData() {\n const localLaneName = this.switchProps.alias || this.laneIdToSwitchTo.name;\n if (this.switchProps.remoteLane) {\n if (!this.switchProps.localTrackedLane) {\n this.consumer.scope.lanes.trackLane({\n localLane: localLaneName,\n remoteLane: this.laneIdToSwitchTo.name,\n remoteScope: this.laneIdToSwitchTo.scope,\n });\n }\n }\n\n this.consumer.setCurrentLane(this.laneIdToSwitchTo, !this.laneToSwitchTo?.isNew);\n this.consumer.bitMap.syncWithIds(\n ComponentIdList.fromArray(this.switchProps.ids || []),\n ComponentIdList.fromArray(this.switchProps.laneBitIds || [])\n );\n\n // If this cache isn't cleared, here's what can happen:\n // Switching from \"lane-dev\" to \"main\": while on \"lane-dev\", ModelComponent keeps in-memory props\n // `laneHeadLocal` and `laneHeadRemote`. Methods like `headIncludeRemote()` use them and may return\n // the lane-dev head instead of the head on main.\n this.consumer.scope.objects.clearObjectsFromCache();\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAA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D,MAAM,CAAC2B,WAAW,CAC9BC,8BAAe,CAACC,SAAS,CAAC,IAAI,CAAC1F,WAAW,CAACY,GAAG,IAAI,EAAE,CAAC,EACrD6E,8BAAe,CAACC,SAAS,CAAC,IAAI,CAAC1F,WAAW,CAAC0D,UAAU,IAAI,EAAE,CAC7D,CAAC;;IAED;IACA;IACA;IACA;IACA,IAAI,CAACvD,QAAQ,CAACwB,KAAK,CAACgE,OAAO,CAACC,qBAAqB,CAAC,CAAC;EACrD;AACF;AAACC,OAAA,CAAAjG,YAAA,GAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"names":["_laneId","data","require","_componentId","_bitError","_lanesModules","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LaneSwitcher","constructor","workspace","logger","switchProps","checkoutProps","lanes","consumer","switch","setStatusLine","isOnMain","throwForStagedComponents","populateSwitchProps","bitMapIds","bitmapIdsFromCurrentLaneIncludeRemoved","idsToSwitch","ids","map","id","bitMapId","searchWithoutVersion","allowAddingComponentsFromScope","versionPerId","resolveMultipleComponentIds","lane","laneToSwitchTo","results","checkout","saveLanesData","onDestroy","laneId","scope","parseLaneIdFromString","laneName","skipFetch","localLane","loadLane","getMainIds","allIds","listIds","toVersionLatest","legacyScope","scopeImporter","importWithoutDeps","cache","ignoreMissingHead","err","consoleWarning","message","getIdsOfDefaultLane","mainIds","isDefault","populatePropsAccordingToDefaultLane","laneIds","BitError","toString","populatePropsAccordingToLocalLane","populatePropsAccordingToRemoteLane","idsOnLaneOnly","find","isEqualWithoutVersion","idsOnMainOnly","laneBitIds","populateIdsAccordingToPattern","filterIdsNotInWorkspaceIfNeeded","existingOnWorkspaceOnly","isInWorkspace","Boolean","pattern","bitMap","getAllBitIdsFromAllLanes","filterIdsFromPoolIdsByPattern","remoteLaneId","laneIdToSwitchTo","debug","throwForSwitchingToCurrentLane","remoteLane","fetchLaneWithItsComponents","name","localTrackedLane","getAliasByLaneId","undefined","toComponentIds","LaneId","from","DEFAULT_LANE","toLaneId","getCurrentLaneId","isEqual","laneIdStr","localLaneName","alias","trackLane","remoteScope","setCurrentLane","isNew","syncWithIds","ComponentIdList","fromArray","objects","clearObjectsFromCache","exports"],"sources":["switch-lanes.ts"],"sourcesContent":["import type { Consumer } from '@teambit/legacy.consumer';\nimport { LaneId, DEFAULT_LANE } from '@teambit/lane-id';\nimport type { ComponentID } from '@teambit/component-id';\nimport { ComponentIdList } from '@teambit/component-id';\nimport type { ApplyVersionResults } from '@teambit/component.modules.merge-helper';\nimport type { Lane } from '@teambit/objects';\nimport type { CheckoutProps } from '@teambit/checkout';\nimport type { Workspace } from '@teambit/workspace';\nimport type { Logger } from '@teambit/logger';\nimport { BitError } from '@teambit/bit-error';\nimport { throwForStagedComponents } from '@teambit/lanes.modules.create-lane';\nimport type { LanesMain } from './lanes.main.runtime';\n\nexport type SwitchProps = {\n laneName: string;\n ids?: ComponentID[];\n laneBitIds?: ComponentID[]; // only needed for the deprecated onLanesOnly prop. once this prop is removed, this prop can be removed as well.\n pattern?: string;\n skipFetch?: boolean;\n existingOnWorkspaceOnly?: boolean;\n remoteLane?: Lane;\n localTrackedLane?: string;\n alias?: string;\n};\n\nexport class LaneSwitcher {\n private consumer: Consumer;\n private laneIdToSwitchTo: LaneId; // populated by `this.populateSwitchProps()`\n private laneToSwitchTo: Lane | undefined; // populated by `this.populateSwitchProps()`, if default-lane, it's undefined\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private switchProps: SwitchProps,\n private checkoutProps: CheckoutProps,\n private lanes: LanesMain\n ) {\n this.consumer = this.workspace.consumer;\n }\n\n async switch(): Promise<ApplyVersionResults> {\n this.logger.setStatusLine(`switching lanes`);\n if (this.workspace.isOnMain()) {\n await throwForStagedComponents(this.workspace);\n }\n await this.populateSwitchProps();\n const bitMapIds = this.workspace.consumer.bitmapIdsFromCurrentLaneIncludeRemoved;\n const idsToSwitch = this.switchProps.ids || [];\n const ids = idsToSwitch.map((id) => {\n const bitMapId = bitMapIds.searchWithoutVersion(id);\n return bitMapId || id;\n });\n\n const checkoutProps: CheckoutProps = {\n ...this.checkoutProps,\n ids,\n allowAddingComponentsFromScope: true,\n versionPerId: await this.workspace.resolveMultipleComponentIds(idsToSwitch),\n lane: this.laneToSwitchTo,\n };\n\n const results = await this.lanes.checkout.checkout(checkoutProps);\n\n await this.saveLanesData();\n await this.consumer.onDestroy('lane-switch');\n\n return results;\n }\n\n private async populateSwitchProps() {\n const laneId = await this.consumer.scope.lanes.parseLaneIdFromString(this.switchProps.laneName);\n const skipFetch = this.switchProps.skipFetch;\n\n const localLane = await this.consumer.scope.loadLane(laneId);\n const getMainIds = async () => {\n if (!skipFetch) {\n // fetch by \"latest\" and without a lane, so the remote resolves each id against the head on\n // main of its original scope. passing the ids as-is would send the versions from .bitmap,\n // which on a lane are snap hashes that live on the lane's scope, not on the component's\n // original scope. the original scope can't resolve them, drops them from the response\n // silently, and the local head on main is left stale.\n const allIds = this.workspace.listIds().toVersionLatest();\n try {\n await this.workspace.scope.legacyScope.scopeImporter.importWithoutDeps(allIds, {\n cache: false,\n ignoreMissingHead: true,\n });\n } catch (err: any) {\n this.logger.consoleWarning(\n `failed to fetch the latest from the remote, falling back to local state. ${err.message}\\nuse --skip-fetch to skip this step.`\n );\n }\n }\n return this.consumer.getIdsOfDefaultLane();\n };\n const mainIds = await getMainIds();\n if (laneId.isDefault()) {\n await this.populatePropsAccordingToDefaultLane();\n this.switchProps.ids = mainIds;\n } else {\n let laneIds: ComponentID[];\n if (skipFetch) {\n if (!localLane) {\n throw new BitError(\n `unable to switch to lane \"${laneId.toString()}\" with --skip-fetch: the lane doesn't exist in the local scope. run without --skip-fetch to fetch it from the remote.`\n );\n }\n laneIds = this.populatePropsAccordingToLocalLane(localLane);\n } else {\n try {\n laneIds = await this.populatePropsAccordingToRemoteLane(laneId);\n } catch (err: any) {\n if (!localLane) throw err;\n this.logger.consoleWarning(\n `failed to fetch lane \"${laneId.toString()}\" from the remote, falling back to local state. ${err.message}\\nuse --skip-fetch to skip this step.`\n );\n laneIds = this.populatePropsAccordingToLocalLane(localLane);\n }\n }\n const idsOnLaneOnly = laneIds.filter((id) => !mainIds.find((i) => i.isEqualWithoutVersion(id)));\n const idsOnMainOnly = mainIds.filter((id) => !laneIds.find((i) => i.isEqualWithoutVersion(id)));\n this.switchProps.ids = [...idsOnMainOnly, ...laneIds];\n this.switchProps.laneBitIds = idsOnLaneOnly;\n }\n await this.populateIdsAccordingToPattern();\n this.filterIdsNotInWorkspaceIfNeeded();\n }\n\n /**\n * `--workspace-only`: switch only the components the workspace already tracks. a lane can carry\n * components this workspace doesn't have - e.g. one that was removed from the source after it was\n * snapped onto the lane - and checking those out would write them back into .bitmap and to the\n * filesystem. this flag is how a caller says \"move the lane pointer, leave my working tree as is\"\n * (`bit ci pr` relies on it: the git checkout is the source of truth there).\n */\n private filterIdsNotInWorkspaceIfNeeded() {\n if (!this.switchProps.existingOnWorkspaceOnly) return;\n const bitMapIds = this.consumer.bitmapIdsFromCurrentLaneIncludeRemoved;\n const isInWorkspace = (id: ComponentID) => Boolean(bitMapIds.searchWithoutVersion(id));\n this.switchProps.ids = (this.switchProps.ids || []).filter(isInWorkspace);\n this.switchProps.laneBitIds = (this.switchProps.laneBitIds || []).filter(isInWorkspace);\n }\n\n private async populateIdsAccordingToPattern() {\n if (!this.switchProps.pattern) {\n return;\n }\n if (this.consumer.bitMap.getAllBitIdsFromAllLanes().length) {\n // if the workspace is not empty, it's possible that it has components from lane-x, and is now switching\n // partially to lane-y, while lane-y has the same components as lane-x. in which case, the user ends up with\n // an invalid state of components from lane-x and lane-y together.\n throw new BitError('error: use --pattern only when the workspace is empty');\n }\n const allIds = this.switchProps.ids || [];\n this.switchProps.ids = await this.workspace.filterIdsFromPoolIdsByPattern(this.switchProps.pattern, allIds);\n }\n\n private async populatePropsAccordingToRemoteLane(remoteLaneId: LaneId): Promise<ComponentID[]> {\n this.laneIdToSwitchTo = remoteLaneId;\n this.logger.debug(`populatePropsAccordingToRemoteLane, remoteLaneId: ${remoteLaneId.toString()}`);\n this.throwForSwitchingToCurrentLane();\n const remoteLane = await this.lanes.fetchLaneWithItsComponents(remoteLaneId);\n this.switchProps.laneName = remoteLaneId.name;\n this.switchProps.localTrackedLane = this.consumer.scope.lanes.getAliasByLaneId(remoteLaneId) || undefined;\n this.switchProps.remoteLane = remoteLane;\n this.laneToSwitchTo = remoteLane;\n this.logger.debug(`populatePropsAccordingToRemoteLane, completed`);\n return [...remoteLane.toComponentIds()];\n }\n\n private async populatePropsAccordingToDefaultLane() {\n this.laneIdToSwitchTo = LaneId.from(DEFAULT_LANE, this.consumer.scope.name);\n this.throwForSwitchingToCurrentLane();\n }\n\n private populatePropsAccordingToLocalLane(localLane: Lane): ComponentID[] {\n this.laneIdToSwitchTo = localLane.toLaneId();\n this.laneToSwitchTo = localLane;\n this.throwForSwitchingToCurrentLane();\n return [...localLane.toComponentIds()];\n }\n\n private throwForSwitchingToCurrentLane() {\n if (this.consumer.getCurrentLaneId().isEqual(this.laneIdToSwitchTo)) {\n const laneIdStr = this.laneIdToSwitchTo.isDefault()\n ? this.laneIdToSwitchTo.name\n : this.laneIdToSwitchTo.toString();\n throw new BitError(`already checked out to \"${laneIdStr}\".\nto be up to date with the remote lane, please run \"bit checkout head\"`);\n }\n }\n\n private async saveLanesData() {\n const localLaneName = this.switchProps.alias || this.laneIdToSwitchTo.name;\n if (this.switchProps.remoteLane) {\n if (!this.switchProps.localTrackedLane) {\n this.consumer.scope.lanes.trackLane({\n localLane: localLaneName,\n remoteLane: this.laneIdToSwitchTo.name,\n remoteScope: this.laneIdToSwitchTo.scope,\n });\n }\n }\n\n this.consumer.setCurrentLane(this.laneIdToSwitchTo, !this.laneToSwitchTo?.isNew);\n this.consumer.bitMap.syncWithIds(\n ComponentIdList.fromArray(this.switchProps.ids || []),\n ComponentIdList.fromArray(this.switchProps.laneBitIds || [])\n );\n\n // If this cache isn't cleared, here's what can happen:\n // Switching from \"lane-dev\" to \"main\": while on \"lane-dev\", ModelComponent keeps in-memory props\n // `laneHeadLocal` and `laneHeadRemote`. Methods like `headIncludeRemote()` use them and may return\n // the lane-dev head instead of the head on main.\n this.consumer.scope.objects.clearObjectsFromCache();\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,aAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,YAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAMA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,cAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,aAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8E,SAAAK,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,a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ACwB,KAAK,CAACoE,OAAO,CAACC,qBAAqB,CAAC,CAAC;EACrD;AACF;AAACC,OAAA,CAAArG,YAAA,GAAAA,YAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/lanes",
3
- "version": "1.0.1121",
3
+ "version": "1.0.1126",
4
4
  "homepage": "https://bit.cloud/teambit/lanes/lanes",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.lanes",
8
8
  "name": "lanes",
9
- "version": "1.0.1121"
9
+ "version": "1.0.1126"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "4.1.2",
@@ -21,14 +21,25 @@
21
21
  "group-array": "1.0.0",
22
22
  "@teambit/lanes.ui.models.lanes-model": "0.0.233",
23
23
  "@teambit/bit-error": "0.0.404",
24
+ "@teambit/cli": "0.0.1367",
25
+ "@teambit/component.modules.merge-helper": "0.0.91",
24
26
  "@teambit/lane-id": "0.0.312",
25
27
  "@teambit/legacy.constants": "0.0.41",
28
+ "@teambit/legacy.scope": "0.0.148",
26
29
  "@teambit/harmony": "0.4.12",
30
+ "@teambit/express": "0.0.1466",
31
+ "@teambit/logger": "0.0.1460",
27
32
  "@teambit/component-id": "1.2.4",
33
+ "@teambit/component.snap-distance": "0.0.149",
28
34
  "@teambit/git.modules.git-executable": "0.0.42",
29
35
  "@teambit/harmony.modules.concurrency": "0.0.42",
30
36
  "@teambit/lanes.entities.lane-diff": "0.0.199",
37
+ "@teambit/lanes.modules.create-lane": "0.0.183",
38
+ "@teambit/lanes.modules.diff": "0.0.653",
31
39
  "@teambit/legacy-bit-id": "1.1.3",
40
+ "@teambit/legacy.component-diff": "0.0.204",
41
+ "@teambit/legacy.component-list": "0.0.202",
42
+ "@teambit/scope.remotes": "0.0.148",
32
43
  "@teambit/component.ui.component-compare.models.component-compare-props": "0.0.133",
33
44
  "@teambit/design.ui.pages.not-found": "0.0.371",
34
45
  "@teambit/lanes.hooks.use-lanes": "0.0.294",
@@ -43,45 +54,34 @@
43
54
  "@teambit/ui-foundation.ui.react-router.slot-router": "0.0.527",
44
55
  "@teambit/ui-foundation.ui.react-router.use-query": "0.0.505",
45
56
  "@teambit/lanes.ui.navigation.lane-switcher": "0.0.239",
46
- "@teambit/checkout": "1.0.1101",
47
- "@teambit/cli": "0.0.1365",
48
- "@teambit/component.modules.merge-helper": "0.0.89",
49
- "@teambit/importer": "1.0.1100",
50
- "@teambit/legacy.scope": "0.0.146",
51
- "@teambit/scope": "1.0.1100",
52
- "@teambit/workspace": "1.0.1100",
53
- "@teambit/express": "0.0.1464",
54
- "@teambit/logger": "0.0.1458",
55
- "@teambit/graphql": "1.0.1100",
56
- "@teambit/component-compare": "1.0.1100",
57
- "@teambit/component-writer": "1.0.1100",
58
- "@teambit/component.snap-distance": "0.0.147",
59
- "@teambit/component": "1.0.1100",
60
- "@teambit/export": "1.0.1100",
61
- "@teambit/install": "1.0.1100",
62
- "@teambit/lanes.modules.create-lane": "0.0.181",
63
- "@teambit/lanes.modules.diff": "0.0.651",
64
- "@teambit/legacy.component-diff": "0.0.202",
65
- "@teambit/legacy.component-list": "0.0.200",
66
- "@teambit/merging": "1.0.1103",
67
- "@teambit/objects": "0.0.607",
68
- "@teambit/remove": "1.0.1100",
69
- "@teambit/scope.remotes": "0.0.146",
70
- "@teambit/command-bar": "1.0.1100",
71
- "@teambit/ui": "1.0.1100",
72
- "@teambit/legacy.consumer": "0.0.146",
73
- "@teambit/scope.network": "0.0.146"
57
+ "@teambit/legacy.consumer": "0.0.148",
58
+ "@teambit/scope.network": "0.0.148",
59
+ "@teambit/checkout": "1.0.1106",
60
+ "@teambit/importer": "1.0.1105",
61
+ "@teambit/scope": "1.0.1105",
62
+ "@teambit/workspace": "1.0.1105",
63
+ "@teambit/graphql": "1.0.1105",
64
+ "@teambit/component-compare": "1.0.1105",
65
+ "@teambit/component-writer": "1.0.1105",
66
+ "@teambit/component": "1.0.1105",
67
+ "@teambit/export": "1.0.1105",
68
+ "@teambit/install": "1.0.1105",
69
+ "@teambit/merging": "1.0.1108",
70
+ "@teambit/objects": "0.0.612",
71
+ "@teambit/remove": "1.0.1105",
72
+ "@teambit/command-bar": "1.0.1105",
73
+ "@teambit/ui": "1.0.1105"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@types/lodash": "4.14.165",
77
77
  "@types/fs-extra": "9.0.7",
78
78
  "@types/mocha": "9.1.0",
79
+ "@teambit/component.testing.mock-components": "0.0.420",
80
+ "@teambit/harmony.testing.load-aspect": "0.0.415",
81
+ "@teambit/workspace.testing.mock-workspace": "0.0.227",
79
82
  "@teambit/harmony.envs.core-aspect-env": "2.0.6",
80
- "@teambit/component.testing.mock-components": "0.0.418",
81
- "@teambit/harmony.testing.load-aspect": "0.0.413",
82
- "@teambit/merge-lanes": "1.0.1121",
83
- "@teambit/snapping": "1.0.1100",
84
- "@teambit/workspace.testing.mock-workspace": "0.0.225"
83
+ "@teambit/merge-lanes": "1.0.1126",
84
+ "@teambit/snapping": "1.0.1105"
85
85
  },
86
86
  "peerDependencies": {
87
87
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0",