@teambit/workspace 0.0.713 → 0.0.714
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/bit-map.d.ts +2 -0
- package/dist/bit-map.js +19 -0
- package/dist/bit-map.js.map +1 -1
- package/package-tar/teambit-workspace-0.0.714.tgz +0 -0
- package/package.json +30 -30
- package/{preview-1650598046924.js → preview-1650684349376.js} +2 -2
- package/package-tar/teambit-workspace-0.0.713.tgz +0 -0
package/dist/bit-map.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export declare class BitMap {
|
|
|
20
20
|
removeComponentConfig(id: ComponentID, aspectId: string, markWithMinusIfNotExist: boolean): boolean;
|
|
21
21
|
removeEntireConfig(id: ComponentID): boolean;
|
|
22
22
|
setEntireConfig(id: ComponentID, config: Record<string, any>): void;
|
|
23
|
+
removeDefaultScope(id: ComponentID): void;
|
|
24
|
+
setDefaultScope(id: ComponentID, defaultScope: string): void;
|
|
23
25
|
/**
|
|
24
26
|
* write .bitmap object to the filesystem
|
|
25
27
|
*/
|
package/dist/bit-map.js
CHANGED
|
@@ -112,6 +112,25 @@ class BitMap {
|
|
|
112
112
|
bitMapEntry.config = config;
|
|
113
113
|
this.legacyBitMap.markAsChanged();
|
|
114
114
|
}
|
|
115
|
+
|
|
116
|
+
removeDefaultScope(id) {
|
|
117
|
+
const bitMapEntry = this.getBitmapEntry(id, {
|
|
118
|
+
ignoreScopeAndVersion: true
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
if (bitMapEntry.defaultScope) {
|
|
122
|
+
delete bitMapEntry.defaultScope;
|
|
123
|
+
this.legacyBitMap.markAsChanged();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
setDefaultScope(id, defaultScope) {
|
|
128
|
+
const bitMapEntry = this.getBitmapEntry(id, {
|
|
129
|
+
ignoreScopeAndVersion: true
|
|
130
|
+
});
|
|
131
|
+
bitMapEntry.defaultScope = defaultScope;
|
|
132
|
+
this.legacyBitMap.markAsChanged();
|
|
133
|
+
}
|
|
115
134
|
/**
|
|
116
135
|
* write .bitmap object to the filesystem
|
|
117
136
|
*/
|
package/dist/bit-map.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["bit-map.ts"],"names":["BitMap","constructor","legacyBitMap","consumer","addComponentConfig","id","aspectId","config","Error","bitMapEntry","getBitmapEntry","ignoreScopeAndVersion","currentConfig","markAsChanged","removeComponentConfig","markWithMinusIfNotExist","REMOVE_EXTENSION_SPECIAL_SIGN","removeEntireConfig","setEntireConfig","write","writeBitMap","ignoreVersion","getComponent","_legacy","getAspectIdFromConfig","componentId","ignoreAspectVersion","undefined","toString","allVersions","Object","keys","filter","startsWith","toStringWithoutVersion","length","BitError","join","renameNewComponent","sourceId","targetId","hasVersion","removeComponent","setComponent"],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAMA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AACA;AACA;AACA;AACO,MAAMA,MAAN,CAAa;AAClBC,EAAAA,WAAW,CAASC,YAAT,EAA6CC,QAA7C,EAAiE;AAAA,SAAxDD,YAAwD,GAAxDA,YAAwD;AAAA,SAApBC,QAAoB,GAApBA,QAAoB;AAAE;AAE9E;AACF;AACA;AACA;AACA;;;AACEC,EAAAA,kBAAkB,CAACC,EAAD,EAAkBC,QAAlB,EAAoCC,MAA2B,GAAG,EAAlE,EAA+E;AAC/F,QAAI,CAACD,QAAD,IAAa,OAAOA,QAAP,KAAoB,QAArC,EAA+C,MAAM,IAAIE,KAAJ,CAAW,qCAAoCF,QAAS,EAAxD,CAAN;AAC/C,UAAMG,WAAW,GAAG,KAAKC,cAAL,CAAoBL,EAApB,EAAwB;AAAEM,MAAAA,qBAAqB,EAAE;AAAzB,KAAxB,CAApB;AACA,UAAMC,aAAa,GAA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,UAAME,WAAW,GAAGC,MAAM,CAACC,IAAP,CAAYxB,MAAZ,EAAoByB,MAApB,CAA4B3B,EAAD,IAAQA,EAAE,CAAC4B,UAAH,CAAe,GAAE3B,QAAQ,CAAC4B,sBAAT,EAAkC,GAAnD,CAAnC,CAApB;;AACA,QAAIL,WAAW,CAACM,MAAZ,GAAqB,CAAzB,EAA4B;AAC1B,YAAM,KAAIC,oBAAJ,EACH,0BACC9B,QAAQ,CAAC4B,sBACV,mCAAkCT,WAAW,CAACG,QAAZ,EAAuB,MAAKC,WAAW,CAACQ,IAAZ,CAAiB,IAAjB,CAAuB,EAHlF,CAAN;AAKD;;AACD,WAAOR,WAAW,CAACM,MAAZ,KAAuB,CAAvB,GAA2BN,WAAW,CAAC,CAAD,CAAtC,GAA4CF,SAAnD;AACD;AAED;AACF;AACA;;;AACEW,EAAAA,kBAAkB,CAACC,QAAD,EAAwBC,QAAxB,EAA+C;AAC/D,UAAM/B,WAAW,GAAG,KAAKC,cAAL,CAAoB6B,QAApB,CAApB;;AACA,QAAI9B,WAAW,CAACJ,EAAZ,CAAeoC,UAAf,EAAJ,EAAiC;AAC/B,YAAM,IAAIjC,KAAJ,CAAW,kDAAiDC,WAAW,CAACJ,EAAZ,CAAeuB,QAAf,EAA0B,EAAtF,CAAN;AACD;;AACD,SAAK1B,YAAL,CAAkBwC,eAAlB,CAAkCjC,WAAW,CAACJ,EAA9C;AACAI,IAAAA,WAAW,CAACJ,EAAZ,GAAiBmC,QAAQ,CAACjB,OAA1B;AACA,SAAKrB,YAAL,CAAkByC,YAAlB,CAA+BlC,WAAW,CAACJ,EAA3C,EAA+CI,WAA/C;AACD;;AAhHiB","sourcesContent":["import { isEqual } from 'lodash';\nimport { ComponentID } from '@teambit/component-id';\nimport LegacyBitMap from '@teambit/legacy/dist/consumer/bit-map';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { GetBitMapComponentOptions } from '@teambit/legacy/dist/consumer/bit-map/bit-map';\nimport ComponentMap from '@teambit/legacy/dist/consumer/bit-map/component-map';\nimport { REMOVE_EXTENSION_SPECIAL_SIGN } from '@teambit/legacy/dist/consumer/config';\nimport { BitError } from '@teambit/bit-error';\n/**\n * consider extracting to a new component.\n * (pro: making Workspace aspect smaller. con: it's an implementation details of the workspace)\n */\nexport class BitMap {\n constructor(private legacyBitMap: LegacyBitMap, private consumer: Consumer) {}\n\n /**\n * adds component config to the .bitmap file.\n * later, upon `bit tag`, the data is saved in the scope.\n * returns a boolean indicating whether a change has been made.\n */\n addComponentConfig(id: ComponentID, aspectId: string, config: Record<string, any> = {}): boolean {\n if (!aspectId || typeof aspectId !== 'string') throw new Error(`expect aspectId to be string, got ${aspectId}`);\n const bitMapEntry = this.getBitmapEntry(id, { ignoreScopeAndVersion: true });\n const currentConfig = (bitMapEntry.config ||= {})[aspectId];\n if (isEqual(currentConfig, config)) {\n return false; // no changes\n }\n if (!config) {\n delete bitMapEntry.config[aspectId];\n } else {\n bitMapEntry.config[aspectId] = config;\n }\n this.legacyBitMap.markAsChanged();\n\n return true; // changes have been made\n }\n\n removeComponentConfig(id: ComponentID, aspectId: string, markWithMinusIfNotExist: boolean): boolean {\n if (!aspectId || typeof aspectId !== 'string') throw new Error(`expect aspectId to be string, got ${aspectId}`);\n const bitMapEntry = this.getBitmapEntry(id, { ignoreScopeAndVersion: true });\n const currentConfig = (bitMapEntry.config ||= {})[aspectId];\n if (currentConfig) {\n delete bitMapEntry.config[aspectId];\n } else {\n if (!markWithMinusIfNotExist) {\n return false; // no changes\n }\n bitMapEntry.config[aspectId] = REMOVE_EXTENSION_SPECIAL_SIGN;\n }\n\n this.legacyBitMap.markAsChanged();\n\n return true; // changes have been made\n }\n\n removeEntireConfig(id: ComponentID): boolean {\n const bitMapEntry = this.getBitmapEntry(id, { ignoreScopeAndVersion: true });\n if (!bitMapEntry.config) return false;\n delete bitMapEntry.config;\n this.legacyBitMap.markAsChanged();\n return true;\n }\n\n setEntireConfig(id: ComponentID, config: Record<string, any>) {\n const bitMapEntry = this.getBitmapEntry(id, { ignoreScopeAndVersion: true });\n bitMapEntry.config = config;\n this.legacyBitMap.markAsChanged();\n }\n\n /**\n * write .bitmap object to the filesystem\n */\n async write() {\n await this.consumer.writeBitMap();\n }\n\n /**\n * get the data saved in the .bitmap file for this component-id.\n */\n getBitmapEntry(\n id: ComponentID,\n { ignoreVersion, ignoreScopeAndVersion }: GetBitMapComponentOptions = {}\n ): ComponentMap {\n return this.legacyBitMap.getComponent(id._legacy, { ignoreVersion, ignoreScopeAndVersion });\n }\n\n getAspectIdFromConfig(\n componentId: ComponentID,\n aspectId: ComponentID,\n ignoreAspectVersion = false\n ): string | undefined {\n const bitMapEntry = this.getBitmapEntry(componentId);\n const config = bitMapEntry.config;\n if (!config) {\n return undefined;\n }\n if (config[aspectId.toString()]) {\n return aspectId.toString();\n }\n if (!ignoreAspectVersion) {\n return undefined;\n }\n const allVersions = Object.keys(config).filter((id) => id.startsWith(`${aspectId.toStringWithoutVersion()}@`));\n if (allVersions.length > 1) {\n throw new BitError(\n `error: the same aspect ${\n aspectId.toStringWithoutVersion\n } configured multiple times for \"${componentId.toString()}\"\\n${allVersions.join('\\n')}`\n );\n }\n return allVersions.length === 1 ? allVersions[0] : undefined;\n }\n\n /**\n * components that were not tagged yet are safe to rename them from the .bitmap file.\n */\n renameNewComponent(sourceId: ComponentID, targetId: ComponentID) {\n const bitMapEntry = this.getBitmapEntry(sourceId);\n if (bitMapEntry.id.hasVersion()) {\n throw new Error(`unable to rename tagged or exported component: ${bitMapEntry.id.toString()}`);\n }\n this.legacyBitMap.removeComponent(bitMapEntry.id);\n bitMapEntry.id = targetId._legacy;\n this.legacyBitMap.setComponent(bitMapEntry.id, bitMapEntry);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["bit-map.ts"],"names":["BitMap","constructor","legacyBitMap","consumer","addComponentConfig","id","aspectId","config","Error","bitMapEntry","getBitmapEntry","ignoreScopeAndVersion","currentConfig","markAsChanged","removeComponentConfig","markWithMinusIfNotExist","REMOVE_EXTENSION_SPECIAL_SIGN","removeEntireConfig","setEntireConfig","removeDefaultScope","defaultScope","setDefaultScope","write","writeBitMap","ignoreVersion","getComponent","_legacy","getAspectIdFromConfig","componentId","ignoreAspectVersion","undefined","toString","allVersions","Object","keys","filter","startsWith","toStringWithoutVersion","length","BitError","join","renameNewComponent","sourceId","targetId","hasVersion","removeComponent","setComponent"],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAMA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AACA;AACA;AACA;AACO,MAAMA,MAAN,CAAa;AAClBC,EAAAA,WAAW,CAASC,YAAT,EAA6CC,QAA7C,EAAiE;AAAA,SAAxDD,YAAwD,GAAxDA,YAAwD;AAAA,SAApBC,QAAoB,GAApBA,QAAoB;AAAE;AAE9E;AACF;AACA;AACA;AACA;;;AACEC,EAAAA,kBAAkB,CAACC,EAAD,EAAkBC,QAAlB,EAAoCC,MAA2B,GAAG,EAAlE,EAA+E;AAC/F,QAAI,CAACD,QAAD,IAAa,OAAOA,QAAP,KAAoB,QAArC,EAA+C,MAAM,IAAIE,KAAJ,CAAW,qCAAoCF,QAAS,EAAxD,CAAN;AAC/C,UAAMG,WAAW,GAAG,KAAKC,cAAL,CAAoBL,EAApB,EAAwB;AAAEM,MAAAA,qBAAqB,EAAE;AAAzB,KAAxB,CAApB;AACA,UAAMC,aAAa,GAAG,CAACH,WAAW,CAACF,MAAb,KAACE,WAAW,CAACF,MAAb,GAAwB,EAAxB,GAA4BD,QAA5B,CAAtB;;AACA,QAAI,uBAAQM,aAAR,EAAuBL,MAAvB,CAAJ,EAAoC;AAClC,aAAO,KAAP,CADkC,CACpB;AACf;;AACD,QAAI,CAACA,MAAL,EAAa;AACX,aAAOE,WAAW,CAACF,MAAZ,CAAmBD,QAAnB,CAAP;AACD,KAFD,MAEO;AACLG,M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W,CAACJ,EAA3C,EAA+CI,WAA/C;AACD;;AA9HiB","sourcesContent":["import { isEqual } from 'lodash';\nimport { ComponentID } from '@teambit/component-id';\nimport LegacyBitMap from '@teambit/legacy/dist/consumer/bit-map';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport { GetBitMapComponentOptions } from '@teambit/legacy/dist/consumer/bit-map/bit-map';\nimport ComponentMap from '@teambit/legacy/dist/consumer/bit-map/component-map';\nimport { REMOVE_EXTENSION_SPECIAL_SIGN } from '@teambit/legacy/dist/consumer/config';\nimport { BitError } from '@teambit/bit-error';\n/**\n * consider extracting to a new component.\n * (pro: making Workspace aspect smaller. con: it's an implementation details of the workspace)\n */\nexport class BitMap {\n constructor(private legacyBitMap: LegacyBitMap, private consumer: Consumer) {}\n\n /**\n * adds component config to the .bitmap file.\n * later, upon `bit tag`, the data is saved in the scope.\n * returns a boolean indicating whether a change has been made.\n */\n addComponentConfig(id: ComponentID, aspectId: string, config: Record<string, any> = {}): boolean {\n if (!aspectId || typeof aspectId !== 'string') throw new Error(`expect aspectId to be string, got ${aspectId}`);\n const bitMapEntry = this.getBitmapEntry(id, { ignoreScopeAndVersion: true });\n const currentConfig = (bitMapEntry.config ||= {})[aspectId];\n if (isEqual(currentConfig, config)) {\n return false; // no changes\n }\n if (!config) {\n delete bitMapEntry.config[aspectId];\n } else {\n bitMapEntry.config[aspectId] = config;\n }\n this.legacyBitMap.markAsChanged();\n\n return true; // changes have been made\n }\n\n removeComponentConfig(id: ComponentID, aspectId: string, markWithMinusIfNotExist: boolean): boolean {\n if (!aspectId || typeof aspectId !== 'string') throw new Error(`expect aspectId to be string, got ${aspectId}`);\n const bitMapEntry = this.getBitmapEntry(id, { ignoreScopeAndVersion: true });\n const currentConfig = (bitMapEntry.config ||= {})[aspectId];\n if (currentConfig) {\n delete bitMapEntry.config[aspectId];\n } else {\n if (!markWithMinusIfNotExist) {\n return false; // no changes\n }\n bitMapEntry.config[aspectId] = REMOVE_EXTENSION_SPECIAL_SIGN;\n }\n\n this.legacyBitMap.markAsChanged();\n\n return true; // changes have been made\n }\n\n removeEntireConfig(id: ComponentID): boolean {\n const bitMapEntry = this.getBitmapEntry(id, { ignoreScopeAndVersion: true });\n if (!bitMapEntry.config) return false;\n delete bitMapEntry.config;\n this.legacyBitMap.markAsChanged();\n return true;\n }\n\n setEntireConfig(id: ComponentID, config: Record<string, any>) {\n const bitMapEntry = this.getBitmapEntry(id, { ignoreScopeAndVersion: true });\n bitMapEntry.config = config;\n this.legacyBitMap.markAsChanged();\n }\n\n removeDefaultScope(id: ComponentID) {\n const bitMapEntry = this.getBitmapEntry(id, { ignoreScopeAndVersion: true });\n if (bitMapEntry.defaultScope) {\n delete bitMapEntry.defaultScope;\n this.legacyBitMap.markAsChanged();\n }\n }\n\n setDefaultScope(id: ComponentID, defaultScope: string) {\n const bitMapEntry = this.getBitmapEntry(id, { ignoreScopeAndVersion: true });\n bitMapEntry.defaultScope = defaultScope;\n this.legacyBitMap.markAsChanged();\n }\n\n /**\n * write .bitmap object to the filesystem\n */\n async write() {\n await this.consumer.writeBitMap();\n }\n\n /**\n * get the data saved in the .bitmap file for this component-id.\n */\n getBitmapEntry(\n id: ComponentID,\n { ignoreVersion, ignoreScopeAndVersion }: GetBitMapComponentOptions = {}\n ): ComponentMap {\n return this.legacyBitMap.getComponent(id._legacy, { ignoreVersion, ignoreScopeAndVersion });\n }\n\n getAspectIdFromConfig(\n componentId: ComponentID,\n aspectId: ComponentID,\n ignoreAspectVersion = false\n ): string | undefined {\n const bitMapEntry = this.getBitmapEntry(componentId);\n const config = bitMapEntry.config;\n if (!config) {\n return undefined;\n }\n if (config[aspectId.toString()]) {\n return aspectId.toString();\n }\n if (!ignoreAspectVersion) {\n return undefined;\n }\n const allVersions = Object.keys(config).filter((id) => id.startsWith(`${aspectId.toStringWithoutVersion()}@`));\n if (allVersions.length > 1) {\n throw new BitError(\n `error: the same aspect ${\n aspectId.toStringWithoutVersion\n } configured multiple times for \"${componentId.toString()}\"\\n${allVersions.join('\\n')}`\n );\n }\n return allVersions.length === 1 ? allVersions[0] : undefined;\n }\n\n /**\n * components that were not tagged yet are safe to rename them from the .bitmap file.\n */\n renameNewComponent(sourceId: ComponentID, targetId: ComponentID) {\n const bitMapEntry = this.getBitmapEntry(sourceId);\n if (bitMapEntry.id.hasVersion()) {\n throw new Error(`unable to rename tagged or exported component: ${bitMapEntry.id.toString()}`);\n }\n this.legacyBitMap.removeComponent(bitMapEntry.id);\n bitMapEntry.id = targetId._legacy;\n this.legacyBitMap.setComponent(bitMapEntry.id, bitMapEntry);\n }\n}\n"]}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/workspace",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.714",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/workspace/workspace",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.workspace",
|
|
8
8
|
"name": "workspace",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.714"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -40,45 +40,45 @@
|
|
|
40
40
|
"@teambit/bit-error": "0.0.394",
|
|
41
41
|
"@teambit/component-id": "0.0.402",
|
|
42
42
|
"@teambit/legacy-bit-id": "0.0.399",
|
|
43
|
-
"@teambit/logger": "0.0.
|
|
44
|
-
"@teambit/scope": "0.0.
|
|
45
|
-
"@teambit/cli": "0.0.
|
|
46
|
-
"@teambit/isolator": "0.0.
|
|
47
|
-
"@teambit/component-tree": "0.0.
|
|
43
|
+
"@teambit/logger": "0.0.568",
|
|
44
|
+
"@teambit/scope": "0.0.714",
|
|
45
|
+
"@teambit/cli": "0.0.476",
|
|
46
|
+
"@teambit/isolator": "0.0.714",
|
|
47
|
+
"@teambit/component-tree": "0.0.502",
|
|
48
48
|
"@teambit/component.ui.component-status-resolver": "0.0.492",
|
|
49
|
-
"@teambit/lanes.ui.lanes": "0.0.
|
|
49
|
+
"@teambit/lanes.ui.lanes": "0.0.42",
|
|
50
50
|
"@teambit/harmony.modules.resolved-component": "0.0.484",
|
|
51
|
-
"@teambit/dependency-resolver": "0.0.
|
|
52
|
-
"@teambit/compiler": "0.0.
|
|
53
|
-
"@teambit/component": "0.0.
|
|
54
|
-
"@teambit/graphql": "0.0.
|
|
55
|
-
"@teambit/aspect-loader": "0.0.
|
|
56
|
-
"@teambit/bundler": "0.0.
|
|
57
|
-
"@teambit/community": "0.0.
|
|
58
|
-
"@teambit/envs": "0.0.
|
|
59
|
-
"@teambit/pubsub": "0.0.
|
|
60
|
-
"@teambit/ui": "0.0.
|
|
61
|
-
"@teambit/variants": "0.0.
|
|
51
|
+
"@teambit/dependency-resolver": "0.0.714",
|
|
52
|
+
"@teambit/compiler": "0.0.714",
|
|
53
|
+
"@teambit/component": "0.0.714",
|
|
54
|
+
"@teambit/graphql": "0.0.714",
|
|
55
|
+
"@teambit/aspect-loader": "0.0.714",
|
|
56
|
+
"@teambit/bundler": "0.0.714",
|
|
57
|
+
"@teambit/community": "0.0.24",
|
|
58
|
+
"@teambit/envs": "0.0.714",
|
|
59
|
+
"@teambit/pubsub": "0.0.714",
|
|
60
|
+
"@teambit/ui": "0.0.714",
|
|
61
|
+
"@teambit/variants": "0.0.572",
|
|
62
62
|
"@teambit/component-issues": "0.0.50",
|
|
63
|
-
"@teambit/config": "0.0.
|
|
63
|
+
"@teambit/config": "0.0.489",
|
|
64
64
|
"@teambit/harmony.modules.requireable-component": "0.0.484",
|
|
65
|
-
"@teambit/importer": "0.0.
|
|
65
|
+
"@teambit/importer": "0.0.143",
|
|
66
66
|
"@teambit/workspace.modules.match-pattern": "0.0.489",
|
|
67
|
-
"@teambit/component.ui.component-drawer": "0.0.
|
|
67
|
+
"@teambit/component.ui.component-drawer": "0.0.21",
|
|
68
68
|
"@teambit/design.ui.tree": "0.0.5",
|
|
69
|
-
"@teambit/ui-foundation.ui.side-bar": "0.0.
|
|
70
|
-
"@teambit/command-bar": "0.0.
|
|
69
|
+
"@teambit/ui-foundation.ui.side-bar": "0.0.539",
|
|
70
|
+
"@teambit/command-bar": "0.0.714",
|
|
71
71
|
"@teambit/component.ui.component-filters": "0.0.3",
|
|
72
|
-
"@teambit/graph": "0.0.
|
|
73
|
-
"@teambit/sidebar": "0.0.
|
|
72
|
+
"@teambit/graph": "0.0.714",
|
|
73
|
+
"@teambit/sidebar": "0.0.714",
|
|
74
74
|
"@teambit/ui-foundation.ui.main-dropdown": "0.0.487",
|
|
75
75
|
"@teambit/ui-foundation.ui.menu": "0.0.487",
|
|
76
76
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.489",
|
|
77
77
|
"@teambit/ui-foundation.ui.tree.drawer": "0.0.499",
|
|
78
78
|
"@teambit/toolbox.time.time-format": "0.0.483",
|
|
79
79
|
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.487",
|
|
80
|
-
"@teambit/component-descriptor": "0.0.
|
|
81
|
-
"@teambit/deprecation": "0.0.
|
|
80
|
+
"@teambit/component-descriptor": "0.0.39",
|
|
81
|
+
"@teambit/deprecation": "0.0.714",
|
|
82
82
|
"@teambit/ui-foundation.ui.constants.z-indexes": "0.0.487",
|
|
83
83
|
"@teambit/ui-foundation.ui.buttons.collapser": "0.0.194",
|
|
84
84
|
"@teambit/ui-foundation.ui.corner": "0.0.495",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
107
|
"@apollo/client": "^3.0.0",
|
|
108
|
-
"@teambit/legacy": "1.0.
|
|
108
|
+
"@teambit/legacy": "1.0.256",
|
|
109
109
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
110
110
|
"react": "^16.8.0 || ^17.0.0"
|
|
111
111
|
},
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"react": "-"
|
|
134
134
|
},
|
|
135
135
|
"peerDependencies": {
|
|
136
|
-
"@teambit/legacy": "1.0.
|
|
136
|
+
"@teambit/legacy": "1.0.256",
|
|
137
137
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
138
138
|
"react": "^16.8.0 || ^17.0.0"
|
|
139
139
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@0.0.
|
|
2
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@0.0.
|
|
1
|
+
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@0.0.714/dist/workspace.composition.js')]
|
|
2
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@0.0.714/dist/workspace.docs.mdx')]
|
|
Binary file
|