diff --git a/.github/workflows/ts-check.yml b/.github/workflows/ts-check.yml new file mode 100644 index 0000000000..0e30bd2d89 --- /dev/null +++ b/.github/workflows/ts-check.yml @@ -0,0 +1,26 @@ +name: TypeScript Check + +on: + pull_request: + types: [opened, reopened, edited] + +jobs: + # Test job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Install Node + uses: actions/setup-node@v3 + with: + node-version: 20.x + + - name: Install Dependencies + run: | + yarn install + + - name: Build Project + run: | + yarn tsc --noEmit diff --git a/package.json b/package.json index 031c757a89..e17a9fe92d 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "@types/esprima": "^4.0.3", "@types/grecaptcha": "^3.0.4", "@types/js-beautify": "^1.14.3", + "@types/node-statsd": "^0.1.6", "@types/three": "^0.149.0", "@types/throttle-debounce": "^5.0.0", "@types/w3c-web-serial": "^1.0.3" diff --git a/src/components/big-interactive-pages/login.tsx b/src/components/big-interactive-pages/login.tsx index 65fed7e151..b544a43ceb 100644 --- a/src/components/big-interactive-pages/login.tsx +++ b/src/components/big-interactive-pages/login.tsx @@ -36,11 +36,11 @@ export default function Login({ session, email, to }: LoginProps) {

Log In to Sprig

{auth.stage.value === 'EMAIL' ? (<>

Please enter your email address below. We'll send you a code to access all your games.

- + - + undefined} value={auth.email.value} type='email' id='email' autoComplete='email' placeholder='fiona@hackclub.com' bind={auth.email} /> {auth.state.value === 'EMAIL_INCORRECT' &&

Failed sending login code. Did you enter the right email?

} - + @@ -54,9 +54,9 @@ export default function Login({ session, email, to }: LoginProps) {

- + - + undefined} value={auth.code.value} id='code' type='text' maxLength={6} placeholder='123456' bind={auth.code} /> {auth.state.value === 'CODE_INCORRECT' &&

Incorrect login code.

} @@ -70,7 +70,7 @@ export default function DraftWarningModal(props: DraftWarningModalProps) {

You've used Sprig before, so we emailed you a code to log in and access all your games. Enter login code:

- + undefined} value={auth.code.value} maxLength={6} class={styles.center} type='text' bind={auth.code} placeholder='123456' /> @@ -88,4 +88,4 @@ export default function DraftWarningModal(props: DraftWarningModalProps) {
) -} \ No newline at end of file +} diff --git a/src/components/popups-etc/save-prompt.tsx b/src/components/popups-etc/save-prompt.tsx index 076d9f0f58..da5cd77e89 100644 --- a/src/components/popups-etc/save-prompt.tsx +++ b/src/components/popups-etc/save-prompt.tsx @@ -12,7 +12,7 @@ interface SavePromptProps { persistenceState: Signal onClose: () => void } - + export default function SavePrompt(props: SavePromptProps) { const email = useSignal(props.persistenceState.value.session?.user.email ?? '') const emailValid = useComputed(() => isValidEmail(email.value)) @@ -38,7 +38,7 @@ export default function SavePrompt(props: SavePromptProps) { }}>

Enter your email to save your work, we'll send you a link for later:

- + undefined} value={email.value} type='email' autoComplete='email' placeholder='fiona@hackclub.com' bind={email} /> @@ -54,10 +54,10 @@ export default function SavePrompt(props: SavePromptProps) { ) } - + return (
{content}
) -} \ No newline at end of file +} diff --git a/src/integrations/generate-metadata.ts b/src/integrations/generate-metadata.ts index 705069af0b..28e9091cab 100644 --- a/src/integrations/generate-metadata.ts +++ b/src/integrations/generate-metadata.ts @@ -1,6 +1,6 @@ /** * Astro integration that generatest the game/metadata.json - * + * * How it works: * 1. It walks/scans the ./games/ directory * 2. It searches each file for metadata, if anything isn't found it halts the build/dev @@ -26,7 +26,7 @@ const regexExpr = { * * TODO! */ -const isMetadataValid = (meta: any): boolean => { +const isMetadataValid = (_: any): boolean => { return true; }; diff --git a/src/lib/state.ts b/src/lib/state.ts index 6d1c502135..c842e722d9 100644 --- a/src/lib/state.ts +++ b/src/lib/state.ts @@ -134,23 +134,23 @@ export const themes: Partial> = { export const switchTheme = (themeType: ThemeType) => { theme.value = themeType; - + // store the new theme value in local storage localStorage.setItem("theme", themeType); const themeValue = themes[themeType]; // set the document values const documentStyle = document.body.style; - documentStyle.background = themeValue.background; - document.documentElement.style.setProperty(`--accent`, themeValue.accent); - document.documentElement.style.setProperty(`--accent-dark`, themeValue.accentDark); - document.documentElement.style.setProperty(`--fg-muted-on-accent`, themeValue.fgMutedOnAccent); - documentStyle.color = themeValue.color; - + documentStyle.background = themeValue!.background; + document.documentElement.style.setProperty(`--accent`, themeValue!.accent); + document.documentElement.style.setProperty(`--accent-dark`, themeValue!.accentDark); + document.documentElement.style.setProperty(`--fg-muted-on-accent`, themeValue!.fgMutedOnAccent); + documentStyle.color = themeValue!.color; + // change the color of the text in elements having .copy-container style // These includes pages such as 'Gallery' and 'Your Games' const copyContainer = document.querySelector(".copy-container") as HTMLDivElement; if (copyContainer) { - copyContainer.style.color = themeValue.copyContainerText; + copyContainer.style.color = themeValue!.copyContainerText; } -} \ No newline at end of file +} diff --git a/src/pages/gallery/gallery.tsx b/src/pages/gallery/gallery.tsx index f00ff63e8d..699bf341fa 100644 --- a/src/pages/gallery/gallery.tsx +++ b/src/pages/gallery/gallery.tsx @@ -3,7 +3,7 @@ import { loadThumbnailUrl } from "../../lib/thumbnail"; import { GameMetadata } from "../../lib/game-saving/gallery"; import Button from "../../components/design-system/button"; import Input from "../../components/design-system/input"; -import { IoCaretDown, IoSearch, IoClose } from "react-icons/io5"; +import { IoCaretDown, IoSearch } from "react-icons/io5"; import "./gallery.css"; enum SortOrder { @@ -269,4 +269,4 @@ export default function Gallery({ games, tags }: { games: GameMetadata[], tags:
) -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index f2f4374a8c..38856f703f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1570,6 +1570,13 @@ dependencies: "@types/unist" "*" +"@types/node-statsd@^0.1.6": + version "0.1.6" + resolved "https://registry.yarnpkg.com/@types/node-statsd/-/node-statsd-0.1.6.tgz#87c2de1f1a1eda6ab4187f4475ee3dc3caa56b8b" + integrity sha512-C3E7STmDzLmXLbIK+C9P5Su6FFW1Ki+Uzjfh6NCBU+5iveeDJl69bmc+0wMSOEymSbPLqPvBsF84mtYDGILlPw== + dependencies: + "@types/node" "*" + "@types/node@*", "@types/node@>=12.12.47", "@types/node@>=13.7.0": version "18.13.0" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.13.0.tgz#0400d1e6ce87e9d3032c19eb6c58205b0d3f7850"