Skip to content

Commit 23780c4

Browse files
authored
chore: use new Prisma ESM generator and improve client imports (#2647)
<!-- ☝️ PR title should follow conventional commits (https://conventionalcommits.org). In particular, the title should start with one of the following types: - docs: 📖 Documentation (updates to the documentation or readme) - fix: 🐞 Bug fix (a non-breaking change that fixes an issue) - feat: ✨ New feature/enhancement (a non-breaking change that adds functionality or improves existing one) - feat!/fix!: ⚠️ Breaking change (fix or feature that would cause existing functionality to change) - chore: 🧹 Chore (updates to the build process or auxiliary tools and libraries) --> ### 🔗 Linked issue <!-- If it resolves an open issue, please link the issue here. For example "Resolves #123" --> ### 📚 Description Use new ESM generator https://www.prisma.io/docs/orm/prisma-schema/overview/generators?utm_source=CLI&utm_medium=generator-warning#prisma-client-early-access <!-- Describe your changes in detail --> <!-- Why is this change required? What problem does it solve? -->
1 parent baaa4c9 commit 23780c4

24 files changed

+1106
-885
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ apollo/introspection.ts
157157
apollo/fragment-masking.ts
158158
apollo/validation.internal.ts
159159

160+
server/database/generated
161+
160162
scripts/journal-data/
161163

162164
# Yarn: https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"@nuxtjs/tailwindcss": "6.12.2",
5353
"@pinia/nuxt": "0.9.0",
5454
"@popperjs/core": "2.11.8",
55+
"@prisma/adapter-pg": "6.15.0",
5556
"@prisma/client": "6.15.0",
5657
"@variantjs/core": "0.0.90",
5758
"@variantjs/vue": "0.0.22",
@@ -98,6 +99,7 @@
9899
"@graphql-typed-document-node/core": "3.2.0",
99100
"@nuxt/content": "3.6.3",
100101
"@nuxt/eslint": "1.5.2",
102+
"@nuxt/icon": "1.15.0",
101103
"@nuxt/kit": "3.15.0",
102104
"@nuxt/test-utils": "3.15.1",
103105
"@nuxtjs/seo": "3.1.0",
@@ -132,7 +134,6 @@
132134
"nuxt": "3.15.0",
133135
"nuxt-auth-utils": "0.4.4",
134136
"nuxt-graphql-server": "3.1.4",
135-
"@nuxt/icon": "1.15.0",
136137
"oxlint": "1.14.0",
137138
"postinstall-postinstall": "2.1.0",
138139
"prettier": "3.6.2",
@@ -161,8 +162,10 @@
161162
"patchedDependencies": {
162163
"mount-vue-component": "patches/[email protected]",
163164
"@vue/apollo-util": "patches/@[email protected]",
164-
"nitropack": "patches/[email protected]",
165-
"@azure/static-web-apps-cli": "patches/@azure__static-web-apps-cli.patch"
165+
"nitropack": "patches/nitropack.patch",
166+
"prisma": "patches/prisma.patch",
167+
"@azure/static-web-apps-cli": "patches/@azure__static-web-apps-cli.patch",
168+
"@prisma/client": "patches/@prisma__client.patch"
166169
},
167170
"onlyBuiltDependencies": [
168171
"@prisma/client",

patches/@prisma__client.patch

Lines changed: 13 additions & 0 deletions
Large diffs are not rendered by default.

patches/nitropack.patch

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
diff --git a/dist/presets/azure/runtime/azure-functions.mjs b/dist/presets/azure/runtime/azure-functions.mjs
2+
index 519277eab528bb8142d1bfc7dfed174f2134975b..d73b72c2e96cfe3d00f093c2719991005bf02e36 100644
3+
--- a/dist/presets/azure/runtime/azure-functions.mjs
4+
+++ b/dist/presets/azure/runtime/azure-functions.mjs
5+
@@ -4,9 +4,29 @@ import {
6+
getAzureParsedCookiesFromHeaders,
7+
normalizeLambdaOutgoingHeaders
8+
} from "nitropack/runtime/internal";
9+
+import { createConsola } from "consola";
10+
const nitroApp = useNitroApp();
11+
export async function handle(context, req) {
12+
const url = "/" + (req.params.url || "");
13+
+ const _getLogFn = (level) => {
14+
+ if (level < 1) {
15+
+ return context.log.error;
16+
+ }
17+
+ if (level === 1) {
18+
+ return context.log.warn;
19+
+ }
20+
+ return context.log;
21+
+ }
22+
+ const consola = createConsola({
23+
+ reporters: [
24+
+ {
25+
+ log: (logObj) => {
26+
+ _getLogFn(logObj.level)(logObj.args);
27+
+ },
28+
+ },
29+
+ ],
30+
+ });
31+
+ consola.wrapConsole();
32+
const { body, status, statusText, headers } = await nitroApp.localCall({
33+
url,
34+
headers: req.headers,
35+
@@ -14,6 +34,7 @@ export async function handle(context, req) {
36+
// https://github.com/Azure/azure-functions-host/issues/293
37+
body: req.rawBody
38+
});
39+
+ consola.restoreConsole();
40+
context.res = {
41+
status,
42+
// cookies https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-node?tabs=typescript%2Cwindows%2Cazure-cli&pivots=nodejs-model-v4#http-response

patches/[email protected]

Lines changed: 0 additions & 46 deletions
This file was deleted.

patches/prisma.patch

Lines changed: 39 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)