@teambit/lanes 0.0.499 → 0.0.501
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.
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lanes.graphql.js +22 -0
- package/dist/lanes.graphql.js.map +1 -1
- package/dist/lanes.main.runtime.d.ts +8 -2
- package/dist/lanes.main.runtime.js +8 -2
- package/dist/lanes.main.runtime.js.map +1 -1
- package/dist/lanes.spec.js +6 -6
- package/dist/lanes.spec.js.map +1 -1
- package/dist/lanes.ui.runtime.d.ts +14 -4
- package/dist/lanes.ui.runtime.js +74 -15
- package/dist/lanes.ui.runtime.js.map +1 -1
- package/dist/{preview-1670414621516.js → preview-1670894303358.js} +2 -2
- package/lanes.ui.runtime.tsx +76 -8
- package/package-tar/teambit-lanes-0.0.501.tgz +0 -0
- package/package.json +27 -26
- package/package-tar/teambit-lanes-0.0.499.tgz +0 -0
package/dist/index.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { LanesAspect } from './lanes.aspect';
|
2
2
|
export type { LanesMain, Lane } from './lanes.main.runtime';
|
3
3
|
export { LanesModel, LanesQuery } from '@teambit/lanes.ui.models.lanes-model';
|
4
|
-
export type { LanesUI } from './lanes.ui.runtime';
|
4
|
+
export type { LanesUI, LaneCompareProps } from './lanes.ui.runtime';
|
5
5
|
export default LanesAspect;
|
6
6
|
export { LanesAspect };
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["LanesAspect"],"sources":["index.ts"],"sourcesContent":["import { LanesAspect } from './lanes.aspect';\n\nexport type { LanesMain, Lane } from './lanes.main.runtime';\nexport { LanesModel, LanesQuery } from '@teambit/lanes.ui.models.lanes-model';\nexport type { LanesUI } from './lanes.ui.runtime';\nexport default LanesAspect;\nexport { LanesAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA8E,eAE/DA,oBAAW;AAAA"}
|
1
|
+
{"version":3,"names":["LanesAspect"],"sources":["index.ts"],"sourcesContent":["import { LanesAspect } from './lanes.aspect';\n\nexport type { LanesMain, Lane } from './lanes.main.runtime';\nexport { LanesModel, LanesQuery } from '@teambit/lanes.ui.models.lanes-model';\nexport type { LanesUI, LaneCompareProps } from './lanes.ui.runtime';\nexport default LanesAspect;\nexport { LanesAspect };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA8E,eAE/DA,oBAAW;AAAA"}
|
package/dist/lanes.graphql.js
CHANGED
@@ -73,6 +73,19 @@ function lanesSchema(lanesMainRuntime) {
|
|
73
73
|
scope: String!
|
74
74
|
}
|
75
75
|
|
76
|
+
type LaneComponentDiffStatus {
|
77
|
+
componentId: ComponentID!
|
78
|
+
changeType: String!
|
79
|
+
upToDate: Boolean!
|
80
|
+
}
|
81
|
+
|
82
|
+
type LaneDiffStatus {
|
83
|
+
source: LaneId!
|
84
|
+
target: LaneId!
|
85
|
+
upToDate: Boolean!
|
86
|
+
componentsStatus: [LaneComponentDiffStatus!]!
|
87
|
+
}
|
88
|
+
|
76
89
|
type Lane {
|
77
90
|
id: LaneId!
|
78
91
|
hash: String
|
@@ -86,6 +99,7 @@ function lanesSchema(lanesMainRuntime) {
|
|
86
99
|
id: String!
|
87
100
|
list(ids: [String!], offset: Int, limit: Int): [Lane!]!
|
88
101
|
diff(from: String!, to: String!, options: DiffOptions): GetDiffResult
|
102
|
+
diffStatus(source: String!, target: String): LaneDiffStatus!
|
89
103
|
current: Lane
|
90
104
|
}
|
91
105
|
|
@@ -136,6 +150,14 @@ function lanesSchema(lanesMainRuntime) {
|
|
136
150
|
id: item.id.toString()
|
137
151
|
}))
|
138
152
|
});
|
153
|
+
},
|
154
|
+
diffStatus: async (lanesMain, {
|
155
|
+
source,
|
156
|
+
target
|
157
|
+
}) => {
|
158
|
+
const sourceLaneId = _laneId().LaneId.parse(source);
|
159
|
+
const targetLaneId = target ? _laneId().LaneId.parse(target) : undefined;
|
160
|
+
return lanesMain.diffStatus(sourceLaneId, targetLaneId);
|
139
161
|
}
|
140
162
|
},
|
141
163
|
Lane: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["lanesSchema","lanesMainRuntime","typeDefs","gql","resolvers","Lanes","id","list","lanesMain","ids","limit","offset","lanes","length","getLanes","showDefaultLane","flatten","Promise","all","map","name","LaneId","parse","slice","current","currentLaneName","getCurrentLaneName","undefined","currentLane","diff","from","to","options","getDiffResults","getDiff","compsWithDiff","item","toString","Lane","lane","toObject","laneComponentIds","componentIds","getLaneComponentIds","componentId","components","laneComponents","getLaneComponentModels","readmeComponent","laneReadmeComponent","getLaneReadmeComponent","Query"],"sources":["lanes.graphql.ts"],"sourcesContent":["import { Schema } from '@teambit/graphql';\nimport { LaneId } from '@teambit/lane-id';\nimport { LaneData } from '@teambit/legacy/dist/scope/lanes/lanes';\nimport gql from 'graphql-tag';\nimport { flatten, slice } from 'lodash';\n\nimport { LanesMain } from './lanes.main.runtime';\n\nexport function lanesSchema(lanesMainRuntime: LanesMain): Schema {\n return {\n typeDefs: gql`\n type FileDiff {\n filePath: String!\n diffOutput: String\n }\n\n type FieldsDiff {\n fieldName: String!\n diffOutput: String\n }\n\n type DiffResults {\n id: String\n hasDiff: Boolean\n filesDiff: [FileDiff]\n fieldsDiff: [FieldsDiff]\n }\n\n type GetDiffResult {\n newComps: [String]\n compsWithNoChanges: [String]\n toLaneName: String\n compsWithDiff: [DiffResults]\n }\n\n input DiffOptions {\n color: Boolean\n }\n\n type LaneId {\n name: String!\n scope: String!\n }\n\n type Lane {\n id: LaneId!\n hash: String\n laneComponentIds: [ComponentID!]!\n components(offset: Int, limit: Int): [Component!]!\n readmeComponent: Component\n }\n\n # Lane API\n type Lanes {\n id: String!\n list(ids: [String!], offset: Int, limit: Int): [Lane!]!\n diff(from: String!, to: String!, options: DiffOptions): GetDiffResult\n current: Lane\n }\n\n type Query {\n lanes: Lanes\n }\n `,\n resolvers: {\n Lanes: {\n // need this for Apollo InMemory Caching\n id: () => 'lanes',\n list: async (\n lanesMain: LanesMain,\n { ids, limit, offset }: { ids?: string[]; offset?: number; limit?: number }\n ) => {\n let lanes: LaneData[] = [];\n\n if (!ids || ids.length === 0) {\n lanes = await lanesMain.getLanes({ showDefaultLane: true });\n } else {\n lanes = flatten(await Promise.all(ids.map((id) => lanesMain.getLanes({ name: LaneId.parse(id).name }))));\n }\n\n if (limit || offset) {\n lanes = slice(lanes, offset, limit && limit + (offset || 0));\n }\n\n return lanes;\n },\n current: async (lanesMain: LanesMain) => {\n const currentLaneName = lanesMain.getCurrentLaneName();\n if (!currentLaneName) return undefined;\n const [currentLane] = await lanesMain.getLanes({ name: currentLaneName });\n return currentLane;\n },\n diff: async (\n lanesMain: LanesMain,\n { from, to, options }: { to: string; from: string; options: { color?: boolean } }\n ) => {\n const getDiffResults = await lanesMain.getDiff([from, to], options);\n return {\n ...getDiffResults,\n compsWithDiff: getDiffResults.compsWithDiff.map((item) => ({ ...item, id: item.id.toString() })),\n };\n },\n },\n Lane: {\n id: (lane: LaneData) => lane.id.toObject(),\n laneComponentIds: async (lane: LaneData) => {\n const componentIds = await lanesMainRuntime.getLaneComponentIds(lane);\n return componentIds.map((componentId) => componentId.toObject());\n },\n components: async (lane: LaneData) => {\n const laneComponents = await lanesMainRuntime.getLaneComponentModels(lane);\n return laneComponents;\n },\n readmeComponent: async (lane: LaneData) => {\n const laneReadmeComponent = await lanesMainRuntime.getLaneReadmeComponent(lane);\n return laneReadmeComponent;\n },\n },\n Query: {\n lanes: () => lanesMainRuntime,\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;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QACd,CAAC;QACDY,OAAO,EAAE,MAAOhB,SAAoB,IAAK;UACvC,MAAMiB,eAAe,GAAGjB,SAAS,CAACkB,kBAAkB,EAAE;UACtD,IAAI,CAACD,eAAe,EAAE,OAAOE,SAAS;UACtC,MAAM,CAACC,WAAW,CAAC,GAAG,MAAMpB,SAAS,CAACM,QAAQ,CAAC;YAAEM,IAAI,EAAEK;UAAgB,CAAC,CAAC;UACzE,OAAOG,WAAW;QACpB,CAAC;QACDC,IAAI,EAAE,OACJrB,SAAoB,EACpB;UAAEsB,IAAI;UAAEC,EAAE;UAAEC;QAAoE,CAAC,KAC9E;UACH,MAAMC,cAAc,GAAG,MAAMzB,SAAS,CAAC0B,OAAO,CAAC,CAACJ,IAAI,EAAEC,EAAE,CAAC,EAAEC,OAAO,CAAC;UACnE,uCACKC,cAAc;YACjBE,aAAa,EAAEF,cAAc,CAACE,aAAa,CAAChB,GAAG,CAAEiB,IAAI,oCAAWA,IAAI;cAAE9B,EAAE,EAAE8B,IAAI,CAAC9B,EAAE,CAAC+B,QAAQ;YAAE,EAAG;UAAC;QAEpG;MACF,CAAC;MACDC,IAAI,EAAE;
|
1
|
+
{"version":3,"names":["lanesSchema","lanesMainRuntime","typeDefs","gql","resolvers","Lanes","id","list","lanesMain","ids","limit","offset","lanes","length","getLanes","showDefaultLane","flatten","Promise","all","map","name","LaneId","parse","slice","current","currentLaneName","getCurrentLaneName","undefined","currentLane","diff","from","to","options","getDiffResults","getDiff","compsWithDiff","item","toString","diffStatus","source","target","sourceLaneId","targetLaneId","Lane","lane","toObject","laneComponentIds","componentIds","getLaneComponentIds","componentId","components","laneComponents","getLaneComponentModels","readmeComponent","laneReadmeComponent","getLaneReadmeComponent","Query"],"sources":["lanes.graphql.ts"],"sourcesContent":["import { Schema } from '@teambit/graphql';\nimport { LaneId } from '@teambit/lane-id';\nimport { LaneData } from '@teambit/legacy/dist/scope/lanes/lanes';\nimport gql from 'graphql-tag';\nimport { flatten, slice } from 'lodash';\n\nimport { LanesMain } from './lanes.main.runtime';\n\nexport function lanesSchema(lanesMainRuntime: LanesMain): Schema {\n return {\n typeDefs: gql`\n type FileDiff {\n filePath: String!\n diffOutput: String\n }\n\n type FieldsDiff {\n fieldName: String!\n diffOutput: String\n }\n\n type DiffResults {\n id: String\n hasDiff: Boolean\n filesDiff: [FileDiff]\n fieldsDiff: [FieldsDiff]\n }\n\n type GetDiffResult {\n newComps: [String]\n compsWithNoChanges: [String]\n toLaneName: String\n compsWithDiff: [DiffResults]\n }\n\n input DiffOptions {\n color: Boolean\n }\n\n type LaneId {\n name: String!\n scope: String!\n }\n\n type LaneComponentDiffStatus {\n componentId: ComponentID!\n changeType: String!\n upToDate: Boolean!\n }\n\n type LaneDiffStatus {\n source: LaneId!\n target: LaneId!\n upToDate: Boolean!\n componentsStatus: [LaneComponentDiffStatus!]!\n }\n\n type Lane {\n id: LaneId!\n hash: String\n laneComponentIds: [ComponentID!]!\n components(offset: Int, limit: Int): [Component!]!\n readmeComponent: Component\n }\n\n # Lane API\n type Lanes {\n id: String!\n list(ids: [String!], offset: Int, limit: Int): [Lane!]!\n diff(from: String!, to: String!, options: DiffOptions): GetDiffResult\n diffStatus(source: String!, target: String): LaneDiffStatus!\n current: Lane\n }\n\n type Query {\n lanes: Lanes\n }\n `,\n resolvers: {\n Lanes: {\n // need this for Apollo InMemory Caching\n id: () => 'lanes',\n list: async (\n lanesMain: LanesMain,\n { ids, limit, offset }: { ids?: string[]; offset?: number; limit?: number }\n ) => {\n let lanes: LaneData[] = [];\n\n if (!ids || ids.length === 0) {\n lanes = await lanesMain.getLanes({ showDefaultLane: true });\n } else {\n lanes = flatten(await Promise.all(ids.map((id) => lanesMain.getLanes({ name: LaneId.parse(id).name }))));\n }\n\n if (limit || offset) {\n lanes = slice(lanes, offset, limit && limit + (offset || 0));\n }\n\n return lanes;\n },\n current: async (lanesMain: LanesMain) => {\n const currentLaneName = lanesMain.getCurrentLaneName();\n if (!currentLaneName) return undefined;\n const [currentLane] = await lanesMain.getLanes({ name: currentLaneName });\n return currentLane;\n },\n diff: async (\n lanesMain: LanesMain,\n { from, to, options }: { to: string; from: string; options: { color?: boolean } }\n ) => {\n const getDiffResults = await lanesMain.getDiff([from, to], options);\n return {\n ...getDiffResults,\n compsWithDiff: getDiffResults.compsWithDiff.map((item) => ({ ...item, id: item.id.toString() })),\n };\n },\n diffStatus: async (lanesMain: LanesMain, { source, target }: { source: string; target?: string }) => {\n const sourceLaneId = LaneId.parse(source);\n const targetLaneId = target ? LaneId.parse(target) : undefined;\n return lanesMain.diffStatus(sourceLaneId, targetLaneId);\n },\n },\n Lane: {\n id: (lane: LaneData) => lane.id.toObject(),\n laneComponentIds: async (lane: LaneData) => {\n const componentIds = await lanesMainRuntime.getLaneComponentIds(lane);\n return componentIds.map((componentId) => componentId.toObject());\n },\n components: async (lane: LaneData) => {\n const laneComponents = await lanesMainRuntime.getLaneComponentModels(lane);\n return laneComponents;\n },\n readmeComponent: async (lane: LaneData) => {\n const laneReadmeComponent = await lanesMainRuntime.getLaneReadmeComponent(lane);\n return laneReadmeComponent;\n },\n },\n Query: {\n lanes: () => lanesMainRuntime,\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAwC;AAAA;AAIjC,SAASA,WAAW,CAACC,gBAA2B,EAAU;EAC/D,OAAO;IACLC,QAAQ,EAAE,IAAAC,qBAAG,CAAC;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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E,OAAOU,mBAAmB;QAC5B;MACF,CAAC;MACDE,KAAK,EAAE;QACL5C,KAAK,EAAE,MAAMX;MACf;IACF;EACF,CAAC;AACH"}
|
@@ -41,11 +41,17 @@ export declare enum ChangeType {
|
|
41
41
|
DEPENDENCY = "DEPENDENCY",
|
42
42
|
CONFIG = "CONFIG"
|
43
43
|
}
|
44
|
-
declare type
|
44
|
+
export declare type LaneComponentDiffStatus = {
|
45
45
|
componentId: ComponentID;
|
46
46
|
changeType: ChangeType;
|
47
47
|
upToDate: boolean;
|
48
48
|
};
|
49
|
+
export declare type LaneDiffStatus = {
|
50
|
+
upToDate: boolean;
|
51
|
+
source: LaneId;
|
52
|
+
target: LaneId;
|
53
|
+
componentsStatus: LaneComponentDiffStatus[];
|
54
|
+
};
|
49
55
|
export declare class LanesMain {
|
50
56
|
private workspace;
|
51
57
|
private scope;
|
@@ -147,7 +153,7 @@ export declare class LanesMain {
|
|
147
153
|
result: boolean;
|
148
154
|
message?: string;
|
149
155
|
}>;
|
150
|
-
|
156
|
+
diffStatus(sourceLaneId: LaneId, targetLaneId?: LaneId): Promise<LaneDiffStatus>;
|
151
157
|
addLaneReadme(readmeComponentIdStr: string, laneName?: string): Promise<{
|
152
158
|
result: boolean;
|
153
159
|
message?: string;
|
@@ -751,7 +751,7 @@ class LanesMain {
|
|
751
751
|
result: true
|
752
752
|
};
|
753
753
|
}
|
754
|
-
async
|
754
|
+
async diffStatus(sourceLaneId, targetLaneId) {
|
755
755
|
const sourceLane = await this.loadLane(sourceLaneId);
|
756
756
|
if (!sourceLane) throw new Error(`unable to find ${sourceLaneId.toString()} in the scope`);
|
757
757
|
const targetLane = targetLaneId ? await this.loadLane(targetLaneId) : undefined;
|
@@ -780,7 +780,13 @@ class LanesMain {
|
|
780
780
|
upToDate: snapsDistance.isUpToDate()
|
781
781
|
};
|
782
782
|
}));
|
783
|
-
|
783
|
+
const isLaneUptoDate = results.every(r => r.upToDate);
|
784
|
+
return {
|
785
|
+
source: sourceLaneId,
|
786
|
+
target: targetLaneId || this.getDefaultLaneId(),
|
787
|
+
upToDate: isLaneUptoDate,
|
788
|
+
componentsStatus: results
|
789
|
+
};
|
784
790
|
}
|
785
791
|
async addLaneReadme(readmeComponentIdStr, laneName) {
|
786
792
|
if (!this.workspace) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ChangeType","LanesMain","constructor","workspace","scope","merging","componentAspect","logger","importer","exporter","componentCompare","getLanes","name","remote","merged","showDefaultLane","notMerged","showMergeData","Boolean","consumer","remoteObj","getRemoteByName","lanes","listLanes","DEFAULT_LANE","defaultLane","getLaneDataOfDefaultLane","legacyScope","getLanesData","push","getCurrentLaneName","getCurrentLaneId","getCurrentLaneNameOrAlias","currentLaneId","trackingData","getLocalTrackedLaneByRemoteName","getCurrentLane","laneId","isDefault","loadLane","getDefaultLaneId","LaneId","from","setCurrentLane","alias","exported","createLane","remoteScope","newLane","createLaneInScope","localLane","remoteLane","throwForInvalidLaneName","defaultScope","trackLaneData","trackLane","scopeJson","setLaneAsNew","onDestroy","id","localName","remoteName","BitError","parseLaneIdFromString","lane","beforeTrackData","getRemoteTrackedDataByLocalLane","beforeTrackDataCloned","undefined","afterTrackData","aliasLane","laneName","includes","LANE_REMOTE_DELIMITER","trackData","laneNameWithoutScope","split","removeTrackLane","changeScope","remoteScopeBefore","newLaneId","saveLane","bitMap","rename","currentName","newName","existingAliasWithNewName","remoteIdStr","objects","remoteLanes","renameRefByNewLaneName","currentLaneName","isExported","isLaneExported","clonedLaneToExport","clone","components","exportErr","exportLane","err","error","toString","message","exportMany","laneObject","ids","BitIds","idsWithFutureScope","allVersions","importLaneObject","persistIfNotExists","scopeComponentImporter","ScopeComponentsImporter","getInstance","results","importLanes","LaneNotFound","exists","getSnapsDistance","componentId","sourceHead","targetHead","Error","modelComponent","getModelComponent","_legacy","getDivergeData","repo","Ref","head","getHeadOnMain","fetchLaneWithItsComponents","debug","importOptions","objectsOnly","verbose","writeConfig","override","installNpmPackages","laneIds","importedIds","importWithOptions","length","removeLanes","laneNames","opts","force","laneResults","switchLanes","merge","getAll","skipDependencyInstallation","mergeStrategy","mergeOptions","Object","keys","MergeOptions","join","switchProps","existingOnWorkspaceOnly","checkoutProps","skipNpmInstall","ignorePackageJson","ignoreDist","isLane","promptMergeOptions","reset","all","LaneSwitcher","switch","isLaneUpToDate","laneToCheck","checkAgainst","upToDateIds","notUpToDateIds","getHashOnAnotherLane","idOnLane","getComponent","modelComp","Promise","map","comp","refOnOtherLane","isEqual","divergeData","isTargetAhead","isDiverged","isSourceAhead","isUpToDate","getDiff","values","diffOptions","pattern","laneDiffGenerator","LaneDiffGenerator","generate","getLaneComponentModels","host","getHost","laneComponentIds","getLaneComponentIds","getMany","laneComponents","bitIdsFromBitmap","getAllBitIdsFromAllLanes","filteredComponentIds","filter","laneComponent","some","bitmapComponentId","isEqualWithoutVersion","legacyIdWithVersion","changeVersion","resolveComponentId","getLaneReadmeComponent","laneReadmeComponent","readmeComponent","laneReadmeComponentId","get","removeLaneReadme","result","readmeComponentId","existingLaneConfig","getSpecificComponentConfig","LanesAspect","remoteLaneIdStr","toLaneId","readme","removeSpecificComponentConfig","addSpecificComponentConfig","setReadmeComponent","write","laneDiff","sourceLaneId","targetLaneId","sourceLane","targetLane","targetLaneIds","toBitIds","headOnTargetLane","searchWithoutVersion","version","snapsDistance","getChangeType","NEW","compare","code","f","status","SOURCE_CODE","fields","NONE","depsFields","field","fieldName","DEPENDENCY","CONFIG","changeType","upToDate","addLaneReadme","readmeComponentIdStr","readmeComponentBitId","bitIds","scopeComponents","list","component","getIdsOfDefaultLane","bitId","isMerged","hash","createRoutePath","deleteRoutePath","provider","cli","graphql","loggerMain","express","createLogger","lanesMain","switchCmd","SwitchCmd","laneCmd","LaneCmd","commands","LaneListCmd","LaneShowCmd","LaneCreateCmd","LaneRemoveCmd","LaneChangeScopeCmd","LaneAliasCmd","LaneRenameCmd","LaneDiffCmd","LaneAddReadmeCmd","LaneRemoveReadmeCmd","LaneImportCmd","register","lanesSchema","LanesCreateRoute","LanesDeleteRoute","CLIAspect","ScopeAspect","WorkspaceAspect","GraphqlAspect","MergingAspect","ComponentAspect","LoggerAspect","ImporterAspect","ExportAspect","ExpressAspect","ComponentCompareAspect","MainRuntime","addRuntime"],"sources":["lanes.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ScopeMain, ScopeAspect } from '@teambit/scope';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { ExpressAspect, ExpressMain } from '@teambit/express';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport getRemoteByName from '@teambit/legacy/dist/remotes/get-remote-by-name';\nimport { LaneDiffCmd, LaneDiffGenerator, LaneDiffResults } from '@teambit/lanes.modules.diff';\nimport { LaneData } from '@teambit/legacy/dist/scope/lanes/lanes';\nimport { LaneId, DEFAULT_LANE, LANE_REMOTE_DELIMITER } from '@teambit/lane-id';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { DiffOptions } from '@teambit/legacy/dist/consumer/component-ops/components-diff';\nimport { MergeStrategy, MergeOptions } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { TrackLane } from '@teambit/legacy/dist/scope/scope-json';\nimport { ImporterAspect, ImporterMain, ImportOptions } from '@teambit/importer';\nimport ComponentAspect, { Component, ComponentID, ComponentMain } from '@teambit/component';\nimport removeLanes from '@teambit/legacy/dist/consumer/lanes/remove-lanes';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { LaneNotFound } from '@teambit/legacy/dist/api/scope/lib/exceptions/lane-not-found';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport { Scope as LegacyScope } from '@teambit/legacy/dist/scope';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { ComponentCompareMain, ComponentCompareAspect } from '@teambit/component-compare';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport { MergingMain, MergingAspect } from '@teambit/merging';\nimport { LanesAspect } from './lanes.aspect';\nimport {\n LaneCmd,\n LaneCreateCmd,\n LaneImportCmd,\n LaneListCmd,\n LaneRemoveCmd,\n LaneShowCmd,\n LaneChangeScopeCmd,\n LaneAliasCmd,\n LaneRenameCmd,\n LaneAddReadmeCmd,\n LaneRemoveReadmeCmd,\n} from './lane.cmd';\nimport { lanesSchema } from './lanes.graphql';\nimport { SwitchCmd } from './switch.cmd';\nimport { LaneSwitcher } from './switch-lanes';\nimport { createLane, createLaneInScope, throwForInvalidLaneName } from './create-lane';\nimport { LanesCreateRoute } from './lanes.create.route';\nimport { LanesDeleteRoute } from './lanes.delete.route';\n\nexport { Lane };\n\nexport type LaneResults = {\n lanes: LaneData[];\n currentLane?: string | null;\n};\n\nexport type CreateLaneOptions = {\n remoteScope?: string; // default to the defaultScope in workspace.jsonc\n alias?: string; // default to the remote name\n};\n\nexport type SwitchLaneOptions = {\n alias?: string;\n merge?: MergeStrategy;\n getAll?: boolean;\n skipDependencyInstallation?: boolean;\n verbose?: boolean;\n override?: boolean;\n};\n\nexport enum ChangeType {\n NONE = 'NONE',\n NEW = 'NEW',\n SOURCE_CODE = 'SOURCE_CODE',\n DEPENDENCY = 'DEPENDENCY',\n CONFIG = 'CONFIG',\n}\n\ntype LaneComponentDiff = {\n componentId: ComponentID;\n changeType: ChangeType;\n upToDate: boolean;\n};\n\nexport class LanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private scope: ScopeMain,\n private merging: MergingMain,\n private componentAspect: ComponentMain,\n public logger: Logger,\n private importer: ImporterMain,\n private exporter: ExportMain,\n private componentCompare: ComponentCompareMain\n ) {}\n\n async getLanes({\n name,\n remote,\n merged,\n showDefaultLane,\n notMerged,\n }: {\n name?: string;\n remote?: string;\n merged?: boolean;\n showDefaultLane?: boolean;\n notMerged?: boolean;\n }): Promise<LaneData[]> {\n const showMergeData = Boolean(merged || notMerged);\n const consumer = this.workspace?.consumer;\n if (remote) {\n const remoteObj = await getRemoteByName(remote, consumer);\n const lanes = await remoteObj.listLanes(name, showMergeData);\n return lanes;\n }\n\n if (name === DEFAULT_LANE) {\n const defaultLane = await this.getLaneDataOfDefaultLane();\n return defaultLane ? [defaultLane] : [];\n }\n\n const lanes = await this.scope.legacyScope.lanes.getLanesData(this.scope.legacyScope, name, showMergeData);\n\n if (showDefaultLane) {\n const defaultLane = await this.getLaneDataOfDefaultLane();\n if (defaultLane) lanes.push(defaultLane);\n }\n\n return lanes;\n }\n\n getCurrentLaneName(): string | null {\n return this.getCurrentLaneId()?.name || null;\n }\n\n getCurrentLaneNameOrAlias(): string | null {\n const currentLaneId = this.getCurrentLaneId();\n if (!currentLaneId) return null;\n const trackingData = this.scope.legacyScope.lanes.getLocalTrackedLaneByRemoteName(\n currentLaneId.name,\n currentLaneId.scope\n );\n return trackingData || currentLaneId.name;\n }\n\n getCurrentLaneId(): LaneId | null {\n if (!this.workspace) return null;\n return this.workspace.consumer.getCurrentLaneId();\n }\n\n /**\n * get the currently checked out lane object, if on main - return null.\n */\n async getCurrentLane(): Promise<Lane | null> {\n const laneId = this.getCurrentLaneId();\n if (!laneId || laneId.isDefault()) return null;\n return this.loadLane(laneId);\n }\n\n getDefaultLaneId(): LaneId {\n return LaneId.from(DEFAULT_LANE, this.scope.name);\n }\n\n setCurrentLane(laneId: LaneId, alias?: string, exported?: boolean) {\n this.workspace?.consumer.setCurrentLane(laneId, exported);\n }\n\n async createLane(name: string, { remoteScope, alias }: CreateLaneOptions = {}): Promise<TrackLane> {\n if (!this.workspace) {\n const newLane = await createLaneInScope(name, this.scope);\n return {\n localLane: newLane.name,\n remoteLane: newLane.name,\n remoteScope: this.scope.name,\n };\n }\n if (alias) {\n throwForInvalidLaneName(alias);\n }\n const scope = remoteScope || this.workspace.defaultScope;\n await createLane(this.workspace.consumer, name, scope);\n const laneId = LaneId.from(name, scope);\n this.setCurrentLane(laneId, alias, false);\n const trackLaneData = {\n localLane: alias || name,\n remoteLane: name,\n remoteScope: scope,\n };\n this.scope.legacyScope.lanes.trackLane(trackLaneData);\n this.scope.legacyScope.scopeJson.setLaneAsNew(name);\n await this.workspace.consumer.onDestroy();\n\n return trackLaneData;\n }\n\n async loadLane(id: LaneId): Promise<Lane | null> {\n return this.scope.legacyScope.lanes.loadLane(id);\n }\n\n async trackLane(\n localName: string,\n remoteScope: string,\n remoteName?: string\n ): Promise<{ beforeTrackData?: TrackLane; afterTrackData: TrackLane }> {\n if (!this.workspace) {\n throw new BitError(`unable to track a lane outside of Bit workspace`);\n }\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(localName);\n const lane = await this.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${localName}\"`);\n }\n const beforeTrackData = this.scope.legacyScope.lanes.getRemoteTrackedDataByLocalLane(localName);\n const beforeTrackDataCloned = beforeTrackData ? { ...beforeTrackData } : undefined;\n const afterTrackData = {\n localLane: localName,\n remoteLane: remoteName || beforeTrackData?.remoteLane || localName,\n remoteScope,\n };\n this.scope.legacyScope.lanes.trackLane(afterTrackData);\n await this.workspace.consumer.onDestroy();\n\n return { beforeTrackData: beforeTrackDataCloned, afterTrackData };\n }\n\n async aliasLane(laneName: string, alias: string): Promise<{ laneId: LaneId }> {\n if (!this.workspace) {\n throw new BitError(`unable to alias a lane outside of Bit workspace`);\n }\n if (alias.includes(LANE_REMOTE_DELIMITER)) {\n throw new BitError(`an alias cannot include a delimiter \"${LANE_REMOTE_DELIMITER}\"`);\n }\n if (alias === laneName) {\n throw new BitError(`an alias cannot be the same as the lane name`);\n }\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(laneName);\n const lane = await this.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${laneName}\"`);\n }\n const trackData = {\n localLane: alias,\n remoteLane: laneId.name,\n remoteScope: laneId.scope,\n };\n const laneNameWithoutScope = laneName.includes(LANE_REMOTE_DELIMITER)\n ? laneName.split(LANE_REMOTE_DELIMITER)[1]\n : laneName;\n this.scope.legacyScope.lanes.removeTrackLane(laneNameWithoutScope);\n this.scope.legacyScope.lanes.trackLane(trackData);\n await this.workspace.consumer.onDestroy();\n\n return { laneId };\n }\n\n async changeScope(laneName: string, remoteScope: string): Promise<{ remoteScopeBefore: string }> {\n if (!this.workspace) {\n throw new BitError(`unable to change-scope of a lane outside of Bit workspace`);\n }\n const laneNameWithoutScope = laneName.includes(LANE_REMOTE_DELIMITER)\n ? laneName.split(LANE_REMOTE_DELIMITER)[1]\n : laneName;\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(laneName);\n const lane = await this.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${laneName}\"`);\n }\n const remoteScopeBefore = lane.scope;\n lane.scope = remoteScope;\n const newLaneId = LaneId.from(laneId.name, remoteScope);\n const trackData = {\n localLane: laneNameWithoutScope,\n remoteLane: laneId.name,\n remoteScope,\n };\n this.scope.legacyScope.lanes.trackLane(trackData);\n await this.scope.legacyScope.lanes.saveLane(lane);\n this.workspace.consumer.bitMap.setCurrentLane(newLaneId, false);\n await this.workspace.consumer.onDestroy();\n\n return { remoteScopeBefore };\n }\n\n /**\n * change a lane-name and if possible, export the lane to the remote\n */\n async rename(currentName: string, newName: string): Promise<{ exported: boolean; exportErr?: Error }> {\n if (!this.workspace) {\n throw new BitError(`unable to rename a lane outside of Bit workspace`);\n }\n throwForInvalidLaneName(newName);\n const existingAliasWithNewName = this.scope.legacyScope.lanes.getRemoteTrackedDataByLocalLane(newName);\n if (existingAliasWithNewName) {\n const remoteIdStr = `${existingAliasWithNewName.remoteLane}/${existingAliasWithNewName.remoteScope}`;\n throw new BitError(`unable to rename to ${newName}. this name is already used to track: ${remoteIdStr}`);\n }\n const laneNameWithoutScope = currentName.includes(LANE_REMOTE_DELIMITER)\n ? currentName.split(LANE_REMOTE_DELIMITER)[1]\n : currentName;\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(currentName);\n const lane = await this.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${currentName}\"`);\n }\n\n // rename the ref file\n await this.scope.legacyScope.objects.remoteLanes.renameRefByNewLaneName(laneNameWithoutScope, newName, lane.scope);\n\n // change tracking data\n const afterTrackData = {\n localLane: newName,\n remoteLane: newName,\n remoteScope: lane.scope,\n };\n this.scope.legacyScope.lanes.trackLane(afterTrackData);\n this.scope.legacyScope.lanes.removeTrackLane(laneNameWithoutScope);\n\n // change the lane object\n lane.name = newName;\n await this.scope.legacyScope.lanes.saveLane(lane);\n\n // change current-lane if needed\n const currentLaneName = this.getCurrentLaneName();\n if (currentLaneName === laneNameWithoutScope) {\n const newLaneId = LaneId.from(newName, lane.scope);\n const isExported = this.workspace.consumer.bitMap.isLaneExported;\n this.setCurrentLane(newLaneId, undefined, isExported);\n }\n\n // export the lane with only the name-change\n const clonedLaneToExport = lane.clone();\n clonedLaneToExport.components = []; // otherwise, it'll export the changes done on the components.\n let exported = false;\n let exportErr: Error | undefined;\n try {\n await this.exportLane(clonedLaneToExport);\n exported = true;\n } catch (err: any) {\n this.logger.error(`unable to export ${lane.id.toString()}: ${err.message}`);\n exportErr = err;\n }\n\n await this.workspace.consumer.onDestroy();\n\n return { exported, exportErr };\n }\n\n async exportLane(lane: Lane) {\n await this.exporter.exportMany({\n scope: this.scope.legacyScope,\n laneObject: lane,\n ids: new BitIds(),\n idsWithFutureScope: new BitIds(),\n allVersions: false,\n });\n }\n\n /**\n * get a Lane object from the remote.\n * `persistIfNotExists` saves the object in the local scope only if the lane is not there yet.\n * otherwise, it needs some merging mechanism, which is done differently whether it's export or import.\n * see `sources.mergeLane()` for export and `import-components._saveLaneDataIfNeeded()` for import.\n * in this case, because we only bring the lane object and not the components, it's not easy to do the merge.\n */\n async importLaneObject(laneId: LaneId, persistIfNotExists = true): Promise<Lane> {\n const legacyScope = this.scope.legacyScope;\n const scopeComponentImporter = ScopeComponentsImporter.getInstance(legacyScope);\n const results = await scopeComponentImporter.importLanes([laneId]);\n const laneObject = results[0];\n if (!laneObject) throw new LaneNotFound(laneId.scope, laneId.name);\n\n if (persistIfNotExists) {\n const exists = await legacyScope.loadLane(laneId);\n if (!exists) {\n await legacyScope.lanes.saveLane(laneObject);\n }\n }\n\n return laneObject;\n }\n\n /**\n * get the distance for a component between two lanes. for example, lane-b forked from lane-a and lane-b added some new snaps\n * @param componentId\n * @param sourceHead head on the source lane. leave empty if the source is main\n * @param targetHead head on the target lane. leave empty if the target is main\n * @returns\n */\n async getSnapsDistance(componentId: ComponentID, sourceHead?: string, targetHead?: string): Promise<SnapsDistance> {\n if (!sourceHead && !targetHead)\n throw new Error(`getDivergeData got sourceHead and targetHead empty. at least one of them should be populated`);\n const modelComponent = await this.scope.legacyScope.getModelComponent(componentId._legacy);\n return getDivergeData({\n modelComponent,\n repo: this.scope.legacyScope.objects,\n sourceHead: sourceHead ? Ref.from(sourceHead) : modelComponent.head || null,\n targetHead: targetHead ? Ref.from(targetHead) : modelComponent.head || null,\n });\n }\n\n /**\n * get the head hash (snap) of main. return undefined if the component exists only on a lane and was never merged to main\n */\n async getHeadOnMain(componentId: ComponentID): Promise<string | undefined> {\n const modelComponent = await this.scope.legacyScope.getModelComponent(componentId._legacy);\n return modelComponent.head?.toString();\n }\n\n /**\n * fetch the lane object and its components from the remote.\n * save the objects to the local scope.\n * this method doesn't change anything in the workspace.\n */\n async fetchLaneWithItsComponents(laneId: LaneId): Promise<Lane> {\n this.logger.debug(`fetching lane ${laneId.toString()}`);\n if (!this.workspace) {\n throw new BitError('unable to fetch lanes outside of Bit workspace');\n }\n const lane = await this.importLaneObject(laneId);\n if (!lane) throw new Error(`unable to import lane ${laneId.toString()} from the remote`);\n const importOptions: ImportOptions = {\n ids: [],\n objectsOnly: true,\n verbose: false,\n writeConfig: false,\n override: false,\n installNpmPackages: false,\n lanes: { laneIds: [laneId], lanes: [lane] },\n };\n const { importedIds } = await this.importer.importWithOptions(importOptions);\n this.logger.debug(`fetching lane ${laneId.toString()} done, fetched ${importedIds.length} components`);\n return lane;\n }\n\n async removeLanes(laneNames: string[], opts?: { remote: boolean; force: boolean }): Promise<string[]> {\n if (!this.workspace && !opts?.remote) {\n await this.scope.legacyScope.lanes.removeLanes(this.scope.legacyScope, laneNames, true);\n return laneNames;\n }\n const results = await removeLanes(this.workspace?.consumer, laneNames, !!opts?.remote, !!opts?.force);\n if (this.workspace) await this.workspace.consumer.onDestroy();\n\n return results.laneResults;\n }\n\n /**\n * switch to a different local or remote lane.\n * switching to a remote lane also imports and writes the components of that remote lane.\n * by default, only the components existing on the workspace will be imported from that lane, unless the \"getAll\"\n * flag is true.\n */\n async switchLanes(\n laneName: string,\n { alias, merge, getAll = false, skipDependencyInstallation = false }: SwitchLaneOptions\n ) {\n if (!this.workspace) {\n throw new BitError(`unable to switch lanes outside of Bit workspace`);\n }\n let mergeStrategy;\n if (merge && typeof merge === 'string') {\n const mergeOptions = Object.keys(MergeOptions);\n if (!mergeOptions.includes(merge)) {\n throw new BitError(`merge must be one of the following: ${mergeOptions.join(', ')}`);\n }\n mergeStrategy = merge;\n }\n if (alias) {\n throwForInvalidLaneName(alias);\n }\n\n const switchProps = {\n laneName,\n existingOnWorkspaceOnly: !getAll,\n alias,\n };\n const checkoutProps = {\n mergeStrategy,\n skipNpmInstall: skipDependencyInstallation,\n verbose: false, // not relevant in Harmony\n ignorePackageJson: true, // not relevant in Harmony\n ignoreDist: true, // not relevant in Harmony\n isLane: true,\n promptMergeOptions: false,\n writeConfig: false,\n reset: false,\n all: false,\n };\n return new LaneSwitcher(this.workspace, this.logger, switchProps, checkoutProps, this).switch();\n }\n\n /**\n * check whether the given lane is up-to-date against \"checkAgainst\", if this param is null, it checks it against main.\n */\n async isLaneUpToDate(laneToCheck: Lane, checkAgainst?: Lane): Promise<boolean> {\n const upToDateIds: BitId[] = [];\n const notUpToDateIds: BitId[] = [];\n const getHashOnAnotherLane = async (id: BitId): Promise<Ref | undefined> => {\n if (checkAgainst) {\n const idOnLane = checkAgainst.getComponent(id);\n return idOnLane?.head;\n }\n const modelComp = await this.scope.legacyScope.getModelComponent(id);\n return modelComp.head;\n };\n await Promise.all(\n laneToCheck.components.map(async (comp) => {\n const refOnOtherLane = await getHashOnAnotherLane(comp.id);\n if (!refOnOtherLane) {\n upToDateIds.push(comp.id);\n return;\n }\n if (comp.head.isEqual(refOnOtherLane)) {\n upToDateIds.push(comp.id);\n return;\n }\n const modelComponent = await this.scope.legacyScope.getModelComponent(comp.id);\n const divergeData = await getDivergeData({\n repo: this.scope.legacyScope.objects,\n modelComponent,\n sourceHead: comp.head,\n targetHead: refOnOtherLane,\n });\n if (divergeData.isTargetAhead() || divergeData.isDiverged()) {\n notUpToDateIds.push(comp.id);\n return;\n }\n if (!divergeData.isSourceAhead()) {\n throw new Error(\n `invalid state - component ${comp.id.toString()} is not diverged, not local-ahead and not-remote-ahead.`\n );\n }\n upToDateIds.push(comp.id);\n })\n );\n\n const isUpToDate = !notUpToDateIds.length;\n\n return isUpToDate;\n }\n\n /**\n * the values array may include zero to two values and will be processed as following:\n * [] => diff between the current lane and default lane. (only inside workspace).\n * [to] => diff between the current lane (or default-lane when in scope) and \"to\" lane.\n * [from, to] => diff between \"from\" lane and \"to\" lane.\n */\n public async getDiff(values: string[], diffOptions: DiffOptions = {}, pattern?: string): Promise<LaneDiffResults> {\n const laneDiffGenerator = new LaneDiffGenerator(this.workspace, this.scope);\n return laneDiffGenerator.generate(values, diffOptions, pattern);\n }\n\n async getLaneComponentModels(lane: LaneData): Promise<Component[]> {\n const host = this.componentAspect.getHost();\n const laneComponentIds = await this.getLaneComponentIds(lane);\n const components = await host.getMany(laneComponentIds);\n return components;\n }\n\n async getLaneComponentIds(lane: LaneData): Promise<ComponentID[]> {\n if (!lane) return [];\n\n const laneComponents = lane.components;\n const workspace = this.workspace;\n const bitIdsFromBitmap = workspace ? workspace.consumer.bitMap.getAllBitIdsFromAllLanes() : [];\n\n const filteredComponentIds = workspace\n ? laneComponents.filter((laneComponent) =>\n bitIdsFromBitmap.some((bitmapComponentId) => bitmapComponentId.isEqualWithoutVersion(laneComponent.id))\n )\n : laneComponents;\n\n const host = this.componentAspect.getHost();\n\n return Promise.all(\n filteredComponentIds.map((laneComponent) => {\n const legacyIdWithVersion = laneComponent.id.changeVersion(laneComponent.head);\n return host.resolveComponentId(legacyIdWithVersion);\n })\n );\n }\n\n async getLaneReadmeComponent(lane: LaneData): Promise<Component | undefined> {\n if (!lane) return undefined;\n const laneReadmeComponent = lane.readmeComponent;\n if (!laneReadmeComponent) return undefined;\n const host = this.componentAspect.getHost();\n const laneReadmeComponentId = await host.resolveComponentId(\n laneReadmeComponent.id.changeVersion(laneReadmeComponent.head)\n );\n const readmeComponent = await host.get(laneReadmeComponentId);\n return readmeComponent;\n }\n\n async removeLaneReadme(laneName?: string): Promise<{ result: boolean; message?: string }> {\n if (!this.workspace) {\n throw new BitError('unable to remove the lane readme component outside of Bit workspace');\n }\n const currentLaneName = this.getCurrentLaneName();\n\n if (!laneName && !currentLaneName) {\n return {\n result: false,\n message: 'unable to remove the lane readme component. Either pass a laneName or switch to a lane',\n };\n }\n\n const scope: LegacyScope = this.workspace.scope.legacyScope;\n const laneId: LaneId = laneName\n ? await scope.lanes.parseLaneIdFromString(laneName)\n : (this.getCurrentLaneId() as LaneId);\n const lane: Lane | null | undefined = await scope.loadLane(laneId);\n\n if (!lane?.readmeComponent) {\n throw new BitError(`there is no readme component added to the lane ${laneName || currentLaneName}`);\n }\n\n const readmeComponentId = await this.workspace.resolveComponentId(lane.readmeComponent.id);\n const existingLaneConfig =\n (await this.workspace.getSpecificComponentConfig(readmeComponentId, LanesAspect.id)) || {};\n\n const remoteLaneIdStr = lane.toLaneId().toString();\n\n if (existingLaneConfig.readme) {\n delete existingLaneConfig.readme[remoteLaneIdStr];\n await this.workspace.removeSpecificComponentConfig(readmeComponentId, LanesAspect.id, false);\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, existingLaneConfig);\n }\n\n lane.setReadmeComponent(undefined);\n await scope.lanes.saveLane(lane);\n await this.workspace.bitMap.write();\n\n return { result: true };\n }\n\n async laneDiff(sourceLaneId: LaneId, targetLaneId?: LaneId): Promise<LaneComponentDiff[]> {\n const sourceLane = await this.loadLane(sourceLaneId);\n if (!sourceLane) throw new Error(`unable to find ${sourceLaneId.toString()} in the scope`);\n const targetLane = targetLaneId ? await this.loadLane(targetLaneId) : undefined;\n const targetLaneIds = targetLane?.toBitIds();\n const host = this.componentAspect.getHost();\n const results = await Promise.all(\n sourceLane.components.map(async (comp) => {\n const componentId = await host.resolveComponentId(comp.id);\n const headOnTargetLane = targetLaneIds\n ? targetLaneIds.searchWithoutVersion(comp.id)?.version\n : await this.getHeadOnMain(componentId);\n const snapsDistance = await this.getSnapsDistance(componentId, comp.head.toString(), headOnTargetLane);\n const getChangeType = async (): Promise<ChangeType> => {\n if (!headOnTargetLane) return ChangeType.NEW;\n const compare = await this.componentCompare.compare(\n comp.id.changeVersion(comp.head.toString()).toString(),\n comp.id.changeVersion(headOnTargetLane).toString()\n );\n if (compare.code.length && compare.code.some((f) => f.status !== 'UNCHANGED')) {\n return ChangeType.SOURCE_CODE;\n }\n if (!compare.fields.length) return ChangeType.NONE;\n const depsFields = ['dependencies', 'devDependencies', 'extensionDependencies'];\n if (compare.fields.some((field) => depsFields.includes(field.fieldName))) return ChangeType.DEPENDENCY;\n return ChangeType.CONFIG;\n };\n const changeType = await getChangeType();\n return { componentId, changeType, upToDate: snapsDistance.isUpToDate() };\n })\n );\n\n return results;\n }\n\n async addLaneReadme(readmeComponentIdStr: string, laneName?: string): Promise<{ result: boolean; message?: string }> {\n if (!this.workspace) {\n throw new BitError(`unable to track a lane readme component outside of Bit workspace`);\n }\n const readmeComponentId = await this.workspace.resolveComponentId(readmeComponentIdStr);\n\n const readmeComponentBitId = readmeComponentId._legacy;\n const scope: LegacyScope = this.workspace.scope.legacyScope;\n const laneId: LaneId = laneName\n ? await scope.lanes.parseLaneIdFromString(laneName)\n : (this.getCurrentLaneId() as LaneId);\n\n const lane: Lane | null | undefined = await scope.loadLane(laneId);\n\n if (!lane) {\n return { result: false, message: `cannot find lane ${laneName}` };\n }\n\n lane.setReadmeComponent(readmeComponentBitId);\n await scope.lanes.saveLane(lane);\n\n const existingLaneConfig =\n (await this.workspace.getSpecificComponentConfig(readmeComponentId, LanesAspect.id)) || {};\n\n const remoteLaneIdStr = lane.toLaneId().toString();\n\n if (existingLaneConfig.readme) {\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, {\n ...existingLaneConfig,\n readme: {\n ...existingLaneConfig.readme,\n [remoteLaneIdStr]: true,\n },\n });\n } else {\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, {\n ...existingLaneConfig,\n readme: {\n [remoteLaneIdStr]: true,\n },\n });\n }\n await this.workspace.bitMap.write();\n return { result: true };\n }\n\n private async getLaneDataOfDefaultLane(): Promise<LaneData | null> {\n const consumer = this.workspace?.consumer;\n let bitIds: BitId[] = [];\n if (!consumer) {\n const scopeComponents = await this.scope.list();\n bitIds = scopeComponents.filter((component) => component.head).map((component) => component.id._legacy);\n } else {\n bitIds = await consumer.getIdsOfDefaultLane();\n }\n\n return {\n name: DEFAULT_LANE,\n remote: null,\n id: this.getDefaultLaneId(),\n components: bitIds.map((bitId) => ({ id: bitId, head: bitId.version as string })),\n isMerged: null,\n hash: '',\n };\n }\n\n get createRoutePath() {\n return '/lanes/create';\n }\n\n get deleteRoutePath() {\n return '/lanes/delete';\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n ScopeAspect,\n WorkspaceAspect,\n GraphqlAspect,\n MergingAspect,\n ComponentAspect,\n LoggerAspect,\n ImporterAspect,\n ExportAspect,\n ExpressAspect,\n ComponentCompareAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n cli,\n scope,\n workspace,\n graphql,\n merging,\n component,\n loggerMain,\n importer,\n exporter,\n express,\n componentCompare,\n ]: [\n CLIMain,\n ScopeMain,\n Workspace,\n GraphqlMain,\n MergingMain,\n ComponentMain,\n LoggerMain,\n ImporterMain,\n ExportMain,\n ExpressMain,\n ComponentCompareMain\n ]) {\n const logger = loggerMain.createLogger(LanesAspect.id);\n const lanesMain = new LanesMain(workspace, scope, merging, component, logger, importer, exporter, componentCompare);\n const switchCmd = new SwitchCmd(lanesMain);\n const laneCmd = new LaneCmd(lanesMain, workspace, scope);\n laneCmd.commands = [\n new LaneListCmd(lanesMain, workspace, scope),\n switchCmd,\n new LaneShowCmd(lanesMain, workspace, scope),\n new LaneCreateCmd(lanesMain),\n new LaneRemoveCmd(lanesMain),\n new LaneChangeScopeCmd(lanesMain),\n new LaneAliasCmd(lanesMain),\n new LaneRenameCmd(lanesMain),\n new LaneDiffCmd(workspace, scope),\n new LaneAddReadmeCmd(lanesMain),\n new LaneRemoveReadmeCmd(lanesMain),\n new LaneImportCmd(switchCmd),\n ];\n cli.register(laneCmd, switchCmd);\n graphql.register(lanesSchema(lanesMain));\n express.register([new LanesCreateRoute(lanesMain, logger), new LanesDeleteRoute(lanesMain, logger)]);\n return lanesMain;\n }\n}\n\nLanesAspect.addRuntime(LanesMain);\n\nexport default LanesMain;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IA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,MAAM,CAAC,EAAE,KAAImS,+BAAgB,EAACpB,SAAS,EAAE/Q,MAAM,CAAC,CAAC,CAAC;IACpG,OAAO+Q,SAAS;EAClB;AACF;AAAC;AAAA,gCAptBYrR,SAAS,WAqpBL,EAAE;AAAA,gCArpBNA,SAAS,kBAspBE,CACpB0S,gBAAS,EACTC,oBAAW,EACXC,4BAAe,EACfC,wBAAa,EACbC,wBAAa,EACbC,oBAAe,EACfC,sBAAY,EACZC,0BAAc,EACdC,sBAAY,EACZC,wBAAa,EACbC,0CAAsB,CACvB;AAAA,gCAlqBUpT,SAAS,aAmqBHqT,kBAAW;AAmD9BtF,oBAAW,CAACuF,UAAU,CAACtT,SAAS,CAAC;AAAC,eAEnBA,SAAS;AAAA"}
|
1
|
+
{"version":3,"names":["ChangeType","LanesMain","constructor","workspace","scope","merging","componentAspect","logger","importer","exporter","componentCompare","getLanes","name","remote","merged","showDefaultLane","notMerged","showMergeData","Boolean","consumer","remoteObj","getRemoteByName","lanes","listLanes","DEFAULT_LANE","defaultLane","getLaneDataOfDefaultLane","legacyScope","getLanesData","push","getCurrentLaneName","getCurrentLaneId","getCurrentLaneNameOrAlias","currentLaneId","trackingData","getLocalTrackedLaneByRemoteName","getCurrentLane","laneId","isDefault","loadLane","getDefaultLaneId","LaneId","from","setCurrentLane","alias","exported","createLane","remoteScope","newLane","createLaneInScope","localLane","remoteLane","throwForInvalidLaneName","defaultScope","trackLaneData","trackLane","scopeJson","setLaneAsNew","onDestroy","id","localName","remoteName","BitError","parseLaneIdFromString","lane","beforeTrackData","getRemoteTrackedDataByLocalLane","beforeTrackDataCloned","undefined","afterTrackData","aliasLane","laneName","includes","LANE_REMOTE_DELIMITER","trackData","laneNameWithoutScope","split","removeTrackLane","changeScope","remoteScopeBefore","newLaneId","saveLane","bitMap","rename","currentName","newName","existingAliasWithNewName","remoteIdStr","objects","remoteLanes","renameRefByNewLaneName","currentLaneName","isExported","isLaneExported","clonedLaneToExport","clone","components","exportErr","exportLane","err","error","toString","message","exportMany","laneObject","ids","BitIds","idsWithFutureScope","allVersions","importLaneObject","persistIfNotExists","scopeComponentImporter","ScopeComponentsImporter","getInstance","results","importLanes","LaneNotFound","exists","getSnapsDistance","componentId","sourceHead","targetHead","Error","modelComponent","getModelComponent","_legacy","getDivergeData","repo","Ref","head","getHeadOnMain","fetchLaneWithItsComponents","debug","importOptions","objectsOnly","verbose","writeConfig","override","installNpmPackages","laneIds","importedIds","importWithOptions","length","removeLanes","laneNames","opts","force","laneResults","switchLanes","merge","getAll","skipDependencyInstallation","mergeStrategy","mergeOptions","Object","keys","MergeOptions","join","switchProps","existingOnWorkspaceOnly","checkoutProps","skipNpmInstall","ignorePackageJson","ignoreDist","isLane","promptMergeOptions","reset","all","LaneSwitcher","switch","isLaneUpToDate","laneToCheck","checkAgainst","upToDateIds","notUpToDateIds","getHashOnAnotherLane","idOnLane","getComponent","modelComp","Promise","map","comp","refOnOtherLane","isEqual","divergeData","isTargetAhead","isDiverged","isSourceAhead","isUpToDate","getDiff","values","diffOptions","pattern","laneDiffGenerator","LaneDiffGenerator","generate","getLaneComponentModels","host","getHost","laneComponentIds","getLaneComponentIds","getMany","laneComponents","bitIdsFromBitmap","getAllBitIdsFromAllLanes","filteredComponentIds","filter","laneComponent","some","bitmapComponentId","isEqualWithoutVersion","legacyIdWithVersion","changeVersion","resolveComponentId","getLaneReadmeComponent","laneReadmeComponent","readmeComponent","laneReadmeComponentId","get","removeLaneReadme","result","readmeComponentId","existingLaneConfig","getSpecificComponentConfig","LanesAspect","remoteLaneIdStr","toLaneId","readme","removeSpecificComponentConfig","addSpecificComponentConfig","setReadmeComponent","write","diffStatus","sourceLaneId","targetLaneId","sourceLane","targetLane","targetLaneIds","toBitIds","headOnTargetLane","searchWithoutVersion","version","snapsDistance","getChangeType","NEW","compare","code","f","status","SOURCE_CODE","fields","NONE","depsFields","field","fieldName","DEPENDENCY","CONFIG","changeType","upToDate","isLaneUptoDate","every","r","source","target","componentsStatus","addLaneReadme","readmeComponentIdStr","readmeComponentBitId","bitIds","scopeComponents","list","component","getIdsOfDefaultLane","bitId","isMerged","hash","createRoutePath","deleteRoutePath","provider","cli","graphql","loggerMain","express","createLogger","lanesMain","switchCmd","SwitchCmd","laneCmd","LaneCmd","commands","LaneListCmd","LaneShowCmd","LaneCreateCmd","LaneRemoveCmd","LaneChangeScopeCmd","LaneAliasCmd","LaneRenameCmd","LaneDiffCmd","LaneAddReadmeCmd","LaneRemoveReadmeCmd","LaneImportCmd","register","lanesSchema","LanesCreateRoute","LanesDeleteRoute","CLIAspect","ScopeAspect","WorkspaceAspect","GraphqlAspect","MergingAspect","ComponentAspect","LoggerAspect","ImporterAspect","ExportAspect","ExpressAspect","ComponentCompareAspect","MainRuntime","addRuntime"],"sources":["lanes.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ScopeMain, ScopeAspect } from '@teambit/scope';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { ExpressAspect, ExpressMain } from '@teambit/express';\nimport { Workspace, WorkspaceAspect } from '@teambit/workspace';\nimport getRemoteByName from '@teambit/legacy/dist/remotes/get-remote-by-name';\nimport { LaneDiffCmd, LaneDiffGenerator, LaneDiffResults } from '@teambit/lanes.modules.diff';\nimport { LaneData } from '@teambit/legacy/dist/scope/lanes/lanes';\nimport { LaneId, DEFAULT_LANE, LANE_REMOTE_DELIMITER } from '@teambit/lane-id';\nimport { BitError } from '@teambit/bit-error';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { DiffOptions } from '@teambit/legacy/dist/consumer/component-ops/components-diff';\nimport { MergeStrategy, MergeOptions } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport { TrackLane } from '@teambit/legacy/dist/scope/scope-json';\nimport { ImporterAspect, ImporterMain, ImportOptions } from '@teambit/importer';\nimport ComponentAspect, { Component, ComponentID, ComponentMain } from '@teambit/component';\nimport removeLanes from '@teambit/legacy/dist/consumer/lanes/remove-lanes';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { LaneNotFound } from '@teambit/legacy/dist/api/scope/lib/exceptions/lane-not-found';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport ScopeComponentsImporter from '@teambit/legacy/dist/scope/component-ops/scope-components-importer';\nimport { Scope as LegacyScope } from '@teambit/legacy/dist/scope';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport { ExportAspect, ExportMain } from '@teambit/export';\nimport { BitIds } from '@teambit/legacy/dist/bit-id';\nimport { ComponentCompareMain, ComponentCompareAspect } from '@teambit/component-compare';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport { MergingMain, MergingAspect } from '@teambit/merging';\nimport { LanesAspect } from './lanes.aspect';\nimport {\n LaneCmd,\n LaneCreateCmd,\n LaneImportCmd,\n LaneListCmd,\n LaneRemoveCmd,\n LaneShowCmd,\n LaneChangeScopeCmd,\n LaneAliasCmd,\n LaneRenameCmd,\n LaneAddReadmeCmd,\n LaneRemoveReadmeCmd,\n} from './lane.cmd';\nimport { lanesSchema } from './lanes.graphql';\nimport { SwitchCmd } from './switch.cmd';\nimport { LaneSwitcher } from './switch-lanes';\nimport { createLane, createLaneInScope, throwForInvalidLaneName } from './create-lane';\nimport { LanesCreateRoute } from './lanes.create.route';\nimport { LanesDeleteRoute } from './lanes.delete.route';\n\nexport { Lane };\n\nexport type LaneResults = {\n lanes: LaneData[];\n currentLane?: string | null;\n};\n\nexport type CreateLaneOptions = {\n remoteScope?: string; // default to the defaultScope in workspace.jsonc\n alias?: string; // default to the remote name\n};\n\nexport type SwitchLaneOptions = {\n alias?: string;\n merge?: MergeStrategy;\n getAll?: boolean;\n skipDependencyInstallation?: boolean;\n verbose?: boolean;\n override?: boolean;\n};\n\nexport enum ChangeType {\n NONE = 'NONE',\n NEW = 'NEW',\n SOURCE_CODE = 'SOURCE_CODE',\n DEPENDENCY = 'DEPENDENCY',\n CONFIG = 'CONFIG',\n}\n\nexport type LaneComponentDiffStatus = {\n componentId: ComponentID;\n changeType: ChangeType;\n upToDate: boolean;\n};\n\nexport type LaneDiffStatus = {\n upToDate: boolean;\n source: LaneId;\n target: LaneId;\n componentsStatus: LaneComponentDiffStatus[];\n};\n\nexport class LanesMain {\n constructor(\n private workspace: Workspace | undefined,\n private scope: ScopeMain,\n private merging: MergingMain,\n private componentAspect: ComponentMain,\n public logger: Logger,\n private importer: ImporterMain,\n private exporter: ExportMain,\n private componentCompare: ComponentCompareMain\n ) {}\n\n async getLanes({\n name,\n remote,\n merged,\n showDefaultLane,\n notMerged,\n }: {\n name?: string;\n remote?: string;\n merged?: boolean;\n showDefaultLane?: boolean;\n notMerged?: boolean;\n }): Promise<LaneData[]> {\n const showMergeData = Boolean(merged || notMerged);\n const consumer = this.workspace?.consumer;\n if (remote) {\n const remoteObj = await getRemoteByName(remote, consumer);\n const lanes = await remoteObj.listLanes(name, showMergeData);\n return lanes;\n }\n\n if (name === DEFAULT_LANE) {\n const defaultLane = await this.getLaneDataOfDefaultLane();\n return defaultLane ? [defaultLane] : [];\n }\n\n const lanes = await this.scope.legacyScope.lanes.getLanesData(this.scope.legacyScope, name, showMergeData);\n\n if (showDefaultLane) {\n const defaultLane = await this.getLaneDataOfDefaultLane();\n if (defaultLane) lanes.push(defaultLane);\n }\n\n return lanes;\n }\n\n getCurrentLaneName(): string | null {\n return this.getCurrentLaneId()?.name || null;\n }\n\n getCurrentLaneNameOrAlias(): string | null {\n const currentLaneId = this.getCurrentLaneId();\n if (!currentLaneId) return null;\n const trackingData = this.scope.legacyScope.lanes.getLocalTrackedLaneByRemoteName(\n currentLaneId.name,\n currentLaneId.scope\n );\n return trackingData || currentLaneId.name;\n }\n\n getCurrentLaneId(): LaneId | null {\n if (!this.workspace) return null;\n return this.workspace.consumer.getCurrentLaneId();\n }\n\n /**\n * get the currently checked out lane object, if on main - return null.\n */\n async getCurrentLane(): Promise<Lane | null> {\n const laneId = this.getCurrentLaneId();\n if (!laneId || laneId.isDefault()) return null;\n return this.loadLane(laneId);\n }\n\n getDefaultLaneId(): LaneId {\n return LaneId.from(DEFAULT_LANE, this.scope.name);\n }\n\n setCurrentLane(laneId: LaneId, alias?: string, exported?: boolean) {\n this.workspace?.consumer.setCurrentLane(laneId, exported);\n }\n\n async createLane(name: string, { remoteScope, alias }: CreateLaneOptions = {}): Promise<TrackLane> {\n if (!this.workspace) {\n const newLane = await createLaneInScope(name, this.scope);\n return {\n localLane: newLane.name,\n remoteLane: newLane.name,\n remoteScope: this.scope.name,\n };\n }\n if (alias) {\n throwForInvalidLaneName(alias);\n }\n const scope = remoteScope || this.workspace.defaultScope;\n await createLane(this.workspace.consumer, name, scope);\n const laneId = LaneId.from(name, scope);\n this.setCurrentLane(laneId, alias, false);\n const trackLaneData = {\n localLane: alias || name,\n remoteLane: name,\n remoteScope: scope,\n };\n this.scope.legacyScope.lanes.trackLane(trackLaneData);\n this.scope.legacyScope.scopeJson.setLaneAsNew(name);\n await this.workspace.consumer.onDestroy();\n\n return trackLaneData;\n }\n\n async loadLane(id: LaneId): Promise<Lane | null> {\n return this.scope.legacyScope.lanes.loadLane(id);\n }\n\n async trackLane(\n localName: string,\n remoteScope: string,\n remoteName?: string\n ): Promise<{ beforeTrackData?: TrackLane; afterTrackData: TrackLane }> {\n if (!this.workspace) {\n throw new BitError(`unable to track a lane outside of Bit workspace`);\n }\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(localName);\n const lane = await this.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${localName}\"`);\n }\n const beforeTrackData = this.scope.legacyScope.lanes.getRemoteTrackedDataByLocalLane(localName);\n const beforeTrackDataCloned = beforeTrackData ? { ...beforeTrackData } : undefined;\n const afterTrackData = {\n localLane: localName,\n remoteLane: remoteName || beforeTrackData?.remoteLane || localName,\n remoteScope,\n };\n this.scope.legacyScope.lanes.trackLane(afterTrackData);\n await this.workspace.consumer.onDestroy();\n\n return { beforeTrackData: beforeTrackDataCloned, afterTrackData };\n }\n\n async aliasLane(laneName: string, alias: string): Promise<{ laneId: LaneId }> {\n if (!this.workspace) {\n throw new BitError(`unable to alias a lane outside of Bit workspace`);\n }\n if (alias.includes(LANE_REMOTE_DELIMITER)) {\n throw new BitError(`an alias cannot include a delimiter \"${LANE_REMOTE_DELIMITER}\"`);\n }\n if (alias === laneName) {\n throw new BitError(`an alias cannot be the same as the lane name`);\n }\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(laneName);\n const lane = await this.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${laneName}\"`);\n }\n const trackData = {\n localLane: alias,\n remoteLane: laneId.name,\n remoteScope: laneId.scope,\n };\n const laneNameWithoutScope = laneName.includes(LANE_REMOTE_DELIMITER)\n ? laneName.split(LANE_REMOTE_DELIMITER)[1]\n : laneName;\n this.scope.legacyScope.lanes.removeTrackLane(laneNameWithoutScope);\n this.scope.legacyScope.lanes.trackLane(trackData);\n await this.workspace.consumer.onDestroy();\n\n return { laneId };\n }\n\n async changeScope(laneName: string, remoteScope: string): Promise<{ remoteScopeBefore: string }> {\n if (!this.workspace) {\n throw new BitError(`unable to change-scope of a lane outside of Bit workspace`);\n }\n const laneNameWithoutScope = laneName.includes(LANE_REMOTE_DELIMITER)\n ? laneName.split(LANE_REMOTE_DELIMITER)[1]\n : laneName;\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(laneName);\n const lane = await this.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${laneName}\"`);\n }\n const remoteScopeBefore = lane.scope;\n lane.scope = remoteScope;\n const newLaneId = LaneId.from(laneId.name, remoteScope);\n const trackData = {\n localLane: laneNameWithoutScope,\n remoteLane: laneId.name,\n remoteScope,\n };\n this.scope.legacyScope.lanes.trackLane(trackData);\n await this.scope.legacyScope.lanes.saveLane(lane);\n this.workspace.consumer.bitMap.setCurrentLane(newLaneId, false);\n await this.workspace.consumer.onDestroy();\n\n return { remoteScopeBefore };\n }\n\n /**\n * change a lane-name and if possible, export the lane to the remote\n */\n async rename(currentName: string, newName: string): Promise<{ exported: boolean; exportErr?: Error }> {\n if (!this.workspace) {\n throw new BitError(`unable to rename a lane outside of Bit workspace`);\n }\n throwForInvalidLaneName(newName);\n const existingAliasWithNewName = this.scope.legacyScope.lanes.getRemoteTrackedDataByLocalLane(newName);\n if (existingAliasWithNewName) {\n const remoteIdStr = `${existingAliasWithNewName.remoteLane}/${existingAliasWithNewName.remoteScope}`;\n throw new BitError(`unable to rename to ${newName}. this name is already used to track: ${remoteIdStr}`);\n }\n const laneNameWithoutScope = currentName.includes(LANE_REMOTE_DELIMITER)\n ? currentName.split(LANE_REMOTE_DELIMITER)[1]\n : currentName;\n const laneId = await this.scope.legacyScope.lanes.parseLaneIdFromString(currentName);\n const lane = await this.loadLane(laneId);\n if (!lane) {\n throw new BitError(`unable to find a local lane \"${currentName}\"`);\n }\n\n // rename the ref file\n await this.scope.legacyScope.objects.remoteLanes.renameRefByNewLaneName(laneNameWithoutScope, newName, lane.scope);\n\n // change tracking data\n const afterTrackData = {\n localLane: newName,\n remoteLane: newName,\n remoteScope: lane.scope,\n };\n this.scope.legacyScope.lanes.trackLane(afterTrackData);\n this.scope.legacyScope.lanes.removeTrackLane(laneNameWithoutScope);\n\n // change the lane object\n lane.name = newName;\n await this.scope.legacyScope.lanes.saveLane(lane);\n\n // change current-lane if needed\n const currentLaneName = this.getCurrentLaneName();\n if (currentLaneName === laneNameWithoutScope) {\n const newLaneId = LaneId.from(newName, lane.scope);\n const isExported = this.workspace.consumer.bitMap.isLaneExported;\n this.setCurrentLane(newLaneId, undefined, isExported);\n }\n\n // export the lane with only the name-change\n const clonedLaneToExport = lane.clone();\n clonedLaneToExport.components = []; // otherwise, it'll export the changes done on the components.\n let exported = false;\n let exportErr: Error | undefined;\n try {\n await this.exportLane(clonedLaneToExport);\n exported = true;\n } catch (err: any) {\n this.logger.error(`unable to export ${lane.id.toString()}: ${err.message}`);\n exportErr = err;\n }\n\n await this.workspace.consumer.onDestroy();\n\n return { exported, exportErr };\n }\n\n async exportLane(lane: Lane) {\n await this.exporter.exportMany({\n scope: this.scope.legacyScope,\n laneObject: lane,\n ids: new BitIds(),\n idsWithFutureScope: new BitIds(),\n allVersions: false,\n });\n }\n\n /**\n * get a Lane object from the remote.\n * `persistIfNotExists` saves the object in the local scope only if the lane is not there yet.\n * otherwise, it needs some merging mechanism, which is done differently whether it's export or import.\n * see `sources.mergeLane()` for export and `import-components._saveLaneDataIfNeeded()` for import.\n * in this case, because we only bring the lane object and not the components, it's not easy to do the merge.\n */\n async importLaneObject(laneId: LaneId, persistIfNotExists = true): Promise<Lane> {\n const legacyScope = this.scope.legacyScope;\n const scopeComponentImporter = ScopeComponentsImporter.getInstance(legacyScope);\n const results = await scopeComponentImporter.importLanes([laneId]);\n const laneObject = results[0];\n if (!laneObject) throw new LaneNotFound(laneId.scope, laneId.name);\n\n if (persistIfNotExists) {\n const exists = await legacyScope.loadLane(laneId);\n if (!exists) {\n await legacyScope.lanes.saveLane(laneObject);\n }\n }\n\n return laneObject;\n }\n\n /**\n * get the distance for a component between two lanes. for example, lane-b forked from lane-a and lane-b added some new snaps\n * @param componentId\n * @param sourceHead head on the source lane. leave empty if the source is main\n * @param targetHead head on the target lane. leave empty if the target is main\n * @returns\n */\n async getSnapsDistance(componentId: ComponentID, sourceHead?: string, targetHead?: string): Promise<SnapsDistance> {\n if (!sourceHead && !targetHead)\n throw new Error(`getDivergeData got sourceHead and targetHead empty. at least one of them should be populated`);\n const modelComponent = await this.scope.legacyScope.getModelComponent(componentId._legacy);\n return getDivergeData({\n modelComponent,\n repo: this.scope.legacyScope.objects,\n sourceHead: sourceHead ? Ref.from(sourceHead) : modelComponent.head || null,\n targetHead: targetHead ? Ref.from(targetHead) : modelComponent.head || null,\n });\n }\n\n /**\n * get the head hash (snap) of main. return undefined if the component exists only on a lane and was never merged to main\n */\n async getHeadOnMain(componentId: ComponentID): Promise<string | undefined> {\n const modelComponent = await this.scope.legacyScope.getModelComponent(componentId._legacy);\n return modelComponent.head?.toString();\n }\n\n /**\n * fetch the lane object and its components from the remote.\n * save the objects to the local scope.\n * this method doesn't change anything in the workspace.\n */\n async fetchLaneWithItsComponents(laneId: LaneId): Promise<Lane> {\n this.logger.debug(`fetching lane ${laneId.toString()}`);\n if (!this.workspace) {\n throw new BitError('unable to fetch lanes outside of Bit workspace');\n }\n const lane = await this.importLaneObject(laneId);\n if (!lane) throw new Error(`unable to import lane ${laneId.toString()} from the remote`);\n const importOptions: ImportOptions = {\n ids: [],\n objectsOnly: true,\n verbose: false,\n writeConfig: false,\n override: false,\n installNpmPackages: false,\n lanes: { laneIds: [laneId], lanes: [lane] },\n };\n const { importedIds } = await this.importer.importWithOptions(importOptions);\n this.logger.debug(`fetching lane ${laneId.toString()} done, fetched ${importedIds.length} components`);\n return lane;\n }\n\n async removeLanes(laneNames: string[], opts?: { remote: boolean; force: boolean }): Promise<string[]> {\n if (!this.workspace && !opts?.remote) {\n await this.scope.legacyScope.lanes.removeLanes(this.scope.legacyScope, laneNames, true);\n return laneNames;\n }\n const results = await removeLanes(this.workspace?.consumer, laneNames, !!opts?.remote, !!opts?.force);\n if (this.workspace) await this.workspace.consumer.onDestroy();\n\n return results.laneResults;\n }\n\n /**\n * switch to a different local or remote lane.\n * switching to a remote lane also imports and writes the components of that remote lane.\n * by default, only the components existing on the workspace will be imported from that lane, unless the \"getAll\"\n * flag is true.\n */\n async switchLanes(\n laneName: string,\n { alias, merge, getAll = false, skipDependencyInstallation = false }: SwitchLaneOptions\n ) {\n if (!this.workspace) {\n throw new BitError(`unable to switch lanes outside of Bit workspace`);\n }\n let mergeStrategy;\n if (merge && typeof merge === 'string') {\n const mergeOptions = Object.keys(MergeOptions);\n if (!mergeOptions.includes(merge)) {\n throw new BitError(`merge must be one of the following: ${mergeOptions.join(', ')}`);\n }\n mergeStrategy = merge;\n }\n if (alias) {\n throwForInvalidLaneName(alias);\n }\n\n const switchProps = {\n laneName,\n existingOnWorkspaceOnly: !getAll,\n alias,\n };\n const checkoutProps = {\n mergeStrategy,\n skipNpmInstall: skipDependencyInstallation,\n verbose: false, // not relevant in Harmony\n ignorePackageJson: true, // not relevant in Harmony\n ignoreDist: true, // not relevant in Harmony\n isLane: true,\n promptMergeOptions: false,\n writeConfig: false,\n reset: false,\n all: false,\n };\n return new LaneSwitcher(this.workspace, this.logger, switchProps, checkoutProps, this).switch();\n }\n\n /**\n * check whether the given lane is up-to-date against \"checkAgainst\", if this param is null, it checks it against main.\n */\n async isLaneUpToDate(laneToCheck: Lane, checkAgainst?: Lane): Promise<boolean> {\n const upToDateIds: BitId[] = [];\n const notUpToDateIds: BitId[] = [];\n const getHashOnAnotherLane = async (id: BitId): Promise<Ref | undefined> => {\n if (checkAgainst) {\n const idOnLane = checkAgainst.getComponent(id);\n return idOnLane?.head;\n }\n const modelComp = await this.scope.legacyScope.getModelComponent(id);\n return modelComp.head;\n };\n await Promise.all(\n laneToCheck.components.map(async (comp) => {\n const refOnOtherLane = await getHashOnAnotherLane(comp.id);\n if (!refOnOtherLane) {\n upToDateIds.push(comp.id);\n return;\n }\n if (comp.head.isEqual(refOnOtherLane)) {\n upToDateIds.push(comp.id);\n return;\n }\n const modelComponent = await this.scope.legacyScope.getModelComponent(comp.id);\n const divergeData = await getDivergeData({\n repo: this.scope.legacyScope.objects,\n modelComponent,\n sourceHead: comp.head,\n targetHead: refOnOtherLane,\n });\n if (divergeData.isTargetAhead() || divergeData.isDiverged()) {\n notUpToDateIds.push(comp.id);\n return;\n }\n if (!divergeData.isSourceAhead()) {\n throw new Error(\n `invalid state - component ${comp.id.toString()} is not diverged, not local-ahead and not-remote-ahead.`\n );\n }\n upToDateIds.push(comp.id);\n })\n );\n\n const isUpToDate = !notUpToDateIds.length;\n\n return isUpToDate;\n }\n\n /**\n * the values array may include zero to two values and will be processed as following:\n * [] => diff between the current lane and default lane. (only inside workspace).\n * [to] => diff between the current lane (or default-lane when in scope) and \"to\" lane.\n * [from, to] => diff between \"from\" lane and \"to\" lane.\n */\n public async getDiff(values: string[], diffOptions: DiffOptions = {}, pattern?: string): Promise<LaneDiffResults> {\n const laneDiffGenerator = new LaneDiffGenerator(this.workspace, this.scope);\n return laneDiffGenerator.generate(values, diffOptions, pattern);\n }\n\n async getLaneComponentModels(lane: LaneData): Promise<Component[]> {\n const host = this.componentAspect.getHost();\n const laneComponentIds = await this.getLaneComponentIds(lane);\n const components = await host.getMany(laneComponentIds);\n return components;\n }\n\n async getLaneComponentIds(lane: LaneData): Promise<ComponentID[]> {\n if (!lane) return [];\n\n const laneComponents = lane.components;\n const workspace = this.workspace;\n const bitIdsFromBitmap = workspace ? workspace.consumer.bitMap.getAllBitIdsFromAllLanes() : [];\n\n const filteredComponentIds = workspace\n ? laneComponents.filter((laneComponent) =>\n bitIdsFromBitmap.some((bitmapComponentId) => bitmapComponentId.isEqualWithoutVersion(laneComponent.id))\n )\n : laneComponents;\n\n const host = this.componentAspect.getHost();\n\n return Promise.all(\n filteredComponentIds.map((laneComponent) => {\n const legacyIdWithVersion = laneComponent.id.changeVersion(laneComponent.head);\n return host.resolveComponentId(legacyIdWithVersion);\n })\n );\n }\n\n async getLaneReadmeComponent(lane: LaneData): Promise<Component | undefined> {\n if (!lane) return undefined;\n const laneReadmeComponent = lane.readmeComponent;\n if (!laneReadmeComponent) return undefined;\n const host = this.componentAspect.getHost();\n const laneReadmeComponentId = await host.resolveComponentId(\n laneReadmeComponent.id.changeVersion(laneReadmeComponent.head)\n );\n const readmeComponent = await host.get(laneReadmeComponentId);\n return readmeComponent;\n }\n\n async removeLaneReadme(laneName?: string): Promise<{ result: boolean; message?: string }> {\n if (!this.workspace) {\n throw new BitError('unable to remove the lane readme component outside of Bit workspace');\n }\n const currentLaneName = this.getCurrentLaneName();\n\n if (!laneName && !currentLaneName) {\n return {\n result: false,\n message: 'unable to remove the lane readme component. Either pass a laneName or switch to a lane',\n };\n }\n\n const scope: LegacyScope = this.workspace.scope.legacyScope;\n const laneId: LaneId = laneName\n ? await scope.lanes.parseLaneIdFromString(laneName)\n : (this.getCurrentLaneId() as LaneId);\n const lane: Lane | null | undefined = await scope.loadLane(laneId);\n\n if (!lane?.readmeComponent) {\n throw new BitError(`there is no readme component added to the lane ${laneName || currentLaneName}`);\n }\n\n const readmeComponentId = await this.workspace.resolveComponentId(lane.readmeComponent.id);\n const existingLaneConfig =\n (await this.workspace.getSpecificComponentConfig(readmeComponentId, LanesAspect.id)) || {};\n\n const remoteLaneIdStr = lane.toLaneId().toString();\n\n if (existingLaneConfig.readme) {\n delete existingLaneConfig.readme[remoteLaneIdStr];\n await this.workspace.removeSpecificComponentConfig(readmeComponentId, LanesAspect.id, false);\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, existingLaneConfig);\n }\n\n lane.setReadmeComponent(undefined);\n await scope.lanes.saveLane(lane);\n await this.workspace.bitMap.write();\n\n return { result: true };\n }\n\n async diffStatus(sourceLaneId: LaneId, targetLaneId?: LaneId): Promise<LaneDiffStatus> {\n const sourceLane = await this.loadLane(sourceLaneId);\n if (!sourceLane) throw new Error(`unable to find ${sourceLaneId.toString()} in the scope`);\n const targetLane = targetLaneId ? await this.loadLane(targetLaneId) : undefined;\n const targetLaneIds = targetLane?.toBitIds();\n const host = this.componentAspect.getHost();\n const results = await Promise.all(\n sourceLane.components.map(async (comp) => {\n const componentId = await host.resolveComponentId(comp.id);\n const headOnTargetLane = targetLaneIds\n ? targetLaneIds.searchWithoutVersion(comp.id)?.version\n : await this.getHeadOnMain(componentId);\n const snapsDistance = await this.getSnapsDistance(componentId, comp.head.toString(), headOnTargetLane);\n const getChangeType = async (): Promise<ChangeType> => {\n if (!headOnTargetLane) return ChangeType.NEW;\n const compare = await this.componentCompare.compare(\n comp.id.changeVersion(comp.head.toString()).toString(),\n comp.id.changeVersion(headOnTargetLane).toString()\n );\n if (compare.code.length && compare.code.some((f) => f.status !== 'UNCHANGED')) {\n return ChangeType.SOURCE_CODE;\n }\n if (!compare.fields.length) return ChangeType.NONE;\n const depsFields = ['dependencies', 'devDependencies', 'extensionDependencies'];\n if (compare.fields.some((field) => depsFields.includes(field.fieldName))) return ChangeType.DEPENDENCY;\n return ChangeType.CONFIG;\n };\n const changeType = await getChangeType();\n return { componentId, changeType, upToDate: snapsDistance.isUpToDate() };\n })\n );\n\n const isLaneUptoDate = results.every((r) => r.upToDate);\n\n return {\n source: sourceLaneId,\n target: targetLaneId || this.getDefaultLaneId(),\n upToDate: isLaneUptoDate,\n componentsStatus: results,\n };\n }\n\n async addLaneReadme(readmeComponentIdStr: string, laneName?: string): Promise<{ result: boolean; message?: string }> {\n if (!this.workspace) {\n throw new BitError(`unable to track a lane readme component outside of Bit workspace`);\n }\n const readmeComponentId = await this.workspace.resolveComponentId(readmeComponentIdStr);\n\n const readmeComponentBitId = readmeComponentId._legacy;\n const scope: LegacyScope = this.workspace.scope.legacyScope;\n const laneId: LaneId = laneName\n ? await scope.lanes.parseLaneIdFromString(laneName)\n : (this.getCurrentLaneId() as LaneId);\n\n const lane: Lane | null | undefined = await scope.loadLane(laneId);\n\n if (!lane) {\n return { result: false, message: `cannot find lane ${laneName}` };\n }\n\n lane.setReadmeComponent(readmeComponentBitId);\n await scope.lanes.saveLane(lane);\n\n const existingLaneConfig =\n (await this.workspace.getSpecificComponentConfig(readmeComponentId, LanesAspect.id)) || {};\n\n const remoteLaneIdStr = lane.toLaneId().toString();\n\n if (existingLaneConfig.readme) {\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, {\n ...existingLaneConfig,\n readme: {\n ...existingLaneConfig.readme,\n [remoteLaneIdStr]: true,\n },\n });\n } else {\n await this.workspace.addSpecificComponentConfig(readmeComponentId, LanesAspect.id, {\n ...existingLaneConfig,\n readme: {\n [remoteLaneIdStr]: true,\n },\n });\n }\n await this.workspace.bitMap.write();\n return { result: true };\n }\n\n private async getLaneDataOfDefaultLane(): Promise<LaneData | null> {\n const consumer = this.workspace?.consumer;\n let bitIds: BitId[] = [];\n if (!consumer) {\n const scopeComponents = await this.scope.list();\n bitIds = scopeComponents.filter((component) => component.head).map((component) => component.id._legacy);\n } else {\n bitIds = await consumer.getIdsOfDefaultLane();\n }\n\n return {\n name: DEFAULT_LANE,\n remote: null,\n id: this.getDefaultLaneId(),\n components: bitIds.map((bitId) => ({ id: bitId, head: bitId.version as string })),\n isMerged: null,\n hash: '',\n };\n }\n\n get createRoutePath() {\n return '/lanes/create';\n }\n\n get deleteRoutePath() {\n return '/lanes/delete';\n }\n\n static slots = [];\n static dependencies = [\n CLIAspect,\n ScopeAspect,\n WorkspaceAspect,\n GraphqlAspect,\n MergingAspect,\n ComponentAspect,\n LoggerAspect,\n ImporterAspect,\n ExportAspect,\n ExpressAspect,\n ComponentCompareAspect,\n ];\n static runtime = MainRuntime;\n static async provider([\n cli,\n scope,\n workspace,\n graphql,\n merging,\n component,\n loggerMain,\n importer,\n exporter,\n express,\n componentCompare,\n ]: [\n CLIMain,\n ScopeMain,\n Workspace,\n GraphqlMain,\n MergingMain,\n ComponentMain,\n LoggerMain,\n ImporterMain,\n ExportMain,\n ExpressMain,\n ComponentCompareMain\n ]) {\n const logger = loggerMain.createLogger(LanesAspect.id);\n const lanesMain = new LanesMain(workspace, scope, merging, component, logger, importer, exporter, componentCompare);\n const switchCmd = new SwitchCmd(lanesMain);\n const laneCmd = new LaneCmd(lanesMain, workspace, scope);\n laneCmd.commands = [\n new LaneListCmd(lanesMain, workspace, scope),\n switchCmd,\n new LaneShowCmd(lanesMain, workspace, scope),\n new LaneCreateCmd(lanesMain),\n new LaneRemoveCmd(lanesMain),\n new LaneChangeScopeCmd(lanesMain),\n new LaneAliasCmd(lanesMain),\n new LaneRenameCmd(lanesMain),\n new LaneDiffCmd(workspace, scope),\n new LaneAddReadmeCmd(lanesMain),\n new LaneRemoveReadmeCmd(lanesMain),\n new LaneImportCmd(switchCmd),\n ];\n cli.register(laneCmd, switchCmd);\n graphql.register(lanesSchema(lanesMain));\n express.register([new LanesCreateRoute(lanesMain, logger), new LanesDeleteRoute(lanesMain, logger)]);\n return lanesMain;\n }\n}\n\nLanesAspect.addRuntime(LanesMain);\n\nexport default LanesMain;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAaA;EAA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
@@ -157,9 +157,9 @@ describe('LanesAspect', function () {
|
|
157
157
|
it('should return that the lane is up to date when the lane is ahead of main', async () => {
|
158
158
|
const currentLane = await lanes.getCurrentLane();
|
159
159
|
if (!currentLane) throw new Error('unable to get the current lane');
|
160
|
-
const laneDiffResults = await lanes.
|
161
|
-
(0, _chai().expect)(laneDiffResults[0].upToDate).to.be.true;
|
162
|
-
(0, _chai().expect)(laneDiffResults[0].changeType).to.equal(_lanesMain().ChangeType.NONE);
|
160
|
+
const laneDiffResults = await lanes.diffStatus(currentLane.toLaneId());
|
161
|
+
(0, _chai().expect)(laneDiffResults.componentsStatus[0].upToDate).to.be.true;
|
162
|
+
(0, _chai().expect)(laneDiffResults.componentsStatus[0].changeType).to.equal(_lanesMain().ChangeType.NONE);
|
163
163
|
});
|
164
164
|
it('should return that the lane is not up to date when main is ahead', async () => {
|
165
165
|
const currentLane = await lanes.getCurrentLane();
|
@@ -172,9 +172,9 @@ describe('LanesAspect', function () {
|
|
172
172
|
build: false,
|
173
173
|
unmodified: true
|
174
174
|
});
|
175
|
-
const laneDiffResults = await lanes.
|
176
|
-
(0, _chai().expect)(laneDiffResults[0].upToDate).to.be.false;
|
177
|
-
(0, _chai().expect)(laneDiffResults[0].changeType).to.equal(_lanesMain().ChangeType.NONE);
|
175
|
+
const laneDiffResults = await lanes.diffStatus(currentLane.toLaneId());
|
176
|
+
(0, _chai().expect)(laneDiffResults.componentsStatus[0].upToDate).to.be.false;
|
177
|
+
(0, _chai().expect)(laneDiffResults.componentsStatus[0].changeType).to.equal(_lanesMain().ChangeType.NONE);
|
178
178
|
});
|
179
179
|
});
|
180
180
|
});
|
package/dist/lanes.spec.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["describe","timeout","lanes","workspaceData","before","mockWorkspace","workspacePath","mockComponents","loadAspect","LanesAspect","createLane","after","destroyWorkspace","it","currentLanes","getLanes","expect","to","have","lengthOf","name","equal","snapping","SnappingAspect","tag","ids","build","ignoreIssues","modifyMockedComponents","result","snap","pattern","snappedComponents","length","currentLane","getCurrentLane","Error","isUpToDate","isLaneUpToDate","be","true","switchLanes","skipDependencyInstallation","unmodified","false","laneDiffResults","laneDiff","toLaneId","upToDate","changeType","ChangeType","NONE"],"sources":["lanes.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport { loadAspect } from '@teambit/harmony.testing.load-aspect';\nimport SnappingAspect, { SnappingMain } from '@teambit/snapping';\nimport { mockWorkspace, destroyWorkspace, WorkspaceData } from '@teambit/workspace.testing.mock-workspace';\nimport { mockComponents, modifyMockedComponents } from '@teambit/component.testing.mock-components';\nimport { LanesAspect } from './lanes.aspect';\nimport { ChangeType, 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 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 = await lanes.isLaneUpToDate(currentLane);\n expect(isUpToDate).to.be.true;\n });\n it('should return that the lane is not up to date when main is ahead', async () => {\n const currentLane = await lanes.getCurrentLane();\n if (!currentLane) throw new Error('unable to get the current lane');\n await lanes.switchLanes('main', { skipDependencyInstallation: true });\n await snapping.snap({\n pattern: 'comp1',\n build: false,\n unmodified: true,\n ignoreIssues: 'MissingManuallyConfiguredPackages',\n });\n const isUpToDate = await lanes.isLaneUpToDate(currentLane);\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 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.laneDiff(currentLane.toLaneId());\n expect(laneDiffResults[0].upToDate).to.be.true;\n expect(laneDiffResults[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.laneDiff(currentLane.toLaneId());\n expect(laneDiffResults[0].upToDate).to.be.false;\n expect(laneDiffResults[0].changeType).to.equal(ChangeType.NONE);\n });\n });\n});\n"],"mappings":";;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEAA,QAAQ,CAAC,aAAa,EAAE,YAAY;EAClC,IAAI,CAACC,OAAO,CAAC,CAAC,CAAC;EAEfD,QAAQ,CAAC,YAAY,EAAE,MAAM;IAC3B,IAAIE,KAAgB;IACpB,IAAIC,aAA4B;IAChCC,MAAM,CAAC,YAAY;MACjBD,aAAa,GAAG,IAAAE,iCAAa,GAAE;MAC/B,MAAM;QAAEC;MAAc,CAAC,GAAGH,aAAa;MACvC,MAAM,IAAAI,kCAAc,EAACD,aAAa,CAAC;MACnCJ,KAAK,GAAG,MAAM,IAAAM,4BAAU,EAACC,oBAAW,EAAEH,aAAa,CAAC;MACpD,MAAMJ,KAAK,CAACQ,UAAU,CAAC,OAAO,CAAC;IACjC,CAAC,CAAC;IACFC,KAAK,CAAC,YAAY;MAChB,MAAM,IAAAC,oCAAgB,EAACT,aAAa,CAAC;IACvC,CAAC,CAAC;IACFU,EAAE,CAAC,uBAAuB,EAAE,YAAY;MACtC,MAAMC,YAAY,GAAG,MAAMZ,KAAK,CAACa,QAAQ,CAAC,CAAC,CAAC,CAAC;MAC7C,IAAAC,cAAM,EAACF,YAAY,CAAC,CAACG,EAAE,CAACC,IAAI,CAACC,QAAQ,CAAC,CAAC,CAAC;MACxC,IAAAH,cAAM,EAACF,YAAY,CAAC,CAAC,CAAC,CAACM,IAAI,CAAC,CAACH,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AAM,IAAIE,KAAK,CAAC,gCAAgC,CAAC;MACnE,MAAMlC,KAAK,CAACuC,WAAW,CAAC,MAAM,EAAE;QAAEC,0BAA0B,EAAE;MAAK,CAAC,CAAC;MACrE,MAAMpB,QAAQ,CAACQ,IAAI,CAAC;QAAEC,OAAO,EAAE,OAAO;QAAEL,KAAK,EAAE,KAAK;QAAEiB,UAAU,EAAE;MAAK,CAAC,CAAC;MAEzE,MAAME,eAAe,GAAG,MAAM3C,KAAK,CAAC4C,QAAQ,CAACZ,WAAW,CAACa,QAAQ,EAAE,CAAC;MACpE,IAAA/B,cAAM,EAAC6B,eAAe,CAAC,CAAC,CAAC,CAACG,QAAQ,CAAC,CAAC/B,EAAE,CAACsB,EAAE,CAACK,KAAK;MAC/C,IAAA5B,cAAM,EAAC6B,eAAe,CAAC,CAAC,CAAC,CAACI,UAAU,CAAC,CAAChC,EAAE,CAACI,KAAK,CAAC6B,uBAAU,CAACC,IAAI,CAAC;IACjE,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
1
|
+
{"version":3,"names":["describe","timeout","lanes","workspaceData","before","mockWorkspace","workspacePath","mockComponents","loadAspect","LanesAspect","createLane","after","destroyWorkspace","it","currentLanes","getLanes","expect","to","have","lengthOf","name","equal","snapping","SnappingAspect","tag","ids","build","ignoreIssues","modifyMockedComponents","result","snap","pattern","snappedComponents","length","currentLane","getCurrentLane","Error","isUpToDate","isLaneUpToDate","be","true","switchLanes","skipDependencyInstallation","unmodified","false","laneDiffResults","diffStatus","toLaneId","componentsStatus","upToDate","changeType","ChangeType","NONE"],"sources":["lanes.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport { loadAspect } from '@teambit/harmony.testing.load-aspect';\nimport SnappingAspect, { SnappingMain } from '@teambit/snapping';\nimport { mockWorkspace, destroyWorkspace, WorkspaceData } from '@teambit/workspace.testing.mock-workspace';\nimport { mockComponents, modifyMockedComponents } from '@teambit/component.testing.mock-components';\nimport { LanesAspect } from './lanes.aspect';\nimport { ChangeType, 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 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 = await lanes.isLaneUpToDate(currentLane);\n expect(isUpToDate).to.be.true;\n });\n it('should return that the lane is not up to date when main is ahead', async () => {\n const currentLane = await lanes.getCurrentLane();\n if (!currentLane) throw new Error('unable to get the current lane');\n await lanes.switchLanes('main', { skipDependencyInstallation: true });\n await snapping.snap({\n pattern: 'comp1',\n build: false,\n unmodified: true,\n ignoreIssues: 'MissingManuallyConfiguredPackages',\n });\n const isUpToDate = await lanes.isLaneUpToDate(currentLane);\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 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"],"mappings":";;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;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,EAAE,CAAC;MACtE,IAAA/B,cAAM,EAAC6B,eAAe,CAACG,gBAAgB,CAAC,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAChC,EAAE,CAACsB,EAAE,CAACK,KAAK;MAChE,IAAA5B,cAAM,EAAC6B,eAAe,CAACG,gBAAgB,CAAC,CAAC,CAAC,CAACE,UAAU,CAAC,CAACjC,EAAE,CAACI,KAAK,CAAC8B,uBAAU,CAACC,IAAI,CAAC;IAClF,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
@@ -1,19 +1,22 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { RouteProps } from 'react-router-dom';
|
3
3
|
import { Harmony } from '@teambit/harmony';
|
4
|
+
import { LaneCompareProps as DefaultLaneCompareProps } from '@teambit/lanes.ui.compare.lane-compare';
|
4
5
|
import { UiUI } from '@teambit/ui';
|
5
6
|
import { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';
|
6
7
|
import { ScopeUI } from '@teambit/scope';
|
7
8
|
import { WorkspaceUI } from '@teambit/workspace';
|
8
9
|
import { ComponentID, ComponentUI } from '@teambit/component';
|
9
|
-
import { SidebarUI } from '@teambit/sidebar';
|
10
10
|
import { MenuWidget, MenuWidgetSlot } from '@teambit/ui-foundation.ui.menu';
|
11
11
|
import { LaneOverviewLine, LaneOverviewLineSlot } from '@teambit/lanes.ui.lane-overview';
|
12
12
|
import { LanesNavPlugin, LanesOrderedNavigationSlot } from '@teambit/lanes.ui.menus.lanes-overview-menu';
|
13
13
|
import { LanesProvider, useLanes } from '@teambit/lanes.hooks.use-lanes';
|
14
14
|
import { LaneId } from '@teambit/lane-id';
|
15
|
+
import { ComponentCompareUI } from '@teambit/component-compare';
|
16
|
+
export declare type LaneCompareProps = Partial<DefaultLaneCompareProps>;
|
15
17
|
export declare class LanesUI {
|
16
|
-
private
|
18
|
+
private componentUI;
|
19
|
+
private componentCompareUI;
|
17
20
|
private routeSlot;
|
18
21
|
private navSlot;
|
19
22
|
private menuWidgetSlot;
|
@@ -26,7 +29,7 @@ export declare class LanesUI {
|
|
26
29
|
static dependencies: import("@teambit/harmony").Aspect[];
|
27
30
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
28
31
|
static slots: (((registerFn: () => string) => import("@teambit/harmony").SlotRegistry<RouteProps>) | ((registerFn: () => string) => import("@teambit/harmony").SlotRegistry<LaneOverviewLineSlot>) | ((registerFn: () => string) => import("@teambit/harmony").SlotRegistry<NavigationSlot>))[];
|
29
|
-
constructor(
|
32
|
+
constructor(componentUI: ComponentUI, componentCompareUI: ComponentCompareUI, routeSlot: RouteSlot, navSlot: LanesOrderedNavigationSlot, menuWidgetSlot: MenuWidgetSlot,
|
30
33
|
/**
|
31
34
|
* overview line slot to add new lines beneath the overview section
|
32
35
|
*/
|
@@ -75,7 +78,14 @@ export declare class LanesUI {
|
|
75
78
|
*/
|
76
79
|
registerOverviewLine(...lines: LaneOverviewLine[]): this;
|
77
80
|
registerNavigation(routes: LanesNavPlugin[]): void;
|
78
|
-
|
81
|
+
getLaneCompare: (props: LaneCompareProps) => JSX.Element | null;
|
82
|
+
static provider([uiUi, componentUI, workspaceUi, scopeUi, componentCompareUI]: [
|
83
|
+
UiUI,
|
84
|
+
ComponentUI,
|
85
|
+
WorkspaceUI,
|
86
|
+
ScopeUI,
|
87
|
+
ComponentCompareUI
|
88
|
+
], _: any, [routeSlot, overviewSlot, navSlot, menuWidgetSlot]: [
|
79
89
|
RouteSlot,
|
80
90
|
LaneOverviewLineSlot,
|
81
91
|
LanesOrderedNavigationSlot,
|
package/dist/lanes.ui.runtime.js
CHANGED
@@ -7,6 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
8
8
|
});
|
9
9
|
exports.default = exports.LanesUI = void 0;
|
10
|
+
function _extends2() {
|
11
|
+
const data = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
12
|
+
_extends2 = function () {
|
13
|
+
return data;
|
14
|
+
};
|
15
|
+
return data;
|
16
|
+
}
|
10
17
|
function _defineProperty2() {
|
11
18
|
const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
12
19
|
_defineProperty2 = function () {
|
@@ -28,6 +35,13 @@ function _reactRouterDom() {
|
|
28
35
|
};
|
29
36
|
return data;
|
30
37
|
}
|
38
|
+
function _lodash() {
|
39
|
+
const data = require("lodash");
|
40
|
+
_lodash = function () {
|
41
|
+
return data;
|
42
|
+
};
|
43
|
+
return data;
|
44
|
+
}
|
31
45
|
function _harmony() {
|
32
46
|
const data = require("@teambit/harmony");
|
33
47
|
_harmony = function () {
|
@@ -35,6 +49,13 @@ function _harmony() {
|
|
35
49
|
};
|
36
50
|
return data;
|
37
51
|
}
|
52
|
+
function _lanesUiCompare() {
|
53
|
+
const data = require("@teambit/lanes.ui.compare.lane-compare");
|
54
|
+
_lanesUiCompare = function () {
|
55
|
+
return data;
|
56
|
+
};
|
57
|
+
return data;
|
58
|
+
}
|
38
59
|
function _ui() {
|
39
60
|
const data = require("@teambit/ui");
|
40
61
|
_ui = function () {
|
@@ -77,13 +98,6 @@ function _component() {
|
|
77
98
|
};
|
78
99
|
return data;
|
79
100
|
}
|
80
|
-
function _sidebar() {
|
81
|
-
const data = _interopRequireDefault(require("@teambit/sidebar"));
|
82
|
-
_sidebar = function () {
|
83
|
-
return data;
|
84
|
-
};
|
85
|
-
return data;
|
86
|
-
}
|
87
101
|
function _lanesUi() {
|
88
102
|
const data = require("@teambit/lanes.ui.lane-overview");
|
89
103
|
_lanesUi = function () {
|
@@ -133,15 +147,23 @@ function _lanesHooks2() {
|
|
133
147
|
};
|
134
148
|
return data;
|
135
149
|
}
|
150
|
+
function _componentCompare() {
|
151
|
+
const data = require("@teambit/component-compare");
|
152
|
+
_componentCompare = function () {
|
153
|
+
return data;
|
154
|
+
};
|
155
|
+
return data;
|
156
|
+
}
|
136
157
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
137
158
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
138
159
|
class LanesUI {
|
139
|
-
constructor(
|
160
|
+
constructor(componentUI, componentCompareUI, routeSlot, navSlot, menuWidgetSlot,
|
140
161
|
/**
|
141
162
|
* overview line slot to add new lines beneath the overview section
|
142
163
|
*/
|
143
164
|
overviewSlot, workspace, scope) {
|
144
|
-
this.
|
165
|
+
this.componentUI = componentUI;
|
166
|
+
this.componentCompareUI = componentCompareUI;
|
145
167
|
this.routeSlot = routeSlot;
|
146
168
|
this.navSlot = navSlot;
|
147
169
|
this.menuWidgetSlot = menuWidgetSlot;
|
@@ -177,6 +199,36 @@ class LanesUI {
|
|
177
199
|
}) => {
|
178
200
|
return /*#__PURE__*/_react().default.createElement(_lanesHooks().LanesProvider, null, children);
|
179
201
|
});
|
202
|
+
(0, _defineProperty2().default)(this, "getLaneCompare", props => {
|
203
|
+
const routes = this.componentCompareUI.routes;
|
204
|
+
const navLinks = this.componentCompareUI.navLinks;
|
205
|
+
const getElement = (routeProps, href) => {
|
206
|
+
var _routeProps$find;
|
207
|
+
if (routeProps.length === 1) return routeProps[0].element;
|
208
|
+
if (!href) return undefined;
|
209
|
+
return (_routeProps$find = routeProps.find(route => {
|
210
|
+
var _route$path;
|
211
|
+
return (_route$path = route.path) === null || _route$path === void 0 ? void 0 : _route$path.startsWith(href);
|
212
|
+
})) === null || _routeProps$find === void 0 ? void 0 : _routeProps$find.element;
|
213
|
+
};
|
214
|
+
const tabs = (0, _lodash().flatten)(Array.from(navLinks.entries()).map(([id, navProps]) => {
|
215
|
+
const maybeRoutesForId = routes.get(id);
|
216
|
+
const routesForId = maybeRoutesForId && (Array.isArray(maybeRoutesForId) ? [...maybeRoutesForId] : [maybeRoutesForId]) || [];
|
217
|
+
return navProps.map(navProp => ({
|
218
|
+
id: `${id}-${navProp.props.href}`,
|
219
|
+
order: navProp.order,
|
220
|
+
props: navProp.props,
|
221
|
+
element: getElement(routesForId, navProp.props.href)
|
222
|
+
}));
|
223
|
+
}));
|
224
|
+
if (!props.base || !props.compare) return null;
|
225
|
+
return /*#__PURE__*/_react().default.createElement(_lanesUiCompare().LaneCompare, (0, _extends2().default)({}, props, {
|
226
|
+
base: props.base,
|
227
|
+
compare: props.compare,
|
228
|
+
host: props.host || this.host,
|
229
|
+
tabs: props.tabs || tabs
|
230
|
+
}));
|
231
|
+
});
|
180
232
|
this.hostAspect = workspace || scope;
|
181
233
|
this.lanesHost = workspace ? 'workspace' : 'scope';
|
182
234
|
this.host = workspace ? _workspace().default.id : _scope().default.id;
|
@@ -226,13 +278,13 @@ class LanesUI {
|
|
226
278
|
// }
|
227
279
|
|
228
280
|
getLaneComponent() {
|
229
|
-
return this.
|
281
|
+
return this.componentUI.getComponentUI(this.host, {
|
230
282
|
componentId: this.useComponentId,
|
231
283
|
useComponentFilters: this.useComponentFilters
|
232
284
|
});
|
233
285
|
}
|
234
286
|
getLaneComponentMenu() {
|
235
|
-
return this.
|
287
|
+
return this.componentUI.getMenu(this.host, {
|
236
288
|
componentId: this.useComponentId,
|
237
289
|
useComponentFilters: this.useComponentFilters
|
238
290
|
});
|
@@ -250,7 +302,7 @@ class LanesUI {
|
|
250
302
|
children: /*#__PURE__*/_react().default.createElement(_reactRouterDom().Route, {
|
251
303
|
path: `${_lanesUiModels().LanesModel.lanePath}/*`
|
252
304
|
}, /*#__PURE__*/_react().default.createElement(_reactRouterDom().Route, {
|
253
|
-
path:
|
305
|
+
path: '*',
|
254
306
|
element: this.getLanesOverviewMenu()
|
255
307
|
}), /*#__PURE__*/_react().default.createElement(_reactRouterDom().Route, {
|
256
308
|
path: "~component/*",
|
@@ -288,6 +340,13 @@ class LanesUI {
|
|
288
340
|
children: 'Overview'
|
289
341
|
},
|
290
342
|
order: 1
|
343
|
+
}, {
|
344
|
+
props: {
|
345
|
+
href: '~compare',
|
346
|
+
children: 'Lane Compare'
|
347
|
+
},
|
348
|
+
order: 2,
|
349
|
+
hide: () => true
|
291
350
|
}]);
|
292
351
|
}
|
293
352
|
registerRoutes() {
|
@@ -331,7 +390,7 @@ class LanesUI {
|
|
331
390
|
registerNavigation(routes) {
|
332
391
|
this.navSlot.register(routes);
|
333
392
|
}
|
334
|
-
static async provider([uiUi,
|
393
|
+
static async provider([uiUi, componentUI, workspaceUi, scopeUi, componentCompareUI], _, [routeSlot, overviewSlot, navSlot, menuWidgetSlot], harmony) {
|
335
394
|
const {
|
336
395
|
config
|
337
396
|
} = harmony;
|
@@ -344,7 +403,7 @@ class LanesUI {
|
|
344
403
|
if (host === _scope().default.id) {
|
345
404
|
scope = scopeUi;
|
346
405
|
}
|
347
|
-
const lanesUi = new LanesUI(
|
406
|
+
const lanesUi = new LanesUI(componentUI, componentCompareUI, routeSlot, navSlot, overviewSlot, menuWidgetSlot, workspace, scope);
|
348
407
|
if (uiUi) uiUi.registerRenderHooks({
|
349
408
|
reactContext: lanesUi.renderContext
|
350
409
|
});
|
@@ -369,7 +428,7 @@ class LanesUI {
|
|
369
428
|
}
|
370
429
|
}
|
371
430
|
exports.LanesUI = LanesUI;
|
372
|
-
(0, _defineProperty2().default)(LanesUI, "dependencies", [_ui().UIAspect, _component().default, _workspace().default, _scope().default,
|
431
|
+
(0, _defineProperty2().default)(LanesUI, "dependencies", [_ui().UIAspect, _component().default, _workspace().default, _scope().default, _componentCompare().ComponentCompareAspect]);
|
373
432
|
(0, _defineProperty2().default)(LanesUI, "runtime", _ui().UIRuntime);
|
374
433
|
(0, _defineProperty2().default)(LanesUI, "slots", [_harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType()]);
|
375
434
|
var _default = LanesUI;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["LanesUI","constructor","componentUi","routeSlot","navSlot","menuWidgetSlot","overviewSlot","workspace","scope","idFromLocation","useIdFromLocation","lanesModel","useLanes","laneFromUrl","useViewedLaneFromUrl","laneComponentId","isDefault","resolveComponentByFullName","undefined","getLaneComponentIdFromUrl","toString","log","logHead","version","children","hostAspect","lanesHost","host","WorkspaceAspect","id","ScopeAspect","registerHostAspectRoutes","registerRoutes","getLaneRoutes","registerMenuRoutes","getMenuRoutes","path","LanesModel","lanesPrefix","lanePath","getLaneOverview","getLaneComponent","overrideComputeLaneUrl","fn","prefix","getLaneComponentUrl","getLaneIdFromPathname","getLaneUrl","getComponentUI","componentId","useComponentId","useComponentFilters","getLaneComponentMenu","getMenu","getLanesOverviewMenu","registerMenuWidget","menuItems","register","registerLanesRoutes","registerNavigation","props","href","exact","order","getLanesSwitcher","LanesSwitcher","getLanesProvider","LanesProvider","getUseLanes","registerLanesDropdown","registerSidebarLink","component","Gallery","weight","registerRoute","route","registerOverviewLine","lines","routes","provider","uiUi","workspaceUi","scopeUi","_","harmony","config","String","get","lanesUi","registerRenderHooks","reactContext","renderContext","viewedLane","currentLane","UIAspect","ComponentAspect","SidebarAspect","UIRuntime","Slot","withType","LanesAspect","addRuntime"],"sources":["lanes.ui.runtime.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { Route, RouteProps } from 'react-router-dom';\nimport { Slot, Harmony } from '@teambit/harmony';\nimport { UIRuntime, UiUI, UIAspect } from '@teambit/ui';\nimport { LanesAspect } from '@teambit/lanes';\nimport { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { NotFoundPage } from '@teambit/design.ui.pages.not-found';\nimport ScopeAspect, { ScopeUI } from '@teambit/scope';\nimport WorkspaceAspect, { WorkspaceUI } from '@teambit/workspace';\nimport ComponentAspect, { ComponentID, ComponentUI, useIdFromLocation } from '@teambit/component';\nimport SidebarAspect, { SidebarUI } from '@teambit/sidebar';\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 { UseLaneMenu } from '@teambit/lanes.ui.menus.use-lanes-menu';\nimport { LanesHost, LanesModel } from '@teambit/lanes.ui.models.lanes-model';\nimport { LanesProvider, useLanes } 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';\n\nexport class LanesUI {\n static dependencies = [UIAspect, ComponentAspect, WorkspaceAspect, ScopeAspect, SidebarAspect];\n static runtime = UIRuntime;\n static slots = [\n Slot.withType<RouteProps>(),\n Slot.withType<LaneOverviewLineSlot>(),\n Slot.withType<NavigationSlot>(),\n Slot.withType<MenuWidgetSlot>(),\n ];\n\n constructor(\n private componentUi: ComponentUI,\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 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=\"*\" 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;\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 getLaneComponentIdFromUrl = () => {\n const idFromLocation = useIdFromLocation();\n const { lanesModel } = useLanes();\n const laneFromUrl = useViewedLaneFromUrl();\n const laneComponentId =\n idFromLocation && !laneFromUrl?.isDefault()\n ? lanesModel?.resolveComponentByFullName(idFromLocation, laneFromUrl)\n : undefined;\n return laneComponentId;\n };\n\n useComponentId = () => {\n return this.getLaneComponentIdFromUrl()?.toString();\n };\n\n useComponentFilters = () => {\n const laneComponentId = this.getLaneComponentIdFromUrl();\n\n return {\n log: laneComponentId && {\n logHead: laneComponentId.version,\n },\n };\n };\n\n getLaneComponent() {\n return this.componentUi.getComponentUI(this.host, {\n componentId: this.useComponentId,\n useComponentFilters: this.useComponentFilters,\n });\n }\n\n getLaneComponentMenu() {\n return this.componentUi.getMenu(this.host, {\n componentId: this.useComponentId,\n useComponentFilters: this.useComponentFilters,\n });\n }\n\n getLaneOverview() {\n return <LaneOverview routeSlot={this.routeSlot} overviewSlot={this.overviewSlot} host={this.lanesHost} />;\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 }\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 }\n\n private registerRoutes() {\n this.registerHostAspectRoutes();\n this.registerLanesRoutes();\n }\n\n getLanesSwitcher() {\n const LanesSwitcher = <LaneSwitcher groupByScope={this.lanesHost === 'workspace'} />;\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 return <LanesProvider>{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 static async provider(\n [uiUi, componentUi, workspaceUi, scopeUi]: [UiUI, ComponentUI, WorkspaceUI, ScopeUI, SidebarUI],\n _,\n [routeSlot, overviewSlot, navSlot, menuWidgetSlot]: [\n RouteSlot,\n LaneOverviewLineSlot,\n LanesOrderedNavigationSlot,\n MenuWidgetSlot\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(componentUi, routeSlot, navSlot, overviewSlot, menuWidgetSlot, workspace, scope);\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 <UseLaneMenu host={lanesUi.lanesHost} viewedLaneId={viewedLane.id} currentLaneId={currentLane?.id} />;\n });\n lanesUi.registerLanesDropdown();\n return lanesUi;\n }\n}\n\nexport default LanesUI;\n\nLanesAspect.addRuntime(LanesUI);\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAA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,CAAC;IAC5G,IAAIwE,IAAI,EAAEA,IAAI,CAACS,mBAAmB,CAAC;MAAEC,YAAY,EAAEF,OAAO,CAACG;IAAc,CAAC,CAAC;IAC3EH,OAAO,CAACxD,cAAc,EAAE;IACxBwD,OAAO,CAACjC,kBAAkB,CAAC,MAAM;MAC/B,MAAM;QAAE5C;MAAW,CAAC,GAAG,IAAAC,sBAAQ,GAAE;MACjC,IAAI,EAACD,UAAU,aAAVA,UAAU,eAAVA,UAAU,CAAEiF,UAAU,GAAE,OAAO,IAAI;MACxC,MAAM;QAAEA,UAAU;QAAEC;MAAY,CAAC,GAAGlF,UAAU;MAC9C,oBAAO,+BAAC,4BAAW;QAAC,IAAI,EAAE6E,OAAO,CAAC9D,SAAU;QAAC,YAAY,EAAEkE,UAAU,CAAC/D,EAAG;QAAC,aAAa,EAAEgE,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEhE;MAAG,EAAG;IAC9G,CAAC,CAAC;IACF2D,OAAO,CAACnB,qBAAqB,EAAE;IAC/B,OAAOmB,OAAO;EAChB;AACF;AAAC;AAAA,gCAzPYxF,OAAO,kBACI,CAAC8F,cAAQ,EAAEC,oBAAe,EAAEnE,oBAAe,EAAEE,gBAAW,EAAEkE,kBAAa,CAAC;AAAA,gCADnFhG,OAAO,aAEDiG,eAAS;AAAA,gCAFfjG,OAAO,WAGH,CACbkG,eAAI,CAACC,QAAQ,EAAc,EAC3BD,eAAI,CAACC,QAAQ,EAAwB,EACrCD,eAAI,CAACC,QAAQ,EAAkB,EAC/BD,eAAI,CAACC,QAAQ,EAAkB,CAChC;AAAA,eAmPYnG,OAAO;AAAA;AAEtBoG,oBAAW,CAACC,UAAU,CAACrG,OAAO,CAAC"}
|
1
|
+
{"version":3,"names":["LanesUI","constructor","componentUI","componentCompareUI","routeSlot","navSlot","menuWidgetSlot","overviewSlot","workspace","scope","idFromLocation","useIdFromLocation","lanesModel","useLanes","laneFromUrl","useViewedLaneFromUrl","laneComponentId","isDefault","resolveComponentByFullName","undefined","getLaneComponentIdFromUrl","toString","log","logHead","version","children","props","routes","navLinks","getElement","routeProps","href","length","element","find","route","path","startsWith","tabs","flatten","Array","from","entries","map","id","navProps","maybeRoutesForId","get","routesForId","isArray","navProp","order","base","compare","host","hostAspect","lanesHost","WorkspaceAspect","ScopeAspect","registerHostAspectRoutes","registerRoutes","getLaneRoutes","registerMenuRoutes","getMenuRoutes","LanesModel","lanesPrefix","lanePath","getLaneOverview","getLaneComponent","overrideComputeLaneUrl","fn","prefix","getLaneComponentUrl","getLaneIdFromPathname","getLaneUrl","getComponentUI","componentId","useComponentId","useComponentFilters","getLaneComponentMenu","getMenu","getLanesOverviewMenu","registerMenuWidget","menuItems","register","registerLanesRoutes","registerNavigation","exact","hide","getLanesSwitcher","LanesSwitcher","getLanesProvider","LanesProvider","getUseLanes","registerLanesDropdown","registerSidebarLink","component","Gallery","weight","registerRoute","registerOverviewLine","lines","provider","uiUi","workspaceUi","scopeUi","_","harmony","config","String","lanesUi","registerRenderHooks","reactContext","renderContext","viewedLane","currentLane","UIAspect","ComponentAspect","ComponentCompareAspect","UIRuntime","Slot","withType","LanesAspect","addRuntime"],"sources":["lanes.ui.runtime.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { Route, RouteProps } from 'react-router-dom';\nimport { flatten } from 'lodash';\nimport { Slot, Harmony } from '@teambit/harmony';\nimport { LaneCompare, LaneCompareProps as DefaultLaneCompareProps } from '@teambit/lanes.ui.compare.lane-compare';\nimport { UIRuntime, UiUI, UIAspect } from '@teambit/ui';\nimport { LanesAspect } from '@teambit/lanes';\nimport { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';\nimport { NotFoundPage } from '@teambit/design.ui.pages.not-found';\nimport ScopeAspect, { ScopeUI } from '@teambit/scope';\nimport WorkspaceAspect, { WorkspaceUI } from '@teambit/workspace';\nimport ComponentAspect, { ComponentID, ComponentUI, useIdFromLocation } 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 { UseLaneMenu } from '@teambit/lanes.ui.menus.use-lanes-menu';\nimport { LanesHost, LanesModel } from '@teambit/lanes.ui.models.lanes-model';\nimport { LanesProvider, useLanes } 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 { TabItem } from '@teambit/component.ui.component-compare.models.component-compare-props';\nimport { ComponentCompareAspect, ComponentCompareUI } from '@teambit/component-compare';\n\nexport type LaneCompareProps = Partial<DefaultLaneCompareProps>;\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 ];\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 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;\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 getLaneComponentIdFromUrl = () => {\n const idFromLocation = useIdFromLocation();\n const { lanesModel } = useLanes();\n const laneFromUrl = useViewedLaneFromUrl();\n const laneComponentId =\n idFromLocation && !laneFromUrl?.isDefault()\n ? lanesModel?.resolveComponentByFullName(idFromLocation, laneFromUrl)\n : undefined;\n return laneComponentId;\n };\n\n useComponentId = () => {\n return this.getLaneComponentIdFromUrl()?.toString();\n };\n\n useComponentFilters = () => {\n const laneComponentId = this.getLaneComponentIdFromUrl();\n\n return {\n log: laneComponentId && {\n logHead: laneComponentId.version,\n },\n };\n };\n\n getLaneComponent() {\n return this.componentUI.getComponentUI(this.host, {\n componentId: this.useComponentId,\n useComponentFilters: this.useComponentFilters,\n });\n }\n\n getLaneComponentMenu() {\n return this.componentUI.getMenu(this.host, {\n componentId: this.useComponentId,\n useComponentFilters: this.useComponentFilters,\n });\n }\n\n getLaneOverview() {\n return <LaneOverview routeSlot={this.routeSlot} overviewSlot={this.overviewSlot} host={this.lanesHost} />;\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 }\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: 'Lane Compare',\n },\n order: 2,\n hide: () => true,\n },\n ]);\n }\n\n private registerRoutes() {\n this.registerHostAspectRoutes();\n this.registerLanesRoutes();\n }\n\n getLanesSwitcher() {\n const LanesSwitcher = <LaneSwitcher groupByScope={this.lanesHost === 'workspace'} />;\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 return <LanesProvider>{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 routes = this.componentCompareUI.routes;\n const navLinks = this.componentCompareUI.navLinks;\n\n const getElement = (routeProps: RouteProps[], href?: string) => {\n if (routeProps.length === 1) return routeProps[0].element;\n if (!href) return undefined;\n return routeProps.find((route) => route.path?.startsWith(href))?.element;\n };\n\n const tabs: TabItem[] = flatten(\n Array.from(navLinks.entries()).map(([id, navProps]) => {\n const maybeRoutesForId = routes.get(id);\n const routesForId =\n (maybeRoutesForId && (Array.isArray(maybeRoutesForId) ? [...maybeRoutesForId] : [maybeRoutesForId])) || [];\n\n return navProps.map((navProp) => ({\n id: `${id}-${navProp.props.href}`,\n order: navProp.order,\n props: navProp.props,\n element: getElement(routesForId, navProp.props.href),\n }));\n })\n );\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]: [\n RouteSlot,\n LaneOverviewLineSlot,\n LanesOrderedNavigationSlot,\n MenuWidgetSlot\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 overviewSlot,\n menuWidgetSlot,\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 <UseLaneMenu host={lanesUi.lanesHost} viewedLaneId={viewedLane.id} currentLaneId={currentLane?.id} />;\n });\n lanesUi.registerLanesDropdown();\n return lanesUi;\n }\n}\n\nexport default LanesUI;\n\nLanesAspect.addRuntime(LanesUI);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAwF;AAAA;AAGjF,MAAMA,OAAO,CAAC;EAWnBC,WAAW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35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.501/dist/lanes.composition.js';
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.lanes_lanes@0.0.501/dist/lanes.docs.mdx';
|
3
3
|
|
4
4
|
export const compositions = [compositions_0];
|
5
5
|
export const overview = [overview_0];
|
package/lanes.ui.runtime.tsx
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
import React, { ReactNode } from 'react';
|
2
2
|
import { Route, RouteProps } from 'react-router-dom';
|
3
|
+
import { flatten } from 'lodash';
|
3
4
|
import { Slot, Harmony } from '@teambit/harmony';
|
5
|
+
import { LaneCompare, LaneCompareProps as DefaultLaneCompareProps } from '@teambit/lanes.ui.compare.lane-compare';
|
4
6
|
import { UIRuntime, UiUI, UIAspect } from '@teambit/ui';
|
5
7
|
import { LanesAspect } from '@teambit/lanes';
|
6
8
|
import { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';
|
@@ -8,7 +10,6 @@ import { NotFoundPage } from '@teambit/design.ui.pages.not-found';
|
|
8
10
|
import ScopeAspect, { ScopeUI } from '@teambit/scope';
|
9
11
|
import WorkspaceAspect, { WorkspaceUI } from '@teambit/workspace';
|
10
12
|
import ComponentAspect, { ComponentID, ComponentUI, useIdFromLocation } from '@teambit/component';
|
11
|
-
import SidebarAspect, { SidebarUI } from '@teambit/sidebar';
|
12
13
|
import { MenuWidget, MenuWidgetSlot } from '@teambit/ui-foundation.ui.menu';
|
13
14
|
import { LaneOverview, LaneOverviewLine, LaneOverviewLineSlot } from '@teambit/lanes.ui.lane-overview';
|
14
15
|
import {
|
@@ -22,9 +23,13 @@ import { LanesProvider, useLanes } from '@teambit/lanes.hooks.use-lanes';
|
|
22
23
|
import { LaneSwitcher } from '@teambit/lanes.ui.navigation.lane-switcher';
|
23
24
|
import { LaneId } from '@teambit/lane-id';
|
24
25
|
import { useViewedLaneFromUrl } from '@teambit/lanes.hooks.use-viewed-lane-from-url';
|
26
|
+
import { TabItem } from '@teambit/component.ui.component-compare.models.component-compare-props';
|
27
|
+
import { ComponentCompareAspect, ComponentCompareUI } from '@teambit/component-compare';
|
25
28
|
|
29
|
+
export type LaneCompareProps = Partial<DefaultLaneCompareProps>;
|
26
30
|
export class LanesUI {
|
27
|
-
static dependencies = [UIAspect, ComponentAspect, WorkspaceAspect, ScopeAspect,
|
31
|
+
static dependencies = [UIAspect, ComponentAspect, WorkspaceAspect, ScopeAspect, ComponentCompareAspect];
|
32
|
+
|
28
33
|
static runtime = UIRuntime;
|
29
34
|
static slots = [
|
30
35
|
Slot.withType<RouteProps>(),
|
@@ -34,7 +39,8 @@ export class LanesUI {
|
|
34
39
|
];
|
35
40
|
|
36
41
|
constructor(
|
37
|
-
private
|
42
|
+
private componentUI: ComponentUI,
|
43
|
+
private componentCompareUI: ComponentCompareUI,
|
38
44
|
private routeSlot: RouteSlot,
|
39
45
|
private navSlot: LanesOrderedNavigationSlot,
|
40
46
|
private menuWidgetSlot: MenuWidgetSlot,
|
@@ -69,6 +75,7 @@ export class LanesUI {
|
|
69
75
|
<Route path={LanesModel.lanePath}>
|
70
76
|
<Route index element={this.getLaneOverview()} />
|
71
77
|
<Route path="~component/*" element={this.getLaneComponent()} />
|
78
|
+
{/* <Route path="~compare/*" element={this.getLanesComparePage()} /> */}
|
72
79
|
<Route path="*" element={<NotFoundPage />} />
|
73
80
|
</Route>
|
74
81
|
<Route path="*" element={<NotFoundPage />} />
|
@@ -125,14 +132,14 @@ export class LanesUI {
|
|
125
132
|
};
|
126
133
|
|
127
134
|
getLaneComponent() {
|
128
|
-
return this.
|
135
|
+
return this.componentUI.getComponentUI(this.host, {
|
129
136
|
componentId: this.useComponentId,
|
130
137
|
useComponentFilters: this.useComponentFilters,
|
131
138
|
});
|
132
139
|
}
|
133
140
|
|
134
141
|
getLaneComponentMenu() {
|
135
|
-
return this.
|
142
|
+
return this.componentUI.getMenu(this.host, {
|
136
143
|
componentId: this.useComponentId,
|
137
144
|
useComponentFilters: this.useComponentFilters,
|
138
145
|
});
|
@@ -148,7 +155,7 @@ export class LanesUI {
|
|
148
155
|
path: LanesModel.lanesPrefix,
|
149
156
|
children: (
|
150
157
|
<Route path={`${LanesModel.lanePath}/*`}>
|
151
|
-
<Route path=
|
158
|
+
<Route path={'*'} element={this.getLanesOverviewMenu()} />
|
152
159
|
<Route path="~component/*" element={this.getLaneComponentMenu()} />
|
153
160
|
</Route>
|
154
161
|
),
|
@@ -186,6 +193,14 @@ export class LanesUI {
|
|
186
193
|
},
|
187
194
|
order: 1,
|
188
195
|
},
|
196
|
+
{
|
197
|
+
props: {
|
198
|
+
href: '~compare',
|
199
|
+
children: 'Lane Compare',
|
200
|
+
},
|
201
|
+
order: 2,
|
202
|
+
hide: () => true,
|
203
|
+
},
|
189
204
|
]);
|
190
205
|
}
|
191
206
|
|
@@ -239,8 +254,52 @@ export class LanesUI {
|
|
239
254
|
this.navSlot.register(routes);
|
240
255
|
}
|
241
256
|
|
257
|
+
getLaneCompare = (props: LaneCompareProps) => {
|
258
|
+
const routes = this.componentCompareUI.routes;
|
259
|
+
const navLinks = this.componentCompareUI.navLinks;
|
260
|
+
|
261
|
+
const getElement = (routeProps: RouteProps[], href?: string) => {
|
262
|
+
if (routeProps.length === 1) return routeProps[0].element;
|
263
|
+
if (!href) return undefined;
|
264
|
+
return routeProps.find((route) => route.path?.startsWith(href))?.element;
|
265
|
+
};
|
266
|
+
|
267
|
+
const tabs: TabItem[] = flatten(
|
268
|
+
Array.from(navLinks.entries()).map(([id, navProps]) => {
|
269
|
+
const maybeRoutesForId = routes.get(id);
|
270
|
+
const routesForId =
|
271
|
+
(maybeRoutesForId && (Array.isArray(maybeRoutesForId) ? [...maybeRoutesForId] : [maybeRoutesForId])) || [];
|
272
|
+
|
273
|
+
return navProps.map((navProp) => ({
|
274
|
+
id: `${id}-${navProp.props.href}`,
|
275
|
+
order: navProp.order,
|
276
|
+
props: navProp.props,
|
277
|
+
element: getElement(routesForId, navProp.props.href),
|
278
|
+
}));
|
279
|
+
})
|
280
|
+
);
|
281
|
+
|
282
|
+
if (!props.base || !props.compare) return null;
|
283
|
+
|
284
|
+
return (
|
285
|
+
<LaneCompare
|
286
|
+
{...props}
|
287
|
+
base={props.base}
|
288
|
+
compare={props.compare}
|
289
|
+
host={props.host || this.host}
|
290
|
+
tabs={props.tabs || tabs}
|
291
|
+
/>
|
292
|
+
);
|
293
|
+
};
|
294
|
+
|
242
295
|
static async provider(
|
243
|
-
[uiUi,
|
296
|
+
[uiUi, componentUI, workspaceUi, scopeUi, componentCompareUI]: [
|
297
|
+
UiUI,
|
298
|
+
ComponentUI,
|
299
|
+
WorkspaceUI,
|
300
|
+
ScopeUI,
|
301
|
+
ComponentCompareUI
|
302
|
+
],
|
244
303
|
_,
|
245
304
|
[routeSlot, overviewSlot, navSlot, menuWidgetSlot]: [
|
246
305
|
RouteSlot,
|
@@ -260,7 +319,16 @@ export class LanesUI {
|
|
260
319
|
if (host === ScopeAspect.id) {
|
261
320
|
scope = scopeUi;
|
262
321
|
}
|
263
|
-
const lanesUi = new LanesUI(
|
322
|
+
const lanesUi = new LanesUI(
|
323
|
+
componentUI,
|
324
|
+
componentCompareUI,
|
325
|
+
routeSlot,
|
326
|
+
navSlot,
|
327
|
+
overviewSlot,
|
328
|
+
menuWidgetSlot,
|
329
|
+
workspace,
|
330
|
+
scope
|
331
|
+
);
|
264
332
|
if (uiUi) uiUi.registerRenderHooks({ reactContext: lanesUi.renderContext });
|
265
333
|
lanesUi.registerRoutes();
|
266
334
|
lanesUi.registerMenuWidget(() => {
|
Binary file
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/lanes",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.501",
|
4
4
|
"homepage": "https://bit.dev/teambit/lanes/lanes",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.lanes",
|
8
8
|
"name": "lanes",
|
9
|
-
"version": "0.0.
|
9
|
+
"version": "0.0.501"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "2.4.2",
|
@@ -18,32 +18,33 @@
|
|
18
18
|
"core-js": "^3.0.0",
|
19
19
|
"@teambit/harmony": "0.3.3",
|
20
20
|
"@teambit/bit-error": "0.0.402",
|
21
|
-
"@teambit/lane-id": "0.0.
|
22
|
-
"@teambit/scope": "0.0.
|
23
|
-
"@teambit/lanes.ui.models.lanes-model": "0.0.
|
24
|
-
"@teambit/cli": "0.0.
|
25
|
-
"@teambit/workspace": "0.0.
|
26
|
-
"@teambit/express": "0.0.
|
27
|
-
"@teambit/logger": "0.0.
|
28
|
-
"@teambit/graphql": "0.0.
|
29
|
-
"@teambit/component-compare": "0.0.
|
30
|
-
"@teambit/component": "0.0.
|
31
|
-
"@teambit/export": "0.0.
|
32
|
-
"@teambit/importer": "0.0.
|
33
|
-
"@teambit/lanes.modules.diff": "0.0.
|
21
|
+
"@teambit/lane-id": "0.0.140",
|
22
|
+
"@teambit/scope": "0.0.929",
|
23
|
+
"@teambit/lanes.ui.models.lanes-model": "0.0.47",
|
24
|
+
"@teambit/cli": "0.0.622",
|
25
|
+
"@teambit/workspace": "0.0.929",
|
26
|
+
"@teambit/express": "0.0.720",
|
27
|
+
"@teambit/logger": "0.0.715",
|
28
|
+
"@teambit/graphql": "0.0.929",
|
29
|
+
"@teambit/component-compare": "0.0.177",
|
30
|
+
"@teambit/component": "0.0.929",
|
31
|
+
"@teambit/export": "0.0.929",
|
32
|
+
"@teambit/importer": "0.0.358",
|
33
|
+
"@teambit/lanes.modules.diff": "0.0.258",
|
34
34
|
"@teambit/legacy-bit-id": "0.0.421",
|
35
|
-
"@teambit/merging": "0.0.
|
35
|
+
"@teambit/merging": "0.0.244",
|
36
|
+
"@teambit/component.ui.component-compare.models.component-compare-props": "0.0.2",
|
36
37
|
"@teambit/design.ui.pages.not-found": "0.0.366",
|
37
|
-
"@teambit/lanes.hooks.use-lanes": "0.0.
|
38
|
-
"@teambit/lanes.hooks.use-viewed-lane-from-url": "0.0.
|
39
|
-
"@teambit/lanes.ui.lane-
|
38
|
+
"@teambit/lanes.hooks.use-lanes": "0.0.85",
|
39
|
+
"@teambit/lanes.hooks.use-viewed-lane-from-url": "0.0.47",
|
40
|
+
"@teambit/lanes.ui.compare.lane-compare": "0.0.2",
|
41
|
+
"@teambit/lanes.ui.lane-overview": "0.0.47",
|
40
42
|
"@teambit/lanes.ui.menus.lanes-overview-menu": "0.0.4",
|
41
|
-
"@teambit/lanes.ui.menus.use-lanes-menu": "0.0.
|
42
|
-
"@teambit/lanes.ui.navigation.lane-switcher": "0.0.
|
43
|
-
"@teambit/sidebar": "0.0.927",
|
43
|
+
"@teambit/lanes.ui.menus.use-lanes-menu": "0.0.47",
|
44
|
+
"@teambit/lanes.ui.navigation.lane-switcher": "0.0.47",
|
44
45
|
"@teambit/ui-foundation.ui.menu": "0.0.496",
|
45
|
-
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.
|
46
|
-
"@teambit/ui": "0.0.
|
46
|
+
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.500",
|
47
|
+
"@teambit/ui": "0.0.929"
|
47
48
|
},
|
48
49
|
"devDependencies": {
|
49
50
|
"@types/react": "^17.0.8",
|
@@ -57,12 +58,12 @@
|
|
57
58
|
"@types/node": "12.20.4",
|
58
59
|
"@teambit/component.testing.mock-components": "0.0.17",
|
59
60
|
"@teambit/harmony.testing.load-aspect": "0.0.16",
|
60
|
-
"@teambit/snapping": "0.0.
|
61
|
+
"@teambit/snapping": "0.0.244",
|
61
62
|
"@teambit/workspace.testing.mock-workspace": "0.0.14"
|
62
63
|
},
|
63
64
|
"peerDependencies": {
|
64
65
|
"react-router-dom": "^6.0.0",
|
65
|
-
"@teambit/legacy": "1.0.
|
66
|
+
"@teambit/legacy": "1.0.403",
|
66
67
|
"react-dom": "^16.8.0 || ^17.0.0",
|
67
68
|
"react": "^16.8.0 || ^17.0.0"
|
68
69
|
},
|
Binary file
|