diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 04b0d5b1493d..007ab352107a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6980,7 +6980,7 @@ importers: version: file:scopes/compositions/model/composition-id(@testing-library/dom@10.4.1) '@teambit/compositions.model.composition-type': specifier: workspace:* - version: file:scopes/compositions/model/composition-type(react@19.2.7) + version: file:scopes/compositions/model/composition-type(@testing-library/dom@10.4.1)(react@19.2.7) '@teambit/compositions.panels.composition-gallery': specifier: workspace:* version: file:scopes/compositions/panels/composition-gallery(@teambit/base-react.navigation.link@2.0.33)(@testing-library/dom@10.4.1)(react@19.2.7) @@ -8057,7 +8057,7 @@ importers: version: file:scopes/compositions/model/composition-id(@testing-library/dom@10.4.1) '@teambit/compositions.model.composition-type': specifier: workspace:* - version: file:scopes/compositions/model/composition-type(react@19.2.7) + version: file:scopes/compositions/model/composition-type(@testing-library/dom@10.4.1)(react@19.2.7) '@teambit/compositions.panels.composition-gallery': specifier: workspace:* version: file:scopes/compositions/panels/composition-gallery(@teambit/base-react.navigation.link@2.0.33)(@testing-library/dom@10.4.1)(react@19.2.7) @@ -9116,7 +9116,7 @@ importers: version: file:scopes/compositions/model/composition-id(@testing-library/dom@10.4.1) '@teambit/compositions.model.composition-type': specifier: workspace:* - version: file:scopes/compositions/model/composition-type(react@18.3.1) + version: file:scopes/compositions/model/composition-type(@testing-library/dom@10.4.1)(react@18.3.1) '@teambit/compositions.panels.composition-gallery': specifier: workspace:* version: file:scopes/compositions/panels/composition-gallery(@teambit/base-react.navigation.link@2.0.33)(@testing-library/dom@10.4.1)(react@18.3.1) @@ -10187,7 +10187,7 @@ importers: version: file:scopes/compositions/model/composition-id(@testing-library/dom@10.4.1) '@teambit/compositions.model.composition-type': specifier: workspace:* - version: file:scopes/compositions/model/composition-type(react@19.2.7) + version: file:scopes/compositions/model/composition-type(@testing-library/dom@10.4.1)(react@19.2.7) '@teambit/compositions.panels.composition-gallery': specifier: workspace:* version: file:scopes/compositions/panels/composition-gallery(@teambit/base-react.navigation.link@2.0.33)(@testing-library/dom@10.4.1)(react@19.2.7) @@ -11234,7 +11234,7 @@ importers: version: file:scopes/compositions/model/composition-id(@testing-library/dom@10.4.1) '@teambit/compositions.model.composition-type': specifier: workspace:* - version: file:scopes/compositions/model/composition-type(react@19.2.7) + version: file:scopes/compositions/model/composition-type(@testing-library/dom@10.4.1)(react@19.2.7) '@teambit/compositions.panels.composition-gallery': specifier: workspace:* version: file:scopes/compositions/panels/composition-gallery(@teambit/base-react.navigation.link@2.0.33)(@testing-library/dom@10.4.1)(react@19.2.7) @@ -12281,7 +12281,7 @@ importers: version: file:scopes/compositions/model/composition-id(@testing-library/dom@10.4.1) '@teambit/compositions.model.composition-type': specifier: workspace:* - version: file:scopes/compositions/model/composition-type(react@19.2.7) + version: file:scopes/compositions/model/composition-type(@testing-library/dom@10.4.1)(react@19.2.7) '@teambit/compositions.panels.composition-gallery': specifier: workspace:* version: file:scopes/compositions/panels/composition-gallery(@teambit/base-react.navigation.link@2.0.33)(@testing-library/dom@10.4.1)(react@19.2.7) @@ -13340,7 +13340,7 @@ importers: version: file:scopes/compositions/model/composition-id(@testing-library/dom@10.4.1) '@teambit/compositions.model.composition-type': specifier: workspace:* - version: file:scopes/compositions/model/composition-type(react@19.2.7) + version: file:scopes/compositions/model/composition-type(@testing-library/dom@10.4.1)(react@19.2.7) '@teambit/compositions.panels.composition-gallery': specifier: workspace:* version: file:scopes/compositions/panels/composition-gallery(@teambit/base-react.navigation.link@2.0.33)(@testing-library/dom@10.4.1)(react@19.2.7) @@ -15238,9 +15238,6 @@ importers: '@teambit/legacy-bit-id': specifier: 1.1.4 version: 1.1.4 - '@teambit/ui-foundation.ui.is-browser': - specifier: ~0.0.500 - version: 0.0.500(react-dom@19.2.7)(react@19.2.7) '@teambit/ui-foundation.ui.main-dropdown': specifier: ~0.0.505 version: 0.0.505(react-dom@19.2.7)(react@19.2.7) @@ -62062,6 +62059,7 @@ snapshots: '@teambit/component.sources': file:scopes/component/sources(domexception@4.0.0)(graphql@15.8.0)(supports-color@9.4.0) '@teambit/component.ui.deprecation-icon': 0.0.509(@testing-library/react@14.3.1)(react-dom@19.2.7)(react@18.3.1) '@teambit/component.ui.version-dropdown': file:components/ui/version-dropdown(@testing-library/dom@10.4.1)(@testing-library/react@14.3.1)(react-router-dom@6.30.4)(react@18.3.1)(supports-color@9.4.0) + '@teambit/compositions.model.composition-type': file:scopes/compositions/model/composition-type(@testing-library/dom@10.4.1)(react@18.3.1) '@teambit/design.inputs.dropdown': 1.3.3(@testing-library/react@14.3.1)(react-dom@19.2.7)(react@18.3.1) '@teambit/design.inputs.selectors.menu-item': 1.1.0(react@18.3.1) '@teambit/design.navigation.responsive-navbar': 0.0.8(@testing-library/react@14.3.1)(@types/react@19.2.18)(react-dom@19.2.7)(react@18.3.1) @@ -62100,7 +62098,6 @@ snapshots: '@teambit/toolbox.string.capitalize': file:scopes/toolbox/string/capitalize '@teambit/toolbox.string.eol': file:scopes/toolbox/string/eol '@teambit/ui-foundation.ui.hooks.use-data-query': file:components/ui/hooks/use-data-query(@apollo/client@3.12.11)(@testing-library/dom@10.4.1)(react@18.3.1) - '@teambit/ui-foundation.ui.is-browser': 0.0.500(react-dom@19.2.7)(react@18.3.1) '@teambit/ui-foundation.ui.main-dropdown': 0.0.505(react-dom@19.2.7)(react@18.3.1) '@teambit/ui-foundation.ui.menu-widget-icon': 0.0.502(react-dom@19.2.7)(react@18.3.1) '@teambit/ui-foundation.ui.react-router.slot-router': file:components/ui/react-router/slot-router(@teambit/base-react.navigation.link@2.0.33)(@testing-library/dom@10.4.1)(react-router-dom@6.30.4)(react@18.3.1) @@ -62151,6 +62148,7 @@ snapshots: '@teambit/component.sources': file:scopes/component/sources(domexception@4.0.0)(graphql@15.8.0)(supports-color@9.4.0) '@teambit/component.ui.deprecation-icon': 0.0.509(@testing-library/react@14.3.1)(react-dom@19.2.7)(react@19.2.7) '@teambit/component.ui.version-dropdown': file:components/ui/version-dropdown(@testing-library/dom@10.4.1)(@testing-library/react@14.3.1)(react-router-dom@6.30.4)(react@19.2.7)(supports-color@9.4.0) + '@teambit/compositions.model.composition-type': file:scopes/compositions/model/composition-type(@testing-library/dom@10.4.1)(react@19.2.7) '@teambit/design.inputs.dropdown': 1.3.3(@testing-library/react@14.3.1)(react-dom@19.2.7)(react@19.2.7) '@teambit/design.inputs.selectors.menu-item': 1.1.0(react@19.2.7) '@teambit/design.navigation.responsive-navbar': 0.0.8(@testing-library/react@14.3.1)(@types/react@19.2.18)(react-dom@19.2.7)(react@19.2.7) @@ -62189,7 +62187,6 @@ snapshots: '@teambit/toolbox.string.capitalize': file:scopes/toolbox/string/capitalize '@teambit/toolbox.string.eol': file:scopes/toolbox/string/eol '@teambit/ui-foundation.ui.hooks.use-data-query': file:components/ui/hooks/use-data-query(@apollo/client@3.12.11)(@testing-library/dom@10.4.1)(react@19.2.7) - '@teambit/ui-foundation.ui.is-browser': 0.0.500(react-dom@19.2.7)(react@19.2.7) '@teambit/ui-foundation.ui.main-dropdown': 0.0.505(react-dom@19.2.7)(react@19.2.7) '@teambit/ui-foundation.ui.menu-widget-icon': 0.0.502(react-dom@19.2.7)(react@19.2.7) '@teambit/ui-foundation.ui.react-router.slot-router': file:components/ui/react-router/slot-router(@teambit/base-react.navigation.link@2.0.33)(@testing-library/dom@10.4.1)(react-router-dom@6.30.4)(react@19.2.7) @@ -62240,6 +62237,7 @@ snapshots: '@teambit/component.sources': file:scopes/component/sources(domexception@4.0.0)(graphql@15.8.0)(supports-color@9.4.0) '@teambit/component.ui.deprecation-icon': 0.0.509(@testing-library/react@14.3.1)(react-dom@19.2.7)(react@19.2.7) '@teambit/component.ui.version-dropdown': file:components/ui/version-dropdown(@testing-library/dom@10.4.1)(@testing-library/react@14.3.1)(react-router-dom@6.30.4)(react@19.2.7)(supports-color@9.4.0) + '@teambit/compositions.model.composition-type': file:scopes/compositions/model/composition-type(@testing-library/dom@10.4.1)(react@19.2.7) '@teambit/design.inputs.dropdown': 1.3.3(@testing-library/react@14.3.1)(react-dom@19.2.7)(react@19.2.7) '@teambit/design.inputs.selectors.menu-item': 1.1.0(react@19.2.7) '@teambit/design.navigation.responsive-navbar': 0.0.8(@testing-library/react@14.3.1)(@types/react@19.2.18)(react-dom@19.2.7)(react@19.2.7) @@ -62278,7 +62276,6 @@ snapshots: '@teambit/toolbox.string.capitalize': file:scopes/toolbox/string/capitalize '@teambit/toolbox.string.eol': file:scopes/toolbox/string/eol '@teambit/ui-foundation.ui.hooks.use-data-query': file:components/ui/hooks/use-data-query(@apollo/client@3.12.11)(@testing-library/dom@10.4.1)(react@19.2.7) - '@teambit/ui-foundation.ui.is-browser': 0.0.500(react-dom@19.2.7)(react@19.2.7) '@teambit/ui-foundation.ui.main-dropdown': 0.0.505(react-dom@19.2.7)(react@19.2.7) '@teambit/ui-foundation.ui.menu-widget-icon': 0.0.502(react-dom@19.2.7)(react@19.2.7) '@teambit/ui-foundation.ui.react-router.slot-router': file:components/ui/react-router/slot-router(@teambit/base-react.navigation.link@2.0.33)(@testing-library/dom@10.4.1)(react-router-dom@6.30.4)(react@19.2.7) @@ -62504,23 +62501,29 @@ snapshots: dependencies: react: 19.2.7 - '@teambit/compositions.model.composition-type@file:scopes/compositions/model/composition-type(react@18.3.1)': + '@teambit/compositions.model.composition-type@file:scopes/compositions/model/composition-type(@testing-library/dom@10.4.1)(react@18.3.1)': dependencies: + '@teambit/compositions.model.composition-id': file:scopes/compositions/model/composition-id(@testing-library/dom@10.4.1) '@types/node': 22.10.5 '@types/react': 19.2.18 '@types/react-dom': 19.2.4(@types/react@19.2.18) react: 18.3.1 react-dom: 19.2.7(react@18.3.1) react-router-dom: 6.30.4(react-dom@19.2.7)(react@18.3.1) + transitivePeerDependencies: + - '@testing-library/dom' - '@teambit/compositions.model.composition-type@file:scopes/compositions/model/composition-type(react@19.2.7)': + '@teambit/compositions.model.composition-type@file:scopes/compositions/model/composition-type(@testing-library/dom@10.4.1)(react@19.2.7)': dependencies: + '@teambit/compositions.model.composition-id': file:scopes/compositions/model/composition-id(@testing-library/dom@10.4.1) '@types/node': 22.10.5 '@types/react': 19.2.18 '@types/react-dom': 19.2.4(@types/react@19.2.18) react: 19.2.7 react-dom: 19.2.7(react@19.2.7) react-router-dom: 6.30.4(react-dom@19.2.7)(react@19.2.7) + transitivePeerDependencies: + - '@testing-library/dom' '@teambit/compositions.panels.composition-gallery@file:scopes/compositions/panels/composition-gallery(@teambit/base-react.navigation.link@2.0.33)(@testing-library/dom@10.4.1)(react@18.3.1)': dependencies: @@ -62727,7 +62730,7 @@ snapshots: '@teambit/component-id': 1.2.5 '@teambit/component.sources': file:scopes/component/sources(domexception@4.0.0)(graphql@15.8.0)(supports-color@9.4.0) '@teambit/compositions.aspect-docs.compositions': file:scopes/compositions/aspect-docs/compositions(@teambit/documenter.theme.theme-compositions@4.1.5)(@teambit/mdx.ui.mdx-layout@1.0.14)(react@18.3.1) - '@teambit/compositions.model.composition-id': file:scopes/compositions/model/composition-id(@testing-library/dom@10.4.1) + '@teambit/compositions.model.composition-type': file:scopes/compositions/model/composition-type(@testing-library/dom@10.4.1)(react@18.3.1) '@teambit/compositions.ui.composition-compare': file:components/ui/composition-compare(@apollo/client@3.12.11)(@teambit/base-react.navigation.link@2.0.33)(@testing-library/dom@10.4.1)(graphql@15.8.0)(react@18.3.1) '@teambit/compositions.ui.composition-compare-section': file:components/ui/composition-compare-section(@apollo/client@3.12.11)(@testing-library/dom@10.4.1)(graphql@15.8.0)(react-router-dom@6.30.4) '@teambit/compositions.ui.composition-live-controls': 0.0.7(react@18.3.1) @@ -62797,7 +62800,7 @@ snapshots: '@teambit/component-id': 1.2.5 '@teambit/component.sources': file:scopes/component/sources(domexception@4.0.0)(graphql@15.8.0)(supports-color@9.4.0) '@teambit/compositions.aspect-docs.compositions': file:scopes/compositions/aspect-docs/compositions(@teambit/documenter.theme.theme-compositions@4.1.5)(@teambit/mdx.ui.mdx-layout@1.0.14)(react@19.2.7) - '@teambit/compositions.model.composition-id': file:scopes/compositions/model/composition-id(@testing-library/dom@10.4.1) + '@teambit/compositions.model.composition-type': file:scopes/compositions/model/composition-type(@testing-library/dom@10.4.1)(react@19.2.7) '@teambit/compositions.ui.composition-compare': file:components/ui/composition-compare(@apollo/client@3.12.11)(@teambit/base-react.navigation.link@2.0.33)(@testing-library/dom@10.4.1)(graphql@15.8.0)(react@19.2.7) '@teambit/compositions.ui.composition-compare-section': file:components/ui/composition-compare-section(@apollo/client@3.12.11)(@testing-library/dom@10.4.1)(graphql@15.8.0)(react-router-dom@6.30.4) '@teambit/compositions.ui.composition-live-controls': 0.0.7(react@19.2.7) diff --git a/scopes/component/component/component.ui.runtime.tsx b/scopes/component/component/component.ui.runtime.tsx index 6943fc228f9b..d773708992c7 100644 --- a/scopes/component/component/component.ui.runtime.tsx +++ b/scopes/component/component/component.ui.runtime.tsx @@ -3,19 +3,13 @@ import flatten from 'lodash.flatten'; import copy from 'copy-to-clipboard'; import type { RouteProps } from 'react-router-dom'; import type { LinkProps } from '@teambit/base-react.navigation.link'; -import type { CommandBarUI, CommandEntry } from '@teambit/command-bar'; -import { CommandBarAspect } from '@teambit/command-bar'; import { DeprecationIcon } from '@teambit/component.ui.deprecation-icon'; import type { SlotRegistry } from '@teambit/harmony'; import { Slot } from '@teambit/harmony'; -import { PreviewAspect, ClickInsideAnIframeEvent } from '@teambit/preview'; -import type { BitBaseEvent, PubsubUI } from '@teambit/pubsub'; -import { PubsubAspect } from '@teambit/pubsub'; import type { ReactRouterUI } from '@teambit/react-router'; import { ReactRouterAspect } from '@teambit/react-router'; import { UIRuntime } from '@teambit/harmony.modules.runtimes'; import { groupBy } from 'lodash'; -import { isBrowser } from '@teambit/ui-foundation.ui.is-browser'; import type { MenuItem, MenuItemSlot } from '@teambit/ui-foundation.ui.main-dropdown'; import type { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router'; import { Import } from '@teambit/ui-foundation.ui.use-box.menu'; @@ -44,6 +38,18 @@ export type ComponentUIConfig = { commandBar: boolean; }; +/** + * a command the component page offers to the command bar (the shape of the command-bar's `CommandEntry`). + */ +export type ComponentCommand = { + id: string; + action: () => void; + keybinding?: string | string[]; + displayName: string; +}; + +export type CommandRunner = (commandId: string) => unknown; + export type Server = { env: string; url: string; @@ -55,14 +61,9 @@ export type ComponentMeta = { export class ComponentUI { readonly routePath = `/*`; - private componentSearcher: ComponentSearcher; + readonly componentSearcher: ComponentSearcher; constructor( - /** - * Pubsub aspects - */ - private pubsub: PubsubUI, - private routeSlot: RouteSlot, private navSlot: OrderedNavigationSlot, @@ -87,12 +88,14 @@ export class ComponentUI { private componentSearchResultSlot: ComponentSearchResultSlot, - private commandBarUI: CommandBarUI, + reactRouterUi: ReactRouterUI, - reactRouterUi: ReactRouterUI + /** + * whether the component page offers its commands and component search to the command bar + */ + readonly isCommandBarEnabled: boolean ) { this.componentSearcher = new ComponentSearcher({ navigate: reactRouterUi.navigateTo }); - if (isBrowser) this.registerPubSub(); } get routes() { @@ -110,6 +113,10 @@ export class ComponentUI { return snapToSemver(version); } + private copyBitId = () => { + copy(this.activeComponent?.id.toString() || ''); + }; + private copyNpmId = () => { const packageName = this.activeComponent?.packageName; if (packageName) { @@ -119,15 +126,26 @@ export class ComponentUI { } }; + private commandRunner?: CommandRunner; + + /** + * set by the command bar, so the menu items can run its commands. + */ + registerCommandRunner(commandRunner: CommandRunner) { + this.commandRunner = commandRunner; + } + + private runCommand(commandId: string) { + return this.commandRunner?.(commandId); + } + /** * key bindings used by component aspect */ - private keyBindings: CommandEntry[] = [ + readonly keyBindings: ComponentCommand[] = [ { id: 'component.copyBitId', // TODO - extract to a component! - action: () => { - copy(this.activeComponent?.id.toString() || ''); - }, + action: this.copyBitId, displayName: 'Copy component ID', keybinding: '.', }, @@ -144,25 +162,25 @@ export class ComponentUI { category: 'general', title: 'Open command bar', keyChar: 'mod+k', - handler: () => this.commandBarUI?.run('command-bar.open'), + handler: () => this.runCommand('command-bar.open'), }, { category: 'general', title: 'Toggle component list', keyChar: 'alt+s', - handler: () => this.commandBarUI?.run('sidebar.toggle'), + handler: () => this.runCommand('sidebar.toggle'), }, { category: 'workflow', title: 'Copy component ID', keyChar: '.', - handler: () => this.commandBarUI?.run('component.copyBitId'), + handler: this.copyBitId, }, { category: 'workflow', title: 'Copy component package name', keyChar: ',', - handler: () => this.commandBarUI?.run('component.copyNpmId'), + handler: this.copyNpmId, }, ]; @@ -194,21 +212,6 @@ export class ComponentUI { }; }; - registerPubSub() { - this.pubsub.sub(PreviewAspect.id, (be: BitBaseEvent) => { - if (be.type === ClickInsideAnIframeEvent.TYPE) { - const event = new MouseEvent('mousedown', { - view: window, - bubbles: true, - cancelable: true, - }); - - const body = document.body; - body?.dispatchEvent(event); - } - }); - } - handleComponentChange = (activeComponent?: ComponentModel) => { this.activeComponent = activeComponent; }; @@ -304,7 +307,7 @@ export class ComponentUI { this.componentSearcher.update(components || []); }; - static dependencies = [PubsubAspect, CommandBarAspect, ReactRouterAspect]; + static dependencies = [ReactRouterAspect]; static runtime = UIRuntime; @@ -324,7 +327,7 @@ export class ComponentUI { }; static async provider( - [pubsub, commandBarUI, reactRouterUI]: [PubsubUI, CommandBarUI, ReactRouterUI], + [reactRouterUI]: [ReactRouterUI], config: ComponentUIConfig, [ routeSlot, @@ -351,7 +354,6 @@ export class ComponentUI { // TODO: refactor ComponentHost to a separate extension (including sidebar, host, graphql, etc.) // TODO: add contextual hook for ComponentHost @uri/@oded const componentUI = new ComponentUI( - pubsub, routeSlot, navSlot, consumeMethodSlot, @@ -361,26 +363,17 @@ export class ComponentUI { menuItemSlot, pageSlot, componentSearchResultSlot, - commandBarUI, - reactRouterUI + reactRouterUI, + config.commandBar ); const aspectSection = new AspectSection(); // @ts-ignore componentUI.registerSearchResultWidget({ key: 'deprecation', end: DeprecationIcon }); - if (componentUI.commandBarUI && config.commandBar) { - componentUI.commandBarUI.addCommand(...componentUI.keyBindings); - commandBarUI.addSearcher(componentUI.componentSearcher); - } - componentUI.registerMenuItem(componentUI.menuItems); componentUI.registerRoute(aspectSection.route); componentUI.registerWidget(aspectSection.navigationLink, aspectSection.order); componentUI.registerConsumeMethod(componentUI.bitMethod); - componentUI.registerRightSideMenuItem({ - item: , - order: 90, - }); return componentUI; } } diff --git a/scopes/component/component/index.ts b/scopes/component/component/index.ts index 9401ed1781a1..239b398a430d 100644 --- a/scopes/component/component/index.ts +++ b/scopes/component/component/index.ts @@ -40,7 +40,13 @@ export { componentFields, componentIdFields, componentOverviewFields } from './u export type { NavPlugin, ConsumePlugin, MenuNavProps } from './ui/menu'; export { CollapsibleMenuNav, ComponentMenu, VersionRelatedDropdowns } from './ui/menu'; export type { RegisteredComponentRoute, ComponentUrlParams } from './component.route'; -export type { ComponentModelProps, DeprecationInfo, RegularCompDescriptor } from './ui/component-model'; +export type { + ComponentModelProps, + DeprecationInfo, + RegularCompDescriptor, + ComponentPreviewSize, + ComponentPreviewSizedFile, +} from './ui/component-model'; export { ComponentModel } from './ui/component-model'; export { TopBarNav } from './ui/top-bar-nav'; export type { ShowFragment, ShowRow, ShowJSONRow } from './show'; diff --git a/scopes/component/component/ui/component-model/component-model.ts b/scopes/component/component/ui/component-model/component-model.ts index ee6b82ef7989..24a01d8d724b 100644 --- a/scopes/component/component/ui/component-model/component-model.ts +++ b/scopes/component/component/ui/component-model/component-model.ts @@ -1,9 +1,8 @@ -import type { CompositionProps } from '@teambit/compositions'; -import { Composition } from '@teambit/compositions'; +import type { CompositionProps } from '@teambit/compositions.model.composition-type'; +import { Composition } from '@teambit/compositions.model.composition-type'; import type { ComponentIdObj } from '@teambit/component-id'; import { ComponentID } from '@teambit/component-id'; import type { LegacyComponentLog } from '@teambit/legacy-component-log'; -import type { ComponentPreviewSize } from '@teambit/preview'; import { Tag } from '../../tag'; import { TagMap } from '../../tag-map'; import type { TagProps } from '../../tag/tag'; @@ -31,6 +30,27 @@ export type RegularCompDescriptor = { description?: string; }; +/** + * the preview bundle size the component model needs. it lives here and not in the preview aspect, so the + * component model doesn't depend on that aspect (it depends on component). + */ +export type ComponentPreviewSize = { + files: ComponentPreviewSizedFile[]; + assets: ComponentPreviewSizedFile[]; + totalFiles: number; + compressedTotalFiles?: number; + totalAssets: number; + compressedTotalAssets?: number; + total: number; + compressedTotal?: number; +}; + +export type ComponentPreviewSizedFile = { + name: string; + size: number; + compressedSize?: number; +}; + // ADDING MORE PROPERTIES HERE IS NOT ALLOWED!!! IF YOU NEED DATA PLEASE ADD A NEW // HOOK FROM YOUR ASPECT!!! // TODO: remove all properties from here to their rightful place in their aspects. diff --git a/scopes/component/component/ui/component-model/index.ts b/scopes/component/component/ui/component-model/index.ts index a0ddb2f33938..2ca3e298d062 100644 --- a/scopes/component/component/ui/component-model/index.ts +++ b/scopes/component/component/ui/component-model/index.ts @@ -1 +1,8 @@ -export { ComponentModel, ComponentModelProps, DeprecationInfo, RegularCompDescriptor } from './component-model'; +export { + ComponentModel, + ComponentModelProps, + DeprecationInfo, + RegularCompDescriptor, + ComponentPreviewSize, + ComponentPreviewSizedFile, +} from './component-model'; diff --git a/scopes/component/component/ui/component-searcher/component-searcher.tsx b/scopes/component/component/ui/component-searcher/component-searcher.tsx index 304079bf5705..ea37d559af41 100644 --- a/scopes/component/component/ui/component-searcher/component-searcher.tsx +++ b/scopes/component/component/ui/component-searcher/component-searcher.tsx @@ -1,7 +1,6 @@ import React from 'react'; import type { SearchResult, FuzzySearchItem } from '@teambit/explorer.ui.command-bar'; import { FuzzySearcher } from '@teambit/explorer.ui.command-bar'; -import type { SearchProvider } from '@teambit/command-bar'; import type { ComponentResultPlugin } from './component-result'; import { ComponentResult } from './component-result'; import type { ComponentModel } from '../component-model'; @@ -21,7 +20,7 @@ type ComponentSearcherOptions = { resultPlugins?: ComponentResultPlugin[]; }; -export class ComponentSearcher extends FuzzySearcher implements SearchProvider { +export class ComponentSearcher extends FuzzySearcher { constructor(public options: ComponentSearcherOptions) { super({ searchKeys }); } diff --git a/scopes/compositions/compositions/composition.ts b/scopes/compositions/compositions/composition.ts index f61fac284983..bee3785ad45a 100644 --- a/scopes/compositions/compositions/composition.ts +++ b/scopes/compositions/compositions/composition.ts @@ -1,60 +1,6 @@ -import { humanizeCompositionId } from '@teambit/compositions.model.composition-id'; - -export type CompositionProps = { - identifier: string; - filepath?: string; - displayName?: string; -}; - -export type CompositionBrowserMetadata = { - displayName?: string; - identifier: string; -}; - -export type CompositionBrowserMetadataObject = { - compositions: CompositionBrowserMetadata[]; -}; - -export class Composition { - constructor( - /** - * identifier of the composition - */ - readonly identifier: string, - - /** - * file path in which the composition is contained. - */ - readonly filepath?: string, - - /** - * set explicit display name - */ - private _displayName?: string - ) {} - - get displayName() { - return this._displayName || humanizeCompositionId(this.identifier); - } - - toObject() { - return { - identifier: this.identifier, - filepath: this.filepath, - displayName: this._displayName, - }; - } - - toBrowserMetaDataObject(): CompositionBrowserMetadata { - return { - identifier: this.identifier, - displayName: this._displayName, - }; - } - - static fromArray(compositions: CompositionProps[]): Composition[] { - return compositions.map((composition) => { - return new Composition(composition.identifier, composition.filepath, composition.displayName); - }); - } -} +export { Composition } from '@teambit/compositions.model.composition-type'; +export type { + CompositionProps, + CompositionBrowserMetadata, + CompositionBrowserMetadataObject, +} from '@teambit/compositions.model.composition-type'; diff --git a/scopes/compositions/model/composition-type/composition.ts b/scopes/compositions/model/composition-type/composition.ts new file mode 100644 index 000000000000..f61fac284983 --- /dev/null +++ b/scopes/compositions/model/composition-type/composition.ts @@ -0,0 +1,60 @@ +import { humanizeCompositionId } from '@teambit/compositions.model.composition-id'; + +export type CompositionProps = { + identifier: string; + filepath?: string; + displayName?: string; +}; + +export type CompositionBrowserMetadata = { + displayName?: string; + identifier: string; +}; + +export type CompositionBrowserMetadataObject = { + compositions: CompositionBrowserMetadata[]; +}; + +export class Composition { + constructor( + /** + * identifier of the composition + */ + readonly identifier: string, + + /** + * file path in which the composition is contained. + */ + readonly filepath?: string, + + /** + * set explicit display name + */ + private _displayName?: string + ) {} + + get displayName() { + return this._displayName || humanizeCompositionId(this.identifier); + } + + toObject() { + return { + identifier: this.identifier, + filepath: this.filepath, + displayName: this._displayName, + }; + } + + toBrowserMetaDataObject(): CompositionBrowserMetadata { + return { + identifier: this.identifier, + displayName: this._displayName, + }; + } + + static fromArray(compositions: CompositionProps[]): Composition[] { + return compositions.map((composition) => { + return new Composition(composition.identifier, composition.filepath, composition.displayName); + }); + } +} diff --git a/scopes/compositions/model/composition-type/index.ts b/scopes/compositions/model/composition-type/index.ts index a2139439a223..d855720deb39 100644 --- a/scopes/compositions/model/composition-type/index.ts +++ b/scopes/compositions/model/composition-type/index.ts @@ -1 +1,3 @@ export type { CompositionType, CompositionsModule } from './composition-type'; +export { Composition } from './composition'; +export type { CompositionProps, CompositionBrowserMetadata, CompositionBrowserMetadataObject } from './composition'; diff --git a/scopes/explorer/command-bar/command-bar.ui.runtime.spec.tsx b/scopes/explorer/command-bar/command-bar.ui.runtime.spec.tsx new file mode 100644 index 000000000000..abeff327ccba --- /dev/null +++ b/scopes/explorer/command-bar/command-bar.ui.runtime.spec.tsx @@ -0,0 +1,53 @@ +import { expect } from 'chai'; +import { SlotRegistry } from '@teambit/harmony'; +import type { ComponentUI } from '@teambit/component'; +import { CommandBarAspect } from './command-bar.aspect'; +import { CommandBarUI } from './command-bar.ui.runtime'; +import { commandBarCommands } from './command-bar.commands'; +import type { CommandEntry } from './command-bar.ui.runtime'; +import type { SearchProvider } from './searchers'; + +function createProvider(componentUI?: Partial) { + // harmony keys slot entries by the aspect whose provider is running + const searcherSlot = new SlotRegistry(() => CommandBarAspect.id); + const commandSlot = new SlotRegistry(() => CommandBarAspect.id); + return CommandBarUI.provider([undefined, undefined, componentUI as ComponentUI], {}, [ + searcherSlot, + commandSlot, + ]).then((commandBar) => ({ commandBar, searcherSlot, commandSlot })); +} + +describe('CommandBarUI provider', () => { + const componentSearcher: SearchProvider = { test: () => true, search: () => ({ items: [] }) }; + let componentActionCalled = false; + const componentUI: Partial = { + isCommandBarEnabled: true, + keyBindings: [ + { id: 'component.copyBitId', action: () => (componentActionCalled = true), displayName: 'Copy component ID' }, + ], + componentSearcher: componentSearcher as unknown as ComponentUI['componentSearcher'], + registerCommandRunner: () => {}, + registerRightSideMenuItem: () => {}, + }; + + it('keeps the open command when component commands are registered', async () => { + const { commandBar } = await createProvider(componentUI); + // `open` returns false (prevent default); undefined means the command is missing + expect(commandBar.run(commandBarCommands.open)).to.equal(false); + commandBar.run('component.copyBitId'); + expect(componentActionCalled).to.be.true; + }); + + it('keeps the command searcher first, followed by the component searcher', async () => { + const { searcherSlot } = await createProvider(componentUI); + const searchers = searcherSlot.values().flat(); + expect(searchers).to.have.lengthOf(2); + expect(searchers[1]).to.equal(componentSearcher); + }); + + it('registers only its own command and searcher when the component command bar is disabled', async () => { + const { commandBar, searcherSlot } = await createProvider({ ...componentUI, isCommandBarEnabled: false }); + expect(commandBar.run(commandBarCommands.open)).to.equal(false); + expect(searcherSlot.values().flat()).to.have.lengthOf(1); + }); +}); diff --git a/scopes/explorer/command-bar/command-bar.ui.runtime.tsx b/scopes/explorer/command-bar/command-bar.ui.runtime.tsx index 8f353c608ff7..41fcdde62e27 100644 --- a/scopes/explorer/command-bar/command-bar.ui.runtime.tsx +++ b/scopes/explorer/command-bar/command-bar.ui.runtime.tsx @@ -7,6 +7,8 @@ import { Slot } from '@teambit/harmony'; import type { UiUI } from '@teambit/ui'; import { UIRuntime } from '@teambit/harmony.modules.runtimes'; import { UIAspect } from '@teambit/ui'; +import type { ComponentUI } from '@teambit/component'; +import { ComponentAspect } from '@teambit/component'; import type { PubsubUI } from '@teambit/pubsub'; import { PubsubAspect } from '@teambit/pubsub'; import { ReactRouterAspect } from '@teambit/react-router'; @@ -182,7 +184,7 @@ export class CommandBarUI { private config: CommandBarConfig ) {} - static dependencies = [UIAspect, PubsubAspect, ReactRouterAspect]; + static dependencies = [UIAspect, PubsubAspect, ComponentAspect, ReactRouterAspect]; static slots = [Slot.withType(), Slot.withType()]; static defaultConfig: CommandBarConfig = { debounce: undefined, @@ -191,19 +193,28 @@ export class CommandBarUI { static runtime = UIRuntime; static async provider( - [uiUi, pubsubUI]: [UiUI | undefined, PubsubUI | undefined], + [uiUi, pubsubUI, componentUI]: [UiUI | undefined, PubsubUI | undefined, ComponentUI | undefined], config: CommandBarConfig, [searcherSlot, commandSlots]: [SearcherSlot, CommandSlot] ) { const commandBar = new CommandBarUI(searcherSlot, commandSlots, config); - commandBar.addSearcher(commandBar.commandSearcher); - commandBar.addCommand({ - id: commandBarCommands.open, - action: commandBar.open, - displayName: 'Open command bar', - keybinding: openCommandBarKeybinding, - }); + // slots keep one entry per registering aspect, so register all of command-bar's searchers and commands at once + const searchers: SearchProvider[] = [commandBar.commandSearcher]; + const commands: CommandEntry[] = [ + { + id: commandBarCommands.open, + action: commandBar.open, + displayName: 'Open command bar', + keybinding: openCommandBarKeybinding, + }, + ]; + if (componentUI?.isCommandBarEnabled) { + searchers.push(componentUI.componentSearcher); + commands.push(...componentUI.keyBindings); + } + commandBar.addSearcher(...searchers); + commandBar.addCommand(...commands); if (pubsubUI) { pubsubUI.sub(CommandBarAspect.id, (e: KeyEvent) => { @@ -216,6 +227,14 @@ export class CommandBarUI { uiUi.registerHudItem(); } + if (componentUI) { + componentUI.registerCommandRunner((commandId) => commandBar.run(commandId)); + componentUI.registerRightSideMenuItem({ + item: , + order: 90, + }); + } + return commandBar; } } diff --git a/scopes/preview/preview/events/click-inside-an-iframe.ts b/scopes/harmony/pubsub/click-inside-an-iframe.ts similarity index 90% rename from scopes/preview/preview/events/click-inside-an-iframe.ts rename to scopes/harmony/pubsub/click-inside-an-iframe.ts index 985f1f0ce29d..afcfa48ae8a4 100644 --- a/scopes/preview/preview/events/click-inside-an-iframe.ts +++ b/scopes/harmony/pubsub/click-inside-an-iframe.ts @@ -1,5 +1,5 @@ /* eslint-disable max-classes-per-file */ -import { BitBaseEvent } from '@teambit/pubsub'; +import { BitBaseEvent } from './bit-base-event'; class ClickInsideAnIframeEventData { constructor(private clickEvent: any) {} diff --git a/scopes/harmony/pubsub/index.ts b/scopes/harmony/pubsub/index.ts index 0a93e2b6874a..20829d36b58f 100644 --- a/scopes/harmony/pubsub/index.ts +++ b/scopes/harmony/pubsub/index.ts @@ -4,5 +4,6 @@ export type { PubsubMain } from './pubsub.main.runtime'; export type { PubsubPreview } from './pubsub.preview.runtime'; export type { PubsubUI } from './pubsub.ui.runtime'; export { BitBaseEvent } from './bit-base-event'; +export { ClickInsideAnIframeEvent } from './click-inside-an-iframe'; export type { PubSubRegistry } from './pubsub-context'; export { usePubSub, usePubSubIframe } from './pubsub-context'; diff --git a/scopes/harmony/pubsub/pubsub.ui.runtime.ts b/scopes/harmony/pubsub/pubsub.ui.runtime.ts index 2b58d46c280b..4d3972198466 100644 --- a/scopes/harmony/pubsub/pubsub.ui.runtime.ts +++ b/scopes/harmony/pubsub/pubsub.ui.runtime.ts @@ -1,10 +1,9 @@ -import type { UiUI } from '@teambit/ui'; import { UIRuntime } from '@teambit/harmony.modules.runtimes'; -import { UIAspect } from '@teambit/ui'; import { EventEmitter2 } from 'eventemitter2'; import { connectToChild } from 'penpal'; import type { AsyncMethodReturns } from 'penpal/lib/types'; import type { BitBaseEvent } from './bit-base-event'; +import { ClickInsideAnIframeEvent } from './click-inside-an-iframe'; import { PubsubAspect } from './pubsub.aspect'; import { createProvider } from './pubsub-context'; import type { Callback } from './types'; @@ -51,7 +50,7 @@ export class PubsubUI { const connection = connectToChild({ iframe, methods: { - pub: this.emitEvent, + pub: this.emitChildEvent, }, }); @@ -81,6 +80,17 @@ export class PubsubUI { this.events.emit(topic, event); }; + /** + * publish an event coming from a nested iframe. + * a click inside the iframe doesn't reach this window, so it's re-dispatched here as a mousedown (e.g. to close open menus). + */ + private emitChildEvent = (topic: string, event: BitBaseEvent) => { + this.emitEvent(topic, event); + if (event.type === ClickInsideAnIframeEvent.TYPE) { + document.body?.dispatchEvent(new MouseEvent('mousedown', { view: window, bubbles: true, cancelable: true })); + } + }; + /** * publish event to nested iframes */ @@ -89,16 +99,10 @@ export class PubsubUI { }; static runtime = UIRuntime; - static dependencies = [UIAspect]; - - static async provider([uiUI]: [UiUI]) { - const pubsubUI = new PubsubUI(); - - const reactContext = pubsubUI.getPubSubContext(); - - if (uiUI) uiUI.registerRenderHooks({ reactContext }); + static dependencies = []; - return pubsubUI; + static async provider() { + return new PubsubUI(); } } diff --git a/scopes/preview/preview/events/index.ts b/scopes/preview/preview/events/index.ts deleted file mode 100644 index 253fe0e68599..000000000000 --- a/scopes/preview/preview/events/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './click-inside-an-iframe'; diff --git a/scopes/preview/preview/index.ts b/scopes/preview/preview/index.ts index 114addb80f16..796cf8c54a0c 100644 --- a/scopes/preview/preview/index.ts +++ b/scopes/preview/preview/index.ts @@ -1,6 +1,6 @@ export { PreviewAspect as default, PreviewAspect, PreviewRuntime } from './preview.aspect'; -export * from './events'; +export { ClickInsideAnIframeEvent } from '@teambit/pubsub'; export type { PreviewEnv, Preview } from './preview-env'; export type { PreviewMain, diff --git a/scopes/preview/preview/preview.main.runtime.ts b/scopes/preview/preview/preview.main.runtime.ts index 707b2edc7062..4b4aedc69643 100644 --- a/scopes/preview/preview/preview.main.runtime.ts +++ b/scopes/preview/preview/preview.main.runtime.ts @@ -1,13 +1,21 @@ import { ArtifactFactory, BuilderAspect } from '@teambit/builder'; import type { BuilderMain } from '@teambit/builder'; -import type { Asset, BundlerMain } from '@teambit/bundler'; +import type { BundlerMain } from '@teambit/bundler'; import { BundlerAspect } from '@teambit/bundler'; import type { PubsubMain } from '@teambit/pubsub'; import { PubsubAspect } from '@teambit/pubsub'; import { MainRuntime } from '@teambit/harmony.modules.runtimes'; import { CLIAspect } from '@teambit/cli'; import type { CLIMain } from '@teambit/cli'; -import type { Component, ComponentMain, ComponentMap, ComponentID, ResolveAspectsOptions } from '@teambit/component'; +import type { + Component, + ComponentMain, + ComponentMap, + ComponentID, + ComponentPreviewSize, + ComponentPreviewSizedFile, + ResolveAspectsOptions, +} from '@teambit/component'; import { ComponentAspect } from '@teambit/component'; import { EnvsAspect } from '@teambit/envs'; import type { EnvsExecutionResult, EnvsMain, ExecutionContext, PreviewEnv } from '@teambit/envs'; @@ -97,18 +105,7 @@ export type PreviewFiles = { isBundledWithEnv: boolean; }; -export type ComponentPreviewSizedFile = Asset; - -export type ComponentPreviewSize = { - files: ComponentPreviewSizedFile[]; - assets: ComponentPreviewSizedFile[]; - totalFiles: number; - compressedTotalFiles?: number; - totalAssets: number; - compressedTotalAssets?: number; - total: number; - compressedTotal?: number; -}; +export type { ComponentPreviewSize, ComponentPreviewSizedFile }; export type ComponentPreviewMetaData = { size?: ComponentPreviewSize; diff --git a/scopes/preview/preview/preview.preview.runtime.tsx b/scopes/preview/preview/preview.preview.runtime.tsx index 7abc84b8b85f..db208fb29aca 100644 --- a/scopes/preview/preview/preview.preview.runtime.tsx +++ b/scopes/preview/preview/preview.preview.runtime.tsx @@ -1,5 +1,5 @@ import type { PubsubPreview } from '@teambit/pubsub'; -import { PubsubAspect } from '@teambit/pubsub'; +import { PubsubAspect, ClickInsideAnIframeEvent } from '@teambit/pubsub'; import type { SlotRegistry } from '@teambit/harmony'; import { Slot } from '@teambit/harmony'; import { ComponentID } from '@teambit/component-id'; @@ -12,7 +12,6 @@ import { debounce, intersection, isObject } from 'lodash'; import { PreviewNotFound } from './exceptions'; import type { PreviewType } from './preview-type'; import { PreviewAspect, PreviewRuntime } from './preview.aspect'; -import { ClickInsideAnIframeEvent } from './events'; import type { ModuleFile, PreviewModule } from './types/preview-module'; import { RenderingContext } from './rendering-context'; import { fetchComponentAspects } from './gql/fetch-component-aspects'; diff --git a/scopes/ui-foundation/ui/ui.ui.runtime.tsx b/scopes/ui-foundation/ui/ui.ui.runtime.tsx index f66bdad621b4..df7d3e204f99 100644 --- a/scopes/ui-foundation/ui/ui.ui.runtime.tsx +++ b/scopes/ui-foundation/ui/ui.ui.runtime.tsx @@ -1,5 +1,7 @@ import type { GraphqlUI } from '@teambit/graphql'; import { GraphqlAspect } from '@teambit/graphql'; +import type { PubsubUI } from '@teambit/pubsub'; +import { PubsubAspect } from '@teambit/pubsub'; import type { SlotRegistry } from '@teambit/harmony'; import { Slot } from '@teambit/harmony'; import type { ReactRouterUI } from '@teambit/react-router'; @@ -35,7 +37,9 @@ export class UiUI { /** slot for overlay ui elements */ private hudSlot: HudSlot, /** hooks into the ssr render process */ - private renderPluginsSlot: RenderPluginsSlot + private renderPluginsSlot: RenderPluginsSlot, + /** render hooks of ui's own dependencies (graphql, pubsub), rendered before the registered ones */ + private dependenciesRenderPlugins: RenderPlugin[] ) {} /** render and rehydrate client-side */ @@ -110,17 +114,14 @@ export class UiUI { } private getLifecyclePlugins() { - const lifecyclePlugins = this.renderPluginsSlot.toArray().map(([key, plugin]) => { + const registeredPlugins = this.renderPluginsSlot.toArray().map(([key, plugin]) => { if (plugin.key) return plugin; // for backward compatibility return { ...plugin, key }; }); - // react-router should register its plugin, when we can reverse it's dependency to depend on Ui - lifecyclePlugins.unshift(this.router.renderPlugin); - - return lifecyclePlugins; + return [this.router.renderPlugin, ...this.dependenciesRenderPlugins, ...registeredPlugins]; } private getRoot(rootExtension: string) { @@ -129,20 +130,20 @@ export class UiUI { static slots = [Slot.withType(), Slot.withType(), Slot.withType()]; - static dependencies = [GraphqlAspect, ReactRouterAspect]; + static dependencies = [GraphqlAspect, ReactRouterAspect, PubsubAspect]; static runtime = UIRuntime; static async provider( - [GraphqlUi, router]: [GraphqlUI, ReactRouterUI], + [GraphqlUi, router, pubsubUI]: [GraphqlUI, ReactRouterUI, PubsubUI], config, [uiRootSlot, hudSlot, renderLifecycleSlot]: [UIRootRegistry, HudSlot, RenderPluginsSlot] ) { - const uiUi = new UiUI(router, uiRootSlot, hudSlot, renderLifecycleSlot); - - if (GraphqlUi) uiUi.registerRenderHooks(GraphqlUi.renderPlugins); - - return uiUi; + const dependenciesRenderPlugins = [ + GraphqlUi.renderPlugins, + { key: PubsubAspect.id, reactContext: pubsubUI.getPubSubContext() }, + ]; + return new UiUI(router, uiRootSlot, hudSlot, renderLifecycleSlot, dependenciesRenderPlugins); } } diff --git a/scripts/circular-deps-check/cycles-baseline.json b/scripts/circular-deps-check/cycles-baseline.json index 75bd1f89a775..a41e55004b96 100644 --- a/scripts/circular-deps-check/cycles-baseline.json +++ b/scripts/circular-deps-check/cycles-baseline.json @@ -1,47 +1,36 @@ { "summary": { "groups": [ - 39, - 16 + 27, + 16, + 5 ], - "components": 55, - "edges": 271 + "components": 48, + "edges": 168 }, "groups": [ [ "teambit.compilation/bundler", "teambit.compilation/compiler", - "teambit.component/component", "teambit.component/component-compare", - "teambit.component/component-tree", "teambit.component/component-writer", "teambit.component/dev-files", "teambit.component/graph", "teambit.component/isolator", - "teambit.component/issues", "teambit.component/lister", "teambit.component/mover", "teambit.component/new-component-helper", "teambit.component/tracker", - "teambit.compositions/compositions", - "teambit.dependencies/dependency-resolver", - "teambit.envs/envs", "teambit.explorer/command-bar", "teambit.generator/generator", "teambit.git/git", "teambit.harmony/application", - "teambit.harmony/aspect-loader", "teambit.harmony/ipc-events", - "teambit.harmony/pubsub", "teambit.pipelines/builder", - "teambit.pkg/pkg", - "teambit.preview/preview", "teambit.scope/importer", "teambit.scope/scope", "teambit.semantics/schema", - "teambit.ui-foundation/sidebar", "teambit.ui-foundation/ui", - "teambit.webpack/webpack", "teambit.workspace/config-merger", "teambit.workspace/install", "teambit.workspace/watcher", @@ -66,81 +55,54 @@ "teambit.scope/remote-actions", "teambit.scope/remotes", "teambit.semantics/doc-parser" + ], + [ + "teambit.component/component", + "teambit.component/issues", + "teambit.dependencies/dependency-resolver", + "teambit.envs/envs", + "teambit.harmony/aspect-loader" ] ], "edges": [ - "teambit.compilation/bundler -> teambit.component/component", - "teambit.compilation/bundler -> teambit.dependencies/dependency-resolver", - "teambit.compilation/bundler -> teambit.envs/envs", - "teambit.compilation/bundler -> teambit.harmony/pubsub", "teambit.compilation/bundler -> teambit.pipelines/builder", "teambit.compilation/compiler -> teambit.compilation/bundler", - "teambit.compilation/compiler -> teambit.component/component", "teambit.compilation/compiler -> teambit.component/graph", "teambit.compilation/compiler -> teambit.component/isolator", - "teambit.compilation/compiler -> teambit.component/issues", - "teambit.compilation/compiler -> teambit.dependencies/dependency-resolver", - "teambit.compilation/compiler -> teambit.envs/envs", "teambit.compilation/compiler -> teambit.generator/generator", - "teambit.compilation/compiler -> teambit.harmony/aspect-loader", - "teambit.compilation/compiler -> teambit.harmony/pubsub", "teambit.compilation/compiler -> teambit.pipelines/builder", "teambit.compilation/compiler -> teambit.ui-foundation/ui", "teambit.compilation/compiler -> teambit.workspace/watcher", "teambit.compilation/compiler -> teambit.workspace/workspace", - "teambit.component/component -> teambit.compositions/compositions", "teambit.component/component -> teambit.dependencies/dependency-resolver", - "teambit.component/component -> teambit.explorer/command-bar", "teambit.component/component -> teambit.harmony/aspect-loader", - "teambit.component/component -> teambit.harmony/pubsub", - "teambit.component/component -> teambit.preview/preview", - "teambit.component/component-compare -> teambit.component/component", "teambit.component/component-compare -> teambit.component/dev-files", - "teambit.component/component-compare -> teambit.dependencies/dependency-resolver", "teambit.component/component-compare -> teambit.pipelines/builder", "teambit.component/component-compare -> teambit.scope/importer", "teambit.component/component-compare -> teambit.scope/scope", "teambit.component/component-compare -> teambit.semantics/schema", "teambit.component/component-compare -> teambit.workspace/workspace", - "teambit.component/component-tree -> teambit.component/component", "teambit.component/component-writer -> teambit.compilation/compiler", "teambit.component/component-writer -> teambit.component/mover", "teambit.component/component-writer -> teambit.workspace/config-merger", "teambit.component/component-writer -> teambit.workspace/install", "teambit.component/component-writer -> teambit.workspace/workspace", "teambit.component/component-writer -> teambit.workspace/workspace-root", - "teambit.component/dev-files -> teambit.component/component", - "teambit.component/dev-files -> teambit.envs/envs", "teambit.component/dev-files -> teambit.scope/scope", "teambit.component/dev-files -> teambit.workspace/workspace", - "teambit.component/graph -> teambit.component/component", "teambit.component/graph -> teambit.component/component-compare", - "teambit.component/isolator -> teambit.component/component", "teambit.component/isolator -> teambit.component/graph", - "teambit.component/isolator -> teambit.dependencies/dependency-resolver", - "teambit.component/isolator -> teambit.harmony/aspect-loader", "teambit.component/issues -> teambit.component/component", "teambit.component/lister -> teambit.workspace/workspace", "teambit.component/mover -> teambit.workspace/workspace", - "teambit.component/new-component-helper -> teambit.component/component", "teambit.component/new-component-helper -> teambit.component/tracker", - "teambit.component/new-component-helper -> teambit.envs/envs", "teambit.component/new-component-helper -> teambit.workspace/workspace", "teambit.component/snap-distance -> teambit.legacy/scope", "teambit.component/sources -> teambit.legacy/consumer-component", "teambit.component/sources -> teambit.legacy/extension-data", "teambit.component/sources -> teambit.legacy/scope", "teambit.component/sources -> teambit.pkg/modules/component-package-name", - "teambit.component/tracker -> teambit.envs/envs", "teambit.component/tracker -> teambit.workspace/workspace", - "teambit.compositions/compositions -> teambit.component/component", - "teambit.compositions/compositions -> teambit.component/component-compare", - "teambit.compositions/compositions -> teambit.component/dev-files", - "teambit.compositions/compositions -> teambit.envs/envs", - "teambit.compositions/compositions -> teambit.preview/preview", - "teambit.compositions/compositions -> teambit.scope/scope", - "teambit.compositions/compositions -> teambit.semantics/schema", - "teambit.compositions/compositions -> teambit.workspace/workspace", "teambit.dependencies/dependency-resolver -> teambit.component/component", "teambit.dependencies/dependency-resolver -> teambit.envs/envs", "teambit.dependencies/dependency-resolver -> teambit.harmony/aspect-loader", @@ -148,22 +110,15 @@ "teambit.envs/envs -> teambit.component/issues", "teambit.envs/envs -> teambit.dependencies/dependency-resolver", "teambit.envs/envs -> teambit.harmony/aspect-loader", - "teambit.explorer/command-bar -> teambit.harmony/pubsub", "teambit.explorer/command-bar -> teambit.ui-foundation/ui", - "teambit.generator/generator -> teambit.component/component", "teambit.generator/generator -> teambit.component/new-component-helper", "teambit.generator/generator -> teambit.component/tracker", - "teambit.generator/generator -> teambit.envs/envs", "teambit.generator/generator -> teambit.git/git", - "teambit.generator/generator -> teambit.harmony/aspect-loader", "teambit.generator/generator -> teambit.scope/scope", "teambit.generator/generator -> teambit.workspace/workspace", "teambit.generator/generator -> teambit.workspace/workspace-config-files", "teambit.git/git -> teambit.workspace/workspace", - "teambit.harmony/application -> teambit.component/component", "teambit.harmony/application -> teambit.component/isolator", - "teambit.harmony/application -> teambit.envs/envs", - "teambit.harmony/application -> teambit.harmony/aspect-loader", "teambit.harmony/application -> teambit.pipelines/builder", "teambit.harmony/application -> teambit.scope/scope", "teambit.harmony/application -> teambit.workspace/watcher", @@ -171,7 +126,6 @@ "teambit.harmony/aspect-loader -> teambit.component/component", "teambit.harmony/aspect-loader -> teambit.envs/envs", "teambit.harmony/ipc-events -> teambit.scope/scope", - "teambit.harmony/pubsub -> teambit.ui-foundation/ui", "teambit.legacy/bit-map -> teambit.legacy/consumer-component", "teambit.legacy/bit-map -> teambit.legacy/extension-data", "teambit.legacy/component-list -> teambit.legacy/bit-map", @@ -213,45 +167,16 @@ "teambit.legacy/scope-api -> teambit.legacy/scope", "teambit.legacy/scope-api -> teambit.scope/network", "teambit.legacy/scope-api -> teambit.scope/remote-actions", - "teambit.pipelines/builder -> teambit.component/component", "teambit.pipelines/builder -> teambit.component/isolator", - "teambit.pipelines/builder -> teambit.component/issues", - "teambit.pipelines/builder -> teambit.envs/envs", "teambit.pipelines/builder -> teambit.generator/generator", - "teambit.pipelines/builder -> teambit.harmony/aspect-loader", "teambit.pipelines/builder -> teambit.scope/scope", "teambit.pipelines/builder -> teambit.ui-foundation/ui", "teambit.pipelines/builder -> teambit.workspace/workspace", "teambit.pkg/modules/component-package-name -> teambit.legacy/consumer-config", "teambit.pkg/modules/component-package-name -> teambit.legacy/extension-data", - "teambit.pkg/pkg -> teambit.compilation/compiler", - "teambit.pkg/pkg -> teambit.component/component", - "teambit.pkg/pkg -> teambit.component/isolator", - "teambit.pkg/pkg -> teambit.dependencies/dependency-resolver", - "teambit.pkg/pkg -> teambit.envs/envs", - "teambit.pkg/pkg -> teambit.pipelines/builder", - "teambit.pkg/pkg -> teambit.scope/scope", - "teambit.pkg/pkg -> teambit.workspace/workspace", - "teambit.preview/preview -> teambit.compilation/bundler", - "teambit.preview/preview -> teambit.compilation/compiler", - "teambit.preview/preview -> teambit.component/component", - "teambit.preview/preview -> teambit.component/isolator", - "teambit.preview/preview -> teambit.dependencies/dependency-resolver", - "teambit.preview/preview -> teambit.envs/envs", - "teambit.preview/preview -> teambit.harmony/aspect-loader", - "teambit.preview/preview -> teambit.harmony/pubsub", - "teambit.preview/preview -> teambit.pipelines/builder", - "teambit.preview/preview -> teambit.pkg/pkg", - "teambit.preview/preview -> teambit.scope/scope", - "teambit.preview/preview -> teambit.ui-foundation/ui", - "teambit.preview/preview -> teambit.webpack/webpack", - "teambit.preview/preview -> teambit.workspace/watcher", - "teambit.preview/preview -> teambit.workspace/workspace", "teambit.scope/importer -> teambit.component/component-writer", "teambit.scope/importer -> teambit.component/graph", "teambit.scope/importer -> teambit.component/lister", - "teambit.scope/importer -> teambit.dependencies/dependency-resolver", - "teambit.scope/importer -> teambit.envs/envs", "teambit.scope/importer -> teambit.scope/scope", "teambit.scope/importer -> teambit.workspace/config-merger", "teambit.scope/importer -> teambit.workspace/install", @@ -272,70 +197,38 @@ "teambit.scope/remotes -> teambit.legacy/scope-api", "teambit.scope/remotes -> teambit.scope/network", "teambit.scope/scope -> teambit.compilation/compiler", - "teambit.scope/scope -> teambit.component/component", - "teambit.scope/scope -> teambit.component/component-tree", "teambit.scope/scope -> teambit.component/graph", "teambit.scope/scope -> teambit.component/isolator", - "teambit.scope/scope -> teambit.dependencies/dependency-resolver", - "teambit.scope/scope -> teambit.envs/envs", "teambit.scope/scope -> teambit.explorer/command-bar", - "teambit.scope/scope -> teambit.harmony/aspect-loader", - "teambit.scope/scope -> teambit.ui-foundation/sidebar", "teambit.scope/scope -> teambit.ui-foundation/ui", "teambit.semantics/doc-parser -> teambit.component/sources", - "teambit.semantics/schema -> teambit.component/component", "teambit.semantics/schema -> teambit.component/tracker", - "teambit.semantics/schema -> teambit.envs/envs", "teambit.semantics/schema -> teambit.pipelines/builder", "teambit.semantics/schema -> teambit.scope/scope", "teambit.semantics/schema -> teambit.workspace/workspace", - "teambit.ui-foundation/sidebar -> teambit.component/component", "teambit.ui-foundation/ui -> teambit.compilation/bundler", - "teambit.ui-foundation/ui -> teambit.component/component", "teambit.ui-foundation/ui -> teambit.component/isolator", - "teambit.ui-foundation/ui -> teambit.harmony/aspect-loader", - "teambit.ui-foundation/ui -> teambit.harmony/pubsub", "teambit.ui-foundation/ui -> teambit.pipelines/builder", - "teambit.webpack/webpack -> teambit.compilation/bundler", - "teambit.webpack/webpack -> teambit.harmony/pubsub", - "teambit.webpack/webpack -> teambit.workspace/workspace", - "teambit.workspace/config-merger -> teambit.dependencies/dependency-resolver", - "teambit.workspace/config-merger -> teambit.envs/envs", "teambit.workspace/config-merger -> teambit.pipelines/builder", "teambit.workspace/config-merger -> teambit.workspace/workspace", "teambit.workspace/install -> teambit.compilation/bundler", "teambit.workspace/install -> teambit.compilation/compiler", - "teambit.workspace/install -> teambit.component/component", - "teambit.workspace/install -> teambit.component/issues", - "teambit.workspace/install -> teambit.dependencies/dependency-resolver", - "teambit.workspace/install -> teambit.envs/envs", "teambit.workspace/install -> teambit.generator/generator", "teambit.workspace/install -> teambit.harmony/application", - "teambit.workspace/install -> teambit.harmony/aspect-loader", "teambit.workspace/install -> teambit.harmony/ipc-events", "teambit.workspace/install -> teambit.ui-foundation/ui", "teambit.workspace/install -> teambit.workspace/workspace", "teambit.workspace/install -> teambit.workspace/workspace-config-files", "teambit.workspace/watcher -> teambit.harmony/ipc-events", - "teambit.workspace/watcher -> teambit.harmony/pubsub", "teambit.workspace/watcher -> teambit.scope/scope", "teambit.workspace/watcher -> teambit.workspace/workspace", "teambit.workspace/workspace -> teambit.compilation/bundler", - "teambit.workspace/workspace -> teambit.component/component", - "teambit.workspace/workspace -> teambit.component/component-tree", "teambit.workspace/workspace -> teambit.component/graph", "teambit.workspace/workspace -> teambit.component/isolator", - "teambit.workspace/workspace -> teambit.dependencies/dependency-resolver", - "teambit.workspace/workspace -> teambit.envs/envs", "teambit.workspace/workspace -> teambit.explorer/command-bar", - "teambit.workspace/workspace -> teambit.harmony/aspect-loader", - "teambit.workspace/workspace -> teambit.harmony/pubsub", "teambit.workspace/workspace -> teambit.scope/scope", - "teambit.workspace/workspace -> teambit.ui-foundation/sidebar", "teambit.workspace/workspace -> teambit.ui-foundation/ui", - "teambit.workspace/workspace-config-files -> teambit.envs/envs", "teambit.workspace/workspace-config-files -> teambit.workspace/workspace", - "teambit.workspace/workspace-root -> teambit.component/component", "teambit.workspace/workspace-root -> teambit.scope/importer", "teambit.workspace/workspace-root -> teambit.scope/scope", "teambit.workspace/workspace-root -> teambit.workspace/install",