From feac23708a417346ec6a62878285d4fd44ea67ef Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Thu, 20 Nov 2025 19:09:47 +0100 Subject: [PATCH 01/20] migrate to prisma 7.0 --- package-lock.json | 586 ++++++++++++++++++++++++++++++++++++-- package.json | 5 +- prisma-e2e/schema.prisma | 1 - prisma-main/schema.prisma | 2 - prisma.config.ts | 12 + 5 files changed, 573 insertions(+), 33 deletions(-) create mode 100644 prisma.config.ts diff --git a/package-lock.json b/package-lock.json index 5ae6aa5..95f7e3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,6 @@ "@codemirror/lang-markdown": "^6.5.0", "@codemirror/language-data": "^6.5.2", "@emotion/react": "^11.14.0", - "@prisma/client": "^6.19.0", "@snapp-notes/markdown-parser": "^0.1.2", "@uiw/codemirror-theme-basic": "^4.25.3", "@uiw/react-codemirror": "^4.25.3", @@ -33,7 +32,7 @@ "@eslint/eslintrc": "^3", "@jsdevtools/coverage-istanbul-loader": "^3.0.5", "@playwright/test": "^1.56.1", - "@prisma/client": "^6.19.0", + "@prisma/client": "^7.0.0", "@prisma/nextjs-monorepo-workaround-plugin": "^7.0.0", "@testing-library/jest-dom": "^6.9.1", "@testing-library/react": "^16.3.0", @@ -58,7 +57,7 @@ "nyc": "^17.1.0", "playwright-test-coverage": "^1.2.12", "prettier": "^3.6.2", - "prisma": "^6.19.0", + "prisma": "^7.0.0", "sqlite3": "^5.1.7", "typescript": "^5", "vitest": "^4.0.9" @@ -1205,6 +1204,43 @@ "react-dom": ">=18" } }, + "node_modules/@chevrotain/cst-dts-gen": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/@chevrotain/cst-dts-gen/-/cst-dts-gen-10.5.0.tgz", + "integrity": "sha512-lhmC/FyqQ2o7pGK4Om+hzuDrm9rhFYIJ/AXoQBeongmn870Xeb0L6oGEiuR8nohFNL5sMaQEJWCxr1oIVIVXrw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@chevrotain/gast": "10.5.0", + "@chevrotain/types": "10.5.0", + "lodash": "4.17.21" + } + }, + "node_modules/@chevrotain/gast": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/@chevrotain/gast/-/gast-10.5.0.tgz", + "integrity": "sha512-pXdMJ9XeDAbgOWKuD1Fldz4ieCs6+nLNmyVhe2gZVqoO7v8HXuHYs5OV2EzUtbuai37TlOAQHrTDvxMnvMJz3A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@chevrotain/types": "10.5.0", + "lodash": "4.17.21" + } + }, + "node_modules/@chevrotain/types": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-10.5.0.tgz", + "integrity": "sha512-f1MAia0x/pAVPWH/T73BJVyO2XU5tI4/iE7cnxb7tqdNTNhQI3Uq3XkqcoteTmD4t1aM0LbHCJOhgIDn07kl2A==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/@chevrotain/utils": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/@chevrotain/utils/-/utils-10.5.0.tgz", + "integrity": "sha512-hBzuU5+JjB2cqNZyszkDHZgOSrUUT8V3dhgRl8Q9Gp6dAj/H5+KILGjbhDpc3Iy9qmqlm/akuOI2ut9VUtzJxQ==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/@codemirror/autocomplete": { "version": "6.19.0", "license": "MIT", @@ -1695,6 +1731,37 @@ "node": ">=18" } }, + "node_modules/@electric-sql/pglite": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@electric-sql/pglite/-/pglite-0.3.2.tgz", + "integrity": "sha512-zfWWa+V2ViDCY/cmUfRqeWY1yLto+EpxjXnZzenB1TyxsTiXaTWeZFIZw6mac52BsuQm0RjCnisjBtdBaXOI6w==", + "dev": true, + "license": "Apache-2.0", + "peer": true + }, + "node_modules/@electric-sql/pglite-socket": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@electric-sql/pglite-socket/-/pglite-socket-0.0.6.tgz", + "integrity": "sha512-6RjmgzphIHIBA4NrMGJsjNWK4pu+bCWJlEWlwcxFTVY3WT86dFpKwbZaGWZV6C5Rd7sCk1Z0CI76QEfukLAUXw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "pglite-server": "dist/scripts/server.js" + }, + "peerDependencies": { + "@electric-sql/pglite": "0.3.2" + } + }, + "node_modules/@electric-sql/pglite-tools": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@electric-sql/pglite-tools/-/pglite-tools-0.2.7.tgz", + "integrity": "sha512-9dAccClqxx4cZB+Ar9B+FZ5WgxDc/Xvl9DPrTWv+dYTf0YNubLzi4wHHRGRGhrJv15XwnyKcGOZAP1VXSneSUg==", + "dev": true, + "license": "Apache-2.0", + "peerDependencies": { + "@electric-sql/pglite": "0.3.2" + } + }, "node_modules/@emotion/babel-plugin": { "version": "11.13.5", "license": "MIT", @@ -1960,6 +2027,19 @@ "version": "1.1.28", "license": "MIT" }, + "node_modules/@hono/node-server": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.14.2.tgz", + "integrity": "sha512-GHjpOeHYbr9d1vkID2sNUYkl5IxumyhDrUJB7wBp7jvqYwPFt+oNKsAPBRcdSbV7kIrXhouLE199ks1QcK4r7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.14.1" + }, + "peerDependencies": { + "hono": "^4" + } + }, "node_modules/@humanfs/core": { "version": "0.19.1", "dev": true, @@ -2395,6 +2475,20 @@ "version": "1.0.2", "license": "MIT" }, + "node_modules/@mrleebo/prisma-ast": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/@mrleebo/prisma-ast/-/prisma-ast-0.12.1.tgz", + "integrity": "sha512-JwqeCQ1U3fvccttHZq7Tk0m/TMC6WcFAQZdukypW3AzlJYKYTGNVd1ANU2GuhKnv4UQuOFj3oAl0LLG/gxFN1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "chevrotain": "^10.5.0", + "lilconfig": "^2.1.0" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/@next/env": { "version": "16.0.3", "resolved": "https://registry.npmjs.org/@next/env/-/env-16.0.3.tgz", @@ -2774,16 +2868,20 @@ } }, "node_modules/@prisma/client": { - "version": "6.19.0", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-7.0.0.tgz", + "integrity": "sha512-FM1NtJezl0zH3CybLxcbJwShJt7xFGSRg+1tGhy3sCB8goUDnxnBR+RC/P35EAW8gjkzx7kgz7bvb0MerY2VSw==", "dev": true, - "hasInstallScript": true, "license": "Apache-2.0", + "dependencies": { + "@prisma/client-runtime-utils": "7.0.0" + }, "engines": { - "node": ">=18.18" + "node": "^20.19 || ^22.12 || ^24.0" }, "peerDependencies": { "prisma": "*", - "typescript": ">=5.1.0" + "typescript": ">=5.4.0" }, "peerDependenciesMeta": { "prisma": { @@ -2794,8 +2892,17 @@ } } }, + "node_modules/@prisma/client-runtime-utils": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@prisma/client-runtime-utils/-/client-runtime-utils-7.0.0.tgz", + "integrity": "sha512-PAiFgMBPrLSaakBwUpML5NevipuKSL3rtNr8pZ8CZ3OBXo0BFcdeGcBIKw/CxJP6H4GNa4+l5bzJPrk8Iq6tDw==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/@prisma/config": { - "version": "6.19.0", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@prisma/config/-/config-7.0.0.tgz", + "integrity": "sha512-TDASB57hyGUwHB0IPCSkoJcXFrJOKA1+R/1o4np4PbS+E0F5MiY5aAyUttO0mSuNQaX7t8VH/GkDemffF1mQzg==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -2806,45 +2913,115 @@ } }, "node_modules/@prisma/debug": { - "version": "6.19.0", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-7.0.0.tgz", + "integrity": "sha512-SdS3qzfMASHtWimywtkiRcJtrHzacbmMVhElko3DYUZSB0TTLqRYWpddRBJdeGgSLmy1FD55p7uGzIJ+MtfhMg==", "dev": true, "license": "Apache-2.0" }, + "node_modules/@prisma/dev": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@prisma/dev/-/dev-0.13.0.tgz", + "integrity": "sha512-QMmF6zFeUF78yv1HYbHvod83AQnl7u6NtKyDhTRZOJup3h1icWs8R7RUVxBJZvM2tBXNAMpLQYYM/8kPlOPegA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@electric-sql/pglite": "0.3.2", + "@electric-sql/pglite-socket": "0.0.6", + "@electric-sql/pglite-tools": "0.2.7", + "@hono/node-server": "1.14.2", + "@mrleebo/prisma-ast": "0.12.1", + "@prisma/get-platform": "6.8.2", + "@prisma/query-plan-executor": "6.18.0", + "foreground-child": "3.3.1", + "get-port-please": "3.1.2", + "hono": "4.7.10", + "http-status-codes": "2.3.0", + "pathe": "2.0.3", + "proper-lockfile": "4.1.2", + "remeda": "2.21.3", + "std-env": "3.9.0", + "valibot": "1.1.0", + "zeptomatch": "2.0.2" + } + }, + "node_modules/@prisma/dev/node_modules/std-env": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.9.0.tgz", + "integrity": "sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==", + "dev": true, + "license": "MIT" + }, "node_modules/@prisma/engines": { - "version": "6.19.0", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-7.0.0.tgz", + "integrity": "sha512-ojCL3OFLMCz33UbU9XwH32jwaeM+dWb8cysTuY8eK6ZlMKXJdy6ogrdG3MGB3meKLGdQBmOpUUGJ7eLIaxbrcg==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.19.0", - "@prisma/engines-version": "6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773", - "@prisma/fetch-engine": "6.19.0", - "@prisma/get-platform": "6.19.0" + "@prisma/debug": "7.0.0", + "@prisma/engines-version": "6.20.0-16.next-0c19ccc313cf9911a90d99d2ac2eb0280c76c513", + "@prisma/fetch-engine": "7.0.0", + "@prisma/get-platform": "7.0.0" } }, "node_modules/@prisma/engines-version": { - "version": "6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773", + "version": "6.20.0-16.next-0c19ccc313cf9911a90d99d2ac2eb0280c76c513", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.20.0-16.next-0c19ccc313cf9911a90d99d2ac2eb0280c76c513.tgz", + "integrity": "sha512-7bzyN8Gp9GbDFbTDzVUH9nFcgRWvsWmjrGgBJvIC/zEoAuv/lx62gZXgAKfjn/HoPkxz/dS+TtsnduFx8WA+cw==", "dev": true, "license": "Apache-2.0" }, + "node_modules/@prisma/engines/node_modules/@prisma/get-platform": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-7.0.0.tgz", + "integrity": "sha512-zyhzrAa+y/GfyCzTnuk0D9lfkvDzo7IbsNyuhTqhPu/AN0txm0x26HAR4tJLismla/fHf5fBzYwSivYSzkpakg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "7.0.0" + } + }, "node_modules/@prisma/fetch-engine": { - "version": "6.19.0", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-7.0.0.tgz", + "integrity": "sha512-qcyWTeWDjVDaDQSrVIymZU1xCYlvmwCzjA395lIuFjUESOH3YQCb8i/hpd4vopfq3fUR4v6+MjjtIGvnmErQgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "7.0.0", + "@prisma/engines-version": "6.20.0-16.next-0c19ccc313cf9911a90d99d2ac2eb0280c76c513", + "@prisma/get-platform": "7.0.0" + } + }, + "node_modules/@prisma/fetch-engine/node_modules/@prisma/get-platform": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-7.0.0.tgz", + "integrity": "sha512-zyhzrAa+y/GfyCzTnuk0D9lfkvDzo7IbsNyuhTqhPu/AN0txm0x26HAR4tJLismla/fHf5fBzYwSivYSzkpakg==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.19.0", - "@prisma/engines-version": "6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773", - "@prisma/get-platform": "6.19.0" + "@prisma/debug": "7.0.0" } }, "node_modules/@prisma/get-platform": { - "version": "6.19.0", + "version": "6.8.2", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.8.2.tgz", + "integrity": "sha512-vXSxyUgX3vm1Q70QwzwkjeYfRryIvKno1SXbIqwSptKwqKzskINnDUcx85oX+ys6ooN2ATGSD0xN2UTfg6Zcow==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@prisma/debug": "6.19.0" + "@prisma/debug": "6.8.2" } }, + "node_modules/@prisma/get-platform/node_modules/@prisma/debug": { + "version": "6.8.2", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.8.2.tgz", + "integrity": "sha512-4muBSSUwJJ9BYth5N8tqts8JtiLT8QI/RSAzEogwEfpbYGFo9mYsInsVo8dqXdPO2+Rm5OG5q0qWDDE3nyUbVg==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/@prisma/nextjs-monorepo-workaround-plugin": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@prisma/nextjs-monorepo-workaround-plugin/-/nextjs-monorepo-workaround-plugin-7.0.0.tgz", @@ -2852,6 +3029,25 @@ "dev": true, "license": "Apache-2.0" }, + "node_modules/@prisma/query-plan-executor": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@prisma/query-plan-executor/-/query-plan-executor-6.18.0.tgz", + "integrity": "sha512-jZ8cfzFgL0jReE1R10gT8JLHtQxjWYLiQ//wHmVYZ2rVkFHoh0DT8IXsxcKcFlfKN7ak7k6j0XMNn2xVNyr5cA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/@prisma/studio-core-licensed": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@prisma/studio-core-licensed/-/studio-core-licensed-0.8.0.tgz", + "integrity": "sha512-SXCcgFvo/SC6/11kEOaQghJgCWNEWZUvPYKn/gpvMB9HLSG/5M8If7dWZtEQHhchvl8bh9A89Hw6mEKpsXFimA==", + "dev": true, + "license": "UNLICENSED", + "peerDependencies": { + "@types/react": "^18.0.0 || ^19.0.0", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + } + }, "node_modules/@rolldown/pluginutils": { "version": "1.0.0-beta.47", "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.47.tgz", @@ -5336,6 +5532,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/aws-ssl-profiles": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz", + "integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/axe-core": { "version": "4.10.3", "dev": true, @@ -5496,6 +5702,7 @@ "dev": true, "hasInstallScript": true, "license": "MIT", + "peer": true, "dependencies": { "bindings": "^1.5.0", "prebuild-install": "^7.1.1" @@ -5628,6 +5835,8 @@ }, "node_modules/c12": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/c12/-/c12-3.1.0.tgz", + "integrity": "sha512-uWoS8OU1MEIsOv8p/5a82c3H31LsWVR5qiyXVfBNOzfffjUWtPnhAb4BYI2uG2HfGmZmFjCtui5XNWaps+iFuw==", "dev": true, "license": "MIT", "dependencies": { @@ -5850,8 +6059,25 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/chevrotain": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-10.5.0.tgz", + "integrity": "sha512-Pkv5rBY3+CsHOYfV5g/Vs5JY9WTHHDEKOlohI2XeygaZhUeqhAlldZ8Hz9cRmxu709bvS08YzxHdTPHhffc13A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@chevrotain/cst-dts-gen": "10.5.0", + "@chevrotain/gast": "10.5.0", + "@chevrotain/types": "10.5.0", + "@chevrotain/utils": "10.5.0", + "lodash": "4.17.21", + "regexp-to-ast": "0.5.0" + } + }, "node_modules/chokidar": { "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", "dev": true, "license": "MIT", "dependencies": { @@ -5874,6 +6100,8 @@ }, "node_modules/citty": { "version": "0.1.6", + "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.6.tgz", + "integrity": "sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6104,11 +6332,15 @@ }, "node_modules/confbox": { "version": "0.2.2", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.2.tgz", + "integrity": "sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==", "dev": true, "license": "MIT" }, "node_modules/consola": { "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", "dev": true, "license": "MIT", "engines": { @@ -6332,6 +6564,8 @@ }, "node_modules/deepmerge-ts": { "version": "7.1.5", + "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-7.1.5.tgz", + "integrity": "sha512-HOJkrhaYsweh+W+e74Yn7YStZOilkoPb6fycpwNLKzSPtruFs48nYis0zy5yJz1+ktUhHxoRDJ27RQAWLIJVJw==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -6402,6 +6636,16 @@ "license": "MIT", "optional": true }, + "node_modules/denque": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=0.10" + } + }, "node_modules/dequal": { "version": "2.0.3", "dev": true, @@ -6412,6 +6656,8 @@ }, "node_modules/destr": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.5.tgz", + "integrity": "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==", "dev": true, "license": "MIT" }, @@ -6441,6 +6687,8 @@ }, "node_modules/dotenv": { "version": "16.6.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", "dev": true, "license": "BSD-2-Clause", "engines": { @@ -6465,6 +6713,8 @@ }, "node_modules/effect": { "version": "3.18.4", + "resolved": "https://registry.npmjs.org/effect/-/effect-3.18.4.tgz", + "integrity": "sha512-b1LXQJLe9D11wfnOKAk3PKxuqYshQ0Heez+y5pnkd3jLj1yx9QhM72zZ9uUrOQyNvrs2GZZd/3maL0ZV18YuDA==", "dev": true, "license": "MIT", "dependencies": { @@ -6492,6 +6742,8 @@ }, "node_modules/empathic": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/empathic/-/empathic-2.0.0.tgz", + "integrity": "sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==", "dev": true, "license": "MIT", "engines": { @@ -7226,11 +7478,15 @@ }, "node_modules/exsolve": { "version": "1.0.8", + "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.0.8.tgz", + "integrity": "sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA==", "dev": true, "license": "MIT" }, "node_modules/fast-check": { "version": "3.23.2", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.23.2.tgz", + "integrity": "sha512-h5+1OzzfCC3Ef7VbtKdcv7zsstUQwUDlYpUTvjeUsJAssPgLn7QzbboPtL5ro04Mq0rPOsMzl7q5hIbRs2wD1A==", "dev": true, "funding": [ { @@ -7570,6 +7826,16 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-property": "^1.0.2" + } + }, "node_modules/gensync": { "version": "1.0.0-beta.2", "dev": true, @@ -7617,6 +7883,13 @@ "node": ">=8.0.0" } }, + "node_modules/get-port-please": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/get-port-please/-/get-port-please-3.1.2.tgz", + "integrity": "sha512-Gxc29eLs1fbn6LQ4jSU4vXjlwyZhF5HsGuMAa7gqBP4Rw4yxxltyDUuF5MBclFzDTXO+ACchGQoeela4DSfzdQ==", + "dev": true, + "license": "MIT" + }, "node_modules/get-proto": { "version": "1.0.1", "dev": true, @@ -7658,6 +7931,8 @@ }, "node_modules/giget": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/giget/-/giget-2.0.0.tgz", + "integrity": "sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA==", "dev": true, "license": "MIT", "dependencies": { @@ -7756,6 +8031,13 @@ "dev": true, "license": "ISC" }, + "node_modules/grammex": { + "version": "3.1.11", + "resolved": "https://registry.npmjs.org/grammex/-/grammex-3.1.11.tgz", + "integrity": "sha512-HNwLkgRg9SqTAd1N3Uh/MnKwTBTzwBxTOPbXQ8pb0tpwydjk90k4zRE8JUn9fMUiRwKtXFZ1TWFmms3dZHN+Fg==", + "dev": true, + "license": "MIT" + }, "node_modules/graphemer": { "version": "1.4.0", "dev": true, @@ -7900,6 +8182,17 @@ "react-is": "^16.7.0" } }, + "node_modules/hono": { + "version": "4.7.10", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.7.10.tgz", + "integrity": "sha512-QkACju9MiN59CKSY5JsGZCYmPZkA6sIW6OFCUp7qDjZu6S6KHtJHhAc9Uy9mV9F8PJ1/HQ3ybZF2yjCa/73fvQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=16.9.0" + } + }, "node_modules/html-encoding-sniffer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", @@ -7938,6 +8231,13 @@ "node": ">= 14" } }, + "node_modules/http-status-codes": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/http-status-codes/-/http-status-codes-2.3.0.tgz", + "integrity": "sha512-RJ8XvFvpPM/Dmc5SV+dC4y5PCeOhT3x1Hq0NU3rjGeg5a/CqlhZ7uudknPwZFz4aeAXDcbAyaeP7GAo9lvngtA==", + "dev": true, + "license": "MIT" + }, "node_modules/https-proxy-agent": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", @@ -8322,6 +8622,13 @@ "dev": true, "license": "MIT" }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==", + "dev": true, + "license": "MIT" + }, "node_modules/is-regex": { "version": "1.2.1", "dev": true, @@ -8860,6 +9167,16 @@ "node": ">= 0.8.0" } }, + "node_modules/lilconfig": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/lines-and-columns": { "version": "1.2.4", "license": "MIT" @@ -8902,6 +9219,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, "node_modules/lodash.flattendeep": { "version": "4.4.0", "dev": true, @@ -8912,6 +9236,13 @@ "dev": true, "license": "MIT" }, + "node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/loose-envify": { "version": "1.4.0", "dev": true, @@ -8931,6 +9262,22 @@ "yallist": "^3.0.2" } }, + "node_modules/lru.min": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.3.tgz", + "integrity": "sha512-Lkk/vx6ak3rYkRR0Nhu4lFUT2VDnQSxBe8Hbl7f36358p6ow8Bnvr8lrLt98H8J1aGxfhbX4Fs5tYg2+FTwr5Q==", + "dev": true, + "license": "MIT", + "engines": { + "bun": ">=1.0.0", + "deno": ">=1.30.0", + "node": ">=8.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wellwelwel" + } + }, "node_modules/lz-string": { "version": "1.5.0", "dev": true, @@ -9351,6 +9698,67 @@ "version": "2.1.3", "license": "MIT" }, + "node_modules/mysql2": { + "version": "3.15.3", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.15.3.tgz", + "integrity": "sha512-FBrGau0IXmuqg4haEZRBfHNWB5mUARw6hNwPDXXGg0XzVJ50mr/9hb267lvpVMnhZ1FON3qNd4Xfcez1rbFwSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "aws-ssl-profiles": "^1.1.1", + "denque": "^2.1.0", + "generate-function": "^2.3.1", + "iconv-lite": "^0.7.0", + "long": "^5.2.1", + "lru.min": "^1.0.0", + "named-placeholders": "^1.1.3", + "seq-queue": "^0.0.5", + "sqlstring": "^2.3.2" + }, + "engines": { + "node": ">= 8.0" + } + }, + "node_modules/mysql2/node_modules/iconv-lite": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.0.tgz", + "integrity": "sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", + "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/named-placeholders/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/nanoid": { "version": "3.3.11", "funding": [ @@ -9495,6 +9903,8 @@ }, "node_modules/node-fetch-native": { "version": "1.6.7", + "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.7.tgz", + "integrity": "sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==", "dev": true, "license": "MIT" }, @@ -9781,6 +10191,8 @@ }, "node_modules/nypm": { "version": "0.6.2", + "resolved": "https://registry.npmjs.org/nypm/-/nypm-0.6.2.tgz", + "integrity": "sha512-7eM+hpOtrKrBDCh7Ypu2lJ9Z7PNZBdi/8AT3AX8xoCj43BBVHD0hPSTEvMtkMpfs8FCqBGhxB+uToIQimA111g==", "dev": true, "license": "MIT", "dependencies": { @@ -9799,6 +10211,8 @@ }, "node_modules/nypm/node_modules/tinyexec": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.2.tgz", + "integrity": "sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==", "dev": true, "license": "MIT", "engines": { @@ -9914,6 +10328,8 @@ }, "node_modules/ohash": { "version": "2.0.11", + "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.11.tgz", + "integrity": "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==", "dev": true, "license": "MIT" }, @@ -10103,6 +10519,8 @@ }, "node_modules/perfect-debounce": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-1.0.0.tgz", + "integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==", "dev": true, "license": "MIT" }, @@ -10186,6 +10604,8 @@ }, "node_modules/pkg-types": { "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.0.tgz", + "integrity": "sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==", "dev": true, "license": "MIT", "dependencies": { @@ -10266,6 +10686,20 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/postgres": { + "version": "3.4.7", + "resolved": "https://registry.npmjs.org/postgres/-/postgres-3.4.7.tgz", + "integrity": "sha512-Jtc2612XINuBjIl/QTWsV5UvE8UHuNblcO3vVADSrKsrc6RqGX6lOW1cEo3CM2v0XG4Nat8nI+YM7/f26VxXLw==", + "dev": true, + "license": "Unlicense", + "engines": { + "node": ">=12" + }, + "funding": { + "type": "individual", + "url": "https://github.com/sponsors/porsager" + } + }, "node_modules/prebuild-install": { "version": "7.1.3", "dev": true, @@ -10343,25 +10777,35 @@ "license": "MIT" }, "node_modules/prisma": { - "version": "6.19.0", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-7.0.0.tgz", + "integrity": "sha512-VZObZ1pQV/OScarYg68RYUx61GpFLH2mJGf9fUX4XxQxTst/6ZK7nkY86CSZ3zBW6U9lKRTsBrZWVz20X5G/KQ==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", "peer": true, "dependencies": { - "@prisma/config": "6.19.0", - "@prisma/engines": "6.19.0" + "@prisma/config": "7.0.0", + "@prisma/dev": "0.13.0", + "@prisma/engines": "7.0.0", + "@prisma/studio-core-licensed": "0.8.0", + "mysql2": "3.15.3", + "postgres": "3.4.7" }, "bin": { "prisma": "build/index.js" }, "engines": { - "node": ">=18.18" + "node": "^20.19 || ^22.12 || ^24.0" }, "peerDependencies": { - "typescript": ">=5.1.0" + "better-sqlite3": ">=9.0.0", + "typescript": ">=5.4.0" }, "peerDependenciesMeta": { + "better-sqlite3": { + "optional": true + }, "typescript": { "optional": true } @@ -10412,6 +10856,18 @@ "react-is": "^16.13.1" } }, + "node_modules/proper-lockfile": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz", + "integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "retry": "^0.12.0", + "signal-exit": "^3.0.2" + } + }, "node_modules/proxy-compare": { "version": "3.0.1", "license": "MIT" @@ -10442,6 +10898,8 @@ }, "node_modules/pure-rand": { "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", "dev": true, "funding": [ { @@ -10512,6 +10970,8 @@ }, "node_modules/rc9": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/rc9/-/rc9-2.1.2.tgz", + "integrity": "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==", "dev": true, "license": "MIT", "dependencies": { @@ -10574,6 +11034,8 @@ }, "node_modules/readdirp": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", "dev": true, "license": "MIT", "engines": { @@ -10621,6 +11083,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/regexp-to-ast": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/regexp-to-ast/-/regexp-to-ast-0.5.0.tgz", + "integrity": "sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw==", + "dev": true, + "license": "MIT" + }, "node_modules/regexp.prototype.flags": { "version": "1.5.4", "dev": true, @@ -10651,6 +11120,29 @@ "node": ">=4" } }, + "node_modules/remeda": { + "version": "2.21.3", + "resolved": "https://registry.npmjs.org/remeda/-/remeda-2.21.3.tgz", + "integrity": "sha512-XXrZdLA10oEOQhLLzEJEiFFSKi21REGAkHdImIb4rt/XXy8ORGXh5HCcpUOsElfPNDb+X6TA/+wkh+p2KffYmg==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^4.39.1" + } + }, + "node_modules/remeda/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/require-directory": { "version": "2.1.1", "dev": true, @@ -10711,7 +11203,6 @@ "version": "0.12.0", "dev": true, "license": "MIT", - "optional": true, "engines": { "node": ">= 4" } @@ -10933,6 +11424,12 @@ "node": ">=10" } }, + "node_modules/seq-queue": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", + "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==", + "dev": true + }, "node_modules/set-blocking": { "version": "2.0.0", "dev": true, @@ -11323,6 +11820,16 @@ } } }, + "node_modules/sqlstring": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", + "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/ssri": { "version": "8.0.1", "dev": true, @@ -12146,6 +12653,21 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/valibot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/valibot/-/valibot-1.1.0.tgz", + "integrity": "sha512-Nk8lX30Qhu+9txPYTwM0cFlWLdPFsFr6LblzqIySfbZph9+BFsAHsNvHOymEviUepeIW6KFHzpX8TKhbptBXXw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "typescript": ">=5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/vite": { "version": "7.1.11", "dev": true, @@ -12735,6 +13257,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/zeptomatch": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/zeptomatch/-/zeptomatch-2.0.2.tgz", + "integrity": "sha512-H33jtSKf8Ijtb5BW6wua3G5DhnFjbFML36eFu+VdOoVY4HD9e7ggjqdM6639B+L87rjnR6Y+XeRzBXZdy52B/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "grammex": "^3.1.10" + } + }, "node_modules/zod": { "version": "4.1.12", "license": "MIT", diff --git a/package.json b/package.json index d9764b8..59bd984 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "@codemirror/lang-markdown": "^6.5.0", "@codemirror/language-data": "^6.5.2", "@emotion/react": "^11.14.0", - "@prisma/client": "^6.19.0", "@snapp-notes/markdown-parser": "^0.1.2", "@uiw/codemirror-theme-basic": "^4.25.3", "@uiw/react-codemirror": "^4.25.3", @@ -56,7 +55,7 @@ "@eslint/eslintrc": "^3", "@jsdevtools/coverage-istanbul-loader": "^3.0.5", "@playwright/test": "^1.56.1", - "@prisma/client": "^6.19.0", + "@prisma/client": "^7.0.0", "@prisma/nextjs-monorepo-workaround-plugin": "^7.0.0", "@testing-library/jest-dom": "^6.9.1", "@testing-library/react": "^16.3.0", @@ -81,7 +80,7 @@ "nyc": "^17.1.0", "playwright-test-coverage": "^1.2.12", "prettier": "^3.6.2", - "prisma": "^6.19.0", + "prisma": "^7.0.0", "sqlite3": "^5.1.7", "typescript": "^5", "vitest": "^4.0.9" diff --git a/prisma-e2e/schema.prisma b/prisma-e2e/schema.prisma index 5d97cce..698b223 100644 --- a/prisma-e2e/schema.prisma +++ b/prisma-e2e/schema.prisma @@ -5,7 +5,6 @@ generator client { datasource db { provider = "sqlite" - url = "file:./test.db" } model User { diff --git a/prisma-main/schema.prisma b/prisma-main/schema.prisma index 6f2c3e9..66f654a 100644 --- a/prisma-main/schema.prisma +++ b/prisma-main/schema.prisma @@ -6,8 +6,6 @@ generator client { datasource db { provider = "mysql" - url = env("DATABASE_URL") - shadowDatabaseUrl = env("SHADOW_DATABASE_URL") } model User { diff --git a/prisma.config.ts b/prisma.config.ts new file mode 100644 index 0000000..ec87f57 --- /dev/null +++ b/prisma.config.ts @@ -0,0 +1,12 @@ +import 'dotenv/config'; +import path from 'node:path'; +import { defineConfig, env } from 'prisma/config'; +export default defineConfig({ + datasource: process.env.CI === 'true' ? { + url: 'file:./test.db' + } : { + url: env('DATABASE_URL'), + shadowDatabaseUrl: env('SHADOW_DATABASE_URL') + }, + schema: path.join(process.env.CI ? 'prisma-e2e' : 'prisma-main', 'schema.prisma'), +}); From 733fd8755b58bf41129d4db12d8067f00a7ee1ef Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Thu, 20 Nov 2025 19:21:02 +0100 Subject: [PATCH 02/20] disable deploy job on PR/forks --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c127a44..bf0adc4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,8 @@ name: 'Test & Deploy' on: workflow_dispatch: push: + branches: + - master paths: - 'src/**' - 'e2e/**' @@ -197,6 +199,7 @@ jobs: retention-days: 1 deploy: + if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' runs-on: ubuntu-latest needs: [unit-integration-tests, e2e-tests] env: From 68d8175791e851a6c9ca8edfcae46d226087ac95 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Thu, 20 Nov 2025 19:38:30 +0100 Subject: [PATCH 03/20] update GitHub workflow --- .github/workflows/test.yml | 72 +++++++++++++++++++++++++++++++++++--- 1 file changed, 68 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bf0adc4..9f74b2d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,6 +22,7 @@ on: - '!**.md' - '!.ai/**' pull_request: + types: [opened, synchronize, reopened] paths: - 'src/**' - 'e2e/**' @@ -199,7 +200,7 @@ jobs: retention-days: 1 deploy: - if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' + if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest needs: [unit-integration-tests, e2e-tests] env: @@ -212,17 +213,80 @@ jobs: - name: Install Vercel CLI run: npm install --global vercel@latest - - name: Pull Vercel Environment Information + - name: Pull Vercel Environment Information (Production) + if: github.event_name == 'push' && github.ref == 'refs/heads/master' run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - - name: Build Project Artifacts + - name: Pull Vercel Environment Information (Preview) + if: github.event_name == 'pull_request' + run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} + + - name: Build Project Artifacts (Production) + if: github.event_name == 'push' && github.ref == 'refs/heads/master' run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} - - name: Deploy Project Artifacts to Vercel + - name: Build Project Artifacts (Preview) + if: github.event_name == 'pull_request' + run: vercel build --token=${{ secrets.VERCEL_TOKEN }} + + - name: Deploy Project Artifacts to Vercel (Production) + if: github.event_name == 'push' && github.ref == 'refs/heads/master' run: | url="$(vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }})" vercel alias --scope jcubics-projects --token=${{ secrets.VERCEL_TOKEN }} set "$url" app.snapp.md + - name: Deploy Project Artifacts to Vercel (Preview) + if: github.event_name == 'pull_request' + id: deploy-preview + run: | + url="$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})" + echo "preview_url=$url" >> $GITHUB_OUTPUT + + - name: Comment PR with preview URL + if: github.event_name == 'pull_request' + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const previewUrl = '${{ steps.deploy-preview.outputs.preview_url }}'; + const comment = `## 🚀 Preview Deployment + + Your preview deployment is ready! + + ✅ **Preview URL:** ${previewUrl} + + --- + *This preview will be updated automatically when you push new commits to this PR.*`; + + // Find existing comment + const { data: comments } = await github.rest.issues.listComments({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + }); + + const botComment = comments.find(comment => + comment.user.type === 'Bot' && + comment.body.includes('Preview Deployment') + ); + + // Update or create comment + if (botComment) { + await github.rest.issues.updateComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: botComment.id, + body: comment + }); + } else { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: comment + }); + } + merge-coverage: runs-on: ubuntu-latest needs: [unit-integration-tests, e2e-tests] From d7a56a039faf361c475f02e151eba19ce10657e5 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Thu, 20 Nov 2025 19:42:43 +0100 Subject: [PATCH 04/20] fix prisma --- prisma-e2e/schema.prisma | 2 +- prisma-main/schema.prisma | 2 +- prisma.config.ts | 17 ++++++++++------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/prisma-e2e/schema.prisma b/prisma-e2e/schema.prisma index 698b223..bdbfcfd 100644 --- a/prisma-e2e/schema.prisma +++ b/prisma-e2e/schema.prisma @@ -1,5 +1,5 @@ generator client { - provider = "prisma-client-js" + provider = "prisma-client" output = "../prisma-e2e/types" } diff --git a/prisma-main/schema.prisma b/prisma-main/schema.prisma index 66f654a..7f37263 100644 --- a/prisma-main/schema.prisma +++ b/prisma-main/schema.prisma @@ -1,5 +1,5 @@ generator client { - provider = "prisma-client-js" + provider = "prisma-client" output = "../prisma-main/types" binaryTargets = ["native", "linux-musl", "rhel-openssl-3.0.x"] } diff --git a/prisma.config.ts b/prisma.config.ts index ec87f57..ac7bec6 100644 --- a/prisma.config.ts +++ b/prisma.config.ts @@ -2,11 +2,14 @@ import 'dotenv/config'; import path from 'node:path'; import { defineConfig, env } from 'prisma/config'; export default defineConfig({ - datasource: process.env.CI === 'true' ? { - url: 'file:./test.db' - } : { - url: env('DATABASE_URL'), - shadowDatabaseUrl: env('SHADOW_DATABASE_URL') - }, - schema: path.join(process.env.CI ? 'prisma-e2e' : 'prisma-main', 'schema.prisma'), + datasource: + process.env.CI === 'true' + ? { + url: 'file:./test.db' + } + : { + url: env('DATABASE_URL'), + shadowDatabaseUrl: env('SHADOW_DATABASE_URL') + }, + schema: path.join(process.env.CI ? 'prisma-e2e' : 'prisma-main', 'schema.prisma') }); From 31725d0d1b829c3f665aeadea8df202d128fc09b Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Thu, 20 Nov 2025 19:48:26 +0100 Subject: [PATCH 05/20] remove an option from prisma command --- e2e/setup-e2e-db.js | 2 +- src/test/global-setup.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/setup-e2e-db.js b/e2e/setup-e2e-db.js index 421550b..5abfd94 100755 --- a/e2e/setup-e2e-db.js +++ b/e2e/setup-e2e-db.js @@ -25,7 +25,7 @@ execSync('npx prisma generate --schema=prisma-e2e/schema.prisma', { }); console.log('Creating E2E test database...'); -execSync('npx prisma db push --skip-generate --schema=prisma-e2e/schema.prisma', { +execSync('npx prisma db push --schema=prisma-e2e/schema.prisma', { stdio: 'inherit', env: { ...process.env } }); diff --git a/src/test/global-setup.ts b/src/test/global-setup.ts index f9bbdb6..5c60069 100644 --- a/src/test/global-setup.ts +++ b/src/test/global-setup.ts @@ -24,7 +24,7 @@ export async function setup() { fs.writeFileSync(TEMP_SCHEMA_PATH, modifiedSchema); try { - execSync(`npx prisma db push --skip-generate --schema=${TEMP_SCHEMA_PATH}`, { + execSync(`npx prisma db push --schema=${TEMP_SCHEMA_PATH}`, { stdio: 'pipe', encoding: 'utf-8' }); From 902b48161f42cc91b72b2bafdf5a5de2f3f9f9c6 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Thu, 20 Nov 2025 19:51:40 +0100 Subject: [PATCH 06/20] fix @prisma/client dependency type --- package-lock.json | 178 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 89 insertions(+), 91 deletions(-) diff --git a/package-lock.json b/package-lock.json index 95f7e3d..525ef15 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@codemirror/lang-markdown": "^6.5.0", "@codemirror/language-data": "^6.5.2", "@emotion/react": "^11.14.0", + "@prisma/client": "^7.0.0", "@snapp-notes/markdown-parser": "^0.1.2", "@uiw/codemirror-theme-basic": "^4.25.3", "@uiw/react-codemirror": "^4.25.3", @@ -32,7 +33,6 @@ "@eslint/eslintrc": "^3", "@jsdevtools/coverage-istanbul-loader": "^3.0.5", "@playwright/test": "^1.56.1", - "@prisma/client": "^7.0.0", "@prisma/nextjs-monorepo-workaround-plugin": "^7.0.0", "@testing-library/jest-dom": "^6.9.1", "@testing-library/react": "^16.3.0", @@ -1208,7 +1208,7 @@ "version": "10.5.0", "resolved": "https://registry.npmjs.org/@chevrotain/cst-dts-gen/-/cst-dts-gen-10.5.0.tgz", "integrity": "sha512-lhmC/FyqQ2o7pGK4Om+hzuDrm9rhFYIJ/AXoQBeongmn870Xeb0L6oGEiuR8nohFNL5sMaQEJWCxr1oIVIVXrw==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "dependencies": { "@chevrotain/gast": "10.5.0", @@ -1220,7 +1220,7 @@ "version": "10.5.0", "resolved": "https://registry.npmjs.org/@chevrotain/gast/-/gast-10.5.0.tgz", "integrity": "sha512-pXdMJ9XeDAbgOWKuD1Fldz4ieCs6+nLNmyVhe2gZVqoO7v8HXuHYs5OV2EzUtbuai37TlOAQHrTDvxMnvMJz3A==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "dependencies": { "@chevrotain/types": "10.5.0", @@ -1231,14 +1231,14 @@ "version": "10.5.0", "resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-10.5.0.tgz", "integrity": "sha512-f1MAia0x/pAVPWH/T73BJVyO2XU5tI4/iE7cnxb7tqdNTNhQI3Uq3XkqcoteTmD4t1aM0LbHCJOhgIDn07kl2A==", - "dev": true, + "devOptional": true, "license": "Apache-2.0" }, "node_modules/@chevrotain/utils": { "version": "10.5.0", "resolved": "https://registry.npmjs.org/@chevrotain/utils/-/utils-10.5.0.tgz", "integrity": "sha512-hBzuU5+JjB2cqNZyszkDHZgOSrUUT8V3dhgRl8Q9Gp6dAj/H5+KILGjbhDpc3Iy9qmqlm/akuOI2ut9VUtzJxQ==", - "dev": true, + "devOptional": true, "license": "Apache-2.0" }, "node_modules/@codemirror/autocomplete": { @@ -1735,7 +1735,7 @@ "version": "0.3.2", "resolved": "https://registry.npmjs.org/@electric-sql/pglite/-/pglite-0.3.2.tgz", "integrity": "sha512-zfWWa+V2ViDCY/cmUfRqeWY1yLto+EpxjXnZzenB1TyxsTiXaTWeZFIZw6mac52BsuQm0RjCnisjBtdBaXOI6w==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "peer": true }, @@ -1743,7 +1743,7 @@ "version": "0.0.6", "resolved": "https://registry.npmjs.org/@electric-sql/pglite-socket/-/pglite-socket-0.0.6.tgz", "integrity": "sha512-6RjmgzphIHIBA4NrMGJsjNWK4pu+bCWJlEWlwcxFTVY3WT86dFpKwbZaGWZV6C5Rd7sCk1Z0CI76QEfukLAUXw==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "bin": { "pglite-server": "dist/scripts/server.js" @@ -1756,7 +1756,7 @@ "version": "0.2.7", "resolved": "https://registry.npmjs.org/@electric-sql/pglite-tools/-/pglite-tools-0.2.7.tgz", "integrity": "sha512-9dAccClqxx4cZB+Ar9B+FZ5WgxDc/Xvl9DPrTWv+dYTf0YNubLzi4wHHRGRGhrJv15XwnyKcGOZAP1VXSneSUg==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "peerDependencies": { "@electric-sql/pglite": "0.3.2" @@ -2031,7 +2031,7 @@ "version": "1.14.2", "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.14.2.tgz", "integrity": "sha512-GHjpOeHYbr9d1vkID2sNUYkl5IxumyhDrUJB7wBp7jvqYwPFt+oNKsAPBRcdSbV7kIrXhouLE199ks1QcK4r7A==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=18.14.1" @@ -2479,7 +2479,7 @@ "version": "0.12.1", "resolved": "https://registry.npmjs.org/@mrleebo/prisma-ast/-/prisma-ast-0.12.1.tgz", "integrity": "sha512-JwqeCQ1U3fvccttHZq7Tk0m/TMC6WcFAQZdukypW3AzlJYKYTGNVd1ANU2GuhKnv4UQuOFj3oAl0LLG/gxFN1w==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "chevrotain": "^10.5.0", @@ -2871,7 +2871,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/@prisma/client/-/client-7.0.0.tgz", "integrity": "sha512-FM1NtJezl0zH3CybLxcbJwShJt7xFGSRg+1tGhy3sCB8goUDnxnBR+RC/P35EAW8gjkzx7kgz7bvb0MerY2VSw==", - "dev": true, "license": "Apache-2.0", "dependencies": { "@prisma/client-runtime-utils": "7.0.0" @@ -2896,14 +2895,13 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/@prisma/client-runtime-utils/-/client-runtime-utils-7.0.0.tgz", "integrity": "sha512-PAiFgMBPrLSaakBwUpML5NevipuKSL3rtNr8pZ8CZ3OBXo0BFcdeGcBIKw/CxJP6H4GNa4+l5bzJPrk8Iq6tDw==", - "dev": true, "license": "Apache-2.0" }, "node_modules/@prisma/config": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@prisma/config/-/config-7.0.0.tgz", "integrity": "sha512-TDASB57hyGUwHB0IPCSkoJcXFrJOKA1+R/1o4np4PbS+E0F5MiY5aAyUttO0mSuNQaX7t8VH/GkDemffF1mQzg==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "dependencies": { "c12": "3.1.0", @@ -2916,14 +2914,14 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-7.0.0.tgz", "integrity": "sha512-SdS3qzfMASHtWimywtkiRcJtrHzacbmMVhElko3DYUZSB0TTLqRYWpddRBJdeGgSLmy1FD55p7uGzIJ+MtfhMg==", - "dev": true, + "devOptional": true, "license": "Apache-2.0" }, "node_modules/@prisma/dev": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@prisma/dev/-/dev-0.13.0.tgz", "integrity": "sha512-QMmF6zFeUF78yv1HYbHvod83AQnl7u6NtKyDhTRZOJup3h1icWs8R7RUVxBJZvM2tBXNAMpLQYYM/8kPlOPegA==", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "@electric-sql/pglite": "0.3.2", @@ -2949,14 +2947,14 @@ "version": "3.9.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.9.0.tgz", "integrity": "sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/@prisma/engines": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-7.0.0.tgz", "integrity": "sha512-ojCL3OFLMCz33UbU9XwH32jwaeM+dWb8cysTuY8eK6ZlMKXJdy6ogrdG3MGB3meKLGdQBmOpUUGJ7eLIaxbrcg==", - "dev": true, + "devOptional": true, "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -2970,14 +2968,14 @@ "version": "6.20.0-16.next-0c19ccc313cf9911a90d99d2ac2eb0280c76c513", "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-6.20.0-16.next-0c19ccc313cf9911a90d99d2ac2eb0280c76c513.tgz", "integrity": "sha512-7bzyN8Gp9GbDFbTDzVUH9nFcgRWvsWmjrGgBJvIC/zEoAuv/lx62gZXgAKfjn/HoPkxz/dS+TtsnduFx8WA+cw==", - "dev": true, + "devOptional": true, "license": "Apache-2.0" }, "node_modules/@prisma/engines/node_modules/@prisma/get-platform": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-7.0.0.tgz", "integrity": "sha512-zyhzrAa+y/GfyCzTnuk0D9lfkvDzo7IbsNyuhTqhPu/AN0txm0x26HAR4tJLismla/fHf5fBzYwSivYSzkpakg==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "dependencies": { "@prisma/debug": "7.0.0" @@ -2987,7 +2985,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-7.0.0.tgz", "integrity": "sha512-qcyWTeWDjVDaDQSrVIymZU1xCYlvmwCzjA395lIuFjUESOH3YQCb8i/hpd4vopfq3fUR4v6+MjjtIGvnmErQgw==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "dependencies": { "@prisma/debug": "7.0.0", @@ -2999,7 +2997,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-7.0.0.tgz", "integrity": "sha512-zyhzrAa+y/GfyCzTnuk0D9lfkvDzo7IbsNyuhTqhPu/AN0txm0x26HAR4tJLismla/fHf5fBzYwSivYSzkpakg==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "dependencies": { "@prisma/debug": "7.0.0" @@ -3009,7 +3007,7 @@ "version": "6.8.2", "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.8.2.tgz", "integrity": "sha512-vXSxyUgX3vm1Q70QwzwkjeYfRryIvKno1SXbIqwSptKwqKzskINnDUcx85oX+ys6ooN2ATGSD0xN2UTfg6Zcow==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "dependencies": { "@prisma/debug": "6.8.2" @@ -3019,7 +3017,7 @@ "version": "6.8.2", "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.8.2.tgz", "integrity": "sha512-4muBSSUwJJ9BYth5N8tqts8JtiLT8QI/RSAzEogwEfpbYGFo9mYsInsVo8dqXdPO2+Rm5OG5q0qWDDE3nyUbVg==", - "dev": true, + "devOptional": true, "license": "Apache-2.0" }, "node_modules/@prisma/nextjs-monorepo-workaround-plugin": { @@ -3033,14 +3031,14 @@ "version": "6.18.0", "resolved": "https://registry.npmjs.org/@prisma/query-plan-executor/-/query-plan-executor-6.18.0.tgz", "integrity": "sha512-jZ8cfzFgL0jReE1R10gT8JLHtQxjWYLiQ//wHmVYZ2rVkFHoh0DT8IXsxcKcFlfKN7ak7k6j0XMNn2xVNyr5cA==", - "dev": true, + "devOptional": true, "license": "Apache-2.0" }, "node_modules/@prisma/studio-core-licensed": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/@prisma/studio-core-licensed/-/studio-core-licensed-0.8.0.tgz", "integrity": "sha512-SXCcgFvo/SC6/11kEOaQghJgCWNEWZUvPYKn/gpvMB9HLSG/5M8If7dWZtEQHhchvl8bh9A89Hw6mEKpsXFimA==", - "dev": true, + "devOptional": true, "license": "UNLICENSED", "peerDependencies": { "@types/react": "^18.0.0 || ^19.0.0", @@ -3873,7 +3871,7 @@ }, "node_modules/@types/react": { "version": "19.1.13", - "dev": true, + "devOptional": true, "license": "MIT", "peer": true, "dependencies": { @@ -5536,7 +5534,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz", "integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">= 6.0.0" @@ -5837,7 +5835,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/c12/-/c12-3.1.0.tgz", "integrity": "sha512-uWoS8OU1MEIsOv8p/5a82c3H31LsWVR5qiyXVfBNOzfffjUWtPnhAb4BYI2uG2HfGmZmFjCtui5XNWaps+iFuw==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "chokidar": "^4.0.3", @@ -6063,7 +6061,7 @@ "version": "10.5.0", "resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-10.5.0.tgz", "integrity": "sha512-Pkv5rBY3+CsHOYfV5g/Vs5JY9WTHHDEKOlohI2XeygaZhUeqhAlldZ8Hz9cRmxu709bvS08YzxHdTPHhffc13A==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "dependencies": { "@chevrotain/cst-dts-gen": "10.5.0", @@ -6078,7 +6076,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "readdirp": "^4.0.1" @@ -6102,7 +6100,7 @@ "version": "0.1.6", "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.6.tgz", "integrity": "sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "consola": "^3.2.3" @@ -6334,14 +6332,14 @@ "version": "0.2.2", "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.2.tgz", "integrity": "sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/consola": { "version": "3.4.2", "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": "^14.18.0 || >=16.10.0" @@ -6389,7 +6387,7 @@ }, "node_modules/cross-spawn": { "version": "7.0.6", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -6566,7 +6564,7 @@ "version": "7.1.5", "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-7.1.5.tgz", "integrity": "sha512-HOJkrhaYsweh+W+e74Yn7YStZOilkoPb6fycpwNLKzSPtruFs48nYis0zy5yJz1+ktUhHxoRDJ27RQAWLIJVJw==", - "dev": true, + "devOptional": true, "license": "BSD-3-Clause", "engines": { "node": ">=16.0.0" @@ -6640,7 +6638,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "engines": { "node": ">=0.10" @@ -6658,7 +6656,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.5.tgz", "integrity": "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/detect-libc": { @@ -6689,7 +6687,7 @@ "version": "16.6.1", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", - "dev": true, + "devOptional": true, "license": "BSD-2-Clause", "engines": { "node": ">=12" @@ -6715,7 +6713,7 @@ "version": "3.18.4", "resolved": "https://registry.npmjs.org/effect/-/effect-3.18.4.tgz", "integrity": "sha512-b1LXQJLe9D11wfnOKAk3PKxuqYshQ0Heez+y5pnkd3jLj1yx9QhM72zZ9uUrOQyNvrs2GZZd/3maL0ZV18YuDA==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@standard-schema/spec": "^1.0.0", @@ -6744,7 +6742,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/empathic/-/empathic-2.0.0.tgz", "integrity": "sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=14" @@ -7480,14 +7478,14 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.0.8.tgz", "integrity": "sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/fast-check": { "version": "3.23.2", "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.23.2.tgz", "integrity": "sha512-h5+1OzzfCC3Ef7VbtKdcv7zsstUQwUDlYpUTvjeUsJAssPgLn7QzbboPtL5ro04Mq0rPOsMzl7q5hIbRs2wD1A==", - "dev": true, + "devOptional": true, "funding": [ { "type": "individual", @@ -7693,7 +7691,7 @@ }, "node_modules/foreground-child": { "version": "3.3.1", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "cross-spawn": "^7.0.6", @@ -7708,7 +7706,7 @@ }, "node_modules/foreground-child/node_modules/signal-exit": { "version": "4.1.0", - "dev": true, + "devOptional": true, "license": "ISC", "engines": { "node": ">=14" @@ -7830,7 +7828,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "is-property": "^1.0.2" @@ -7887,7 +7885,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/get-port-please/-/get-port-please-3.1.2.tgz", "integrity": "sha512-Gxc29eLs1fbn6LQ4jSU4vXjlwyZhF5HsGuMAa7gqBP4Rw4yxxltyDUuF5MBclFzDTXO+ACchGQoeela4DSfzdQ==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/get-proto": { @@ -7933,7 +7931,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/giget/-/giget-2.0.0.tgz", "integrity": "sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "citty": "^0.1.6", @@ -8028,14 +8026,14 @@ }, "node_modules/graceful-fs": { "version": "4.2.11", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/grammex": { "version": "3.1.11", "resolved": "https://registry.npmjs.org/grammex/-/grammex-3.1.11.tgz", "integrity": "sha512-HNwLkgRg9SqTAd1N3Uh/MnKwTBTzwBxTOPbXQ8pb0tpwydjk90k4zRE8JUn9fMUiRwKtXFZ1TWFmms3dZHN+Fg==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/graphemer": { @@ -8186,7 +8184,7 @@ "version": "4.7.10", "resolved": "https://registry.npmjs.org/hono/-/hono-4.7.10.tgz", "integrity": "sha512-QkACju9MiN59CKSY5JsGZCYmPZkA6sIW6OFCUp7qDjZu6S6KHtJHhAc9Uy9mV9F8PJ1/HQ3ybZF2yjCa/73fvQ==", - "dev": true, + "devOptional": true, "license": "MIT", "peer": true, "engines": { @@ -8235,7 +8233,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/http-status-codes/-/http-status-codes-2.3.0.tgz", "integrity": "sha512-RJ8XvFvpPM/Dmc5SV+dC4y5PCeOhT3x1Hq0NU3rjGeg5a/CqlhZ7uudknPwZFz4aeAXDcbAyaeP7GAo9lvngtA==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/https-proxy-agent": { @@ -8626,7 +8624,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/is-regex": { @@ -8787,7 +8785,7 @@ }, "node_modules/isexe": { "version": "2.0.0", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/istanbul-lib-coverage": { @@ -8914,7 +8912,7 @@ }, "node_modules/jiti": { "version": "2.6.1", - "dev": true, + "devOptional": true, "license": "MIT", "peer": true, "bin": { @@ -9171,7 +9169,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=10" @@ -9223,7 +9221,7 @@ "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/lodash.flattendeep": { @@ -9240,7 +9238,7 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", - "dev": true, + "devOptional": true, "license": "Apache-2.0" }, "node_modules/loose-envify": { @@ -9266,7 +9264,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.3.tgz", "integrity": "sha512-Lkk/vx6ak3rYkRR0Nhu4lFUT2VDnQSxBe8Hbl7f36358p6ow8Bnvr8lrLt98H8J1aGxfhbX4Fs5tYg2+FTwr5Q==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "bun": ">=1.0.0", @@ -9702,7 +9700,7 @@ "version": "3.15.3", "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.15.3.tgz", "integrity": "sha512-FBrGau0IXmuqg4haEZRBfHNWB5mUARw6hNwPDXXGg0XzVJ50mr/9hb267lvpVMnhZ1FON3qNd4Xfcez1rbFwSg==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "aws-ssl-profiles": "^1.1.1", @@ -9723,7 +9721,7 @@ "version": "0.7.0", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.0.tgz", "integrity": "sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" @@ -9740,7 +9738,7 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.3.tgz", "integrity": "sha512-eLoBxg6wE/rZkJPhU/xRX1WTpkFEwDJEN96oxFrTsqBdbT5ec295Q+CoHrL9IT0DipqKhmGcaZmwOt8OON5x1w==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "lru-cache": "^7.14.1" @@ -9753,7 +9751,7 @@ "version": "7.18.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", - "dev": true, + "devOptional": true, "license": "ISC", "engines": { "node": ">=12" @@ -9905,7 +9903,7 @@ "version": "1.6.7", "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.7.tgz", "integrity": "sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/node-gyp": { @@ -10193,7 +10191,7 @@ "version": "0.6.2", "resolved": "https://registry.npmjs.org/nypm/-/nypm-0.6.2.tgz", "integrity": "sha512-7eM+hpOtrKrBDCh7Ypu2lJ9Z7PNZBdi/8AT3AX8xoCj43BBVHD0hPSTEvMtkMpfs8FCqBGhxB+uToIQimA111g==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "citty": "^0.1.6", @@ -10213,7 +10211,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.2.tgz", "integrity": "sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=18" @@ -10330,7 +10328,7 @@ "version": "2.0.11", "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.11.tgz", "integrity": "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/once": { @@ -10495,7 +10493,7 @@ }, "node_modules/path-key": { "version": "3.1.1", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=8" @@ -10514,14 +10512,14 @@ }, "node_modules/pathe": { "version": "2.0.3", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/perfect-debounce": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-1.0.0.tgz", "integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/perfect-freehand": { @@ -10606,7 +10604,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.0.tgz", "integrity": "sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "confbox": "^0.2.2", @@ -10690,7 +10688,7 @@ "version": "3.4.7", "resolved": "https://registry.npmjs.org/postgres/-/postgres-3.4.7.tgz", "integrity": "sha512-Jtc2612XINuBjIl/QTWsV5UvE8UHuNblcO3vVADSrKsrc6RqGX6lOW1cEo3CM2v0XG4Nat8nI+YM7/f26VxXLw==", - "dev": true, + "devOptional": true, "license": "Unlicense", "engines": { "node": ">=12" @@ -10780,7 +10778,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/prisma/-/prisma-7.0.0.tgz", "integrity": "sha512-VZObZ1pQV/OScarYg68RYUx61GpFLH2mJGf9fUX4XxQxTst/6ZK7nkY86CSZ3zBW6U9lKRTsBrZWVz20X5G/KQ==", - "dev": true, + "devOptional": true, "hasInstallScript": true, "license": "Apache-2.0", "peer": true, @@ -10860,7 +10858,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz", "integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", @@ -10900,7 +10898,7 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", - "dev": true, + "devOptional": true, "funding": [ { "type": "individual", @@ -10972,7 +10970,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/rc9/-/rc9-2.1.2.tgz", "integrity": "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "defu": "^6.1.4", @@ -11036,7 +11034,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">= 14.18.0" @@ -11087,7 +11085,7 @@ "version": "0.5.0", "resolved": "https://registry.npmjs.org/regexp-to-ast/-/regexp-to-ast-0.5.0.tgz", "integrity": "sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw==", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/regexp.prototype.flags": { @@ -11124,7 +11122,7 @@ "version": "2.21.3", "resolved": "https://registry.npmjs.org/remeda/-/remeda-2.21.3.tgz", "integrity": "sha512-XXrZdLA10oEOQhLLzEJEiFFSKi21REGAkHdImIb4rt/XXy8ORGXh5HCcpUOsElfPNDb+X6TA/+wkh+p2KffYmg==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "type-fest": "^4.39.1" @@ -11134,7 +11132,7 @@ "version": "4.41.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", - "dev": true, + "devOptional": true, "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=16" @@ -11201,7 +11199,7 @@ }, "node_modules/retry": { "version": "0.12.0", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">= 4" @@ -11376,7 +11374,7 @@ }, "node_modules/safer-buffer": { "version": "2.1.2", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/saxes": { @@ -11428,7 +11426,7 @@ "version": "0.0.5", "resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", "integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==", - "dev": true + "devOptional": true }, "node_modules/set-blocking": { "version": "2.0.0", @@ -11527,7 +11525,7 @@ }, "node_modules/shebang-command": { "version": "2.0.0", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" @@ -11538,7 +11536,7 @@ }, "node_modules/shebang-regex": { "version": "3.0.0", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=8" @@ -11632,7 +11630,7 @@ }, "node_modules/signal-exit": { "version": "3.0.7", - "dev": true, + "devOptional": true, "license": "ISC" }, "node_modules/simple-concat": { @@ -11824,7 +11822,7 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", "integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">= 0.6" @@ -12487,7 +12485,7 @@ }, "node_modules/typescript": { "version": "5.9.2", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "peer": true, "bin": { @@ -12657,7 +12655,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/valibot/-/valibot-1.1.0.tgz", "integrity": "sha512-Nk8lX30Qhu+9txPYTwM0cFlWLdPFsFr6LblzqIySfbZph9+BFsAHsNvHOymEviUepeIW6KFHzpX8TKhbptBXXw==", - "dev": true, + "devOptional": true, "license": "MIT", "peerDependencies": { "typescript": ">=5" @@ -12955,7 +12953,7 @@ }, "node_modules/which": { "version": "2.0.2", - "dev": true, + "devOptional": true, "license": "ISC", "dependencies": { "isexe": "^2.0.0" @@ -13261,7 +13259,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/zeptomatch/-/zeptomatch-2.0.2.tgz", "integrity": "sha512-H33jtSKf8Ijtb5BW6wua3G5DhnFjbFML36eFu+VdOoVY4HD9e7ggjqdM6639B+L87rjnR6Y+XeRzBXZdy52B/g==", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "grammex": "^3.1.10" diff --git a/package.json b/package.json index 59bd984..b41ab27 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "@codemirror/lang-markdown": "^6.5.0", "@codemirror/language-data": "^6.5.2", "@emotion/react": "^11.14.0", + "@prisma/client": "^7.0.0", "@snapp-notes/markdown-parser": "^0.1.2", "@uiw/codemirror-theme-basic": "^4.25.3", "@uiw/react-codemirror": "^4.25.3", @@ -55,7 +56,6 @@ "@eslint/eslintrc": "^3", "@jsdevtools/coverage-istanbul-loader": "^3.0.5", "@playwright/test": "^1.56.1", - "@prisma/client": "^7.0.0", "@prisma/nextjs-monorepo-workaround-plugin": "^7.0.0", "@testing-library/jest-dom": "^6.9.1", "@testing-library/react": "^16.3.0", From 321c67c490e26061e92c8e49dd93326834cd18ec Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Thu, 20 Nov 2025 20:10:42 +0100 Subject: [PATCH 07/20] fix integration tests --- prisma.config.ts | 2 +- .../reset-password/ResetPasswordForm.test.tsx | 7 ---- src/test/constants.ts | 7 +--- src/test/global-setup.ts | 38 +++++++------------ 4 files changed, 17 insertions(+), 37 deletions(-) diff --git a/prisma.config.ts b/prisma.config.ts index ac7bec6..83c0c8e 100644 --- a/prisma.config.ts +++ b/prisma.config.ts @@ -5,7 +5,7 @@ export default defineConfig({ datasource: process.env.CI === 'true' ? { - url: 'file:./test.db' + url: process.env.DB_FILE ? process.env.DB_FILE : 'file:./test.db' } : { url: env('DATABASE_URL'), diff --git a/src/app/reset-password/ResetPasswordForm.test.tsx b/src/app/reset-password/ResetPasswordForm.test.tsx index 2d8fdf2..0cbc015 100644 --- a/src/app/reset-password/ResetPasswordForm.test.tsx +++ b/src/app/reset-password/ResetPasswordForm.test.tsx @@ -198,13 +198,6 @@ describe('ResetPasswordForm', () => { }); }); - // Note: Skipping automatic redirect test due to timer/waitFor conflicts - // The redirect functionality is tested via the manual "Go to Login" button - it.skip('should redirect to login after 3 seconds', async () => { - // This test is skipped because fake timers conflict with waitFor's polling - // The redirect functionality is still covered by the manual button test - }); - it('should have manual go to login button', async () => { const user = userEvent.setup({ delay: null }); diff --git a/src/test/constants.ts b/src/test/constants.ts index ca55e7b..3e46bb2 100644 --- a/src/test/constants.ts +++ b/src/test/constants.ts @@ -1,11 +1,8 @@ import path from 'path'; export const SCHEMA_PATH = path.resolve(__dirname, '../../prisma-e2e/schema.prisma'); -export const TEMP_SCHEMA_PATH = path.resolve( - __dirname, - '../../prisma-e2e/schema.temp.prisma' -); -export const TEMPLATE_DB_PATH = path.resolve(__dirname, '../../prisma-e2e/template.db'); +export const DB_FILE = 'prisma-e2e/template.db'; +export const TEMPLATE_DB_PATH = path.resolve(__dirname, `../../${DB_FILE}`); export const TEST_DB_PATH = path.resolve(__dirname, '../../prisma-e2e/test.db'); export const TEST_DB_JOURNAL_PATH = path.resolve( __dirname, diff --git a/src/test/global-setup.ts b/src/test/global-setup.ts index 5c60069..02fc275 100644 --- a/src/test/global-setup.ts +++ b/src/test/global-setup.ts @@ -2,7 +2,7 @@ import fs from 'fs'; import { execSync } from 'child_process'; import { SCHEMA_PATH, - TEMP_SCHEMA_PATH, + DB_FILE, TEMPLATE_DB_PATH, TEST_DB_PATH, TEST_DB_JOURNAL_PATH @@ -15,30 +15,20 @@ export async function setup() { fs.unlinkSync(TEMPLATE_DB_PATH); } - const schemaContent = fs.readFileSync(SCHEMA_PATH, 'utf-8'); - const modifiedSchema = schemaContent.replace( - 'url = "file:./test.db"', - 'url = "file:./template.db"' - ); - - fs.writeFileSync(TEMP_SCHEMA_PATH, modifiedSchema); - - try { - execSync(`npx prisma db push --schema=${TEMP_SCHEMA_PATH}`, { - stdio: 'pipe', - encoding: 'utf-8' - }); - - if (!fs.existsSync(TEMPLATE_DB_PATH)) { - throw new Error(`Template database was not created at ${TEMPLATE_DB_PATH}`); - } - - console.log('Template database created successfully'); - } finally { - if (fs.existsSync(TEMP_SCHEMA_PATH)) { - fs.unlinkSync(TEMP_SCHEMA_PATH); - } + execSync(`npx prisma db push --schema=${SCHEMA_PATH}`, { + stdio: 'pipe', + env: { + ...process.env, + DB_FILE: `file:./${DB_FILE}` + }, + encoding: 'utf-8' + }); + + if (!fs.existsSync(TEMPLATE_DB_PATH)) { + throw new Error(`Template database was not created at ${TEMPLATE_DB_PATH}`); } + + console.log('Template database created successfully'); } export async function teardown() { From a7aac7fe0446133c4ca3f591c1a4c9e27ec16a8e Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Thu, 20 Nov 2025 20:11:32 +0100 Subject: [PATCH 08/20] fix prisma source in E2E test --- e2e/setup-e2e-db.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/e2e/setup-e2e-db.js b/e2e/setup-e2e-db.js index 5abfd94..a052fc9 100755 --- a/e2e/setup-e2e-db.js +++ b/e2e/setup-e2e-db.js @@ -21,13 +21,14 @@ const dbUrl = `file:${dbFile}`; console.log('Generating Prisma client for E2E tests (SQLite)...'); execSync('npx prisma generate --schema=prisma-e2e/schema.prisma', { - stdio: 'inherit' + stdio: 'inherit', + env: { ...process.env, CI: true } }); console.log('Creating E2E test database...'); execSync('npx prisma db push --schema=prisma-e2e/schema.prisma', { stdio: 'inherit', - env: { ...process.env } + env: { ...process.env, CI: true } }); console.log('E2E test database ready'); From 7cc11659d6f8642cc9b1d5a635922582ca3b136f Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Thu, 20 Nov 2025 20:44:39 +0100 Subject: [PATCH 09/20] update Prisma client imports --- prisma.config.ts | 2 +- src/lib/prisma.ts | 6 +++--- src/test/setup-db.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/prisma.config.ts b/prisma.config.ts index 83c0c8e..4e4e0d6 100644 --- a/prisma.config.ts +++ b/prisma.config.ts @@ -5,7 +5,7 @@ export default defineConfig({ datasource: process.env.CI === 'true' ? { - url: process.env.DB_FILE ? process.env.DB_FILE : 'file:./test.db' + url: process.env.DB_FILE ? process.env.DB_FILE : 'file:./prisma-main/test.db' } : { url: env('DATABASE_URL'), diff --git a/src/lib/prisma.ts b/src/lib/prisma.ts index cf9dbf7..65463fa 100644 --- a/src/lib/prisma.ts +++ b/src/lib/prisma.ts @@ -47,8 +47,8 @@ * ``` */ -import { PrismaClient as mainClient } from '../../prisma-main/types'; -import { PrismaClient as e2eClient, Prisma } from '../../prisma-e2e/types'; +import { PrismaClient as mainClient } from '../../prisma-main/types/client'; +import { PrismaClient as e2eClient, Prisma } from '../../prisma-e2e/types/client'; import { prismaAdapter } from 'better-auth/adapters/prisma'; /** @@ -59,7 +59,7 @@ import { prismaAdapter } from 'better-auth/adapters/prisma'; * This ensures type consistency across the application regardless of which * database engine is used at runtime. */ -export * from '../../prisma-main/types'; +export * from '../../prisma-main/types/client'; /** * Prisma client options for logging configuration. diff --git a/src/test/setup-db.ts b/src/test/setup-db.ts index 5606183..01ed914 100644 --- a/src/test/setup-db.ts +++ b/src/test/setup-db.ts @@ -1,6 +1,6 @@ import { beforeAll, afterAll, beforeEach, vi } from 'vitest'; import fs from 'fs'; -import { PrismaClient as e2eClient } from '../../prisma-e2e/types'; +import { PrismaClient as e2eClient } from '../../prisma-e2e/types/client'; import { TEMPLATE_DB_PATH, TEST_DB_PATH } from './constants'; let prisma: e2eClient; From 3eb16265dcd0e1de7f88db68e1e52f742e0cefe6 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Thu, 20 Nov 2025 21:19:33 +0100 Subject: [PATCH 10/20] update Prisma config in Integration tests --- src/test/setup-db.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/test/setup-db.ts b/src/test/setup-db.ts index 01ed914..20b7c7b 100644 --- a/src/test/setup-db.ts +++ b/src/test/setup-db.ts @@ -46,7 +46,13 @@ export async function setupTestDatabase(): Promise { // Ensure the copied file has write permissions (0666 = rw-rw-rw-) fs.chmodSync(TEST_DB_PATH, 0o666); - prisma = new e2eClient(); + prisma = new e2eClient({ + datasources: { + db: { + url: `file:./${TEST_DB_PATH}` + } + } + }); } export async function cleanDatabase(): Promise { From 542626f496788658de64b7a54571e3bc16b3c579 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Thu, 20 Nov 2025 23:33:58 +0100 Subject: [PATCH 11/20] use Prisma Adapter for SQLite db --- package-lock.json | 335 ++++++++++++++++++++++++++++++++++++++++++- package.json | 1 + src/lib/prisma.ts | 9 +- src/test/setup-db.ts | 11 +- 4 files changed, 342 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 525ef15..277dc81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@codemirror/lang-markdown": "^6.5.0", "@codemirror/language-data": "^6.5.2", "@emotion/react": "^11.14.0", + "@prisma/adapter-libsql": "^7.0.0", "@prisma/client": "^7.0.0", "@snapp-notes/markdown-parser": "^0.1.2", "@uiw/codemirror-theme-basic": "^4.25.3", @@ -2471,6 +2472,150 @@ "@lezer/lr": "^1.4.0" } }, + "node_modules/@libsql/client": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@libsql/client/-/client-0.8.1.tgz", + "integrity": "sha512-xGg0F4iTDFpeBZ0r4pA6icGsYa5rG6RAG+i/iLDnpCAnSuTqEWMDdPlVseiq4Z/91lWI9jvvKKiKpovqJ1kZWA==", + "license": "MIT", + "dependencies": { + "@libsql/core": "^0.8.1", + "@libsql/hrana-client": "^0.6.2", + "js-base64": "^3.7.5", + "libsql": "^0.3.10", + "promise-limit": "^2.7.0" + } + }, + "node_modules/@libsql/core": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@libsql/core/-/core-0.8.1.tgz", + "integrity": "sha512-u6nrj6HZMTPsgJ9EBhLzO2uhqhlHQJQmVHV+0yFLvfGf3oSP8w7TjZCNUgu1G8jHISx6KFi7bmcrdXW9lRt++A==", + "license": "MIT", + "dependencies": { + "js-base64": "^3.7.5" + } + }, + "node_modules/@libsql/darwin-arm64": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@libsql/darwin-arm64/-/darwin-arm64-0.3.19.tgz", + "integrity": "sha512-rmOqsLcDI65zzxlUOoEiPJLhqmbFsZF6p4UJQ2kMqB+Kc0Rt5/A1OAdOZ/Wo8fQfJWjR1IbkbpEINFioyKf+nQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@libsql/darwin-x64": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@libsql/darwin-x64/-/darwin-x64-0.3.19.tgz", + "integrity": "sha512-q9O55B646zU+644SMmOQL3FIfpmEvdWpRpzubwFc2trsa+zoBlSkHuzU9v/C+UNoPHQVRMP7KQctJ455I/h/xw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@libsql/hrana-client": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/@libsql/hrana-client/-/hrana-client-0.6.2.tgz", + "integrity": "sha512-MWxgD7mXLNf9FXXiM0bc90wCjZSpErWKr5mGza7ERy2FJNNMXd7JIOv+DepBA1FQTIfI8TFO4/QDYgaQC0goNw==", + "license": "MIT", + "dependencies": { + "@libsql/isomorphic-fetch": "^0.2.1", + "@libsql/isomorphic-ws": "^0.1.5", + "js-base64": "^3.7.5", + "node-fetch": "^3.3.2" + } + }, + "node_modules/@libsql/isomorphic-fetch": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@libsql/isomorphic-fetch/-/isomorphic-fetch-0.2.5.tgz", + "integrity": "sha512-8s/B2TClEHms2yb+JGpsVRTPBfy1ih/Pq6h6gvyaNcYnMVJvgQRY7wAa8U2nD0dppbCuDU5evTNMEhrQ17ZKKg==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@libsql/isomorphic-ws": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@libsql/isomorphic-ws/-/isomorphic-ws-0.1.5.tgz", + "integrity": "sha512-DtLWIH29onUYR00i0GlQ3UdcTRC6EP4u9w/h9LxpUZJWRMARk6dQwZ6Jkd+QdwVpuAOrdxt18v0K2uIYR3fwFg==", + "license": "MIT", + "dependencies": { + "@types/ws": "^8.5.4", + "ws": "^8.13.0" + } + }, + "node_modules/@libsql/linux-arm64-gnu": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@libsql/linux-arm64-gnu/-/linux-arm64-gnu-0.3.19.tgz", + "integrity": "sha512-mgeAUU1oqqh57k7I3cQyU6Trpdsdt607eFyEmH5QO7dv303ti+LjUvh1pp21QWV6WX7wZyjeJV1/VzEImB+jRg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@libsql/linux-arm64-musl": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@libsql/linux-arm64-musl/-/linux-arm64-musl-0.3.19.tgz", + "integrity": "sha512-VEZtxghyK6zwGzU9PHohvNxthruSxBEnRrX7BSL5jQ62tN4n2JNepJ6SdzXp70pdzTfwroOj/eMwiPt94gkVRg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@libsql/linux-x64-gnu": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@libsql/linux-x64-gnu/-/linux-x64-gnu-0.3.19.tgz", + "integrity": "sha512-2t/J7LD5w2f63wGihEO+0GxfTyYIyLGEvTFEsMO16XI5o7IS9vcSHrxsvAJs4w2Pf907uDjmc7fUfMg6L82BrQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@libsql/linux-x64-musl": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@libsql/linux-x64-musl/-/linux-x64-musl-0.3.19.tgz", + "integrity": "sha512-BLsXyJaL8gZD8+3W2LU08lDEd9MIgGds0yPy5iNPp8tfhXx3pV/Fge2GErN0FC+nzt4DYQtjL+A9GUMglQefXQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@libsql/win32-x64-msvc": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@libsql/win32-x64-msvc/-/win32-x64-msvc-0.3.19.tgz", + "integrity": "sha512-ay1X9AobE4BpzG0XPw1gplyLZPGHIgJOovvW23gUrukRegiUP62uzhpRbKNogLlUOynyXeq//prHgPXiebUfWg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@marijn/find-cluster-break": { "version": "1.0.2", "license": "MIT" @@ -2489,6 +2634,12 @@ "node": ">=16" } }, + "node_modules/@neon-rs/load": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@neon-rs/load/-/load-0.0.4.tgz", + "integrity": "sha512-kTPhdZyTQxB+2wpiRcFWrDcejc4JI6tkPuS7UZCG4l6Zvc5kU/gGQ/ozvHTh1XR5tS+UlfAfGuPajjzQjCiHCw==", + "license": "MIT" + }, "node_modules/@next/env": { "version": "16.0.3", "resolved": "https://registry.npmjs.org/@next/env/-/env-16.0.3.tgz", @@ -2867,6 +3018,17 @@ "node": ">=18" } }, + "node_modules/@prisma/adapter-libsql": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@prisma/adapter-libsql/-/adapter-libsql-7.0.0.tgz", + "integrity": "sha512-RspyVP5FgvNhsb4XdpbcUfiWWh/JXucTxzLUVKlrL/sLYQ50Mxx855cElncWjl9u1chaLC5AOLqYC4wNH8XOzA==", + "license": "Apache-2.0", + "dependencies": { + "@libsql/client": "^0.8.1", + "@prisma/driver-adapter-utils": "7.0.0", + "async-mutex": "0.5.0" + } + }, "node_modules/@prisma/client": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@prisma/client/-/client-7.0.0.tgz", @@ -2914,7 +3076,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-7.0.0.tgz", "integrity": "sha512-SdS3qzfMASHtWimywtkiRcJtrHzacbmMVhElko3DYUZSB0TTLqRYWpddRBJdeGgSLmy1FD55p7uGzIJ+MtfhMg==", - "devOptional": true, "license": "Apache-2.0" }, "node_modules/@prisma/dev": { @@ -2950,6 +3111,15 @@ "devOptional": true, "license": "MIT" }, + "node_modules/@prisma/driver-adapter-utils": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@prisma/driver-adapter-utils/-/driver-adapter-utils-7.0.0.tgz", + "integrity": "sha512-ZEvzFaIapnfNKFPgZu/Zy4g6jfO5C0ZmMp+IjO9hNKNDwVKrDlBKw7F3Y9oRK0U0kfb9lKWP4Dz7DgtKs4TTbA==", + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "7.0.0" + } + }, "node_modules/@prisma/engines": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-7.0.0.tgz", @@ -3848,7 +4018,6 @@ }, "node_modules/@types/node": { "version": "24.7.0", - "dev": true, "license": "MIT", "dependencies": { "undici-types": "~7.14.0" @@ -3887,6 +4056,15 @@ "@types/react": "^19.0.0" } }, + "node_modules/@types/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "8.46.2", "dev": true, @@ -5516,6 +5694,15 @@ "node": ">= 0.4" } }, + "node_modules/async-mutex": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/async-mutex/-/async-mutex-0.5.0.tgz", + "integrity": "sha512-1A94B18jkJ3DYq284ohPxoXbfTA5HsQ7/Mf4DEhcyLx3Bz27Rh59iScbB6EPiP+B+joue6YCxcMXSbFC1tZKwA==", + "license": "MIT", + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/available-typed-arrays": { "version": "1.0.7", "dev": true, @@ -6441,6 +6628,15 @@ "dev": true, "license": "BSD-2-Clause" }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, "node_modules/data-urls": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-6.0.0.tgz", @@ -7574,6 +7770,29 @@ "reusify": "^1.0.4" } }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, "node_modules/file-entry-cache": { "version": "8.0.0", "dev": true, @@ -7715,6 +7934,18 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "license": "MIT", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/fromentries": { "version": "1.3.2", "dev": true, @@ -8929,6 +9160,12 @@ "url": "https://github.com/sponsors/panva" } }, + "node_modules/js-base64": { + "version": "3.7.8", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.8.tgz", + "integrity": "sha512-hNngCeKxIUQiEUN3GPJOkz4wF/YvdUdbNL9hsBcMQTkKzboD7T/q3OYOuuPZLUE6dBxSGpwhk5mwuDud7JVAow==", + "license": "BSD-3-Clause" + }, "node_modules/js-tokens": { "version": "4.0.0", "license": "MIT" @@ -9165,6 +9402,45 @@ "node": ">= 0.8.0" } }, + "node_modules/libsql": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/libsql/-/libsql-0.3.19.tgz", + "integrity": "sha512-Aj5cQ5uk/6fHdmeW0TiXK42FqUlwx7ytmMLPSaUQPin5HKKKuUPD62MAbN4OEweGBBI7q1BekoEN4gPUEL6MZA==", + "cpu": [ + "x64", + "arm64", + "wasm32" + ], + "license": "MIT", + "os": [ + "darwin", + "linux", + "win32" + ], + "dependencies": { + "@neon-rs/load": "^0.0.4", + "detect-libc": "2.0.2", + "libsql": "^0.3.15" + }, + "optionalDependencies": { + "@libsql/darwin-arm64": "0.3.19", + "@libsql/darwin-x64": "0.3.19", + "@libsql/linux-arm64-gnu": "0.3.19", + "@libsql/linux-arm64-musl": "0.3.19", + "@libsql/linux-x64-gnu": "0.3.19", + "@libsql/linux-x64-musl": "0.3.19", + "@libsql/win32-x64-msvc": "0.3.19" + } + }, + "node_modules/libsql/node_modules/detect-libc": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, "node_modules/lilconfig": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", @@ -9899,6 +10175,44 @@ "dev": true, "license": "MIT" }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "license": "MIT", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, "node_modules/node-fetch-native": { "version": "1.6.7", "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.7.tgz", @@ -10831,6 +11145,12 @@ "license": "ISC", "optional": true }, + "node_modules/promise-limit": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/promise-limit/-/promise-limit-2.7.0.tgz", + "integrity": "sha512-7nJ6v5lnJsXwGprnGXga4wx6d1POjvi5Qmf1ivTRxTjH4Z/9Czja/UCMLVmB9N93GeWOU93XaFaEt6jbuoagNw==", + "license": "ISC" + }, "node_modules/promise-retry": { "version": "2.0.1", "dev": true, @@ -12543,7 +12863,6 @@ }, "node_modules/undici-types": { "version": "7.14.0", - "dev": true, "license": "MIT" }, "node_modules/unique-filename": { @@ -12904,6 +13223,15 @@ "node": ">=18" } }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, "node_modules/webidl-conversions": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-8.0.0.tgz", @@ -13118,7 +13446,6 @@ "version": "8.18.3", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", - "dev": true, "license": "MIT", "engines": { "node": ">=10.0.0" diff --git a/package.json b/package.json index b41ab27..8731089 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "@codemirror/lang-markdown": "^6.5.0", "@codemirror/language-data": "^6.5.2", "@emotion/react": "^11.14.0", + "@prisma/adapter-libsql": "^7.0.0", "@prisma/client": "^7.0.0", "@snapp-notes/markdown-parser": "^0.1.2", "@uiw/codemirror-theme-basic": "^4.25.3", diff --git a/src/lib/prisma.ts b/src/lib/prisma.ts index 65463fa..e13ed82 100644 --- a/src/lib/prisma.ts +++ b/src/lib/prisma.ts @@ -87,7 +87,14 @@ const getPrismaMain = () => new mainClient(options); * * @returns {e2eClient} Prisma client instance for SQLite */ -const getPrismaE2E = () => new e2eClient(options); + +import { PrismaLibSql } from '@prisma/adapter-libsql'; + +const adapter = new PrismaLibSql({ + url: process.env.DATABASE_URL ?? '' +}); + +export const getPrismaE2E = () => new e2eClient({ adapter }); /** * Selects appropriate Prisma client based on environment. diff --git a/src/test/setup-db.ts b/src/test/setup-db.ts index 20b7c7b..12e889e 100644 --- a/src/test/setup-db.ts +++ b/src/test/setup-db.ts @@ -1,8 +1,7 @@ import { beforeAll, afterAll, beforeEach, vi } from 'vitest'; import fs from 'fs'; -import { PrismaClient as e2eClient } from '../../prisma-e2e/types/client'; import { TEMPLATE_DB_PATH, TEST_DB_PATH } from './constants'; - +import { getPrismaE2E } from '@/lib/prisma'; let prisma: e2eClient; vi.spyOn(console, 'log').mockImplementation(() => undefined); @@ -46,13 +45,7 @@ export async function setupTestDatabase(): Promise { // Ensure the copied file has write permissions (0666 = rw-rw-rw-) fs.chmodSync(TEST_DB_PATH, 0o666); - prisma = new e2eClient({ - datasources: { - db: { - url: `file:./${TEST_DB_PATH}` - } - } - }); + prisma = getPrismaE2E(); } export async function cleanDatabase(): Promise { From 69ea1dff0b7f4d14fa0417965f165951ab1413d8 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Fri, 21 Nov 2025 09:25:26 +0100 Subject: [PATCH 12/20] update Prisma clients --- package-lock.json | 42 +++++++++++++++++++++++++++++++++++++++--- package.json | 1 + prisma.config.ts | 1 + src/lib/prisma.ts | 28 ++++++++++++++++++---------- src/test/setup-db.ts | 3 ++- 5 files changed, 61 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 277dc81..82fb26d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "@codemirror/language-data": "^6.5.2", "@emotion/react": "^11.14.0", "@prisma/adapter-libsql": "^7.0.0", + "@prisma/adapter-mariadb": "^7.0.0", "@prisma/client": "^7.0.0", "@snapp-notes/markdown-parser": "^0.1.2", "@uiw/codemirror-theme-basic": "^4.25.3", @@ -3029,6 +3030,16 @@ "async-mutex": "0.5.0" } }, + "node_modules/@prisma/adapter-mariadb": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@prisma/adapter-mariadb/-/adapter-mariadb-7.0.0.tgz", + "integrity": "sha512-aYwIPjdqFVPQpFZHioQ2Z/PsNSlf49La/d+5YAT/KJoaqdsd9rSq/ut/lwIy5oKp2lTd/uRJnqOI49Bvlwo+Kw==", + "license": "Apache-2.0", + "dependencies": { + "@prisma/driver-adapter-utils": "7.0.0", + "mariadb": "3.4.5" + } + }, "node_modules/@prisma/client": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@prisma/client/-/client-7.0.0.tgz", @@ -3999,6 +4010,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/geojson": { + "version": "7946.0.16", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz", + "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==", + "license": "MIT" + }, "node_modules/@types/glob-to-regexp": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/@types/glob-to-regexp/-/glob-to-regexp-0.4.4.tgz", @@ -6834,7 +6851,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", - "devOptional": true, "license": "Apache-2.0", "engines": { "node": ">=0.10" @@ -8492,7 +8508,6 @@ }, "node_modules/iconv-lite": { "version": "0.6.3", - "dev": true, "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" @@ -9680,6 +9695,28 @@ "license": "ISC", "optional": true }, + "node_modules/mariadb": { + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/mariadb/-/mariadb-3.4.5.tgz", + "integrity": "sha512-gThTYkhIS5rRqkVr+Y0cIdzr+GRqJ9sA2Q34e0yzmyhMCwyApf3OKAC1jnF23aSlIOqJuyaUFUcj7O1qZslmmQ==", + "license": "LGPL-2.1-or-later", + "dependencies": { + "@types/geojson": "^7946.0.16", + "@types/node": "^24.0.13", + "denque": "^2.1.0", + "iconv-lite": "^0.6.3", + "lru-cache": "^10.4.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/mariadb/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, "node_modules/math-intrinsics": { "version": "1.1.0", "dev": true, @@ -11694,7 +11731,6 @@ }, "node_modules/safer-buffer": { "version": "2.1.2", - "devOptional": true, "license": "MIT" }, "node_modules/saxes": { diff --git a/package.json b/package.json index 8731089..f214514 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "@codemirror/language-data": "^6.5.2", "@emotion/react": "^11.14.0", "@prisma/adapter-libsql": "^7.0.0", + "@prisma/adapter-mariadb": "^7.0.0", "@prisma/client": "^7.0.0", "@snapp-notes/markdown-parser": "^0.1.2", "@uiw/codemirror-theme-basic": "^4.25.3", diff --git a/prisma.config.ts b/prisma.config.ts index 4e4e0d6..4f11263 100644 --- a/prisma.config.ts +++ b/prisma.config.ts @@ -1,6 +1,7 @@ import 'dotenv/config'; import path from 'node:path'; import { defineConfig, env } from 'prisma/config'; + export default defineConfig({ datasource: process.env.CI === 'true' diff --git a/src/lib/prisma.ts b/src/lib/prisma.ts index e13ed82..c0947b3 100644 --- a/src/lib/prisma.ts +++ b/src/lib/prisma.ts @@ -71,16 +71,23 @@ export * from '../../prisma-main/types/client'; * Logging is kept minimal to reduce noise in production. * Add 'query' and 'info' for development debugging if needed. */ -const options: Prisma.PrismaClientOptions = { - log: ['error', 'warn'] -}; /** * Creates a Prisma client for MySQL database (production/development). * * @returns {mainClient} Prisma client instance for MySQL */ -const getPrismaMain = () => new mainClient(options); + +import { PrismaMariaDb } from '@prisma/adapter-mariadb'; + +const url = new URL(process.env.DATABASE_URL as string); + +const getPrismaMain = () => new mainClient({ + adapter: new PrismaMariaDb({ + host: url.host, + port: parseInt(url.port) + }) +}); /** * Creates a Prisma client for SQLite database (CI/test). @@ -89,12 +96,13 @@ const getPrismaMain = () => new mainClient(options); */ import { PrismaLibSql } from '@prisma/adapter-libsql'; +import { TEST_DB_PATH } from '@/test/constants'; -const adapter = new PrismaLibSql({ - url: process.env.DATABASE_URL ?? '' -}); - -export const getPrismaE2E = () => new e2eClient({ adapter }); +export const getPrismaE2E = () => new e2eClient({ + adapter: new PrismaLibSql({ + url: `file:${TEST_DB_PATH}` + }) +}}); /** * Selects appropriate Prisma client based on environment. @@ -114,7 +122,7 @@ const getPrisma = () => (process.env.CI ? getPrismaE2E() : getPrismaMain()); * This prevents creating multiple Prisma instances during hot-reload in development. */ const globalForPrisma = global as unknown as { - prisma: ReturnType; + prisma: ReturnType; }; /** diff --git a/src/test/setup-db.ts b/src/test/setup-db.ts index 12e889e..c8bb4e5 100644 --- a/src/test/setup-db.ts +++ b/src/test/setup-db.ts @@ -2,7 +2,8 @@ import { beforeAll, afterAll, beforeEach, vi } from 'vitest'; import fs from 'fs'; import { TEMPLATE_DB_PATH, TEST_DB_PATH } from './constants'; import { getPrismaE2E } from '@/lib/prisma'; -let prisma: e2eClient; + +let prisma: ReturnType; vi.spyOn(console, 'log').mockImplementation(() => undefined); From cbbf790567a83ef24def6db0680b66b7723ad282 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Fri, 21 Nov 2025 09:58:41 +0100 Subject: [PATCH 13/20] update tsdocs + format --- e2e/setup-e2e-db.js | 16 ++++++++++++ prisma-e2e/schema.prisma | 14 +++++++++++ prisma-main/schema.prisma | 9 +++++++ prisma.config.ts | 15 ++++++++++++ src/lib/prisma.ts | 51 ++++++++++++++++++--------------------- src/test/global-setup.ts | 13 ++++++++++ src/test/setup-db.ts | 12 +++++++++ 7 files changed, 102 insertions(+), 28 deletions(-) diff --git a/e2e/setup-e2e-db.js b/e2e/setup-e2e-db.js index a052fc9..7c7786d 100755 --- a/e2e/setup-e2e-db.js +++ b/e2e/setup-e2e-db.js @@ -1,5 +1,19 @@ #!/usr/bin/env node +/** + * E2E Test Database Setup Script + * + * Prepares SQLite database for Playwright E2E tests. + * + * Steps: + * 1. Cleans up existing test database and .next cache + * 2. Generates Prisma Client for SQLite (prisma-e2e/types) + * 3. Creates test database using prisma db push + * + * Note: CI=true is required for prisma.config.ts to select the + * correct schema (prisma-e2e/schema.prisma) + */ + const { execSync } = require('child_process'); const fs = require('fs'); const path = require('path'); @@ -20,12 +34,14 @@ if (fs.existsSync(nextDir)) { const dbUrl = `file:${dbFile}`; console.log('Generating Prisma client for E2E tests (SQLite)...'); +// CI=true required to select prisma-e2e/schema.prisma in prisma.config.ts execSync('npx prisma generate --schema=prisma-e2e/schema.prisma', { stdio: 'inherit', env: { ...process.env, CI: true } }); console.log('Creating E2E test database...'); +// CI=true required to select prisma-e2e/schema.prisma in prisma.config.ts execSync('npx prisma db push --schema=prisma-e2e/schema.prisma', { stdio: 'inherit', env: { ...process.env, CI: true } diff --git a/prisma-e2e/schema.prisma b/prisma-e2e/schema.prisma index bdbfcfd..caea09a 100644 --- a/prisma-e2e/schema.prisma +++ b/prisma-e2e/schema.prisma @@ -1,3 +1,17 @@ +// Prisma Schema - SQLite (CI/Test Environment) +// +// Used for: +// - CI environment (GitHub Actions, process.env.CI=true) +// - Unit and integration tests (Vitest) +// - E2E tests (Playwright) +// +// Structurally identical to prisma-main/schema.prisma except: +// - provider: "sqlite" instead of "mysql" +// - Removed @db.Text, @db.LongText, @db.VarChar (MySQL-specific) +// - Removed @@fulltext (MySQL-specific, not supported in SQLite) +// +// Database configuration in prisma.config.ts + generator client { provider = "prisma-client" output = "../prisma-e2e/types" diff --git a/prisma-main/schema.prisma b/prisma-main/schema.prisma index 7f37263..233c5fa 100644 --- a/prisma-main/schema.prisma +++ b/prisma-main/schema.prisma @@ -1,3 +1,12 @@ +// Prisma Schema - MySQL/MariaDB (Production/Development) +// +// Used for: +// - Production environment (DATABASE_URL from .env) +// - Development environment (DATABASE_URL from .env) +// - Migrations: npx prisma migrate dev --schema=prisma-main/schema.prisma +// +// Database configuration in prisma.config.ts + generator client { provider = "prisma-client" output = "../prisma-main/types" diff --git a/prisma.config.ts b/prisma.config.ts index 4f11263..2dce90c 100644 --- a/prisma.config.ts +++ b/prisma.config.ts @@ -1,16 +1,31 @@ +/** + * @file prisma.config.ts + * @description Prisma configuration with environment-aware schema selection + * + * Configuration switches between MySQL (production/dev) and SQLite (CI/test): + * - CI=true: Uses SQLite schema (prisma-e2e/schema.prisma) for testing + * - Otherwise: Uses MySQL schema (prisma-main/schema.prisma) for production/development + * + * Database URLs are configured via environment variables (DATABASE_URL) or + * DB_FILE for test environments. + */ import 'dotenv/config'; import path from 'node:path'; import { defineConfig, env } from 'prisma/config'; export default defineConfig({ + // Datasource configuration - switches between SQLite (CI) and MySQL (prod/dev) datasource: process.env.CI === 'true' ? { + // SQLite configuration for CI/test environment url: process.env.DB_FILE ? process.env.DB_FILE : 'file:./prisma-main/test.db' } : { + // MySQL/MariaDB configuration for production/development url: env('DATABASE_URL'), shadowDatabaseUrl: env('SHADOW_DATABASE_URL') }, + // Schema selection - conditionally loads MySQL or SQLite schema schema: path.join(process.env.CI ? 'prisma-e2e' : 'prisma-main', 'schema.prisma') }); diff --git a/src/lib/prisma.ts b/src/lib/prisma.ts index c0947b3..75fd3a5 100644 --- a/src/lib/prisma.ts +++ b/src/lib/prisma.ts @@ -5,13 +5,15 @@ * and SQLite (CI/test) based on environment variables. * * @dependencies - * - ../../prisma-main/types: MySQL schema types (production/development) - * - ../../prisma-e2e/types: SQLite schema types (CI/test) + * - ../../prisma-main/types/client: MySQL schema types (production/development) + * - ../../prisma-e2e/types/client: SQLite schema types (CI/test) + * - @prisma/adapter-mariadb: MySQL/MariaDB driver adapter + * - @prisma/adapter-libsql: SQLite driver adapter * * @remarks * - Both schemas are identical in structure, only the database engine differs - * - In CI environment, uses SQLite for faster, isolated testing - * - In production/development, uses MySQL for persistence and scalability + * - In CI environment, uses SQLite with LibSQL adapter for faster, isolated testing + * - In production/development, uses MySQL/MariaDB with MariaDB adapter * - Singleton pattern prevents multiple instances in hot-reload during development * - Re-exports all Prisma types from prisma-main for consistent imports * @@ -23,7 +25,7 @@ * * // ❌ Wrong - Do not import from schema directories * import { type Note } from '@prisma/client'; - * import { type Note } from '../../prisma-main/types'; + * import { type Note } from '../../prisma-main/types/client'; * ``` * * @example @@ -48,7 +50,7 @@ */ import { PrismaClient as mainClient } from '../../prisma-main/types/client'; -import { PrismaClient as e2eClient, Prisma } from '../../prisma-e2e/types/client'; +import { PrismaClient as e2eClient } from '../../prisma-e2e/types/client'; import { prismaAdapter } from 'better-auth/adapters/prisma'; /** @@ -61,19 +63,9 @@ import { prismaAdapter } from 'better-auth/adapters/prisma'; */ export * from '../../prisma-main/types/client'; -/** - * Prisma client options for logging configuration. - * - * @constant {Prisma.PrismaClientOptions} options - * @property {string[]} log - Log levels: only errors and warnings - * - * @remarks - * Logging is kept minimal to reduce noise in production. - * Add 'query' and 'info' for development debugging if needed. - */ - /** * Creates a Prisma client for MySQL database (production/development). + * Uses MariaDB adapter for MySQL connections. * * @returns {mainClient} Prisma client instance for MySQL */ @@ -82,15 +74,17 @@ import { PrismaMariaDb } from '@prisma/adapter-mariadb'; const url = new URL(process.env.DATABASE_URL as string); -const getPrismaMain = () => new mainClient({ - adapter: new PrismaMariaDb({ - host: url.host, - port: parseInt(url.port) - }) -}); +const getPrismaMain = () => + new mainClient({ + adapter: new PrismaMariaDb({ + host: url.host, + port: parseInt(url.port) + }) + }); /** * Creates a Prisma client for SQLite database (CI/test). + * Uses LibSQL adapter for SQLite connections. * * @returns {e2eClient} Prisma client instance for SQLite */ @@ -98,11 +92,12 @@ const getPrismaMain = () => new mainClient({ import { PrismaLibSql } from '@prisma/adapter-libsql'; import { TEST_DB_PATH } from '@/test/constants'; -export const getPrismaE2E = () => new e2eClient({ - adapter: new PrismaLibSql({ - url: `file:${TEST_DB_PATH}` - }) -}}); +export const getPrismaE2E = () => + new e2eClient({ + adapter: new PrismaLibSql({ + url: `file:${TEST_DB_PATH}` + }) + }); /** * Selects appropriate Prisma client based on environment. diff --git a/src/test/global-setup.ts b/src/test/global-setup.ts index 02fc275..34c8ed4 100644 --- a/src/test/global-setup.ts +++ b/src/test/global-setup.ts @@ -8,6 +8,17 @@ import { TEST_DB_JOURNAL_PATH } from './constants'; +/** + * Vitest global setup for database testing + * + * Creates a template SQLite database used for fast test initialization. + * + * Process: + * 1. Deletes existing template database + * 2. Runs prisma db push with DB_FILE env to create template database + * 3. Template database is copied for each test suite (see setup-db.ts) + */ + export async function setup() { console.log('Creating template database for integration tests...'); @@ -15,6 +26,8 @@ export async function setup() { fs.unlinkSync(TEMPLATE_DB_PATH); } + // Use DB_FILE environment variable for database path + // prisma.config.ts reads DB_FILE when CI=true to determine database location execSync(`npx prisma db push --schema=${SCHEMA_PATH}`, { stdio: 'pipe', env: { diff --git a/src/test/setup-db.ts b/src/test/setup-db.ts index c8bb4e5..0765736 100644 --- a/src/test/setup-db.ts +++ b/src/test/setup-db.ts @@ -3,6 +3,17 @@ import fs from 'fs'; import { TEMPLATE_DB_PATH, TEST_DB_PATH } from './constants'; import { getPrismaE2E } from '@/lib/prisma'; +/** + * Test database setup utilities for Vitest + * + * Provides clean database state for each test suite. + * + * Process: + * - beforeAll: Copies template database to test.db and creates Prisma client + * - beforeEach: Cleans all tables for fresh test state + * - afterAll: Disconnects Prisma client + */ + let prisma: ReturnType; vi.spyOn(console, 'log').mockImplementation(() => undefined); @@ -46,6 +57,7 @@ export async function setupTestDatabase(): Promise { // Ensure the copied file has write permissions (0666 = rw-rw-rw-) fs.chmodSync(TEST_DB_PATH, 0o666); + // Create Prisma client with LibSQL adapter prisma = getPrismaE2E(); } From fd41e777188b230effed26d645a1eaeda16e1433 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Fri, 21 Nov 2025 10:12:28 +0100 Subject: [PATCH 14/20] fix URL in Prisma config --- prisma.config.ts | 2 +- src/lib/prisma.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/prisma.config.ts b/prisma.config.ts index 2dce90c..e77b12c 100644 --- a/prisma.config.ts +++ b/prisma.config.ts @@ -19,7 +19,7 @@ export default defineConfig({ process.env.CI === 'true' ? { // SQLite configuration for CI/test environment - url: process.env.DB_FILE ? process.env.DB_FILE : 'file:./prisma-main/test.db' + url: process.env.DB_FILE ? process.env.DB_FILE : 'file:./prisma-e2e/test.db' } : { // MySQL/MariaDB configuration for production/development diff --git a/src/lib/prisma.ts b/src/lib/prisma.ts index 75fd3a5..23ac6de 100644 --- a/src/lib/prisma.ts +++ b/src/lib/prisma.ts @@ -72,7 +72,7 @@ export * from '../../prisma-main/types/client'; import { PrismaMariaDb } from '@prisma/adapter-mariadb'; -const url = new URL(process.env.DATABASE_URL as string); +const url = new URL(process.env.DATABASE_URL as string ?? 'mysql://localhost:3306'); const getPrismaMain = () => new mainClient({ @@ -90,12 +90,12 @@ const getPrismaMain = () => */ import { PrismaLibSql } from '@prisma/adapter-libsql'; -import { TEST_DB_PATH } from '@/test/constants'; +import { DB_FILE } from '@/test/constants'; export const getPrismaE2E = () => new e2eClient({ adapter: new PrismaLibSql({ - url: `file:${TEST_DB_PATH}` + url: `file:./${DB_FILE}` }) }); From 60fd7fcbb8b590de073cb2c195de3afc7a57b4bd Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Fri, 21 Nov 2025 10:25:33 +0100 Subject: [PATCH 15/20] run prettier --- src/lib/prisma.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/prisma.ts b/src/lib/prisma.ts index 23ac6de..414e30e 100644 --- a/src/lib/prisma.ts +++ b/src/lib/prisma.ts @@ -72,7 +72,7 @@ export * from '../../prisma-main/types/client'; import { PrismaMariaDb } from '@prisma/adapter-mariadb'; -const url = new URL(process.env.DATABASE_URL as string ?? 'mysql://localhost:3306'); +const url = new URL((process.env.DATABASE_URL as string) ?? 'mysql://localhost:3306'); const getPrismaMain = () => new mainClient({ From 8635fe5440428d848ca4ab75b3c916d885da0c50 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Fri, 21 Nov 2025 10:51:32 +0100 Subject: [PATCH 16/20] refactor prisma client code --- src/lib/prisma.ts | 25 ++++++++++++------------- src/test/setup-db.ts | 2 +- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/lib/prisma.ts b/src/lib/prisma.ts index 414e30e..66e3ab5 100644 --- a/src/lib/prisma.ts +++ b/src/lib/prisma.ts @@ -72,15 +72,14 @@ export * from '../../prisma-main/types/client'; import { PrismaMariaDb } from '@prisma/adapter-mariadb'; -const url = new URL((process.env.DATABASE_URL as string) ?? 'mysql://localhost:3306'); - -const getPrismaMain = () => - new mainClient({ - adapter: new PrismaMariaDb({ - host: url.host, - port: parseInt(url.port) - }) +const getPrismaMain = () => { + const url = new URL(process.env.DATABASE_URL as string); + const adapter = new PrismaMariaDb({ + host: url.host, + port: parseInt(url.port) }); + return new mainClient({ adapter }); +}; /** * Creates a Prisma client for SQLite database (CI/test). @@ -92,12 +91,12 @@ const getPrismaMain = () => import { PrismaLibSql } from '@prisma/adapter-libsql'; import { DB_FILE } from '@/test/constants'; -export const getPrismaE2E = () => - new e2eClient({ - adapter: new PrismaLibSql({ - url: `file:./${DB_FILE}` - }) +export const getPrismaE2E = () => { + const adapter = new PrismaLibSql({ + url: process.env.DB_FILE ?? `file:./${DB_FILE}` }); + return new e2eClient({ adapter }); +}; /** * Selects appropriate Prisma client based on environment. diff --git a/src/test/setup-db.ts b/src/test/setup-db.ts index 0765736..8a6fabd 100644 --- a/src/test/setup-db.ts +++ b/src/test/setup-db.ts @@ -19,7 +19,7 @@ let prisma: ReturnType; vi.spyOn(console, 'log').mockImplementation(() => undefined); export async function setupTestDatabase(): Promise { - process.env.DATABASE_URL = `file:${TEST_DB_PATH}`; + process.env.DB_FILE = `file:${TEST_DB_PATH}`; if (!fs.existsSync(TEMPLATE_DB_PATH)) { throw new Error('Template database not found. Global setup may have failed.'); From 549599ea82baef7d20ef2a6966fb7a6b7672017e Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Fri, 21 Nov 2025 11:20:11 +0100 Subject: [PATCH 17/20] Update paths to SQLite database --- .github/workflows/test.yml | 2 +- e2e/setup-e2e-db.js | 2 +- src/test/constants.ts | 7 ++++--- src/test/global-setup.ts | 10 +++++----- src/test/setup-db.ts | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9f74b2d..2597057 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -143,7 +143,7 @@ jobs: env: CI: 'true' COVERAGE: 'true' - BASE_URL: 'http://localhost:45678' + DB_FILE: 'file:./prisma-e2e/test.db' BETTER_AUTH_SECRET: 'test-secret-key-at-least-32-characters-long-for-ci' BETTER_AUTH_URL: 'http://localhost:45678' diff --git a/e2e/setup-e2e-db.js b/e2e/setup-e2e-db.js index 7c7786d..588d6d8 100755 --- a/e2e/setup-e2e-db.js +++ b/e2e/setup-e2e-db.js @@ -18,7 +18,7 @@ const { execSync } = require('child_process'); const fs = require('fs'); const path = require('path'); -const dbFile = path.join(__dirname, './prisma-e2e/test.db'); +const dbFile = path.join(__dirname, '../prisma-e2e/test.db'); const nextDir = path.join(__dirname, '../.next'); if (fs.existsSync(dbFile)) { diff --git a/src/test/constants.ts b/src/test/constants.ts index 3e46bb2..9441572 100644 --- a/src/test/constants.ts +++ b/src/test/constants.ts @@ -1,9 +1,10 @@ import path from 'path'; export const SCHEMA_PATH = path.resolve(__dirname, '../../prisma-e2e/schema.prisma'); -export const DB_FILE = 'prisma-e2e/template.db'; -export const TEMPLATE_DB_PATH = path.resolve(__dirname, `../../${DB_FILE}`); -export const TEST_DB_PATH = path.resolve(__dirname, '../../prisma-e2e/test.db'); +export const DB_FILE = 'prisma-e2e/test.db'; +export const TEMPLATE_DB_FILE = 'prisma-e2e/template.db'; +export const TEMPLATE_DB_PATH = path.resolve(__dirname, `../../${TEMPLATE_DB_FILE}`); +export const TEST_DB_PATH = path.resolve(__dirname, `../../${DB_FILE}`); export const TEST_DB_JOURNAL_PATH = path.resolve( __dirname, '../../prisma-e2e/test.db-journal' diff --git a/src/test/global-setup.ts b/src/test/global-setup.ts index 34c8ed4..89a60b0 100644 --- a/src/test/global-setup.ts +++ b/src/test/global-setup.ts @@ -2,7 +2,7 @@ import fs from 'fs'; import { execSync } from 'child_process'; import { SCHEMA_PATH, - DB_FILE, + TEMPLATE_DB_FILE, TEMPLATE_DB_PATH, TEST_DB_PATH, TEST_DB_JOURNAL_PATH @@ -15,7 +15,7 @@ import { * * Process: * 1. Deletes existing template database - * 2. Runs prisma db push with DB_FILE env to create template database + * 2. Runs prisma db push with TEMPLATE_DB_FILE env to create template database * 3. Template database is copied for each test suite (see setup-db.ts) */ @@ -26,13 +26,13 @@ export async function setup() { fs.unlinkSync(TEMPLATE_DB_PATH); } - // Use DB_FILE environment variable for database path - // prisma.config.ts reads DB_FILE when CI=true to determine database location + // Use TEMPLATE_DB_FILE environment variable for database path + // prisma.config.ts reads TEMPLATE_DB_FILE when CI=true to determine database location execSync(`npx prisma db push --schema=${SCHEMA_PATH}`, { stdio: 'pipe', env: { ...process.env, - DB_FILE: `file:./${DB_FILE}` + DB_FILE: `file:./${TEMPLATE_DB_FILE}` }, encoding: 'utf-8' }); diff --git a/src/test/setup-db.ts b/src/test/setup-db.ts index 8a6fabd..fbb9fa9 100644 --- a/src/test/setup-db.ts +++ b/src/test/setup-db.ts @@ -1,6 +1,6 @@ import { beforeAll, afterAll, beforeEach, vi } from 'vitest'; import fs from 'fs'; -import { TEMPLATE_DB_PATH, TEST_DB_PATH } from './constants'; +import { TEMPLATE_DB_PATH, TEST_DB_PATH, DB_FILE } from './constants'; import { getPrismaE2E } from '@/lib/prisma'; /** @@ -19,7 +19,7 @@ let prisma: ReturnType; vi.spyOn(console, 'log').mockImplementation(() => undefined); export async function setupTestDatabase(): Promise { - process.env.DB_FILE = `file:${TEST_DB_PATH}`; + process.env.DB_FILE = `file:${DB_FILE}`; if (!fs.existsSync(TEMPLATE_DB_PATH)) { throw new Error('Template database not found. Global setup may have failed.'); From f1074f4975735b44362675001ab78732fcb9001a Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Fri, 21 Nov 2025 12:44:26 +0100 Subject: [PATCH 18/20] update prisma config --- prisma.config.ts | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/prisma.config.ts b/prisma.config.ts index e77b12c..e87bb3b 100644 --- a/prisma.config.ts +++ b/prisma.config.ts @@ -10,22 +10,29 @@ * DB_FILE for test environments. */ import 'dotenv/config'; -import path from 'node:path'; import { defineConfig, env } from 'prisma/config'; -export default defineConfig({ - // Datasource configuration - switches between SQLite (CI) and MySQL (prod/dev) - datasource: - process.env.CI === 'true' - ? { - // SQLite configuration for CI/test environment +export default defineConfig( + process.env.CI + ? { + schema: 'prisma-e2e/schema.prisma', + migrations: { + path: 'prisma-e2e/migrations', + seed: 'tsx prisma-e2e/seed.ts' + }, + datasource: { url: process.env.DB_FILE ? process.env.DB_FILE : 'file:./prisma-e2e/test.db' } - : { - // MySQL/MariaDB configuration for production/development + } + : { + schema: 'prisma-main/schema.prisma', + migrations: { + path: 'prisma-main/migrations', + seed: 'tsx prisma-main/seed.ts' + }, + datasource: { url: env('DATABASE_URL'), shadowDatabaseUrl: env('SHADOW_DATABASE_URL') - }, - // Schema selection - conditionally loads MySQL or SQLite schema - schema: path.join(process.env.CI ? 'prisma-e2e' : 'prisma-main', 'schema.prisma') -}); + } + } +); From 0cde5f8a7da4784990ca068fb2055a40ada1c9a0 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Fri, 21 Nov 2025 14:40:56 +0100 Subject: [PATCH 19/20] update config --- package.json | 1 + prisma-main/schema.prisma | 9 +++++---- tsconfig.json | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f214514..94004dd 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "SNApp", "version": "0.0.0", "private": true, + "type": "module", "scripts": { "dev": "next dev", "dev:coverage": "next dev --webpack", diff --git a/prisma-main/schema.prisma b/prisma-main/schema.prisma index 233c5fa..6338c4d 100644 --- a/prisma-main/schema.prisma +++ b/prisma-main/schema.prisma @@ -8,13 +8,14 @@ // Database configuration in prisma.config.ts generator client { - provider = "prisma-client" - output = "../prisma-main/types" - binaryTargets = ["native", "linux-musl", "rhel-openssl-3.0.x"] + provider = "prisma-client" + output = "../prisma-main/types" + binaryTargets = ["native", "linux-musl", "rhel-openssl-3.0.x"] + importFileExtension = "ts" } datasource db { - provider = "mysql" + provider = "mysql" } model User { diff --git a/tsconfig.json b/tsconfig.json index 2f9d6dd..4c7d8eb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,7 @@ "noEmit": true, "esModuleInterop": true, "module": "esnext", - "moduleResolution": "bundler", + "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "jsx": "react-jsx", From 41cd55ab0f82becf189b83480562bce26badc41c Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Tue, 25 Nov 2025 15:27:06 +0100 Subject: [PATCH 20/20] fix turbopack config --- next.config.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/next.config.ts b/next.config.ts index ca91dad..68cdbee 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,4 +1,5 @@ import type { NextConfig } from 'next'; +import { resolve } from 'path'; const nextConfig: NextConfig = { distDir: process.env.E2E_TEST === 'true' ? '.next-e2e' : '.next', @@ -9,7 +10,9 @@ const nextConfig: NextConfig = { removeConsole: process.env.NODE_ENV === 'production' }, allowedDevOrigins: ['host.docker.internal'], - turbopack: {}, + turbopack: { + root: resolve('.') + }, webpack: (config, { isServer }) => { if (process.env.COVERAGE === 'true' && !isServer) { config.module.rules.push({