diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 0777b2e8..bf5fb037 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,10 +1,10 @@ { - "recommendations": [ - "Vue.volar", - "vitest.explorer", - "ms-playwright.playwright", - "dbaeumer.vscode-eslint", - "EditorConfig.EditorConfig", - "esbenp.prettier-vscode" - ] + "recommendations": [ + "Vue.volar", + "vitest.explorer", + "ms-playwright.playwright", + "dbaeumer.vscode-eslint", + "EditorConfig.EditorConfig", + "esbenp.prettier-vscode" + ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 4ae19c08..21550adc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,13 +1,13 @@ { - "explorer.fileNesting.enabled": true, - "explorer.fileNesting.patterns": { - "tsconfig.json": "tsconfig.*.json, env.d.ts", - "vite.config.*": "jsconfig*, vitest.config.*, cypress.config.*, playwright.config.*", - "package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .prettier*, prettier*, .editorconfig" - }, - "editor.codeActionsOnSave": { - "source.fixAll.eslint": "explicit" - }, - "editor.formatOnSave": false, - "editor.defaultFormatter": "esbenp.prettier-vscode" + "explorer.fileNesting.enabled": true, + "explorer.fileNesting.patterns": { + "tsconfig.json": "tsconfig.*.json, env.d.ts", + "vite.config.*": "jsconfig*, vitest.config.*, cypress.config.*, playwright.config.*", + "package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .prettier*, prettier*, .editorconfig" + }, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit" + }, + "editor.formatOnSave": false, + "editor.defaultFormatter": "esbenp.prettier-vscode" } diff --git a/backend/tests/example.test.ts b/backend/tests/example.test.ts index 638d03b1..9904b6d2 100644 --- a/backend/tests/example.test.ts +++ b/backend/tests/example.test.ts @@ -1,9 +1,9 @@ -import { describe, it, expect } from "vitest"; +import { describe, it, expect } from 'vitest'; -describe("Sample test", () => { - it("should sum to 2", () => { +describe('Sample test', () => { + it('should sum to 2', () => { const expected = 2; const result = 1 + 1; expect(result).toBe(expected); }); -}) +}); diff --git a/backend/tsconfig.json b/backend/tsconfig.json index 6cdb459b..86267d25 100644 --- a/backend/tsconfig.json +++ b/backend/tsconfig.json @@ -1,8 +1,6 @@ { "extends": "../tsconfig.json", - "include": [ - "src/**/*.ts" - ], + "include": ["src/**/*.ts"], "compilerOptions": { "rootDir": "./src", "outDir": "./dist" diff --git a/docker-compose.yml b/docker-compose.yml index e8efb530..f579b470 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,16 +1,16 @@ services: - db: - image: postgres:latest - environment: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: postgres - ports: - - "5432:5432" - network_mode: "host" - volumes: - - postgres_data:/var/lib/postgresql/data - - ./backend/config/db/init.sql:/docker-entrypoint-initdb.d/init.sql + db: + image: postgres:latest + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: postgres + ports: + - '5432:5432' + network_mode: 'host' + volumes: + - postgres_data:/var/lib/postgresql/data + - ./backend/config/db/init.sql:/docker-entrypoint-initdb.d/init.sql volumes: postgres_data: diff --git a/eslint.config.ts b/eslint.config.ts index 7e0ec525..b838d8c5 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -16,13 +16,13 @@ export default [ prettierConfig, includeIgnoreFile(gitignorePath), { - ignores: ['**/dist/**', '**/.node_modules/**', '**/coverage/**', '**/.github/**'], - files: [ - "**/*.ts", - "**/*.cts", - "**.*.mts", - "**/*.ts" - ] + ignores: [ + '**/dist/**', + '**/.node_modules/**', + '**/coverage/**', + '**/.github/**', + ], + files: ['**/*.ts', '**/*.cts', '**.*.mts', '**/*.ts'], }, { languageOptions: { diff --git a/frontend/e2e/vue.spec.ts b/frontend/e2e/vue.spec.ts index 9471698e..fd4797b7 100644 --- a/frontend/e2e/vue.spec.ts +++ b/frontend/e2e/vue.spec.ts @@ -1,8 +1,8 @@ -import { test, expect } from '@playwright/test'; +import { test, expect } from "@playwright/test"; // See here how to get started: // https://playwright.dev/docs/intro -test('visits the app root url', async ({ page }) => { - await page.goto('/'); - await expect(page.locator('h1')).toHaveText('You did it!'); +test("visits the app root url", async ({ page }) => { + await page.goto("/"); + await expect(page.locator("h1")).toHaveText("You did it!"); }); diff --git a/frontend/eslint.config.ts b/frontend/eslint.config.ts index 216bb5c1..9e68e9c0 100644 --- a/frontend/eslint.config.ts +++ b/frontend/eslint.config.ts @@ -1,12 +1,9 @@ -import pluginVue from 'eslint-plugin-vue'; -import { - defineConfigWithVueTs, - vueTsConfigs, -} from '@vue/eslint-config-typescript'; -import pluginVitest from '@vitest/eslint-plugin'; -import pluginPlaywright from 'eslint-plugin-playwright'; -import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'; -import rootConfig from '../eslint.config'; +import pluginVue from "eslint-plugin-vue"; +import { defineConfigWithVueTs, vueTsConfigs } from "@vue/eslint-config-typescript"; +import pluginVitest from "@vitest/eslint-plugin"; +import pluginPlaywright from "eslint-plugin-playwright"; +import skipFormatting from "@vue/eslint-config-prettier/skip-formatting"; +import rootConfig from "../eslint.config"; // To allow more languages other than `ts` in `.vue` files, uncomment the following lines: // Import { configureVueProject } from '@vue/eslint-config-typescript' @@ -15,31 +12,28 @@ import rootConfig from '../eslint.config'; const vueConfig = defineConfigWithVueTs( { - name: 'app/files-to-lint', - files: ['**/*.{ts,mts,tsx,vue}'], + name: "app/files-to-lint", + files: ["**/*.{ts,mts,tsx,vue}"], }, { - name: 'app/files-to-ignore', - ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'], + name: "app/files-to-ignore", + ignores: ["**/dist/**", "**/dist-ssr/**", "**/coverage/**"], }, - pluginVue.configs['flat/essential'], + pluginVue.configs["flat/essential"], vueTsConfigs.recommended, { ...pluginVitest.configs.recommended, - files: ['src/**/__tests__/*'], + files: ["src/**/__tests__/*"], }, { - ...pluginPlaywright.configs['flat/recommended'], - files: ['e2e/**/*.{test,spec}.{js,ts,jsx,tsx}'], + ...pluginPlaywright.configs["flat/recommended"], + files: ["e2e/**/*.{test,spec}.{js,ts,jsx,tsx}"], }, - skipFormatting + skipFormatting, ); -export default [ - ...rootConfig, - ...vueConfig -] +export default [...rootConfig, ...vueConfig]; diff --git a/frontend/index.html b/frontend/index.html index a678cb53..3c1f2f07 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -2,12 +2,21 @@ - - + + Vite App
- + diff --git a/frontend/playwright.config.ts b/frontend/playwright.config.ts index a6cfb499..06d60d89 100644 --- a/frontend/playwright.config.ts +++ b/frontend/playwright.config.ts @@ -1,5 +1,5 @@ -import process from 'node:process'; -import { defineConfig, devices } from '@playwright/test'; +import process from "node:process"; +import { defineConfig, devices } from "@playwright/test"; /** * Read environment variables from file. @@ -11,7 +11,7 @@ import { defineConfig, devices } from '@playwright/test'; * See https://playwright.dev/docs/test-configuration. */ export default defineConfig({ - testDir: './e2e', + testDir: "./e2e", /* Maximum time one test can run for. */ timeout: 30 * 1000, expect: { @@ -28,18 +28,16 @@ export default defineConfig({ /* Opt out of parallel tests on CI. */ workers: process.env.CI ? 1 : undefined, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: 'html', + reporter: "html", /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ actionTimeout: 0, /* Base URL to use in actions like `await page.goto('/')`. */ - baseURL: process.env.CI - ? 'http://localhost:4173' - : 'http://localhost:5173', + baseURL: process.env.CI ? "http://localhost:4173" : "http://localhost:5173", /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'on-first-retry', + trace: "on-first-retry", /* Only on CI systems run the tests headless */ headless: Boolean(process.env.CI), @@ -48,21 +46,21 @@ export default defineConfig({ /* Configure projects for major browsers */ projects: [ { - name: 'chromium', + name: "chromium", use: { - ...devices['Desktop Chrome'], + ...devices["Desktop Chrome"], }, }, { - name: 'firefox', + name: "firefox", use: { - ...devices['Desktop Firefox'], + ...devices["Desktop Firefox"], }, }, { - name: 'webkit', + name: "webkit", use: { - ...devices['Desktop Safari'], + ...devices["Desktop Safari"], }, }, @@ -105,7 +103,7 @@ export default defineConfig({ * Use the preview server on CI for more realistic testing. * Playwright will re-use the local server if there is already a dev-server running. */ - command: process.env.CI ? 'npm run preview' : 'npm run dev', + command: process.env.CI ? "npm run preview" : "npm run dev", port: process.env.CI ? 4173 : 5173, reuseExistingServer: !process.env.CI, }, diff --git a/frontend/prettier.config.js b/frontend/prettier.config.js index 00145504..4bc9699b 100644 --- a/frontend/prettier.config.js +++ b/frontend/prettier.config.js @@ -2,10 +2,10 @@ * @type {import("prettier").Options} */ -const rootConfig = import ('../prettier.config.js'); +const rootConfig = import("../prettier.config.js"); export default { ...rootConfig, vueIndentScriptAndStyle: true, - singleAttributePerLine: true + singleAttributePerLine: true, }; diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index a558039c..7bb3e1c6 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -1,15 +1,15 @@ -import { fileURLToPath, URL } from 'node:url'; +import { fileURLToPath, URL } from "node:url"; -import { defineConfig } from 'vite'; -import vue from '@vitejs/plugin-vue'; -import vueDevTools from 'vite-plugin-vue-devtools'; +import { defineConfig } from "vite"; +import vue from "@vitejs/plugin-vue"; +import vueDevTools from "vite-plugin-vue-devtools"; // https://vite.dev/config/ export default defineConfig({ plugins: [vue(), vueDevTools()], resolve: { alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)), + "@": fileURLToPath(new URL("./src", import.meta.url)), }, }, }); diff --git a/frontend/vitest.config.ts b/frontend/vitest.config.ts index 176ad62e..ba2d72b6 100644 --- a/frontend/vitest.config.ts +++ b/frontend/vitest.config.ts @@ -1,14 +1,14 @@ -import { fileURLToPath } from 'node:url'; -import { mergeConfig, defineConfig, configDefaults } from 'vitest/config'; -import viteConfig from './vite.config'; +import { fileURLToPath } from "node:url"; +import { mergeConfig, defineConfig, configDefaults } from "vitest/config"; +import viteConfig from "./vite.config"; export default mergeConfig( viteConfig, defineConfig({ test: { - environment: 'jsdom', - exclude: [...configDefaults.exclude, 'e2e/**'], - root: fileURLToPath(new URL('./', import.meta.url)), + environment: "jsdom", + exclude: [...configDefaults.exclude, "e2e/**"], + root: fileURLToPath(new URL("./", import.meta.url)), }, }), ); diff --git a/prettier.config.js b/prettier.config.js index f78ee017..8be1cdc4 100644 --- a/prettier.config.js +++ b/prettier.config.js @@ -10,4 +10,4 @@ export default { objectWrap: 'preserve', bracketSameLine: false, arrowParens: 'always', -} +};