diff --git a/bun.lockb b/bun.lockb index 336c19e..a6a5aa8 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/compose.yaml b/compose.yaml index ef4cf7c..89322d5 100644 --- a/compose.yaml +++ b/compose.yaml @@ -5,9 +5,11 @@ services: # dockerfile: Debian.Dockerfile volumes: - ./data:/app/data - environment: - - ACCOUNT_REGISTRATION=true - - JWT_SECRET=aLongAndSecretStringUsedToSignTheJSONWebToken1234 - - ALLOW_UNAUTHENTICATED=true + environment: # Defaults are listed below. All are optional. + - ACCOUNT_REGISTRATION=true # true or false, doesn't matter for the first account (e.g. keep this to false if you only want one account) + - JWT_SECRET=aLongAndSecretStringUsedToSignTheJSONWebToken1234 # will use randomUUID() by default + - HTTP_ALLOWED=true # setting this to true is unsafe, only set this to true locally + - ALLOW_UNAUTHENTICATED=true # allows anyone to use the service without logging in, only set this to true locally + - AUTO_DELETE_EVERY_N_HOURS=1 # checks every n hours for files older then n hours and deletes them, set to 0 to disable ports: - 3000:3000 diff --git a/eslint.config.mjs b/eslint.config.mjs index f43d771..4a045a3 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -2,16 +2,16 @@ import { fixupPluginRules } from "@eslint/compat"; import tseslint from "typescript-eslint"; import eslint from "@eslint/js"; import deprecationPlugin from "eslint-plugin-deprecation"; -import eslintCommentsPlugin from "eslint-plugin-eslint-comments"; import importPlugin from "eslint-plugin-import"; import simpleImportSortPlugin from "eslint-plugin-simple-import-sort"; +import tailwind from "eslint-plugin-tailwindcss"; +import comments from "@eslint-community/eslint-plugin-eslint-comments/configs" export default tseslint.config( { plugins: { "@typescript-eslint": tseslint.plugin, deprecation: fixupPluginRules(deprecationPlugin), - "eslint-comments": eslintCommentsPlugin, import: fixupPluginRules(importPlugin), "simple-import-sort": simpleImportSortPlugin, }, @@ -20,8 +20,10 @@ export default tseslint.config( ignores: ["**/node_modules/**", "**/public/**"], }, eslint.configs.recommended, + comments.recommended, ...tseslint.configs.recommendedTypeChecked, ...tseslint.configs.stylisticTypeChecked, + ...tailwind.configs["flat/recommended"], { languageOptions: { parserOptions: { @@ -32,5 +34,14 @@ export default tseslint.config( project: ["./tsconfig.json"], }, }, + rules: { + "tailwindcss/no-custom-classname": [ + "error", + { + "config": "./tailwind.config.js", + "whitelist": ['select_container', 'convert_to_popup', 'convert_to_group', 'target', 'convert_to_target'] + } + ], + } }, ); diff --git a/package.json b/package.json index dfad85c..fc40987 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "@elysiajs/html": "1.0.2", "@elysiajs/jwt": "^1.1.1", "@elysiajs/static": "1.0.3", - "elysia": "^1.1.12" + "elysia": "^1.1.16" }, "module": "src/index.tsx", "type": "module", @@ -25,37 +25,40 @@ }, "devDependencies": { "@biomejs/biome": "1.9.2", + "@eslint-community/eslint-plugin-eslint-comments": "^4.4.0", "@eslint/compat": "^1.1.1", - "@eslint/js": "^9.9.1", + "@eslint/js": "^9.11.1", "@ianvs/prettier-plugin-sort-imports": "^4.3.1", - "@kitajs/ts-html-plugin": "^4.0.2", + "@kitajs/ts-html-plugin": "^4.1.0", "@picocss/pico": "^2.0.6", "@total-typescript/ts-reset": "^0.6.1", - "@types/bun": "^1.1.8", + "@types/bun": "^1.1.10", "@types/eslint": "^9.6.1", - "@types/node": "^22.5.4", - "@typescript-eslint/eslint-plugin": "^8.4.0", - "@typescript-eslint/parser": "^8.4.0", + "@types/eslint-plugin-tailwindcss": "^3.17.0", + "@types/eslint__js": "^8.42.3", + "@types/node": "^22.6.1", + "@typescript-eslint/eslint-plugin": "^8.7.0", + "@typescript-eslint/parser": "^8.7.0", "autoprefixer": "^10.4.20", "cssnano": "^7.0.6", - "eslint": "^9.9.1", + "eslint": "^9.11.1", "eslint-config-prettier": "^9.1.0", "eslint-plugin-deprecation": "^3.0.0", - "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-import": "^2.30.0", "eslint-plugin-isaacscript": "^4.0.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-simple-import-sort": "^12.1.1", - "knip": "^5.29.2", - "npm-run-all2": "^6.2.2", + "eslint-plugin-tailwindcss": "^3.17.4", + "knip": "^5.30.5", + "npm-run-all2": "^6.2.3", "postcss": "^8.4.47", "postcss-cli": "^11.0.0", "postcss-lightningcss": "^1.0.1", "prettier": "^3.3.3", "tailwind-scrollbar": "^3.1.0", - "tailwindcss": "^3.4.12", - "typescript": "^5.5.4", - "typescript-eslint": "^8.4.0" + "tailwindcss": "^3.4.13", + "typescript": "^5.6.2", + "typescript-eslint": "^8.7.0" }, "trustedDependencies": [ "@biomejs/biome" diff --git a/src/converters/main.ts b/src/converters/main.ts index 6b86fea..3be2ba0 100644 --- a/src/converters/main.ts +++ b/src/converters/main.ts @@ -34,20 +34,15 @@ import { normalizeFiletype } from "../helpers/normalizeFiletype"; // This should probably be reconstructed so that the functions are not imported instead the functions hook into this to make the converters more modular -const properties: { - [key: string]: { +const properties: Record; + to: Record; + options?: Record>; }; converter: ( filePath: string, @@ -58,8 +53,7 @@ const properties: { options?: any, // biome-ignore lint/suspicious/noExplicitAny: ) => any; - }; -} = { + }> = { libjxl: { properties: propertiesLibjxl, converter: convertLibjxl, @@ -159,7 +153,7 @@ export async function mainConverter( } } -const possibleTargets: { [key: string]: { [key: string]: string[] } } = {}; +const possibleTargets: Record> = {}; for (const converterName in properties) { const converterProperties = properties[converterName]?.properties; @@ -186,7 +180,7 @@ for (const converterName in properties) { export const getPossibleTargets = ( from: string, -): { [key: string]: string[] } => { +): Record => { const fromClean = normalizeFiletype(from); return possibleTargets[fromClean] || {}; @@ -214,7 +208,7 @@ const getPossibleInputs = () => { return possibleInputs; }; -const allTargets: { [key: string]: string[] } = {}; +const allTargets: Record = {}; for (const converterName in properties) { const converterProperties = properties[converterName]?.properties; @@ -236,7 +230,7 @@ export const getAllTargets = () => { return allTargets; }; -const allInputs: { [key: string]: string[] } = {}; +const allInputs: Record = {}; for (const converterName in properties) { const converterProperties = properties[converterName]?.properties; diff --git a/src/index.tsx b/src/index.tsx index e64cd9e..34b81b3 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -138,8 +138,8 @@ const app = new Elysia({ return ( -
-

Welcome to ConvertX!

+
+

Welcome to ConvertX!

Create your account
@@ -172,7 +172,7 @@ const app = new Elysia({