From f9ed2be3246885ad95b8f722f70bead0ba17f223 Mon Sep 17 00:00:00 2001 From: Yangshun Date: Sun, 26 Oct 2025 15:13:52 +0800 Subject: [PATCH 1/2] Modify for serverless --- .gitignore | 1 + package.json | 12 +- pnpm-lock.yaml | 562 +++++++++++++++++++++++++++++++++++---- src/graphql/builder.tsx | 3 +- src/index.tsx | 83 +++--- src/prisma/prisma.tsx | 5 +- src/prisma/schema.prisma | 1 + tsdown.config.ts | 5 + 8 files changed, 581 insertions(+), 91 deletions(-) create mode 100644 tsdown.config.ts diff --git a/.gitignore b/.gitignore index c851018..4ab1835 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ src/graphql/schemaImportMap.tsx src/prisma/pothos-types.ts src/prisma/prisma-client/ tsconfig.tsbuildinfo +dist/ diff --git a/package.json b/package.json index df949ab..67427e4 100644 --- a/package.json +++ b/package.json @@ -8,11 +8,13 @@ "author": "Christoph Nakazawa ", "type": "module", "scripts": { - "dev": "NODE_ENV=development node_modules/.bin/nodemon -q -I --exec node --no-warnings --experimental-specifier-resolution=node --loader ts-node/esm --env-file .env src/index.tsx", + "build": "tsdown", + "dev": "NODE_ENV=development node_modules/.bin/nodemon -q -I --exec node --no-warnings --experimental-specifier-resolution=node --loader ts-node/esm --env-file .env src/index.ts", "dev:setup": "pnpm prisma generate && pnpm generate-graphql", "format": "prettier --experimental-cli --write .", "generate-graphql": "node --no-warnings --experimental-specifier-resolution=node --loader ts-node/esm ./scripts/generate-graphql.tsx", "preinstall": "command -v git >/dev/null 2>&1 && git config core.hooksPath git-hooks || exit 0", + "postinstall": "pnpm dev:setup", "lint": "eslint --cache .", "lint:format": "prettier --experimental-cli --cache --check .", "test": "npm-run-all --parallel tsc:check vitest:run lint lint:format", @@ -36,7 +38,8 @@ "@pothos/plugin-prisma": "^4.12.0", "@pothos/plugin-relay": "^4.6.2", "@pothos/plugin-scope-auth": "^4.1.6", - "@prisma/client": "^6.17.1", + "@prisma/adapter-pg": "^6.18.0", + "@prisma/client": "^6.18.0", "array-shuffle": "^4.0.0", "better-auth": "^1.3.28", "graphql": "^16.11.0", @@ -56,14 +59,15 @@ "npm-run-all2": "^8.0.4", "prettier": "^3.6.2", "prettier-plugin-packagejson": "^2.5.19", - "prisma": "^6.17.1", + "prisma": "^6.18.0", "prisma-json-types-generator": "^3.6.2", "ts-node": "^10.9.2", + "tsdown": "^0.15.9", "typescript": "^5.9.3", "vitest": "^3.2.4" }, "engines": { - "node": ">=24.0.0", + "node": ">=22.0.0", "pnpm": ">=10.0.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6eb60db..315180c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -31,16 +31,19 @@ importers: version: 4.2.5(@pothos/core@4.10.0(graphql@16.11.0))(graphql@16.11.0) '@pothos/plugin-prisma': specifier: ^4.12.0 - version: 4.12.0(@pothos/core@4.10.0(graphql@16.11.0))(@prisma/client@6.17.1(prisma@6.17.1(typescript@5.9.3))(typescript@5.9.3))(graphql@16.11.0)(typescript@5.9.3) + version: 4.12.0(@pothos/core@4.10.0(graphql@16.11.0))(@prisma/client@6.18.0(prisma@6.18.0(typescript@5.9.3))(typescript@5.9.3))(graphql@16.11.0)(typescript@5.9.3) '@pothos/plugin-relay': specifier: ^4.6.2 version: 4.6.2(@pothos/core@4.10.0(graphql@16.11.0))(graphql@16.11.0) '@pothos/plugin-scope-auth': specifier: ^4.1.6 version: 4.1.6(@pothos/core@4.10.0(graphql@16.11.0))(graphql@16.11.0) + '@prisma/adapter-pg': + specifier: ^6.18.0 + version: 6.18.0 '@prisma/client': - specifier: ^6.17.1 - version: 6.17.1(prisma@6.17.1(typescript@5.9.3))(typescript@5.9.3) + specifier: ^6.18.0 + version: 6.18.0(prisma@6.18.0(typescript@5.9.3))(typescript@5.9.3) array-shuffle: specifier: ^4.0.0 version: 4.0.0 @@ -94,14 +97,17 @@ importers: specifier: ^2.5.19 version: 2.5.19(prettier@3.6.2) prisma: - specifier: ^6.17.1 - version: 6.17.1(typescript@5.9.3) + specifier: ^6.18.0 + version: 6.18.0(typescript@5.9.3) prisma-json-types-generator: specifier: ^3.6.2 - version: 3.6.2(@prisma/client@6.17.1(prisma@6.17.1(typescript@5.9.3))(typescript@5.9.3))(prisma@6.17.1(typescript@5.9.3))(typescript@5.9.3) + version: 3.6.2(@prisma/client@6.18.0(prisma@6.18.0(typescript@5.9.3))(typescript@5.9.3))(prisma@6.18.0(typescript@5.9.3))(typescript@5.9.3) ts-node: specifier: ^10.9.2 version: 10.9.2(@swc/core@1.13.5)(@types/node@24.8.1)(typescript@5.9.3) + tsdown: + specifier: ^0.15.9 + version: 0.15.9(typescript@5.9.3) typescript: specifier: ^5.9.3 version: 5.9.3 @@ -549,6 +555,9 @@ packages: '@napi-rs/wasm-runtime@0.2.12': resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==} + '@napi-rs/wasm-runtime@1.0.7': + resolution: {integrity: sha512-SeDnOO0Tk7Okiq6DbXmmBODgOAb9dp9gjlphokTUxmt8U3liIP1ZsozBahH69j/RJv+Rfs6IwUKHTgQYJ/HBAw==} + '@nkzw/core@1.3.0': resolution: {integrity: sha512-4iLkdSgKqbjOPUlaH6mYcBeHplCaykEgwOfplokdZIKRNXTfGhHtgFE620TAxxjnX2fVqpSemiWQbvb8xvVGIQ==} @@ -677,6 +686,9 @@ packages: '@oxc-project/types@0.74.0': resolution: {integrity: sha512-KOw/RZrVlHGhCXh1RufBFF7Nuo7HdY5w1lRJukM/igIl6x9qtz8QycDvZdzb4qnHO7znrPyo2sJrFJK2eKHgfQ==} + '@oxc-project/types@0.95.0': + resolution: {integrity: sha512-vACy7vhpMPhjEJhULNxrdR0D943TkA/MigMpJCHmBHvMXxRStRi/dPtTlfQ3uDwWSzRpT8z+7ImjZVf8JWBocQ==} + '@peculiar/asn1-android@2.5.0': resolution: {integrity: sha512-t8A83hgghWQkcneRsgGs2ebAlRe54ns88p7ouv8PW2tzF1nAW4yHcL4uZKrFpIU+uszIRzTkcCuie37gpkId0A==} @@ -759,8 +771,11 @@ packages: resolution: {integrity: sha512-UGXe+g/rSRbglL0FOJiar+a+nUrst7KaFmsg05wYbKiInGWP6eAj/f8A2Uobgo5KxEtb2X10zeflNH6RK2xeIQ==} engines: {node: '>=14'} - '@prisma/client@6.17.1': - resolution: {integrity: sha512-zL58jbLzYamjnNnmNA51IOZdbk5ci03KviXCuB0Tydc9btH2kDWsi1pQm2VecviRTM7jGia0OPPkgpGnT3nKvw==} + '@prisma/adapter-pg@6.18.0': + resolution: {integrity: sha512-eBtBOL1z2Sh0Rc2hwa4dmwoNeFs5T69tsA62AkhBvnzNfTcr/YfLeJae/wjNmvRttYDPmdiuhqZCRPNY1+8fOA==} + + '@prisma/client@6.18.0': + resolution: {integrity: sha512-jnL2I9gDnPnw4A+4h5SuNn8Gc+1mL1Z79U/3I9eE2gbxJG1oSA+62ByPW4xkeDgwE0fqMzzpAZ7IHxYnLZ4iQA==} engines: {node: '>=18.18'} peerDependencies: prisma: '*' @@ -771,23 +786,29 @@ packages: typescript: optional: true - '@prisma/config@6.17.1': - resolution: {integrity: sha512-fs8wY6DsvOCzuiyWVckrVs1LOcbY4LZNz8ki4uUIQ28jCCzojTGqdLhN2Jl5lDnC1yI8/gNIKpsWDM8pLhOdwA==} + '@prisma/config@6.18.0': + resolution: {integrity: sha512-rgFzspCpwsE+q3OF/xkp0fI2SJ3PfNe9LLMmuSVbAZ4nN66WfBiKqJKo/hLz3ysxiPQZf8h1SMf2ilqPMeWATQ==} '@prisma/debug@6.17.1': resolution: {integrity: sha512-Vf7Tt5Wh9XcndpbmeotuqOMLWPTjEKCsgojxXP2oxE1/xYe7PtnP76hsouG9vis6fctX+TxgmwxTuYi/+xc7dQ==} + '@prisma/debug@6.18.0': + resolution: {integrity: sha512-PMVPMmxPj0ps1VY75DIrT430MoOyQx9hmm174k6cmLZpcI95rAPXOQ+pp8ANQkJtNyLVDxnxVJ0QLbrm/ViBcg==} + '@prisma/dmmf@6.17.1': resolution: {integrity: sha512-ILf+sYTvoZRJIn1KjW8ZBn9N3fK+4ZxreJT0EXuLxbZWbXuz7Eums0/PEscS8+fzktg1zbxZvjHVFMppqfFz3g==} - '@prisma/engines-version@6.17.1-1.272a37d34178c2894197e17273bf937f25acdeac': - resolution: {integrity: sha512-17140E3huOuD9lMdJ9+SF/juOf3WR3sTJMVyyenzqUPbuH+89nPhSWcrY+Mf7tmSs6HvaO+7S+HkELinn6bhdg==} + '@prisma/driver-adapter-utils@6.18.0': + resolution: {integrity: sha512-9wgSriEKs4j1ePxlv1/RNfJV9Gu5rzG37Neshg+DfrCcUY3amroERvTjyR04w5J1THdGdOTgGL9VdJcVaKRMmQ==} - '@prisma/engines@6.17.1': - resolution: {integrity: sha512-D95Ik3GYZkqZ8lSR4EyFOJ/tR33FcYRP8kK61o+WMsyD10UfJwd7+YielflHfKwiGodcqKqoraWw8ElAgMDbPw==} + '@prisma/engines-version@6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f': + resolution: {integrity: sha512-T7Af4QsJQnSgWN1zBbX+Cha5t4qjHRxoeoWpK4JugJzG/ipmmDMY5S+O0N1ET6sCBNVkf6lz+Y+ZNO9+wFU8pQ==} - '@prisma/fetch-engine@6.17.1': - resolution: {integrity: sha512-AYZiHOs184qkDMiTeshyJCtyL4yERkjfTkJiSJdYuSfc24m94lTNL5+GFinZ6vVz+ktX4NJzHKn1zIFzGTWrWg==} + '@prisma/engines@6.18.0': + resolution: {integrity: sha512-i5RzjGF/ex6AFgqEe2o1IW8iIxJGYVQJVRau13kHPYEL1Ck8Zvwuzamqed/1iIljs5C7L+Opiz5TzSsUebkriA==} + + '@prisma/fetch-engine@6.18.0': + resolution: {integrity: sha512-TdaBvTtBwP3IoqVYoGIYpD4mWlk0pJpjTJjir/xLeNWlwog7Sl3bD2J0jJ8+5+q/6RBg+acb9drsv5W6lqae7A==} '@prisma/generator-helper@6.17.1': resolution: {integrity: sha512-ONuUTGXCTUK9K//ronFg4xOEARv+tZKOo5uVSJg6tj2y90gpXQunPYyvR17gEoAQrZT17kC0ie60ecv8nulWyQ==} @@ -795,12 +816,101 @@ packages: '@prisma/generator@6.17.1': resolution: {integrity: sha512-R4SIlAtMHlxwXYYHiyWtN+MLRGFF3Jy+LvqcfInbCiaZkoqyhU5kj8/aOu2OV2ydNkkN+Q8ft9Tnv5a/b4pqPg==} - '@prisma/get-platform@6.17.1': - resolution: {integrity: sha512-AKEn6fsfz0r482S5KRDFlIGEaq9wLNcgalD1adL+fPcFFblIKs1sD81kY/utrHdqKuVC6E1XSRpegDK3ZLL4Qg==} + '@prisma/get-platform@6.18.0': + resolution: {integrity: sha512-uXNJCJGhxTCXo2B25Ta91Rk1/Nmlqg9p7G9GKh8TPhxvAyXCvMNQoogj4JLEUy+3ku8g59cpyQIKFhqY2xO2bg==} + + '@quansync/fs@0.1.5': + resolution: {integrity: sha512-lNS9hL2aS2NZgNW7BBj+6EBl4rOf8l+tQ0eRY6JWCI8jI2kc53gSoqbjojU0OnAWhzoXiOjFyGsHcDGePB3lhA==} '@repeaterjs/repeater@3.0.6': resolution: {integrity: sha512-Javneu5lsuhwNCryN+pXH93VPQ8g0dBX7wItHFgYiwQmzE1sVdg5tWHiOgHywzL2W21XQopa7IwIEnNbmeUJYA==} + '@rolldown/binding-android-arm64@1.0.0-beta.44': + resolution: {integrity: sha512-g9ejDOehJFhxC1DIXQuZQ9bKv4lRDioOTL42cJjFjqKPl1L7DVb9QQQE1FxokGEIMr6FezLipxwnzOXWe7DNPg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.0.0-beta.44': + resolution: {integrity: sha512-PxAW1PXLPmCzfhfKIS53kwpjLGTUdIfX4Ht+l9mj05C3lYCGaGowcNsYi2rdxWH24vSTmeK+ajDNRmmmrK0M7g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.0-beta.44': + resolution: {integrity: sha512-/CtQqs1oO9uSb5Ju60rZvsdjE7Pzn8EK2ISAdl2jedjMzeD/4neNyCbwyJOAPzU+GIQTZVyrFZJX+t7HXR1R/g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.0.0-beta.44': + resolution: {integrity: sha512-V5Q5W9c4+2GJ4QabmjmVV6alY97zhC/MZBaLkDtHwGy3qwzbM4DYgXUbun/0a8AH5hGhuU27tUIlYz6ZBlvgOA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.44': + resolution: {integrity: sha512-X6adjkHeFqKsTU0FXdNN9HY4LDozPqIfHcnXovE5RkYLWIjMWuc489mIZ6iyhrMbCqMUla9IOsh5dvXSGT9o9A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.44': + resolution: {integrity: sha512-kRRKGZI4DXWa6ANFr3dLA85aSVkwPdgXaRjfanwY84tfc3LncDiIjyWCb042e3ckPzYhHSZ3LmisO+cdOIYL6Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.44': + resolution: {integrity: sha512-hMtiN9xX1NhxXBa2U3Up4XkVcsVp2h73yYtMDY59z9CDLEZLrik9RVLhBL5QtoX4zZKJ8HZKJtWuGYvtmkCbIQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.44': + resolution: {integrity: sha512-rd1LzbpXQuR8MTG43JB9VyXDjG7ogSJbIkBpZEHJ8oMKzL6j47kQT5BpIXrg3b5UVygW9QCI2fpFdMocT5Kudg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@rolldown/binding-linux-x64-musl@1.0.0-beta.44': + resolution: {integrity: sha512-qI2IiPqmPRW25exXkuQr3TlweCDc05YvvbSDRPCuPsWkwb70dTiSoXn8iFxT4PWqTi71wWHg1Wyta9PlVhX5VA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + + '@rolldown/binding-openharmony-arm64@1.0.0-beta.44': + resolution: {integrity: sha512-+vHvEc1pL5iJRFlldLC8mjm6P4Qciyfh2bh5ZI6yxDQKbYhCHRKNURaKz1mFcwxhVL5YMYsLyaqM3qizVif9MQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.0.0-beta.44': + resolution: {integrity: sha512-XSgLxRrtFj6RpTeMYmmQDAwHjKseYGKUn5LPiIdW4Cq+f5SBSStL2ToBDxkbdxKPEbCZptnLPQ/nfKcAxrC8Xg==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.44': + resolution: {integrity: sha512-cF1LJdDIX02cJrFrX3wwQ6IzFM7I74BYeKFkzdcIA4QZ0+2WA7/NsKIgjvrunupepWb1Y6PFWdRlHSaz5AW1Wg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.44': + resolution: {integrity: sha512-5uaJonDafhHiMn+iEh7qUp3QQ4Gihv3lEOxKfN8Vwadpy0e+5o28DWI42DpJ9YBYMrVy4JOWJ/3etB/sptpUwA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.44': + resolution: {integrity: sha512-vsqhWAFJkkmgfBN/lkLCWTXF1PuPhMjfnAyru48KvF7mVh2+K7WkKYHezF3Fjz4X/mPScOcIv+g6cf6wnI6eWg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.0.0-beta.44': + resolution: {integrity: sha512-g6eW7Zwnr2c5RADIoqziHoVs6b3W5QTQ4+qbpfjbkMJ9x+8Og211VW/oot2dj9dVwaK/UyC6Yo+02gV+wWQVNg==} + '@rollup/rollup-android-arm-eabi@4.52.5': resolution: {integrity: sha512-8c1vW4ocv3UOMp9K+gToY5zL2XiiVw3k7f1ksf4yO1FlDFQ1C2u72iACFnSOceJFsWskc2WZNqeRhFRPzv+wtQ==} cpu: [arm] @@ -1272,6 +1382,10 @@ packages: resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} engines: {node: '>=12'} + ansis@4.2.0: + resolution: {integrity: sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==} + engines: {node: '>=14'} + anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} @@ -1326,6 +1440,10 @@ packages: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} + ast-kit@2.1.3: + resolution: {integrity: sha512-TH+b3Lv6pUjy/Nu0m6A2JULtdzLpmqF9x1Dhj00ZoEiML8qvVA9j1flkzTKNYgdEhWrjDwtWNpyyCUbfQe514g==} + engines: {node: '>=20.19.0'} + async-function@1.0.0: resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==} engines: {node: '>= 0.4'} @@ -1387,6 +1505,9 @@ packages: bindings@1.5.0: resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} + birpc@2.6.1: + resolution: {integrity: sha512-LPnFhlDpdSH6FJhJyn4M0kFO7vtQ5iPw24FnG0y21q09xC7e8+1LeR31S1MAIrDAHp4m7aas4bEkTDTvMAtebQ==} + bl@4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} @@ -1596,6 +1717,10 @@ packages: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} + diff@8.0.2: + resolution: {integrity: sha512-sSuxWU5j5SR9QQji/o2qMvqRNYRDOcBTgsJ/DeCf4iSN4gW+gNMXM7wFIP+fdXZxoNiAnHUTGjCr+TSWXdRDKg==} + engines: {node: '>=0.3.1'} + doctrine@2.1.0: resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} engines: {node: '>=0.10.0'} @@ -1612,6 +1737,15 @@ packages: resolution: {integrity: sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA==} engines: {node: '>=4'} + dts-resolver@2.1.2: + resolution: {integrity: sha512-xeXHBQkn2ISSXxbJWD828PFjtyg+/UrMDo7W4Ffcs7+YWCquxU8YjV1KoxuiL+eJ5pg3ll+bC6flVv61L3LKZg==} + engines: {node: '>=20.18.0'} + peerDependencies: + oxc-resolver: '>=11.0.0' + peerDependenciesMeta: + oxc-resolver: + optional: true + dunder-proto@1.0.1: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} @@ -1619,8 +1753,8 @@ packages: eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - effect@3.16.12: - resolution: {integrity: sha512-N39iBk0K71F9nb442TLbTkjl24FLUzuvx2i1I2RsEAQsdAdUTuUoW0vlfUXgkMTUOnYqKnWcFfqw4hK4Pw27hg==} + effect@3.18.4: + resolution: {integrity: sha512-b1LXQJLe9D11wfnOKAk3PKxuqYshQ0Heez+y5pnkd3jLj1yx9QhM72zZ9uUrOQyNvrs2GZZd/3maL0ZV18YuDA==} electron-to-chromium@1.5.237: resolution: {integrity: sha512-icUt1NvfhGLar5lSWH3tHNzablaA5js3HVHacQimfP8ViEBOQv+L7DKEuHdbTZ0SKCO1ogTJTIL1Gwk9S6Qvcg==} @@ -2049,6 +2183,9 @@ packages: resolution: {integrity: sha512-rpGNOfacO4WEPClfkEt1yfl8cbu10uB1lNpiI33AKoiAHwOS8lV748JiLx4b5ozO/u4qLjIvfpFsPXdY5Qjkmg==} engines: {node: '>=16.9.0'} + hookable@5.5.3: + resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} + ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} @@ -2571,6 +2708,40 @@ packages: perfect-debounce@1.0.0: resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} + pg-cloudflare@1.2.7: + resolution: {integrity: sha512-YgCtzMH0ptvZJslLM1ffsY4EuGaU0cx4XSdXLRFae8bPP4dS5xL1tNB3k2o/N64cHJpwU7dxKli/nZ2lUa5fLg==} + + pg-connection-string@2.9.1: + resolution: {integrity: sha512-nkc6NpDcvPVpZXxrreI/FOtX3XemeLl8E0qFr6F2Lrm/I8WOnaWNhIPK2Z7OHpw7gh5XJThi6j6ppgNoaT1w4w==} + + pg-int8@1.0.1: + resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==} + engines: {node: '>=4.0.0'} + + pg-pool@3.10.1: + resolution: {integrity: sha512-Tu8jMlcX+9d8+QVzKIvM/uJtp07PKr82IUOYEphaWcoBhIYkoHpLXN3qO59nAI11ripznDsEzEv8nUxBVWajGg==} + peerDependencies: + pg: '>=8.0' + + pg-protocol@1.10.3: + resolution: {integrity: sha512-6DIBgBQaTKDJyxnXaLiLR8wBpQQcGWuAESkRBX/t6OwA8YsqP+iVSiond2EDy6Y/dsGk8rh/jtax3js5NeV7JQ==} + + pg-types@2.2.0: + resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==} + engines: {node: '>=4'} + + pg@8.16.3: + resolution: {integrity: sha512-enxc1h0jA/aq5oSDMvqyW3q89ra6XIIDZgCX9vkMrnz5DFTw/Ny3Li2lFQ+pt3L6MCgm/5o2o8HW9hiJji+xvw==} + engines: {node: '>= 16.0.0'} + peerDependencies: + pg-native: '>=3.0.1' + peerDependenciesMeta: + pg-native: + optional: true + + pgpass@1.0.5: + resolution: {integrity: sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==} + picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -2602,6 +2773,26 @@ packages: resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} engines: {node: ^10 || ^12 || >=14} + postgres-array@2.0.0: + resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==} + engines: {node: '>=4'} + + postgres-array@3.0.4: + resolution: {integrity: sha512-nAUSGfSDGOaOAEGwqsRY27GPOea7CNipJPOA7lPbdEpx5Kg3qzdP0AaWC5MlhTWV9s4hFX39nomVZ+C4tnGOJQ==} + engines: {node: '>=12'} + + postgres-bytea@1.0.0: + resolution: {integrity: sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==} + engines: {node: '>=0.10.0'} + + postgres-date@1.0.7: + resolution: {integrity: sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==} + engines: {node: '>=0.10.0'} + + postgres-interval@1.2.0: + resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==} + engines: {node: '>=0.10.0'} + prebuild-install@7.1.3: resolution: {integrity: sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==} engines: {node: '>=10'} @@ -2633,8 +2824,8 @@ packages: prisma: ^6.14 typescript: ^5.9.2 - prisma@6.17.1: - resolution: {integrity: sha512-ac6h0sM1Tg3zu8NInY+qhP/S9KhENVaw9n1BrGKQVFu05JT5yT5Qqqmb8tMRIE3ZXvVj4xcRA5yfrsy4X7Yy5g==} + prisma@6.18.0: + resolution: {integrity: sha512-bXWy3vTk8mnRmT+SLyZBQoC2vtV9Z8u7OHvEu+aULYxwiop/CPiFZ+F56KsNRNf35jw+8wcu8pmLsjxpBxAO9g==} engines: {node: '>=18.18'} hasBin: true peerDependencies: @@ -2666,6 +2857,9 @@ packages: resolution: {integrity: sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==} engines: {node: '>=6.0.0'} + quansync@0.2.11: + resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} + queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -2734,6 +2928,30 @@ packages: resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + rolldown-plugin-dts@0.16.12: + resolution: {integrity: sha512-9dGjm5oqtKcbZNhpzyBgb8KrYiU616A7IqcFWG7Msp1RKAXQ/hapjivRg+g5IYWSiFhnk3OKYV5T4Ft1t8Cczg==} + engines: {node: '>=20.18.0'} + peerDependencies: + '@ts-macro/tsc': ^0.3.6 + '@typescript/native-preview': '>=7.0.0-dev.20250601.1' + rolldown: ^1.0.0-beta.9 + typescript: ^5.0.0 + vue-tsc: ~3.1.0 + peerDependenciesMeta: + '@ts-macro/tsc': + optional: true + '@typescript/native-preview': + optional: true + typescript: + optional: true + vue-tsc: + optional: true + + rolldown@1.0.0-beta.44: + resolution: {integrity: sha512-gcqgyCi3g93Fhr49PKvymE8PoaGS0sf6ajQrsYaQ8o5de6aUEbD6rJZiJbhOfpcqOnycgsAsUNPYri1h25NgsQ==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + rollup@4.52.5: resolution: {integrity: sha512-3GuObel8h7Kqdjt0gxkEzaifHTqLVW56Y/bjN7PSQtkKr0w3V/QYSdt6QWYtd7A1xUtYQigtdUfgj1RvWVtorw==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -2841,6 +3059,10 @@ packages: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} + split2@4.2.0: + resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} + engines: {node: '>= 10.x'} + stable-hash-x@0.2.0: resolution: {integrity: sha512-o3yWv49B/o4QZk5ZcsALc6t0+eCelPc44zZsLtCQnZPDwFpDYSWcDnrv2TtMmMbQ7uKo3J0HTURCqckw23czNQ==} engines: {node: '>=12.0.0'} @@ -2968,6 +3190,10 @@ packages: resolution: {integrity: sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==} hasBin: true + tree-kill@1.2.2: + resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} + hasBin: true + ts-api-utils@2.1.0: resolution: {integrity: sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==} engines: {node: '>=18.12'} @@ -2991,6 +3217,28 @@ packages: tsconfig-paths@3.15.0: resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} + tsdown@0.15.9: + resolution: {integrity: sha512-C0EJYpXIYdlJokTumIL4lmv/wEiB20oa6iiYsXFE7Q0VKF3Ju6TQ7XAn4JQdm+2iQGEfl8cnEKcX5DB7iVR5Dw==} + engines: {node: '>=20.19.0'} + hasBin: true + peerDependencies: + '@arethetypeswrong/core': ^0.18.1 + publint: ^0.3.0 + typescript: ^5.0.0 + unplugin-lightningcss: ^0.4.0 + unplugin-unused: ^0.5.0 + peerDependenciesMeta: + '@arethetypeswrong/core': + optional: true + publint: + optional: true + typescript: + optional: true + unplugin-lightningcss: + optional: true + unplugin-unused: + optional: true + tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} @@ -3040,6 +3288,9 @@ packages: resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==} engines: {node: '>= 0.4'} + unconfig@7.3.3: + resolution: {integrity: sha512-QCkQoOnJF8L107gxfHL0uavn7WD9b3dpBcFX6HtfQYmjw2YzWxGuFQ0N0J6tE9oguCBJn9KOvfqYDCMPHIZrBA==} + uncrypto@0.1.3: resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} @@ -3189,6 +3440,10 @@ packages: wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + xtend@4.0.2: + resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} + engines: {node: '>=0.4'} + yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} @@ -3645,6 +3900,13 @@ snapshots: '@tybys/wasm-util': 0.10.1 optional: true + '@napi-rs/wasm-runtime@1.0.7': + dependencies: + '@emnapi/core': 1.5.0 + '@emnapi/runtime': 1.5.0 + '@tybys/wasm-util': 0.10.1 + optional: true + '@nkzw/core@1.3.0': {} '@nkzw/define-env@1.1.0': {} @@ -3742,6 +4004,8 @@ snapshots: '@oxc-project/types@0.74.0': {} + '@oxc-project/types@0.95.0': {} + '@peculiar/asn1-android@2.5.0': dependencies: '@peculiar/asn1-schema': 2.5.0 @@ -3854,10 +4118,10 @@ snapshots: '@pothos/core': 4.10.0(graphql@16.11.0) graphql: 16.11.0 - '@pothos/plugin-prisma@4.12.0(@pothos/core@4.10.0(graphql@16.11.0))(@prisma/client@6.17.1(prisma@6.17.1(typescript@5.9.3))(typescript@5.9.3))(graphql@16.11.0)(typescript@5.9.3)': + '@pothos/plugin-prisma@4.12.0(@pothos/core@4.10.0(graphql@16.11.0))(@prisma/client@6.18.0(prisma@6.18.0(typescript@5.9.3))(typescript@5.9.3))(graphql@16.11.0)(typescript@5.9.3)': dependencies: '@pothos/core': 4.10.0(graphql@16.11.0) - '@prisma/client': 6.17.1(prisma@6.17.1(typescript@5.9.3))(typescript@5.9.3) + '@prisma/client': 6.18.0(prisma@6.18.0(typescript@5.9.3))(typescript@5.9.3) '@prisma/generator-helper': 6.17.1 graphql: 16.11.0 typescript: 5.9.3 @@ -3876,38 +4140,52 @@ snapshots: dependencies: oxc-parser: 0.74.0 - '@prisma/client@6.17.1(prisma@6.17.1(typescript@5.9.3))(typescript@5.9.3)': + '@prisma/adapter-pg@6.18.0': + dependencies: + '@prisma/driver-adapter-utils': 6.18.0 + pg: 8.16.3 + postgres-array: 3.0.4 + transitivePeerDependencies: + - pg-native + + '@prisma/client@6.18.0(prisma@6.18.0(typescript@5.9.3))(typescript@5.9.3)': optionalDependencies: - prisma: 6.17.1(typescript@5.9.3) + prisma: 6.18.0(typescript@5.9.3) typescript: 5.9.3 - '@prisma/config@6.17.1': + '@prisma/config@6.18.0': dependencies: c12: 3.1.0 deepmerge-ts: 7.1.5 - effect: 3.16.12 + effect: 3.18.4 empathic: 2.0.0 transitivePeerDependencies: - magicast '@prisma/debug@6.17.1': {} + '@prisma/debug@6.18.0': {} + '@prisma/dmmf@6.17.1': {} - '@prisma/engines-version@6.17.1-1.272a37d34178c2894197e17273bf937f25acdeac': {} + '@prisma/driver-adapter-utils@6.18.0': + dependencies: + '@prisma/debug': 6.18.0 + + '@prisma/engines-version@6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f': {} - '@prisma/engines@6.17.1': + '@prisma/engines@6.18.0': dependencies: - '@prisma/debug': 6.17.1 - '@prisma/engines-version': 6.17.1-1.272a37d34178c2894197e17273bf937f25acdeac - '@prisma/fetch-engine': 6.17.1 - '@prisma/get-platform': 6.17.1 + '@prisma/debug': 6.18.0 + '@prisma/engines-version': 6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f + '@prisma/fetch-engine': 6.18.0 + '@prisma/get-platform': 6.18.0 - '@prisma/fetch-engine@6.17.1': + '@prisma/fetch-engine@6.18.0': dependencies: - '@prisma/debug': 6.17.1 - '@prisma/engines-version': 6.17.1-1.272a37d34178c2894197e17273bf937f25acdeac - '@prisma/get-platform': 6.17.1 + '@prisma/debug': 6.18.0 + '@prisma/engines-version': 6.18.0-8.34b5a692b7bd79939a9a2c3ef97d816e749cda2f + '@prisma/get-platform': 6.18.0 '@prisma/generator-helper@6.17.1': dependencies: @@ -3917,12 +4195,62 @@ snapshots: '@prisma/generator@6.17.1': {} - '@prisma/get-platform@6.17.1': + '@prisma/get-platform@6.18.0': dependencies: - '@prisma/debug': 6.17.1 + '@prisma/debug': 6.18.0 + + '@quansync/fs@0.1.5': + dependencies: + quansync: 0.2.11 '@repeaterjs/repeater@3.0.6': {} + '@rolldown/binding-android-arm64@1.0.0-beta.44': + optional: true + + '@rolldown/binding-darwin-arm64@1.0.0-beta.44': + optional: true + + '@rolldown/binding-darwin-x64@1.0.0-beta.44': + optional: true + + '@rolldown/binding-freebsd-x64@1.0.0-beta.44': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.44': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.44': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.44': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.44': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.0-beta.44': + optional: true + + '@rolldown/binding-openharmony-arm64@1.0.0-beta.44': + optional: true + + '@rolldown/binding-wasm32-wasi@1.0.0-beta.44': + dependencies: + '@napi-rs/wasm-runtime': 1.0.7 + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.44': + optional: true + + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.44': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.44': + optional: true + + '@rolldown/pluginutils@1.0.0-beta.44': {} + '@rollup/rollup-android-arm-eabi@4.52.5': optional: true @@ -4343,6 +4671,8 @@ snapshots: ansi-styles@6.2.3: {} + ansis@4.2.0: {} + anymatch@3.1.3: dependencies: normalize-path: 3.0.0 @@ -4430,6 +4760,11 @@ snapshots: assertion-error@2.0.1: {} + ast-kit@2.1.3: + dependencies: + '@babel/parser': 7.28.4 + pathe: 2.0.3 + async-function@1.0.0: {} available-typed-arrays@1.0.7: @@ -4480,6 +4815,8 @@ snapshots: dependencies: file-uri-to-path: 1.0.0 + birpc@2.6.1: {} + bl@4.1.0: dependencies: buffer: 5.7.1 @@ -4694,6 +5031,8 @@ snapshots: diff@4.0.2: {} + diff@8.0.2: {} + doctrine@2.1.0: dependencies: esutils: 2.0.3 @@ -4704,6 +5043,8 @@ snapshots: dset@3.1.4: {} + dts-resolver@2.1.2: {} + dunder-proto@1.0.1: dependencies: call-bind-apply-helpers: 1.0.2 @@ -4712,7 +5053,7 @@ snapshots: eastasianwidth@0.2.0: {} - effect@3.16.12: + effect@3.18.4: dependencies: '@standard-schema/spec': 1.0.0 fast-check: 3.23.2 @@ -5312,6 +5653,8 @@ snapshots: hono@4.10.1: {} + hookable@5.5.3: {} + ieee754@1.2.1: {} ignore-by-default@1.0.1: {} @@ -5807,6 +6150,41 @@ snapshots: perfect-debounce@1.0.0: {} + pg-cloudflare@1.2.7: + optional: true + + pg-connection-string@2.9.1: {} + + pg-int8@1.0.1: {} + + pg-pool@3.10.1(pg@8.16.3): + dependencies: + pg: 8.16.3 + + pg-protocol@1.10.3: {} + + pg-types@2.2.0: + dependencies: + pg-int8: 1.0.1 + postgres-array: 2.0.0 + postgres-bytea: 1.0.0 + postgres-date: 1.0.7 + postgres-interval: 1.2.0 + + pg@8.16.3: + dependencies: + pg-connection-string: 2.9.1 + pg-pool: 3.10.1(pg@8.16.3) + pg-protocol: 1.10.3 + pg-types: 2.2.0 + pgpass: 1.0.5 + optionalDependencies: + pg-cloudflare: 1.2.7 + + pgpass@1.0.5: + dependencies: + split2: 4.2.0 + picocolors@1.1.1: {} picomatch@2.3.1: {} @@ -5831,6 +6209,18 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 + postgres-array@2.0.0: {} + + postgres-array@3.0.4: {} + + postgres-bytea@1.0.0: {} + + postgres-date@1.0.7: {} + + postgres-interval@1.2.0: + dependencies: + xtend: 4.0.2 + prebuild-install@7.1.3: dependencies: detect-libc: 2.1.2 @@ -5857,19 +6247,19 @@ snapshots: prettier@3.6.2: {} - prisma-json-types-generator@3.6.2(@prisma/client@6.17.1(prisma@6.17.1(typescript@5.9.3))(typescript@5.9.3))(prisma@6.17.1(typescript@5.9.3))(typescript@5.9.3): + prisma-json-types-generator@3.6.2(@prisma/client@6.18.0(prisma@6.18.0(typescript@5.9.3))(typescript@5.9.3))(prisma@6.18.0(typescript@5.9.3))(typescript@5.9.3): dependencies: - '@prisma/client': 6.17.1(prisma@6.17.1(typescript@5.9.3))(typescript@5.9.3) + '@prisma/client': 6.18.0(prisma@6.18.0(typescript@5.9.3))(typescript@5.9.3) '@prisma/generator-helper': 6.17.1 - prisma: 6.17.1(typescript@5.9.3) + prisma: 6.18.0(typescript@5.9.3) semver: 7.7.3 tslib: 2.8.1 typescript: 5.9.3 - prisma@6.17.1(typescript@5.9.3): + prisma@6.18.0(typescript@5.9.3): dependencies: - '@prisma/config': 6.17.1 - '@prisma/engines': 6.17.1 + '@prisma/config': 6.18.0 + '@prisma/engines': 6.18.0 optionalDependencies: typescript: 5.9.3 transitivePeerDependencies: @@ -5898,6 +6288,8 @@ snapshots: pvutils@1.1.3: {} + quansync@0.2.11: {} + queue-microtask@1.2.3: {} rc9@2.1.2: @@ -5978,6 +6370,44 @@ snapshots: reusify@1.1.0: {} + rolldown-plugin-dts@0.16.12(rolldown@1.0.0-beta.44)(typescript@5.9.3): + dependencies: + '@babel/generator': 7.28.3 + '@babel/parser': 7.28.4 + '@babel/types': 7.28.4 + ast-kit: 2.1.3 + birpc: 2.6.1 + debug: 4.4.3(supports-color@5.5.0) + dts-resolver: 2.1.2 + get-tsconfig: 4.12.0 + magic-string: 0.30.19 + rolldown: 1.0.0-beta.44 + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - oxc-resolver + - supports-color + + rolldown@1.0.0-beta.44: + dependencies: + '@oxc-project/types': 0.95.0 + '@rolldown/pluginutils': 1.0.0-beta.44 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.0.0-beta.44 + '@rolldown/binding-darwin-arm64': 1.0.0-beta.44 + '@rolldown/binding-darwin-x64': 1.0.0-beta.44 + '@rolldown/binding-freebsd-x64': 1.0.0-beta.44 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.44 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.44 + '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.44 + '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.44 + '@rolldown/binding-linux-x64-musl': 1.0.0-beta.44 + '@rolldown/binding-openharmony-arm64': 1.0.0-beta.44 + '@rolldown/binding-wasm32-wasi': 1.0.0-beta.44 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.44 + '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.44 + '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.44 + rollup@4.52.5: dependencies: '@types/estree': 1.0.8 @@ -6127,6 +6557,8 @@ snapshots: source-map-js@1.2.1: {} + split2@4.2.0: {} + stable-hash-x@0.2.0: {} stackback@0.0.2: {} @@ -6271,6 +6703,8 @@ snapshots: touch@3.1.1: {} + tree-kill@1.2.2: {} + ts-api-utils@2.1.0(typescript@5.9.3): dependencies: typescript: 5.9.3 @@ -6303,6 +6737,31 @@ snapshots: strip-bom: 3.0.0 optional: true + tsdown@0.15.9(typescript@5.9.3): + dependencies: + ansis: 4.2.0 + cac: 6.7.14 + chokidar: 4.0.3 + debug: 4.4.3(supports-color@5.5.0) + diff: 8.0.2 + empathic: 2.0.0 + hookable: 5.5.3 + rolldown: 1.0.0-beta.44 + rolldown-plugin-dts: 0.16.12(rolldown@1.0.0-beta.44)(typescript@5.9.3) + semver: 7.7.3 + tinyexec: 1.0.1 + tinyglobby: 0.2.15 + tree-kill: 1.2.2 + unconfig: 7.3.3 + optionalDependencies: + typescript: 5.9.3 + transitivePeerDependencies: + - '@ts-macro/tsc' + - '@typescript/native-preview' + - oxc-resolver + - supports-color + - vue-tsc + tslib@1.14.1: {} tslib@2.8.1: {} @@ -6372,6 +6831,13 @@ snapshots: has-symbols: 1.1.0 which-boxed-primitive: 1.1.1 + unconfig@7.3.3: + dependencies: + '@quansync/fs': 0.1.5 + defu: 6.1.4 + jiti: 2.6.1 + quansync: 0.2.11 + uncrypto@0.1.3: {} undefsafe@2.0.5: {} @@ -6565,6 +7031,8 @@ snapshots: wrappy@1.0.2: {} + xtend@4.0.2: {} + yallist@3.1.1: {} yaml@2.7.0: diff --git a/src/graphql/builder.tsx b/src/graphql/builder.tsx index fc7374d..4163aa0 100644 --- a/src/graphql/builder.tsx +++ b/src/graphql/builder.tsx @@ -4,7 +4,7 @@ import DirectivesPlugin from '@pothos/plugin-directives'; import PrismaPlugin from '@pothos/plugin-prisma'; import RelayPlugin from '@pothos/plugin-relay'; import ScopeAuthPlugin from '@pothos/plugin-scope-auth'; -import PrismaTypes from '../prisma/pothos-types.ts'; +import PrismaTypes, { getDatamodel } from '../prisma/pothos-types.ts'; import prisma from '../prisma/prisma.tsx'; import isAdmin from '../user/isAdmin.tsx'; import { Context } from './context.tsx'; @@ -44,6 +44,7 @@ const builder = new SchemaBuilder({ ], prisma: { client: prisma, + dmmf: getDatamodel(), exposeDescriptions: false, filterConnectionTotalCount: true, maxConnectionSize: 120, diff --git a/src/index.tsx b/src/index.tsx index 9808cb8..b0607d8 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -12,32 +12,7 @@ import env from './lib/env.tsx'; import prisma from './prisma/prisma.tsx'; import { toSessionUser } from './user/SessionUser.tsx'; -try { - await prisma.$connect(); -} catch (error) { - console.error( - `${styleText(['red', 'bold'], 'Prisma Database Connection Error')}\n`, - error, - ); - process.exit(1); -} - -const name = 'Pothos GraphQL Server'; - -const { - values: { port: portArg }, -} = parseArgs({ - options: { - port: { - default: '9000', - short: 'p', - type: 'string', - }, - }, -}); - const origin = env('CLIENT_DOMAIN'); -const port = (portArg && parseInteger(portArg)) || 9000; const app = new Hono(); app.use( @@ -69,18 +44,50 @@ app.on(['POST', 'GET', 'OPTIONS'], '/graphql/*', async (context) => { app.all('/*', (context) => context.redirect(origin)); -serve({ fetch: app.fetch, port }, () => - console.log( - `${styleText(['green', 'bold'], `${name}\n ➜`)} Server running on port ${styleText('bold', String(port))}.\n`, - ), -); - -const setTitle = (title: string) => { - process.title = title; - if (process.stdout.isTTY) { - process.stdout.write( - `${String.fromCharCode(27)}]0;🚀 ${title}${String.fromCharCode(7)}`, +if (process.env.npm_lifecycle_event === 'dev') { + try { + await prisma.$connect(); + } catch (error) { + // eslint-disable-next-line no-console + console.error( + `${styleText(['red', 'bold'], 'Prisma Database Connection Error')}\n`, + error, ); + process.exit(1); } -}; -setTimeout(() => setTitle(name), 0); + + const name = 'Pothos GraphQL Server'; + + const { + values: { port: portArg }, + } = parseArgs({ + options: { + port: { + default: '9000', + short: 'p', + type: 'string', + }, + }, + }); + + const port = (portArg && parseInteger(portArg)) || 9000; + + serve({ fetch: app.fetch, port }, () => + // eslint-disable-next-line no-console + console.log( + `${styleText(['green', 'bold'], `${name}\n ➜`)} Server running on port ${styleText('bold', String(port))}.\n`, + ), + ); + + const setTitle = (title: string) => { + process.title = title; + if (process.stdout.isTTY) { + process.stdout.write( + `${String.fromCharCode(27)}]0;🚀 ${title}${String.fromCharCode(7)}`, + ); + } + }; + setTimeout(() => setTitle(name), 0); +} + +export default app; diff --git a/src/prisma/prisma.tsx b/src/prisma/prisma.tsx index 310163c..ee626ed 100644 --- a/src/prisma/prisma.tsx +++ b/src/prisma/prisma.tsx @@ -1,5 +1,8 @@ +import { PrismaPg } from '@prisma/adapter-pg'; import { PrismaClient } from './prisma-client/client.ts'; +const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL }); + declare global { namespace PrismaJson { type PokemonStats = Readonly<{ @@ -14,4 +17,4 @@ declare global { } } -export default new PrismaClient(); +export default new PrismaClient({ adapter }); diff --git a/src/prisma/schema.prisma b/src/prisma/schema.prisma index f479eed..789ee6d 100644 --- a/src/prisma/schema.prisma +++ b/src/prisma/schema.prisma @@ -6,6 +6,7 @@ generator client { importFileExtension = "ts" output = "./prisma-client" provider = "prisma-client" + engineType = "client" } generator pothos { diff --git a/tsdown.config.ts b/tsdown.config.ts new file mode 100644 index 0000000..a0e4ee1 --- /dev/null +++ b/tsdown.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from 'tsdown'; + +export default defineConfig({ + entry: ['./src/index.tsx'], +}); From 254f333e169158b81358514dc509fb0f6bc2ebb2 Mon Sep 17 00:00:00 2001 From: Yangshun Date: Sun, 2 Nov 2025 10:37:12 +0800 Subject: [PATCH 2/2] add docs --- README.md | 14 ++++++++++++++ package.json | 2 +- src/index.tsx | 24 ++++++++++-------------- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index d2f9ee7..5e08108 100644 --- a/README.md +++ b/README.md @@ -255,6 +255,20 @@ You need to build your own authentication flow in your client using [Better Auth The sample data in this repository is insecure demo data. Before deploying a server built using this template, make sure to at least change the passwords for the seed users and the authentication secret in the `.env` file. +## Deployment to serverless + +This template can also be deployed to serverless hosting platforms like Vercel. To increase portability, we strip all TypeScript types and bundle the app via [tsdown](https://tsdown.dev/) into a single file at `dist/index.js`. + +To deploy on Vercel with the default configurations, specify the following options for the project: + +- **Framework Preset**: Hono +- **Build Command**: `npm run build` +- **Output Directory**: `dist` + +Be sure to add the necessary environment variables. + +After which, the GraphQL endpoint can be accessed at `https://yourdomain.vercel.app/graphql`. + ## Building a client This template is designed to be used with [Relay](https://relay.dev/) as the client. Relay is a mature choice for a GraphQL client for TypeScript apps. The CORS policy expects the client to run at `http://localhost:5173` during development. If you are using a different port, change the `DEVELOPMENT_DOMAIN` in `.env`. diff --git a/package.json b/package.json index 67427e4..2fce325 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "type": "module", "scripts": { "build": "tsdown", - "dev": "NODE_ENV=development node_modules/.bin/nodemon -q -I --exec node --no-warnings --experimental-specifier-resolution=node --loader ts-node/esm --env-file .env src/index.ts", + "dev": "NODE_ENV=development node_modules/.bin/nodemon -q -I --exec node --no-warnings --experimental-specifier-resolution=node --loader ts-node/esm --env-file .env src/index.tsx", "dev:setup": "pnpm prisma generate && pnpm generate-graphql", "format": "prettier --experimental-cli --write .", "generate-graphql": "node --no-warnings --experimental-specifier-resolution=node --loader ts-node/esm ./scripts/generate-graphql.tsx", diff --git a/src/index.tsx b/src/index.tsx index b0607d8..e176d38 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -12,6 +12,16 @@ import env from './lib/env.tsx'; import prisma from './prisma/prisma.tsx'; import { toSessionUser } from './user/SessionUser.tsx'; +try { + await prisma.$connect(); +} catch (error) { + console.error( + `${styleText(['red', 'bold'], 'Prisma Database Connection Error')}\n`, + error, + ); + process.exit(1); +} + const origin = env('CLIENT_DOMAIN'); const app = new Hono(); @@ -45,19 +55,7 @@ app.on(['POST', 'GET', 'OPTIONS'], '/graphql/*', async (context) => { app.all('/*', (context) => context.redirect(origin)); if (process.env.npm_lifecycle_event === 'dev') { - try { - await prisma.$connect(); - } catch (error) { - // eslint-disable-next-line no-console - console.error( - `${styleText(['red', 'bold'], 'Prisma Database Connection Error')}\n`, - error, - ); - process.exit(1); - } - const name = 'Pothos GraphQL Server'; - const { values: { port: portArg }, } = parseArgs({ @@ -71,9 +69,7 @@ if (process.env.npm_lifecycle_event === 'dev') { }); const port = (portArg && parseInteger(portArg)) || 9000; - serve({ fetch: app.fetch, port }, () => - // eslint-disable-next-line no-console console.log( `${styleText(['green', 'bold'], `${name}\n ➜`)} Server running on port ${styleText('bold', String(port))}.\n`, ),