Skip to content

Commit

Permalink
fix: remove circular dependency warnings when generating bundled file…
Browse files Browse the repository at this point in the history
…s with Rollup
  • Loading branch information
joshhowenstine committed Mar 1, 2024
1 parent 4a9c28a commit 930e9bf
Show file tree
Hide file tree
Showing 28 changed files with 84 additions and 58 deletions.
2 changes: 1 addition & 1 deletion packages/@lightningjs/ui-components/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
export * from './src/components';
export * from './src/mixins';
export * from './src/types/lui';
export * from './src/globals';
// export * from './src/globals';

// exports without type definitions
export { default as utils } from './src/utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import lng from '@lightningjs/core';
import { Color, StylePartial } from '../../types/lui';
import Surface, { SurfaceStyle } from '../Surface';
import type { TextBoxStyle } from '../TextBox'; // text in Button is all using our own version of TextBox
import type TextBoxStyle from '../TextBox/TextBox.style'; // text in Button is all using our own version of TextBox

type ButtonStyle = SurfaceStyle & {
justify: 'center' | 'left' | 'right';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

import type lng from '@lightningjs/core';
import Surface, { SurfaceStyle } from '../Surface';
import TextBox, { TextBoxStyle } from '../TextBox';
import TextBox from '../TextBox';
import type TextBoxStyle from '../TextBox/TextBox.style';
import { Color, StylePartial } from '../../types/lui';

type CardStyle = SurfaceStyle & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

import lng from '@lightningjs/core';
import { StylePartial } from '../../types/lui';
import TextBox, { TextBoxStyle } from '../TextBox';
import TextBox from '../TextBox';
import type TextBoxStyle from '../TextBox/TextBox.style';
import CardTitle, { CardTitleStyle } from './CardTitle';

type CardRadioStyle = CardTitleStyle & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import lng from '@lightningjs/core';
import Card, { CardStyle } from './Card';
import { StylePartial } from '../../types/lui';
import Icon from '../Icon';
import { TextBoxStyle } from '../TextBox';
import type TextBoxStyle from '../TextBox/TextBox.style';

type CardSectionStyle = CardStyle & {
iconHeight: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

import lng from '@lightningjs/core';
import Card, { CardStyle } from './Card';
import TextBox, { TextBoxStyle } from '../TextBox';
import TextBox from '../TextBox';
import type TextBoxStyle from '../TextBox/TextBox.style';
import { StylePartial } from '../../types/lui';

type CardTitleStyle = CardStyle & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import lng from '@lightningjs/core';
import { Color, StylePartial } from '../../types/lui';
import Card, { CardStyle } from '../Card';
import TextBox, { TextBoxStyle } from '../TextBox';
import TextBox from '../TextBox';
import type TextBoxStyle from '../TextBox/TextBox.style';
import MetadataBase from '../MetadataBase';
import Tile from '../Tile';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import lng from '@lightningjs/core';
import Base from '../Base';
import { StylePartial } from '../../types/lui';
import { TextBoxStyle } from '../TextBox';
import type TextBoxStyle from '../TextBox/TextBox.style';

type GridOverlayStyle = {
propertyTextStyle: TextBoxStyle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import lng from '@lightningjs/core';
import Badge from '../Badge';
import Base from '../Base';
import { StylePartial } from '../../types/lui';
import TextContent from '../TextBox/TextBox';
import TextContent from '../TextBox/TextBox.content';

type JustifyContent =
| 'flex-start'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

import lng from '@lightningjs/core';
import Button, { ButtonStyle } from '../Button';
import TextBox, { TextBoxStyle } from '../TextBox';
import TextBox from '../TextBox';
import type TextBoxStyle from '../TextBox/TextBox.style';
import { StylePartial } from '../../types/lui';

type InputStyle = ButtonStyle & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

import lng from '@lightningjs/core';
import Button, { ButtonStyle } from '../Button';
import TextBox, { TextBoxStyle } from '../TextBox';
import TextBox from '../TextBox';
import type TextBoxStyle from '../TextBox/TextBox.style';
import { StylePartial } from '../../types/lui';

type LogoStyleObject = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

import lng from '@lightningjs/core';
import { StylePartial } from '../../types/lui';
import TextBox, { TextBoxStyle } from '../TextBox';
import TextBox from '../TextBox';
import type TextBoxStyle from '../TextBox/TextBox.style';
import ListItem, { ListItemStyle } from './ListItem';
import NestedSlider from './NestedSlider';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import lng from '@lightningjs/core';
import Base from '../Base';
import { Color, StylePartial } from '../../types/lui';
import { TextBoxStyle } from '../TextBox';
import type TextBoxStyle from '../TextBox/TextBox.style';

type MarqueeStyle = {
/** @deprecated */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import lng from '@lightningjs/core';
import Base from '../Base';
import { StylePartial } from '../../types/lui';
import TextBox, { TextBoxStyle } from '../TextBox';
import TextBox from '../TextBox';
import type TextBoxStyle from '../TextBox/TextBox.style';
import Icon from '../Icon';

type MetadataBaseStyle = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import lng from '@lightningjs/core';
import MetadataBase, { MetadataBaseStyle } from '../MetadataBase';
import Provider, { ProviderStyle } from '../Provider';
import TextBox, { TextBoxStyle } from '../TextBox';
import TextBox from '../TextBox';
import type TextBoxStyle from '../TextBox/TextBox.style';
import { StylePartial } from '../../types/lui';

type MetadataCardContentStyle = MetadataBaseStyle & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import lng from '@lightningjs/core';
import Base from '../Base';
import { TextBoxStyle } from '../TextBox';
import type TextBoxStyle from '../TextBox/TextBox.style';
import { Color, StylePartial } from '../../types/lui';

type ProviderStyle = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import lng from '@lightningjs/core';
import Slider, { SliderStyle } from '../Slider';
import { ScrollWrapperStyle } from './ScrollWrapper';
import ScrollWrapperStyle from './ScrollWrapper.style';
import { StylePartial } from '../../types/lui';

type ScrollSliderStyle = SliderStyle & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,8 @@
import lng from '@lightningjs/core';
import ScrollSlider from './ScrollSlider';
import Base from '../Base';
import { TextBoxStyle } from '../TextBox';
import { StylePartial } from '../../types/lui';

type ScrollWrapperStyle = {
textStyle: TextBoxStyle;
scrollBarW: number;
scrollBarH: number;
fadeHeight: 100;
scroll: {
timingFunction: string;
duration: number;
};
contentMarginTop: number;
contentMarginLeft: number;
sliderMarginLeft: number;
};
import ScrollWrapperStyle from './ScrollWrapper.style';

declare namespace ScrollWrapper {
export interface TemplateSpec extends Base.TemplateSpec {
Expand Down Expand Up @@ -161,4 +147,4 @@ declare class ScrollWrapper<
get _ScrollableText(): lng.Component;
}

export { ScrollWrapper as default, ScrollWrapperStyle };
export { ScrollWrapper as default };
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type TextBoxStyle from '../TextBox/TextBox.style';

type ScrollWrapperStyle = {
textStyle: TextBoxStyle;
scrollBarW: number;
scrollBarH: number;
fadeHeight: 100;
scroll: {
timingFunction: string;
duration: number;
};
contentMarginTop: number;
contentMarginLeft: number;
sliderMarginLeft: number;
};

export { ScrollWrapperStyle as default }

Check failure on line 17 in packages/@lightningjs/ui-components/src/components/ScrollWrapper/ScrollWrapper.style.d.ts

View workflow job for this annotation

GitHub Actions / quality / lint-unit

Insert `;⏎`
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

import ScrollWrapper, { ScrollWrapperStyle } from './ScrollWrapper';
import ScrollWrapper from './ScrollWrapper';

export { ScrollWrapper as default, ScrollWrapperStyle };
export { ScrollWrapper as default };
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import lng from '@lightningjs/core';
import { Color, StylePartial } from '../../types/lui';
import Surface, { SurfaceStyle } from '../Surface';
// text should be using our own version of TextBox
import TextBox, { TextBoxStyle } from '../TextBox';
import TextBox from '../TextBox';
import type TextBoxStyle from '../TextBox/TextBox.style';
import Icon from '../Icon';

type TabStyle = SurfaceStyle & {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import lng from '@lightningjs/core';

type ContentBase = {
title?: string;
announce?: string;
style?: lng.textures.TextTexture.Settings | string;
};

type TextContent =
| string
| (ContentBase & ({ text: string } | { icon: string } | { badge: string }));

export { TextContent as default }

Check failure on line 13 in packages/@lightningjs/ui-components/src/components/TextBox/TextBox.content.d.ts

View workflow job for this annotation

GitHub Actions / quality / lint-unit

Insert `;⏎`
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,9 @@ import Base from '../Base';
import { StylePartial } from '../../types/lui';
import Marquee from '../Marquee';
import InlineContent from '../InlineContent';
import TextContent from './TextBox.content';
import TextBoxStyle from './TextBox.style';

type ContentBase = {
title?: string;
announce?: string;
style?: lng.textures.TextTexture.Settings | string;
};

type TextContent =
| string
| (ContentBase & ({ text: string } | { icon: string } | { badge: string }));

type TextBoxStyle = {
offsetY: number;
offsetX: number;
textStyle: lng.textures.TextTexture.Settings | string;
};

Check failure on line 27 in packages/@lightningjs/ui-components/src/components/TextBox/TextBox.d.ts

View workflow job for this annotation

GitHub Actions / quality / lint-unit

Delete `⏎`
declare namespace TextBox {
export interface TemplateSpec extends Base.TemplateSpec {
Expand Down Expand Up @@ -123,4 +110,4 @@ declare class TextBox<
get _Text(): TextBox;
}

export { TextBox as default, TextBoxStyle, TextContent };
export { TextBox as default };
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import lng from '@lightningjs/core';

type TextBoxStyle = {
offsetY: number;
offsetX: number;
textStyle: lng.textures.TextTexture.Settings | string;
};

export { TextBoxStyle as default }

Check failure on line 9 in packages/@lightningjs/ui-components/src/components/TextBox/TextBox.style.d.ts

View workflow job for this annotation

GitHub Actions / quality / lint-unit

Insert `;`
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

import TextBox, { TextBoxStyle, TextContent } from './TextBox';
import TextBox from './TextBox';

export { TextBox as default, TextBoxStyle, TextContent };
export { TextBox as default };
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import type Row from '../Row';
import FocusManager from '../FocusManager';
import type { NavigationManagerStyle } from '../NavigationManager/NavigationManager';
import type { StylePartial } from '../../types/lui';
import type { TextBoxStyle } from '../TextBox';
import type TextBoxStyle from '../TextBox/TextBox.style';

// Why does `TitleRow` extend `Row` but use style props from `NavigationManager`?
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import lng from '@lightningjs/core';
import Base from '../Base';
import { Color, StylePartial } from '../../types/lui';
import TextBox, { TextBoxStyle } from '../TextBox';
import TextBox from '../TextBox';
import type TextBoxStyle from '../TextBox/TextBox.style';

type TooltipStyle = {
backgroundColor: Color;
Expand Down
7 changes: 5 additions & 2 deletions packages/@lightningjs/ui-components/src/components/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,15 @@ export { default as ProgressBar, ProgressBarStyle } from './ProgressBar';
export { default as Provider, ProviderStyle } from './Provider';
export { default as Radio, RadioStyle } from './Radio';
export { default as Row } from './Row';
export { default as ScrollWrapper, ScrollWrapperStyle } from './ScrollWrapper';
export { default as ScrollWrapper } from './ScrollWrapper';
export { default as ScrollWrapperStyle } from './ScrollWrapper/ScrollWrapper.style';
export { default as Shadow, ShadowStyle } from './Shadow';
export { default as Slider, SliderStyle } from './Slider';
export { default as Surface, SurfaceStyle } from './Surface';
export { default as TabBar, TabBarStyle, Tab, TabStyle } from './TabBar';
export { default as TextBox, TextBoxStyle, TextContent } from './TextBox';
export { default as TextBox } from './TextBox';
export { default as TextBoxStyle } from './TextBox/TextBox.style';
export { default as TextContent } from './TextBox/TextBox.content';
export { default as Tile, TileStyle } from './Tile';
export { default as TitleRow, TitleRowStyle } from './TitleRow';
export { default as Toggle, ToggleStyle } from './Toggle';
Expand Down

0 comments on commit 930e9bf

Please sign in to comment.