Skip to content

Commit 451dddd

Browse files
committed
chore: More build and package fixes
1 parent 3589d23 commit 451dddd

80 files changed

Lines changed: 396 additions & 261 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.changeset/slick-days-agree.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
"@plextv/vite-plugin-react-reanimated-lightning": patch
3+
"@plextv/vite-plugin-react-native-lightning": patch
4+
"@plextv/react-native-lightning-components": patch
5+
"@plextv/react-native-lightning-example": patch
6+
"@plextv/react-lightning-components": patch
7+
"@plextv/vite-plugin-msdf-fontgen": patch
8+
"@plextv/react-native-lightning": patch
9+
"@plextv/react-lightning-plugin-css-transform": patch
10+
"@plextv/react-lightning-example": patch
11+
"@plextv/react-lightning-plugin-flexbox-lite": patch
12+
"@plextv/react-lightning-plugin-reanimated": patch
13+
"@plextv/react-lightning": patch
14+
"@plextv/react-lightning-plugin-flexbox": patch
15+
"@repo/configs": patch
16+
"@plextv/react-lightning-storybook": patch
17+
---
18+
19+
chore: More build and package fixes

‎apps/react-lightning-example/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"clean": "del ./dist",
2020
"dev": "vite --host",
2121
"preview": "vite preview --host --port 3333",
22+
"check:types": "tsc --noEmit",
2223
"test:unit": "vitest run --passWithNoTests"
2324
},
2425
"dependencies": {

‎apps/react-lightning-example/src/api/getHeaders.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getClientIdentifier } from './getClientIdentifier';
33
const getScreenResolution = () =>
44
`${window.innerWidth}x${window.innerHeight},${window.screen.width}x${window.screen.height}`;
55

6-
export const getHeaders = (token?: string) => {
6+
export const getHeaders = (token?: string): Record<string, string> => {
77
const headers: Record<string, string> = {
88
Accept: 'application/json',
99
'X-Plex-Product': 'Plex Web',

‎apps/react-lightning-example/src/api/getImageUrl.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const baseUrl = 'https://images.plex.tv/photo';
22

3-
export const getImageUrl = (url?: string) => {
3+
export const getImageUrl = (url?: string): string => {
44
if (!url) {
55
return '';
66
}

‎apps/react-lightning-example/src/api/getToken.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { getHeaders } from './getHeaders';
22

33
const baseUrl = 'https://clients.plex.tv/api/v2/users/anonymous';
44

5-
export const getToken = async () => {
5+
export const getToken = async (): Promise<string> => {
66
const token = localStorage.getItem('authToken');
77

88
if (token) {

‎apps/react-lightning-example/src/api/useHubItemsData.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import useSWR from 'swr';
1+
import useSWR, { type SWRResponse } from 'swr';
22
import { getHeaders } from './getHeaders';
33
import { getToken } from './getToken';
44
import type { HubItemsRoot } from './types/HubItems';
@@ -13,7 +13,7 @@ const args = {
1313
includeDetails: '1',
1414
};
1515

16-
export const useHubItemsData = (hubKey: string) => {
16+
export const useHubItemsData = (hubKey: string): SWRResponse<HubItemsRoot> => {
1717
return useSWR<HubItemsRoot>(
1818
baseUrl + hubKey,
1919
async () => {

‎apps/react-lightning-example/src/api/useHubsData.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import useSWR from 'swr';
1+
import useSWR, { type SWRResponse } from 'swr';
22
import { getHeaders } from './getHeaders';
33
import { getToken } from './getToken';
44
import type { HubRoot } from './types/Hubs';
@@ -11,7 +11,7 @@ const args = {
1111
count: '4',
1212
};
1313

14-
export const useHubsData = () => {
14+
export const useHubsData = (): SWRResponse<HubRoot> => {
1515
return useSWR<HubRoot>(
1616
baseUrl,
1717
async () => {

‎apps/react-lightning-example/src/components/AnimatedImage.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { LightningImageElement } from '@plextv/react-lightning';
2-
import { useEffect, useMemo, useRef, useState } from 'react';
2+
import { type FC, useEffect, useMemo, useRef, useState } from 'react';
33

44
function randomInt(max: number): number {
55
return Math.round(Math.random() * max);
66
}
77

8-
const AnimatedImage = () => {
8+
const AnimatedImage: FC = () => {
99
const duration = useMemo(() => randomInt(2000) + 500, []);
1010
const ref = useRef<LightningImageElement>(null);
1111
const [x, setX] = useState(randomInt(1670));

‎apps/react-lightning-example/src/components/Button.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type {
55
LightningViewElementProps,
66
} from '@plextv/react-lightning';
77
import { Keys, useFocus } from '@plextv/react-lightning';
8-
import { useCallback } from 'react';
8+
import { type FC, useCallback } from 'react';
99

1010
const containerStyles: LightningElementStyle = {
1111
w: 330,
@@ -29,7 +29,7 @@ type Props = LightningViewElementProps & {
2929
onPress?: () => void;
3030
};
3131

32-
const Button = (props: Props) => {
32+
const Button: FC<Props> = (props) => {
3333
const { autoFocus, onPress, ...otherProps } = props;
3434
const { ref, focused } = useFocus<LightningElement>({ autoFocus });
3535

‎apps/react-lightning-example/src/components/HubItem.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
useFocus,
66
} from '@plextv/react-lightning';
77
import { Column } from '@plextv/react-lightning-components';
8+
import type { FC } from 'react';
89
import { getImageUrl } from '../api/getImageUrl';
910
import type { Metadata } from '../api/types/Metadata';
1011

@@ -13,7 +14,7 @@ interface Props extends LightningViewElementProps {
1314
style?: LightningViewElementStyle;
1415
}
1516

16-
export const HubItem = ({ metadata, style, ...rest }: Props) => {
17+
export const HubItem: FC<Props> = ({ metadata, style, ...rest }) => {
1718
const poster = metadata.Image?.find((image) => image.type === 'coverPoster');
1819
const { ref, focused } = useFocus<LightningViewElement>();
1920

0 commit comments

Comments
 (0)