From f4bee94a16bb4f5312be5c160fda49aa88b0dc4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benito=20Rodr=C3=ADguez?= Date: Sun, 8 Feb 2026 12:36:36 +0100 Subject: [PATCH] chore: update Prisma and dependencies, add initial migration and tests - Updated Prisma and @prisma/client to version 6.19.2 in package.json and yarn.lock. - Added package extensions for @prisma/client in .yarnrc.yml. - Updated backend README.md for clearer setup instructions. - Created initial migration for Game, Platform, and related tables in Prisma. - Added migration lock file for version control. - Implemented tests for Game model using Vitest, including creation and unique slug constraint checks. --- .gitea/workflows/ci.yaml | 2 +- .github/copilot-instructions.md | 4 +- .gitignore | 2 + .pnp.cjs | 365 ++++++++++++++++-- .yarnrc.yml | 5 + backend/README.md | 33 +- backend/package.json | 12 +- .../20260208102247_init/migration.sql | 133 +++++++ backend/prisma/migrations/migration_lock.toml | 3 + backend/tests/models/game.spec.ts | 92 +++++ yarn.lock | 347 ++++++++++++++--- 11 files changed, 886 insertions(+), 112 deletions(-) create mode 100644 backend/prisma/migrations/20260208102247_init/migration.sql create mode 100644 backend/prisma/migrations/migration_lock.toml create mode 100644 backend/tests/models/game.spec.ts diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index c177d3b..3dac941 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -38,7 +38,7 @@ jobs: run: yarn workspace quasar-backend run lint - name: Run backend unit tests - run: yarn workspace quasar-backend run test + run: yarn workspace quasar-backend run test:ci e2e: runs-on: ubuntu-latest diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index dec30f2..9d977d5 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -3,6 +3,8 @@ **Resumen breve** Quasar es una aplicación web para gestionar una biblioteca personal de videojuegos. Este repositorio está en estado inicial: contiene `package.json` y `README.md` pero no hay código fuente ni tests aún. Prioridad: configurar pruebas (Playwright), scripts útiles y prácticas de seguridad para manejar claves/API. +**Importante:** Este proyecto usa Yarn (no npm). Usa `yarn` para instalar dependencias y ejecutar scripts. + ## Estilo de código ✅ - Mantener **CommonJS** (`type: commonjs` en `package.json`). @@ -13,7 +15,7 @@ Quasar es una aplicación web para gestionar una biblioteca personal de videojue - Instalación: `yarn install` (usar Yarn/local; `packageManager` se indica en `package.json`). - `package.json` actual tiene un `test` placeholder. Reemplazar por un runner real tras inicializar Playwright. (recomendado) - Inicializar Playwright: `npx playwright test --init`. (recomendado) -- Instalar dependencias de navegadores: `npm run test:install` (sugerido script abajo). +- Instalar dependencias de navegadores: `yarn test:install` (sugerido script abajo). - En CI: `yarn install && yarn test:install && yarn test`. ## Convenciones 🔁 diff --git a/.gitignore b/.gitignore index 1c7ced1..149e103 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,5 @@ test-results/ # package-lock.json # yarn.lock # pnpm-lock.yaml + +backend/prisma/dev.db \ No newline at end of file diff --git a/.pnp.cjs b/.pnp.cjs index b928e41..0e8f72c 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -721,76 +721,102 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["@prisma/client", [\ - ["npm:5.22.0", {\ - "packageLocation": "./.yarn/unplugged/@prisma-client-virtual-b44ecdc172/node_modules/@prisma/client/",\ + ["npm:6.19.2", {\ + "packageLocation": "./.yarn/unplugged/@prisma-client-virtual-0b18021af5/node_modules/@prisma/client/",\ "packageDependencies": [\ - ["@prisma/client", "npm:5.22.0"]\ + ["@prisma/client", "npm:6.19.2"]\ ],\ "linkType": "SOFT"\ }],\ - ["virtual:f6b9964910e3f10023a17ff3ab92233ffcc1e59e4d8aa19a994a441163321ece3524a6d19f9ae419b654b74f6329bf472cc21d02ecd1e6b308b8ee074795dc9b#npm:5.22.0", {\ - "packageLocation": "./.yarn/unplugged/@prisma-client-virtual-b44ecdc172/node_modules/@prisma/client/",\ + ["virtual:f6b9964910e3f10023a17ff3ab92233ffcc1e59e4d8aa19a994a441163321ece3524a6d19f9ae419b654b74f6329bf472cc21d02ecd1e6b308b8ee074795dc9b#npm:6.19.2", {\ + "packageLocation": "./.yarn/unplugged/@prisma-client-virtual-0b18021af5/node_modules/@prisma/client/",\ "packageDependencies": [\ - ["@prisma/client", "virtual:f6b9964910e3f10023a17ff3ab92233ffcc1e59e4d8aa19a994a441163321ece3524a6d19f9ae419b654b74f6329bf472cc21d02ecd1e6b308b8ee074795dc9b#npm:5.22.0"],\ + ["@prisma/client", "virtual:f6b9964910e3f10023a17ff3ab92233ffcc1e59e4d8aa19a994a441163321ece3524a6d19f9ae419b654b74f6329bf472cc21d02ecd1e6b308b8ee074795dc9b#npm:6.19.2"],\ ["@types/prisma", null],\ - ["prisma", "npm:5.22.0"]\ + ["@types/typescript", null],\ + ["prisma", "virtual:f6b9964910e3f10023a17ff3ab92233ffcc1e59e4d8aa19a994a441163321ece3524a6d19f9ae419b654b74f6329bf472cc21d02ecd1e6b308b8ee074795dc9b#npm:6.19.2"],\ + ["typescript", "patch:typescript@npm%3A5.9.3#optional!builtin::version=5.9.3&hash=5786d5"]\ ],\ "packagePeers": [\ "@types/prisma",\ - "prisma"\ + "@types/typescript",\ + "prisma",\ + "typescript"\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@prisma/config", [\ + ["npm:6.19.2", {\ + "packageLocation": "../../.yarn/berry/cache/@prisma-config-npm-6.19.2-4170d6ff50-10c0.zip/node_modules/@prisma/config/",\ + "packageDependencies": [\ + ["@prisma/config", "npm:6.19.2"],\ + ["c12", "virtual:4170d6ff501da63f0d3e52bc6a464c165ab52c37722b8be4092b04445aeedba09f225a90bbcd1b1e5d8a125a266d3fe255ec43432cf179f6c5b270c072015af6#npm:3.1.0"],\ + ["deepmerge-ts", "npm:7.1.5"],\ + ["effect", "npm:3.18.4"],\ + ["empathic", "npm:2.0.0"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@prisma/debug", [\ - ["npm:5.22.0", {\ - "packageLocation": "../../.yarn/berry/cache/@prisma-debug-npm-5.22.0-ab51f36b8c-10c0.zip/node_modules/@prisma/debug/",\ + ["npm:6.19.2", {\ + "packageLocation": "../../.yarn/berry/cache/@prisma-debug-npm-6.19.2-4d0f4963e3-10c0.zip/node_modules/@prisma/debug/",\ "packageDependencies": [\ - ["@prisma/debug", "npm:5.22.0"]\ + ["@prisma/debug", "npm:6.19.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@prisma/engines", [\ - ["npm:5.22.0", {\ - "packageLocation": "./.yarn/unplugged/@prisma-engines-npm-5.22.0-168ab25a58/node_modules/@prisma/engines/",\ + ["npm:6.19.2", {\ + "packageLocation": "./.yarn/unplugged/@prisma-engines-npm-6.19.2-e66744f43c/node_modules/@prisma/engines/",\ "packageDependencies": [\ - ["@prisma/debug", "npm:5.22.0"],\ - ["@prisma/engines", "npm:5.22.0"],\ - ["@prisma/engines-version", "npm:5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2"],\ - ["@prisma/fetch-engine", "npm:5.22.0"],\ - ["@prisma/get-platform", "npm:5.22.0"]\ + ["@prisma/debug", "npm:6.19.2"],\ + ["@prisma/engines", "npm:6.19.2"],\ + ["@prisma/engines-version", "npm:7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7"],\ + ["@prisma/fetch-engine", "npm:6.19.2"],\ + ["@prisma/get-platform", "npm:6.19.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@prisma/engines-version", [\ - ["npm:5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2", {\ - "packageLocation": "../../.yarn/berry/cache/@prisma-engines-version-npm-5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2-6921cd2048-10c0.zip/node_modules/@prisma/engines-version/",\ + ["npm:7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7", {\ + "packageLocation": "../../.yarn/berry/cache/@prisma-engines-version-npm-7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7-42efbb58a5-10c0.zip/node_modules/@prisma/engines-version/",\ "packageDependencies": [\ - ["@prisma/engines-version", "npm:5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2"]\ + ["@prisma/engines-version", "npm:7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@prisma/fetch-engine", [\ - ["npm:5.22.0", {\ - "packageLocation": "../../.yarn/berry/cache/@prisma-fetch-engine-npm-5.22.0-46ec7f5e04-10c0.zip/node_modules/@prisma/fetch-engine/",\ + ["npm:6.19.2", {\ + "packageLocation": "../../.yarn/berry/cache/@prisma-fetch-engine-npm-6.19.2-d300d1cc93-10c0.zip/node_modules/@prisma/fetch-engine/",\ "packageDependencies": [\ - ["@prisma/debug", "npm:5.22.0"],\ - ["@prisma/engines-version", "npm:5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2"],\ - ["@prisma/fetch-engine", "npm:5.22.0"],\ - ["@prisma/get-platform", "npm:5.22.0"]\ + ["@prisma/debug", "npm:6.19.2"],\ + ["@prisma/engines-version", "npm:7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7"],\ + ["@prisma/fetch-engine", "npm:6.19.2"],\ + ["@prisma/get-platform", "npm:6.19.2"]\ ],\ "linkType": "HARD"\ }]\ ]],\ ["@prisma/get-platform", [\ - ["npm:5.22.0", {\ - "packageLocation": "../../.yarn/berry/cache/@prisma-get-platform-npm-5.22.0-1f768aebf2-10c0.zip/node_modules/@prisma/get-platform/",\ + ["npm:6.19.2", {\ + "packageLocation": "../../.yarn/berry/cache/@prisma-get-platform-npm-6.19.2-22ce032eab-10c0.zip/node_modules/@prisma/get-platform/",\ "packageDependencies": [\ - ["@prisma/debug", "npm:5.22.0"],\ - ["@prisma/get-platform", "npm:5.22.0"]\ + ["@prisma/debug", "npm:6.19.2"],\ + ["@prisma/get-platform", "npm:6.19.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@standard-schema/spec", [\ + ["npm:1.1.0", {\ + "packageLocation": "../../.yarn/berry/cache/@standard-schema-spec-npm-1.1.0-d3e5ccd2e2-10c0.zip/node_modules/@standard-schema/spec/",\ + "packageDependencies": [\ + ["@standard-schema/spec", "npm:1.1.0"]\ ],\ "linkType": "HARD"\ }]\ @@ -1551,6 +1577,40 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["c12", [\ + ["npm:3.1.0", {\ + "packageLocation": "../../.yarn/berry/cache/c12-npm-3.1.0-7adf9faecd-10c0.zip/node_modules/c12/",\ + "packageDependencies": [\ + ["c12", "npm:3.1.0"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:4170d6ff501da63f0d3e52bc6a464c165ab52c37722b8be4092b04445aeedba09f225a90bbcd1b1e5d8a125a266d3fe255ec43432cf179f6c5b270c072015af6#npm:3.1.0", {\ + "packageLocation": "./.yarn/__virtual__/c12-virtual-4a2483d6f1/3/.yarn/berry/cache/c12-npm-3.1.0-7adf9faecd-10c0.zip/node_modules/c12/",\ + "packageDependencies": [\ + ["@types/magicast", null],\ + ["c12", "virtual:4170d6ff501da63f0d3e52bc6a464c165ab52c37722b8be4092b04445aeedba09f225a90bbcd1b1e5d8a125a266d3fe255ec43432cf179f6c5b270c072015af6#npm:3.1.0"],\ + ["chokidar", "npm:4.0.3"],\ + ["confbox", "npm:0.2.4"],\ + ["defu", "npm:6.1.4"],\ + ["dotenv", "npm:16.6.1"],\ + ["exsolve", "npm:1.0.8"],\ + ["giget", "npm:2.0.0"],\ + ["jiti", "npm:2.6.1"],\ + ["magicast", null],\ + ["ohash", "npm:2.0.11"],\ + ["pathe", "npm:2.0.3"],\ + ["perfect-debounce", "npm:1.0.0"],\ + ["pkg-types", "npm:2.3.0"],\ + ["rc9", "npm:2.1.2"]\ + ],\ + "packagePeers": [\ + "@types/magicast",\ + "magicast"\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["cac", [\ ["npm:6.7.14", {\ "packageLocation": "../../.yarn/berry/cache/cac-npm-6.7.14-c46284e425-10c0.zip/node_modules/cac/",\ @@ -1641,6 +1701,14 @@ const RAW_RUNTIME_STATE = ["readdirp", "npm:3.6.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:4.0.3", {\ + "packageLocation": "../../.yarn/berry/cache/chokidar-npm-4.0.3-962354fbb4-10c0.zip/node_modules/chokidar/",\ + "packageDependencies": [\ + ["chokidar", "npm:4.0.3"],\ + ["readdirp", "npm:4.1.2"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["chownr", [\ @@ -1652,6 +1720,23 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["citty", [\ + ["npm:0.1.6", {\ + "packageLocation": "../../.yarn/berry/cache/citty-npm-0.1.6-60b76c16d8-10c0.zip/node_modules/citty/",\ + "packageDependencies": [\ + ["citty", "npm:0.1.6"],\ + ["consola", "npm:3.4.2"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:0.2.0", {\ + "packageLocation": "../../.yarn/berry/cache/citty-npm-0.2.0-a9c9f8998f-10c0.zip/node_modules/citty/",\ + "packageDependencies": [\ + ["citty", "npm:0.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["color-convert", [\ ["npm:2.0.1", {\ "packageLocation": "../../.yarn/berry/cache/color-convert-npm-2.0.1-79730e935b-10c0.zip/node_modules/color-convert/",\ @@ -1704,6 +1789,22 @@ const RAW_RUNTIME_STATE = ["confbox", "npm:0.1.8"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:0.2.4", {\ + "packageLocation": "../../.yarn/berry/cache/confbox-npm-0.2.4-31ba8953f9-10c0.zip/node_modules/confbox/",\ + "packageDependencies": [\ + ["confbox", "npm:0.2.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["consola", [\ + ["npm:3.4.2", {\ + "packageLocation": "../../.yarn/berry/cache/consola-npm-3.4.2-133d72719e-10c0.zip/node_modules/consola/",\ + "packageDependencies": [\ + ["consola", "npm:3.4.2"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["cookie", [\ @@ -1788,6 +1889,33 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["deepmerge-ts", [\ + ["npm:7.1.5", {\ + "packageLocation": "../../.yarn/berry/cache/deepmerge-ts-npm-7.1.5-d78cb9df71-10c0.zip/node_modules/deepmerge-ts/",\ + "packageDependencies": [\ + ["deepmerge-ts", "npm:7.1.5"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["defu", [\ + ["npm:6.1.4", {\ + "packageLocation": "../../.yarn/berry/cache/defu-npm-6.1.4-c791c7f2cc-10c0.zip/node_modules/defu/",\ + "packageDependencies": [\ + ["defu", "npm:6.1.4"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["destr", [\ + ["npm:2.0.5", {\ + "packageLocation": "../../.yarn/berry/cache/destr-npm-2.0.5-743a0bad4e-10c0.zip/node_modules/destr/",\ + "packageDependencies": [\ + ["destr", "npm:2.0.5"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["diff", [\ ["npm:4.0.4", {\ "packageLocation": "../../.yarn/berry/cache/diff-npm-4.0.4-e9ea573423-10c0.zip/node_modules/diff/",\ @@ -1826,6 +1954,26 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["effect", [\ + ["npm:3.18.4", {\ + "packageLocation": "../../.yarn/berry/cache/effect-npm-3.18.4-415d415f2b-10c0.zip/node_modules/effect/",\ + "packageDependencies": [\ + ["@standard-schema/spec", "npm:1.1.0"],\ + ["effect", "npm:3.18.4"],\ + ["fast-check", "npm:3.23.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["empathic", [\ + ["npm:2.0.0", {\ + "packageLocation": "../../.yarn/berry/cache/empathic-npm-2.0.0-440d97be6e-10c0.zip/node_modules/empathic/",\ + "packageDependencies": [\ + ["empathic", "npm:2.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["encoding", [\ ["npm:0.1.13", {\ "packageLocation": "../../.yarn/berry/cache/encoding-npm-0.1.13-82a1837d30-10c0.zip/node_modules/encoding/",\ @@ -2187,6 +2335,25 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["exsolve", [\ + ["npm:1.0.8", {\ + "packageLocation": "../../.yarn/berry/cache/exsolve-npm-1.0.8-20570c05a2-10c0.zip/node_modules/exsolve/",\ + "packageDependencies": [\ + ["exsolve", "npm:1.0.8"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["fast-check", [\ + ["npm:3.23.2", {\ + "packageLocation": "../../.yarn/berry/cache/fast-check-npm-3.23.2-63dd857472-10c0.zip/node_modules/fast-check/",\ + "packageDependencies": [\ + ["fast-check", "npm:3.23.2"],\ + ["pure-rand", "npm:6.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["fast-content-type-parse", [\ ["npm:1.1.0", {\ "packageLocation": "../../.yarn/berry/cache/fast-content-type-parse-npm-1.1.0-035173e566-10c0.zip/node_modules/fast-content-type-parse/",\ @@ -2510,6 +2677,21 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["giget", [\ + ["npm:2.0.0", {\ + "packageLocation": "../../.yarn/berry/cache/giget-npm-2.0.0-1f9231b875-10c0.zip/node_modules/giget/",\ + "packageDependencies": [\ + ["citty", "npm:0.1.6"],\ + ["consola", "npm:3.4.2"],\ + ["defu", "npm:6.1.4"],\ + ["giget", "npm:2.0.0"],\ + ["node-fetch-native", "npm:1.6.7"],\ + ["nypm", "npm:0.6.5"],\ + ["pathe", "npm:2.0.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["glob", [\ ["npm:13.0.1", {\ "packageLocation": "../../.yarn/berry/cache/glob-npm-13.0.1-322004d656-10c0.zip/node_modules/glob/",\ @@ -2813,6 +2995,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["jiti", [\ + ["npm:2.6.1", {\ + "packageLocation": "../../.yarn/berry/cache/jiti-npm-2.6.1-597ab7fb84-10c0.zip/node_modules/jiti/",\ + "packageDependencies": [\ + ["jiti", "npm:2.6.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["js-string-escape", [\ ["npm:1.0.1", {\ "packageLocation": "../../.yarn/berry/cache/js-string-escape-npm-1.0.1-8b8d76add3-10c0.zip/node_modules/js-string-escape/",\ @@ -3197,6 +3388,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["node-fetch-native", [\ + ["npm:1.6.7", {\ + "packageLocation": "../../.yarn/berry/cache/node-fetch-native-npm-1.6.7-346a13c388-10c0.zip/node_modules/node-fetch-native/",\ + "packageDependencies": [\ + ["node-fetch-native", "npm:1.6.7"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["node-gyp", [\ ["npm:12.2.0", {\ "packageLocation": "./.yarn/unplugged/node-gyp-npm-12.2.0-11f8fe84f1/node_modules/node-gyp/",\ @@ -3235,6 +3435,18 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["nypm", [\ + ["npm:0.6.5", {\ + "packageLocation": "../../.yarn/berry/cache/nypm-npm-0.6.5-bdb1150524-10c0.zip/node_modules/nypm/",\ + "packageDependencies": [\ + ["citty", "npm:0.2.0"],\ + ["nypm", "npm:0.6.5"],\ + ["pathe", "npm:2.0.3"],\ + ["tinyexec", "npm:1.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["obliterator", [\ ["npm:2.0.5", {\ "packageLocation": "../../.yarn/berry/cache/obliterator-npm-2.0.5-55b0b3e992-10c0.zip/node_modules/obliterator/",\ @@ -3244,6 +3456,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["ohash", [\ + ["npm:2.0.11", {\ + "packageLocation": "../../.yarn/berry/cache/ohash-npm-2.0.11-11d66c7fc3-10c0.zip/node_modules/ohash/",\ + "packageDependencies": [\ + ["ohash", "npm:2.0.11"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["on-exit-leak-free", [\ ["npm:2.1.2", {\ "packageLocation": "../../.yarn/berry/cache/on-exit-leak-free-npm-2.1.2-0d0c5ad67d-10c0.zip/node_modules/on-exit-leak-free/",\ @@ -3397,6 +3618,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["perfect-debounce", [\ + ["npm:1.0.0", {\ + "packageLocation": "../../.yarn/berry/cache/perfect-debounce-npm-1.0.0-0968810009-10c0.zip/node_modules/perfect-debounce/",\ + "packageDependencies": [\ + ["perfect-debounce", "npm:1.0.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["picocolors", [\ ["npm:1.1.1", {\ "packageLocation": "../../.yarn/berry/cache/picocolors-npm-1.1.1-4fede47cf1-10c0.zip/node_modules/picocolors/",\ @@ -3505,6 +3735,16 @@ const RAW_RUNTIME_STATE = ["pkg-types", "npm:1.3.1"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:2.3.0", {\ + "packageLocation": "../../.yarn/berry/cache/pkg-types-npm-2.3.0-e7381b4aaa-10c0.zip/node_modules/pkg-types/",\ + "packageDependencies": [\ + ["confbox", "npm:0.2.4"],\ + ["exsolve", "npm:1.0.8"],\ + ["pathe", "npm:2.0.3"],\ + ["pkg-types", "npm:2.3.0"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["playwright", [\ @@ -3587,12 +3827,25 @@ const RAW_RUNTIME_STATE = }]\ ]],\ ["prisma", [\ - ["npm:5.22.0", {\ - "packageLocation": "./.yarn/unplugged/prisma-npm-5.22.0-20c6f5ba07/node_modules/prisma/",\ + ["npm:6.19.2", {\ + "packageLocation": "./.yarn/unplugged/prisma-virtual-e3afdd77c7/node_modules/prisma/",\ "packageDependencies": [\ - ["@prisma/engines", "npm:5.22.0"],\ - ["fsevents", "patch:fsevents@npm%3A2.3.3#optional!builtin::version=2.3.3&hash=df0bf1"],\ - ["prisma", "npm:5.22.0"]\ + ["prisma", "npm:6.19.2"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:f6b9964910e3f10023a17ff3ab92233ffcc1e59e4d8aa19a994a441163321ece3524a6d19f9ae419b654b74f6329bf472cc21d02ecd1e6b308b8ee074795dc9b#npm:6.19.2", {\ + "packageLocation": "./.yarn/unplugged/prisma-virtual-e3afdd77c7/node_modules/prisma/",\ + "packageDependencies": [\ + ["@prisma/config", "npm:6.19.2"],\ + ["@prisma/engines", "npm:6.19.2"],\ + ["@types/typescript", null],\ + ["prisma", "virtual:f6b9964910e3f10023a17ff3ab92233ffcc1e59e4d8aa19a994a441163321ece3524a6d19f9ae419b654b74f6329bf472cc21d02ecd1e6b308b8ee074795dc9b#npm:6.19.2"],\ + ["typescript", "patch:typescript@npm%3A5.9.3#optional!builtin::version=5.9.3&hash=5786d5"]\ + ],\ + "packagePeers": [\ + "@types/typescript",\ + "typescript"\ ],\ "linkType": "HARD"\ }]\ @@ -3662,6 +3915,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["pure-rand", [\ + ["npm:6.1.0", {\ + "packageLocation": "../../.yarn/berry/cache/pure-rand-npm-6.1.0-497ea3fc37-10c0.zip/node_modules/pure-rand/",\ + "packageDependencies": [\ + ["pure-rand", "npm:6.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["quasar", [\ ["workspace:.", {\ "packageLocation": "./",\ @@ -3689,14 +3951,14 @@ const RAW_RUNTIME_STATE = ["@fastify/helmet", "npm:11.1.1"],\ ["@fastify/multipart", "npm:9.4.0"],\ ["@fastify/rate-limit", "npm:9.1.0"],\ - ["@prisma/client", "virtual:f6b9964910e3f10023a17ff3ab92233ffcc1e59e4d8aa19a994a441163321ece3524a6d19f9ae419b654b74f6329bf472cc21d02ecd1e6b308b8ee074795dc9b#npm:5.22.0"],\ + ["@prisma/client", "virtual:f6b9964910e3f10023a17ff3ab92233ffcc1e59e4d8aa19a994a441163321ece3524a6d19f9ae419b654b74f6329bf472cc21d02ecd1e6b308b8ee074795dc9b#npm:6.19.2"],\ ["@types/node", "npm:18.19.130"],\ ["dotenv", "npm:16.6.1"],\ ["eslint", "npm:8.57.1"],\ ["fastify", "npm:4.29.1"],\ ["pino", "npm:8.21.0"],\ ["prettier", "npm:2.8.8"],\ - ["prisma", "npm:5.22.0"],\ + ["prisma", "virtual:f6b9964910e3f10023a17ff3ab92233ffcc1e59e4d8aa19a994a441163321ece3524a6d19f9ae419b654b74f6329bf472cc21d02ecd1e6b308b8ee074795dc9b#npm:6.19.2"],\ ["quasar-backend", "workspace:backend"],\ ["ts-node-dev", "virtual:f6b9964910e3f10023a17ff3ab92233ffcc1e59e4d8aa19a994a441163321ece3524a6d19f9ae419b654b74f6329bf472cc21d02ecd1e6b308b8ee074795dc9b#npm:2.0.0"],\ ["typescript", "patch:typescript@npm%3A5.9.3#optional!builtin::version=5.9.3&hash=5786d5"],\ @@ -3723,6 +3985,17 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["rc9", [\ + ["npm:2.1.2", {\ + "packageLocation": "../../.yarn/berry/cache/rc9-npm-2.1.2-fc8aeb8bb0-10c0.zip/node_modules/rc9/",\ + "packageDependencies": [\ + ["defu", "npm:6.1.4"],\ + ["destr", "npm:2.0.5"],\ + ["rc9", "npm:2.1.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["react-is", [\ ["npm:17.0.2", {\ "packageLocation": "../../.yarn/berry/cache/react-is-npm-17.0.2-091bbb8db6-10c0.zip/node_modules/react-is/",\ @@ -3754,6 +4027,13 @@ const RAW_RUNTIME_STATE = ["readdirp", "npm:3.6.0"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:4.1.2", {\ + "packageLocation": "../../.yarn/berry/cache/readdirp-npm-4.1.2-3440472afe-10c0.zip/node_modules/readdirp/",\ + "packageDependencies": [\ + ["readdirp", "npm:4.1.2"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["real-require", [\ @@ -4227,6 +4507,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["tinyexec", [\ + ["npm:1.0.2", {\ + "packageLocation": "../../.yarn/berry/cache/tinyexec-npm-1.0.2-321b713e56-10c0.zip/node_modules/tinyexec/",\ + "packageDependencies": [\ + ["tinyexec", "npm:1.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["tinyglobby", [\ ["npm:0.2.15", {\ "packageLocation": "../../.yarn/berry/cache/tinyglobby-npm-0.2.15-0e783aadbd-10c0.zip/node_modules/tinyglobby/",\ diff --git a/.yarnrc.yml b/.yarnrc.yml index 4ececd9..9ce0361 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1 +1,6 @@ yarnPath: .yarn/releases/yarn-4.12.0.cjs + +packageExtensions: + "@prisma/client@*": + dependencies: + ".prisma": "*" diff --git a/backend/README.md b/backend/README.md index 9ea806e..504a711 100644 --- a/backend/README.md +++ b/backend/README.md @@ -2,31 +2,34 @@ Scaffold mínimo del backend usando Fastify + TypeScript + Prisma (SQLite). -Pasos rápidos: +**Arranque rápido** -1. Instalar dependencias: +``` +# desde la raíz +yarn - yarn +# entrar al backend +cd backend -2. Generar el cliente Prisma: +# generar cliente Prisma +yarn prisma:generate - npx prisma generate +# aplicar migraciones (si pide nombre, usar --name init) +yarn prisma:migrate -3. Crear la migración inicial (local): +# abrir Prisma Studio +yarn prisma:studio - npx prisma migrate dev --name init +# ejecutar en desarrollo +yarn dev -4. Ejecutar en modo desarrollo: - - yarn dev - -5. Tests: - - yarn test +# ejecutar tests +yarn test +``` Notas: -- Las migraciones **no** se ejecutaron como parte de este commit. Use `.env.example` como referencia para `DATABASE_URL`. +- Use `.env.example` como referencia para `DATABASE_URL`. --- diff --git a/backend/package.json b/backend/package.json index 77f3cf8..1b90786 100644 --- a/backend/package.json +++ b/backend/package.json @@ -9,9 +9,11 @@ "build": "tsc -p tsconfig.json", "start": "node dist/index.js", "test": "vitest", - "prisma:generate": "prisma generate", - "prisma:migrate": "prisma migrate dev --name init", - "prisma:studio": "prisma studio", + "test:ci": "vitest run", + "prisma:generate": "prisma generate --schema=./prisma/schema.prisma", + "prisma:migrate": "prisma migrate dev --name init --schema=./prisma/schema.prisma", + "prisma:migrate:deploy": "prisma migrate deploy --schema=./prisma/schema.prisma", + "prisma:studio": "prisma studio --schema=./prisma/schema.prisma", "lint": "eslint \"src/**/*.{ts,js}\"", "format": "prettier --write ." }, @@ -20,7 +22,7 @@ "@fastify/helmet": "^11.0.0", "@fastify/multipart": "^9.0.0", "@fastify/rate-limit": "^9.0.0", - "@prisma/client": "5.22.0", + "@prisma/client": "6.19.2", "dotenv": "^16.0.0", "fastify": "^4.28.0", "pino": "^8.0.0" @@ -29,7 +31,7 @@ "@types/node": "^18.0.0", "eslint": "^8.0.0", "prettier": "^2.8.0", - "prisma": "5.22.0", + "prisma": "6.19.2", "ts-node-dev": "^2.0.0", "typescript": "^5.2.0", "vitest": "^0.31.0" diff --git a/backend/prisma/migrations/20260208102247_init/migration.sql b/backend/prisma/migrations/20260208102247_init/migration.sql new file mode 100644 index 0000000..a2509d8 --- /dev/null +++ b/backend/prisma/migrations/20260208102247_init/migration.sql @@ -0,0 +1,133 @@ +-- CreateTable +CREATE TABLE "Game" ( + "id" TEXT NOT NULL PRIMARY KEY, + "title" TEXT NOT NULL, + "slug" TEXT NOT NULL, + "description" TEXT, + "releaseDate" DATETIME, + "igdbId" INTEGER, + "rawgId" INTEGER, + "thegamesdbId" INTEGER, + "extra" TEXT, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" DATETIME NOT NULL +); + +-- CreateTable +CREATE TABLE "Platform" ( + "id" TEXT NOT NULL PRIMARY KEY, + "name" TEXT NOT NULL, + "slug" TEXT NOT NULL, + "generation" INTEGER +); + +-- CreateTable +CREATE TABLE "GamePlatform" ( + "id" TEXT NOT NULL PRIMARY KEY, + "gameId" TEXT NOT NULL, + "platformId" TEXT NOT NULL, + CONSTRAINT "GamePlatform_gameId_fkey" FOREIGN KEY ("gameId") REFERENCES "Game" ("id") ON DELETE RESTRICT ON UPDATE CASCADE, + CONSTRAINT "GamePlatform_platformId_fkey" FOREIGN KEY ("platformId") REFERENCES "Platform" ("id") ON DELETE RESTRICT ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "RomFile" ( + "id" TEXT NOT NULL PRIMARY KEY, + "path" TEXT NOT NULL, + "filename" TEXT NOT NULL, + "checksum" TEXT NOT NULL, + "size" INTEGER NOT NULL, + "format" TEXT NOT NULL, + "hashes" TEXT, + "gameId" TEXT, + "addedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "lastSeenAt" DATETIME, + "status" TEXT NOT NULL DEFAULT 'active', + CONSTRAINT "RomFile_gameId_fkey" FOREIGN KEY ("gameId") REFERENCES "Game" ("id") ON DELETE SET NULL ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "Artwork" ( + "id" TEXT NOT NULL PRIMARY KEY, + "gameId" TEXT NOT NULL, + "type" TEXT NOT NULL, + "sourceUrl" TEXT NOT NULL, + "localPath" TEXT, + "width" INTEGER, + "height" INTEGER, + "fetchedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT "Artwork_gameId_fkey" FOREIGN KEY ("gameId") REFERENCES "Game" ("id") ON DELETE RESTRICT ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "Purchase" ( + "id" TEXT NOT NULL PRIMARY KEY, + "gameId" TEXT NOT NULL, + "priceCents" INTEGER NOT NULL, + "currency" TEXT NOT NULL, + "store" TEXT, + "date" DATETIME NOT NULL, + "receiptPath" TEXT, + CONSTRAINT "Purchase_gameId_fkey" FOREIGN KEY ("gameId") REFERENCES "Game" ("id") ON DELETE RESTRICT ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "Tag" ( + "id" TEXT NOT NULL PRIMARY KEY, + "name" TEXT NOT NULL +); + +-- CreateTable +CREATE TABLE "PriceHistory" ( + "id" TEXT NOT NULL PRIMARY KEY, + "gameId" TEXT NOT NULL, + "priceCents" INTEGER NOT NULL, + "currency" TEXT NOT NULL, + "recordedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + "source" TEXT, + CONSTRAINT "PriceHistory_gameId_fkey" FOREIGN KEY ("gameId") REFERENCES "Game" ("id") ON DELETE RESTRICT ON UPDATE CASCADE +); + +-- CreateTable +CREATE TABLE "_GameToTag" ( + "A" TEXT NOT NULL, + "B" TEXT NOT NULL, + CONSTRAINT "_GameToTag_A_fkey" FOREIGN KEY ("A") REFERENCES "Game" ("id") ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT "_GameToTag_B_fkey" FOREIGN KEY ("B") REFERENCES "Tag" ("id") ON DELETE CASCADE ON UPDATE CASCADE +); + +-- CreateIndex +CREATE UNIQUE INDEX "Game_slug_key" ON "Game"("slug"); + +-- CreateIndex +CREATE UNIQUE INDEX "Game_igdbId_key" ON "Game"("igdbId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Game_rawgId_key" ON "Game"("rawgId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Game_thegamesdbId_key" ON "Game"("thegamesdbId"); + +-- CreateIndex +CREATE INDEX "Game_title_idx" ON "Game"("title"); + +-- CreateIndex +CREATE UNIQUE INDEX "Platform_slug_key" ON "Platform"("slug"); + +-- CreateIndex +CREATE UNIQUE INDEX "GamePlatform_gameId_platformId_key" ON "GamePlatform"("gameId", "platformId"); + +-- CreateIndex +CREATE UNIQUE INDEX "RomFile_checksum_key" ON "RomFile"("checksum"); + +-- CreateIndex +CREATE INDEX "RomFile_checksum_idx" ON "RomFile"("checksum"); + +-- CreateIndex +CREATE UNIQUE INDEX "Tag_name_key" ON "Tag"("name"); + +-- CreateIndex +CREATE UNIQUE INDEX "_GameToTag_AB_unique" ON "_GameToTag"("A", "B"); + +-- CreateIndex +CREATE INDEX "_GameToTag_B_index" ON "_GameToTag"("B"); diff --git a/backend/prisma/migrations/migration_lock.toml b/backend/prisma/migrations/migration_lock.toml new file mode 100644 index 0000000..2a5a444 --- /dev/null +++ b/backend/prisma/migrations/migration_lock.toml @@ -0,0 +1,3 @@ +# Please do not edit this file manually +# It should be added in your version-control system (e.g., Git) +provider = "sqlite" diff --git a/backend/tests/models/game.spec.ts b/backend/tests/models/game.spec.ts new file mode 100644 index 0000000..0a16a2c --- /dev/null +++ b/backend/tests/models/game.spec.ts @@ -0,0 +1,92 @@ +import fs from 'fs'; +import os from 'os'; +import path from 'path'; +import { execSync } from 'child_process'; +import { describe, beforeAll, afterAll, it, expect } from 'vitest'; +// Import PrismaClient dynamically after running `prisma generate` +// to allow the test setup to run `prisma generate`/`prisma migrate` first. + +// Nota: Estos tests siguen TDD. Al principio deben FALLAR hasta que se creen migraciones. + +describe('Prisma / Game model', () => { + const tmpDir = os.tmpdir(); + const dbFile = path.join( + tmpDir, + `quasar-test-${Date.now()}-${Math.random().toString(36).slice(2)}.db` + ); + const databaseUrl = `file:${dbFile}`; + let prisma: any; + + beforeAll(async () => { + // Asegurarse de que la DB de prueba no exista antes de empezar + try { + fs.unlinkSync(dbFile); + } catch (e) { + /* ignore */ + } + + // Apuntar Prisma a la DB temporal + process.env.DATABASE_URL = databaseUrl; + + // Ejecutar migraciones contra la DB de prueba + // Esto fallará si no hay migraciones: esperado en la fase TDD inicial + execSync('yarn prisma migrate deploy --schema=./prisma/schema.prisma', { + stdio: 'inherit', + cwd: path.resolve(__dirname, '..', '..'), + }); + + // Intentar requerir el cliente generado; si no existe, intentar generarlo (fallback) + let GeneratedPrismaClient; + try { + // eslint-disable-next-line @typescript-eslint/no-var-requires + GeneratedPrismaClient = require('@prisma/client').PrismaClient; + } catch (e) { + try { + execSync('yarn prisma generate --schema=./prisma/schema.prisma', { + stdio: 'inherit', + cwd: path.resolve(__dirname, '..', '..'), + }); + // eslint-disable-next-line @typescript-eslint/no-var-requires + GeneratedPrismaClient = require('@prisma/client').PrismaClient; + } catch (err) { + // Si generation falla (por ejemplo PnP), reintentar require para mostrar mejor error + // eslint-disable-next-line @typescript-eslint/no-var-requires + GeneratedPrismaClient = require('@prisma/client').PrismaClient; + } + } + prisma = new GeneratedPrismaClient(); + await prisma.$connect(); + }); + + afterAll(async () => { + if (prisma) { + await prisma.$disconnect(); + } + try { + fs.unlinkSync(dbFile); + } catch (e) { + /* ignore */ + } + }); + + it('can create a Game and read title/slug', async () => { + const created = await prisma.game.create({ data: { title: 'Test Game', slug: 'test-game' } }); + const found = await prisma.game.findUnique({ where: { id: created.id } }); + expect(found).toBeTruthy(); + expect(found?.title).toBe('Test Game'); + expect(found?.slug).toBe('test-game'); + }); + + it('enforces unique slug constraint', async () => { + const slug = `unique-${Date.now()}`; + await prisma.game.create({ data: { title: 'G1', slug } }); + + let threw = false; + try { + await prisma.game.create({ data: { title: 'G2', slug } }); + } catch (err) { + threw = true; + } + expect(threw).toBe(true); + }); +}); diff --git a/yarn.lock b/yarn.lock index 4276fa6..58897bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -553,61 +553,83 @@ __metadata: languageName: node linkType: hard -"@prisma/client@npm:5.22.0": - version: 5.22.0 - resolution: "@prisma/client@npm:5.22.0" +"@prisma/client@npm:6.19.2": + version: 6.19.2 + resolution: "@prisma/client@npm:6.19.2" peerDependencies: prisma: "*" + typescript: ">=5.1.0" peerDependenciesMeta: prisma: optional: true - checksum: 10c0/ad111b931f184249794f811637456eb38dcfd0d7047e5a1f64804e5256f462fa3ee7c7a552fc8fa181e8daacc2b958af7426cb57bf0dc66605c3ef7c4aef4afb + typescript: + optional: true + checksum: 10c0/b1b81171af50627275f1f66ee44652363eb9b3e0fac60590f15a99e48ca434f0cbf8580c252f0b8f4268468be219ba4f18e338c6275a038f8473fad809a782f7 languageName: node linkType: hard -"@prisma/debug@npm:5.22.0": - version: 5.22.0 - resolution: "@prisma/debug@npm:5.22.0" - checksum: 10c0/ff7c5e84d9f9b568a2a1992eb39fc7c3ab6d9e326c77fdefec1655ccfbf6c0ee268a5dcf087867848eb00a0328c9cc75a164880ec7cd60f7fd634e2fca2943d9 - languageName: node - linkType: hard - -"@prisma/engines-version@npm:5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2": - version: 5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2 - resolution: "@prisma/engines-version@npm:5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2" - checksum: 10c0/95df49c6f35f99c0977e9690d9ae0776327df07c6f035e8c4a247a9c21108f0760c02ca6dbe63a35013e5cd1eb77a896edb340f1e28ea04373c6cefc4ce09b51 - languageName: node - linkType: hard - -"@prisma/engines@npm:5.22.0": - version: 5.22.0 - resolution: "@prisma/engines@npm:5.22.0" +"@prisma/config@npm:6.19.2": + version: 6.19.2 + resolution: "@prisma/config@npm:6.19.2" dependencies: - "@prisma/debug": "npm:5.22.0" - "@prisma/engines-version": "npm:5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2" - "@prisma/fetch-engine": "npm:5.22.0" - "@prisma/get-platform": "npm:5.22.0" - checksum: 10c0/81a439e5064a1036e05da8feaf7ffb19b5dba98d5ea68dc385f7e24e3cc25ef9f0b78a1aa1d7d7234a9afd916ee18b707863cee48274912315bc933429f26ce7 + c12: "npm:3.1.0" + deepmerge-ts: "npm:7.1.5" + effect: "npm:3.18.4" + empathic: "npm:2.0.0" + checksum: 10c0/dfa186781c0e3a67d2bcc2925e8f7551fff184f66d12428e2d55621fedd52aa69414b1b950f7b569fc41eaeb189716d55860c2152a9033a70e39851c3f2a7499 languageName: node linkType: hard -"@prisma/fetch-engine@npm:5.22.0": - version: 5.22.0 - resolution: "@prisma/fetch-engine@npm:5.22.0" - dependencies: - "@prisma/debug": "npm:5.22.0" - "@prisma/engines-version": "npm:5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2" - "@prisma/get-platform": "npm:5.22.0" - checksum: 10c0/0d3dcaffbadcf9185cca37bb50ce3a92fad2a205451731e5c3d02b1ee96a918dde99a9ce231e62bddde5ec8dcb3035338ff1312f8416f2cdaf31a69a19448baf +"@prisma/debug@npm:6.19.2": + version: 6.19.2 + resolution: "@prisma/debug@npm:6.19.2" + checksum: 10c0/340650d8cd0e7f3c70e0b24c2d60e46ca14e1e356d77976185ecd7c9f8b7938f782b8575a4b60e8aeb359bcf8c3cd730c6354105e7e81612fdb67742d7aa230c languageName: node linkType: hard -"@prisma/get-platform@npm:5.22.0": - version: 5.22.0 - resolution: "@prisma/get-platform@npm:5.22.0" +"@prisma/engines-version@npm:7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7": + version: 7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7 + resolution: "@prisma/engines-version@npm:7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7" + checksum: 10c0/7bf85d9a33b6be89ab2941d2ae7f2bab29bee0166badddba878245b326a5d82966cebca9124a0cf982696b0be9572fe14ce7fe95ba82c59bb8ea0946ad296452 + languageName: node + linkType: hard + +"@prisma/engines@npm:6.19.2": + version: 6.19.2 + resolution: "@prisma/engines@npm:6.19.2" dependencies: - "@prisma/debug": "npm:5.22.0" - checksum: 10c0/b934f9bbba1e8dae01721a213a5b166a4dd9f35bf04ad93fb9e24afb67945c09562d4e2c5b4d33b1830cdc7adeb03775309c55ab2c470048ed4cfc947fe495f5 + "@prisma/debug": "npm:6.19.2" + "@prisma/engines-version": "npm:7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7" + "@prisma/fetch-engine": "npm:6.19.2" + "@prisma/get-platform": "npm:6.19.2" + checksum: 10c0/7f94f141d9e0190b7a8cbf0c2ffa4e0638d810b28f9ef4d3e46e70648ba25b0ab74e3962d2cc824283a01e115c92efac7e043683af6ed382b22aa769b0586f03 + languageName: node + linkType: hard + +"@prisma/fetch-engine@npm:6.19.2": + version: 6.19.2 + resolution: "@prisma/fetch-engine@npm:6.19.2" + dependencies: + "@prisma/debug": "npm:6.19.2" + "@prisma/engines-version": "npm:7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7" + "@prisma/get-platform": "npm:6.19.2" + checksum: 10c0/6f569ef6bb15f54f62efa68b84a8ae2c1a2d65b9eb995205862a288ae641c92e1d56f26e633f22fb89e927ddc8b5bbe72a100803835d775ea98e857677fecee5 + languageName: node + linkType: hard + +"@prisma/get-platform@npm:6.19.2": + version: 6.19.2 + resolution: "@prisma/get-platform@npm:6.19.2" + dependencies: + "@prisma/debug": "npm:6.19.2" + checksum: 10c0/9fd401cac64753223e89db6564b8149a9c4abbd6932a8f017e3b0261fa73786e904b69b8d83ef2bea1bb42b9a728bcf6738e4710bc414f289900a7af24c13e42 + languageName: node + linkType: hard + +"@standard-schema/spec@npm:^1.0.0": + version: 1.1.0 + resolution: "@standard-schema/spec@npm:1.1.0" + checksum: 10c0/d90f55acde4b2deb983529c87e8025fa693de1a5e8b49ecc6eb84d1fd96328add0e03d7d551442156c7432fd78165b2c26ff561b970a9a881f046abb78d6a526 languageName: node linkType: hard @@ -1166,6 +1188,31 @@ __metadata: languageName: node linkType: hard +"c12@npm:3.1.0": + version: 3.1.0 + resolution: "c12@npm:3.1.0" + dependencies: + chokidar: "npm:^4.0.3" + confbox: "npm:^0.2.2" + defu: "npm:^6.1.4" + dotenv: "npm:^16.6.1" + exsolve: "npm:^1.0.7" + giget: "npm:^2.0.0" + jiti: "npm:^2.4.2" + ohash: "npm:^2.0.11" + pathe: "npm:^2.0.3" + perfect-debounce: "npm:^1.0.0" + pkg-types: "npm:^2.2.0" + rc9: "npm:^2.1.2" + peerDependencies: + magicast: ^0.3.5 + peerDependenciesMeta: + magicast: + optional: true + checksum: 10c0/a84d6cb5cb6171e9b5be67388b24c6945da8bf3d37b1e4db885ceb1db019da13b9af093d8bbed6b536fd9c4a9202a2ed8c14fb15d4d94fb2e5e7c83b6c88f05b + languageName: node + linkType: hard + "cac@npm:^6.7.14": version: 6.7.14 resolution: "cac@npm:6.7.14" @@ -1252,6 +1299,15 @@ __metadata: languageName: node linkType: hard +"chokidar@npm:^4.0.3": + version: 4.0.3 + resolution: "chokidar@npm:4.0.3" + dependencies: + readdirp: "npm:^4.0.1" + checksum: 10c0/a58b9df05bb452f7d105d9e7229ac82fa873741c0c40ddcc7bb82f8a909fbe3f7814c9ebe9bc9a2bef9b737c0ec6e2d699d179048ef06ad3ec46315df0ebe6ad + languageName: node + linkType: hard + "chownr@npm:^3.0.0": version: 3.0.0 resolution: "chownr@npm:3.0.0" @@ -1259,6 +1315,22 @@ __metadata: languageName: node linkType: hard +"citty@npm:^0.1.6": + version: 0.1.6 + resolution: "citty@npm:0.1.6" + dependencies: + consola: "npm:^3.2.3" + checksum: 10c0/d26ad82a9a4a8858c7e149d90b878a3eceecd4cfd3e2ed3cd5f9a06212e451fb4f8cbe0fa39a3acb1b3e8f18e22db8ee5def5829384bad50e823d4b301609b48 + languageName: node + linkType: hard + +"citty@npm:^0.2.0": + version: 0.2.0 + resolution: "citty@npm:0.2.0" + checksum: 10c0/da72051262ec0e0390dc9800e16bae72a5c85d61982e4f74e3c502d08a3099428964405eb1b4cdc07a7fd5658f78db97c0111c503cde592a41e75a299ac45fb5 + languageName: node + linkType: hard + "color-convert@npm:^2.0.1": version: 2.0.1 resolution: "color-convert@npm:2.0.1" @@ -1305,6 +1377,20 @@ __metadata: languageName: node linkType: hard +"confbox@npm:^0.2.2": + version: 0.2.4 + resolution: "confbox@npm:0.2.4" + checksum: 10c0/4c36af33d9df7034300c452f7b289179264493bd0671fa81b995a0d70dc897b1d37f1af10d3ffb187f178d17ba1ed2ba167ed0f599ba3a139c271205dd553f73 + languageName: node + linkType: hard + +"consola@npm:^3.2.3, consola@npm:^3.4.0": + version: 3.4.2 + resolution: "consola@npm:3.4.2" + checksum: 10c0/7cebe57ecf646ba74b300bcce23bff43034ed6fbec9f7e39c27cee1dc00df8a21cd336b466ad32e304ea70fba04ec9e890c200270de9a526ce021ba8a7e4c11a + languageName: node + linkType: hard + "cookie@npm:^0.7.0": version: 0.7.2 resolution: "cookie@npm:0.7.2" @@ -1367,6 +1453,27 @@ __metadata: languageName: node linkType: hard +"deepmerge-ts@npm:7.1.5": + version: 7.1.5 + resolution: "deepmerge-ts@npm:7.1.5" + checksum: 10c0/3a265a2086f334e3ecf43a7d4138c950cb99e0b39e816fa7fd7f5326161364e51b13010906908212667619066f5b48de738ed42543212323fbbb5d4ed7ebdc84 + languageName: node + linkType: hard + +"defu@npm:^6.1.4": + version: 6.1.4 + resolution: "defu@npm:6.1.4" + checksum: 10c0/2d6cc366262dc0cb8096e429368e44052fdf43ed48e53ad84cc7c9407f890301aa5fcb80d0995abaaf842b3949f154d060be4160f7a46cb2bc2f7726c81526f5 + languageName: node + linkType: hard + +"destr@npm:^2.0.3": + version: 2.0.5 + resolution: "destr@npm:2.0.5" + checksum: 10c0/efabffe7312a45ad90d79975376be958c50069f1156b94c181199763a7f971e113bd92227c26b94a169c71ca7dbc13583b7e96e5164743969fc79e1ff153e646 + languageName: node + linkType: hard + "diff@npm:^4.0.1": version: 4.0.4 resolution: "diff@npm:4.0.4" @@ -1383,7 +1490,7 @@ __metadata: languageName: node linkType: hard -"dotenv@npm:^16.0.0": +"dotenv@npm:^16.0.0, dotenv@npm:^16.6.1": version: 16.6.1 resolution: "dotenv@npm:16.6.1" checksum: 10c0/15ce56608326ea0d1d9414a5c8ee6dcf0fffc79d2c16422b4ac2268e7e2d76ff5a572d37ffe747c377de12005f14b3cc22361e79fc7f1061cce81f77d2c973dc @@ -1399,6 +1506,23 @@ __metadata: languageName: node linkType: hard +"effect@npm:3.18.4": + version: 3.18.4 + resolution: "effect@npm:3.18.4" + dependencies: + "@standard-schema/spec": "npm:^1.0.0" + fast-check: "npm:^3.23.1" + checksum: 10c0/086603b2b4e13426b5230e65a8ed9da8db7f00918c2e2c783565b40d5e5f59050148900dd7c9eee56ea0ff2ea48c1dd7e95b0879e1b1025752fbd9027a830f36 + languageName: node + linkType: hard + +"empathic@npm:2.0.0": + version: 2.0.0 + resolution: "empathic@npm:2.0.0" + checksum: 10c0/7d3b14b04a93b35c47bcc950467ec914fd241cd9acc0269b0ea160f13026ec110f520c90fae64720fde72cc1757b57f3f292fb606617b7fccac1f4d008a76506 + languageName: node + linkType: hard + "encoding@npm:^0.1.13": version: 0.1.13 resolution: "encoding@npm:0.1.13" @@ -1759,6 +1883,22 @@ __metadata: languageName: node linkType: hard +"exsolve@npm:^1.0.7": + version: 1.0.8 + resolution: "exsolve@npm:1.0.8" + checksum: 10c0/65e44ae05bd4a4a5d87cfdbbd6b8f24389282cf9f85fa5feb17ca87ad3f354877e6af4cd99e02fc29044174891f82d1d68c77f69234410eb8f163530e6278c67 + languageName: node + linkType: hard + +"fast-check@npm:^3.23.1": + version: 3.23.2 + resolution: "fast-check@npm:3.23.2" + dependencies: + pure-rand: "npm:^6.1.0" + checksum: 10c0/16fcff3c80321ee765e23c3aebd0f6427f175c9c6c1753104ec658970162365dc2d56bda046d815e8f2e90634c07ba7d6f0bcfd327fbd576d98c56a18a9765ed + languageName: node + linkType: hard + "fast-content-type-parse@npm:^1.1.0": version: 1.1.0 resolution: "fast-content-type-parse@npm:1.1.0" @@ -2014,7 +2154,7 @@ __metadata: languageName: node linkType: hard -"fsevents@npm:2.3.3, fsevents@npm:~2.3.2": +"fsevents@npm:~2.3.2": version: 2.3.3 resolution: "fsevents@npm:2.3.3" dependencies: @@ -2033,7 +2173,7 @@ __metadata: languageName: node linkType: hard -"fsevents@patch:fsevents@npm%3A2.3.3#optional!builtin, fsevents@patch:fsevents@npm%3A~2.3.2#optional!builtin": +"fsevents@patch:fsevents@npm%3A~2.3.2#optional!builtin": version: 2.3.3 resolution: "fsevents@patch:fsevents@npm%3A2.3.3#optional!builtin::version=2.3.3&hash=df0bf1" dependencies: @@ -2056,6 +2196,22 @@ __metadata: languageName: node linkType: hard +"giget@npm:^2.0.0": + version: 2.0.0 + resolution: "giget@npm:2.0.0" + dependencies: + citty: "npm:^0.1.6" + consola: "npm:^3.4.0" + defu: "npm:^6.1.4" + node-fetch-native: "npm:^1.6.6" + nypm: "npm:^0.6.0" + pathe: "npm:^2.0.3" + bin: + giget: dist/cli.mjs + checksum: 10c0/606d81652643936ee7f76653b4dcebc09703524ff7fd19692634ce69e3fc6775a377760d7508162379451c03bf43cc6f46716aeadeb803f7cef3fc53d0671396 + languageName: node + linkType: hard + "glob-parent@npm:^6.0.2": version: 6.0.2 resolution: "glob-parent@npm:6.0.2" @@ -2319,6 +2475,15 @@ __metadata: languageName: node linkType: hard +"jiti@npm:^2.4.2": + version: 2.6.1 + resolution: "jiti@npm:2.6.1" + bin: + jiti: lib/jiti-cli.mjs + checksum: 10c0/79b2e96a8e623f66c1b703b98ec1b8be4500e1d217e09b09e343471bbb9c105381b83edbb979d01cef18318cc45ce6e153571b6c83122170eefa531c64b6789b + languageName: node + linkType: hard + "js-string-escape@npm:^1.0.1": version: 1.0.1 resolution: "js-string-escape@npm:1.0.1" @@ -2664,6 +2829,13 @@ __metadata: languageName: node linkType: hard +"node-fetch-native@npm:^1.6.6": + version: 1.6.7 + resolution: "node-fetch-native@npm:1.6.7" + checksum: 10c0/8b748300fb053d21ca4d3db9c3ff52593d5e8f8a2d9fe90cbfad159676e324b954fdaefab46aeca007b5b9edab3d150021c4846444e4e8ab1f4e44cd3807be87 + languageName: node + linkType: hard + "node-gyp@npm:latest": version: 12.2.0 resolution: "node-gyp@npm:12.2.0" @@ -2702,6 +2874,19 @@ __metadata: languageName: node linkType: hard +"nypm@npm:^0.6.0": + version: 0.6.5 + resolution: "nypm@npm:0.6.5" + dependencies: + citty: "npm:^0.2.0" + pathe: "npm:^2.0.3" + tinyexec: "npm:^1.0.2" + bin: + nypm: dist/cli.mjs + checksum: 10c0/47a945e83085dc34e8f92c19afb21fc36230d9186af071dffff6e727332c49eb2df1f9abbd71eabfa366cd00d4cf314ba41a202dd111e5c25c2c5f117808b8c7 + languageName: node + linkType: hard + "obliterator@npm:^2.0.1": version: 2.0.5 resolution: "obliterator@npm:2.0.5" @@ -2709,6 +2894,13 @@ __metadata: languageName: node linkType: hard +"ohash@npm:^2.0.11": + version: 2.0.11 + resolution: "ohash@npm:2.0.11" + checksum: 10c0/d07c8d79cc26da082c1a7c8d5b56c399dd4ed3b2bd069fcae6bae78c99a9bcc3ad813b1e1f49ca2f335292846d689c6141a762cf078727d2302a33d414e69c79 + languageName: node + linkType: hard + "on-exit-leak-free@npm:^2.1.0": version: 2.1.2 resolution: "on-exit-leak-free@npm:2.1.2" @@ -2841,6 +3033,13 @@ __metadata: languageName: node linkType: hard +"perfect-debounce@npm:^1.0.0": + version: 1.0.0 + resolution: "perfect-debounce@npm:1.0.0" + checksum: 10c0/e2baac416cae046ef1b270812cf9ccfb0f91c04ea36ac7f5b00bc84cb7f41bdbba087c0ab21b4e02a7ef3a1f1f6db399f137cecec46868bd7d8d88c2a9ee431f + languageName: node + linkType: hard + "picocolors@npm:^1.0.0, picocolors@npm:^1.1.1": version: 1.1.1 resolution: "picocolors@npm:1.1.1" @@ -2948,6 +3147,17 @@ __metadata: languageName: node linkType: hard +"pkg-types@npm:^2.2.0": + version: 2.3.0 + resolution: "pkg-types@npm:2.3.0" + dependencies: + confbox: "npm:^0.2.2" + exsolve: "npm:^1.0.7" + pathe: "npm:^2.0.3" + checksum: 10c0/d2bbddc5b81bd4741e1529c08ef4c5f1542bbdcf63498b73b8e1d84cff71806d1b8b1577800549bb569cb7aa20056257677b979bff48c97967cba7e64f72ae12 + languageName: node + linkType: hard + "playwright-core@npm:1.58.2": version: 1.58.2 resolution: "playwright-core@npm:1.58.2" @@ -3028,18 +3238,20 @@ __metadata: languageName: node linkType: hard -"prisma@npm:5.22.0": - version: 5.22.0 - resolution: "prisma@npm:5.22.0" +"prisma@npm:6.19.2": + version: 6.19.2 + resolution: "prisma@npm:6.19.2" dependencies: - "@prisma/engines": "npm:5.22.0" - fsevents: "npm:2.3.3" - dependenciesMeta: - fsevents: + "@prisma/config": "npm:6.19.2" + "@prisma/engines": "npm:6.19.2" + peerDependencies: + typescript: ">=5.1.0" + peerDependenciesMeta: + typescript: optional: true bin: prisma: build/index.js - checksum: 10c0/63d1fe828394d1a1fabc0d29245ae35be53c1bdb26da4dbcfaf17fba3733c1c120b72f28b548dba47b2b80ff7fad670717be1316c1ea4bb12ebe1937415a1ddb + checksum: 10c0/b7e78dab6e568dc1db78bd5ce60d61ef6116cb3889e84f6f397d80198681b052492ef3b96440519c8b61bef78448e9f23dae5b9f0c28d2949a0de15728ea7de6 languageName: node linkType: hard @@ -3098,6 +3310,13 @@ __metadata: languageName: node linkType: hard +"pure-rand@npm:^6.1.0": + version: 6.1.0 + resolution: "pure-rand@npm:6.1.0" + checksum: 10c0/1abe217897bf74dcb3a0c9aba3555fe975023147b48db540aa2faf507aee91c03bf54f6aef0eb2bf59cc259a16d06b28eca37f0dc426d94f4692aeff02fb0e65 + languageName: node + linkType: hard + "quasar-backend@workspace:backend": version: 0.0.0-use.local resolution: "quasar-backend@workspace:backend" @@ -3106,14 +3325,14 @@ __metadata: "@fastify/helmet": "npm:^11.0.0" "@fastify/multipart": "npm:^9.0.0" "@fastify/rate-limit": "npm:^9.0.0" - "@prisma/client": "npm:5.22.0" + "@prisma/client": "npm:6.19.2" "@types/node": "npm:^18.0.0" dotenv: "npm:^16.0.0" eslint: "npm:^8.0.0" fastify: "npm:^4.28.0" pino: "npm:^8.0.0" prettier: "npm:^2.8.0" - prisma: "npm:5.22.0" + prisma: "npm:6.19.2" ts-node-dev: "npm:^2.0.0" typescript: "npm:^5.2.0" vitest: "npm:^0.31.0" @@ -3151,6 +3370,16 @@ __metadata: languageName: node linkType: hard +"rc9@npm:^2.1.2": + version: 2.1.2 + resolution: "rc9@npm:2.1.2" + dependencies: + defu: "npm:^6.1.4" + destr: "npm:^2.0.3" + checksum: 10c0/a2ead3b94bf033e35e4ea40d70062a09feddb8f589c3f5a8fe4e9342976974296aee9f6e9e72bd5e78e6ae4b7bc16dc244f63699fd7322c16314e3238db982c9 + languageName: node + linkType: hard + "react-is@npm:^17.0.1": version: 17.0.2 resolution: "react-is@npm:17.0.2" @@ -3171,6 +3400,13 @@ __metadata: languageName: node linkType: hard +"readdirp@npm:^4.0.1": + version: 4.1.2 + resolution: "readdirp@npm:4.1.2" + checksum: 10c0/60a14f7619dec48c9c850255cd523e2717001b0e179dc7037cfa0895da7b9e9ab07532d324bfb118d73a710887d1e35f79c495fa91582784493e085d18c72c62 + languageName: node + linkType: hard + "readdirp@npm:~3.6.0": version: 3.6.0 resolution: "readdirp@npm:3.6.0" @@ -3608,6 +3844,13 @@ __metadata: languageName: node linkType: hard +"tinyexec@npm:^1.0.2": + version: 1.0.2 + resolution: "tinyexec@npm:1.0.2" + checksum: 10c0/1261a8e34c9b539a9aae3b7f0bb5372045ff28ee1eba035a2a059e532198fe1a182ec61ac60fa0b4a4129f0c4c4b1d2d57355b5cb9aa2d17ac9454ecace502ee + languageName: node + linkType: hard + "tinyglobby@npm:^0.2.12, tinyglobby@npm:^0.2.15": version: 0.2.15 resolution: "tinyglobby@npm:0.2.15"