@teambit/lanes 1.0.107 → 1.0.109
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/artifacts/__bit_junit.xml +13 -0
- package/artifacts/preview/teambit_lanes_lanes-preview.js +1 -0
- package/dist/create-lane.js +1 -1
- package/dist/create-lane.js.map +1 -1
- package/dist/lane.cmd.d.ts +15 -15
- package/dist/lane.cmd.js +3 -4
- package/dist/lane.cmd.js.map +1 -1
- package/dist/lanes.composition.d.ts +2 -2
- package/dist/lanes.graphql.js +8 -11
- package/dist/lanes.graphql.js.map +1 -1
- package/dist/lanes.main.runtime.d.ts +10 -19
- package/dist/lanes.main.runtime.js +45 -77
- package/dist/lanes.main.runtime.js.map +1 -1
- package/dist/lanes.spec.js +34 -43
- package/dist/lanes.spec.js.map +1 -1
- package/dist/lanes.ui.runtime.d.ts +14 -14
- package/dist/lanes.ui.runtime.js +8 -10
- package/dist/lanes.ui.runtime.js.map +1 -1
- package/dist/{preview-1703590665075.js → preview-1703698405864.js} +2 -2
- package/dist/switch-lanes.d.ts +1 -1
- package/dist/switch-lanes.js +1 -2
- package/dist/switch-lanes.js.map +1 -1
- package/package.json +31 -40
- package/tsconfig.json +16 -21
- package/types/asset.d.ts +15 -3
package/dist/switch-lanes.js
CHANGED
@@ -131,7 +131,6 @@ to be up to date with the remote lane, please run "bit checkout head""`);
|
|
131
131
|
}
|
132
132
|
}
|
133
133
|
async saveLanesData() {
|
134
|
-
var _this$laneToSwitchTo;
|
135
134
|
const localLaneName = this.switchProps.alias || this.laneIdToSwitchTo.name;
|
136
135
|
if (this.switchProps.remoteLane) {
|
137
136
|
if (!this.switchProps.localTrackedLane) {
|
@@ -142,7 +141,7 @@ to be up to date with the remote lane, please run "bit checkout head""`);
|
|
142
141
|
});
|
143
142
|
}
|
144
143
|
}
|
145
|
-
this.consumer.setCurrentLane(this.laneIdToSwitchTo, !
|
144
|
+
this.consumer.setCurrentLane(this.laneIdToSwitchTo, !this.laneToSwitchTo?.isNew);
|
146
145
|
this.consumer.bitMap.syncWithIds(_componentId().ComponentIdList.fromArray(this.switchProps.ids || []), _componentId().ComponentIdList.fromArray(this.switchProps.laneBitIds || []));
|
147
146
|
}
|
148
147
|
}
|
package/dist/switch-lanes.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_laneId","data","require","_componentId","_bitError","_createLane","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","LaneSwitcher","constructor","workspace","logger","switchProps","checkoutProps","Lanes","consumer","switch","setStatusLine","isOnMain","throwForStagedComponents","populateSwitchProps","bitMapIds","bitmapIdsFromCurrentLaneIncludeRemoved","idsToSwitch","ids","idsWithVersion","map","id","bitMapId","searchWithoutVersion","resolveMultipleComponentIds","allowAddingComponentsFromScope","versionPerId","lane","laneToSwitchTo","results","checkout","saveLanesData","onDestroy","laneId","scope","lanes","parseLaneIdFromString","laneName","localLane","loadLane","mainIds","getIdsOfDefaultLane","isDefault","populatePropsAccordingToDefaultLane","laneIds","populatePropsAccordingToLocalLane","populatePropsAccordingToRemoteLane","idsOnLaneOnly","find","isEqualWithoutVersion","idsOnMainOnly","laneBitIds","pattern","bitMap","getAllBitIdsFromAllLanes","BitError","allIds","patternIds","filterIdsFromPoolIdsByPattern","remoteLaneId","laneIdToSwitchTo","debug","toString","throwForSwitchingToCurrentLane","remoteLane","fetchLaneWithItsComponents","name","localTrackedLane","getAliasByLaneId","undefined","components","l","changeVersion","head","LaneId","from","DEFAULT_LANE","toLaneId","c","getCurrentLaneId","isEqual","laneIdStr","_this$laneToSwitchTo","localLaneName","alias","trackLane","remoteScope","setCurrentLane","isNew","syncWithIds","ComponentIdList","fromArray","exports"],"sources":["switch-lanes.ts"],"sourcesContent":["import { Consumer } from '@teambit/legacy/dist/consumer';\nimport { LaneId, DEFAULT_LANE } from '@teambit/lane-id';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { ApplyVersionResults } from '@teambit/merging';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { CheckoutPropsLegacy, CheckoutProps } from '@teambit/checkout';\nimport { Workspace } from '@teambit/workspace';\nimport { Logger } from '@teambit/logger';\nimport { BitError } from '@teambit/bit-error';\nimport { LanesMain } from './lanes.main.runtime';\nimport { throwForStagedComponents } from './create-lane';\n\nexport type SwitchProps = {\n laneName: string;\n ids?: ComponentID[];\n laneBitIds?: ComponentID[]; // only needed for the deprecated onLanesOnly prop. once this prop is removed, this prop can be removed as well.\n pattern?: string;\n existingOnWorkspaceOnly: boolean;\n remoteLane?: Lane;\n localTrackedLane?: string;\n alias?: string;\n};\n\nexport class LaneSwitcher {\n private consumer: Consumer;\n private laneIdToSwitchTo: LaneId; // populated by `this.populateSwitchProps()`\n private laneToSwitchTo: Lane | undefined; // populated by `this.populateSwitchProps()`, if default-lane, it's undefined\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private switchProps: SwitchProps,\n private checkoutProps: CheckoutPropsLegacy,\n private Lanes: LanesMain\n ) {\n this.consumer = this.workspace.consumer;\n }\n\n async switch(): Promise<ApplyVersionResults> {\n this.logger.setStatusLine(`switching lanes`);\n if (this.workspace.isOnMain()) {\n await throwForStagedComponents(this.consumer);\n }\n await this.populateSwitchProps();\n const bitMapIds = this.workspace.consumer.bitmapIdsFromCurrentLaneIncludeRemoved;\n const idsToSwitch = this.switchProps.ids || [];\n const idsWithVersion = idsToSwitch.map((id) => {\n const bitMapId = bitMapIds.searchWithoutVersion(id);\n return bitMapId || id;\n });\n const ids = await this.workspace.resolveMultipleComponentIds(idsWithVersion);\n\n const checkoutProps: CheckoutProps = {\n ...this.checkoutProps,\n ids,\n allowAddingComponentsFromScope: true,\n versionPerId: await this.workspace.resolveMultipleComponentIds(idsToSwitch),\n lane: this.laneToSwitchTo,\n };\n\n const results = await this.Lanes.checkout.checkout(checkoutProps);\n\n await this.saveLanesData();\n await this.consumer.onDestroy('lane-switch');\n\n return results;\n }\n\n private async populateSwitchProps() {\n const laneId = await this.consumer.scope.lanes.parseLaneIdFromString(this.switchProps.laneName);\n\n const localLane = await this.consumer.scope.loadLane(laneId);\n const mainIds = await this.consumer.getIdsOfDefaultLane();\n if (laneId.isDefault()) {\n await this.populatePropsAccordingToDefaultLane();\n this.switchProps.ids = mainIds;\n } else {\n const laneIds = localLane\n ? this.populatePropsAccordingToLocalLane(localLane)\n : await this.populatePropsAccordingToRemoteLane(laneId);\n const idsOnLaneOnly = laneIds.filter((id) => !mainIds.find((i) => i.isEqualWithoutVersion(id)));\n const idsOnMainOnly = mainIds.filter((id) => !laneIds.find((i) => i.isEqualWithoutVersion(id)));\n this.switchProps.ids = [...idsOnMainOnly, ...laneIds];\n this.switchProps.laneBitIds = idsOnLaneOnly;\n }\n\n if (this.switchProps.pattern) {\n if (this.consumer.bitMap.getAllBitIdsFromAllLanes().length) {\n // if the workspace is not empty, it's possible that it has components from lane-x, and is now switching\n // partially to lane-y, while lane-y has the same components as lane-x. in which case, the user ends up with\n // an invalid state of components from lane-x and lane-y together.\n throw new BitError('error: use --pattern only when the workspace is empty');\n }\n const allIds = await this.workspace.resolveMultipleComponentIds(this.switchProps.ids || []);\n const patternIds = await this.workspace.filterIdsFromPoolIdsByPattern(this.switchProps.pattern, allIds);\n this.switchProps.ids = patternIds.map((id) => id);\n }\n }\n\n private async populatePropsAccordingToRemoteLane(remoteLaneId: LaneId): Promise<ComponentID[]> {\n this.laneIdToSwitchTo = remoteLaneId;\n this.logger.debug(`populatePropsAccordingToRemoteLane, remoteLaneId: ${remoteLaneId.toString()}`);\n this.throwForSwitchingToCurrentLane();\n const remoteLane = await this.Lanes.fetchLaneWithItsComponents(remoteLaneId);\n this.switchProps.laneName = remoteLaneId.name;\n this.switchProps.localTrackedLane = this.consumer.scope.lanes.getAliasByLaneId(remoteLaneId) || undefined;\n this.switchProps.remoteLane = remoteLane;\n this.laneToSwitchTo = remoteLane;\n this.logger.debug(`populatePropsAccordingToRemoteLane, completed`);\n return remoteLane.components.map((l) => l.id.changeVersion(l.head.toString()));\n }\n\n private async populatePropsAccordingToDefaultLane() {\n this.laneIdToSwitchTo = LaneId.from(DEFAULT_LANE, this.consumer.scope.name);\n this.throwForSwitchingToCurrentLane();\n }\n\n private populatePropsAccordingToLocalLane(localLane: Lane): ComponentID[] {\n this.laneIdToSwitchTo = localLane.toLaneId();\n this.laneToSwitchTo = localLane;\n this.throwForSwitchingToCurrentLane();\n return localLane.components.map((c) => c.id.changeVersion(c.head.toString()));\n }\n\n private throwForSwitchingToCurrentLane() {\n if (this.consumer.getCurrentLaneId().isEqual(this.laneIdToSwitchTo)) {\n const laneIdStr = this.laneIdToSwitchTo.isDefault()\n ? this.laneIdToSwitchTo.name\n : this.laneIdToSwitchTo.toString();\n throw new BitError(`already checked out to \"${laneIdStr}\".\nto be up to date with the remote lane, please run \"bit checkout head\"\"`);\n }\n }\n\n private async saveLanesData() {\n const localLaneName = this.switchProps.alias || this.laneIdToSwitchTo.name;\n if (this.switchProps.remoteLane) {\n if (!this.switchProps.localTrackedLane) {\n this.consumer.scope.lanes.trackLane({\n localLane: localLaneName,\n remoteLane: this.laneIdToSwitchTo.name,\n remoteScope: this.laneIdToSwitchTo.scope,\n });\n }\n }\n\n this.consumer.setCurrentLane(this.laneIdToSwitchTo, !this.laneToSwitchTo?.isNew);\n this.consumer.bitMap.syncWithIds(\n ComponentIdList.fromArray(this.switchProps.ids || []),\n ComponentIdList.fromArray(this.switchProps.laneBitIds || [])\n );\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,aAAA;EA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C/B,IAAI,CAAC,IAAI,CAAC1D,WAAW,CAAC6D,gBAAgB,EAAE;QACtC,IAAI,CAAC1D,QAAQ,CAACyB,KAAK,CAACC,KAAK,CAACkD,SAAS,CAAC;UAClC/C,SAAS,EAAE6C,aAAa;UACxBnB,UAAU,EAAE,IAAI,CAACJ,gBAAgB,CAACM,IAAI;UACtCoB,WAAW,EAAE,IAAI,CAAC1B,gBAAgB,CAAC1B;QACrC,CAAC,CAAC;MACJ;IACF;IAEA,IAAI,CAACzB,QAAQ,CAAC8E,cAAc,CAAC,IAAI,CAAC3B,gBAAgB,EAAE,GAAAsB,oBAAA,GAAC,IAAI,CAACtD,cAAc,cAAAsD,oBAAA,eAAnBA,oBAAA,CAAqBM,KAAK,EAAC;IAChF,IAAI,CAAC/E,QAAQ,CAAC4C,MAAM,CAACoC,WAAW,CAC9BC,8BAAe,CAACC,SAAS,CAAC,IAAI,CAACrF,WAAW,CAACY,GAAG,IAAI,EAAE,CAAC,EACrDwE,8BAAe,CAACC,SAAS,CAAC,IAAI,CAACrF,WAAW,CAAC6C,UAAU,IAAI,EAAE,CAC7D,CAAC;EACH;AACF;AAACyC,OAAA,CAAA1F,YAAA,GAAAA,YAAA"}
|
1
|
+
{"version":3,"names":["_laneId","data","require","_componentId","_bitError","_createLane","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","obj","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","LaneSwitcher","constructor","workspace","logger","switchProps","checkoutProps","Lanes","consumer","switch","setStatusLine","isOnMain","throwForStagedComponents","populateSwitchProps","bitMapIds","bitmapIdsFromCurrentLaneIncludeRemoved","idsToSwitch","ids","idsWithVersion","map","id","bitMapId","searchWithoutVersion","resolveMultipleComponentIds","allowAddingComponentsFromScope","versionPerId","lane","laneToSwitchTo","results","checkout","saveLanesData","onDestroy","laneId","scope","lanes","parseLaneIdFromString","laneName","localLane","loadLane","mainIds","getIdsOfDefaultLane","isDefault","populatePropsAccordingToDefaultLane","laneIds","populatePropsAccordingToLocalLane","populatePropsAccordingToRemoteLane","idsOnLaneOnly","find","isEqualWithoutVersion","idsOnMainOnly","laneBitIds","pattern","bitMap","getAllBitIdsFromAllLanes","BitError","allIds","patternIds","filterIdsFromPoolIdsByPattern","remoteLaneId","laneIdToSwitchTo","debug","toString","throwForSwitchingToCurrentLane","remoteLane","fetchLaneWithItsComponents","name","localTrackedLane","getAliasByLaneId","undefined","components","l","changeVersion","head","LaneId","from","DEFAULT_LANE","toLaneId","c","getCurrentLaneId","isEqual","laneIdStr","localLaneName","alias","trackLane","remoteScope","setCurrentLane","isNew","syncWithIds","ComponentIdList","fromArray","exports"],"sources":["switch-lanes.ts"],"sourcesContent":["import { Consumer } from '@teambit/legacy/dist/consumer';\nimport { LaneId, DEFAULT_LANE } from '@teambit/lane-id';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { ApplyVersionResults } from '@teambit/merging';\nimport { Lane } from '@teambit/legacy/dist/scope/models';\nimport { CheckoutPropsLegacy, CheckoutProps } from '@teambit/checkout';\nimport { Workspace } from '@teambit/workspace';\nimport { Logger } from '@teambit/logger';\nimport { BitError } from '@teambit/bit-error';\nimport { LanesMain } from './lanes.main.runtime';\nimport { throwForStagedComponents } from './create-lane';\n\nexport type SwitchProps = {\n laneName: string;\n ids?: ComponentID[];\n laneBitIds?: ComponentID[]; // only needed for the deprecated onLanesOnly prop. once this prop is removed, this prop can be removed as well.\n pattern?: string;\n existingOnWorkspaceOnly: boolean;\n remoteLane?: Lane;\n localTrackedLane?: string;\n alias?: string;\n};\n\nexport class LaneSwitcher {\n private consumer: Consumer;\n private laneIdToSwitchTo: LaneId; // populated by `this.populateSwitchProps()`\n private laneToSwitchTo: Lane | undefined; // populated by `this.populateSwitchProps()`, if default-lane, it's undefined\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private switchProps: SwitchProps,\n private checkoutProps: CheckoutPropsLegacy,\n private Lanes: LanesMain\n ) {\n this.consumer = this.workspace.consumer;\n }\n\n async switch(): Promise<ApplyVersionResults> {\n this.logger.setStatusLine(`switching lanes`);\n if (this.workspace.isOnMain()) {\n await throwForStagedComponents(this.consumer);\n }\n await this.populateSwitchProps();\n const bitMapIds = this.workspace.consumer.bitmapIdsFromCurrentLaneIncludeRemoved;\n const idsToSwitch = this.switchProps.ids || [];\n const idsWithVersion = idsToSwitch.map((id) => {\n const bitMapId = bitMapIds.searchWithoutVersion(id);\n return bitMapId || id;\n });\n const ids = await this.workspace.resolveMultipleComponentIds(idsWithVersion);\n\n const checkoutProps: CheckoutProps = {\n ...this.checkoutProps,\n ids,\n allowAddingComponentsFromScope: true,\n versionPerId: await this.workspace.resolveMultipleComponentIds(idsToSwitch),\n lane: this.laneToSwitchTo,\n };\n\n const results = await this.Lanes.checkout.checkout(checkoutProps);\n\n await this.saveLanesData();\n await this.consumer.onDestroy('lane-switch');\n\n return results;\n }\n\n private async populateSwitchProps() {\n const laneId = await this.consumer.scope.lanes.parseLaneIdFromString(this.switchProps.laneName);\n\n const localLane = await this.consumer.scope.loadLane(laneId);\n const mainIds = await this.consumer.getIdsOfDefaultLane();\n if (laneId.isDefault()) {\n await this.populatePropsAccordingToDefaultLane();\n this.switchProps.ids = mainIds;\n } else {\n const laneIds = localLane\n ? this.populatePropsAccordingToLocalLane(localLane)\n : await this.populatePropsAccordingToRemoteLane(laneId);\n const idsOnLaneOnly = laneIds.filter((id) => !mainIds.find((i) => i.isEqualWithoutVersion(id)));\n const idsOnMainOnly = mainIds.filter((id) => !laneIds.find((i) => i.isEqualWithoutVersion(id)));\n this.switchProps.ids = [...idsOnMainOnly, ...laneIds];\n this.switchProps.laneBitIds = idsOnLaneOnly;\n }\n\n if (this.switchProps.pattern) {\n if (this.consumer.bitMap.getAllBitIdsFromAllLanes().length) {\n // if the workspace is not empty, it's possible that it has components from lane-x, and is now switching\n // partially to lane-y, while lane-y has the same components as lane-x. in which case, the user ends up with\n // an invalid state of components from lane-x and lane-y together.\n throw new BitError('error: use --pattern only when the workspace is empty');\n }\n const allIds = await this.workspace.resolveMultipleComponentIds(this.switchProps.ids || []);\n const patternIds = await this.workspace.filterIdsFromPoolIdsByPattern(this.switchProps.pattern, allIds);\n this.switchProps.ids = patternIds.map((id) => id);\n }\n }\n\n private async populatePropsAccordingToRemoteLane(remoteLaneId: LaneId): Promise<ComponentID[]> {\n this.laneIdToSwitchTo = remoteLaneId;\n this.logger.debug(`populatePropsAccordingToRemoteLane, remoteLaneId: ${remoteLaneId.toString()}`);\n this.throwForSwitchingToCurrentLane();\n const remoteLane = await this.Lanes.fetchLaneWithItsComponents(remoteLaneId);\n this.switchProps.laneName = remoteLaneId.name;\n this.switchProps.localTrackedLane = this.consumer.scope.lanes.getAliasByLaneId(remoteLaneId) || undefined;\n this.switchProps.remoteLane = remoteLane;\n this.laneToSwitchTo = remoteLane;\n this.logger.debug(`populatePropsAccordingToRemoteLane, completed`);\n return remoteLane.components.map((l) => l.id.changeVersion(l.head.toString()));\n }\n\n private async populatePropsAccordingToDefaultLane() {\n this.laneIdToSwitchTo = LaneId.from(DEFAULT_LANE, this.consumer.scope.name);\n this.throwForSwitchingToCurrentLane();\n }\n\n private populatePropsAccordingToLocalLane(localLane: Lane): ComponentID[] {\n this.laneIdToSwitchTo = localLane.toLaneId();\n this.laneToSwitchTo = localLane;\n this.throwForSwitchingToCurrentLane();\n return localLane.components.map((c) => c.id.changeVersion(c.head.toString()));\n }\n\n private throwForSwitchingToCurrentLane() {\n if (this.consumer.getCurrentLaneId().isEqual(this.laneIdToSwitchTo)) {\n const laneIdStr = this.laneIdToSwitchTo.isDefault()\n ? this.laneIdToSwitchTo.name\n : this.laneIdToSwitchTo.toString();\n throw new BitError(`already checked out to \"${laneIdStr}\".\nto be up to date with the remote lane, please run \"bit checkout head\"\"`);\n }\n }\n\n private async saveLanesData() {\n const localLaneName = this.switchProps.alias || this.laneIdToSwitchTo.name;\n if (this.switchProps.remoteLane) {\n if (!this.switchProps.localTrackedLane) {\n this.consumer.scope.lanes.trackLane({\n localLane: localLaneName,\n remoteLane: this.laneIdToSwitchTo.name,\n remoteScope: this.laneIdToSwitchTo.scope,\n });\n }\n }\n\n this.consumer.setCurrentLane(this.laneIdToSwitchTo, !this.laneToSwitchTo?.isNew);\n this.consumer.bitMap.syncWithIds(\n ComponentIdList.fromArray(this.switchProps.ids || []),\n ComponentIdList.fromArray(this.switchProps.laneBitIds || [])\n );\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,aAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,YAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAMA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAyD,SAAAK,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IA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,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/lanes",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.109",
|
4
4
|
"homepage": "https://bit.cloud/teambit/lanes/lanes",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.lanes",
|
8
8
|
"name": "lanes",
|
9
|
-
"version": "1.0.
|
9
|
+
"version": "1.0.109"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"lodash": "4.17.21",
|
@@ -16,8 +16,6 @@
|
|
16
16
|
"graphql-tag": "2.12.1",
|
17
17
|
"p-map-series": "2.1.0",
|
18
18
|
"p-map": "4.0.0",
|
19
|
-
"core-js": "^3.0.0",
|
20
|
-
"@babel/runtime": "7.20.0",
|
21
19
|
"@teambit/bit-error": "0.0.404",
|
22
20
|
"@teambit/component-version": "1.0.3",
|
23
21
|
"@teambit/lane-id": "0.0.311",
|
@@ -38,44 +36,40 @@
|
|
38
36
|
"@teambit/ui-foundation.ui.menu": "0.0.502",
|
39
37
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.506",
|
40
38
|
"@teambit/ui-foundation.ui.react-router.use-query": "0.0.501",
|
41
|
-
"@teambit/scope": "1.0.
|
42
|
-
"@teambit/snapping": "1.0.
|
43
|
-
"@teambit/workspace": "1.0.
|
44
|
-
"@teambit/cli": "0.0.
|
45
|
-
"@teambit/express": "0.0.
|
46
|
-
"@teambit/logger": "0.0.
|
47
|
-
"@teambit/graphql": "1.0.
|
48
|
-
"@teambit/checkout": "1.0.
|
49
|
-
"@teambit/component-compare": "1.0.
|
50
|
-
"@teambit/component-writer": "1.0.
|
51
|
-
"@teambit/component": "1.0.
|
52
|
-
"@teambit/export": "1.0.
|
53
|
-
"@teambit/importer": "1.0.
|
54
|
-
"@teambit/lanes.entities.lane-diff": "0.0.164",
|
39
|
+
"@teambit/scope": "1.0.109",
|
40
|
+
"@teambit/snapping": "1.0.109",
|
41
|
+
"@teambit/workspace": "1.0.109",
|
42
|
+
"@teambit/cli": "0.0.841",
|
43
|
+
"@teambit/express": "0.0.940",
|
44
|
+
"@teambit/logger": "0.0.934",
|
45
|
+
"@teambit/graphql": "1.0.109",
|
46
|
+
"@teambit/checkout": "1.0.109",
|
47
|
+
"@teambit/component-compare": "1.0.109",
|
48
|
+
"@teambit/component-writer": "1.0.109",
|
49
|
+
"@teambit/component": "1.0.109",
|
50
|
+
"@teambit/export": "1.0.109",
|
51
|
+
"@teambit/importer": "1.0.109",
|
55
52
|
"@teambit/lanes.modules.diff": "0.0.438",
|
56
|
-
"@teambit/merging": "1.0.
|
57
|
-
"@teambit/remove": "1.0.
|
58
|
-
"@teambit/
|
53
|
+
"@teambit/merging": "1.0.109",
|
54
|
+
"@teambit/remove": "1.0.109",
|
55
|
+
"@teambit/lanes.entities.lane-diff": "0.0.164",
|
56
|
+
"@teambit/ui": "1.0.109"
|
59
57
|
},
|
60
58
|
"devDependencies": {
|
61
59
|
"@types/lodash": "4.14.165",
|
62
|
-
"@types/react": "^17.0.8",
|
63
|
-
"@types/chai": "4.2.15",
|
64
|
-
"chai": "4.3.0",
|
65
60
|
"@types/mocha": "9.1.0",
|
66
|
-
"@types/
|
67
|
-
"@types/
|
68
|
-
"@
|
69
|
-
"@
|
70
|
-
"@teambit/
|
71
|
-
"@teambit/harmony.testing.load-aspect": "0.0.178",
|
61
|
+
"@types/jest": "^29.2.2",
|
62
|
+
"@types/testing-library__jest-dom": "^5.9.5",
|
63
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.14",
|
64
|
+
"@teambit/component.testing.mock-components": "0.0.181",
|
65
|
+
"@teambit/harmony.testing.load-aspect": "0.0.180",
|
72
66
|
"@teambit/workspace.testing.mock-workspace": "0.0.18"
|
73
67
|
},
|
74
68
|
"peerDependencies": {
|
75
|
-
"react
|
76
|
-
"
|
77
|
-
"react": "^
|
78
|
-
"
|
69
|
+
"react": "^17.0.0 || ^18.0.0",
|
70
|
+
"react-router-dom": "^6.8.1",
|
71
|
+
"@types/react": "^18.2.12",
|
72
|
+
"@teambit/legacy": "1.0.624"
|
79
73
|
},
|
80
74
|
"license": "Apache-2.0",
|
81
75
|
"optionalDependencies": {},
|
@@ -89,7 +83,7 @@
|
|
89
83
|
},
|
90
84
|
"private": false,
|
91
85
|
"engines": {
|
92
|
-
"node": ">=
|
86
|
+
"node": ">=16.0.0"
|
93
87
|
},
|
94
88
|
"repository": {
|
95
89
|
"type": "git",
|
@@ -98,12 +92,9 @@
|
|
98
92
|
"keywords": [
|
99
93
|
"bit",
|
100
94
|
"bit-aspect",
|
95
|
+
"bit-core-aspect",
|
101
96
|
"components",
|
102
97
|
"collaboration",
|
103
|
-
"web"
|
104
|
-
"react",
|
105
|
-
"react-components",
|
106
|
-
"angular",
|
107
|
-
"angular-components"
|
98
|
+
"web"
|
108
99
|
]
|
109
100
|
}
|
package/tsconfig.json
CHANGED
@@ -1,38 +1,33 @@
|
|
1
1
|
{
|
2
2
|
"compilerOptions": {
|
3
3
|
"lib": [
|
4
|
-
"
|
5
|
-
"
|
6
|
-
"
|
7
|
-
"DOM.Iterable",
|
8
|
-
"ScriptHost"
|
4
|
+
"esnext",
|
5
|
+
"dom",
|
6
|
+
"dom.Iterable"
|
9
7
|
],
|
10
|
-
"target": "
|
11
|
-
"module": "
|
12
|
-
"jsx": "react",
|
13
|
-
"allowJs": true,
|
14
|
-
"composite": true,
|
8
|
+
"target": "es2020",
|
9
|
+
"module": "es2020",
|
10
|
+
"jsx": "react-jsx",
|
15
11
|
"declaration": true,
|
16
12
|
"sourceMap": true,
|
17
|
-
"skipLibCheck": true,
|
18
13
|
"experimentalDecorators": true,
|
19
|
-
"
|
14
|
+
"skipLibCheck": true,
|
20
15
|
"moduleResolution": "node",
|
21
16
|
"esModuleInterop": true,
|
22
|
-
"rootDir": ".",
|
23
17
|
"resolveJsonModule": true,
|
24
|
-
"
|
25
|
-
"
|
26
|
-
"
|
27
|
-
"strictPropertyInitialization": false,
|
28
|
-
"strict": true,
|
29
|
-
"noImplicitAny": false,
|
30
|
-
"preserveConstEnums": true
|
18
|
+
"allowJs": true,
|
19
|
+
"outDir": "dist",
|
20
|
+
"emitDeclarationOnly": true
|
31
21
|
},
|
32
22
|
"exclude": [
|
23
|
+
"artifacts",
|
24
|
+
"public",
|
33
25
|
"dist",
|
26
|
+
"node_modules",
|
27
|
+
"package.json",
|
34
28
|
"esm.mjs",
|
35
|
-
"
|
29
|
+
"**/*.cjs",
|
30
|
+
"./dist"
|
36
31
|
],
|
37
32
|
"include": [
|
38
33
|
"**/*",
|
package/types/asset.d.ts
CHANGED
@@ -5,12 +5,12 @@ declare module '*.png' {
|
|
5
5
|
declare module '*.svg' {
|
6
6
|
import type { FunctionComponent, SVGProps } from 'react';
|
7
7
|
|
8
|
-
export const ReactComponent: FunctionComponent<
|
8
|
+
export const ReactComponent: FunctionComponent<
|
9
|
+
SVGProps<SVGSVGElement> & { title?: string }
|
10
|
+
>;
|
9
11
|
const src: string;
|
10
12
|
export default src;
|
11
13
|
}
|
12
|
-
|
13
|
-
// @TODO Gilad
|
14
14
|
declare module '*.jpg' {
|
15
15
|
const value: any;
|
16
16
|
export = value;
|
@@ -27,3 +27,15 @@ declare module '*.bmp' {
|
|
27
27
|
const value: any;
|
28
28
|
export = value;
|
29
29
|
}
|
30
|
+
declare module '*.otf' {
|
31
|
+
const value: any;
|
32
|
+
export = value;
|
33
|
+
}
|
34
|
+
declare module '*.woff' {
|
35
|
+
const value: any;
|
36
|
+
export = value;
|
37
|
+
}
|
38
|
+
declare module '*.woff2' {
|
39
|
+
const value: any;
|
40
|
+
export = value;
|
41
|
+
}
|