@teambit/component 0.0.782 → 0.0.785
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/component.main.runtime.d.ts +1 -2
- package/dist/component.main.runtime.js +3 -18
- package/dist/component.main.runtime.js.map +1 -1
- package/dist/config.d.ts +0 -3
- package/dist/config.js.map +1 -1
- package/package-tar/teambit-component-0.0.785.tgz +0 -0
- package/package.json +19 -49
- package/{preview-1657164425299.js → preview-1657337177086.js} +2 -2
- package/package-tar/teambit-component-0.0.782.tgz +0 -0
|
@@ -2,7 +2,6 @@ import { CLIMain } from '@teambit/cli';
|
|
|
2
2
|
import { ExpressMain, Route } from '@teambit/express';
|
|
3
3
|
import { GraphqlMain } from '@teambit/graphql';
|
|
4
4
|
import { SlotRegistry } from '@teambit/harmony';
|
|
5
|
-
import type { ConfigMain } from '@teambit/config';
|
|
6
5
|
import { ComponentID } from '@teambit/component-id';
|
|
7
6
|
import { ExtensionDataList } from '@teambit/legacy/dist/consumer/config';
|
|
8
7
|
import { ComponentFactory } from './component-factory';
|
|
@@ -71,5 +70,5 @@ export declare class ComponentMain {
|
|
|
71
70
|
static slots: (((registerFn: () => string) => SlotRegistry<Route[]>) | ((registerFn: () => string) => SlotRegistry<ComponentFactory>) | ((registerFn: () => string) => SlotRegistry<ShowFragment[]>))[];
|
|
72
71
|
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
73
72
|
static dependencies: import("@teambit/harmony").Aspect[];
|
|
74
|
-
static provider([graphql, express, cli
|
|
73
|
+
static provider([graphql, express, cli]: [GraphqlMain, ExpressMain, CLIMain], config: any, [hostSlot, showFragmentSlot]: [ComponentHostSlot, ShowFragmentSlot]): Promise<ComponentMain>;
|
|
75
74
|
}
|
|
@@ -61,16 +61,6 @@ function _harmony() {
|
|
|
61
61
|
return data;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
function _config() {
|
|
65
|
-
const data = require("@teambit/config");
|
|
66
|
-
|
|
67
|
-
_config = function () {
|
|
68
|
-
return data;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
return data;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
64
|
function _lodash() {
|
|
75
65
|
const data = require("lodash");
|
|
76
66
|
|
|
@@ -256,14 +246,9 @@ class ComponentMain {
|
|
|
256
246
|
return this;
|
|
257
247
|
}
|
|
258
248
|
|
|
259
|
-
static async provider([graphql, express, cli
|
|
249
|
+
static async provider([graphql, express, cli], config, [hostSlot, showFragmentSlot]) {
|
|
260
250
|
const componentExtension = new ComponentMain(hostSlot, express, showFragmentSlot);
|
|
261
|
-
|
|
262
|
-
if (configAspect.workspaceConfig && !configAspect.workspaceConfig.isLegacy || configAspect.type === 'scope') {
|
|
263
|
-
cli.unregister('show');
|
|
264
|
-
cli.register(new (_show().ShowCmd)(componentExtension));
|
|
265
|
-
}
|
|
266
|
-
|
|
251
|
+
cli.register(new (_show().ShowCmd)(componentExtension));
|
|
267
252
|
componentExtension.registerShowFragments([new (_show().NameFragment)(), new (_show().MainFileFragment)(), new (_show().IDFragment)(), new (_show().ScopeFragment)(), new (_show().FilesFragment)(), new (_show().ExtensionsFragment)()]);
|
|
268
253
|
graphql.register((0, _component2().componentSchema)(componentExtension));
|
|
269
254
|
return componentExtension;
|
|
@@ -274,7 +259,7 @@ class ComponentMain {
|
|
|
274
259
|
exports.ComponentMain = ComponentMain;
|
|
275
260
|
(0, _defineProperty2().default)(ComponentMain, "slots", [_harmony().Slot.withType(), _harmony().Slot.withType(), _harmony().Slot.withType()]);
|
|
276
261
|
(0, _defineProperty2().default)(ComponentMain, "runtime", _cli().MainRuntime);
|
|
277
|
-
(0, _defineProperty2().default)(ComponentMain, "dependencies", [_graphql().GraphqlAspect, _express().ExpressAspect, _cli().CLIAspect
|
|
262
|
+
(0, _defineProperty2().default)(ComponentMain, "dependencies", [_graphql().GraphqlAspect, _express().ExpressAspect, _cli().CLIAspect]);
|
|
278
263
|
|
|
279
264
|
_component().ComponentAspect.addRuntime(ComponentMain);
|
|
280
265
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ComponentMain","constructor","hostSlot","express","showFragmentSlot","registerHost","host","register","createAspectListFromLegacy","legacyExtensionDataList","scope","AspectList","fromLegacyExtensions","createAspectListFromEntries","entries","registerRoute","routes","routeEntries","map","route","ComponentRoute","flattenRoutes","flatten","setHostPriority","id","get","HostNotFound","_priorHost","getHost","getPriorHost","getRoute","routeName","toString","hosts","values","priorityHost","find","priority","getShowFragments","fragments","orderBy","isHost","name","registerShowFragments","showFragments","provider","graphql","cli","configAspect","config","componentExtension","workspaceConfig","isLegacy","type","unregister","ShowCmd","NameFragment","MainFileFragment","IDFragment","ScopeFragment","FilesFragment","ExtensionsFragment","componentSchema","Slot","withType","MainRuntime","GraphqlAspect","ExpressAspect","CLIAspect","ConfigAspect","ComponentAspect","addRuntime"],"sources":["component.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ExpressAspect, ExpressMain, Route } from '@teambit/express';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { ConfigAspect } from '@teambit/config';\nimport type { ConfigMain } from '@teambit/config';\nimport { ComponentID } from '@teambit/component-id';\nimport { flatten, orderBy } from 'lodash';\nimport { ExtensionDataList } from '@teambit/legacy/dist/consumer/config';\nimport { ComponentFactory } from './component-factory';\nimport { ComponentAspect } from './component.aspect';\nimport { componentSchema } from './component.graphql';\nimport { ComponentRoute } from './component.route';\nimport { AspectList } from './aspect-list';\nimport { HostNotFound } from './exceptions';\nimport { AspectEntry } from './aspect-entry';\nimport {\n ShowCmd,\n ShowFragment,\n NameFragment,\n MainFileFragment,\n IDFragment,\n ScopeFragment,\n FilesFragment,\n ExtensionsFragment,\n} from './show';\nimport { RegisteredComponentRoute } from '.';\n\nexport type ComponentHostSlot = SlotRegistry<ComponentFactory>;\n\nexport type ShowFragmentSlot = SlotRegistry<ShowFragment[]>;\n\nexport class ComponentMain {\n constructor(\n /**\n * slot for component hosts to register.\n */\n private hostSlot: ComponentHostSlot,\n\n /**\n * Express Extension\n */\n private express: ExpressMain,\n\n private showFragmentSlot: ShowFragmentSlot\n ) {}\n\n /**\n * register a new component host.\n */\n registerHost(host: ComponentFactory) {\n this.hostSlot.register(host);\n return this;\n }\n\n /**\n * important! avoid using this method.\n * seems like this method was written to work around a very specific case when the ComponentID of the aspects are\n * not available. in case of new components, to get the ComponentID, the workspace-aspect is needed to get the\n * default-scope. when this method is called from the scope, there is no way to get the real component-id.\n * instead, this method asks for the \"scope\", which when called by the scope-aspect is the current scope-name.\n * it may or may not be the real scope-name of the aspect.\n * to fix this possibly incorrect scope-name, the `workspace.resolveScopeAspectListIds()` checks whether the\n * scope-name is the same as scope.name, and if so, resolve it to the correct scope-name.\n */\n createAspectListFromLegacy(legacyExtensionDataList: ExtensionDataList, scope?: string) {\n return AspectList.fromLegacyExtensions(legacyExtensionDataList, scope);\n }\n\n createAspectListFromEntries(entries: AspectEntry[]) {\n return new AspectList(entries);\n }\n\n registerRoute(routes: RegisteredComponentRoute[]) {\n const routeEntries = routes.map((route: RegisteredComponentRoute) => {\n return new ComponentRoute(route, this);\n });\n\n const flattenRoutes = flatten(routeEntries) as any as Route[];\n\n this.express.register(flattenRoutes);\n return this;\n }\n\n /**\n * set the prior host.\n */\n setHostPriority(id: string) {\n const host = this.hostSlot.get(id);\n if (!host) {\n throw new HostNotFound(id);\n }\n\n this._priorHost = host;\n return this;\n }\n\n /**\n * get component host by extension ID.\n */\n getHost(id?: string): ComponentFactory {\n if (id) {\n const host = this.hostSlot.get(id);\n if (!host) throw new HostNotFound(id);\n return host;\n }\n\n return this.getPriorHost();\n }\n\n getRoute(id: ComponentID, routeName: string) {\n return `/api/${id.toString()}/~aspect/${routeName}`;\n }\n\n /**\n * get the prior host.\n */\n private getPriorHost() {\n if (this._priorHost) return this._priorHost;\n\n const hosts = this.hostSlot.values();\n const priorityHost = hosts.find((host) => host.priority);\n return priorityHost || hosts[0];\n }\n\n getShowFragments() {\n const fragments = orderBy(flatten(this.showFragmentSlot.values()), ['weight', ['asc']]);\n return fragments;\n }\n\n isHost(name: string) {\n return !!this.hostSlot.get(name);\n }\n\n /**\n * register a show fragment to display further information in the `bit show` command.\n */\n registerShowFragments(showFragments: ShowFragment[]) {\n this.showFragmentSlot.register(showFragments);\n return this;\n }\n\n private _priorHost: ComponentFactory | undefined;\n\n static slots = [Slot.withType<ComponentFactory>(), Slot.withType<Route[]>(), Slot.withType<ShowFragment[]>()];\n\n static runtime = MainRuntime;\n static dependencies = [GraphqlAspect, ExpressAspect, CLIAspect, ConfigAspect];\n\n static async provider(\n [graphql, express, cli, configAspect]: [GraphqlMain, ExpressMain, CLIMain, ConfigMain],\n config,\n [hostSlot, showFragmentSlot]: [ComponentHostSlot, ShowFragmentSlot]\n ) {\n const componentExtension = new ComponentMain(hostSlot, express, showFragmentSlot);\n\n if ((configAspect.workspaceConfig && !configAspect.workspaceConfig.isLegacy) || configAspect.type === 'scope') {\n cli.unregister('show');\n cli.register(new ShowCmd(componentExtension));\n }\n\n componentExtension.registerShowFragments([\n new NameFragment(),\n new MainFileFragment(),\n new IDFragment(),\n new ScopeFragment(),\n new FilesFragment(),\n new ExtensionsFragment(),\n ]);\n graphql.register(componentSchema(componentExtension));\n\n return componentExtension;\n }\n}\n\nComponentAspect.addRuntime(ComponentMain);\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;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAA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B,CAA2BvE,aAA3B"}
|
|
1
|
+
{"version":3,"names":["ComponentMain","constructor","hostSlot","express","showFragmentSlot","registerHost","host","register","createAspectListFromLegacy","legacyExtensionDataList","scope","AspectList","fromLegacyExtensions","createAspectListFromEntries","entries","registerRoute","routes","routeEntries","map","route","ComponentRoute","flattenRoutes","flatten","setHostPriority","id","get","HostNotFound","_priorHost","getHost","getPriorHost","getRoute","routeName","toString","hosts","values","priorityHost","find","priority","getShowFragments","fragments","orderBy","isHost","name","registerShowFragments","showFragments","provider","graphql","cli","config","componentExtension","ShowCmd","NameFragment","MainFileFragment","IDFragment","ScopeFragment","FilesFragment","ExtensionsFragment","componentSchema","Slot","withType","MainRuntime","GraphqlAspect","ExpressAspect","CLIAspect","ComponentAspect","addRuntime"],"sources":["component.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { ExpressAspect, ExpressMain, Route } from '@teambit/express';\nimport { GraphqlAspect, GraphqlMain } from '@teambit/graphql';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { ComponentID } from '@teambit/component-id';\nimport { flatten, orderBy } from 'lodash';\nimport { ExtensionDataList } from '@teambit/legacy/dist/consumer/config';\nimport { ComponentFactory } from './component-factory';\nimport { ComponentAspect } from './component.aspect';\nimport { componentSchema } from './component.graphql';\nimport { ComponentRoute } from './component.route';\nimport { AspectList } from './aspect-list';\nimport { HostNotFound } from './exceptions';\nimport { AspectEntry } from './aspect-entry';\nimport {\n ShowCmd,\n ShowFragment,\n NameFragment,\n MainFileFragment,\n IDFragment,\n ScopeFragment,\n FilesFragment,\n ExtensionsFragment,\n} from './show';\nimport { RegisteredComponentRoute } from '.';\n\nexport type ComponentHostSlot = SlotRegistry<ComponentFactory>;\n\nexport type ShowFragmentSlot = SlotRegistry<ShowFragment[]>;\n\nexport class ComponentMain {\n constructor(\n /**\n * slot for component hosts to register.\n */\n private hostSlot: ComponentHostSlot,\n\n /**\n * Express Extension\n */\n private express: ExpressMain,\n\n private showFragmentSlot: ShowFragmentSlot\n ) {}\n\n /**\n * register a new component host.\n */\n registerHost(host: ComponentFactory) {\n this.hostSlot.register(host);\n return this;\n }\n\n /**\n * important! avoid using this method.\n * seems like this method was written to work around a very specific case when the ComponentID of the aspects are\n * not available. in case of new components, to get the ComponentID, the workspace-aspect is needed to get the\n * default-scope. when this method is called from the scope, there is no way to get the real component-id.\n * instead, this method asks for the \"scope\", which when called by the scope-aspect is the current scope-name.\n * it may or may not be the real scope-name of the aspect.\n * to fix this possibly incorrect scope-name, the `workspace.resolveScopeAspectListIds()` checks whether the\n * scope-name is the same as scope.name, and if so, resolve it to the correct scope-name.\n */\n createAspectListFromLegacy(legacyExtensionDataList: ExtensionDataList, scope?: string) {\n return AspectList.fromLegacyExtensions(legacyExtensionDataList, scope);\n }\n\n createAspectListFromEntries(entries: AspectEntry[]) {\n return new AspectList(entries);\n }\n\n registerRoute(routes: RegisteredComponentRoute[]) {\n const routeEntries = routes.map((route: RegisteredComponentRoute) => {\n return new ComponentRoute(route, this);\n });\n\n const flattenRoutes = flatten(routeEntries) as any as Route[];\n\n this.express.register(flattenRoutes);\n return this;\n }\n\n /**\n * set the prior host.\n */\n setHostPriority(id: string) {\n const host = this.hostSlot.get(id);\n if (!host) {\n throw new HostNotFound(id);\n }\n\n this._priorHost = host;\n return this;\n }\n\n /**\n * get component host by extension ID.\n */\n getHost(id?: string): ComponentFactory {\n if (id) {\n const host = this.hostSlot.get(id);\n if (!host) throw new HostNotFound(id);\n return host;\n }\n\n return this.getPriorHost();\n }\n\n getRoute(id: ComponentID, routeName: string) {\n return `/api/${id.toString()}/~aspect/${routeName}`;\n }\n\n /**\n * get the prior host.\n */\n private getPriorHost() {\n if (this._priorHost) return this._priorHost;\n\n const hosts = this.hostSlot.values();\n const priorityHost = hosts.find((host) => host.priority);\n return priorityHost || hosts[0];\n }\n\n getShowFragments() {\n const fragments = orderBy(flatten(this.showFragmentSlot.values()), ['weight', ['asc']]);\n return fragments;\n }\n\n isHost(name: string) {\n return !!this.hostSlot.get(name);\n }\n\n /**\n * register a show fragment to display further information in the `bit show` command.\n */\n registerShowFragments(showFragments: ShowFragment[]) {\n this.showFragmentSlot.register(showFragments);\n return this;\n }\n\n private _priorHost: ComponentFactory | undefined;\n\n static slots = [Slot.withType<ComponentFactory>(), Slot.withType<Route[]>(), Slot.withType<ShowFragment[]>()];\n\n static runtime = MainRuntime;\n static dependencies = [GraphqlAspect, ExpressAspect, CLIAspect];\n\n static async provider(\n [graphql, express, cli]: [GraphqlMain, ExpressMain, CLIMain],\n config,\n [hostSlot, showFragmentSlot]: [ComponentHostSlot, ShowFragmentSlot]\n ) {\n const componentExtension = new ComponentMain(hostSlot, express, showFragmentSlot);\n cli.register(new ShowCmd(componentExtension));\n\n componentExtension.registerShowFragments([\n new NameFragment(),\n new MainFileFragment(),\n new IDFragment(),\n new ScopeFragment(),\n new FilesFragment(),\n new ExtensionsFragment(),\n ]);\n graphql.register(componentSchema(componentExtension));\n\n return componentExtension;\n }\n}\n\nComponentAspect.addRuntime(ComponentMain);\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;;AAEA;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;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAgBO,MAAMA,aAAN,CAAoB;EACzBC,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MAAM6C,kBAAkB,GAAG,IAAIjD,aAAJ,CAAkBE,QAAlB,EAA4BC,OAA5B,EAAqCC,gBAArC,CAA3B;IACA2C,GAAG,CAACxC,QAAJ,CAAa,KAAI2C,eAAJ,EAAYD,kBAAZ,CAAb;IAEAA,kBAAkB,CAACN,qBAAnB,CAAyC,CACvC,KAAIQ,oBAAJ,GADuC,EAEvC,KAAIC,wBAAJ,GAFuC,EAGvC,KAAIC,kBAAJ,GAHuC,EAIvC,KAAIC,qBAAJ,GAJuC,EAKvC,KAAIC,qBAAJ,GALuC,EAMvC,KAAIC,0BAAJ,GANuC,CAAzC;IAQAV,OAAO,CAACvC,QAAR,CAAiB,IAAAkD,6BAAA,EAAgBR,kBAAhB,CAAjB;IAEA,OAAOA,kBAAP;EACD;;AAxIwB;;;gCAAdjD,a,WAgHI,CAAC0D,eAAA,CAAKC,QAAL,EAAD,EAAoCD,eAAA,CAAKC,QAAL,EAApC,EAA8DD,eAAA,CAAKC,QAAL,EAA9D,C;gCAhHJ3D,a,aAkHM4D,kB;gCAlHN5D,a,kBAmHW,CAAC6D,wBAAD,EAAgBC,wBAAhB,EAA+BC,gBAA/B,C;;AAwBxBC,4BAAA,CAAgBC,UAAhB,CAA2BjE,aAA3B"}
|
package/dist/config.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { Compilers, Testers } from '@teambit/legacy/dist/consumer/config/abstract-config';
|
|
2
1
|
import { ComponentOverridesData } from '@teambit/legacy/dist/consumer/config/component-overrides';
|
|
3
2
|
import { ExtensionDataList } from '@teambit/legacy/dist/consumer/config/extension-data';
|
|
4
3
|
import { PathLinux } from '@teambit/legacy/dist/utils/path';
|
|
5
4
|
declare type LegacyConfigProps = {
|
|
6
5
|
lang?: string;
|
|
7
|
-
compiler?: string | Compilers;
|
|
8
|
-
tester?: string | Testers;
|
|
9
6
|
bindingPrefix: string;
|
|
10
7
|
extensions?: ExtensionDataList;
|
|
11
8
|
overrides?: ComponentOverridesData;
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Config","constructor","main","extensions","legacyProperties"],"sources":["config.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":["Config","constructor","main","extensions","legacyProperties"],"sources":["config.ts"],"sourcesContent":["import { ComponentOverridesData } from '@teambit/legacy/dist/consumer/config/component-overrides';\nimport { ExtensionDataList } from '@teambit/legacy/dist/consumer/config/extension-data';\nimport { PathLinux } from '@teambit/legacy/dist/utils/path';\n// import { CustomResolvedPath } from '@teambit/legacy/dist/consumer/component/consumer-component';\n// import { ComponentOverridesData } from '@teambit/legacy/dist/consumer/config/component-overrides';\n\ntype LegacyConfigProps = {\n lang?: string;\n bindingPrefix: string;\n extensions?: ExtensionDataList;\n overrides?: ComponentOverridesData;\n};\n\n/**\n * in-memory representation of the component configuration.\n */\nexport default class Config {\n constructor(\n /**\n * version main file\n */\n readonly main: PathLinux,\n\n /**\n * configured extensions\n */\n readonly extensions: ExtensionDataList,\n\n readonly legacyProperties?: LegacyConfigProps\n ) {}\n}\n"],"mappings":";;;;;;;AAGA;AACA;;AASA;AACA;AACA;AACe,MAAMA,MAAN,CAAa;EAC1BC,WAAW;EACT;AACJ;AACA;EACaC,IAJA;EAMT;AACJ;AACA;EACaC,UATA,EAWAC,gBAXA,EAYT;IAAA,KARSF,IAQT,GARSA,IAQT;IAAA,KAHSC,UAGT,GAHSA,UAGT;IAAA,KADSC,gBACT,GADSA,gBACT;EAAE;;AAbsB"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/component",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.785",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/component/component",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "component",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.785"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/any-fs": "0.0.5",
|
|
@@ -31,42 +31,41 @@
|
|
|
31
31
|
"@teambit/design.inputs.dropdown": "0.0.7",
|
|
32
32
|
"@teambit/component-id": "0.0.402",
|
|
33
33
|
"@teambit/ui-foundation.ui.menu-widget-icon": "0.0.488",
|
|
34
|
-
"@teambit/aspect-loader": "0.0.
|
|
34
|
+
"@teambit/aspect-loader": "0.0.785",
|
|
35
35
|
"@teambit/legacy-bit-id": "0.0.399",
|
|
36
36
|
"@teambit/toolbox.path.match-patterns": "0.0.1",
|
|
37
37
|
"@teambit/toolbox.string.capitalize": "0.0.483",
|
|
38
|
-
"@teambit/cli": "0.0.
|
|
39
|
-
"@teambit/
|
|
40
|
-
"@teambit/
|
|
41
|
-
"@teambit/graphql": "0.0.782",
|
|
38
|
+
"@teambit/cli": "0.0.519",
|
|
39
|
+
"@teambit/express": "0.0.617",
|
|
40
|
+
"@teambit/graphql": "0.0.785",
|
|
42
41
|
"@teambit/bit-error": "0.0.394",
|
|
43
|
-
"@teambit/command-bar": "0.0.
|
|
42
|
+
"@teambit/command-bar": "0.0.785",
|
|
44
43
|
"@teambit/component.ui.deprecation-icon": "0.0.494",
|
|
45
|
-
"@teambit/preview": "0.0.
|
|
46
|
-
"@teambit/pubsub": "0.0.
|
|
47
|
-
"@teambit/react-router": "0.0.
|
|
44
|
+
"@teambit/preview": "0.0.785",
|
|
45
|
+
"@teambit/pubsub": "0.0.785",
|
|
46
|
+
"@teambit/react-router": "0.0.785",
|
|
48
47
|
"@teambit/ui-foundation.ui.is-browser": "0.0.486",
|
|
49
48
|
"@teambit/ui-foundation.ui.main-dropdown": "0.0.487",
|
|
50
49
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.490",
|
|
51
50
|
"@teambit/ui-foundation.ui.use-box.menu": "0.0.116",
|
|
52
|
-
"@teambit/ui": "0.0.
|
|
53
|
-
"@teambit/component-issues": "0.0.
|
|
51
|
+
"@teambit/ui": "0.0.785",
|
|
52
|
+
"@teambit/component-issues": "0.0.57",
|
|
54
53
|
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.488",
|
|
55
54
|
"@teambit/cli-table": "0.0.34",
|
|
56
|
-
"@teambit/lanes.ui.lanes": "0.0.
|
|
57
|
-
"@teambit/component-descriptor": "0.0.
|
|
55
|
+
"@teambit/lanes.ui.lanes": "0.0.87",
|
|
56
|
+
"@teambit/component-descriptor": "0.0.81",
|
|
58
57
|
"@teambit/ui-foundation.ui.react-router.use-query": "0.0.487",
|
|
59
58
|
"@teambit/design.ui.empty-box": "0.0.354",
|
|
60
59
|
"@teambit/harmony.ui.aspect-box": "0.0.486",
|
|
61
60
|
"@teambit/design.ui.pages.not-found": "0.0.356",
|
|
62
61
|
"@teambit/design.ui.pages.server-error": "0.0.356",
|
|
63
|
-
"@teambit/compositions": "0.0.
|
|
64
|
-
"@teambit/deprecation": "0.0.
|
|
65
|
-
"@teambit/envs": "0.0.
|
|
62
|
+
"@teambit/compositions": "0.0.785",
|
|
63
|
+
"@teambit/deprecation": "0.0.785",
|
|
64
|
+
"@teambit/envs": "0.0.785",
|
|
66
65
|
"@teambit/legacy-component-log": "0.0.392",
|
|
67
66
|
"@teambit/design.ui.styles.ellipsis": "0.0.347",
|
|
68
67
|
"@teambit/envs.ui.env-icon": "0.0.486",
|
|
69
|
-
"@teambit/component.ui.version-dropdown": "0.0.
|
|
68
|
+
"@teambit/component.ui.version-dropdown": "0.0.575",
|
|
70
69
|
"@teambit/ui-foundation.ui.full-loader": "0.0.486",
|
|
71
70
|
"@teambit/ui-foundation.ui.use-box.dropdown": "0.0.116",
|
|
72
71
|
"@teambit/ui-foundation.ui.constants.z-indexes": "0.0.488"
|
|
@@ -88,40 +87,11 @@
|
|
|
88
87
|
"peerDependencies": {
|
|
89
88
|
"react-router-dom": "^6.0.0",
|
|
90
89
|
"@apollo/client": "^3.0.0",
|
|
91
|
-
"@teambit/legacy": "1.0.
|
|
90
|
+
"@teambit/legacy": "1.0.300",
|
|
92
91
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
93
92
|
"react": "^16.8.0 || ^17.0.0"
|
|
94
93
|
},
|
|
95
94
|
"license": "Apache-2.0",
|
|
96
|
-
"bit": {
|
|
97
|
-
"bindingPrefix": "@teambit",
|
|
98
|
-
"env": {},
|
|
99
|
-
"overrides": {
|
|
100
|
-
"dependencies": {
|
|
101
|
-
"@teambit/legacy": "-",
|
|
102
|
-
"@babel/runtime": "7.12.18",
|
|
103
|
-
"core-js": "^3.0.0",
|
|
104
|
-
"react-dom": "-",
|
|
105
|
-
"react": "-"
|
|
106
|
-
},
|
|
107
|
-
"devDependencies": {
|
|
108
|
-
"@teambit/legacy": "-",
|
|
109
|
-
"@types/mocha": "9.1.0",
|
|
110
|
-
"@types/testing-library__jest-dom": "5.9.5",
|
|
111
|
-
"@types/jest": "^26.0.0",
|
|
112
|
-
"@types/react-dom": "^17.0.5",
|
|
113
|
-
"@types/react": "^17.0.8",
|
|
114
|
-
"@types/node": "12.20.4",
|
|
115
|
-
"react-dom": "-",
|
|
116
|
-
"react": "-"
|
|
117
|
-
},
|
|
118
|
-
"peerDependencies": {
|
|
119
|
-
"@teambit/legacy": "1.0.299",
|
|
120
|
-
"react-dom": "^16.8.0 || ^17.0.0",
|
|
121
|
-
"react": "^16.8.0 || ^17.0.0"
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
95
|
"private": false,
|
|
126
96
|
"engines": {
|
|
127
97
|
"node": ">=12.22.0"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.785/dist/component.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_component@0.0.785/dist/component.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
Binary file
|