From b7b4af7726f444097e25cd0102d0c00b246f2b8e Mon Sep 17 00:00:00 2001 From: ymc9 <104139426+ymc9@users.noreply.github.com> Date: Sun, 2 Jun 2024 09:45:51 +0800 Subject: [PATCH 1/3] chore: upgrade to Prisma 5.14.0 --- packages/schema/package.json | 6 +- packages/sdk/package.json | 4 +- pnpm-lock.yaml | 101 +++++++++--------- tests/integration/test-run/package.json | 4 +- .../nextjs/test-project/package.json | 4 +- .../frameworks/trpc/test-project/package.json | 4 +- 6 files changed, 64 insertions(+), 59 deletions(-) diff --git a/packages/schema/package.json b/packages/schema/package.json index 90d3d8edd..fe427ef11 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -122,10 +122,10 @@ "zod-validation-error": "^1.5.0" }, "peerDependencies": { - "prisma": "5.0.0 - 5.13.x" + "prisma": "5.0.0 - 5.14.x" }, "devDependencies": { - "@prisma/client": "^5.13.0", + "@prisma/client": "^5.14.0", "@types/async-exit-hook": "^2.0.0", "@types/pluralize": "^0.0.29", "@types/semver": "^7.3.13", @@ -137,7 +137,7 @@ "@zenstackhq/runtime": "workspace:*", "dotenv": "^16.0.3", "esbuild": "^0.15.12", - "prisma": "^5.13.0", + "prisma": "^5.14.0", "renamer": "^4.0.0", "tmp": "^0.2.1", "tsc-alias": "^1.7.0", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 274039a58..4158a0143 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -18,8 +18,8 @@ "author": "", "license": "MIT", "dependencies": { - "@prisma/generator-helper": "^5.13.0", - "@prisma/internals": "^5.13.0", + "@prisma/generator-helper": "^5.14.0", + "@prisma/internals": "^5.14.0", "@zenstackhq/language": "workspace:*", "@zenstackhq/runtime": "workspace:*", "langium": "1.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8bb3f206a..d50f6524e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -569,8 +569,8 @@ importers: version: 1.5.0(zod@3.22.4) devDependencies: '@prisma/client': - specifier: ^5.13.0 - version: 5.13.0(prisma@5.13.0) + specifier: ^5.14.0 + version: 5.14.0(prisma@5.14.0) '@types/async-exit-hook': specifier: ^2.0.0 version: 2.0.0 @@ -605,8 +605,8 @@ importers: specifier: ^0.15.12 version: 0.15.12 prisma: - specifier: ^5.13.0 - version: 5.13.0 + specifier: ^5.14.0 + version: 5.14.0 renamer: specifier: ^4.0.0 version: 4.0.0 @@ -624,11 +624,11 @@ importers: packages/sdk: dependencies: '@prisma/generator-helper': - specifier: ^5.13.0 - version: 5.13.0 + specifier: ^5.14.0 + version: 5.14.0 '@prisma/internals': - specifier: ^5.13.0 - version: 5.13.0 + specifier: ^5.14.0 + version: 5.14.0 '@zenstackhq/language': specifier: workspace:* version: link:../language/dist @@ -3854,8 +3854,8 @@ packages: optional: true dev: false - /@prisma/client@5.13.0(prisma@5.13.0): - resolution: {integrity: sha512-uYdfpPncbZ/syJyiYBwGZS8Gt1PTNoErNYMuqHDa2r30rNSFtgTA/LXsSk55R7pdRTMi5pHkeP9B14K6nHmwkg==} + /@prisma/client@5.14.0(prisma@5.14.0): + resolution: {integrity: sha512-akMSuyvLKeoU4LeyBAUdThP/uhVP3GuLygFE3MlYzaCb3/J8SfsYBE5PkaFuLuVpLyA6sFoW+16z/aPhNAESqg==} engines: {node: '>=16.13'} requiresBuild: true peerDependencies: @@ -3864,7 +3864,7 @@ packages: prisma: optional: true dependencies: - prisma: 5.13.0 + prisma: 5.14.0 dev: true /@prisma/client@5.7.0: @@ -3878,28 +3878,28 @@ packages: optional: true dev: true - /@prisma/debug@5.13.0: - resolution: {integrity: sha512-699iqlEvzyCj9ETrXhs8o8wQc/eVW+FigSsHpiskSFydhjVuwTJEfj/nIYqTaWFYuxiWQRfm3r01meuW97SZaQ==} + /@prisma/debug@5.14.0: + resolution: {integrity: sha512-iq56qBZuFfX3fCxoxT8gBX33lQzomBU0qIUaEj1RebsKVz1ob/BVH1XSBwwwvRVtZEV1b7Fxx2eVu34Ge/mg3w==} /@prisma/debug@5.7.0: resolution: {integrity: sha512-tZ+MOjWlVvz1kOEhNYMa4QUGURY+kgOUBqLHYIV8jmCsMuvA1tWcn7qtIMLzYWCbDcQT4ZS8xDgK0R2gl6/0wA==} dev: false - /@prisma/engines-version@5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b: - resolution: {integrity: sha512-AyUuhahTINGn8auyqYdmxsN+qn0mw3eg+uhkp8zwknXYIqoT3bChG4RqNY/nfDkPvzWAPBa9mrDyBeOnWSgO6A==} + /@prisma/engines-version@5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48: + resolution: {integrity: sha512-ip6pNkRo1UxWv+6toxNcYvItNYaqQjXdFNGJ+Nuk2eYtRoEdoF13wxo7/jsClJFFenMPVNVqXQDV0oveXnR1cA==} /@prisma/engines-version@5.7.0-41.79fb5193cf0a8fdbef536e4b4a159cad677ab1b9: resolution: {integrity: sha512-V6tgRVi62jRwTm0Hglky3Scwjr/AKFBFtS+MdbsBr7UOuiu1TKLPc6xfPiyEN1+bYqjEtjxwGsHgahcJsd1rNg==} dev: false - /@prisma/engines@5.13.0: - resolution: {integrity: sha512-hIFLm4H1boj6CBZx55P4xKby9jgDTeDG0Jj3iXtwaaHmlD5JmiDkZhh8+DYWkTGchu+rRF36AVROLnk0oaqhHw==} + /@prisma/engines@5.14.0: + resolution: {integrity: sha512-lgxkKZ6IEygVcw6IZZUlPIfLQ9hjSYAtHjZ5r64sCLDgVzsPFCi2XBBJgzPMkOQ5RHzUD4E/dVdpn9+ez8tk1A==} requiresBuild: true dependencies: - '@prisma/debug': 5.13.0 - '@prisma/engines-version': 5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b - '@prisma/fetch-engine': 5.13.0 - '@prisma/get-platform': 5.13.0 + '@prisma/debug': 5.14.0 + '@prisma/engines-version': 5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 + '@prisma/fetch-engine': 5.14.0 + '@prisma/get-platform': 5.14.0 /@prisma/engines@5.7.0: resolution: {integrity: sha512-TkOMgMm60n5YgEKPn9erIvFX2/QuWnl3GBo6yTRyZKk5O5KQertXiNnrYgSLy0SpsKmhovEPQb+D4l0SzyE7XA==} @@ -3911,12 +3911,12 @@ packages: '@prisma/get-platform': 5.7.0 dev: false - /@prisma/fetch-engine@5.13.0: - resolution: {integrity: sha512-Yh4W+t6YKyqgcSEB3odBXt7QyVSm0OQlBSldQF2SNXtmOgMX8D7PF/fvH6E6qBCpjB/yeJLy/FfwfFijoHI6sA==} + /@prisma/fetch-engine@5.14.0: + resolution: {integrity: sha512-VrheA9y9DMURK5vu8OJoOgQpxOhas3qF0IBHJ8G/0X44k82kc8E0w98HCn2nhnbOOMwbWsJWXfLC2/F8n5u0gQ==} dependencies: - '@prisma/debug': 5.13.0 - '@prisma/engines-version': 5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b - '@prisma/get-platform': 5.13.0 + '@prisma/debug': 5.14.0 + '@prisma/engines-version': 5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 + '@prisma/get-platform': 5.14.0 /@prisma/fetch-engine@5.7.0: resolution: {integrity: sha512-zIn/qmO+N/3FYe7/L9o+yZseIU8ivh4NdPKSkQRIHfg2QVTVMnbhGoTcecbxfVubeTp+DjcbjS0H9fCuM4W04w==} @@ -3926,10 +3926,10 @@ packages: '@prisma/get-platform': 5.7.0 dev: false - /@prisma/generator-helper@5.13.0: - resolution: {integrity: sha512-i+53beJ0dxkDrkHdsXxmeMf+eVhyhOIpL0SdBga8vwe0qHPrAIJ/lpuT/Hj0y5awTmq40qiUEmhXwCEuM/Z17w==} + /@prisma/generator-helper@5.14.0: + resolution: {integrity: sha512-xVc71cmTnPZ0lnSs4FAY6Ta72vFJ3webrQwKMQ2ujr6hDG1VPIEf820T1TOS3ZZQd/OKigNKXnq3co8biz9/qw==} dependencies: - '@prisma/debug': 5.13.0 + '@prisma/debug': 5.14.0 dev: false /@prisma/generator-helper@5.7.0: @@ -3938,10 +3938,10 @@ packages: '@prisma/debug': 5.7.0 dev: false - /@prisma/get-platform@5.13.0: - resolution: {integrity: sha512-B/WrQwYTzwr7qCLifQzYOmQhZcFmIFhR81xC45gweInSUn2hTEbfKUPd2keAog+y5WI5xLAFNJ3wkXplvSVkSw==} + /@prisma/get-platform@5.14.0: + resolution: {integrity: sha512-/yAyBvcEjRv41ynZrhdrPtHgk47xLRRq/o5eWGcUpBJ1YrUZTYB8EoPiopnP7iQrMATK8stXQdPOoVlrzuTQZw==} dependencies: - '@prisma/debug': 5.13.0 + '@prisma/debug': 5.14.0 /@prisma/get-platform@5.7.0: resolution: {integrity: sha512-ZeV/Op4bZsWXuw5Tg05WwRI8BlKiRFhsixPcAM+5BKYSiUZiMKIi713tfT3drBq8+T0E1arNZgYSA9QYcglWNA==} @@ -3949,16 +3949,16 @@ packages: '@prisma/debug': 5.7.0 dev: false - /@prisma/internals@5.13.0: - resolution: {integrity: sha512-OPMzS+IBPzCLT4s+IfGUbOhGFY51CFbokIFMZuoSeLKWE8UvDlitiXZ3OlVqDPUc0AlH++ysQHzDISHbZD+ZUg==} + /@prisma/internals@5.14.0: + resolution: {integrity: sha512-s0JRNDmR2bvcyy0toz89jy7SbbjANAs4e9KCReNvSm5czctIaZzDf68tcOXdtH0G7m9mKhVhNPdS9lMky0DhWA==} dependencies: - '@prisma/debug': 5.13.0 - '@prisma/engines': 5.13.0 - '@prisma/fetch-engine': 5.13.0 - '@prisma/generator-helper': 5.13.0 - '@prisma/get-platform': 5.13.0 - '@prisma/prisma-schema-wasm': 5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b - '@prisma/schema-files-loader': 5.13.0 + '@prisma/debug': 5.14.0 + '@prisma/engines': 5.14.0 + '@prisma/fetch-engine': 5.14.0 + '@prisma/generator-helper': 5.14.0 + '@prisma/get-platform': 5.14.0 + '@prisma/prisma-schema-wasm': 5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 + '@prisma/schema-files-loader': 5.14.0 arg: 5.0.2 prompts: 2.4.2 dev: false @@ -3976,17 +3976,22 @@ packages: prompts: 2.4.2 dev: false - /@prisma/prisma-schema-wasm@5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b: - resolution: {integrity: sha512-+IhHvuE1wKlyOpJgwAhGop1oqEt+1eixrCeikBIshRhdX6LwjmtRxVxVMlP5nS1yyughmpfkysIW4jZTa+Zjuw==} + /@prisma/prisma-schema-wasm@5.14.0-17.56ca112d5a19c9925b53af75c3c6b7ada97f9f85: + resolution: {integrity: sha512-SX9vE9dGYBap6xsfJuDE5b2eoA6w1vKsx8QpLUHZR+kIV6GQVUYUboEfkvYYoBVen3s9LqxJ1+LjHL/1MqBZag==} + dev: false + + /@prisma/prisma-schema-wasm@5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48: + resolution: {integrity: sha512-WeTmJ0mK8ALoKJUQFO+465k9lm1JWS4ODUg7akJq1wjgyDU1RTAzDFli8ESmNJlMVgJgoAd6jXmzcnoA0HT9Lg==} dev: false /@prisma/prisma-schema-wasm@5.7.0-41.79fb5193cf0a8fdbef536e4b4a159cad677ab1b9: resolution: {integrity: sha512-w+HdQtux0dJDEn6BG3fgNn+fXErXiekj9n//uHRAgrmZghockJkhnikOmG8aSXjTb1Tu5DrGasBX+rYX6rHT1w==} dev: false - /@prisma/schema-files-loader@5.13.0: - resolution: {integrity: sha512-6sVMoqobkWKsmzb98LfLiIt/aFRucWfkzSUBsqk7sc+h99xjynJt6aKtM2SSkyndFdWpRU0OiCHfQ9UlYUEJIw==} + /@prisma/schema-files-loader@5.14.0: + resolution: {integrity: sha512-n1QHR2C63dARKPZe0WPn7biybcBHzXe+BEmiHC5Drq9KPWnpmQtIfGpqm1ZKdvCZfcA5FF3wgpSMPK4LnB0obQ==} dependencies: + '@prisma/prisma-schema-wasm': 5.14.0-17.56ca112d5a19c9925b53af75c3c6b7ada97f9f85 fs-extra: 11.1.1 dev: false @@ -12487,13 +12492,13 @@ packages: hasBin: true dev: true - /prisma@5.13.0: - resolution: {integrity: sha512-kGtcJaElNRAdAGsCNykFSZ7dBKpL14Cbs+VaQ8cECxQlRPDjBlMHNFYeYt0SKovAVy2Y65JXQwB3A5+zIQwnTg==} + /prisma@5.14.0: + resolution: {integrity: sha512-gCNZco7y5XtjrnQYeDJTiVZmT/ncqCr5RY1/Cf8X2wgLRmyh9ayPAGBNziI4qEE4S6SxCH5omQLVo9lmURaJ/Q==} engines: {node: '>=16.13'} hasBin: true requiresBuild: true dependencies: - '@prisma/engines': 5.13.0 + '@prisma/engines': 5.14.0 dev: true /process-nextick-args@2.0.1: diff --git a/tests/integration/test-run/package.json b/tests/integration/test-run/package.json index fc262c950..2e13b47d0 100644 --- a/tests/integration/test-run/package.json +++ b/tests/integration/test-run/package.json @@ -10,9 +10,9 @@ "author": "", "license": "ISC", "dependencies": { - "@prisma/client": "^5.13.0", + "@prisma/client": "^5.14.0", "@zenstackhq/runtime": "file:../../../packages/runtime/dist", - "prisma": "^5.13.0", + "prisma": "^5.14.0", "react": "^18.2.0", "swr": "^1.3.0", "typescript": "^4.9.3", diff --git a/tests/integration/tests/frameworks/nextjs/test-project/package.json b/tests/integration/tests/frameworks/nextjs/test-project/package.json index 2508743a6..64f360dc4 100644 --- a/tests/integration/tests/frameworks/nextjs/test-project/package.json +++ b/tests/integration/tests/frameworks/nextjs/test-project/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@prisma/client": "^5.13.0", + "@prisma/client": "^5.14.0", "@types/node": "18.11.18", "@types/react": "18.0.27", "@types/react-dom": "18.0.10", @@ -22,6 +22,6 @@ "zod": "^3.22.4" }, "devDependencies": { - "prisma": "^5.13.0" + "prisma": "^5.14.0" } } diff --git a/tests/integration/tests/frameworks/trpc/test-project/package.json b/tests/integration/tests/frameworks/trpc/test-project/package.json index dba55073e..c2ebd83f6 100644 --- a/tests/integration/tests/frameworks/trpc/test-project/package.json +++ b/tests/integration/tests/frameworks/trpc/test-project/package.json @@ -9,7 +9,7 @@ "lint": "next lint" }, "dependencies": { - "@prisma/client": "^5.13.0", + "@prisma/client": "^5.14.0", "@tanstack/react-query": "^4.22.4", "@trpc/client": "^10.34.0", "@trpc/next": "^10.34.0", @@ -26,6 +26,6 @@ "zod": "^3.22.4" }, "devDependencies": { - "prisma": "^5.13.0" + "prisma": "^5.14.0" } } From 76059e3d7eaa57610baa3f79234f397faaa93dd0 Mon Sep 17 00:00:00 2001 From: ymc9 <104139426+ymc9@users.noreply.github.com> Date: Sun, 2 Jun 2024 10:04:24 +0800 Subject: [PATCH 2/3] fix tests --- .../tests/generator/prisma-generator.test.ts | 8 +++----- .../validation/datasource-validation.test.ts | 16 +++------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/packages/schema/tests/generator/prisma-generator.test.ts b/packages/schema/tests/generator/prisma-generator.test.ts index 6eaf06399..5affcec77 100644 --- a/packages/schema/tests/generator/prisma-generator.test.ts +++ b/packages/schema/tests/generator/prisma-generator.test.ts @@ -34,7 +34,6 @@ describe('Prisma generator test', () => { provider = 'postgresql' url = env("DATABASE_URL") directUrl = env("DATABASE_URL") - shadowDatabaseUrl = env("DATABASE_URL") extensions = [pg_trgm, postgis(version: "3.3.2"), uuid_ossp(map: "uuid-ossp", schema: "extensions")] schemas = ["auth", "public"] } @@ -67,7 +66,6 @@ describe('Prisma generator test', () => { expect(content).toContain('provider = "postgresql"'); expect(content).toContain('url = env("DATABASE_URL")'); expect(content).toContain('directUrl = env("DATABASE_URL")'); - expect(content).toContain('shadowDatabaseUrl = env("DATABASE_URL")'); expect(content).toContain( 'extensions = [pg_trgm, postgis(version: "3.3.2"), uuid_ossp(map: "uuid-ossp", schema: "extensions")]' ); @@ -253,9 +251,9 @@ describe('Prisma generator test', () => { expect(content).toContain(`@@map("_Role")`); expect(content).toContain(`@map("admin")`); expect(content).toContain(`@map("customer")`); - expect(content).toContain('/// Admin role documentation line 1\n' + - ' /// Admin role documentation line 2\n' + - ' ADMIN'); + expect(content).toContain( + '/// Admin role documentation line 1\n' + ' /// Admin role documentation line 2\n' + ' ADMIN' + ); }); it('attribute passthrough', async () => { diff --git a/packages/schema/tests/schema/validation/datasource-validation.test.ts b/packages/schema/tests/schema/validation/datasource-validation.test.ts index 469ba5ac1..0c90da4db 100644 --- a/packages/schema/tests/schema/validation/datasource-validation.test.ts +++ b/packages/schema/tests/schema/validation/datasource-validation.test.ts @@ -13,9 +13,9 @@ describe('Datasource Validation Tests', () => { cause: [ { message: 'datasource must include a "provider" field' }, { message: 'datasource must include a "url" field' }, - ] - } - }) + ], + }, + }); }); it('dup fields', async () => { @@ -63,14 +63,6 @@ describe('Datasource Validation Tests', () => { } `) ).toContain('"url" must be set to a string literal or an invocation of "env" function'); - - expect( - await loadModelWithError(` - datasource db { - shadowDatabaseUrl = 123 - } - `) - ).toContain('"shadowDatabaseUrl" must be set to a string literal or an invocation of "env" function'); }); it('invalid relationMode value', async () => { @@ -96,7 +88,6 @@ describe('Datasource Validation Tests', () => { datasource db { provider = "postgresql" url = "url" - shadowDatabaseUrl = "shadow" relationMode = "prisma" } `); @@ -105,7 +96,6 @@ describe('Datasource Validation Tests', () => { datasource db { provider = "postgresql" url = env("url") - shadowDatabaseUrl = env("shadowUrl") relationMode = "foreignKeys" } `); From 36796bdec91f120bbc12dbc51e5f01455fbdedde Mon Sep 17 00:00:00 2001 From: ymc9 <104139426+ymc9@users.noreply.github.com> Date: Sun, 2 Jun 2024 10:17:49 +0800 Subject: [PATCH 3/3] update --- packages/runtime/package.json | 2 +- pnpm-lock.yaml | 17 ++--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/packages/runtime/package.json b/packages/runtime/package.json index 6609dadc8..fce03504a 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -98,7 +98,7 @@ "zod-validation-error": "^1.5.0" }, "peerDependencies": { - "@prisma/client": "5.0.0 - 5.13.x" + "@prisma/client": "5.0.0 - 5.14.x" }, "author": { "name": "ZenStack Team" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d50f6524e..ef1ebfa0f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -395,8 +395,8 @@ importers: packages/runtime: dependencies: '@prisma/client': - specifier: 5.0.0 - 5.13.x - version: 5.12.0 + specifier: 5.0.0 - 5.14.x + version: 5.14.0(prisma@5.14.0) bcryptjs: specifier: ^2.4.3 version: 2.4.3 @@ -3843,17 +3843,6 @@ packages: resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} dev: true - /@prisma/client@5.12.0: - resolution: {integrity: sha512-bk/+KPpRm0+IzqFCtAxrj+/TNiHzulspnO+OkysaYY/atc/eX0Gx8V3tTLxbHKVX0LKD4Hi8KKCcSbU1U72n7Q==} - engines: {node: '>=16.13'} - requiresBuild: true - peerDependencies: - prisma: '*' - peerDependenciesMeta: - prisma: - optional: true - dev: false - /@prisma/client@5.14.0(prisma@5.14.0): resolution: {integrity: sha512-akMSuyvLKeoU4LeyBAUdThP/uhVP3GuLygFE3MlYzaCb3/J8SfsYBE5PkaFuLuVpLyA6sFoW+16z/aPhNAESqg==} engines: {node: '>=16.13'} @@ -3865,7 +3854,6 @@ packages: optional: true dependencies: prisma: 5.14.0 - dev: true /@prisma/client@5.7.0: resolution: {integrity: sha512-cZmglCrfNbYpzUtz7HscVHl38e9CrUs31nrVoGUK1nIPXGgt8hT4jj2s657UXcNdQ/jBUxDgGmHyu2Nyrq1txg==} @@ -12499,7 +12487,6 @@ packages: requiresBuild: true dependencies: '@prisma/engines': 5.14.0 - dev: true /process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==}