-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(client): Fix $Enums namespace in browser build
$Enums namespace was correctly created for server-side clients, but not for browser. Fix #20480
- Loading branch information
Showing
8 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { $ } from 'zx' | ||
|
||
import { executeSteps } from '../_utils/executeSteps' | ||
|
||
void executeSteps({ | ||
setup: async () => { | ||
await $`pnpm install` | ||
await $`pnpm exec prisma generate` | ||
}, | ||
test: async () => { | ||
await $`pnpm exec jest` | ||
}, | ||
finish: async () => { | ||
await $`echo "done"` | ||
}, | ||
// keep: true, // keep docker open to debug it | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"private": true, | ||
"version": "0.0.0", | ||
"main": "index.js", | ||
"scripts": {}, | ||
"dependencies": { | ||
"@prisma/client": "../prisma-client-0.0.0.tgz" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "29.5.1", | ||
"@types/node": "16.18.11", | ||
"prisma": "../prisma-0.0.0.tgz" | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/client/tests/e2e/browser-enum/prisma/schema.prisma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// This is your Prisma schema file, | ||
// learn more about it in the docs: https://pris.ly/d/prisma-schema | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = "postgresql://user@pwd:example.com/db" | ||
} | ||
|
||
model User { | ||
id Int @id @default(autoincrement()) | ||
role Role | ||
} | ||
|
||
enum Role { | ||
USER | ||
ADMIN | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Readme | ||
|
||
This is an example of a readme file. Put a description of your test here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Role } from '@prisma/client/index-browser' | ||
|
||
test('example', () => { | ||
expect(Role).toEqual({ | ||
USER: 'USER', | ||
ADMIN: 'ADMIN', | ||
}) | ||
}) | ||
|
||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "../tsconfig.base.json", | ||
"exclude": ["_steps.ts"] | ||
} |