@teambit/lanes 1.0.282 → 1.0.284

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.
@@ -11,7 +11,7 @@ function _express() {
11
11
  };
12
12
  return data;
13
13
  }
14
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
15
15
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
16
16
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
17
17
  class LanesRestoreRoute {
@@ -1 +1 @@
1
- {"version":3,"names":["_express","data","require","_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","LanesRestoreRoute","constructor","lanes","logger","restoreRoutePath","Verb","WRITE","req","res","body","laneHash","hash","status","send","result","restoreLane","json","error","toString","exports"],"sources":["lanes.restore.route.ts"],"sourcesContent":["import { Route, Verb, Request, Response } from '@teambit/express';\nimport { Logger } from '@teambit/logger';\nimport { LanesMain } from './lanes.main.runtime';\n\nexport class LanesRestoreRoute implements Route {\n constructor(private lanes: LanesMain, private logger: Logger) {}\n\n method = 'post';\n route = this.lanes.restoreRoutePath;\n verb = Verb.WRITE;\n\n middlewares = [\n async (req: Request, res: Response) => {\n const { body } = req;\n const laneHash = body.hash;\n if (!laneHash) {\n return res.status(400).send('Missing hash in body');\n }\n try {\n const result = await this.lanes.restoreLane(laneHash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Z,OAAO4B,GAAY,EAAEC,GAAa,KAAK;MACrC,MAAM;QAAEC;MAAK,CAAC,GAAGF,GAAG;MACpB,MAAMG,QAAQ,GAAGD,IAAI,CAACE,IAAI;MAC1B,IAAI,CAACD,QAAQ,EAAE;QACb,OAAOF,GAAG,CAACI,MAAM,CAAC,GAAG,CAAC,CAACC,IAAI,CAAC,sBAAsB,CAAC;MACrD;MACA,IAAI;QACF,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACZ,KAAK,CAACa,WAAW,CAACL,QAAQ,CAAC;QACrD,OAAOF,GAAG,CAACQ,IAAI,CAACF,MAAM,CAAC;MACzB,CAAC,CAAC,OAAOrB,CAAM,EAAE;QACf,IAAI,CAACU,MAAM,CAACc,KAAK,CAACxB,CAAC,CAACyB,QAAQ,CAAC,CAAC,CAAC;QAC/B,OAAOV,GAAG,CAACI,MAAM,CAAC,GAAG,CAAC,CAACC,IAAI,CAACpB,CAAC,CAACyB,QAAQ,CAAC,CAAC,CAAC;MAC3C;IACF,CAAC,CACF;EArB8D;AAsBjE;AAACC,OAAA,CAAAnB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_express","data","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","LanesRestoreRoute","constructor","lanes","logger","restoreRoutePath","Verb","WRITE","req","res","body","laneHash","hash","status","send","result","restoreLane","json","error","toString","exports"],"sources":["lanes.restore.route.ts"],"sourcesContent":["import { Route, Verb, Request, Response } from '@teambit/express';\nimport { Logger } from '@teambit/logger';\nimport { LanesMain } from './lanes.main.runtime';\n\nexport class LanesRestoreRoute implements Route {\n constructor(private lanes: LanesMain, private logger: Logger) {}\n\n method = 'post';\n route = this.lanes.restoreRoutePath;\n verb = Verb.WRITE;\n\n middlewares = [\n async (req: Request, res: Response) => {\n const { body } = req;\n const laneHash = body.hash;\n if (!laneHash) {\n return res.status(400).send('Missing hash in body');\n }\n try {\n const result = await this.lanes.restoreLane(laneHash);\n return res.json(result);\n } catch (e: any) {\n this.logger.error(e.toString());\n return res.status(500).send(e.toString());\n }\n },\n ];\n}\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAkE,SAAAE,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAI3D,MAAMgB,iBAAiB,CAAkB;EAC9CC,WAAWA,CAASC,KAAgB,EAAUC,MAAc,EAAE;IAAA,KAA1CD,KAAgB,GAAhBA,KAAgB;IAAA,KAAUC,MAAc,GAAdA,MAAc;IAAAtB,eAAA,iBAEnD,MAAM;IAAAA,eAAA,gBACP,IAAI,CAACqB,KAAK,CAACE,gBAAgB;IAAAvB,eAAA,eAC5BwB,eAAI,CAACC,KAAK;IAAAzB,eAAA,sBAEH,CACZ,OAAO0B,GAAY,EAAEC,GAAa,KAAK;MACrC,MAAM;QAAEC;MAAK,CAAC,GAAGF,GAAG;MACpB,MAAMG,QAAQ,GAAGD,IAAI,CAACE,IAAI;MAC1B,IAAI,CAACD,QAAQ,EAAE;QACb,OAAOF,GAAG,CAACI,MAAM,CAAC,GAAG,CAAC,CAACC,IAAI,CAAC,sBAAsB,CAAC;MACrD;MACA,IAAI;QACF,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACZ,KAAK,CAACa,WAAW,CAACL,QAAQ,CAAC;QACrD,OAAOF,GAAG,CAACQ,IAAI,CAACF,MAAM,CAAC;MACzB,CAAC,CAAC,OAAOhC,CAAM,EAAE;QACf,IAAI,CAACqB,MAAM,CAACc,KAAK,CAACnC,CAAC,CAACoC,QAAQ,CAAC,CAAC,CAAC;QAC/B,OAAOV,GAAG,CAACI,MAAM,CAAC,GAAG,CAAC,CAACC,IAAI,CAAC/B,CAAC,CAACoC,QAAQ,CAAC,CAAC,CAAC;MAC3C;IACF,CAAC,CACF;EArB8D;AAsBjE;AAACC,OAAA,CAAAnB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -91,7 +91,7 @@ function _lanes() {
91
91
  };
92
92
  return data;
93
93
  }
94
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
94
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
95
95
  describe('LanesAspect', function () {
96
96
  this.timeout(0);
97
97
  describe('getLanes()', () => {
@@ -1 +1 @@
1
- {"version":3,"names":["_chai","data","require","_fsExtra","_interopRequireDefault","_path","_harmonyTesting","_remove","_snapping","_workspace","_export","_featureToggle","_workspaceTesting","_componentTesting","_lanesEntities","_lanes","obj","__esModule","default","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","ignoreIssues","exporter","ExportAspect","export","modifyMockedComponents","result","snap","pattern","snappedComponents","length","currentLane","getCurrentLane","Error","isUpToDate","diffStatus","toLaneId","undefined","skipChanges","componentsStatus","every","c","upToDate","be","true","switchLanes","skipDependencyInstallation","unmodified","false","laneDiffResults","changeType","ChangeType","NONE","removeLanes","lanesAfterDelete","restoreLane","hash","id","output","laneHash","error","err","instanceOf","message","include","laneId","addFeature","SUPPORT_LANE_HISTORY","currentLaneId","getCurrentLaneId","removeFeature","laneHistory","getLaneHistory","history","getHistory","Object","keys","snappingResult","snapHistory","log","components","toString","exportResults","compFile","path","join","fs","appendFile","componentsIds","exportedLanes","newWorkspace","bareScopeName","remoteScopeName","importLaneObject","snapHistoryId","find","key","includes","results","checkoutHistory","failedComponents","revertWorkspace","revertHistory","compFileContent","readFile","not","secondSnapHistoryId","secondSnapHistory","workspace","WorkspaceAspect","listIds","scope","harmony","loadManyAspects","RemoveAspect","get","remove","deleteComps","lane","isDeleted","deleted"],"sources":["lanes.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport { loadAspect, loadManyAspects } from '@teambit/harmony.testing.load-aspect';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { SnappingAspect, SnappingMain } from '@teambit/snapping';\nimport { WorkspaceAspect, Workspace } from '@teambit/workspace';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { LaneId } from '@teambit/lane-id';\nimport { SUPPORT_LANE_HISTORY, addFeature, removeFeature } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';\nimport { mockWorkspace, destroyWorkspace, WorkspaceData } from '@teambit/workspace.testing.mock-workspace';\nimport { mockComponents, modifyMockedComponents } from '@teambit/component.testing.mock-components';\nimport { ChangeType } from '@teambit/lanes.entities.lane-diff';\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, ignoreIssues: 'MissingManuallyConfiguredPackages' });\n const exporter: ExportMain = await loadAspect(ExportAspect, workspacePath);\n await exporter.export();\n lanes = await loadAspect(LanesAspect, workspacePath);\n await lanes.createLane('stage');\n await modifyMockedComponents(workspacePath, 'v2');\n const result = await snapping.snap({\n pattern: 'comp1',\n build: false,\n ignoreIssues: 'MissingManuallyConfiguredPackages',\n });\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 = (\n await lanes.diffStatus(currentLane.toLaneId(), undefined, { skipChanges: true })\n ).componentsStatus.every((c) => c.upToDate);\n\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({\n pattern: 'comp1',\n build: false,\n unmodified: true,\n ignoreIssues: 'MissingManuallyConfiguredPackages',\n });\n const isUpToDate = (\n await lanes.diffStatus(currentLane.toLaneId(), undefined, { skipChanges: true })\n ).componentsStatus.every((c) => c.upToDate);\n\n expect(isUpToDate).to.be.false;\n });\n });\n\n describe('laneDiff', () => {\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 const exporter: ExportMain = await loadAspect(ExportAspect, workspacePath);\n await exporter.export();\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 laneDiffResults = await lanes.diffStatus(currentLane.toLaneId());\n expect(laneDiffResults.componentsStatus[0].upToDate).to.be.true;\n expect(laneDiffResults.componentsStatus[0].changeType).to.equal(ChangeType.NONE);\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\n const laneDiffResults = await lanes.diffStatus(currentLane.toLaneId());\n expect(laneDiffResults.componentsStatus[0].upToDate).to.be.false;\n expect(laneDiffResults.componentsStatus[0].changeType).to.equal(ChangeType.NONE);\n });\n });\n\n describe('restoreLane()', () => {\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 // as an intermediate step, make sure the lane was created\n const currentLanes = await lanes.getLanes({});\n expect(currentLanes).to.have.lengthOf(1);\n\n await lanes.switchLanes('main', { skipDependencyInstallation: true });\n await lanes.removeLanes(['stage']);\n\n // as an intermediate step, make sure the lane was removed\n const lanesAfterDelete = await lanes.getLanes({});\n expect(lanesAfterDelete).to.have.lengthOf(0);\n\n await lanes.restoreLane(currentLanes[0].hash);\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n it('should restore the deleted lane', async () => {\n const currentLanes = await lanes.getLanes({});\n expect(currentLanes).to.have.lengthOf(1);\n expect(currentLanes[0].id.name).to.equal('stage');\n });\n describe('delete restored lane', () => {\n let output: string[];\n before(async () => {\n output = await lanes.removeLanes(['stage']);\n });\n it('should not throw', () => {\n expect(output).to.have.lengthOf(1);\n });\n });\n });\n\n describe('restore lane when an existing lane has the same id', () => {\n let lanes: LanesMain;\n let workspaceData: WorkspaceData;\n let laneHash: string;\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 // as an intermediate step, make sure the lane was created\n const currentLanes = await lanes.getLanes({});\n expect(currentLanes).to.have.lengthOf(1);\n\n await lanes.switchLanes('main', { skipDependencyInstallation: true });\n await lanes.removeLanes(['stage']);\n\n await lanes.createLane('stage');\n laneHash = currentLanes[0].hash;\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n it('should throw when restoring the lane', async () => {\n let error: Error | undefined;\n try {\n await lanes.restoreLane(laneHash);\n } catch (err: any) {\n error = err;\n }\n expect(error).to.be.instanceOf(Error);\n expect(error?.message).to.include('unable to restore lane');\n });\n });\n\n describe('lane history', () => {\n let lanes: LanesMain;\n let workspaceData: WorkspaceData;\n let snapping: SnappingMain;\n let laneId: LaneId;\n before(async () => {\n addFeature(SUPPORT_LANE_HISTORY);\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n await mockComponents(workspacePath);\n lanes = await loadAspect(LanesAspect, workspacePath);\n await lanes.createLane('stage');\n snapping = await loadAspect(SnappingAspect, workspacePath);\n const currentLaneId = lanes.getCurrentLaneId();\n if (!currentLaneId) throw new Error('unable to get the current lane-id');\n laneId = currentLaneId;\n });\n after(async () => {\n removeFeature(SUPPORT_LANE_HISTORY);\n await destroyWorkspace(workspaceData);\n });\n it('should create lane history object when creating a new lane', async () => {\n const laneHistory = await lanes.getLaneHistory(laneId);\n const history = laneHistory.getHistory();\n expect(Object.keys(history).length).to.equal(1);\n });\n describe('snapping', () => {\n let snappingResult;\n before(async () => {\n snappingResult = await snapping.snap({ pattern: 'comp1', build: false, message: 'first snap' });\n });\n it('should add a record to LaneHistory when snapping', async () => {\n const laneHistory = await lanes.getLaneHistory(laneId);\n const history = laneHistory.getHistory();\n expect(Object.keys(history).length).to.equal(2);\n const snapHistory = history[Object.keys(history)[1]];\n expect(snapHistory.log.message).to.equal('snap (first snap)');\n expect(snapHistory.components.length).to.equal(1);\n expect(snapHistory.components[0]).to.equal(snappingResult?.snappedComponents[0].id.toString() as string);\n });\n describe('snap again and export', () => {\n let exportResults;\n\n before(async () => {\n const compFile = path.join(workspaceData.workspacePath, 'comp1/index.js');\n await fs.appendFile(compFile, `\\nconsole.log('second-snap');`);\n // make another snap to check to test the checkout later.\n await snapping.snap({ pattern: 'comp1', build: false, message: 'second snap' });\n const laneHistory = await lanes.getLaneHistory(laneId);\n const history = laneHistory.getHistory();\n expect(Object.keys(history).length).to.equal(3);\n\n const exporter: ExportMain = await loadAspect(ExportAspect, workspaceData.workspacePath);\n exportResults = await exporter.export();\n });\n it('should export successfully', () => {\n expect(exportResults.componentsIds.length).to.equal(1);\n expect(exportResults.exportedLanes.length).to.equal(1);\n });\n describe('import to another workspace', () => {\n let newWorkspace: WorkspaceData;\n before(async () => {\n newWorkspace = mockWorkspace({ bareScopeName: workspaceData.remoteScopeName });\n\n lanes = await loadAspect(LanesAspect, newWorkspace.workspacePath);\n await lanes.switchLanes(laneId.toString(), { skipDependencyInstallation: true });\n await lanes.importLaneObject(laneId, true, true);\n });\n after(async () => {\n await destroyWorkspace(newWorkspace);\n });\n it('should not add a record to the lane-history', async () => {\n const laneHistory = await lanes.getLaneHistory(laneId);\n const history = laneHistory.getHistory();\n expect(Object.keys(history).length).to.equal(3);\n });\n it('should be able to checkout to a previous state of the lane', async () => {\n const laneHistory = await lanes.getLaneHistory(laneId);\n const history = laneHistory.getHistory();\n const snapHistoryId = Object.keys(history).find((key) => history[key].log.message?.includes('first snap'));\n if (!snapHistoryId) throw new Error('unable to find snap history of the first snap');\n const results = await lanes.checkoutHistory(snapHistoryId, { skipDependencyInstallation: true });\n expect(results.components?.length).to.equal(1);\n expect(results.failedComponents?.length).to.equal(0);\n });\n it('should be able to revert to a previous history id', async () => {\n const revertWorkspace = mockWorkspace({ bareScopeName: workspaceData.remoteScopeName });\n lanes = await loadAspect(LanesAspect, revertWorkspace.workspacePath);\n await lanes.switchLanes(laneId.toString(), { skipDependencyInstallation: true });\n await lanes.importLaneObject(laneId, true, true);\n const laneHistory = await lanes.getLaneHistory(laneId);\n const history = laneHistory.getHistory();\n const snapHistoryId = Object.keys(history).find((key) => history[key].log.message?.includes('first snap'));\n if (!snapHistoryId) throw new Error('unable to find snap history of the first snap');\n const results = await lanes.revertHistory(snapHistoryId, { skipDependencyInstallation: true });\n expect(results.components?.length).to.equal(1);\n expect(results.failedComponents?.length).to.equal(0);\n\n const compFile = path.join(\n revertWorkspace.workspacePath,\n revertWorkspace.remoteScopeName,\n 'comp1/index.js'\n );\n const compFileContent = await fs.readFile(compFile, 'utf8');\n\n // make sure it reverts to the first snap.\n expect(compFileContent).to.not.include('second-snap');\n\n // make sure it keeps the version in .bitmap intact and doesn't change it to the first snap. (as with checkout)\n const secondSnapHistoryId = Object.keys(history).find((key) =>\n history[key].log.message?.includes('second snap')\n );\n if (!secondSnapHistoryId) throw new Error('unable to find snap history of the second snap');\n const secondSnapHistory = history[secondSnapHistoryId];\n const workspace: Workspace = await loadAspect(WorkspaceAspect, revertWorkspace.workspacePath);\n const ids = await workspace.listIds();\n expect(ids[0].toString()).to.equal(secondSnapHistory.components[0]);\n await destroyWorkspace(revertWorkspace);\n });\n });\n });\n });\n });\n\n describe('create lanes with the same name different scope', () => {\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 await lanes.switchLanes('main', { skipDependencyInstallation: true });\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n it('should not throw when creating the second lane', async () => {\n await lanes.createLane('stage', { scope: 'new-scope' });\n const currentLanes = await lanes.getLanes({});\n expect(currentLanes.length).to.equal(2);\n expect(currentLanes[0].id.name).to.equal('stage');\n expect(currentLanes[1].id.name).to.equal('stage');\n });\n });\n\n describe('delete component on a lane after export', () => {\n let lanes: LanesMain;\n let workspaceData: WorkspaceData;\n let snapping: SnappingMain;\n let laneId: LaneId;\n before(async () => {\n addFeature(SUPPORT_LANE_HISTORY);\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n await mockComponents(workspacePath);\n const harmony = await loadManyAspects(\n [SnappingAspect, ExportAspect, RemoveAspect, WorkspaceAspect, LanesAspect],\n workspaceData.workspacePath\n );\n lanes = harmony.get(LanesAspect.id);\n await lanes.createLane('stage');\n\n const currentLaneId = lanes.getCurrentLaneId();\n if (!currentLaneId) throw new Error('unable to get the current lane-id');\n laneId = currentLaneId;\n\n snapping = harmony.get(SnappingAspect.id);\n await snapping.snap({ build: false });\n const exporter: ExportMain = harmony.get(ExportAspect.id);\n await exporter.export();\n\n const remove: RemoveMain = harmony.get(RemoveAspect.id);\n await remove.deleteComps('comp1');\n\n await snapping.snap({ build: false });\n });\n after(async () => {\n removeFeature(SUPPORT_LANE_HISTORY);\n await destroyWorkspace(workspaceData);\n });\n it('should save the deleted data into the lane object', async () => {\n const lane = await lanes.getCurrentLane();\n expect(lane?.components[0].isDeleted).to.be.true;\n });\n it('should save the deleted data into lane history', async () => {\n const laneHistory = await lanes.getLaneHistory(laneId);\n const history = laneHistory.getHistory();\n expect(Object.keys(history).length).to.equal(3);\n const snapHistory = history[Object.keys(history)[2]];\n expect(snapHistory.deleted?.length).to.equal(1);\n });\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,gBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,eAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,UAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,SAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,WAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,UAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,QAAA;EAA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,mDAAmD,EAAE,YAAY;MAClE,MAAM+G,IAAI,GAAG,MAAM1H,KAAK,CAACoC,cAAc,CAAC,CAAC;MACzC,IAAAtB,cAAM,EAAC4G,IAAI,EAAEtC,UAAU,CAAC,CAAC,CAAC,CAACuC,SAAS,CAAC,CAAC5G,EAAE,CAACgC,EAAE,CAACC,IAAI;IAClD,CAAC,CAAC;IACFrC,EAAE,CAAC,gDAAgD,EAAE,YAAY;MAC/D,MAAMgE,WAAW,GAAG,MAAM3E,KAAK,CAAC4E,cAAc,CAACP,MAAM,CAAC;MACtD,MAAMQ,OAAO,GAAGF,WAAW,CAACG,UAAU,CAAC,CAAC;MACxC,IAAAhE,cAAM,EAACiE,MAAM,CAACC,IAAI,CAACH,OAAO,CAAC,CAAC3C,MAAM,CAAC,CAACnB,EAAE,CAACI,KAAK,CAAC,CAAC,CAAC;MAC/C,MAAM+D,WAAW,GAAGL,OAAO,CAACE,MAAM,CAACC,IAAI,CAACH,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;MACpD,IAAA/D,cAAM,EAACoE,WAAW,CAAC0C,OAAO,EAAE1F,MAAM,CAAC,CAACnB,EAAE,CAACI,KAAK,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_chai","data","require","_fsExtra","_interopRequireDefault","_path","_harmonyTesting","_remove","_snapping","_workspace","_export","_featureToggle","_workspaceTesting","_componentTesting","_lanesEntities","_lanes","e","__esModule","default","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","ignoreIssues","exporter","ExportAspect","export","modifyMockedComponents","result","snap","pattern","snappedComponents","length","currentLane","getCurrentLane","Error","isUpToDate","diffStatus","toLaneId","undefined","skipChanges","componentsStatus","every","c","upToDate","be","true","switchLanes","skipDependencyInstallation","unmodified","false","laneDiffResults","changeType","ChangeType","NONE","removeLanes","lanesAfterDelete","restoreLane","hash","id","output","laneHash","error","err","instanceOf","message","include","laneId","addFeature","SUPPORT_LANE_HISTORY","currentLaneId","getCurrentLaneId","removeFeature","laneHistory","getLaneHistory","history","getHistory","Object","keys","snappingResult","snapHistory","log","components","toString","exportResults","compFile","path","join","fs","appendFile","componentsIds","exportedLanes","newWorkspace","bareScopeName","remoteScopeName","importLaneObject","snapHistoryId","find","key","includes","results","checkoutHistory","failedComponents","revertWorkspace","revertHistory","compFileContent","readFile","not","secondSnapHistoryId","secondSnapHistory","workspace","WorkspaceAspect","listIds","scope","harmony","loadManyAspects","RemoveAspect","get","remove","deleteComps","lane","isDeleted","deleted"],"sources":["lanes.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport fs from 'fs-extra';\nimport path from 'path';\nimport { loadAspect, loadManyAspects } from '@teambit/harmony.testing.load-aspect';\nimport { RemoveAspect, RemoveMain } from '@teambit/remove';\nimport { SnappingAspect, SnappingMain } from '@teambit/snapping';\nimport { WorkspaceAspect, Workspace } from '@teambit/workspace';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { LaneId } from '@teambit/lane-id';\nimport { SUPPORT_LANE_HISTORY, addFeature, removeFeature } from '@teambit/legacy/dist/api/consumer/lib/feature-toggle';\nimport { mockWorkspace, destroyWorkspace, WorkspaceData } from '@teambit/workspace.testing.mock-workspace';\nimport { mockComponents, modifyMockedComponents } from '@teambit/component.testing.mock-components';\nimport { ChangeType } from '@teambit/lanes.entities.lane-diff';\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, ignoreIssues: 'MissingManuallyConfiguredPackages' });\n const exporter: ExportMain = await loadAspect(ExportAspect, workspacePath);\n await exporter.export();\n lanes = await loadAspect(LanesAspect, workspacePath);\n await lanes.createLane('stage');\n await modifyMockedComponents(workspacePath, 'v2');\n const result = await snapping.snap({\n pattern: 'comp1',\n build: false,\n ignoreIssues: 'MissingManuallyConfiguredPackages',\n });\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 = (\n await lanes.diffStatus(currentLane.toLaneId(), undefined, { skipChanges: true })\n ).componentsStatus.every((c) => c.upToDate);\n\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({\n pattern: 'comp1',\n build: false,\n unmodified: true,\n ignoreIssues: 'MissingManuallyConfiguredPackages',\n });\n const isUpToDate = (\n await lanes.diffStatus(currentLane.toLaneId(), undefined, { skipChanges: true })\n ).componentsStatus.every((c) => c.upToDate);\n\n expect(isUpToDate).to.be.false;\n });\n });\n\n describe('laneDiff', () => {\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 const exporter: ExportMain = await loadAspect(ExportAspect, workspacePath);\n await exporter.export();\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 laneDiffResults = await lanes.diffStatus(currentLane.toLaneId());\n expect(laneDiffResults.componentsStatus[0].upToDate).to.be.true;\n expect(laneDiffResults.componentsStatus[0].changeType).to.equal(ChangeType.NONE);\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\n const laneDiffResults = await lanes.diffStatus(currentLane.toLaneId());\n expect(laneDiffResults.componentsStatus[0].upToDate).to.be.false;\n expect(laneDiffResults.componentsStatus[0].changeType).to.equal(ChangeType.NONE);\n });\n });\n\n describe('restoreLane()', () => {\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 // as an intermediate step, make sure the lane was created\n const currentLanes = await lanes.getLanes({});\n expect(currentLanes).to.have.lengthOf(1);\n\n await lanes.switchLanes('main', { skipDependencyInstallation: true });\n await lanes.removeLanes(['stage']);\n\n // as an intermediate step, make sure the lane was removed\n const lanesAfterDelete = await lanes.getLanes({});\n expect(lanesAfterDelete).to.have.lengthOf(0);\n\n await lanes.restoreLane(currentLanes[0].hash);\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n it('should restore the deleted lane', async () => {\n const currentLanes = await lanes.getLanes({});\n expect(currentLanes).to.have.lengthOf(1);\n expect(currentLanes[0].id.name).to.equal('stage');\n });\n describe('delete restored lane', () => {\n let output: string[];\n before(async () => {\n output = await lanes.removeLanes(['stage']);\n });\n it('should not throw', () => {\n expect(output).to.have.lengthOf(1);\n });\n });\n });\n\n describe('restore lane when an existing lane has the same id', () => {\n let lanes: LanesMain;\n let workspaceData: WorkspaceData;\n let laneHash: string;\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 // as an intermediate step, make sure the lane was created\n const currentLanes = await lanes.getLanes({});\n expect(currentLanes).to.have.lengthOf(1);\n\n await lanes.switchLanes('main', { skipDependencyInstallation: true });\n await lanes.removeLanes(['stage']);\n\n await lanes.createLane('stage');\n laneHash = currentLanes[0].hash;\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n it('should throw when restoring the lane', async () => {\n let error: Error | undefined;\n try {\n await lanes.restoreLane(laneHash);\n } catch (err: any) {\n error = err;\n }\n expect(error).to.be.instanceOf(Error);\n expect(error?.message).to.include('unable to restore lane');\n });\n });\n\n describe('lane history', () => {\n let lanes: LanesMain;\n let workspaceData: WorkspaceData;\n let snapping: SnappingMain;\n let laneId: LaneId;\n before(async () => {\n addFeature(SUPPORT_LANE_HISTORY);\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n await mockComponents(workspacePath);\n lanes = await loadAspect(LanesAspect, workspacePath);\n await lanes.createLane('stage');\n snapping = await loadAspect(SnappingAspect, workspacePath);\n const currentLaneId = lanes.getCurrentLaneId();\n if (!currentLaneId) throw new Error('unable to get the current lane-id');\n laneId = currentLaneId;\n });\n after(async () => {\n removeFeature(SUPPORT_LANE_HISTORY);\n await destroyWorkspace(workspaceData);\n });\n it('should create lane history object when creating a new lane', async () => {\n const laneHistory = await lanes.getLaneHistory(laneId);\n const history = laneHistory.getHistory();\n expect(Object.keys(history).length).to.equal(1);\n });\n describe('snapping', () => {\n let snappingResult;\n before(async () => {\n snappingResult = await snapping.snap({ pattern: 'comp1', build: false, message: 'first snap' });\n });\n it('should add a record to LaneHistory when snapping', async () => {\n const laneHistory = await lanes.getLaneHistory(laneId);\n const history = laneHistory.getHistory();\n expect(Object.keys(history).length).to.equal(2);\n const snapHistory = history[Object.keys(history)[1]];\n expect(snapHistory.log.message).to.equal('snap (first snap)');\n expect(snapHistory.components.length).to.equal(1);\n expect(snapHistory.components[0]).to.equal(snappingResult?.snappedComponents[0].id.toString() as string);\n });\n describe('snap again and export', () => {\n let exportResults;\n\n before(async () => {\n const compFile = path.join(workspaceData.workspacePath, 'comp1/index.js');\n await fs.appendFile(compFile, `\\nconsole.log('second-snap');`);\n // make another snap to check to test the checkout later.\n await snapping.snap({ pattern: 'comp1', build: false, message: 'second snap' });\n const laneHistory = await lanes.getLaneHistory(laneId);\n const history = laneHistory.getHistory();\n expect(Object.keys(history).length).to.equal(3);\n\n const exporter: ExportMain = await loadAspect(ExportAspect, workspaceData.workspacePath);\n exportResults = await exporter.export();\n });\n it('should export successfully', () => {\n expect(exportResults.componentsIds.length).to.equal(1);\n expect(exportResults.exportedLanes.length).to.equal(1);\n });\n describe('import to another workspace', () => {\n let newWorkspace: WorkspaceData;\n before(async () => {\n newWorkspace = mockWorkspace({ bareScopeName: workspaceData.remoteScopeName });\n\n lanes = await loadAspect(LanesAspect, newWorkspace.workspacePath);\n await lanes.switchLanes(laneId.toString(), { skipDependencyInstallation: true });\n await lanes.importLaneObject(laneId, true, true);\n });\n after(async () => {\n await destroyWorkspace(newWorkspace);\n });\n it('should not add a record to the lane-history', async () => {\n const laneHistory = await lanes.getLaneHistory(laneId);\n const history = laneHistory.getHistory();\n expect(Object.keys(history).length).to.equal(3);\n });\n it('should be able to checkout to a previous state of the lane', async () => {\n const laneHistory = await lanes.getLaneHistory(laneId);\n const history = laneHistory.getHistory();\n const snapHistoryId = Object.keys(history).find((key) => history[key].log.message?.includes('first snap'));\n if (!snapHistoryId) throw new Error('unable to find snap history of the first snap');\n const results = await lanes.checkoutHistory(snapHistoryId, { skipDependencyInstallation: true });\n expect(results.components?.length).to.equal(1);\n expect(results.failedComponents?.length).to.equal(0);\n });\n it('should be able to revert to a previous history id', async () => {\n const revertWorkspace = mockWorkspace({ bareScopeName: workspaceData.remoteScopeName });\n lanes = await loadAspect(LanesAspect, revertWorkspace.workspacePath);\n await lanes.switchLanes(laneId.toString(), { skipDependencyInstallation: true });\n await lanes.importLaneObject(laneId, true, true);\n const laneHistory = await lanes.getLaneHistory(laneId);\n const history = laneHistory.getHistory();\n const snapHistoryId = Object.keys(history).find((key) => history[key].log.message?.includes('first snap'));\n if (!snapHistoryId) throw new Error('unable to find snap history of the first snap');\n const results = await lanes.revertHistory(snapHistoryId, { skipDependencyInstallation: true });\n expect(results.components?.length).to.equal(1);\n expect(results.failedComponents?.length).to.equal(0);\n\n const compFile = path.join(\n revertWorkspace.workspacePath,\n revertWorkspace.remoteScopeName,\n 'comp1/index.js'\n );\n const compFileContent = await fs.readFile(compFile, 'utf8');\n\n // make sure it reverts to the first snap.\n expect(compFileContent).to.not.include('second-snap');\n\n // make sure it keeps the version in .bitmap intact and doesn't change it to the first snap. (as with checkout)\n const secondSnapHistoryId = Object.keys(history).find((key) =>\n history[key].log.message?.includes('second snap')\n );\n if (!secondSnapHistoryId) throw new Error('unable to find snap history of the second snap');\n const secondSnapHistory = history[secondSnapHistoryId];\n const workspace: Workspace = await loadAspect(WorkspaceAspect, revertWorkspace.workspacePath);\n const ids = await workspace.listIds();\n expect(ids[0].toString()).to.equal(secondSnapHistory.components[0]);\n await destroyWorkspace(revertWorkspace);\n });\n });\n });\n });\n });\n\n describe('create lanes with the same name different scope', () => {\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 await lanes.switchLanes('main', { skipDependencyInstallation: true });\n });\n after(async () => {\n await destroyWorkspace(workspaceData);\n });\n it('should not throw when creating the second lane', async () => {\n await lanes.createLane('stage', { scope: 'new-scope' });\n const currentLanes = await lanes.getLanes({});\n expect(currentLanes.length).to.equal(2);\n expect(currentLanes[0].id.name).to.equal('stage');\n expect(currentLanes[1].id.name).to.equal('stage');\n });\n });\n\n describe('delete component on a lane after export', () => {\n let lanes: LanesMain;\n let workspaceData: WorkspaceData;\n let snapping: SnappingMain;\n let laneId: LaneId;\n before(async () => {\n addFeature(SUPPORT_LANE_HISTORY);\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n await mockComponents(workspacePath);\n const harmony = await loadManyAspects(\n [SnappingAspect, ExportAspect, RemoveAspect, WorkspaceAspect, LanesAspect],\n workspaceData.workspacePath\n );\n lanes = harmony.get(LanesAspect.id);\n await lanes.createLane('stage');\n\n const currentLaneId = lanes.getCurrentLaneId();\n if (!currentLaneId) throw new Error('unable to get the current lane-id');\n laneId = currentLaneId;\n\n snapping = harmony.get(SnappingAspect.id);\n await snapping.snap({ build: false });\n const exporter: ExportMain = harmony.get(ExportAspect.id);\n await exporter.export();\n\n const remove: RemoveMain = harmony.get(RemoveAspect.id);\n await remove.deleteComps('comp1');\n\n await snapping.snap({ build: false });\n });\n after(async () => {\n removeFeature(SUPPORT_LANE_HISTORY);\n await destroyWorkspace(workspaceData);\n });\n it('should save the deleted data into the lane object', async () => {\n const lane = await lanes.getCurrentLane();\n expect(lane?.components[0].isDeleted).to.be.true;\n });\n it('should save the deleted data into lane history', async () => {\n const laneHistory = await lanes.getLaneHistory(laneId);\n const history = laneHistory.getHistory();\n expect(Object.keys(history).length).to.equal(3);\n const snapHistory = history[Object.keys(history)[2]];\n expect(snapHistory.deleted?.length).to.equal(1);\n });\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,gBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,eAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,UAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,SAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,WAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,UAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,QAAA;EAAA,MAAAT,IAAA,GAAAC,OAAA;EAAAQ,OAAA,YAAAA,CAAA;IAAA,OAAAT,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAU,eAAA;EAAA,MAAAV,IAAA,GAAAC,OAAA;EAA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SAAS,CAAC,CAAC5G,EAAE,CAACgC,EAAE,CAACC,IAAI;IAClD,CAAC,CAAC;IACFrC,EAAE,CAAC,gDAAgD,EAAE,YAAY;MAC/D,MAAMgE,WAAW,GAAG,MAAM3E,KAAK,CAAC4E,cAAc,CAACP,MAAM,CAAC;MACtD,MAAMQ,OAAO,GAAGF,WAAW,CAACG,UAAU,CAAC,CAAC;MACxC,IAAAhE,cAAM,EAACiE,MAAM,CAACC,IAAI,CAACH,OAAO,CAAC,CAAC3C,MAAM,CAAC,CAACnB,EAAE,CAACI,KAAK,CAAC,CAAC,CAAC;MAC/C,MAAM+D,WAAW,GAAGL,OAAO,CAACE,MAAM,CAACC,IAAI,CAACH,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;MACpD,IAAA/D,cAAM,EAACoE,WAAW,CAAC0C,OAAO,EAAE1F,MAAM,CAAC,CAACnB,EAAE,CAACI,KAAK,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -161,11 +161,11 @@ function _lanesUiModule() {
161
161
  };
162
162
  return data;
163
163
  }
164
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
164
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
165
165
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
166
166
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
167
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
168
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
167
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
168
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
169
169
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
170
170
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
171
171
  function useComponentFilters() {
@@ -1 +1 @@
1
- {"version":3,"names":["_react","data","_interopRequireWildcard","require","_reactRouterDom","_harmony","_lanesUiCompare","_ui","_designUiPages","_scope","_workspace","_component","_lanesUi","_lanesUiMenus","_uiFoundationUiReactRouter","_lanesUiMenus2","_lanesUiModels","_lanesHooks","_lanesUiNavigation","_lanesHooks2","_componentCompare","_lanesUiCompare2","_scopeUi","_lanes","_lanesUiModule","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","prototype","apply","_defineProperty","value","_toPropertyKey","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","useComponentFilters","idFromLocation","useIdFromLocation","undefined","lanesModel","loading","useLanes","laneFromUrl","useViewedLaneFromUrl","laneComponentId","isDefault","resolveComponentFromUrl","log","head","version","useLaneComponentIdFromUrl","query","useQuery","componentVersion","compIdFromLocation","ComponentID","tryFromString","lanesComp","changeVersion","useComponentId","toString","LanesUI","constructor","componentUI","componentCompareUI","routeSlot","navSlot","menuWidgetSlot","overviewSlot","laneProviderIgnoreSlot","workspace","scope","children","ignoreFns","values","createElement","LanesProvider","ignoreDerivingFromUrl","props","tabs","base","compare","LaneCompare","host","hostAspect","lanesHost","WorkspaceAspect","id","ScopeAspect","registerHostAspectRoutes","registerRoutes","getLaneRoutes","registerMenuRoutes","getMenuRoutes","path","LanesModel","lanesPrefix","Fragment","Route","lanePath","index","element","getLaneOverview","getLaneComponent","getLanesComparePage","NotFoundPage","overrideComputeLaneUrl","fn","prefix","getLaneComponentUrl","getLaneIdFromPathname","getLaneUrl","getComponentUI","componentId","getLaneComponentMenu","getMenu","LaneOverview","LaneComparePage","getLaneCompare","groupByScope","getLanesOverviewMenu","LanesOverviewMenu","navigationSlot","widgetSlot","registerMenuWidget","menuItems","register","registerLaneProviderIgnoreSlot","ignoreFn","registerLanesRoutes","registerNavigation","href","exact","order","hide","viewedLane","lanes","getLanesSwitcher","mainIcon","useContext","ScopeContext","ScopeIcon","size","scopeImage","icon","bgColor","backgroundIconColor","className","styles","mainLaneIcon","LanesSwitcher","LaneSwitcher","getLanesProvider","getUseLanes","registerLanesDropdown","registerSidebarLink","component","Gallery","weight","registerRoute","route","registerOverviewLine","lines","routes","provider","uiUi","workspaceUi","scopeUi","_","harmony","config","lanesUi","registerRenderHooks","reactContext","renderContext","currentLane","UseLaneMenu","actionName","actionIcon","viewedLaneId","currentLaneId","exports","UIAspect","ComponentAspect","ComponentCompareAspect","UIRuntime","Slot","withType","_default","LanesAspect","addRuntime"],"sources":["lanes.ui.runtime.tsx"],"sourcesContent":["import React, { ReactNode, useContext } from 'react';\nimport { Route, RouteProps } from 'react-router-dom';\nimport { Slot, Harmony, SlotRegistry } from '@teambit/harmony';\nimport { LaneCompare, type LaneCompareProps as DefaultLaneCompareProps } from '@teambit/lanes.ui.compare.lane-compare';\nimport { UIRuntime, UiUI, UIAspect } from '@teambit/ui';\nimport type { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { NotFoundPage } from '@teambit/design.ui.pages.not-found';\nimport { ScopeAspect, ScopeContext, ScopeUI } from '@teambit/scope';\nimport { WorkspaceAspect, WorkspaceUI } from '@teambit/workspace';\nimport { ComponentAspect, ComponentUI, useIdFromLocation, ComponentID } from '@teambit/component';\nimport { MenuWidget, MenuWidgetSlot } from '@teambit/ui-foundation.ui.menu';\nimport { LaneOverview, LaneOverviewLine, LaneOverviewLineSlot } from '@teambit/lanes.ui.lane-overview';\nimport {\n LanesNavPlugin,\n LanesOrderedNavigationSlot,\n LanesOverviewMenu,\n} from '@teambit/lanes.ui.menus.lanes-overview-menu';\nimport { useQuery } from '@teambit/ui-foundation.ui.react-router.use-query';\nimport { UseLaneMenu } from '@teambit/lanes.ui.menus.use-lanes-menu';\nimport { LanesHost, LanesModel } from '@teambit/lanes.ui.models.lanes-model';\nimport { LanesProvider, useLanes, IgnoreDerivingFromUrl } from '@teambit/lanes.hooks.use-lanes';\nimport { LaneSwitcher } from '@teambit/lanes.ui.navigation.lane-switcher';\nimport { LaneId } from '@teambit/lane-id';\nimport { useViewedLaneFromUrl } from '@teambit/lanes.hooks.use-viewed-lane-from-url';\nimport { ComponentCompareAspect, ComponentCompareUI } from '@teambit/component-compare';\nimport { LaneComparePage } from '@teambit/lanes.ui.compare.lane-compare-page';\nimport { ScopeIcon } from '@teambit/scope.ui.scope-icon';\n\nimport { LanesAspect } from './lanes.aspect';\nimport styles from './lanes.ui.module.scss';\n\nexport type LaneCompareProps = Partial<DefaultLaneCompareProps>;\nexport type LaneProviderIgnoreSlot = SlotRegistry<IgnoreDerivingFromUrl>;\nexport function useComponentFilters() {\n const idFromLocation = useIdFromLocation(undefined, true);\n const { lanesModel, loading } = useLanes();\n const laneFromUrl = useViewedLaneFromUrl();\n const laneComponentId =\n idFromLocation && !laneFromUrl?.isDefault()\n ? lanesModel?.resolveComponentFromUrl(idFromLocation, laneFromUrl) ?? null\n : null;\n\n if (laneComponentId === null || loading) {\n return {\n loading: true,\n };\n }\n\n return {\n loading: false,\n log: {\n head: laneComponentId.version,\n },\n };\n}\n\nexport function useLaneComponentIdFromUrl(): ComponentID | undefined | null {\n const idFromLocation = useIdFromLocation(undefined, true);\n const { lanesModel, loading } = useLanes();\n const laneFromUrl = useViewedLaneFromUrl();\n const query = useQuery();\n const componentVersion = query.get('version');\n\n if (!idFromLocation) return null;\n\n const compIdFromLocation = ComponentID.tryFromString(\n `${idFromLocation}${componentVersion ? `@${componentVersion}` : ''}`\n );\n\n if (compIdFromLocation) return compIdFromLocation;\n if (loading) return undefined;\n\n const lanesComp = (lanesModel?.resolveComponentFromUrl(idFromLocation, laneFromUrl) as any | undefined) ?? null;\n\n if (componentVersion) {\n return lanesComp?.changeVersion(componentVersion);\n }\n\n return lanesComp;\n}\n\nexport function useComponentId() {\n return useLaneComponentIdFromUrl()?.toString();\n}\n\nexport class LanesUI {\n static dependencies = [UIAspect, ComponentAspect, WorkspaceAspect, ScopeAspect, ComponentCompareAspect];\n\n static runtime = UIRuntime;\n static slots = [\n Slot.withType<RouteProps>(),\n Slot.withType<LaneOverviewLineSlot>(),\n Slot.withType<NavigationSlot>(),\n Slot.withType<MenuWidgetSlot>(),\n Slot.withType<LaneProviderIgnoreSlot>(),\n ];\n\n constructor(\n private componentUI: ComponentUI,\n private componentCompareUI: ComponentCompareUI,\n private routeSlot: RouteSlot,\n private navSlot: LanesOrderedNavigationSlot,\n private menuWidgetSlot: MenuWidgetSlot,\n /**\n * overview line slot to add new lines beneath the overview section\n */\n private overviewSlot: LaneOverviewLineSlot,\n private laneProviderIgnoreSlot: LaneProviderIgnoreSlot,\n private workspace?: WorkspaceUI,\n private scope?: ScopeUI\n ) {\n this.hostAspect = workspace || scope;\n this.lanesHost = workspace ? 'workspace' : 'scope';\n this.host = workspace ? WorkspaceAspect.id : ScopeAspect.id;\n }\n\n private readonly lanesHost: LanesHost;\n private readonly hostAspect?: WorkspaceUI | ScopeUI;\n private readonly host: string;\n\n private registerHostAspectRoutes() {\n if (!this.hostAspect) return;\n this.hostAspect.registerRoutes(this.getLaneRoutes());\n this.hostAspect.registerMenuRoutes(this.getMenuRoutes());\n }\n\n getLaneRoutes() {\n return [\n {\n path: LanesModel.lanesPrefix,\n children: (\n <>\n <Route path={LanesModel.lanePath}>\n <Route index element={this.getLaneOverview()} />\n <Route path=\"~component/*\" element={this.getLaneComponent()} />\n <Route path=\"~compare/*\" element={this.getLanesComparePage()} />\n <Route path=\"*\" element={<NotFoundPage />} />\n </Route>\n <Route path=\"*\" element={<NotFoundPage />} />\n </>\n ),\n },\n ];\n }\n\n overrideComputeLaneUrl(\n fn: () => {\n prefix: string;\n path: string;\n getLaneIdFromPathname: (pathname: string) => LaneId | undefined;\n getLaneUrl: (laneId: LaneId, relative?: boolean) => string;\n getLaneComponentUrl: (componentId: ComponentID, laneId: LaneId) => string;\n }\n ) {\n const { prefix, path, getLaneComponentUrl, getLaneIdFromPathname, getLaneUrl } = fn();\n LanesModel.lanesPrefix = prefix;\n LanesModel.lanePath = path;\n LanesModel.getLaneComponentUrl = getLaneComponentUrl as any;\n LanesModel.getLaneUrl = getLaneUrl;\n LanesModel.getLaneIdFromPathname = getLaneIdFromPathname;\n }\n\n // getLaneReadme() {\n // return <LaneReadmeOverview host={this.host} overviewSlot={this.overviewSlot} routeSlot={this.routeSlot} />;\n // }\n\n getLaneComponent() {\n return this.componentUI.getComponentUI(this.host, {\n componentId: useComponentId,\n useComponentFilters,\n });\n }\n\n getLaneComponentMenu() {\n return this.componentUI.getMenu(this.host, {\n componentId: useComponentId,\n useComponentFilters,\n });\n }\n\n getLaneOverview() {\n return (\n <LaneOverview\n routeSlot={this.routeSlot}\n overviewSlot={this.overviewSlot}\n host={this.lanesHost}\n useLanes={useLanes}\n />\n );\n }\n\n getLanesComparePage() {\n return <LaneComparePage getLaneCompare={this.getLaneCompare} groupByScope={this.lanesHost === 'workspace'} />;\n }\n\n getMenuRoutes() {\n return [\n {\n path: LanesModel.lanesPrefix,\n children: (\n <Route path={`${LanesModel.lanePath}/*`}>\n <Route path={'*'} element={this.getLanesOverviewMenu()} />\n <Route path=\"~component/*\" element={this.getLaneComponentMenu()} />\n </Route>\n ),\n },\n ];\n }\n\n getLanesOverviewMenu() {\n return <LanesOverviewMenu navigationSlot={this.navSlot} widgetSlot={this.menuWidgetSlot} />;\n }\n\n registerMenuWidget(...menuItems: MenuWidget[]) {\n this.menuWidgetSlot.register(menuItems);\n return this;\n }\n\n registerLaneProviderIgnoreSlot(ignoreFn: IgnoreDerivingFromUrl) {\n this.laneProviderIgnoreSlot.register(ignoreFn);\n return this;\n }\n\n private registerLanesRoutes() {\n this.registerNavigation([\n // {\n // props: {\n // href: '.',\n // exact: true,\n // children: 'README',\n // },\n // order: 1,\n // hide: () => {\n // const { lanesModel } = useLanes();\n // return !lanesModel?.viewedLane?.readmeComponent;\n // },\n // },\n {\n props: {\n href: '.',\n exact: true,\n children: 'Overview',\n },\n order: 1,\n },\n {\n props: {\n href: '~compare',\n children: 'Compare',\n },\n order: 2,\n hide: () => {\n const { lanesModel } = useLanes();\n return !lanesModel?.viewedLane || lanesModel?.lanes.length < 2;\n },\n },\n ]);\n }\n\n private registerRoutes() {\n this.registerHostAspectRoutes();\n this.registerLanesRoutes();\n }\n\n getLanesSwitcher() {\n const mainIcon = () => {\n const scope = useContext(ScopeContext);\n return (\n <ScopeIcon\n size={24}\n scopeImage={scope.icon}\n bgColor={scope.backgroundIconColor}\n className={styles.mainLaneIcon}\n />\n );\n };\n\n const LanesSwitcher = (\n <LaneSwitcher\n groupByScope={this.lanesHost === 'workspace'}\n mainIcon={this.lanesHost === 'scope' ? mainIcon : undefined}\n // @ts-ignore @todo - fix this\n useLanes={useLanes}\n />\n );\n\n return LanesSwitcher;\n }\n\n getLanesProvider() {\n return LanesProvider;\n }\n\n getUseLanes() {\n return useLanes;\n }\n\n private registerLanesDropdown() {\n const LanesSwitcher = this.getLanesSwitcher();\n\n this.hostAspect?.registerSidebarLink({\n component: function Gallery() {\n return LanesSwitcher;\n },\n weight: 1000,\n });\n }\n\n private renderContext = ({ children }: { children: ReactNode }) => {\n const ignoreFns = this.laneProviderIgnoreSlot.values();\n\n return <LanesProvider ignoreDerivingFromUrl={ignoreFns}>{children}</LanesProvider>;\n };\n\n registerRoute(route: RouteProps) {\n this.routeSlot.register(route);\n return this;\n }\n\n /**\n * register a new line beneath the lane overview section.\n */\n registerOverviewLine(...lines: LaneOverviewLine[]) {\n this.overviewSlot.register(lines);\n return this;\n }\n\n registerNavigation(routes: LanesNavPlugin[]) {\n this.navSlot.register(routes);\n }\n\n getLaneCompare = (props: LaneCompareProps) => {\n const tabs = this.componentCompareUI.tabs;\n\n if (!props.base || !props.compare) return null;\n\n return (\n <LaneCompare\n {...props}\n base={props.base}\n compare={props.compare}\n host={props.host || this.host}\n tabs={props.tabs || tabs}\n />\n );\n };\n\n static async provider(\n [uiUi, componentUI, workspaceUi, scopeUi, componentCompareUI]: [\n UiUI,\n ComponentUI,\n WorkspaceUI,\n ScopeUI,\n ComponentCompareUI\n ],\n _,\n [routeSlot, overviewSlot, navSlot, menuWidgetSlot, laneProviderIgnoreSlot]: [\n RouteSlot,\n LaneOverviewLineSlot,\n LanesOrderedNavigationSlot,\n MenuWidgetSlot,\n LaneProviderIgnoreSlot\n ],\n harmony: Harmony\n ) {\n const { config } = harmony;\n const host = String(config.get('teambit.harmony/bit'));\n let workspace: WorkspaceUI | undefined;\n let scope: ScopeUI | undefined;\n if (host === WorkspaceAspect.id) {\n workspace = workspaceUi;\n }\n if (host === ScopeAspect.id) {\n scope = scopeUi;\n }\n const lanesUi = new LanesUI(\n componentUI,\n componentCompareUI,\n routeSlot,\n navSlot,\n menuWidgetSlot,\n overviewSlot,\n laneProviderIgnoreSlot,\n workspace,\n scope\n );\n if (uiUi) uiUi.registerRenderHooks({ reactContext: lanesUi.renderContext });\n lanesUi.registerRoutes();\n lanesUi.registerMenuWidget(() => {\n const { lanesModel } = useLanes();\n if (!lanesModel?.viewedLane) return null;\n const { viewedLane, currentLane } = lanesModel;\n return (\n <UseLaneMenu\n actionName={'Import'}\n actionIcon={'terminal'}\n host={lanesUi.lanesHost}\n viewedLaneId={viewedLane.id}\n currentLaneId={currentLane?.id}\n />\n );\n });\n lanesUi.registerLanesDropdown();\n return lanesUi;\n }\n}\n\nexport default LanesUI;\n\nLanesAspect.addRuntime(LanesUI);\n"],"mappings":";;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,gBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,gBAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,eAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,IAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,GAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,eAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,c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ACFoF,OAAO,CAACjB,qBAAqB,CAAC,CAAC;IAC/B,OAAOiB,OAAO;EAChB;AACF;AAACU,OAAA,CAAAxH,OAAA,GAAAA,OAAA;AAAAtC,eAAA,CAhUYsC,OAAO,kBACI,CAACyH,cAAQ,EAAEC,4BAAe,EAAEjG,4BAAe,EAAEE,oBAAW,EAAEgG,0CAAsB,CAAC;AAAAjK,eAAA,CAD5FsC,OAAO,aAGD4H,eAAS;AAAAlK,eAAA,CAHfsC,OAAO,WAIH,CACb6H,eAAI,CAACC,QAAQ,CAAa,CAAC,EAC3BD,eAAI,CAACC,QAAQ,CAAuB,CAAC,EACrCD,eAAI,CAACC,QAAQ,CAAiB,CAAC,EAC/BD,eAAI,CAACC,QAAQ,CAAiB,CAAC,EAC/BD,eAAI,CAACC,QAAQ,CAAyB,CAAC,CACxC;AAAA,IAAAC,QAAA,GAAAP,OAAA,CAAA3L,OAAA,GAwTYmE,OAAO;AAEtBgI,oBAAW,CAACC,UAAU,CAACjI,OAAO,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","data","_interopRequireWildcard","require","_reactRouterDom","_harmony","_lanesUiCompare","_ui","_designUiPages","_scope","_workspace","_component","_lanesUi","_lanesUiMenus","_uiFoundationUiReactRouter","_lanesUiMenus2","_lanesUiModels","_lanesHooks","_lanesUiNavigation","_lanesHooks2","_componentCompare","_lanesUiCompare2","_scopeUi","_lanes","_lanesUiModule","_interopRequireDefault","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","_defineProperty","_toPropertyKey","value","enumerable","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","useComponentFilters","idFromLocation","useIdFromLocation","undefined","lanesModel","loading","useLanes","laneFromUrl","useViewedLaneFromUrl","laneComponentId","isDefault","resolveComponentFromUrl","log","head","version","useLaneComponentIdFromUrl","query","useQuery","componentVersion","compIdFromLocation","ComponentID","tryFromString","lanesComp","changeVersion","useComponentId","toString","LanesUI","constructor","componentUI","componentCompareUI","routeSlot","navSlot","menuWidgetSlot","overviewSlot","laneProviderIgnoreSlot","workspace","scope","children","ignoreFns","values","createElement","LanesProvider","ignoreDerivingFromUrl","props","tabs","base","compare","LaneCompare","host","hostAspect","lanesHost","WorkspaceAspect","id","ScopeAspect","registerHostAspectRoutes","registerRoutes","getLaneRoutes","registerMenuRoutes","getMenuRoutes","path","LanesModel","lanesPrefix","Fragment","Route","lanePath","index","element","getLaneOverview","getLaneComponent","getLanesComparePage","NotFoundPage","overrideComputeLaneUrl","fn","prefix","getLaneComponentUrl","getLaneIdFromPathname","getLaneUrl","getComponentUI","componentId","getLaneComponentMenu","getMenu","LaneOverview","LaneComparePage","getLaneCompare","groupByScope","getLanesOverviewMenu","LanesOverviewMenu","navigationSlot","widgetSlot","registerMenuWidget","menuItems","register","registerLaneProviderIgnoreSlot","ignoreFn","registerLanesRoutes","registerNavigation","href","exact","order","hide","viewedLane","lanes","getLanesSwitcher","mainIcon","useContext","ScopeContext","ScopeIcon","size","scopeImage","icon","bgColor","backgroundIconColor","className","styles","mainLaneIcon","LanesSwitcher","LaneSwitcher","getLanesProvider","getUseLanes","registerLanesDropdown","registerSidebarLink","component","Gallery","weight","registerRoute","route","registerOverviewLine","lines","routes","provider","uiUi","workspaceUi","scopeUi","_","harmony","config","lanesUi","registerRenderHooks","reactContext","renderContext","currentLane","UseLaneMenu","actionName","actionIcon","viewedLaneId","currentLaneId","exports","UIAspect","ComponentAspect","ComponentCompareAspect","UIRuntime","Slot","withType","_default","LanesAspect","addRuntime"],"sources":["lanes.ui.runtime.tsx"],"sourcesContent":["import React, { ReactNode, useContext } from 'react';\nimport { Route, RouteProps } from 'react-router-dom';\nimport { Slot, Harmony, SlotRegistry } from '@teambit/harmony';\nimport { LaneCompare, type LaneCompareProps as DefaultLaneCompareProps } from '@teambit/lanes.ui.compare.lane-compare';\nimport { UIRuntime, UiUI, UIAspect } from '@teambit/ui';\nimport type { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { NotFoundPage } from '@teambit/design.ui.pages.not-found';\nimport { ScopeAspect, ScopeContext, ScopeUI } from '@teambit/scope';\nimport { WorkspaceAspect, WorkspaceUI } from '@teambit/workspace';\nimport { ComponentAspect, ComponentUI, useIdFromLocation, ComponentID } from '@teambit/component';\nimport { MenuWidget, MenuWidgetSlot } from '@teambit/ui-foundation.ui.menu';\nimport { LaneOverview, LaneOverviewLine, LaneOverviewLineSlot } from '@teambit/lanes.ui.lane-overview';\nimport {\n LanesNavPlugin,\n LanesOrderedNavigationSlot,\n LanesOverviewMenu,\n} from '@teambit/lanes.ui.menus.lanes-overview-menu';\nimport { useQuery } from '@teambit/ui-foundation.ui.react-router.use-query';\nimport { UseLaneMenu } from '@teambit/lanes.ui.menus.use-lanes-menu';\nimport { LanesHost, LanesModel } from '@teambit/lanes.ui.models.lanes-model';\nimport { LanesProvider, useLanes, IgnoreDerivingFromUrl } from '@teambit/lanes.hooks.use-lanes';\nimport { LaneSwitcher } from '@teambit/lanes.ui.navigation.lane-switcher';\nimport { LaneId } from '@teambit/lane-id';\nimport { useViewedLaneFromUrl } from '@teambit/lanes.hooks.use-viewed-lane-from-url';\nimport { ComponentCompareAspect, ComponentCompareUI } from '@teambit/component-compare';\nimport { LaneComparePage } from '@teambit/lanes.ui.compare.lane-compare-page';\nimport { ScopeIcon } from '@teambit/scope.ui.scope-icon';\n\nimport { LanesAspect } from './lanes.aspect';\nimport styles from './lanes.ui.module.scss';\n\nexport type LaneCompareProps = Partial<DefaultLaneCompareProps>;\nexport type LaneProviderIgnoreSlot = SlotRegistry<IgnoreDerivingFromUrl>;\nexport function useComponentFilters() {\n const idFromLocation = useIdFromLocation(undefined, true);\n const { lanesModel, loading } = useLanes();\n const laneFromUrl = useViewedLaneFromUrl();\n const laneComponentId =\n idFromLocation && !laneFromUrl?.isDefault()\n ? lanesModel?.resolveComponentFromUrl(idFromLocation, laneFromUrl) ?? null\n : null;\n\n if (laneComponentId === null || loading) {\n return {\n loading: true,\n };\n }\n\n return {\n loading: false,\n log: {\n head: laneComponentId.version,\n },\n };\n}\n\nexport function useLaneComponentIdFromUrl(): ComponentID | undefined | null {\n const idFromLocation = useIdFromLocation(undefined, true);\n const { lanesModel, loading } = useLanes();\n const laneFromUrl = useViewedLaneFromUrl();\n const query = useQuery();\n const componentVersion = query.get('version');\n\n if (!idFromLocation) return null;\n\n const compIdFromLocation = ComponentID.tryFromString(\n `${idFromLocation}${componentVersion ? `@${componentVersion}` : ''}`\n );\n\n if (compIdFromLocation) return compIdFromLocation;\n if (loading) return undefined;\n\n const lanesComp = (lanesModel?.resolveComponentFromUrl(idFromLocation, laneFromUrl) as any | undefined) ?? null;\n\n if (componentVersion) {\n return lanesComp?.changeVersion(componentVersion);\n }\n\n return lanesComp;\n}\n\nexport function useComponentId() {\n return useLaneComponentIdFromUrl()?.toString();\n}\n\nexport class LanesUI {\n static dependencies = [UIAspect, ComponentAspect, WorkspaceAspect, ScopeAspect, ComponentCompareAspect];\n\n static runtime = UIRuntime;\n static slots = [\n Slot.withType<RouteProps>(),\n Slot.withType<LaneOverviewLineSlot>(),\n Slot.withType<NavigationSlot>(),\n Slot.withType<MenuWidgetSlot>(),\n Slot.withType<LaneProviderIgnoreSlot>(),\n ];\n\n constructor(\n private componentUI: ComponentUI,\n private componentCompareUI: ComponentCompareUI,\n private routeSlot: RouteSlot,\n private navSlot: LanesOrderedNavigationSlot,\n private menuWidgetSlot: MenuWidgetSlot,\n /**\n * overview line slot to add new lines beneath the overview section\n */\n private overviewSlot: LaneOverviewLineSlot,\n private laneProviderIgnoreSlot: LaneProviderIgnoreSlot,\n private workspace?: WorkspaceUI,\n private scope?: ScopeUI\n ) {\n this.hostAspect = workspace || scope;\n this.lanesHost = workspace ? 'workspace' : 'scope';\n this.host = workspace ? WorkspaceAspect.id : ScopeAspect.id;\n }\n\n private readonly lanesHost: LanesHost;\n private readonly hostAspect?: WorkspaceUI | ScopeUI;\n private readonly host: string;\n\n private registerHostAspectRoutes() {\n if (!this.hostAspect) return;\n this.hostAspect.registerRoutes(this.getLaneRoutes());\n this.hostAspect.registerMenuRoutes(this.getMenuRoutes());\n }\n\n getLaneRoutes() {\n return [\n {\n path: LanesModel.lanesPrefix,\n children: (\n <>\n <Route path={LanesModel.lanePath}>\n <Route index element={this.getLaneOverview()} />\n <Route path=\"~component/*\" element={this.getLaneComponent()} />\n <Route path=\"~compare/*\" element={this.getLanesComparePage()} />\n <Route path=\"*\" element={<NotFoundPage />} />\n </Route>\n <Route path=\"*\" element={<NotFoundPage />} />\n </>\n ),\n },\n ];\n }\n\n overrideComputeLaneUrl(\n fn: () => {\n prefix: string;\n path: string;\n getLaneIdFromPathname: (pathname: string) => LaneId | undefined;\n getLaneUrl: (laneId: LaneId, relative?: boolean) => string;\n getLaneComponentUrl: (componentId: ComponentID, laneId: LaneId) => string;\n }\n ) {\n const { prefix, path, getLaneComponentUrl, getLaneIdFromPathname, getLaneUrl } = fn();\n LanesModel.lanesPrefix = prefix;\n LanesModel.lanePath = path;\n LanesModel.getLaneComponentUrl = getLaneComponentUrl as any;\n LanesModel.getLaneUrl = getLaneUrl;\n LanesModel.getLaneIdFromPathname = getLaneIdFromPathname;\n }\n\n // getLaneReadme() {\n // return <LaneReadmeOverview host={this.host} overviewSlot={this.overviewSlot} routeSlot={this.routeSlot} />;\n // }\n\n getLaneComponent() {\n return this.componentUI.getComponentUI(this.host, {\n componentId: useComponentId,\n useComponentFilters,\n });\n }\n\n getLaneComponentMenu() {\n return this.componentUI.getMenu(this.host, {\n componentId: useComponentId,\n useComponentFilters,\n });\n }\n\n getLaneOverview() {\n return (\n <LaneOverview\n routeSlot={this.routeSlot}\n overviewSlot={this.overviewSlot}\n host={this.lanesHost}\n useLanes={useLanes}\n />\n );\n }\n\n getLanesComparePage() {\n return <LaneComparePage getLaneCompare={this.getLaneCompare} groupByScope={this.lanesHost === 'workspace'} />;\n }\n\n getMenuRoutes() {\n return [\n {\n path: LanesModel.lanesPrefix,\n children: (\n <Route path={`${LanesModel.lanePath}/*`}>\n <Route path={'*'} element={this.getLanesOverviewMenu()} />\n <Route path=\"~component/*\" element={this.getLaneComponentMenu()} />\n </Route>\n ),\n },\n ];\n }\n\n getLanesOverviewMenu() {\n return <LanesOverviewMenu navigationSlot={this.navSlot} widgetSlot={this.menuWidgetSlot} />;\n }\n\n registerMenuWidget(...menuItems: MenuWidget[]) {\n this.menuWidgetSlot.register(menuItems);\n return this;\n }\n\n registerLaneProviderIgnoreSlot(ignoreFn: IgnoreDerivingFromUrl) {\n this.laneProviderIgnoreSlot.register(ignoreFn);\n return this;\n }\n\n private registerLanesRoutes() {\n this.registerNavigation([\n // {\n // props: {\n // href: '.',\n // exact: true,\n // children: 'README',\n // },\n // order: 1,\n // hide: () => {\n // const { lanesModel } = useLanes();\n // return !lanesModel?.viewedLane?.readmeComponent;\n // },\n // },\n {\n props: {\n href: '.',\n exact: true,\n children: 'Overview',\n },\n order: 1,\n },\n {\n props: {\n href: '~compare',\n children: 'Compare',\n },\n order: 2,\n hide: () => {\n const { lanesModel } = useLanes();\n return !lanesModel?.viewedLane || lanesModel?.lanes.length < 2;\n },\n },\n ]);\n }\n\n private registerRoutes() {\n this.registerHostAspectRoutes();\n this.registerLanesRoutes();\n }\n\n getLanesSwitcher() {\n const mainIcon = () => {\n const scope = useContext(ScopeContext);\n return (\n <ScopeIcon\n size={24}\n scopeImage={scope.icon}\n bgColor={scope.backgroundIconColor}\n className={styles.mainLaneIcon}\n />\n );\n };\n\n const LanesSwitcher = (\n <LaneSwitcher\n groupByScope={this.lanesHost === 'workspace'}\n mainIcon={this.lanesHost === 'scope' ? mainIcon : undefined}\n // @ts-ignore @todo - fix this\n useLanes={useLanes}\n />\n );\n\n return LanesSwitcher;\n }\n\n getLanesProvider() {\n return LanesProvider;\n }\n\n getUseLanes() {\n return useLanes;\n }\n\n private registerLanesDropdown() {\n const LanesSwitcher = this.getLanesSwitcher();\n\n this.hostAspect?.registerSidebarLink({\n component: function Gallery() {\n return LanesSwitcher;\n },\n weight: 1000,\n });\n }\n\n private renderContext = ({ children }: { children: ReactNode }) => {\n const ignoreFns = this.laneProviderIgnoreSlot.values();\n\n return <LanesProvider ignoreDerivingFromUrl={ignoreFns}>{children}</LanesProvider>;\n };\n\n registerRoute(route: RouteProps) {\n this.routeSlot.register(route);\n return this;\n }\n\n /**\n * register a new line beneath the lane overview section.\n */\n registerOverviewLine(...lines: LaneOverviewLine[]) {\n this.overviewSlot.register(lines);\n return this;\n }\n\n registerNavigation(routes: LanesNavPlugin[]) {\n this.navSlot.register(routes);\n }\n\n getLaneCompare = (props: LaneCompareProps) => {\n const tabs = this.componentCompareUI.tabs;\n\n if (!props.base || !props.compare) return null;\n\n return (\n <LaneCompare\n {...props}\n base={props.base}\n compare={props.compare}\n host={props.host || this.host}\n tabs={props.tabs || tabs}\n />\n );\n };\n\n static async provider(\n [uiUi, componentUI, workspaceUi, scopeUi, componentCompareUI]: [\n UiUI,\n ComponentUI,\n WorkspaceUI,\n ScopeUI,\n ComponentCompareUI\n ],\n _,\n [routeSlot, overviewSlot, navSlot, menuWidgetSlot, laneProviderIgnoreSlot]: [\n RouteSlot,\n LaneOverviewLineSlot,\n LanesOrderedNavigationSlot,\n MenuWidgetSlot,\n LaneProviderIgnoreSlot\n ],\n harmony: Harmony\n ) {\n const { config } = harmony;\n const host = String(config.get('teambit.harmony/bit'));\n let workspace: WorkspaceUI | undefined;\n let scope: ScopeUI | undefined;\n if (host === WorkspaceAspect.id) {\n workspace = workspaceUi;\n }\n if (host === ScopeAspect.id) {\n scope = scopeUi;\n }\n const lanesUi = new LanesUI(\n componentUI,\n componentCompareUI,\n routeSlot,\n navSlot,\n menuWidgetSlot,\n overviewSlot,\n laneProviderIgnoreSlot,\n workspace,\n scope\n );\n if (uiUi) uiUi.registerRenderHooks({ reactContext: lanesUi.renderContext });\n lanesUi.registerRoutes();\n lanesUi.registerMenuWidget(() => {\n const { lanesModel } = useLanes();\n if (!lanesModel?.viewedLane) return null;\n const { viewedLane, currentLane } = lanesModel;\n return (\n <UseLaneMenu\n actionName={'Import'}\n actionIcon={'terminal'}\n host={lanesUi.lanesHost}\n viewedLaneId={viewedLane.id}\n currentLaneId={currentLane?.id}\n />\n );\n });\n lanesUi.registerLanesDropdown();\n return lanesUi;\n }\n}\n\nexport default LanesUI;\n\nLanesAspect.addRuntime(LanesUI);\n"],"mappings":";;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,gBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,gBAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,eAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,IAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,GAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,eAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,cAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,OAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,MAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;A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A,CAD5FsC,OAAO,aAGD4H,eAAS;AAAAlK,eAAA,CAHfsC,OAAO,WAIH,CACb6H,eAAI,CAACC,QAAQ,CAAa,CAAC,EAC3BD,eAAI,CAACC,QAAQ,CAAuB,CAAC,EACrCD,eAAI,CAACC,QAAQ,CAAiB,CAAC,EAC/BD,eAAI,CAACC,QAAQ,CAAiB,CAAC,EAC/BD,eAAI,CAACC,QAAQ,CAAyB,CAAC,CACxC;AAAA,IAAAC,QAAA,GAAAP,OAAA,CAAAtL,OAAA,GAwTY8D,OAAO;AAEtBgI,oBAAW,CAACC,UAAU,CAACjI,OAAO,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.lanes_lanes@1.0.282/dist/lanes.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.lanes_lanes@1.0.282/dist/lanes.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.lanes_lanes@1.0.284/dist/lanes.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.lanes_lanes@1.0.284/dist/lanes.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -34,7 +34,7 @@ function _createLane() {
34
34
  }
35
35
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
36
36
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
37
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
37
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
38
38
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
39
39
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
40
40
  class LaneSwitcher {
@@ -1 +1 @@
1
- {"version":3,"names":["_laneId","data","require","_componentId","_bitError","_createLane","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","key","value","_toPropertyKey","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","localLane","loadLane","getMainIds","mainIds","getIdsOfDefaultLane","head","legacyScope","scopeImporter","importWithoutDeps","cache","isDefault","populatePropsAccordingToDefaultLane","laneIds","populatePropsAccordingToLocalLane","populatePropsAccordingToRemoteLane","idsOnLaneOnly","find","isEqualWithoutVersion","idsOnMainOnly","laneBitIds","populateIdsAccordingToPattern","pattern","bitMap","getAllBitIdsFromAllLanes","BitError","allIds","patternIds","filterIdsFromPoolIdsByPattern","remoteLaneId","laneIdToSwitchTo","debug","toString","throwForSwitchingToCurrentLane","remoteLane","fetchLaneWithItsComponents","name","localTrackedLane","getAliasByLaneId","undefined","components","l","changeVersion","LaneId","from","DEFAULT_LANE","toLaneId","c","getCurrentLaneId","isEqual","laneIdStr","localLaneName","alias","trackLane","remoteScope","setCurrentLane","isNew","syncWithIds","ComponentIdList","fromArray","exports"],"sources":["switch-lanes.ts"],"sourcesContent":["import { Consumer } from '@teambit/legacy/dist/consumer';\nimport { LaneId, DEFAULT_LANE } from '@teambit/lane-id';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { ApplyVersionResults } from '@teambit/merging';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { CheckoutProps } from '@teambit/checkout';\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?: 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 head?: 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.consumer);\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\n const localLane = await this.consumer.scope.loadLane(laneId);\n const getMainIds = async () => {\n const mainIds = await this.consumer.getIdsOfDefaultLane();\n if (this.switchProps.head) {\n await this.workspace.scope.legacyScope.scopeImporter.importWithoutDeps(mainIds, { cache: false });\n return this.consumer.getIdsOfDefaultLane();\n }\n return mainIds;\n };\n const mainIds = await getMainIds();\n if (laneId.isDefault()) {\n await this.populatePropsAccordingToDefaultLane();\n this.switchProps.ids = mainIds;\n } else {\n const laneIds =\n localLane && !this.switchProps.head\n ? this.populatePropsAccordingToLocalLane(localLane)\n : await this.populatePropsAccordingToRemoteLane(laneId);\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 const patternIds = await this.workspace.filterIdsFromPoolIdsByPattern(this.switchProps.pattern, allIds);\n this.switchProps.ids = patternIds.map((id) => id);\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.components.map((l) => l.id.changeVersion(l.head.toString()));\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.components.map((c) => c.id.changeVersion(c.head.toString()));\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}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,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;AAEA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyD,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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B,EAAE,CAAC,IAAI,CAACtC,cAAc,EAAEgE,KAAK,CAAC;IAChF,IAAI,CAAClF,QAAQ,CAACiD,MAAM,CAACkC,WAAW,CAC9BC,8BAAe,CAACC,SAAS,CAAC,IAAI,CAACxF,WAAW,CAACY,GAAG,IAAI,EAAE,CAAC,EACrD2E,8BAAe,CAACC,SAAS,CAAC,IAAI,CAACxF,WAAW,CAACiD,UAAU,IAAI,EAAE,CAC7D,CAAC;EACH;AACF;AAACwC,OAAA,CAAA7F,YAAA,GAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"names":["_laneId","data","require","_componentId","_bitError","_createLane","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","localLane","loadLane","getMainIds","mainIds","getIdsOfDefaultLane","head","legacyScope","scopeImporter","importWithoutDeps","cache","isDefault","populatePropsAccordingToDefaultLane","laneIds","populatePropsAccordingToLocalLane","populatePropsAccordingToRemoteLane","idsOnLaneOnly","find","isEqualWithoutVersion","idsOnMainOnly","laneBitIds","populateIdsAccordingToPattern","pattern","bitMap","getAllBitIdsFromAllLanes","BitError","allIds","patternIds","filterIdsFromPoolIdsByPattern","remoteLaneId","laneIdToSwitchTo","debug","toString","throwForSwitchingToCurrentLane","remoteLane","fetchLaneWithItsComponents","name","localTrackedLane","getAliasByLaneId","undefined","components","l","changeVersion","LaneId","from","DEFAULT_LANE","toLaneId","c","getCurrentLaneId","isEqual","laneIdStr","localLaneName","alias","trackLane","remoteScope","setCurrentLane","isNew","syncWithIds","ComponentIdList","fromArray","exports"],"sources":["switch-lanes.ts"],"sourcesContent":["import { Consumer } from '@teambit/legacy/dist/consumer';\nimport { LaneId, DEFAULT_LANE } from '@teambit/lane-id';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { ApplyVersionResults } from '@teambit/merging';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { CheckoutProps } from '@teambit/checkout';\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?: 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 head?: 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.consumer);\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\n const localLane = await this.consumer.scope.loadLane(laneId);\n const getMainIds = async () => {\n const mainIds = await this.consumer.getIdsOfDefaultLane();\n if (this.switchProps.head) {\n await this.workspace.scope.legacyScope.scopeImporter.importWithoutDeps(mainIds, { cache: false });\n return this.consumer.getIdsOfDefaultLane();\n }\n return mainIds;\n };\n const mainIds = await getMainIds();\n if (laneId.isDefault()) {\n await this.populatePropsAccordingToDefaultLane();\n this.switchProps.ids = mainIds;\n } else {\n const laneIds =\n localLane && !this.switchProps.head\n ? this.populatePropsAccordingToLocalLane(localLane)\n : await this.populatePropsAccordingToRemoteLane(laneId);\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 const patternIds = await this.workspace.filterIdsFromPoolIdsByPattern(this.switchProps.pattern, allIds);\n this.switchProps.ids = patternIds.map((id) => id);\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.components.map((l) => l.id.changeVersion(l.head.toString()));\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.components.map((c) => c.id.changeVersion(c.head.toString()));\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.laneToS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AS,CAAC,IAAI,CAACxF,WAAW,CAACiD,UAAU,IAAI,EAAE,CAC7D,CAAC;EACH;AACF;AAACwC,OAAA,CAAA7F,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -32,8 +32,8 @@ function _constants() {
32
32
  };
33
33
  return data;
34
34
  }
35
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
36
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
35
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
36
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
37
37
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
38
38
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
39
39
  class SwitchCmd {
@@ -1 +1 @@
1
- {"version":3,"names":["_chalk","data","_interopRequireDefault","require","_lodash","_merging","_constants","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","SwitchCmd","constructor","lanes","name","description","COMPONENT_PATTERN_HELP","report","lane","head","alias","autoMergeResolve","getAll","workspaceOnly","skipDependencyInstallation","pattern","json","components","failedComponents","installationError","compilationError","switchLanes","merge","logger","warn","JSON","stringify","getFailureOutput","length","title","body","map","failedComponent","color","unchangedLegitimately","chalk","bold","id","toString","unchangedMessage","join","getSuccessfulOutput","laneSwitched","green","applyVersionReport","compact","installationErrorOutput","compilationErrorOutput","exports"],"sources":["switch.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { compact } from 'lodash';\nimport { applyVersionReport, installationErrorOutput, compilationErrorOutput } from '@teambit/merging';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { LanesMain } from './lanes.main.runtime';\n\nexport class SwitchCmd implements Command {\n name = 'switch <lane>';\n description = `switch to the specified lane`;\n extendedDescription = ``;\n private = true;\n alias = '';\n arguments = [\n {\n name: 'lane',\n description: 'lane-name or lane-id (if lane is not local) to switch to',\n },\n ];\n options = [\n ['h', 'head', 'switch to the head of the lane/main (fetches the latest changes from the remote)'],\n [\n 'r',\n 'auto-merge-resolve <merge-strategy>',\n 'merge local changes with the checked out version. strategy should be \"theirs\", \"ours\" or \"manual\"',\n ],\n ['a', 'get-all', 'DEPRECATED. this is currently the default behavior'],\n ['', 'workspace-only', 'checkout only the components in the workspace to the selected lane'],\n ['x', 'skip-dependency-installation', 'do not install dependencies of the imported components'],\n [\n 'p',\n 'pattern <component-pattern>',\n `switch only the lane components matching the specified component-pattern. only works when the workspace is empty\\n\n${COMPONENT_PATTERN_HELP}`,\n ],\n [\n 'n',\n 'alias <string>',\n \"relevant when the specified lane is a remote lane. create a local alias for the lane (doesnt affect the lane's name on the remote\",\n ],\n ['j', 'json', 'return the output as JSON'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report(\n [lane]: [string],\n {\n head,\n alias,\n autoMergeResolve,\n getAll = false,\n workspaceOnly = false,\n skipDependencyInstallation = false,\n pattern,\n json = false,\n }: {\n head?: boolean;\n alias?: string;\n autoMergeResolve?: MergeStrategy;\n getAll?: boolean;\n workspaceOnly?: boolean;\n skipDependencyInstallation?: boolean;\n override?: boolean;\n pattern?: string;\n json?: boolean;\n }\n ) {\n const { components, failedComponents, installationError, compilationError } = await this.lanes.switchLanes(lane, {\n head,\n alias,\n merge: autoMergeResolve,\n workspaceOnly,\n pattern,\n skipDependencyInstallation,\n });\n if (getAll) {\n this.lanes.logger.warn('the --get-all flag is deprecated and currently the default behavior');\n }\n if (json) {\n return JSON.stringify({ components, failedComponents }, null, 4);\n }\n const getFailureOutput = () => {\n if (!failedComponents || !failedComponents.length) return '';\n const title = 'the switch has been canceled for the following component(s)';\n const body = failedComponents\n .map((failedComponent) => {\n const color = failedComponent.unchangedLegitimately ? 'white' : 'red';\n return `${chalk.bold(failedComponent.id.toString())} - ${chalk[color](failedComponent.unchangedMessage)}`;\n })\n .join('\\n');\n return `${title}\\n${body}`;\n };\n const getSuccessfulOutput = () => {\n const laneSwitched = chalk.green(`\\nsuccessfully set \"${chalk.bold(lane)}\" as the active lane`);\n if (!components || !components.length) return `No components have been changed.${laneSwitched}`;\n const title = `successfully switched ${components.length} components to the head of lane ${lane}\\n`;\n return chalk.bold(title) + applyVersionReport(components, true, false) + laneSwitched;\n };\n\n return compact([\n getFailureOutput(),\n getSuccessfulOutput(),\n installationErrorOutput(installationError),\n compilationErrorOutput(compilationError),\n ]).join('\\n\\n');\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;E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require","_lodash","_merging","_constants","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","SwitchCmd","constructor","lanes","name","description","COMPONENT_PATTERN_HELP","report","lane","head","alias","autoMergeResolve","getAll","workspaceOnly","skipDependencyInstallation","pattern","json","components","failedComponents","installationError","compilationError","switchLanes","merge","logger","warn","JSON","stringify","getFailureOutput","length","title","body","map","failedComponent","color","unchangedLegitimately","chalk","bold","id","toString","unchangedMessage","join","getSuccessfulOutput","laneSwitched","green","applyVersionReport","compact","installationErrorOutput","compilationErrorOutput","exports"],"sources":["switch.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { compact } from 'lodash';\nimport { applyVersionReport, installationErrorOutput, compilationErrorOutput } from '@teambit/merging';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';\nimport { LanesMain } from './lanes.main.runtime';\n\nexport class SwitchCmd implements Command {\n name = 'switch <lane>';\n description = `switch to the specified lane`;\n extendedDescription = ``;\n private = true;\n alias = '';\n arguments = [\n {\n name: 'lane',\n description: 'lane-name or lane-id (if lane is not local) to switch to',\n },\n ];\n options = [\n ['h', 'head', 'switch to the head of the lane/main (fetches the latest changes from the remote)'],\n [\n 'r',\n 'auto-merge-resolve <merge-strategy>',\n 'merge local changes with the checked out version. strategy should be \"theirs\", \"ours\" or \"manual\"',\n ],\n ['a', 'get-all', 'DEPRECATED. this is currently the default behavior'],\n ['', 'workspace-only', 'checkout only the components in the workspace to the selected lane'],\n ['x', 'skip-dependency-installation', 'do not install dependencies of the imported components'],\n [\n 'p',\n 'pattern <component-pattern>',\n `switch only the lane components matching the specified component-pattern. only works when the workspace is empty\\n\n${COMPONENT_PATTERN_HELP}`,\n ],\n [\n 'n',\n 'alias <string>',\n \"relevant when the specified lane is a remote lane. create a local alias for the lane (doesnt affect the lane's name on the remote\",\n ],\n ['j', 'json', 'return the output as JSON'],\n ] as CommandOptions;\n loader = true;\n\n constructor(private lanes: LanesMain) {}\n\n async report(\n [lane]: [string],\n {\n head,\n alias,\n autoMergeResolve,\n getAll = false,\n workspaceOnly = false,\n skipDependencyInstallation = false,\n pattern,\n json = false,\n }: {\n head?: boolean;\n alias?: string;\n autoMergeResolve?: MergeStrategy;\n getAll?: boolean;\n workspaceOnly?: boolean;\n skipDependencyInstallation?: boolean;\n override?: boolean;\n pattern?: string;\n json?: boolean;\n }\n ) {\n const { components, failedComponents, installationError, compilationError } = await this.lanes.switchLanes(lane, {\n head,\n alias,\n merge: autoMergeResolve,\n workspaceOnly,\n pattern,\n skipDependencyInstallation,\n });\n if (getAll) {\n this.lanes.logger.warn('the --get-all flag is deprecated and currently the default behavior');\n }\n if (json) {\n return JSON.stringify({ components, failedComponents }, null, 4);\n }\n const getFailureOutput = () => {\n if (!failedComponents || !failedComponents.length) return '';\n const title = 'the switch has been canceled for the following component(s)';\n const body = failedComponents\n .map((failedComponent) => {\n const color = failedComponent.unchangedLegitimately ? 'white' : 'red';\n return `${chalk.bold(failedComponent.id.toString())} - ${chalk[color](failedComponent.unchangedMessage)}`;\n })\n .join('\\n');\n return `${title}\\n${body}`;\n };\n const getSuccessfulOutput = () => {\n const laneSwitched = chalk.green(`\\nsuccessfully set \"${chalk.bold(lane)}\" as the active lane`);\n if (!components || !components.length) return `No components have been changed.${laneSwitched}`;\n const title = `successfully switched ${components.length} components to the head of lane ${lane}\\n`;\n return chalk.bold(title) + applyVersionReport(components, true, false) + laneSwitched;\n };\n\n return compact([\n getFailureOutput(),\n getSuccessfulOutput(),\n installationErrorOutput(installationError),\n compilationErrorOutput(compilationError),\n ]).join('\\n\\n');\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;I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