@teambit/lanes 0.0.544 → 0.0.546

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.
@@ -4,3 +4,4 @@ import Lane from '@teambit/legacy/dist/scope/models/lane';
4
4
  export declare function createLane(consumer: Consumer, laneName: string, scopeName: string, remoteLane?: Lane): Promise<Lane>;
5
5
  export declare function createLaneInScope(laneName: string, scope: ScopeMain): Promise<Lane>;
6
6
  export declare function throwForInvalidLaneName(laneName: string): void;
7
+ export declare function throwForStagedComponents(consumer: Consumer): Promise<void>;
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.createLane = createLane;
9
9
  exports.createLaneInScope = createLaneInScope;
10
10
  exports.throwForInvalidLaneName = throwForInvalidLaneName;
11
+ exports.throwForStagedComponents = throwForStagedComponents;
11
12
  function _bitError() {
12
13
  const data = require("@teambit/bit-error");
13
14
  _bitError = function () {
@@ -120,7 +121,7 @@ async function throwForStagedComponents(consumer) {
120
121
  const componentList = new (_componentsList().default)(consumer);
121
122
  const stagedComponents = await componentList.listExportPendingComponentsIds();
122
123
  if (stagedComponents.length) {
123
- throw new (_bitError().BitError)(`unable to create a new lane, please export or reset the following components first: ${stagedComponents.join(', ')}`);
124
+ throw new (_bitError().BitError)(`unable to switch/create a new lane, please export or reset the following components first: ${stagedComponents.join(', ')}`);
124
125
  }
125
126
  }
126
127
  function isValidLaneName(val) {
@@ -1 +1 @@
1
- {"version":3,"names":["createLane","consumer","laneName","scopeName","remoteLane","lanes","scope","listLanes","find","lane","name","BitError","throwForInvalidLaneName","throwForStagedComponents","getDataToPopulateLaneObjectIfNeeded","components","currentLaneObject","getCurrentLaneObject","laneComponents","workspaceIds","bitMap","getAllBitIds","laneComponentWithBitmapHead","map","id","head","bitmapHead","searchWithoutVersion","isHash","version","Ref","from","forkedFrom","getLaneOrigin","newLane","Lane","hash","toString","log","create","dataToPopulate","setLaneComponents","saveLane","createLaneInScope","legacyScope","currentLaneId","laneId","undefined","isLaneExported","currentLane","isValidLaneName","componentList","ComponentsList","stagedComponents","listExportPendingComponentsIds","length","join","val","test"],"sources":["create-lane.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { LaneId } from '@teambit/lane-id';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { ScopeMain } from '@teambit/scope';\n// import { BitIds } from '@teambit/legacy/dist/bit-id';\nimport Lane, { LaneComponent } from '@teambit/legacy/dist/scope/models/lane';\nimport { isHash } from '@teambit/component-version';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\n\nexport async function createLane(\n consumer: Consumer,\n laneName: string,\n scopeName: string,\n remoteLane?: Lane\n): Promise<Lane> {\n const lanes = await consumer.scope.listLanes();\n if (lanes.find((lane) => lane.name === laneName)) {\n throw new BitError(`lane \"${laneName}\" already exists, to switch to this lane, please use \"bit switch\" command`);\n }\n throwForInvalidLaneName(laneName);\n await throwForStagedComponents(consumer);\n const getDataToPopulateLaneObjectIfNeeded = async (): Promise<LaneComponent[]> => {\n if (remoteLane) return remoteLane.components;\n // when branching from one lane to another, copy components from the origin lane\n // when branching from main, no need to copy anything\n const currentLaneObject = await consumer.getCurrentLaneObject();\n if (!currentLaneObject) return [];\n const laneComponents = currentLaneObject.components;\n const workspaceIds = consumer.bitMap.getAllBitIds();\n const laneComponentWithBitmapHead = laneComponents.map(({ id, head }) => {\n const bitmapHead = workspaceIds.searchWithoutVersion(id);\n if (bitmapHead && isHash(bitmapHead.version)) {\n return { id, head: Ref.from(bitmapHead.version as string) };\n }\n return { id, head };\n });\n return laneComponentWithBitmapHead;\n };\n\n const forkedFrom = await getLaneOrigin(consumer);\n const newLane = remoteLane\n ? Lane.from({\n name: laneName,\n hash: remoteLane.hash().toString(),\n log: remoteLane.log,\n scope: remoteLane.scope,\n forkedFrom,\n })\n : Lane.create(laneName, scopeName, forkedFrom);\n const dataToPopulate = await getDataToPopulateLaneObjectIfNeeded();\n newLane.setLaneComponents(dataToPopulate);\n\n await consumer.scope.lanes.saveLane(newLane);\n\n return newLane;\n}\n\nexport async function createLaneInScope(laneName: string, scope: ScopeMain): Promise<Lane> {\n const lanes = await scope.legacyScope.listLanes();\n if (lanes.find((lane) => lane.name === laneName)) {\n throw new BitError(`lane \"${laneName}\" already exists`);\n }\n throwForInvalidLaneName(laneName);\n const newLane = Lane.create(laneName, scope.name);\n await scope.legacyScope.lanes.saveLane(newLane);\n return newLane;\n}\n\nasync function getLaneOrigin(consumer: Consumer): Promise<LaneId | undefined> {\n const currentLaneId = consumer.bitMap.laneId;\n if (!currentLaneId) return undefined;\n if (consumer.bitMap.isLaneExported) {\n return currentLaneId;\n }\n // current lane is new.\n const currentLane = await consumer.getCurrentLaneObject();\n return currentLane?.forkedFrom;\n}\n\nexport function throwForInvalidLaneName(laneName: string) {\n if (!isValidLaneName(laneName)) {\n throw new BitError(\n `lane \"${laneName}\" has invalid characters. lane name can only contain alphanumeric, lowercase characters, and the following [\"-\", \"_\", \"$\", \"!\"]`\n );\n }\n}\n\nasync function throwForStagedComponents(consumer: Consumer) {\n const componentList = new ComponentsList(consumer);\n const stagedComponents = await componentList.listExportPendingComponentsIds();\n if (stagedComponents.length) {\n throw new BitError(\n `unable to create a new lane, please export or reset the following components first: ${stagedComponents.join(\n ', '\n )}`\n );\n }\n}\n\nfunction isValidLaneName(val: unknown): boolean {\n if (typeof val !== 'string') return false;\n // @todo: should we allow slash? if so, we should probably replace the lane-delimiter with something else. (maybe \":\")\n return /^[$\\-_!a-z0-9]+$/.test(val);\n}\n"],"mappings":";;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAJA;;AAMO,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AAc,EAAE;IAClC,OAAOH,aAAa;EACtB;EACA;EACA,MAAMI,WAAW,GAAG,MAAMhD,QAAQ,CAACgB,oBAAoB,EAAE;EACzD,OAAOgC,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEjB,UAAU;AAChC;AAEO,SAASpB,uBAAuB,CAACV,QAAgB,EAAE;EACxD,IAAI,CAACgD,eAAe,CAAChD,QAAQ,CAAC,EAAE;IAC9B,MAAM,KAAIS,oBAAQ,EACf,SAAQT,QAAS,iIAAgI,CACnJ;EACH;AACF;AAEA,eAAeW,wBAAwB,CAACZ,QAAkB,EAAE;EAC1D,MAAMkD,aAAa,GAAG,KAAIC,yBAAc,EAACnD,QAAQ,CAAC;EAClD,MAAMoD,gBAAgB,GAAG,MAAMF,aAAa,CAACG,8BAA8B,EAAE;EAC7E,IAAID,gBAAgB,CAACE,MAAM,EAAE;IAC3B,MAAM,KAAI5C,oBAAQ,EACf,uFAAsF0C,gBAAgB,CAACG,IAAI,CAC1G,IAAI,CACJ,EAAC,CACJ;EACH;AACF;AAEA,SAASN,eAAe,CAACO,GAAY,EAAW;EAC9C,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE,OAAO,KAAK;EACzC;EACA,OAAO,kBAAkB,CAACC,IAAI,CAACD,GAAG,CAAC;AACrC"}
1
+ {"version":3,"names":["createLane","consumer","laneName","scopeName","remoteLane","lanes","scope","listLanes","find","lane","name","BitError","throwForInvalidLaneName","throwForStagedComponents","getDataToPopulateLaneObjectIfNeeded","components","currentLaneObject","getCurrentLaneObject","laneComponents","workspaceIds","bitMap","getAllBitIds","laneComponentWithBitmapHead","map","id","head","bitmapHead","searchWithoutVersion","isHash","version","Ref","from","forkedFrom","getLaneOrigin","newLane","Lane","hash","toString","log","create","dataToPopulate","setLaneComponents","saveLane","createLaneInScope","legacyScope","currentLaneId","laneId","undefined","isLaneExported","currentLane","isValidLaneName","componentList","ComponentsList","stagedComponents","listExportPendingComponentsIds","length","join","val","test"],"sources":["create-lane.ts"],"sourcesContent":["import { BitError } from '@teambit/bit-error';\nimport { LaneId } from '@teambit/lane-id';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { ScopeMain } from '@teambit/scope';\n// import { BitIds } from '@teambit/legacy/dist/bit-id';\nimport Lane, { LaneComponent } from '@teambit/legacy/dist/scope/models/lane';\nimport { isHash } from '@teambit/component-version';\nimport ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\n\nexport async function createLane(\n consumer: Consumer,\n laneName: string,\n scopeName: string,\n remoteLane?: Lane\n): Promise<Lane> {\n const lanes = await consumer.scope.listLanes();\n if (lanes.find((lane) => lane.name === laneName)) {\n throw new BitError(`lane \"${laneName}\" already exists, to switch to this lane, please use \"bit switch\" command`);\n }\n throwForInvalidLaneName(laneName);\n await throwForStagedComponents(consumer);\n const getDataToPopulateLaneObjectIfNeeded = async (): Promise<LaneComponent[]> => {\n if (remoteLane) return remoteLane.components;\n // when branching from one lane to another, copy components from the origin lane\n // when branching from main, no need to copy anything\n const currentLaneObject = await consumer.getCurrentLaneObject();\n if (!currentLaneObject) return [];\n const laneComponents = currentLaneObject.components;\n const workspaceIds = consumer.bitMap.getAllBitIds();\n const laneComponentWithBitmapHead = laneComponents.map(({ id, head }) => {\n const bitmapHead = workspaceIds.searchWithoutVersion(id);\n if (bitmapHead && isHash(bitmapHead.version)) {\n return { id, head: Ref.from(bitmapHead.version as string) };\n }\n return { id, head };\n });\n return laneComponentWithBitmapHead;\n };\n\n const forkedFrom = await getLaneOrigin(consumer);\n const newLane = remoteLane\n ? Lane.from({\n name: laneName,\n hash: remoteLane.hash().toString(),\n log: remoteLane.log,\n scope: remoteLane.scope,\n forkedFrom,\n })\n : Lane.create(laneName, scopeName, forkedFrom);\n const dataToPopulate = await getDataToPopulateLaneObjectIfNeeded();\n newLane.setLaneComponents(dataToPopulate);\n\n await consumer.scope.lanes.saveLane(newLane);\n\n return newLane;\n}\n\nexport async function createLaneInScope(laneName: string, scope: ScopeMain): Promise<Lane> {\n const lanes = await scope.legacyScope.listLanes();\n if (lanes.find((lane) => lane.name === laneName)) {\n throw new BitError(`lane \"${laneName}\" already exists`);\n }\n throwForInvalidLaneName(laneName);\n const newLane = Lane.create(laneName, scope.name);\n await scope.legacyScope.lanes.saveLane(newLane);\n return newLane;\n}\n\nasync function getLaneOrigin(consumer: Consumer): Promise<LaneId | undefined> {\n const currentLaneId = consumer.bitMap.laneId;\n if (!currentLaneId) return undefined;\n if (consumer.bitMap.isLaneExported) {\n return currentLaneId;\n }\n // current lane is new.\n const currentLane = await consumer.getCurrentLaneObject();\n return currentLane?.forkedFrom;\n}\n\nexport function throwForInvalidLaneName(laneName: string) {\n if (!isValidLaneName(laneName)) {\n throw new BitError(\n `lane \"${laneName}\" has invalid characters. lane name can only contain alphanumeric, lowercase characters, and the following [\"-\", \"_\", \"$\", \"!\"]`\n );\n }\n}\n\nexport async function throwForStagedComponents(consumer: Consumer) {\n const componentList = new ComponentsList(consumer);\n const stagedComponents = await componentList.listExportPendingComponentsIds();\n if (stagedComponents.length) {\n throw new BitError(\n `unable to switch/create a new lane, please export or reset the following components first: ${stagedComponents.join(\n ', '\n )}`\n );\n }\n}\n\nfunction isValidLaneName(val: unknown): boolean {\n if (typeof val !== 'string') return false;\n // @todo: should we allow slash? if so, we should probably replace the lane-delimiter with something else. (maybe \":\")\n return /^[$\\-_!a-z0-9]+$/.test(val);\n}\n"],"mappings":";;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAJA;;AAMO,eAAeA,UAAU,CAC9BC,QAAkB,EAClBC,QAAgB,EAChBC,SAAiB,EACjBC,UAAiB,EACF;EACf,MAAMC,KAA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oB,EAAE;EACzD,OAAOgC,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEjB,UAAU;AAChC;AAEO,SAASpB,uBAAuB,CAACV,QAAgB,EAAE;EACxD,IAAI,CAACgD,eAAe,CAAChD,QAAQ,CAAC,EAAE;IAC9B,MAAM,KAAIS,oBAAQ,EACf,SAAQT,QAAS,iIAAgI,CACnJ;EACH;AACF;AAEO,eAAeW,wBAAwB,CAACZ,QAAkB,EAAE;EACjE,MAAMkD,aAAa,GAAG,KAAIC,yBAAc,EAACnD,QAAQ,CAAC;EAClD,MAAMoD,gBAAgB,GAAG,MAAMF,aAAa,CAACG,8BAA8B,EAAE;EAC7E,IAAID,gBAAgB,CAACE,MAAM,EAAE;IAC3B,MAAM,KAAI5C,oBAAQ,EACf,8FAA6F0C,gBAAgB,CAACG,IAAI,CACjH,IAAI,CACJ,EAAC,CACJ;EACH;AACF;AAEA,SAASN,eAAe,CAACO,GAAY,EAAW;EAC9C,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE,OAAO,KAAK;EACzC;EACA,OAAO,kBAAkB,CAACC,IAAI,CAACD,GAAG,CAAC;AACrC"}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.544/dist/lanes.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.544/dist/lanes.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.546/dist/lanes.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.546/dist/lanes.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -70,6 +70,13 @@ function _bitError() {
70
70
  };
71
71
  return data;
72
72
  }
73
+ function _createLane() {
74
+ const data = require("./create-lane");
75
+ _createLane = function () {
76
+ return data;
77
+ };
78
+ return data;
79
+ }
73
80
  class LaneSwitcher {
74
81
  // populated by `this.populateSwitchProps()`
75
82
  // populated by `this.populateSwitchProps()`, if default-lane, it's undefined
@@ -86,6 +93,9 @@ class LaneSwitcher {
86
93
  }
87
94
  async switch() {
88
95
  this.logger.setStatusLine(`switching lanes`);
96
+ if (this.workspace.isOnMain()) {
97
+ await (0, _createLane().throwForStagedComponents)(this.consumer);
98
+ }
89
99
  await this.populateSwitchProps();
90
100
  const allComponentsStatus = await this.getAllComponentsStatus();
91
101
  const componentWithConflict = allComponentsStatus.find(component => component.mergeResults && component.mergeResults.hasConflicts);
@@ -1 +1 @@
1
- {"version":3,"names":["LaneSwitcher","constructor","workspace","logger","switchProps","checkoutProps","Lanes","consumer","switch","setStatusLine","populateSwitchProps","allComponentsStatus","getAllComponentsStatus","componentWithConflict","find","component","mergeResults","hasConflicts","promptMergeOptions","mergeStrategy","GeneralError","id","toStringWithoutVersion","getMergeStrategyInteractive","failedComponents","filter","componentStatus","failureMessage","map","unchangedLegitimately","succeededComponents","componentsResults","mapSeries","componentFromFS","applyVersion","markFilesToBeRemovedIfNeeded","saveLanesData","componentsWithDependencies","c","manyComponentsWriterOpts","skipDependencyInstallation","skipNpmInstall","verbose","writeConfig","installationError","componentWriter","writeMany","deleteFilesIfNeeded","appliedVersionComponents","applyVersionResult","onDestroy","components","laneId","scope","lanes","parseLaneIdFromString","laneName","localLane","loadLane","isDefault","populatePropsAccordingToDefaultLane","populatePropsAccordingToLocalLane","populatePropsAccordingToRemoteLane","remoteLaneId","laneIdToSwitch","debug","toString","getCurrentLaneId","isEqual","BitError","remoteLane","fetchLaneWithItsComponents","name","ids","l","changeVersion","head","localTrackedLane","getAliasByLaneId","undefined","laneToSwitchTo","isOnLane","getIdsOfDefaultLane","LaneId","from","DEFAULT_LANE","toLaneId","tmp","Tmp","componentsStatusP","getComponentStatus","componentsStatus","Promise","all","clear","err","localLaneName","alias","trackLane","remoteScope","setCurrentLane","isNew","bitMap","syncWithLanes","returnFailure","msg","modelComponent","getModelComponentIfExist","unmerged","objects","unmergedComponents","getEntry","version","existingBitMapId","getBitIdIfExist","ignoreVersion","componentOnLane","loadVersion","isRemoved","existingOnWorkspaceOnly","componentFromModel","hasVersion","currentlyUsedVersion","baseComponent","loadComponent","isModified","isComponentSourceCodeModified","isHeadSameAsMain","getHead","tagVersion","getTagOfRefIfExists","headVersion","otherComponent","threeWayMerge","otherLabel","currentComponent","currentLabel"],"sources":["switch-lanes.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport { LaneId, DEFAULT_LANE } from '@teambit/lane-id';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { ApplyVersionResults } from '@teambit/merging';\nimport { ComponentWithDependencies } from '@teambit/legacy/dist/scope';\nimport { Version, Lane } from '@teambit/legacy/dist/scope/models';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport {\n applyVersion,\n ComponentStatus,\n CheckoutProps,\n deleteFilesIfNeeded,\n markFilesToBeRemovedIfNeeded,\n} from '@teambit/legacy/dist/consumer/versions-ops/checkout-version';\nimport {\n FailedComponents,\n getMergeStrategyInteractive,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport threeWayMerge, {\n MergeResultsThreeWay,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport { Workspace } from '@teambit/workspace';\nimport { Logger } from '@teambit/logger';\nimport { BitError } from '@teambit/bit-error';\nimport { LanesMain } from './lanes.main.runtime';\n\nexport type SwitchProps = {\n laneName: string;\n ids?: BitId[];\n existingOnWorkspaceOnly: boolean;\n remoteLane?: Lane;\n localTrackedLane?: string;\n alias?: string;\n};\n\nexport class LaneSwitcher {\n private consumer: Consumer;\n private laneIdToSwitch: 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 await this.populateSwitchProps();\n const allComponentsStatus: ComponentStatus[] = await this.getAllComponentsStatus();\n const componentWithConflict = allComponentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict) {\n if (!this.checkoutProps.promptMergeOptions && !this.checkoutProps.mergeStrategy) {\n throw new GeneralError(\n `automatic merge has failed for component ${componentWithConflict.id.toStringWithoutVersion()}.\\nplease use \"--manual\" to manually merge changes or use \"--theirs / --ours\" to choose one of the conflicted versions`\n );\n }\n if (!this.checkoutProps.mergeStrategy) this.checkoutProps.mergeStrategy = await getMergeStrategyInteractive();\n }\n const failedComponents: FailedComponents[] = allComponentsStatus\n .filter((componentStatus) => componentStatus.failureMessage)\n .map((componentStatus) => ({\n id: componentStatus.id,\n failureMessage: componentStatus.failureMessage as string,\n unchangedLegitimately: componentStatus.unchangedLegitimately,\n }));\n\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.failureMessage);\n // do not use Promise.all for applyVersion. otherwise, it'll write all components in parallel,\n // which can be an issue when some components are also dependencies of others\n const componentsResults = await mapSeries(succeededComponents, ({ id, componentFromFS, mergeResults }) => {\n return applyVersion(this.consumer, id, componentFromFS, mergeResults, this.checkoutProps);\n });\n\n markFilesToBeRemovedIfNeeded(succeededComponents, componentsResults);\n\n await this.saveLanesData();\n\n const componentsWithDependencies = componentsResults\n .map((c) => c.component)\n .filter((c) => c) as ComponentWithDependencies[];\n\n const manyComponentsWriterOpts = {\n componentsWithDependencies,\n skipDependencyInstallation: this.checkoutProps.skipNpmInstall,\n verbose: this.checkoutProps.verbose,\n writeConfig: this.checkoutProps.writeConfig,\n };\n const { installationError } = await this.Lanes.componentWriter.writeMany(manyComponentsWriterOpts);\n await deleteFilesIfNeeded(componentsResults, this.consumer);\n\n const appliedVersionComponents = componentsResults.map((c) => c.applyVersionResult);\n\n await this.consumer.onDestroy();\n\n return { components: appliedVersionComponents, failedComponents, installationError };\n }\n\n private async populateSwitchProps() {\n const laneId = await this.consumer.scope.lanes.parseLaneIdFromString(this.switchProps.laneName);\n\n const localLane = await this.consumer.scope.loadLane(laneId);\n if (laneId.isDefault()) {\n await this.populatePropsAccordingToDefaultLane();\n } else if (localLane) {\n this.populatePropsAccordingToLocalLane(localLane);\n } else {\n await this.populatePropsAccordingToRemoteLane(laneId);\n }\n }\n\n private async populatePropsAccordingToRemoteLane(remoteLaneId: LaneId) {\n this.laneIdToSwitch = remoteLaneId;\n this.logger.debug(`populatePropsAccordingToRemoteLane, remoteLaneId: ${remoteLaneId.toString()}`);\n if (this.consumer.getCurrentLaneId().isEqual(remoteLaneId)) {\n throw new BitError(`already checked out to \"${remoteLaneId.toString()}\"`);\n }\n const remoteLane = await this.Lanes.fetchLaneWithItsComponents(remoteLaneId);\n this.switchProps.laneName = remoteLaneId.name;\n this.switchProps.ids = remoteLane.components.map((l) => l.id.changeVersion(l.head.toString()));\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 }\n\n private async populatePropsAccordingToDefaultLane() {\n if (!this.consumer.isOnLane()) {\n throw new BitError(`already checked out to \"${this.switchProps.laneName}\"`);\n }\n this.switchProps.ids = await this.consumer.getIdsOfDefaultLane();\n this.laneIdToSwitch = LaneId.from(DEFAULT_LANE, this.consumer.scope.name);\n }\n\n private populatePropsAccordingToLocalLane(localLane: Lane) {\n if (this.consumer.getCurrentLaneId().name === this.switchProps.laneName) {\n throw new BitError(`already checked out to \"${this.switchProps.laneName}\"`);\n }\n this.switchProps.ids = localLane.components.map((c) => c.id.changeVersion(c.head.toString()));\n this.laneIdToSwitch = localLane.toLaneId();\n this.laneToSwitchTo = localLane;\n }\n\n private async getAllComponentsStatus(): Promise<ComponentStatus[]> {\n const { ids } = this.switchProps;\n const tmp = new Tmp(this.consumer.scope);\n try {\n const componentsStatusP = (ids as BitId[]).map((id) => getComponentStatus(this.consumer, id, this.switchProps));\n const componentsStatus = await Promise.all(componentsStatusP);\n await tmp.clear();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n }\n\n private async saveLanesData() {\n const localLaneName = this.switchProps.alias || this.laneIdToSwitch.name;\n if (this.switchProps.remoteLane) {\n if (!this.switchProps.localTrackedLane) {\n this.consumer.scope.lanes.trackLane({\n localLane: localLaneName,\n remoteLane: this.laneIdToSwitch.name,\n remoteScope: this.laneIdToSwitch.scope,\n });\n }\n }\n\n this.consumer.setCurrentLane(this.laneIdToSwitch, !this.laneToSwitchTo?.isNew);\n this.consumer.bitMap.syncWithLanes(this.laneToSwitchTo);\n }\n}\n\nasync function getComponentStatus(consumer: Consumer, id: BitId, switchProps: SwitchProps): Promise<ComponentStatus> {\n const componentStatus: ComponentStatus = { id };\n const returnFailure = (msg: string, unchangedLegitimately = false) => {\n componentStatus.failureMessage = msg;\n componentStatus.unchangedLegitimately = unchangedLegitimately;\n return componentStatus;\n };\n const modelComponent = await consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) {\n return returnFailure(`component ${id.toString()} had never imported`, true);\n }\n const unmerged = consumer.scope.objects.unmergedComponents.getEntry(id.name);\n if (unmerged) {\n return returnFailure(\n `component ${id.toStringWithoutVersion()} is in during-merge state, please snap/tag it first (or use bit merge --resolve/--abort)`\n );\n }\n const version = id.version;\n if (!version) {\n return returnFailure(`component doesn't have any snaps on ${DEFAULT_LANE}`, true);\n }\n const existingBitMapId = consumer.bitMap.getBitIdIfExist(id, { ignoreVersion: true });\n const componentOnLane: Version = await modelComponent.loadVersion(version, consumer.scope.objects);\n if (componentOnLane.isRemoved()) {\n return returnFailure(`component has been removed`, true);\n }\n if (!existingBitMapId) {\n if (switchProps.existingOnWorkspaceOnly) {\n return returnFailure(`component ${id.toStringWithoutVersion()} is not in the workspace`, true);\n }\n return { componentFromFS: undefined, componentFromModel: componentOnLane, id, mergeResults: null };\n }\n if (!existingBitMapId.hasVersion()) {\n // happens when switching from main to a lane and a component was snapped on the lane.\n // in the .bitmap file, the version is \"latest\" or empty. so we just need to write the component according to the\n // model. we don't care about the componentFromFS\n return { componentFromFS: undefined, componentFromModel: componentOnLane, id, mergeResults: null };\n }\n const currentlyUsedVersion = existingBitMapId.version;\n if (currentlyUsedVersion === version) {\n return returnFailure(`component ${id.toStringWithoutVersion()} is already at version ${version}`, true);\n }\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const baseComponent: Version = await modelComponent.loadVersion(currentlyUsedVersion, consumer.scope.objects);\n const component = await consumer.loadComponent(existingBitMapId);\n // don't use `consumer.isModified` here. otherwise, if there are dependency changes, the user can't discard them\n // and won't be able to switch lanes.\n const isModified = await consumer.isComponentSourceCodeModified(baseComponent, component);\n let mergeResults: MergeResultsThreeWay | null | undefined;\n const isHeadSameAsMain = () => {\n const head = modelComponent.getHead();\n if (!head) return false;\n if (!existingBitMapId.version) return false;\n const tagVersion = modelComponent.getTagOfRefIfExists(head);\n const headVersion = tagVersion || head.toString();\n return existingBitMapId.version === headVersion;\n };\n if (isModified) {\n if (!isHeadSameAsMain()) {\n throw new GeneralError(\n `unable to checkout ${id.toStringWithoutVersion()}, the component is modified and belongs to another lane`\n );\n }\n\n const otherComponent: Version = await modelComponent.loadVersion(\n existingBitMapId.version as string, // we are here because the head is same as main. so, existingBitMapId.version must be set\n consumer.scope.objects\n );\n mergeResults = await threeWayMerge({\n consumer,\n otherComponent,\n otherLabel: version,\n currentComponent: component,\n currentLabel: `${currentlyUsedVersion} modified`,\n baseComponent,\n });\n }\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return { componentFromFS: component, componentFromModel: componentOnLane, id, mergeResults };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAOA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAYO,MAAMA,YAAY,CAAC;EAEQ;EACU;EAC1CC,WAAW,CACDC,SAAoB,EACpBC,MAAc,EACdC,WAAwB,EACxBC,aAA4B,EAC5BC,KAAgB,EACxB;IAAA,KALQJ,SAAoB,GAApBA,SAAoB;IAAA,KACpBC,MAAc,GAAdA,MAAc;IAAA,KACdC,WAAwB,GAAxBA,WAAwB;IAAA,KACxBC,aAA4B,GAA5BA,aAA4B;IAAA,KAC5BC,KAAgB,GAAhBA,KAAgB;IAAA;IAAA;IAAA;IAExB,IAAI,CAACC,QAAQ,GAAG,IAAI,CAACL,SAAS,CAACK,QAAQ;EACzC;EAEA,MAAMC,MAAM,GAAiC;IAC3C,IAAI,CAACL,MAAM,CAACM,aAAa,CAAE,iBAAgB,CAAC;IAC5C,MAAM,IAAI,CAACC,mBAAmB,EAAE;IAChC,MAAMC,mBAAsC,GAAG,MAAM,IAAI,CAACC,sBAAsB,EAAE;IAClF,MAAMC,qBAAqB,GAAGF,mBAAmB,CAACG,IAAI,CACnDC,SAAS,IAAKA,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B;IACD7F,YAAY,GAAG,MAAM,IAAAqH,wBAAa,EAAC;MACjC9H,QAAQ;MACR6H,cAAc;MACdE,UAAU,EAAEtB,OAAO;MACnBuB,gBAAgB,EAAExH,SAAS;MAC3ByH,YAAY,EAAG,GAAEd,oBAAqB,WAAU;MAChDC;IACF,CAAC,CAAC;EACJ;EACA;EACA,OAAO;IAAE1F,eAAe,EAAElB,SAAS;IAAEyG,kBAAkB,EAAEJ,eAAe;IAAE/F,EAAE;IAAEL;EAAa,CAAC;AAC9F"}
1
+ {"version":3,"names":["LaneSwitcher","constructor","workspace","logger","switchProps","checkoutProps","Lanes","consumer","switch","setStatusLine","isOnMain","throwForStagedComponents","populateSwitchProps","allComponentsStatus","getAllComponentsStatus","componentWithConflict","find","component","mergeResults","hasConflicts","promptMergeOptions","mergeStrategy","GeneralError","id","toStringWithoutVersion","getMergeStrategyInteractive","failedComponents","filter","componentStatus","failureMessage","map","unchangedLegitimately","succeededComponents","componentsResults","mapSeries","componentFromFS","applyVersion","markFilesToBeRemovedIfNeeded","saveLanesData","componentsWithDependencies","c","manyComponentsWriterOpts","skipDependencyInstallation","skipNpmInstall","verbose","writeConfig","installationError","componentWriter","writeMany","deleteFilesIfNeeded","appliedVersionComponents","applyVersionResult","onDestroy","components","laneId","scope","lanes","parseLaneIdFromString","laneName","localLane","loadLane","isDefault","populatePropsAccordingToDefaultLane","populatePropsAccordingToLocalLane","populatePropsAccordingToRemoteLane","remoteLaneId","laneIdToSwitch","debug","toString","getCurrentLaneId","isEqual","BitError","remoteLane","fetchLaneWithItsComponents","name","ids","l","changeVersion","head","localTrackedLane","getAliasByLaneId","undefined","laneToSwitchTo","isOnLane","getIdsOfDefaultLane","LaneId","from","DEFAULT_LANE","toLaneId","tmp","Tmp","componentsStatusP","getComponentStatus","componentsStatus","Promise","all","clear","err","localLaneName","alias","trackLane","remoteScope","setCurrentLane","isNew","bitMap","syncWithLanes","returnFailure","msg","modelComponent","getModelComponentIfExist","unmerged","objects","unmergedComponents","getEntry","version","existingBitMapId","getBitIdIfExist","ignoreVersion","componentOnLane","loadVersion","isRemoved","existingOnWorkspaceOnly","componentFromModel","hasVersion","currentlyUsedVersion","baseComponent","loadComponent","isModified","isComponentSourceCodeModified","isHeadSameAsMain","getHead","tagVersion","getTagOfRefIfExists","headVersion","otherComponent","threeWayMerge","otherLabel","currentComponent","currentLabel"],"sources":["switch-lanes.ts"],"sourcesContent":["import mapSeries from 'p-map-series';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport GeneralError from '@teambit/legacy/dist/error/general-error';\nimport { LaneId, DEFAULT_LANE } from '@teambit/lane-id';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { ApplyVersionResults } from '@teambit/merging';\nimport { ComponentWithDependencies } from '@teambit/legacy/dist/scope';\nimport { Version, Lane } from '@teambit/legacy/dist/scope/models';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport {\n applyVersion,\n ComponentStatus,\n CheckoutProps,\n deleteFilesIfNeeded,\n markFilesToBeRemovedIfNeeded,\n} from '@teambit/legacy/dist/consumer/versions-ops/checkout-version';\nimport {\n FailedComponents,\n getMergeStrategyInteractive,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport threeWayMerge, {\n MergeResultsThreeWay,\n} from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport { Workspace } from '@teambit/workspace';\nimport { Logger } from '@teambit/logger';\nimport { BitError } from '@teambit/bit-error';\nimport { LanesMain } from './lanes.main.runtime';\nimport { throwForStagedComponents } from './create-lane';\n\nexport type SwitchProps = {\n laneName: string;\n ids?: BitId[];\n existingOnWorkspaceOnly: boolean;\n remoteLane?: Lane;\n localTrackedLane?: string;\n alias?: string;\n};\n\nexport class LaneSwitcher {\n private consumer: Consumer;\n private laneIdToSwitch: 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.consumer);\n }\n await this.populateSwitchProps();\n const allComponentsStatus: ComponentStatus[] = await this.getAllComponentsStatus();\n const componentWithConflict = allComponentsStatus.find(\n (component) => component.mergeResults && component.mergeResults.hasConflicts\n );\n if (componentWithConflict) {\n if (!this.checkoutProps.promptMergeOptions && !this.checkoutProps.mergeStrategy) {\n throw new GeneralError(\n `automatic merge has failed for component ${componentWithConflict.id.toStringWithoutVersion()}.\\nplease use \"--manual\" to manually merge changes or use \"--theirs / --ours\" to choose one of the conflicted versions`\n );\n }\n if (!this.checkoutProps.mergeStrategy) this.checkoutProps.mergeStrategy = await getMergeStrategyInteractive();\n }\n const failedComponents: FailedComponents[] = allComponentsStatus\n .filter((componentStatus) => componentStatus.failureMessage)\n .map((componentStatus) => ({\n id: componentStatus.id,\n failureMessage: componentStatus.failureMessage as string,\n unchangedLegitimately: componentStatus.unchangedLegitimately,\n }));\n\n const succeededComponents = allComponentsStatus.filter((componentStatus) => !componentStatus.failureMessage);\n // do not use Promise.all for applyVersion. otherwise, it'll write all components in parallel,\n // which can be an issue when some components are also dependencies of others\n const componentsResults = await mapSeries(succeededComponents, ({ id, componentFromFS, mergeResults }) => {\n return applyVersion(this.consumer, id, componentFromFS, mergeResults, this.checkoutProps);\n });\n\n markFilesToBeRemovedIfNeeded(succeededComponents, componentsResults);\n\n await this.saveLanesData();\n\n const componentsWithDependencies = componentsResults\n .map((c) => c.component)\n .filter((c) => c) as ComponentWithDependencies[];\n\n const manyComponentsWriterOpts = {\n componentsWithDependencies,\n skipDependencyInstallation: this.checkoutProps.skipNpmInstall,\n verbose: this.checkoutProps.verbose,\n writeConfig: this.checkoutProps.writeConfig,\n };\n const { installationError } = await this.Lanes.componentWriter.writeMany(manyComponentsWriterOpts);\n await deleteFilesIfNeeded(componentsResults, this.consumer);\n\n const appliedVersionComponents = componentsResults.map((c) => c.applyVersionResult);\n\n await this.consumer.onDestroy();\n\n return { components: appliedVersionComponents, failedComponents, installationError };\n }\n\n private async populateSwitchProps() {\n const laneId = await this.consumer.scope.lanes.parseLaneIdFromString(this.switchProps.laneName);\n\n const localLane = await this.consumer.scope.loadLane(laneId);\n if (laneId.isDefault()) {\n await this.populatePropsAccordingToDefaultLane();\n } else if (localLane) {\n this.populatePropsAccordingToLocalLane(localLane);\n } else {\n await this.populatePropsAccordingToRemoteLane(laneId);\n }\n }\n\n private async populatePropsAccordingToRemoteLane(remoteLaneId: LaneId) {\n this.laneIdToSwitch = remoteLaneId;\n this.logger.debug(`populatePropsAccordingToRemoteLane, remoteLaneId: ${remoteLaneId.toString()}`);\n if (this.consumer.getCurrentLaneId().isEqual(remoteLaneId)) {\n throw new BitError(`already checked out to \"${remoteLaneId.toString()}\"`);\n }\n const remoteLane = await this.Lanes.fetchLaneWithItsComponents(remoteLaneId);\n this.switchProps.laneName = remoteLaneId.name;\n this.switchProps.ids = remoteLane.components.map((l) => l.id.changeVersion(l.head.toString()));\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 }\n\n private async populatePropsAccordingToDefaultLane() {\n if (!this.consumer.isOnLane()) {\n throw new BitError(`already checked out to \"${this.switchProps.laneName}\"`);\n }\n this.switchProps.ids = await this.consumer.getIdsOfDefaultLane();\n this.laneIdToSwitch = LaneId.from(DEFAULT_LANE, this.consumer.scope.name);\n }\n\n private populatePropsAccordingToLocalLane(localLane: Lane) {\n if (this.consumer.getCurrentLaneId().name === this.switchProps.laneName) {\n throw new BitError(`already checked out to \"${this.switchProps.laneName}\"`);\n }\n this.switchProps.ids = localLane.components.map((c) => c.id.changeVersion(c.head.toString()));\n this.laneIdToSwitch = localLane.toLaneId();\n this.laneToSwitchTo = localLane;\n }\n\n private async getAllComponentsStatus(): Promise<ComponentStatus[]> {\n const { ids } = this.switchProps;\n const tmp = new Tmp(this.consumer.scope);\n try {\n const componentsStatusP = (ids as BitId[]).map((id) => getComponentStatus(this.consumer, id, this.switchProps));\n const componentsStatus = await Promise.all(componentsStatusP);\n await tmp.clear();\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n }\n\n private async saveLanesData() {\n const localLaneName = this.switchProps.alias || this.laneIdToSwitch.name;\n if (this.switchProps.remoteLane) {\n if (!this.switchProps.localTrackedLane) {\n this.consumer.scope.lanes.trackLane({\n localLane: localLaneName,\n remoteLane: this.laneIdToSwitch.name,\n remoteScope: this.laneIdToSwitch.scope,\n });\n }\n }\n\n this.consumer.setCurrentLane(this.laneIdToSwitch, !this.laneToSwitchTo?.isNew);\n this.consumer.bitMap.syncWithLanes(this.laneToSwitchTo);\n }\n}\n\nasync function getComponentStatus(consumer: Consumer, id: BitId, switchProps: SwitchProps): Promise<ComponentStatus> {\n const componentStatus: ComponentStatus = { id };\n const returnFailure = (msg: string, unchangedLegitimately = false) => {\n componentStatus.failureMessage = msg;\n componentStatus.unchangedLegitimately = unchangedLegitimately;\n return componentStatus;\n };\n const modelComponent = await consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) {\n return returnFailure(`component ${id.toString()} had never imported`, true);\n }\n const unmerged = consumer.scope.objects.unmergedComponents.getEntry(id.name);\n if (unmerged) {\n return returnFailure(\n `component ${id.toStringWithoutVersion()} is in during-merge state, please snap/tag it first (or use bit merge --resolve/--abort)`\n );\n }\n const version = id.version;\n if (!version) {\n return returnFailure(`component doesn't have any snaps on ${DEFAULT_LANE}`, true);\n }\n const existingBitMapId = consumer.bitMap.getBitIdIfExist(id, { ignoreVersion: true });\n const componentOnLane: Version = await modelComponent.loadVersion(version, consumer.scope.objects);\n if (componentOnLane.isRemoved()) {\n return returnFailure(`component has been removed`, true);\n }\n if (!existingBitMapId) {\n if (switchProps.existingOnWorkspaceOnly) {\n return returnFailure(`component ${id.toStringWithoutVersion()} is not in the workspace`, true);\n }\n return { componentFromFS: undefined, componentFromModel: componentOnLane, id, mergeResults: null };\n }\n if (!existingBitMapId.hasVersion()) {\n // happens when switching from main to a lane and a component was snapped on the lane.\n // in the .bitmap file, the version is \"latest\" or empty. so we just need to write the component according to the\n // model. we don't care about the componentFromFS\n return { componentFromFS: undefined, componentFromModel: componentOnLane, id, mergeResults: null };\n }\n const currentlyUsedVersion = existingBitMapId.version;\n if (currentlyUsedVersion === version) {\n return returnFailure(`component ${id.toStringWithoutVersion()} is already at version ${version}`, true);\n }\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n const baseComponent: Version = await modelComponent.loadVersion(currentlyUsedVersion, consumer.scope.objects);\n const component = await consumer.loadComponent(existingBitMapId);\n // don't use `consumer.isModified` here. otherwise, if there are dependency changes, the user can't discard them\n // and won't be able to switch lanes.\n const isModified = await consumer.isComponentSourceCodeModified(baseComponent, component);\n let mergeResults: MergeResultsThreeWay | null | undefined;\n const isHeadSameAsMain = () => {\n const head = modelComponent.getHead();\n if (!head) return false;\n if (!existingBitMapId.version) return false;\n const tagVersion = modelComponent.getTagOfRefIfExists(head);\n const headVersion = tagVersion || head.toString();\n return existingBitMapId.version === headVersion;\n };\n if (isModified) {\n if (!isHeadSameAsMain()) {\n throw new GeneralError(\n `unable to checkout ${id.toStringWithoutVersion()}, the component is modified and belongs to another lane`\n );\n }\n\n const otherComponent: Version = await modelComponent.loadVersion(\n existingBitMapId.version as string, // we are here because the head is same as main. so, existingBitMapId.version must be set\n consumer.scope.objects\n );\n mergeResults = await threeWayMerge({\n consumer,\n otherComponent,\n otherLabel: version,\n currentComponent: component,\n currentLabel: `${currentlyUsedVersion} modified`,\n baseComponent,\n });\n }\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n return { componentFromFS: component, componentFromModel: componentOnLane, id, mergeResults };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAOA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAIA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAWO,MAAMA,YAAY,CAAC;EAEQ;EACU;EAC1CC,WAAW,CACDC,SAAoB,EACpBC,MAAc,EACdC,WAAwB,EACxBC,aAA4B,EAC5BC,KAAgB,EACxB;IAAA,KALQJ,SAAoB,GAApBA,SAAoB;IAAA,KACpBC,MAAc,GAAdA,MAAc;IAAA,KACdC,WAAwB,GAAxBA,WAAwB;IAAA,KACxBC,aAA4B,GAA5BA,aAA4B;IAAA,KAC5BC,KAAgB,GAAhBA,KAAgB;IAAA;IAAA;IAAA;IAExB,IAAI,CAACC,QAAQ,GAAG,IAAI,CAACL,SAAS,CAACK,QAAQ;EACzC;EAEA,MAAMC,MAAM,GAAiC;IAC3C,IAAI,CAACL,MAAM,CAACM,aAAa,CAAE,iBAAgB,CAAC;IAC5C,IAAI,IAAI,CAACP,SAAS,CAACQ,QAAQ,EAAE,EAAE;MAC7B,MAAM,IAAAC,sCAAwB,EAAC,IAAI,CAACJ,QAAQ,CAAC;IAC/C;IACA,MAAM,IAAI,CAACK,mBAAmB,EAAE;IAChC,MAAMC,mBAAsC,GAAG,MAAM,IAAI,CAACC,sBAAsB,EAAE;IAClF,MAAMC,qBAAqB,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AAQ,CAACgD,KAAK,CAACwD,OAAO,CACvB;IACD7F,YAAY,GAAG,MAAM,IAAAqH,wBAAa,EAAC;MACjChI,QAAQ;MACR+H,cAAc;MACdE,UAAU,EAAEtB,OAAO;MACnBuB,gBAAgB,EAAExH,SAAS;MAC3ByH,YAAY,EAAG,GAAEd,oBAAqB,WAAU;MAChDC;IACF,CAAC,CAAC;EACJ;EACA;EACA,OAAO;IAAE1F,eAAe,EAAElB,SAAS;IAAEyG,kBAAkB,EAAEJ,eAAe;IAAE/F,EAAE;IAAEL;EAAa,CAAC;AAC9F"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/lanes",
3
- "version": "0.0.544",
3
+ "version": "0.0.546",
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.544"
9
+ "version": "0.0.546"
10
10
  },
11
11
  "dependencies": {
12
12
  "chalk": "2.4.2",
@@ -19,36 +19,36 @@
19
19
  "@teambit/component-version": "0.0.406",
20
20
  "@teambit/harmony": "0.4.6",
21
21
  "@teambit/bit-error": "0.0.402",
22
- "@teambit/lane-id": "0.0.169",
23
- "@teambit/scope": "0.0.972",
24
- "@teambit/lanes.ui.models.lanes-model": "0.0.77",
25
- "@teambit/cli": "0.0.652",
26
- "@teambit/workspace": "0.0.972",
27
- "@teambit/express": "0.0.750",
28
- "@teambit/logger": "0.0.745",
29
- "@teambit/graphql": "0.0.972",
30
- "@teambit/component-compare": "0.0.220",
31
- "@teambit/component-writer": "0.0.8",
32
- "@teambit/component": "0.0.972",
33
- "@teambit/export": "0.0.972",
34
- "@teambit/importer": "0.0.401",
35
- "@teambit/lanes.entities.lane-diff": "0.0.14",
36
- "@teambit/lanes.modules.diff": "0.0.287",
22
+ "@teambit/lane-id": "0.0.171",
23
+ "@teambit/scope": "0.0.974",
24
+ "@teambit/lanes.ui.models.lanes-model": "0.0.79",
25
+ "@teambit/cli": "0.0.654",
26
+ "@teambit/workspace": "0.0.974",
27
+ "@teambit/express": "0.0.752",
28
+ "@teambit/logger": "0.0.747",
29
+ "@teambit/graphql": "0.0.974",
30
+ "@teambit/component-compare": "0.0.222",
31
+ "@teambit/component-writer": "0.0.10",
32
+ "@teambit/component": "0.0.974",
33
+ "@teambit/export": "0.0.974",
34
+ "@teambit/importer": "0.0.403",
35
+ "@teambit/lanes.entities.lane-diff": "0.0.16",
36
+ "@teambit/lanes.modules.diff": "0.0.289",
37
37
  "@teambit/legacy-bit-id": "0.0.421",
38
- "@teambit/merging": "0.0.287",
38
+ "@teambit/merging": "0.0.289",
39
39
  "@teambit/component.ui.component-compare.models.component-compare-props": "0.0.3",
40
40
  "@teambit/design.ui.pages.not-found": "0.0.366",
41
- "@teambit/lanes.hooks.use-lanes": "0.0.115",
42
- "@teambit/lanes.hooks.use-viewed-lane-from-url": "0.0.77",
43
- "@teambit/lanes.ui.compare.lane-compare-page": "0.0.14",
44
- "@teambit/lanes.ui.compare.lane-compare": "0.0.33",
45
- "@teambit/lanes.ui.lane-overview": "0.0.78",
41
+ "@teambit/lanes.hooks.use-lanes": "0.0.117",
42
+ "@teambit/lanes.hooks.use-viewed-lane-from-url": "0.0.79",
43
+ "@teambit/lanes.ui.compare.lane-compare-page": "0.0.16",
44
+ "@teambit/lanes.ui.compare.lane-compare": "0.0.35",
45
+ "@teambit/lanes.ui.lane-overview": "0.0.80",
46
46
  "@teambit/lanes.ui.menus.lanes-overview-menu": "0.0.5",
47
- "@teambit/lanes.ui.menus.use-lanes-menu": "0.0.77",
48
- "@teambit/lanes.ui.navigation.lane-switcher": "0.0.77",
47
+ "@teambit/lanes.ui.menus.use-lanes-menu": "0.0.79",
48
+ "@teambit/lanes.ui.navigation.lane-switcher": "0.0.79",
49
49
  "@teambit/ui-foundation.ui.menu": "0.0.497",
50
50
  "@teambit/ui-foundation.ui.react-router.slot-router": "0.0.501",
51
- "@teambit/ui": "0.0.972"
51
+ "@teambit/ui": "0.0.974"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/react": "^17.0.8",
@@ -62,12 +62,12 @@
62
62
  "@types/testing-library__jest-dom": "5.9.5",
63
63
  "@teambit/component.testing.mock-components": "0.0.21",
64
64
  "@teambit/harmony.testing.load-aspect": "0.0.20",
65
- "@teambit/snapping": "0.0.287",
65
+ "@teambit/snapping": "0.0.289",
66
66
  "@teambit/workspace.testing.mock-workspace": "0.0.14"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "react-router-dom": "^6.0.0",
70
- "@teambit/legacy": "1.0.434",
70
+ "@teambit/legacy": "1.0.436",
71
71
  "react": "^16.8.0 || ^17.0.0",
72
72
  "react-dom": "^16.8.0 || ^17.0.0"
73
73
  },