diff --git a/bin/web/.prettierignore b/bin/web/.prettierignore index ab78a95..9d789b7 100644 --- a/bin/web/.prettierignore +++ b/bin/web/.prettierignore @@ -2,3 +2,6 @@ package-lock.json pnpm-lock.yaml yarn.lock + +# Static Assets +static/pico.min.css diff --git a/bin/web/.prettierrc b/bin/web/.prettierrc index b513262..fd3282e 100644 --- a/bin/web/.prettierrc +++ b/bin/web/.prettierrc @@ -1,17 +1,15 @@ { - "useTabs": true, - "singleQuote": true, - "trailingComma": "none", - "printWidth": 100, - "plugins": [ - "prettier-plugin-svelte" - ], - "overrides": [ - { - "files": "*.svelte", - "options": { - "parser": "svelte" - } - } - ] + "singleQuote": true, + "tabWidth": 4, + "trailingComma": "es5", + "printWidth": 100, + "plugins": ["prettier-plugin-svelte"], + "overrides": [ + { + "files": "*.svelte", + "options": { + "parser": "svelte" + } + } + ] } diff --git a/bin/web/eslint.config.js b/bin/web/eslint.config.js index d9f4264..42794f8 100644 --- a/bin/web/eslint.config.js +++ b/bin/web/eslint.config.js @@ -1,33 +1,42 @@ -import prettier from "eslint-config-prettier"; +import prettier from 'eslint-config-prettier'; import js from '@eslint/js'; import svelte from 'eslint-plugin-svelte'; import globals from 'globals'; import ts from 'typescript-eslint'; export default ts.config( - js.configs.recommended, - ...ts.configs.recommended, - ...svelte.configs["flat/recommended"], - prettier, - ...svelte.configs['flat/prettier'], - { - languageOptions: { - globals: { - ...globals.browser, - ...globals.node - } - } - }, - { - files: ["**/*.svelte"], + { + ignores: ['build/', '.svelte-kit/**', 'dist/'] + }, + js.configs.recommended, + ...ts.configs.recommended, + ...svelte.configs['flat/recommended'], + prettier, + ...svelte.configs['flat/prettier'], + { + languageOptions: { + globals: { + ...globals.browser, + ...globals.node + } + } + }, + { + files: ['**/*.svelte'], - languageOptions: { - parserOptions: { - parser: ts.parser - } - } - }, - { - ignores: ["build/", ".svelte-kit/", "dist/"] - } + languageOptions: { + parserOptions: { + parser: ts.parser + } + } + }, + { + rules: { + '@typescript-eslint/no-unused-vars': [ + 'error', + { argsIgnorePattern: '^_', varsIgnorePattern: '^_' } + ], + '@typescript-eslint/no-explicit-any': 'off' + } + } ); diff --git a/bin/web/package.json b/bin/web/package.json index 7b7964f..4018e31 100644 --- a/bin/web/package.json +++ b/bin/web/package.json @@ -1,37 +1,38 @@ { - "name": "web", - "version": "0.0.1", - "type": "module", - "scripts": { - "dev": "vite dev", - "build": "vite build", - "preview": "vite preview", - "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", - "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "test:unit": "vitest", - "test": "npm run test:unit -- --run", - "format": "prettier --write .", - "lint": "prettier --check . && eslint ." - }, - "devDependencies": { - "@sveltejs/adapter-auto": "^3.0.0", - "@sveltejs/adapter-static": "^3.0.5", - "@sveltejs/kit": "^2.0.0", - "@sveltejs/vite-plugin-svelte": "^4.0.0", - "@types/eslint": "^9.6.0", - "autoprefixer": "^10.4.20", - "eslint": "^9.7.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-svelte": "^2.36.0", - "globals": "^15.0.0", - "prettier": "^3.3.2", - "prettier-plugin-svelte": "^3.2.6", - "svelte": "^5.0.0", - "svelte-check": "^4.0.0", - "tailwindcss": "^3.4.9", - "typescript": "^5.0.0", - "typescript-eslint": "^8.0.0", - "vite": "^5.0.3", - "vitest": "^2.0.4" - } + "name": "web", + "version": "0.0.1", + "type": "module", + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "test:unit": "vitest", + "test": "npm run test:unit -- --run", + "format": "prettier --write .", + "lint": "prettier --check . && eslint .", + "fix": "eslint --fix ." + }, + "devDependencies": { + "@sveltejs/adapter-auto": "^3.0.0", + "@sveltejs/adapter-static": "^3.0.5", + "@sveltejs/kit": "^2.0.0", + "@sveltejs/vite-plugin-svelte": "^4.0.0", + "@types/eslint": "^9.6.0", + "autoprefixer": "^10.4.20", + "eslint": "^9.7.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-svelte": "^2.36.0", + "globals": "^15.0.0", + "prettier": "^3.3.2", + "prettier-plugin-svelte": "^3.2.6", + "svelte": "^5.0.0", + "svelte-check": "^4.0.0", + "tailwindcss": "^3.4.9", + "typescript": "^5.0.0", + "typescript-eslint": "^8.0.0", + "vite": "^5.0.3", + "vitest": "^2.0.4" + } } diff --git a/bin/web/postcss.config.js b/bin/web/postcss.config.js index ba80730..badd100 100644 --- a/bin/web/postcss.config.js +++ b/bin/web/postcss.config.js @@ -1,6 +1,6 @@ export default { - plugins: { - tailwindcss: {}, - autoprefixer: {} - } + plugins: { + tailwindcss: {}, + autoprefixer: {} + } }; diff --git a/bin/web/svelte.config.js b/bin/web/svelte.config.js index b2a4b0b..90036a1 100644 --- a/bin/web/svelte.config.js +++ b/bin/web/svelte.config.js @@ -1,20 +1,20 @@ import adapter from '@sveltejs/adapter-static'; export default { - kit: { - adapter: adapter({ - // default options are shown. On some platforms - // these options are set automatically — see below - pages: 'build', - assets: 'build', - fallback: undefined, - precompress: false, - strict: true - }), - version: { + kit: { + adapter: adapter({ + // default options are shown. On some platforms + // these options are set automatically — see below + pages: 'build', + assets: 'build', + fallback: undefined, + precompress: false, + strict: true + }), + version: { // Use a deterministic version string for reproducible builds. // Without this option, SvelteKit will use a timestamp. - name: process.env.GITHUB_SHA || 'dev' - } - } + name: process.env.GITHUB_SHA || 'dev' + } + } }; diff --git a/bin/web/tailwind.config.ts b/bin/web/tailwind.config.ts index 5948176..ab0b0e5 100644 --- a/bin/web/tailwind.config.ts +++ b/bin/web/tailwind.config.ts @@ -1,17 +1,17 @@ import type { Config } from 'tailwindcss'; export default { - content: ['./src/**/*.{html,js,svelte,ts}'], + content: ['./src/**/*.{html,js,svelte,ts}'], - theme: { - extend: { - colors: { - 'rayhunter-blue': '#4e4eb1', - 'rayhunter-dark-blue': '#3f3da0', - 'rayhunter-green': '#94ea18' - } - } - }, + theme: { + extend: { + colors: { + 'rayhunter-blue': '#4e4eb1', + 'rayhunter-dark-blue': '#3f3da0', + 'rayhunter-green': '#94ea18' + } + } + }, - plugins: [] + plugins: [] } as Config; diff --git a/bin/web/tsconfig.json b/bin/web/tsconfig.json index 0b2d886..19034e0 100644 --- a/bin/web/tsconfig.json +++ b/bin/web/tsconfig.json @@ -1,19 +1,19 @@ { - "extends": "./.svelte-kit/tsconfig.json", - "compilerOptions": { - "allowJs": true, - "checkJs": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "sourceMap": true, - "strict": true, - "moduleResolution": "bundler" - } - // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias - // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files - // - // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes - // from the referenced tsconfig.json - TypeScript does not merge them in + "extends": "./.svelte-kit/tsconfig.json", + "compilerOptions": { + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "moduleResolution": "bundler" + } + // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias + // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files + // + // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes + // from the referenced tsconfig.json - TypeScript does not merge them in } diff --git a/bin/web/vite.config.ts b/bin/web/vite.config.ts index 7948f06..6492c8f 100644 --- a/bin/web/vite.config.ts +++ b/bin/web/vite.config.ts @@ -1,4 +1,4 @@ -import { defineConfig } from "vitest/config"; +import { defineConfig } from 'vitest/config'; import { sveltekit } from '@sveltejs/kit/vite'; export default defineConfig({ @@ -16,11 +16,15 @@ export default defineConfig({ console.log('Sending Request to the Target:', req.method, req.url); }); proxy.on('proxyRes', (proxyRes, req, _res) => { - console.log('Received Response from the Target:', proxyRes.statusCode, req.url); + console.log( + 'Received Response from the Target:', + proxyRes.statusCode, + req.url + ); }); - }, - }, - }, + } + } + } }, plugins: [sveltekit()],