Skip to content

Commit 5a9702e

Browse files
authored
chore: install prisma/client-runtime-utils (#523)
* chore: install prisma/client-runtime-utils we have a runtime lint/typecheck issue where tsc can't resolve the type properly. refer to this issue: prisma/prisma#28581 (comment), where the problem exists due to symlinks used by pnpm to link to packages. to avoid this, we have to install the required prisma package at the package's top level * chore: copy env prior to typecheck prisma now uses the prisma config file, which calls into `env` to get teh database url to generate types. this requires the env var to be set to work, so we copy the example env to the env * chore: patch prisma/client we need to patch the client so that the missing types are available
1 parent 6718017 commit 5a9702e

File tree

5 files changed

+59
-17
lines changed

5 files changed

+59
-17
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ jobs:
5454
- name: Setup
5555
uses: ./tooling/github/setup
5656

57+
- name: Copy env
58+
shell: bash
59+
run: cp .env.example .env
60+
5761
- name: Typecheck
5862
run: pnpm typecheck
5963
# TODO: Add test CI

packages/db/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"dependencies": {
4242
"@prisma/adapter-pg": "catalog:prisma",
4343
"@prisma/client": "catalog:prisma",
44+
"@prisma/client-runtime-utils": "catalog:prisma",
4445
"@t3-oss/env-core": "catalog:t3-env",
4546
"kysely": "^0.28.8",
4647
"pg": "^8.16.3",

patches/@prisma__client.patch

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
diff --git a/runtime/client.d.ts b/runtime/client.d.ts
2+
index 8cfc8fbb4221ba0c5d9508cac2b428ef50230d32..5f764a3ebe7765aa5a2803080da12e3d1fd83562 100644
3+
--- a/runtime/client.d.ts
4+
+++ b/runtime/client.d.ts
5+
@@ -3178,3 +3178,8 @@ export { Value }
6+
export declare const warnOnce: (key: string, message: string, ...args: unknown[]) => void;
7+
8+
export { }
9+
+
10+
+export { AnyNullClass } from '@prisma/client-runtime-utils';
11+
+export { DbNullClass } from '@prisma/client-runtime-utils';
12+
+export { JsonNullClass } from '@prisma/client-runtime-utils';
13+
+
14+
diff --git a/runtime/index-browser.d.ts b/runtime/index-browser.d.ts
15+
index ca12789acff83849a2e2d96331ca68dfcd306469..8212c484f8ad10af6fd4cf901b8a1ce9d64280c5 100644
16+
--- a/runtime/index-browser.d.ts
17+
+++ b/runtime/index-browser.d.ts
18+
@@ -85,3 +85,9 @@ declare function validator<C, M extends Exclude<keyof C, `$${string}`>, O extend
19+
declare function validator<C, M extends Exclude<keyof C, `$${string}`>, O extends keyof C[M] & Operation, P extends keyof Args<C[M], O>>(client: C, model: M, operation: O, prop: P): <S>(select: Exact<S, Args<C[M], O>[P]>) => S;
20+
21+
export { }
22+
+
23+
+
24+
+export { AnyNullClass } from '@prisma/client-runtime-utils';
25+
+export { DbNullClass } from '@prisma/client-runtime-utils';
26+
+export { JsonNullClass } from '@prisma/client-runtime-utils';
27+
+

pnpm-lock.yaml

Lines changed: 25 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ catalogs:
2323
prisma:
2424
'@prisma/adapter-pg': ^7.0.0
2525
'@prisma/client': ^7.0.0
26+
'@prisma/client-runtime-utils': 7.0.1
2627
prisma: ^7.0.0
2728
react-query5:
2829
'@tanstack/react-query': ^5.90.8
@@ -68,6 +69,7 @@ overrides:
6869
'@types/minimatch': 5.1.2
6970

7071
patchedDependencies:
72+
'@prisma/client': patches/@prisma__client.patch
7173
7274

7375
publicHoistPattern:

0 commit comments

Comments
 (0)