diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..ce1022b --- /dev/null +++ b/.eslintignore @@ -0,0 +1,8 @@ +# Ignore all config files in the root folder +leaky-ships/*.config.js + +# Ignore the whole __tests__ folder +leaky-ships/__tests__ + +# Allow all other files in folders +leaky-ships/!*/ diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index d860e09..7b2437c 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -18,12 +18,12 @@ jobs: - name: Install Node.js uses: actions/setup-node@v3 with: - node-version: 20 + node-version: 18 - uses: pnpm/action-setup@v2 name: Install pnpm with: - version: 8.7.4 + version: 8.6.10 run_install: false - name: Get pnpm store directory @@ -41,8 +41,8 @@ jobs: - name: Add FA token run: | - npm config set "@fortawesome:registry" "https://npm.fontawesome.com/" - npm config set "//npm.fontawesome.com/:_authToken" "${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" + echo "@fortawesome:registry=https://npm.fontawesome.com/" > .npmrc + npm config set '//npm.fontawesome.com/:_authToken' "${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" - name: Install dependencies run: pnpm install --frozen-lockfile @@ -53,7 +53,8 @@ jobs: - name: 'Compiling page' run: | echo "${{ secrets.ENV_FILE }}" > .env - pnpm build + pnpm prisma generate + pnpm run build - name: Run Playwright tests run: pnpm playwright test diff --git a/README.md b/README.md index 9314081..9d8b856 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # leaky-ships - -Battleship web app made with SolidJS using solid-start. +Battleship web app with react frontend and ASP.NET Core backend ## Bluetooth diff --git a/leaky-ships/.eslintrc.json b/leaky-ships/.eslintrc.json index bf919bc..ed20e77 100644 --- a/leaky-ships/.eslintrc.json +++ b/leaky-ships/.eslintrc.json @@ -1,11 +1,6 @@ { - "parser": "@typescript-eslint/parser", - "env": { - "node": true - }, - "plugins": ["solid"], - "extends": [ - "plugin:@typescript-eslint/recommended", - "plugin:solid/typescript" - ] + "extends": ["next/core-web-vitals", "prettier"], + "rules": { + "@next/next/no-img-element": "off" + } } diff --git a/leaky-ships/.gitignore b/leaky-ships/.gitignore index 404e93b..8f793d8 100644 --- a/leaky-ships/.gitignore +++ b/leaky-ships/.gitignore @@ -1,35 +1,48 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# logs /log -src/drizzle/migrations -dist -.vinxi -.output -.vercel -.netlify -netlify - -# Environment -.env -.env*.local +# prisma +/prisma/migrations # dependencies /node_modules +/.pnp +.pnp.js -# IDEs and editors -/.idea -.project -.classpath -*.launch -.settings/ +# testing +/coverage -# Temp -gitignore +# next.js +/.next/ +/out/ -# System Files +# production +/build + +# misc .DS_Store -Thumbs.db +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# local env files +.env +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts # playwright /test-results/ /playwright-report/ -/playwright/.cache/ \ No newline at end of file +/playwright/.cache/ diff --git a/leaky-ships/src/components/Bluetooth.tsx b/leaky-ships/components/Bluetooth.tsx similarity index 91% rename from leaky-ships/src/components/Bluetooth.tsx rename to leaky-ships/components/Bluetooth.tsx index e726498..f2ea535 100644 --- a/leaky-ships/src/components/Bluetooth.tsx +++ b/leaky-ships/components/Bluetooth.tsx @@ -1,8 +1,8 @@ -import { createSignal } from "solid-js" +import { useState } from "react" function Bluetooth() { - const [startDisabled, setStartDisabled] = createSignal(true) - const [stopDisabled, setStopDisabled] = createSignal(true) + const [startDisabled, setStartDisabled] = useState(true) + const [stopDisabled, setStopDisabled] = useState(true) const deviceName = "Chromecast Remote" // ble UV Index @@ -48,7 +48,7 @@ function Bluetooth() { if (!isWebBluetoothEnabled()) return return getDeviceInfo() .then(connectGatt) - .then(() => { + .then((_) => { console.log("Reading UV Index...") return gattCharacteristic.readValue() }) @@ -108,7 +108,7 @@ function Bluetooth() { if (!isWebBluetoothEnabled()) return gattCharacteristic .startNotifications() - .then(() => { + .then((_) => { console.log("Start reading...") setStartDisabled(true) setStopDisabled(false) @@ -119,7 +119,7 @@ function Bluetooth() { if (!isWebBluetoothEnabled()) return gattCharacteristic .stopNotifications() - .then(() => { + .then((_) => { console.log("Stop reading...") setStartDisabled(false) setStopDisabled(true) @@ -135,28 +135,28 @@ function Bluetooth() { return (