diff --git a/.vscode/settings.json b/.vscode/settings.json index 632384f7..96522090 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,7 +4,7 @@ }, "explorer.fileNesting.enabled": true, "explorer.fileNesting.patterns": { - "package.json": "package-lock.json, yarn.lock, .eslintrc.js, tsconfig.json, .prettierrc, .editorconfig, pnpm-lock.yaml, postcss.config.js, tailwind.config.js", + "package.json": "package-lock.json, yarn.lock, eslint.config.mjs, tsconfig.json, .prettierrc, .editorconfig, pnpm-lock.yaml, postcss.config.js, tailwind.config.js", "docker-compose.yml": "Dockerfile, .dockerignore, docker-compose.dev.yml, docker-compose.yml", "README.md": "LICENSE, SECURITY.md" }, @@ -22,6 +22,7 @@ "editor.defaultFormatter": "dbaeumer.vscode-eslint" }, "eslint.format.enable": true, + "eslint.useFlatConfig": true, "css.validate": false, "tailwindCSS.includeLanguages": { "vue": "html", diff --git a/Taskfile.yml b/Taskfile.yml index f6c8fc5d..e2da964d 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -93,6 +93,16 @@ tasks: - go run ./app/api/ {{ .CLI_ARGS }} & silent: true + go:ci:with-frontend: + desc: Run backend with frontend in CI mode + dir: frontend + cmds: + - pnpm install + - pnpm run build + - cp -r ./.output/public ../backend/app/api/static/ + - task: go:ci + silent: true + go:test: desc: Runs all go tests using gotestsum - supports passing gotestsum args dir: backend @@ -201,12 +211,11 @@ tasks: desc: Runs end-to-end test on a live server dir: frontend cmds: - - task: go:ci - - task: ui:ci + - task: go:ci:with-frontend - pnpm exec playwright install-deps - pnpm exec playwright install - sleep 30 - - TEST_SHUTDOWN_API_SERVER=true pnpm exec playwright test -c ./test/playwright.config.ts {{ .CLI_ARGS }} + - TEST_SHUTDOWN_API_SERVER=true E2E_BASE_URL=http://localhost:7745 pnpm exec playwright test -c ./test/playwright.config.ts {{ .CLI_ARGS }} pr: desc: Runs all tasks required for a PR diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js deleted file mode 100644 index e2bc53c5..00000000 --- a/frontend/.eslintrc.js +++ /dev/null @@ -1,55 +0,0 @@ -module.exports = { - env: { - browser: true, - es2021: true, - node: true, - }, - extends: [ - "eslint:recommended", - "plugin:vue/essential", - "plugin:@typescript-eslint/recommended", - "@nuxtjs/eslint-config-typescript", - "plugin:vue/vue3-recommended", - "plugin:prettier/recommended", - "plugin:tailwindcss/recommended", - ], - parserOptions: { - ecmaVersion: "latest", - parser: "@typescript-eslint/parser", - sourceType: "module", - }, - plugins: ["vue", "@typescript-eslint"], - rules: { - "no-console": 0, - "no-unused-vars": "off", - "vue/multi-word-component-names": "off", - "vue/no-setup-props-destructure": 0, - "vue/no-multiple-template-root": 0, - "vue/no-v-model-argument": 0, - "vue/no-v-html": 0, - "@typescript-eslint/consistent-type-imports": "error", - "@typescript-eslint/ban-ts-comment": 0, - "tailwindcss/no-custom-classname": "warn", - "@typescript-eslint/no-unused-vars": [ - "error", - { - ignoreRestSiblings: true, - destructuredArrayIgnorePattern: "_", - caughtErrors: "none", - }, - ], - "prettier/prettier": [ - "warn", - { - arrowParens: "avoid", - semi: true, - tabWidth: 2, - useTabs: false, - vueIndentScriptAndStyle: true, - singleQuote: false, - trailingComma: "es5", - printWidth: 120, - }, - ], - }, -}; diff --git a/frontend/app.vue b/frontend/app.vue index ba159df7..71428a16 100644 --- a/frontend/app.vue +++ b/frontend/app.vue @@ -6,7 +6,7 @@ - + diff --git a/frontend/components/App/CreateModal.vue b/frontend/components/App/CreateModal.vue index a2efe690..5720a972 100644 --- a/frontend/components/App/CreateModal.vue +++ b/frontend/components/App/CreateModal.vue @@ -47,7 +47,8 @@ import { useMediaQuery } from "@vueuse/core"; import type { DialogID } from "@/components/ui/dialog-provider/utils"; import { Drawer, DrawerContent, DrawerHeader, DrawerTitle } from "@/components/ui/drawer"; - import { Dialog, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog"; + import { Dialog, DialogFooter, DialogHeader, DialogScrollContent, DialogTitle } from "@/components/ui/dialog"; + import { Shortcut } from "@/components/ui/shortcut"; const isDesktop = useMediaQuery("(min-width: 768px)"); diff --git a/frontend/components/App/ImportDialog.vue b/frontend/components/App/ImportDialog.vue index eaf1048d..d85c6418 100644 --- a/frontend/components/App/ImportDialog.vue +++ b/frontend/components/App/ImportDialog.vue @@ -51,7 +51,7 @@ import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; type Props = { - modelValue: boolean; + modelValue?: boolean; }; const { t } = useI18n(); @@ -66,13 +66,13 @@ const api = useUserApi(); - const importCsv = ref(null); + const importCsv = ref(undefined); const importLoading = ref(false); const importRef = ref(); whenever( () => !dialog.value, () => { - importCsv.value = null; + importCsv.value = undefined; } ); @@ -102,7 +102,7 @@ // Reset dialog.value = false; importLoading.value = false; - importCsv.value = null; + importCsv.value = undefined; if (importRef.value) { importRef.value.value = ""; diff --git a/frontend/components/App/OutdatedModal.vue b/frontend/components/App/OutdatedModal.vue index a2d51c13..4d990737 100644 --- a/frontend/components/App/OutdatedModal.vue +++ b/frontend/components/App/OutdatedModal.vue @@ -29,12 +29,12 @@ import { lt } from "semver"; import { AlertDialog, + AlertDialogAction, AlertDialogContent, - AlertDialogHeader, - AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, - AlertDialogAction, + AlertDialogHeader, + AlertDialogTitle, } from "@/components/ui/alert-dialog"; import { useDialog } from "@/components/ui/dialog-provider"; diff --git a/frontend/components/App/QuickMenuModal.vue b/frontend/components/App/QuickMenuModal.vue index 4d443033..12875a65 100644 --- a/frontend/components/App/QuickMenuModal.vue +++ b/frontend/components/App/QuickMenuModal.vue @@ -3,11 +3,11 @@ import { DialogID, type NoParamDialogIDs, type OptionalDialogIDs } from "@/components/ui/dialog-provider/utils"; import { CommandDialog, - CommandInput, - CommandList, CommandEmpty, CommandGroup, + CommandInput, CommandItem, + CommandList, CommandSeparator, } from "~/components/ui/command"; import { Shortcut } from "~/components/ui/shortcut"; diff --git a/frontend/components/App/ScannerModal.vue b/frontend/components/App/ScannerModal.vue index e13cb266..546e86b9 100644 --- a/frontend/components/App/ScannerModal.vue +++ b/frontend/components/App/ScannerModal.vue @@ -33,7 +33,7 @@ - +