Skip to content

Commit

Permalink
fix(deps): update prisma monorepo to v5.16.0 (#9188)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Cousens <413395+dcousens@users.noreply.github.com>
  • Loading branch information
renovate[bot] and dcousens committed Jun 26, 2024
1 parent 4262e50 commit 09ffee1
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 83 deletions.
3 changes: 1 addition & 2 deletions examples/testing/example-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ test('Check that trying to create user with no name (required field) fails', asy
})
},
{
message:
'You provided invalid data for this operation.\n - User.name: Name must not be empty',
message: 'You provided invalid data for this operation.\n - User.name: Name must not be empty',
}
)
})
Expand Down
8 changes: 4 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@
"@keystone-ui/toast": "workspace:^",
"@keystone-ui/tooltip": "workspace:^",
"@nodelib/fs.walk": "^2.0.0",
"@prisma/client": "5.15.1",
"@prisma/internals": "5.15.1",
"@prisma/migrate": "5.15.1",
"@prisma/client": "5.16.0",
"@prisma/internals": "5.16.0",
"@prisma/migrate": "5.16.0",
"@sindresorhus/slugify": "^1.1.2",
"apollo-upload-client": "^17.0.0",
"bcryptjs": "^2.4.3",
Expand Down Expand Up @@ -235,7 +235,7 @@
"meow": "^9.0.0",
"next": "^14.2.0",
"pluralize": "^8.0.0",
"prisma": "5.15.1",
"prisma": "5.16.0",
"prompts": "^2.4.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/lib/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export async function withMigrate<T> (
}) => Promise<T>
) {
const migrate = new Migrate(prismaSchemaPath)
function run <T> (f: () => T): T {
async function run <T> (f: () => T) {
// only required once - on child process start - but easiest to do this always
const prevDBURLFromEnv = process.env.DATABASE_URL
const prevShadowDBURLFromEnv = process.env.SHADOW_DATABASE_URL
Expand All @@ -39,7 +39,7 @@ export async function withMigrate<T> (
process.env.DATABASE_URL = system.config.db.url
setOrRemoveEnvVariable('SHADOW_DATABASE_URL', system.config.db.shadowDatabaseUrl)
process.env.PRISMA_HIDE_UPDATE_MESSAGE = '1' // temporarily silence
return f()
return await f()
} finally {
setOrRemoveEnvVariable('DATABASE_URL', prevDBURLFromEnv)
setOrRemoveEnvVariable('SHADOW_DATABASE_URL', prevShadowDBURLFromEnv)
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { createDatabase, } from '@prisma/internals'

import { withMigrate } from './lib/migrations'

export async function resetDatabase (dbUrl: string, prismaSchemaPath: string) {
await createDatabase(dbUrl, path.dirname(prismaSchemaPath))
export async function resetDatabase (url: string, prismaSchemaPath: string) {
await createDatabase(url, path.dirname(prismaSchemaPath))
await withMigrate(prismaSchemaPath, {
config: {
db: {
url: dbUrl,
url,
shadowDatabaseUrl: ''
}
},
Expand Down
142 changes: 71 additions & 71 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/cli-tests/build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test("start errors when a build hasn't happened", async () => {
await expect(cliMock(cwd, 'start')).rejects.toEqual(new ExitError(1))
expect(recording()).toMatchInlineSnapshot(`
"? Starting Keystone
? keystone build must be run before running keystone start"
? keystone build has not been run"
`)
})

Expand Down

0 comments on commit 09ffee1

Please sign in to comment.