diff --git a/.env b/.env deleted file mode 100644 index e69de29bb..000000000 diff --git a/.eslintignore b/.eslintignore index 52b9ce5ab..677cb4756 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,5 +1,5 @@ node_modules/ lib/ -web/js -web/ruffle -web/built-games \ No newline at end of file +public_html/ +app/public/ +app/vite-env.d.ts \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f057b28f8..6c070ba7d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,6 +6,12 @@ version: 2 updates: - package-ecosystem: "npm" + target-branch: "master" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "npm" + target-branch: "next" directory: "/" schedule: interval: "daily" diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml deleted file mode 100644 index e145c7271..000000000 --- a/.github/workflows/bump.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Bump - -on: - push: - branches: [ "master" ] - -jobs: - bump-version: - name: "Bump Version on master" - runs-on: ubuntu-latest - - steps: - - name: "Checkout source code" - uses: "actions/checkout@v2" - with: - ref: ${{ github.ref }} - - name: "cat package.json" - run: cat ./package.json - - name: "Setup Node.js" - uses: "actions/setup-node@v1" - with: - node-version: 14 - - name: "Automated Version Bump" - id: version-bump - uses: "phips28/gh-action-bump-version@master" - with: - tag-prefix: '' - commit-message: 'Bump: package.json version to {{version}}' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..52a18e2e9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,94 @@ +name: CI/CD + +on: + push: + branches: '**' + workflow_dispatch: + +jobs: + + version: + name: Bump Version + runs-on: ubuntu-latest + if: github.ref != 'refs/heads/master' + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.ref }} + + - run: | + git config --global user.name 'CI/CD' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + npm version patch -m "Bump: %s" + git push + + lint: + name: Lint + runs-on: ubuntu-latest + needs: version + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.ref }} + + - name: Use Node.js 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install Dependencies + run: npm ci + + - name: "Lint" + run: | + git config --global user.name 'CI/CD' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + npm run lint || true + git commit -am "Eslint: fix all" || true + git push || true + + deploy: + name: Deploy + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' + permissions: + contents: write + pages: write + id-token: write + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.ref }} + submodules: true + + - name: Setup Pages + uses: actions/configure-pages@v3 + + - name: Use Node.js 18 + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install Dependencies + run: npm ci + + - name: Build + run: | + npm run build + + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: 'public_html' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 + diff --git a/.github/workflows/code-quality-analysis.yml b/.github/workflows/code-quality-analysis.yml index 05a91e1c6..c1f3a4b74 100644 --- a/.github/workflows/code-quality-analysis.yml +++ b/.github/workflows/code-quality-analysis.yml @@ -13,9 +13,7 @@ name: "Code Quality Analysis" on: push: - branches: [master] - pull_request: - branches: [] + branches: ["**"] jobs: analyze: diff --git a/.github/workflows/code-style-analysis.yml b/.github/workflows/code-style-analysis.yml deleted file mode 100644 index a629075f1..000000000 --- a/.github/workflows/code-style-analysis.yml +++ /dev/null @@ -1,41 +0,0 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Code Style Analysis - -# Run on basicly every change to the tree -on: - push: - branches: [master] - pull_request: - branches: [master] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - eslint: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Checkout repository - uses: actions/checkout@v2 - - # Sets up node environment - - name: Use Node.js 14 - uses: actions/setup-node@v2 - with: - node-version: '14' - - # Install node modules - - name: Install node modules - run: | - npm ci - - # Attempt to build - - name: Run ESLint - run: | - ./node_modules/.bin/eslint --max-warnings=0 --fix . diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 28c630a39..000000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,32 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Publish to Docker Hub - -on: - push: - branches: [ master ] - -jobs: - push_to_registry: - name: Push Docker image to Docker Hub - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v2 - - - name: Log in to Docker Hub - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - username: shsgames - password: ${{ secrets.DOCKER_HUB }} - - - name: Build - run: | - docker build -t shsgames/shsgames . - - - name: Push - run: | - docker push shsgames/shsgames diff --git a/.github/workflows/public-html.yml b/.github/workflows/public-html.yml deleted file mode 100644 index d8e7a28b7..000000000 --- a/.github/workflows/public-html.yml +++ /dev/null @@ -1,48 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Public HTML - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: - - master - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - - name: Use Node.js 14 - uses: actions/setup-node@v2 - with: - node-version: '14' - - - name: Build - run: | - npm ci - npm run build - - - name: Configure git user - run: | - hub config --global user.name "github-actions[bot]" - hub config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - - name: Push - run: | - cd public_html - hub init -b public_html - hub add . - hub commit -m "Build public_html [Github actions]" - echo hub remote add output https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git - hub remote add output https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git - hub push -fu output public_html - diff --git a/.github/workflows/test-ci.yml b/.github/workflows/test-ci.yml deleted file mode 100644 index a6c4bbe6a..000000000 --- a/.github/workflows/test-ci.yml +++ /dev/null @@ -1,46 +0,0 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Test CI - -# Run on basicly every change to the tree -on: - push: - branches: [master] - pull_request: - branches: [master] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Checkout repository - uses: actions/checkout@v2 - - # Sets up node environment - - name: Use Node.js 14 - uses: actions/setup-node@v2 - with: - node-version: '14' - - # Install node modules - - name: Install node modules - run: | - npm ci - - # Attempt to build - - name: Build module - run: | - npm run build --if-present - - # Run tests - - name: Run test suite - run: | - npm run test --if-present diff --git a/.gitignore b/.gitignore index b90d7534b..03370fe6e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,26 @@ -lib/ -node_modules/ -hash -public_html/ -web/__compile_cache/ -pnpm-lock.yaml \ No newline at end of file +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +public_html +lib +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..a2e099a72 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,18 @@ +[submodule "app/public/built-games/cookieclicker"] + path = app/public/built-games/cookieclicker + url = https://github.com/SHSGames/cookieclicker.git +[submodule "app/public/built-games/CSGOClicker"] + path = app/public/built-games/CSGOClicker + url = https://github.com/SHSGames/CSGOClicker.git +[submodule "app/public/built-games/chromedino"] + path = app/public/built-games/chromedino + url = https://github.com/SHSGames/chromedino.git +[submodule "app/public/built-games/baldis-basics"] + path = app/public/built-games/baldis-basics + url = https://github.com/SHSGames/baldis-basics.git +[submodule "app/public/built-games/takumiraccoon"] + path = app/public/built-games/takumiraccoon + url = https://github.com/SHSGames/takumiraccoon.git +[submodule "app/public/IodineGBA"] + path = app/public/IodineGBA + url = https://github.com/SHSGames/IodineGBA.git diff --git a/.npmignore b/.npmignore deleted file mode 100644 index e92803dc4..000000000 --- a/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -*.map$ -*.md$ -.env -.eslint* -.git* -.npmignore -node_modules/ -package-lock.json -src/ -tsconfig.js -nodemon.json \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 2eaf198a2..dd52831cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:14 +FROM node:16 WORKDIR /app diff --git a/MIRRORS.md b/MIRRORS.md new file mode 100644 index 000000000..273c14611 --- /dev/null +++ b/MIRRORS.md @@ -0,0 +1,22 @@ +# Mirrors +Mirrors are community maintained sites incase all the official sites are blocked for you. + +| URL | Status | +| - | - | +| https://artix-hangout.netlify.app | Broken | +| https://bogpog.herokuapp.com | Broken | +| https://breezegames.herokuapp.com | Broken | +| https://cpsgames.herokuapp.com | Outdated | +| http://joe-biden.herokuapp.com | Not Secured | +| https://magixxzshsgames.herokuapp.com | Outdated | +| https://physics-central.com | Outdated | +| https://sh--9pfs.repl.co | ChromeOS Only | +| https://shhstheplayce672.herokuapp.com | Legacy | +| https://shs.barnacled.repl.co | Outdated | +| https://shs.klj2.repl.co | Outdated | +| https://shsgame.herokuapp.com | Broken | +| https://shs-game.herokuapp.com | Outdated | +| http://spotsymath.herokuapp.com | Not Secured | +| https://unbzoked-yay.herokuapp.com | Outdated | +| https://unkxn.netlify.app | Outdated | +| https://virabot-aotic.herokuapp.com | Outdated | \ No newline at end of file diff --git a/README.md b/README.md index f0ab52a8b..703b8f2a3 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,30 @@ -# [SHS Games](https://shsgames.github.io/) -Collectively building an online game hub for the brave! - -### Developer Checks -[![Code Style Analysis](https://github.com/SHSGames/shsgames.github.io/actions/workflows/code-style-analysis.yml/badge.svg)](https://github.com/SHSGames/shsgames.github.io/actions/workflows/code-style-analysis.yml) [![Code Quality Analysis](https://github.com/SHSGames/shsgames.github.io/actions/workflows/code-quality-analysis.yml/badge.svg)](https://github.com/SHSGames/shsgames.github.io/actions/workflows/code-quality-analysis.yml) [![public_html](https://github.com/SHSGames/shsgames.github.io/actions/workflows/public-html.yml/badge.svg)](https://github.com/SHSGames/shsgames.github.io/actions/workflows/public-html.yml) [![Publish to Docker Hub](https://github.com/SHSGames/shsgames.github.io/actions/workflows/docker.yml/badge.svg)](https://github.com/SHSGames/shsgames.github.io/actions/workflows/docker.yml) [![Test CI](https://github.com/SHSGames/shsgames.github.io/actions/workflows/test-ci.yml/badge.svg)](https://github.com/SHSGames/shsgames.github.io/actions/workflows/test-ci.yml) - ---- -## About -SHS Games is a free and open source hub for games. Designed to be unblocked and available for everyone anytime. - -[License](./LICENSE.md) • [Privacy Statement](./PRIVACY.md) - ----- -## Links -* https://bogpog.herokuapp.com -* https://breezegames.herokuapp.com -* https://coolschoolg.herokuapp.com -* https://cpsgames.herokuapp.com -* https://shhstheplayce672.herokuapp.com -* https://shs-games.herokuapp.com *(official)* -* https://shsg.herokuapp.com *(official)* -* https://shsgame.herokuapp.com -* https://shs-game.herokuapp.com -* https://shsgames.github.io *(official)* -* https://shsgames.herokuapp.com *(official)* -* https://virabot-aotic.herokuapp.com -* https://sh.9pfs.repl.co/ (Chrome OS only, using server-side checking) - ---- -## Join the rebellion -SHS Games can be easily spun up in many different environments. Clicking the buttons below will spin up a new site running SHS Games. And if you know what your doing, here are some detailed [Build instructions](https://github.com/SHSGames/shsgames.github.io/blob/master/BUILDING.md) you can also [download the HTML](https://github.com/SHSGames/shsgames.github.io/archive/refs/heads/public_html.zip) for your own web server, or even just a [Docker container](https://hub.docker.com/r/shsgames/shsgames). When you create a mirror, I'll add it to the list above for everyones benifit. - -[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) -[![Remix on Glitch](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button.svg)](https://glitch.com/edit/#!/import/github/SHSGames/shsgames.github.io) -[![Deploy instance on Replit](https://camo.githubusercontent.com/aaa5efab04d69a070ff9ee9f75506b38932a7300359318135f4790c31b7dace4/68747470733a2f2f7265706c2e69742f62616467652f6769746875622f756e6b6e6f776e626c7565677579362f4d696e6553776565706572)](https://replit.com/github/SHSGames/shsgames.github.io) +# [SHS Games](https://shsgames.github.io/) +Collectively building an online game hub for the brave! + +### Developer Checks +[![Code Style Analysis](https://github.com/SHSGames/shsgames.github.io/actions/workflows/code-style-analysis.yml/badge.svg)](https://github.com/SHSGames/shsgames.github.io/actions/workflows/code-style-analysis.yml) [![Code Quality Analysis](https://github.com/SHSGames/shsgames.github.io/actions/workflows/code-quality-analysis.yml/badge.svg)](https://github.com/SHSGames/shsgames.github.io/actions/workflows/code-quality-analysis.yml) [![public_html](https://github.com/SHSGames/shsgames.github.io/actions/workflows/public-html.yml/badge.svg)](https://github.com/SHSGames/shsgames.github.io/actions/workflows/public-html.yml) [![Publish to Docker Hub](https://github.com/SHSGames/shsgames.github.io/actions/workflows/docker.yml/badge.svg)](https://github.com/SHSGames/shsgames.github.io/actions/workflows/docker.yml) [![Test CI](https://github.com/SHSGames/shsgames.github.io/actions/workflows/test-ci.yml/badge.svg)](https://github.com/SHSGames/shsgames.github.io/actions/workflows/test-ci.yml) + +--- +## About +SHS Games is a free and open source hub for games. Designed to be unblocked and available for everyone anytime. + +[License](./LICENSE.md) • [Privacy Statement](./PRIVACY.md) + +---- +## Official Links +* https://shsg.herokuapp.com +* https://shsgames.github.io +* https://shsgames.herokuapp.com +* https://shs-games.herokuapp.com + +Don't worry if they get blocked. There are tons of [community maintained mirrors](./MIRRORS.md). + +--- +## Join the rebellion +SHS Games can be easily spun up in many different environments. Clicking the buttons below will spin up a new site running SHS Games. And if you know what your doing, here are some detailed [Build instructions](https://github.com/SHSGames/shsgames.github.io/blob/master/BUILDING.md) you can also [download the HTML](https://github.com/SHSGames/shsgames.github.io/archive/refs/heads/public_html.zip) for your own web server, or even just a [Docker container](https://hub.docker.com/r/shsgames/shsgames). When you create a mirror, I'll add it to the list above for everyones benifit. + +[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) +[![Remix on Glitch](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button.svg)](https://glitch.com/edit/#!/import/github/SHSGames/shsgames.github.io) +[Deploy instance on Replit](https://replit.com/github/SHSGames/shsgames.github.io) + +Or you can fork this repository and host with GitHub Pages. Reference [#341](https://github.com/SHSGames/shsgames.github.io/discussions/341) for help setting this up. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..ab4e72d2f --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,10 @@ +# Security Policy + +## Supported Versions + +Its reccomended you always use the most up to date version. Version and build info can be found at the bottom right in the footer. +![shsgames github io_1](https://user-images.githubusercontent.com/31785395/158916730-cf7c2e1e-e815-450d-b526-e2b60f9388fa.png) + +## Reporting a Vulnerability + +If you suspect a vulnerability, please report it in the issues tab. diff --git a/web/games.ts b/app/games.ts similarity index 97% rename from web/games.ts rename to app/games.ts index 799ef891a..acf160419 100644 --- a/web/games.ts +++ b/app/games.ts @@ -10,8 +10,25 @@ export interface Game { export default [ + // PARKER GAMES + { + name: "prkr's Agario", + runner: "IFRAME", + game: "https://jptragar.glitch.me/", + thumbnail: "https://cdn.jsdelivr.net/gh/joshmerlino/shsg-pfile/thumbs/prkrs-agario.jpg", + width: 1200, + aspectRatio: 16 / 9 + }, + // IFRAME GAMES { + name: "1v1.lol", + runner: "IFRAME", + game: "https://ejvd3326248pklq0mtj313irgbc2vsrb-a-sites-opensocial.googleusercontent.com/gadgets/ifr?url=https://sites.google.com/site/s035r8h4/1v1.xml&container=enterprise&view=default&lang=en&country=ALL&sanitize=0&v=8d01559d545a3200&libs=core&mid=172&parent=https://sites.google.com/site/unblockedgameswtf/1v1-lol#USX6PB", + thumbnail: "https://cdn.jsdelivr.net/gh/joshmerlino/shsg-pfile/thumbs/1v1lol.png", + width: 1200, + aspectRatio: 16 / 9 + }, { name: "Baldi's Basic", runner: "IFRAME", game: "/built-games/baldis-basics/index.html", @@ -35,7 +52,7 @@ export default [ }, { name: "CSGOClicker", runner: "IFRAME", - game: "/built-games/csgoclicker/index.html", + game: "/built-games/CSGOClicker/index.html", thumbnail: "https://cdn.jsdelivr.net/gh/joshmerlino/shsg-pfile/thumbs/csgoclicker.jpg", width: 1080, aspectRatio: 5 / 3 @@ -693,21 +710,22 @@ export default [ thumbnail: "https://cdn.jsdelivr.net/gh/JoshMerlino/shsg-pfile/thumbs/minesweeper.jpg", width: 800, aspectRatio: 4/3 - }, { - name: "Run 2", - runner: "RUFFLE", - game: "https://cdn.jsdelivr.net/gh/JoshMerlino/shsg-pfile/games/run-2.swf", - thumbnail: "https://cdn.jsdelivr.net/gh/JoshMerlino/shsg-pfile/thumbs/run-2.jpg", - width: 800, - aspectRatio: 4/3 - }, { - name: "Run 3", - runner: "RUFFLE", - game: "https://cdn.jsdelivr.net/gh/JoshMerlino/shsg-pfile/games/run-3.swf", - thumbnail: "https://cdn.jsdelivr.net/gh/JoshMerlino/shsg-pfile/thumbs/run-3.jpg", - width: 800, - aspectRatio: 4/3 } + // , { + // Name: "Run 2", + // Runner: "RUFFLE", + // Game: "https://cdn.jsdelivr.net/gh/JoshMerlino/shsg-pfile/games/run-2.swf", + // Thumbnail: "https://cdn.jsdelivr.net/gh/JoshMerlino/shsg-pfile/thumbs/run-2.jpg", + // Width: 800, + // AspectRatio: 4/3 + // }, { + // Name: "Run 3", + // Runner: "RUFFLE", + // Game: "https://cdn.jsdelivr.net/gh/JoshMerlino/shsg-pfile/games/run-3.swf", + // Thumbnail: "https://cdn.jsdelivr.net/gh/JoshMerlino/shsg-pfile/thumbs/run-3.jpg", + // Width: 800, + // AspectRatio: 4/3 + // } // { name: "N", // Runner: "RUFFLE", // Game: "https://cdn.jsdelivr.net/gh/JoshMerlino/shsg-pfile/games/n.swf", diff --git a/web/ts/types.d.ts b/app/github.d.ts similarity index 79% rename from web/ts/types.d.ts rename to app/github.d.ts index 1ab9e1a6b..e1bf39efe 100644 --- a/web/ts/types.d.ts +++ b/app/github.d.ts @@ -1,36 +1,3 @@ -/* eslint camelcase: off */ -declare const PRODUCTION: boolean; - -declare interface View { - route: string; - default: React.ComponentType; - title?: string; -} - -declare interface AppManifest { - name: string; - short_name: string; - version: string; - description: string; - developerName: string; - developerURL: string; - background_color: string; - theme_color: string; - orientation: string; - crossorigin: string; - icons: { - src: string; - sizes: number[]; - purpose?: string; - destination: string; - }[]; -} - -declare const APP_MANIFEST: AppManifest; -declare const APP_CONFIG: any; - -declare let adsbygoogle: any; - declare namespace GitHub { interface User { diff --git a/web/index.html b/app/index.html similarity index 60% rename from web/index.html rename to app/index.html index ddcfbfcdc..5cd34fbca 100644 --- a/web/index.html +++ b/app/index.html @@ -1,65 +1,59 @@ - - - - - <%= title %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + SHS Games + + + + + + + + + + + + + + +
+ + + diff --git a/app/index.tsx b/app/index.tsx new file mode 100644 index 000000000..35cb2153e --- /dev/null +++ b/app/index.tsx @@ -0,0 +1,55 @@ +import { ElementType, StrictMode } from "react"; +import ReactDOM from "react-dom"; +import { QueryClient, QueryClientProvider } from "react-query"; +import { ReactQueryDevtools } from "react-query/devtools"; +import { BrowserRouter, Route, Routes } from "react-router-dom"; +import { registerSW } from "virtual:pwa-register"; +import { base } from "./manifest.json"; +import ErrorBoundary from "./src/runtime/ErrorBoundry"; +import "styles/main.less"; +import "setimmediate"; +import Drawer from "./src/components/Drawer"; +import Toolbar from "./src/components/Toolbar"; +import Footer from "./src/components/Footer"; +import Keybinds from "./src/runtime/Keybinds"; +import PWAInstaller from "./src/components/PWAInstaller"; + +if ("serviceWorker" in navigator && !/localhost/.test(window.location.toString())) registerSW({ + immediate: true +}); + +export const queryClient = new QueryClient; + +export type Page = { default: ElementType, path: string, caseSensitive?: boolean }; +const pages = import.meta.globEager("./src/pages/*.tsx"); + +// Log SHS GAMES!! +console.log(" _______ _______ _______ _______ _______ _______ _______ \n( ____ \\|\\ /|( ____ \\ ( ____ \\( ___ )( )( ____ \\( ____ \\\n| ( \\/| ) ( || ( \\/ | ( \\/| ( ) || () () || ( \\/| ( \\/\n| (_____ | (___) || (_____ | | | (___) || || || || (__ | (_____ \n(_____ )| ___ |(_____ ) | | ____ | ___ || |(_)| || __) (_____ )\n ) || ( ) | ) | | | \\_ )| ( ) || | | || ( ) |\n/\\____) || ) ( |/\\____) | | (___) || ) ( || ) ( || (____/\\/\\____) |\n\\_______)|/ \\|\\_______) (_______)|/ \\||/ \\|(_______/\\_______)"); +console.log("%cJoin our cult at http://github.com/SHSGames/shsgames.github.io", "color: #1976d4"); +console.log("%cHi, Evan!", "font-style: italic"); + +ReactDOM.render( + + + + + + + + { Object.values(pages).map((page, key) => }/> + ) } + +