From 2135c6b9f1bed5c4fdf9d2b1cfb7cdf54e9e2bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emrik=20=C3=96stling?= Date: Fri, 23 Oct 2026 18:23:49 +0200 Subject: [PATCH] chore: use bun fmt and bun check (#685) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- .vscode/settings.json | 4 ++-- bun.lock | 3 --- bunfig.toml | 15 ++++++++++++--- knip.json | 3 ++- mise.toml | 12 ++++++------ package.json | 17 ++++++++--------- prettier.config.js | 4 +--- src/converters/assimp.ts | 1 + src/converters/calibre.ts | 1 + src/converters/dasel.ts | 1 + src/converters/djvu.ts | 1 + src/converters/dvisvgm.ts | 1 + src/converters/ffmpeg.ts | 2 +- src/converters/graphicsmagick.ts | 1 + src/converters/imagemagick.ts | 1 + src/converters/inkscape.ts | 1 + src/converters/libheif.ts | 1 + src/converters/libjxl.ts | 1 + src/converters/libreoffice.ts | 1 + src/converters/main.ts | 10 ++++++---- src/converters/markitdown.ts | 1 + src/converters/msgconvert.ts | 1 + src/converters/pandoc.ts | 1 + src/converters/pdftops.ts | 1 + src/converters/potrace.ts | 1 + src/converters/resvg.ts | 1 + src/converters/vips.ts | 1 + src/converters/vtracer.ts | 1 + src/converters/xelatex.ts | 1 + src/helpers/printVersions.ts | 1 + src/index.tsx | 4 +++- src/main.css | 6 +++--- src/pages/chooseConverter.tsx | 1 + src/pages/convert.tsx | 2 ++ src/pages/deleteFile.tsx | 6 ++++-- src/pages/deleteJob.tsx | 4 +++- src/pages/download.tsx | 2 ++ src/pages/healthcheck.tsx | 1 + src/pages/history.tsx | 7 ++++--- src/pages/listConverters.tsx | 3 ++- src/pages/results.tsx | 5 +++-- src/pages/root.tsx | 4 +++- src/pages/upload.tsx | 3 ++- src/pages/user.tsx | 1 + src/services/user.ts | 2 ++ tests/converters/assimp.test.ts | 1 + tests/converters/calibre.test.ts | 1 + tests/converters/dasel.test.ts | 3 ++- tests/converters/djvu.test.ts | 3 ++- tests/converters/dvisvgm.test.ts | 1 + tests/converters/ffmpeg.test.ts | 3 ++- tests/converters/graphicsmagick.test.ts | 1 + tests/converters/helpers/commonTests.ts | 1 + tests/converters/helpers/converters.ts | 9 +++++---- tests/converters/imagemagick.test.ts | 1 + tests/converters/inkscape.test.ts | 1 + tests/converters/libheif.test.ts | 1 + tests/converters/libjxl.test.ts | 1 + tests/converters/libreoffice.test.ts | 4 ++-- tests/converters/main.test.ts | 2 ++ tests/converters/markitdown.test.ts | 1 + tests/converters/msgconvert.test.ts | 1 + tests/converters/pandoc.test.ts | 3 ++- tests/converters/pdftops.test.ts | 1 + tests/converters/potrace.test.ts | 1 + tests/converters/resvg.test.ts | 1 + tests/converters/vcf.test.ts | 3 ++- tests/converters/vips.test.ts | 1 + tests/converters/vtracer.test.ts | 3 ++- tests/converters/xelatex.test.ts | 1 + tests/db/db.test.ts | 4 ++-- tests/helpers/normalizeFiletype.test.ts | 3 ++- tests/pages/auth.test.ts | 2 ++ tests/pages/chooseConverter.test.ts | 1 + tests/pages/convert.test.ts | 1 + tests/pages/deleteFile.test.ts | 1 + tests/pages/deleteJob.test.ts | 1 + tests/pages/download.test.ts | 2 ++ tests/pages/firstRun.test.ts | 1 + tests/pages/healthcheck.test.ts | 1 + tests/pages/helpers/app.ts | 2 ++ tests/pages/history.test.ts | 1 + tests/pages/listConverters.test.ts | 1 + tests/pages/results.test.ts | 1 + tests/pages/root.test.ts | 1 + tests/pages/upload.test.ts | 1 + tests/pages/user.test.ts | 1 + tests/services/user.test.ts | 2 ++ tsconfig.json | 1 - 89 files changed, 156 insertions(+), 63 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index fae8e3d8..9519b6f0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,4 @@ { - "typescript.tsdk": "node_modules/typescript/lib", - "typescript.enablePromptUseWorkspaceTsdk": true + "js/ts.tsdk.path": "node_modules/typescript/lib", + "js/ts.tsdk.promptToUseWorkspaceVersion": true } diff --git a/bun.lock b/bun.lock index 746d677d..5dcaf6e1 100644 --- a/bun.lock +++ b/bun.lock @@ -26,7 +26,6 @@ "knip": "^6.38.0", "npm-run-all2": "^9.0.3", "postcss": "^8.5.28", - "prettier": "^3.9.9", "tailwind-scrollbar": "^4.0.2", "tailwindcss": "^4.3.3", "typescript": "^5.9.3", @@ -530,8 +529,6 @@ "prelude-ls": ["prelude-ls@1.2.1", "", {}, "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="], - "prettier": ["prettier@3.9.10", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-skGHTH1Yb9QvaTC4hWnRTzEYtCpApF0UMBPz+t/0ZPzP8ihefo/btKd+QA7pUE0fEwA1SbS/NmhyEcstdXOIdA=="], - "prism-react-renderer": ["prism-react-renderer@2.4.1", "", { "dependencies": { "@types/prismjs": "^1.26.0", "clsx": "^2.0.0" }, "peerDependencies": { "react": ">=16.0.0" } }, "sha512-ey8Ls/+Di31eqzUxC46h8MksNuGx/n0AAC8uKpwFau4RPDYLuE3EXTp8N8G2vX2N7UC/+IXeNUnlWBGGcAG+Ig=="], "punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="], diff --git a/bunfig.toml b/bunfig.toml index d073e330..deb6d9b4 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -1,6 +1,15 @@ [test] preload = ["./tests/preload.ts"] coverage = true -coveragePathIgnorePatterns = [ - "tests/converters/helpers/commonTests.ts" -] +coveragePathIgnorePatterns = ["tests/converters/helpers/commonTests.ts"] + +[fmt] +arrowParens = "always" +printWidth = 100 +singleQuote = false +semi = true +tabWidth = 2 +sortImports = true +sortTailwindcss = false +sortPackageJson = true +jsdoc = true diff --git a/knip.json b/knip.json index c9e38040..472bad85 100644 --- a/knip.json +++ b/knip.json @@ -19,7 +19,8 @@ "potrace", "soffice", "perl", - "markitdown" + "markitdown", + "fmt" ], "tailwind": { "entry": ["src/main.css"] diff --git a/mise.toml b/mise.toml index 40a490fb..b29723e2 100644 --- a/mise.toml +++ b/mise.toml @@ -1,6 +1,6 @@ -[tools] -bun = "1.4.4" - -[env] -JWT_SECRET = "aLongAndSecretStringUsedToSignTheJSONWebToken1234" -FFMPEG_OUTPUT_ARGS = "-preset veryfast -threads 2" +[tools] +bun = "1.4.4" + +[env] +JWT_SECRET = "aLongAndSecretStringUsedToSignTheJSONWebToken1234" +FFMPEG_OUTPUT_ARGS = "-preset veryfast -threads 2" diff --git a/package.json b/package.json index c18cd013..7c6f6aaf 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,24 @@ { "name": "convertx-frontend", "version": "0.20.0", + "type": "module", + "module": "src/index.tsx", "scripts": { "dev": "bun run --watch src/index.tsx", "hot": "bun run --hot src/index.tsx", "format": "npm-run-all 'format:*'", "format:eslint": "eslint --fix .", - "format:prettier": "prettier --write .", + "format:prettier": "bun fmt", "build:css": "bun x @tailwindcss/cli -i ./src/main.css -o ./public/generated.css", "build:js": "tsc", "build:bin": "bun run build:css && bun build --compile --minify --sourcemap --bytecode --format=esm --define 'process.env.NODE_ENV=\"production\"' src/index.tsx --outfile dist/convertx", "build:docker": "docker compose build", "build": "bun run build:css && bun run build:js", "lint": "npm-run-all 'lint:*'", - "lint:tsc": "tsc --noEmit", + "lint:tsc": "bun check", "lint:knip": "knip", "lint:eslint": "eslint .", - "lint:prettier": "prettier --check .", + "lint:prettier": "bun fmt --check", "lint:xss": "xss-scan", "test": "bun test --path-ignore-patterns=tests/integration", "test:integration": "docker build --target test -t convertx:test . && docker run --rm -t -v ./tests:/app/tests -v ./src:/app/src -v ./package.json:/app/package.json convertx:test bun test tests/integration" @@ -30,11 +32,6 @@ "sanitize-filename": "^1.6.4", "tar": "^7.5.22" }, - "module": "src/index.tsx", - "type": "module", - "bun-create": { - "start": "bun run src/index.tsx" - }, "devDependencies": { "@eslint/js": "^10.0.1", "@kitajs/ts-html-plugin": "^4.1.4", @@ -48,12 +45,14 @@ "knip": "^6.38.0", "npm-run-all2": "^9.0.3", "postcss": "^8.5.28", - "prettier": "^3.9.9", "tailwind-scrollbar": "^4.0.2", "tailwindcss": "^4.3.3", "typescript": "^5.9.3", "typescript-eslint": "^8.70.1" }, + "bun-create": { + "start": "bun run src/index.tsx" + }, "trustedDependencies": [ "@parcel/watcher", "@tailwindcss/oxide", diff --git a/prettier.config.js b/prettier.config.js index b6bca479..23d52452 100644 --- a/prettier.config.js +++ b/prettier.config.js @@ -1,6 +1,4 @@ -/** - * @type {import('prettier').Config} - */ +/** @type {import("prettier").Config} */ const config = { arrowParens: "always", printWidth: 100, diff --git a/src/converters/assimp.ts b/src/converters/assimp.ts index 42e1b6f7..61663564 100644 --- a/src/converters/assimp.ts +++ b/src/converters/assimp.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; export const properties = { diff --git a/src/converters/calibre.ts b/src/converters/calibre.ts index 952f79d8..7000bd6d 100644 --- a/src/converters/calibre.ts +++ b/src/converters/calibre.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; export const properties = { diff --git a/src/converters/dasel.ts b/src/converters/dasel.ts index c895d3eb..5bd5f7fd 100644 --- a/src/converters/dasel.ts +++ b/src/converters/dasel.ts @@ -1,5 +1,6 @@ import fs from "fs"; import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; export const properties = { diff --git a/src/converters/djvu.ts b/src/converters/djvu.ts index 054afabd..02e48c43 100644 --- a/src/converters/djvu.ts +++ b/src/converters/djvu.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import type { ExecFileFn } from "./types"; export const properties = { diff --git a/src/converters/dvisvgm.ts b/src/converters/dvisvgm.ts index a48bc69a..a284d25f 100644 --- a/src/converters/dvisvgm.ts +++ b/src/converters/dvisvgm.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; export const properties = { diff --git a/src/converters/ffmpeg.ts b/src/converters/ffmpeg.ts index adf48b45..8e5959a7 100644 --- a/src/converters/ffmpeg.ts +++ b/src/converters/ffmpeg.ts @@ -1,6 +1,6 @@ import { - execFile as execFileOriginal, type ChildProcess, + execFile as execFileOriginal, type ExecFileOptions, } from "node:child_process"; diff --git a/src/converters/graphicsmagick.ts b/src/converters/graphicsmagick.ts index a51a2947..ddfaed8f 100644 --- a/src/converters/graphicsmagick.ts +++ b/src/converters/graphicsmagick.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; export const properties = { diff --git a/src/converters/imagemagick.ts b/src/converters/imagemagick.ts index 767dd081..435cce72 100644 --- a/src/converters/imagemagick.ts +++ b/src/converters/imagemagick.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; // declare possible conversions diff --git a/src/converters/inkscape.ts b/src/converters/inkscape.ts index dce123bd..fd774efd 100644 --- a/src/converters/inkscape.ts +++ b/src/converters/inkscape.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; export const properties = { diff --git a/src/converters/libheif.ts b/src/converters/libheif.ts index 3df1f52a..adc3af73 100644 --- a/src/converters/libheif.ts +++ b/src/converters/libheif.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "child_process"; + import { ExecFileFn } from "./types"; export const properties = { diff --git a/src/converters/libjxl.ts b/src/converters/libjxl.ts index 5abe9ba1..3f83b469 100644 --- a/src/converters/libjxl.ts +++ b/src/converters/libjxl.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; // declare possible conversions diff --git a/src/converters/libreoffice.ts b/src/converters/libreoffice.ts index f9a06c3b..f1448565 100644 --- a/src/converters/libreoffice.ts +++ b/src/converters/libreoffice.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; export const properties = { diff --git a/src/converters/main.ts b/src/converters/main.ts index 9a74a12a..d87ecd18 100644 --- a/src/converters/main.ts +++ b/src/converters/main.ts @@ -1,7 +1,9 @@ -import { Cookie } from "elysia"; -import db from "../db/db"; import fs from "node:fs"; import path from "node:path"; + +import { Cookie } from "elysia"; + +import db from "../db/db"; import { MAX_CONVERT_PROCESS } from "../helpers/env"; import { normalizeFiletype, normalizeOutputFiletype } from "../helpers/normalizeFiletype"; import { convert as convertassimp, properties as propertiesassimp } from "./assimp"; @@ -19,16 +21,16 @@ import { convert as convertInkscape, properties as propertiesInkscape } from "./ import { convert as convertLibheif, properties as propertiesLibheif } from "./libheif"; import { convert as convertLibjxl, properties as propertiesLibjxl } from "./libjxl"; import { convert as convertLibreOffice, properties as propertiesLibreOffice } from "./libreoffice"; +import { convert as convertMarkitdown, properties as propertiesMarkitdown } from "./markitdown"; import { convert as convertMsgconvert, properties as propertiesMsgconvert } from "./msgconvert"; import { convert as convertPandoc, properties as propertiesPandoc } from "./pandoc"; import { convert as convertPdftops, properties as propertiesPdftops } from "./pdftops"; import { convert as convertPotrace, properties as propertiesPotrace } from "./potrace"; import { convert as convertresvg, properties as propertiesresvg } from "./resvg"; +import { convert as convertVcf, properties as propertiesVcf } from "./vcf"; import { convert as convertImage, properties as propertiesImage } from "./vips"; import { convert as convertVtracer, properties as propertiesVtracer } from "./vtracer"; -import { convert as convertVcf, properties as propertiesVcf } from "./vcf"; import { convert as convertxelatex, properties as propertiesxelatex } from "./xelatex"; -import { convert as convertMarkitdown, properties as propertiesMarkitdown } from "./markitdown"; // This should probably be reconstructed so that the functions are not imported instead the functions hook into this to make the converters more modular diff --git a/src/converters/markitdown.ts b/src/converters/markitdown.ts index 6a61cb02..08d70d02 100644 --- a/src/converters/markitdown.ts +++ b/src/converters/markitdown.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; export const properties = { diff --git a/src/converters/msgconvert.ts b/src/converters/msgconvert.ts index 612a2ef9..21ec091e 100644 --- a/src/converters/msgconvert.ts +++ b/src/converters/msgconvert.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; export const properties = { diff --git a/src/converters/pandoc.ts b/src/converters/pandoc.ts index c14c98b9..ac08dd33 100644 --- a/src/converters/pandoc.ts +++ b/src/converters/pandoc.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; export const properties = { diff --git a/src/converters/pdftops.ts b/src/converters/pdftops.ts index 8ac97669..8804cf28 100644 --- a/src/converters/pdftops.ts +++ b/src/converters/pdftops.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; export const properties = { diff --git a/src/converters/potrace.ts b/src/converters/potrace.ts index b18f202f..e1f2af7c 100644 --- a/src/converters/potrace.ts +++ b/src/converters/potrace.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; export const properties = { diff --git a/src/converters/resvg.ts b/src/converters/resvg.ts index fcdc2e46..cadc6e15 100644 --- a/src/converters/resvg.ts +++ b/src/converters/resvg.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; export const properties = { diff --git a/src/converters/vips.ts b/src/converters/vips.ts index 310053fe..b5bb2531 100644 --- a/src/converters/vips.ts +++ b/src/converters/vips.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; // declare possible conversions diff --git a/src/converters/vtracer.ts b/src/converters/vtracer.ts index 31ce1109..cc24e863 100644 --- a/src/converters/vtracer.ts +++ b/src/converters/vtracer.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; export const properties = { diff --git a/src/converters/xelatex.ts b/src/converters/xelatex.ts index 6bd08028..8dfe3df5 100644 --- a/src/converters/xelatex.ts +++ b/src/converters/xelatex.ts @@ -1,4 +1,5 @@ import { execFile as execFileOriginal } from "node:child_process"; + import { ExecFileFn } from "./types"; export const properties = { diff --git a/src/helpers/printVersions.ts b/src/helpers/printVersions.ts index 93b615de..6d7ba3b4 100644 --- a/src/helpers/printVersions.ts +++ b/src/helpers/printVersions.ts @@ -1,5 +1,6 @@ import { exec } from "node:child_process"; import { readFile } from "node:fs"; + import { version } from "../../package.json"; console.log(`ConvertX v${version}`); diff --git a/src/index.tsx b/src/index.tsx index 57308464..995934f2 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,7 +1,9 @@ +import { rmSync } from "node:fs"; + import { html } from "@elysiajs/html"; import { staticPlugin } from "@elysiajs/static"; import { Elysia } from "elysia"; -import { rmSync } from "node:fs"; + import db from "./db/db"; import { Jobs } from "./db/types"; import { AUTO_DELETE_EVERY_N_HOURS, WEBROOT } from "./helpers/env"; diff --git a/src/main.css b/src/main.css index 72ded0e1..3e56e0da 100644 --- a/src/main.css +++ b/src/main.css @@ -20,13 +20,13 @@ } @utility article { - @apply px-2 sm:px-4 py-4 mb-4 bg-neutral-800/40 w-full mx-auto max-w-4xl rounded-sm; + @apply mx-auto mb-4 w-full max-w-4xl rounded-sm bg-neutral-800/40 px-2 py-4 sm:px-4; } @utility btn-primary { - @apply bg-accent-500 text-contrast rounded-sm p-2 sm:p-4 hover:bg-accent-400 cursor-pointer transition-colors; + @apply bg-accent-500 text-contrast hover:bg-accent-400 cursor-pointer rounded-sm p-2 transition-colors sm:p-4; } @utility btn-secondary { - @apply bg-neutral-400 text-contrast rounded-sm p-2 sm:p-4 hover:bg-neutral-300 cursor-pointer transition-colors; + @apply text-contrast cursor-pointer rounded-sm bg-neutral-400 p-2 transition-colors hover:bg-neutral-300 sm:p-4; } diff --git a/src/pages/chooseConverter.tsx b/src/pages/chooseConverter.tsx index 0807cbf2..ed51dea0 100644 --- a/src/pages/chooseConverter.tsx +++ b/src/pages/chooseConverter.tsx @@ -1,4 +1,5 @@ import Elysia, { t } from "elysia"; + import { getPossibleTargets } from "../converters/main"; import { userService } from "./user"; diff --git a/src/pages/convert.tsx b/src/pages/convert.tsx index 27d7c0e8..de4f7337 100644 --- a/src/pages/convert.tsx +++ b/src/pages/convert.tsx @@ -1,6 +1,8 @@ import { mkdir } from "node:fs/promises"; + import { Elysia, t } from "elysia"; import sanitize from "sanitize-filename"; + import { outputDir, uploadsDir } from ".."; import { handleConvert } from "../converters/main"; import db from "../db/db"; diff --git a/src/pages/deleteFile.tsx b/src/pages/deleteFile.tsx index 6302db9b..62808629 100644 --- a/src/pages/deleteFile.tsx +++ b/src/pages/deleteFile.tsx @@ -1,11 +1,13 @@ import { unlink } from "node:fs/promises"; +import path from "node:path"; + import { Elysia, t } from "elysia"; +import sanitize from "sanitize-filename"; + import { uploadsDir } from ".."; import db from "../db/db"; import { WEBROOT } from "../helpers/env"; import { userService } from "./user"; -import sanitize from "sanitize-filename"; -import path from "node:path"; export const deleteFile = new Elysia().use(userService).post( "/delete", diff --git a/src/pages/deleteJob.tsx b/src/pages/deleteJob.tsx index e70a32b4..5ab1cc21 100644 --- a/src/pages/deleteJob.tsx +++ b/src/pages/deleteJob.tsx @@ -1,10 +1,12 @@ import { rmSync } from "node:fs"; + import { Elysia, t } from "elysia"; + import { outputDir, uploadsDir } from ".."; import db from "../db/db"; +import { Jobs } from "../db/types"; import { WEBROOT } from "../helpers/env"; import { userService } from "./user"; -import { Jobs } from "../db/types"; export const deleteJob = new Elysia() .use(userService) diff --git a/src/pages/download.tsx b/src/pages/download.tsx index f4dc7cf4..e642bfa8 100644 --- a/src/pages/download.tsx +++ b/src/pages/download.tsx @@ -1,7 +1,9 @@ import path from "node:path"; + import { Elysia } from "elysia"; import sanitize from "sanitize-filename"; import * as tar from "tar"; + import { outputDir } from ".."; import db from "../db/db"; import { WEBROOT } from "../helpers/env"; diff --git a/src/pages/healthcheck.tsx b/src/pages/healthcheck.tsx index 7c0d4099..04efd4b6 100644 --- a/src/pages/healthcheck.tsx +++ b/src/pages/healthcheck.tsx @@ -1,4 +1,5 @@ import Elysia from "elysia"; + import { userService } from "./user"; export const healthcheck = new Elysia().use(userService).get( diff --git a/src/pages/history.tsx b/src/pages/history.tsx index d0cecdf0..7907b8e0 100644 --- a/src/pages/history.tsx +++ b/src/pages/history.tsx @@ -1,19 +1,20 @@ import { Elysia } from "elysia"; + import { BaseHtml } from "../components/base"; import { Header } from "../components/header"; import db from "../db/db"; import { Filename, Jobs } from "../db/types"; import { ALLOW_UNAUTHENTICATED, + BRANDING, HIDE_HISTORY, LANGUAGE, TIMEZONE, WEBROOT, - BRANDING, } from "../helpers/env"; -import { userService } from "./user"; -import { EyeIcon } from "../icons/eye"; import { DeleteIcon } from "../icons/delete"; +import { EyeIcon } from "../icons/eye"; +import { userService } from "./user"; export const history = new Elysia().use(userService).get( "/history", diff --git a/src/pages/listConverters.tsx b/src/pages/listConverters.tsx index 881037af..3be4e0df 100644 --- a/src/pages/listConverters.tsx +++ b/src/pages/listConverters.tsx @@ -1,8 +1,9 @@ import Elysia from "elysia"; + import { BaseHtml } from "../components/base"; import { Header } from "../components/header"; import { getAllInputs, getAllTargets } from "../converters/main"; -import { ALLOW_UNAUTHENTICATED, WEBROOT, BRANDING } from "../helpers/env"; +import { ALLOW_UNAUTHENTICATED, BRANDING, WEBROOT } from "../helpers/env"; import { userService } from "./user"; export const listConverters = new Elysia().use(userService).get( diff --git a/src/pages/results.tsx b/src/pages/results.tsx index c30dbdd8..47dc0941 100644 --- a/src/pages/results.tsx +++ b/src/pages/results.tsx @@ -1,12 +1,13 @@ import { Elysia } from "elysia"; + import { BaseHtml } from "../components/base"; import { Header } from "../components/header"; import db from "../db/db"; import { Filename, Jobs } from "../db/types"; import { buildDownloadUrl } from "../helpers/buildDownloadUrl"; -import { ALLOW_UNAUTHENTICATED, WEBROOT, BRANDING } from "../helpers/env"; -import { DownloadIcon } from "../icons/download"; +import { ALLOW_UNAUTHENTICATED, BRANDING, WEBROOT } from "../helpers/env"; import { DeleteIcon } from "../icons/delete"; +import { DownloadIcon } from "../icons/download"; import { EyeIcon } from "../icons/eye"; import { userService } from "./user"; diff --git a/src/pages/root.tsx b/src/pages/root.tsx index 0f85f5cf..1592af34 100644 --- a/src/pages/root.tsx +++ b/src/pages/root.tsx @@ -1,6 +1,8 @@ import { randomInt } from "node:crypto"; + import { JWTPayloadSpec } from "@elysiajs/jwt"; import { Elysia, t } from "elysia"; + import { BaseHtml } from "../components/base"; import { Header } from "../components/header"; import { getAllTargets } from "../converters/main"; @@ -9,11 +11,11 @@ import { User } from "../db/types"; import { ACCOUNT_REGISTRATION, ALLOW_UNAUTHENTICATED, + BRANDING, HIDE_HISTORY, HTTP_ALLOWED, UNAUTHENTICATED_USER_SHARING, WEBROOT, - BRANDING, } from "../helpers/env"; import { FIRST_RUN, userService } from "./user"; diff --git a/src/pages/upload.tsx b/src/pages/upload.tsx index 0c000091..19079cf6 100644 --- a/src/pages/upload.tsx +++ b/src/pages/upload.tsx @@ -1,9 +1,10 @@ import { Elysia, t } from "elysia"; +import sanitize from "sanitize-filename"; + import db from "../db/db"; import { WEBROOT } from "../helpers/env"; import { uploadsDir } from "../index"; import { userService } from "./user"; -import sanitize from "sanitize-filename"; export const upload = new Elysia().use(userService).post( "/upload", diff --git a/src/pages/user.tsx b/src/pages/user.tsx index 29a24483..6405d257 100644 --- a/src/pages/user.tsx +++ b/src/pages/user.tsx @@ -1,4 +1,5 @@ import { Elysia, t } from "elysia"; + import { BaseHtml } from "../components/base"; import { Header } from "../components/header"; import db from "../db/db"; diff --git a/src/services/user.ts b/src/services/user.ts index d71204d8..a7e2d3d6 100644 --- a/src/services/user.ts +++ b/src/services/user.ts @@ -1,6 +1,8 @@ import { randomUUID } from "node:crypto"; + import { jwt } from "@elysiajs/jwt"; import { Elysia, t } from "elysia"; + import { WEBROOT } from "../helpers/env"; import { isHtmlPageRequest } from "../helpers/isHtmlPageRequest"; diff --git a/tests/converters/assimp.test.ts b/tests/converters/assimp.test.ts index ff8bb244..f9bef786 100644 --- a/tests/converters/assimp.test.ts +++ b/tests/converters/assimp.test.ts @@ -1,4 +1,5 @@ import { expect, test } from "bun:test"; + import { convert } from "../../src/converters/assimp"; import { runCommonTests } from "./helpers/commonTests"; import { createMockExecFile } from "./helpers/converters"; diff --git a/tests/converters/calibre.test.ts b/tests/converters/calibre.test.ts index 021dd5c7..586f18f1 100644 --- a/tests/converters/calibre.test.ts +++ b/tests/converters/calibre.test.ts @@ -1,4 +1,5 @@ import { expect, test } from "bun:test"; + import { convert } from "../../src/converters/calibre"; import { runCommonTests } from "./helpers/commonTests"; import { createMockExecFile } from "./helpers/converters"; diff --git a/tests/converters/dasel.test.ts b/tests/converters/dasel.test.ts index bb0c780c..e0c45054 100644 --- a/tests/converters/dasel.test.ts +++ b/tests/converters/dasel.test.ts @@ -1,5 +1,6 @@ +import { afterEach, beforeEach, describe, expect, test } from "bun:test"; import fs from "fs"; -import { beforeEach, afterEach, expect, test, describe } from "bun:test"; + import { buildDaselArgs, convert } from "../../src/converters/dasel"; import type { ExecFileFn } from "../../src/converters/types"; import { captureConsole } from "./helpers/converters"; diff --git a/tests/converters/djvu.test.ts b/tests/converters/djvu.test.ts index 45504301..92347996 100644 --- a/tests/converters/djvu.test.ts +++ b/tests/converters/djvu.test.ts @@ -1,5 +1,6 @@ -import type { ExecFileException } from "node:child_process"; import { expect, test } from "bun:test"; +import type { ExecFileException } from "node:child_process"; + import { convert, properties } from "../../src/converters/djvu"; import type { ExecFileFn } from "../../src/converters/types"; import { runCommonTests } from "./helpers/commonTests"; diff --git a/tests/converters/dvisvgm.test.ts b/tests/converters/dvisvgm.test.ts index 3808664a..d43783fd 100644 --- a/tests/converters/dvisvgm.test.ts +++ b/tests/converters/dvisvgm.test.ts @@ -1,4 +1,5 @@ import { expect, test } from "bun:test"; + import { convert } from "../../src/converters/dvisvgm"; import { runCommonTests } from "./helpers/commonTests"; import { createMockExecFile } from "./helpers/converters"; diff --git a/tests/converters/ffmpeg.test.ts b/tests/converters/ffmpeg.test.ts index 54c1b210..a6479cc9 100644 --- a/tests/converters/ffmpeg.test.ts +++ b/tests/converters/ffmpeg.test.ts @@ -1,6 +1,7 @@ import { afterAll, afterEach, beforeEach, expect, test } from "bun:test"; -import { convert } from "../../src/converters/ffmpeg"; import type { ExecFileOptions } from "node:child_process"; + +import { convert } from "../../src/converters/ffmpeg"; import { captureConsole } from "./helpers/converters"; let calls: string[][] = []; diff --git a/tests/converters/graphicsmagick.test.ts b/tests/converters/graphicsmagick.test.ts index 7a7b9284..51eba24e 100644 --- a/tests/converters/graphicsmagick.test.ts +++ b/tests/converters/graphicsmagick.test.ts @@ -1,4 +1,5 @@ import { expect, test } from "bun:test"; + import { convert } from "../../src/converters/graphicsmagick"; import { runCommonTests } from "./helpers/commonTests"; import { createMockExecFile } from "./helpers/converters"; diff --git a/tests/converters/helpers/commonTests.ts b/tests/converters/helpers/commonTests.ts index 9c9872e7..5b690839 100644 --- a/tests/converters/helpers/commonTests.ts +++ b/tests/converters/helpers/commonTests.ts @@ -1,4 +1,5 @@ import { test } from "bun:test"; + import { ConvertFnWithExecFile } from "../../../src/converters/types"; import { runConvertFailTest, diff --git a/tests/converters/helpers/converters.ts b/tests/converters/helpers/converters.ts index a7269313..e17018a7 100644 --- a/tests/converters/helpers/converters.ts +++ b/tests/converters/helpers/converters.ts @@ -1,11 +1,12 @@ import { expect } from "bun:test"; + import type { ConvertFnWithExecFile, ExecFileFn } from "../../../src/converters/types"; type ExecFileCall = { cmd: string; args: string[] }; /** - * Creates an execFile replacement that records every invocation and answers with the - * given error/stdout/stderr, so converter tests never spawn real binaries. + * Creates an execFile replacement that records every invocation and answers with the given + * error/stdout/stderr, so converter tests never spawn real binaries. */ export function createMockExecFile({ error = null, @@ -21,8 +22,8 @@ export function createMockExecFile({ } /** - * Redirects console.log/error/warn into arrays so tests can assert on them without - * printing to the terminal. Always call restore() afterwards (e.g. in afterEach). + * Redirects console.log/error/warn into arrays so tests can assert on them without printing to the + * terminal. Always call restore() afterwards (e.g. in afterEach). */ export function captureConsole() { const original = { log: console.log, error: console.error, warn: console.warn }; diff --git a/tests/converters/imagemagick.test.ts b/tests/converters/imagemagick.test.ts index 2f176364..eef9122c 100644 --- a/tests/converters/imagemagick.test.ts +++ b/tests/converters/imagemagick.test.ts @@ -1,4 +1,5 @@ import { expect, test } from "bun:test"; + import { convert } from "../../src/converters/imagemagick"; import { runCommonTests } from "./helpers/commonTests"; import { createMockExecFile } from "./helpers/converters"; diff --git a/tests/converters/inkscape.test.ts b/tests/converters/inkscape.test.ts index b0697461..f75aa8eb 100644 --- a/tests/converters/inkscape.test.ts +++ b/tests/converters/inkscape.test.ts @@ -1,4 +1,5 @@ import { expect, test } from "bun:test"; + import { convert } from "../../src/converters/inkscape"; import { runCommonTests } from "./helpers/commonTests"; import { createMockExecFile } from "./helpers/converters"; diff --git a/tests/converters/libheif.test.ts b/tests/converters/libheif.test.ts index 4001f301..8a6a5bdd 100644 --- a/tests/converters/libheif.test.ts +++ b/tests/converters/libheif.test.ts @@ -1,4 +1,5 @@ import { expect, test } from "bun:test"; + import { convert } from "../../src/converters/libheif"; import { runCommonTests } from "./helpers/commonTests"; import { createMockExecFile } from "./helpers/converters"; diff --git a/tests/converters/libjxl.test.ts b/tests/converters/libjxl.test.ts index c5415384..348bca74 100644 --- a/tests/converters/libjxl.test.ts +++ b/tests/converters/libjxl.test.ts @@ -1,4 +1,5 @@ import { expect, test } from "bun:test"; + import { convert } from "../../src/converters/libjxl"; import { runCommonTests } from "./helpers/commonTests"; import { createMockExecFile } from "./helpers/converters"; diff --git a/tests/converters/libreoffice.test.ts b/tests/converters/libreoffice.test.ts index 532b55ef..21d3c611 100644 --- a/tests/converters/libreoffice.test.ts +++ b/tests/converters/libreoffice.test.ts @@ -1,7 +1,7 @@ import { afterEach, beforeEach, expect, test } from "bun:test"; -import { convert } from "../../src/converters/libreoffice"; + +import { convert, filters, getFilters } from "../../src/converters/libreoffice"; import type { ExecFileFn } from "../../src/converters/types"; -import { filters, getFilters } from "../../src/converters/libreoffice"; function requireDefined(value: T, msg: string): NonNullable { if (value === undefined || value === null) throw new Error(msg); diff --git a/tests/converters/main.test.ts b/tests/converters/main.test.ts index 96e05e50..00b7bd92 100644 --- a/tests/converters/main.test.ts +++ b/tests/converters/main.test.ts @@ -3,7 +3,9 @@ import { mkdirSync, mkdtempSync, rmSync } from "node:fs"; import { readFile, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; + import type { Cookie } from "elysia"; + import { properties as libreofficeProperties } from "../../src/converters/libreoffice"; import { captureConsole } from "./helpers/converters"; diff --git a/tests/converters/markitdown.test.ts b/tests/converters/markitdown.test.ts index 3c05ac02..c8e33db8 100644 --- a/tests/converters/markitdown.test.ts +++ b/tests/converters/markitdown.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, expect, test } from "bun:test"; + import { convert } from "../../src/converters/markitdown"; import { runCommonTests } from "./helpers/commonTests"; import { captureConsole, createMockExecFile } from "./helpers/converters"; diff --git a/tests/converters/msgconvert.test.ts b/tests/converters/msgconvert.test.ts index 02e64085..bfb0be96 100644 --- a/tests/converters/msgconvert.test.ts +++ b/tests/converters/msgconvert.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, expect, test } from "bun:test"; + import { convert } from "../../src/converters/msgconvert"; import { captureConsole, createMockExecFile } from "./helpers/converters"; diff --git a/tests/converters/pandoc.test.ts b/tests/converters/pandoc.test.ts index 7904ac85..5ec9e308 100644 --- a/tests/converters/pandoc.test.ts +++ b/tests/converters/pandoc.test.ts @@ -1,4 +1,5 @@ -import { expect, test, describe } from "bun:test"; +import { describe, expect, test } from "bun:test"; + import { convert } from "../../src/converters/pandoc"; import { runCommonTests } from "./helpers/commonTests"; import { createMockExecFile } from "./helpers/converters"; diff --git a/tests/converters/pdftops.test.ts b/tests/converters/pdftops.test.ts index b3f94765..52c257ba 100644 --- a/tests/converters/pdftops.test.ts +++ b/tests/converters/pdftops.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, expect, test } from "bun:test"; + import { convert } from "../../src/converters/pdftops"; import { runCommonTests } from "./helpers/commonTests"; import { captureConsole, createMockExecFile } from "./helpers/converters"; diff --git a/tests/converters/potrace.test.ts b/tests/converters/potrace.test.ts index cf1ebf65..48197243 100644 --- a/tests/converters/potrace.test.ts +++ b/tests/converters/potrace.test.ts @@ -1,4 +1,5 @@ import { expect, test } from "bun:test"; + import { convert } from "../../src/converters/potrace"; import { runCommonTests } from "./helpers/commonTests"; import { createMockExecFile } from "./helpers/converters"; diff --git a/tests/converters/resvg.test.ts b/tests/converters/resvg.test.ts index ad06a263..a51e17dd 100644 --- a/tests/converters/resvg.test.ts +++ b/tests/converters/resvg.test.ts @@ -1,4 +1,5 @@ import { expect, test } from "bun:test"; + import { convert } from "../../src/converters/resvg"; import { runCommonTests } from "./helpers/commonTests"; import { createMockExecFile } from "./helpers/converters"; diff --git a/tests/converters/vcf.test.ts b/tests/converters/vcf.test.ts index e4d7f571..d6bf2412 100644 --- a/tests/converters/vcf.test.ts +++ b/tests/converters/vcf.test.ts @@ -1,8 +1,9 @@ -import { afterAll, beforeAll, expect, test, describe } from "bun:test"; +import { afterAll, beforeAll, describe, expect, test } from "bun:test"; import { mkdtempSync, rmSync } from "node:fs"; import { readFile, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; + import { convert, parseVCF, toCSV } from "../../src/converters/vcf"; describe("parseVCF", () => { diff --git a/tests/converters/vips.test.ts b/tests/converters/vips.test.ts index 6c264cf8..6b2a7ec4 100644 --- a/tests/converters/vips.test.ts +++ b/tests/converters/vips.test.ts @@ -1,4 +1,5 @@ import { expect, test } from "bun:test"; + import { convert } from "../../src/converters/vips"; import { runCommonTests } from "./helpers/commonTests"; import { createMockExecFile } from "./helpers/converters"; diff --git a/tests/converters/vtracer.test.ts b/tests/converters/vtracer.test.ts index f78718ad..edfcff46 100644 --- a/tests/converters/vtracer.test.ts +++ b/tests/converters/vtracer.test.ts @@ -1,4 +1,5 @@ -import { afterEach, beforeEach, expect, test, describe } from "bun:test"; +import { afterEach, beforeEach, describe, expect, test } from "bun:test"; + import { convert } from "../../src/converters/vtracer"; import { captureConsole, createMockExecFile } from "./helpers/converters"; diff --git a/tests/converters/xelatex.test.ts b/tests/converters/xelatex.test.ts index 5e540664..65631ce1 100644 --- a/tests/converters/xelatex.test.ts +++ b/tests/converters/xelatex.test.ts @@ -1,4 +1,5 @@ import { expect, test } from "bun:test"; + import { convert } from "../../src/converters/xelatex"; import { runCommonTests } from "./helpers/commonTests"; import { createMockExecFile } from "./helpers/converters"; diff --git a/tests/db/db.test.ts b/tests/db/db.test.ts index 21f4ce58..3e2e8357 100644 --- a/tests/db/db.test.ts +++ b/tests/db/db.test.ts @@ -1,6 +1,6 @@ -import { test, expect, beforeEach, afterEach } from "bun:test"; import { Database } from "bun:sqlite"; -import { unlinkSync, existsSync } from "node:fs"; +import { afterEach, beforeEach, expect, test } from "bun:test"; +import { existsSync, unlinkSync } from "node:fs"; import { join } from "node:path"; const testRoot = process.env.CONVERTX_TEST_ROOT; diff --git a/tests/helpers/normalizeFiletype.test.ts b/tests/helpers/normalizeFiletype.test.ts index d4878362..f2a555c2 100644 --- a/tests/helpers/normalizeFiletype.test.ts +++ b/tests/helpers/normalizeFiletype.test.ts @@ -1,4 +1,5 @@ -import { test, expect } from "bun:test"; +import { expect, test } from "bun:test"; + import { normalizeFiletype, normalizeOutputFiletype } from "../../src/helpers/normalizeFiletype"; test("normalizeFiletype maps known inputs", () => { diff --git a/tests/pages/auth.test.ts b/tests/pages/auth.test.ts index 1e97faea..31c4c423 100644 --- a/tests/pages/auth.test.ts +++ b/tests/pages/auth.test.ts @@ -1,5 +1,7 @@ import { expect, test } from "bun:test"; + import { Elysia } from "elysia"; + import { isHtmlPageRequest } from "../../src/helpers/isHtmlPageRequest"; import { userService } from "../../src/services/user"; diff --git a/tests/pages/chooseConverter.test.ts b/tests/pages/chooseConverter.test.ts index 3042febf..2d797e87 100644 --- a/tests/pages/chooseConverter.test.ts +++ b/tests/pages/chooseConverter.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "bun:test"; + import { request } from "./helpers/app"; async function conversionsFor(fileType: string) { diff --git a/tests/pages/convert.test.ts b/tests/pages/convert.test.ts index ddcb4001..0983183d 100644 --- a/tests/pages/convert.test.ts +++ b/tests/pages/convert.test.ts @@ -1,6 +1,7 @@ import { describe, expect, test } from "bun:test"; import { mkdirSync } from "node:fs"; import { readFile, writeFile } from "node:fs/promises"; + import { createJob, createUser, db, jobDirs, request, waitFor } from "./helpers/app"; type JobRow = { status: string; num_files: number }; diff --git a/tests/pages/deleteFile.test.ts b/tests/pages/deleteFile.test.ts index 5fe8c542..140fcb78 100644 --- a/tests/pages/deleteFile.test.ts +++ b/tests/pages/deleteFile.test.ts @@ -1,5 +1,6 @@ import { describe, expect, test } from "bun:test"; import { existsSync, mkdirSync, writeFileSync } from "node:fs"; + import { createJob, createUser, jobDirs, request, uploadsDir } from "./helpers/app"; async function userWithUploads(...fileNames: string[]) { diff --git a/tests/pages/deleteJob.test.ts b/tests/pages/deleteJob.test.ts index 1ef31dbf..e7194892 100644 --- a/tests/pages/deleteJob.test.ts +++ b/tests/pages/deleteJob.test.ts @@ -1,5 +1,6 @@ import { describe, expect, test } from "bun:test"; import { existsSync, mkdirSync, writeFileSync } from "node:fs"; + import { createJob, createUser, db, jobDirs, request } from "./helpers/app"; async function userWithJobs(count = 1) { diff --git a/tests/pages/download.test.ts b/tests/pages/download.test.ts index f6a2e75e..a8a8d553 100644 --- a/tests/pages/download.test.ts +++ b/tests/pages/download.test.ts @@ -2,7 +2,9 @@ import { describe, expect, test } from "bun:test"; import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { join } from "node:path"; + import * as tar from "tar"; + import { createJob, createUser, jobDirs, request } from "./helpers/app"; async function userWithOutputs(files: Record) { diff --git a/tests/pages/firstRun.test.ts b/tests/pages/firstRun.test.ts index 4665b366..4840069f 100644 --- a/tests/pages/firstRun.test.ts +++ b/tests/pages/firstRun.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "bun:test"; + import type { User } from "../../src/db/types"; import { db, FIRST_ACCOUNT, firstRun as recordedFirstRun, SECOND_ACCOUNT } from "./helpers/app"; diff --git a/tests/pages/healthcheck.test.ts b/tests/pages/healthcheck.test.ts index 807a17ce..9701cdb7 100644 --- a/tests/pages/healthcheck.test.ts +++ b/tests/pages/healthcheck.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "bun:test"; + import { request } from "./helpers/app"; describe("GET /healthcheck", () => { diff --git a/tests/pages/helpers/app.ts b/tests/pages/helpers/app.ts index ae889483..82af5f82 100644 --- a/tests/pages/helpers/app.ts +++ b/tests/pages/helpers/app.ts @@ -1,6 +1,8 @@ import { mock } from "bun:test"; + import { html } from "@elysiajs/html"; import { Elysia } from "elysia"; + import * as realEnvModule from "../../../src/helpers/env"; if (!process.env.CONVERTX_TEST_ROOT) { diff --git a/tests/pages/history.test.ts b/tests/pages/history.test.ts index 7e04fdd3..6216d8ba 100644 --- a/tests/pages/history.test.ts +++ b/tests/pages/history.test.ts @@ -1,4 +1,5 @@ import { afterEach, describe, expect, test } from "bun:test"; + import { createJob, createUser, request, resetEnv, setEnv } from "./helpers/app"; afterEach(() => { diff --git a/tests/pages/listConverters.test.ts b/tests/pages/listConverters.test.ts index 22582265..03cdc206 100644 --- a/tests/pages/listConverters.test.ts +++ b/tests/pages/listConverters.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "bun:test"; + import { getAllInputs, getAllTargets } from "../../src/converters/main"; import { createUser, request } from "./helpers/app"; diff --git a/tests/pages/results.test.ts b/tests/pages/results.test.ts index 44e8d8ec..b30ecd05 100644 --- a/tests/pages/results.test.ts +++ b/tests/pages/results.test.ts @@ -1,4 +1,5 @@ import { afterEach, describe, expect, test } from "bun:test"; + import { buildDownloadUrl } from "../../src/helpers/buildDownloadUrl"; import { createJob, createUser, request, resetEnv, setCookie, setEnv } from "./helpers/app"; diff --git a/tests/pages/root.test.ts b/tests/pages/root.test.ts index b4f39b3d..15b0a8c1 100644 --- a/tests/pages/root.test.ts +++ b/tests/pages/root.test.ts @@ -1,4 +1,5 @@ import { afterEach, describe, expect, test } from "bun:test"; + import { app, createUser, diff --git a/tests/pages/upload.test.ts b/tests/pages/upload.test.ts index 34b37f87..caec8cc3 100644 --- a/tests/pages/upload.test.ts +++ b/tests/pages/upload.test.ts @@ -2,6 +2,7 @@ import { describe, expect, test } from "bun:test"; import { existsSync, readdirSync } from "node:fs"; import { readFile } from "node:fs/promises"; import { resolve } from "node:path"; + import { createJob, createUser, jobDirs, request } from "./helpers/app"; function uploadForm(...files: File[]) { diff --git a/tests/pages/user.test.ts b/tests/pages/user.test.ts index 1be61164..08486597 100644 --- a/tests/pages/user.test.ts +++ b/tests/pages/user.test.ts @@ -1,4 +1,5 @@ import { afterEach, describe, expect, test } from "bun:test"; + import type { User } from "../../src/db/types"; import { app, diff --git a/tests/services/user.test.ts b/tests/services/user.test.ts index 73f0ec0a..ec5854c3 100644 --- a/tests/services/user.test.ts +++ b/tests/services/user.test.ts @@ -1,7 +1,9 @@ import { describe, expect, test } from "bun:test"; import { randomUUID } from "node:crypto"; + import { jwt } from "@elysiajs/jwt"; import { Elysia } from "elysia"; + import { WEBROOT } from "../../src/helpers/env"; import { userService } from "../../src/services/user"; diff --git a/tsconfig.json b/tsconfig.json index cb524d98..a5775d64 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,6 @@ "noEmit": false, "composite": true, "strict": true, - "downlevelIteration": true, "skipLibCheck": true, "jsx": "react-jsx", "jsxImportSource": "@kitajs/html",