Skip to content

Commit

Permalink
Inline prismaClientPath for examples/ (#9300)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens authored Aug 20, 2024
1 parent 19a734c commit 7dda360
Show file tree
Hide file tree
Showing 108 changed files with 125 additions and 184 deletions.
3 changes: 1 addition & 2 deletions examples/assets-local/keystone.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { config } from '@keystone-6/core'
import { fixPrismaPath } from '../example-utils'
import { lists } from './schema'

export default config({
Expand All @@ -8,7 +7,7 @@ export default config({
url: process.env.DATABASE_URL || 'file:./keystone-example.db',

// WARNING: this is only needed for our monorepo examples, dont do this
...fixPrismaPath,
prismaClientPath: 'node_modules/myprisma',
},
lists,
storage: {
Expand Down
2 changes: 1 addition & 1 deletion examples/assets-local/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datasource sqlite {

generator client {
provider = "prisma-client-js"
output = "node_modules/.myprisma/client"
output = "node_modules/myprisma"
}

model Post {
Expand Down
3 changes: 1 addition & 2 deletions examples/assets-s3/keystone.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dotenv/config'
import { config } from '@keystone-6/core'
import { fixPrismaPath } from '../example-utils'
import { lists } from './schema'

const {
Expand All @@ -16,7 +15,7 @@ export default config({
url: process.env.DATABASE_URL || 'file:./keystone-example.db',

// WARNING: this is only needed for our monorepo examples, dont do this
...fixPrismaPath,
prismaClientPath: 'node_modules/myprisma',
},
lists,
storage: {
Expand Down
2 changes: 1 addition & 1 deletion examples/assets-s3/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datasource sqlite {

generator client {
provider = "prisma-client-js"
output = "node_modules/.myprisma/client"
output = "node_modules/myprisma"
}

model Post {
Expand Down
3 changes: 1 addition & 2 deletions examples/auth/keystone.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { config } from '@keystone-6/core'
import { statelessSessions } from '@keystone-6/core/session'
import { createAuth } from '@keystone-6/auth'
import { fixPrismaPath } from '../example-utils'
import { type Session, lists } from './schema'
import { type TypeInfo } from '.keystone/types'

Expand Down Expand Up @@ -55,7 +54,7 @@ export default withAuth<TypeInfo<Session>>(
url: process.env.DATABASE_URL || 'file:./keystone-example.db',

// WARNING: this is only needed for our monorepo examples, dont do this
...fixPrismaPath,
prismaClientPath: 'node_modules/myprisma',
},
lists,
ui: {
Expand Down
2 changes: 1 addition & 1 deletion examples/auth/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datasource sqlite {

generator client {
provider = "prisma-client-js"
output = "node_modules/.myprisma/client"
output = "node_modules/myprisma"
}

model User {
Expand Down
3 changes: 1 addition & 2 deletions examples/cloudinary/keystone.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dotenv/config'
import { config } from '@keystone-6/core'
import { fixPrismaPath } from '../example-utils'
import { lists } from './schema'

export default config({
Expand All @@ -9,7 +8,7 @@ export default config({
url: process.env.DATABASE_URL || 'file:./keystone-example.db',

// WARNING: this is only needed for our monorepo examples, dont do this
...fixPrismaPath,
prismaClientPath: 'node_modules/myprisma',
},
lists,
})
2 changes: 1 addition & 1 deletion examples/cloudinary/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datasource sqlite {

generator client {
provider = "prisma-client-js"
output = "node_modules/.myprisma/client"
output = "node_modules/myprisma"
}

model Post {
Expand Down
3 changes: 1 addition & 2 deletions examples/custom-admin-ui-logo/keystone.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { config } from '@keystone-6/core'
import { fixPrismaPath } from '../example-utils'
import { lists } from './schema'

export default config({
Expand All @@ -8,7 +7,7 @@ export default config({
url: process.env.DATABASE_URL || 'file:./keystone-example.db',

// WARNING: this is only needed for our monorepo examples, dont do this
...fixPrismaPath,
prismaClientPath: 'node_modules/myprisma',
},
lists,
})
2 changes: 1 addition & 1 deletion examples/custom-admin-ui-logo/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datasource sqlite {

generator client {
provider = "prisma-client-js"
output = "node_modules/.myprisma/client"
output = "node_modules/myprisma"
}

model Task {
Expand Down
3 changes: 1 addition & 2 deletions examples/custom-admin-ui-navigation/keystone.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { config } from '@keystone-6/core'
import { fixPrismaPath } from '../example-utils'
import { lists } from './schema'

export default config({
Expand All @@ -8,7 +7,7 @@ export default config({
url: process.env.DATABASE_URL || 'file:./keystone-example.db',

// WARNING: this is only needed for our monorepo examples, dont do this
...fixPrismaPath,
prismaClientPath: 'node_modules/myprisma',
},
lists,
})
2 changes: 1 addition & 1 deletion examples/custom-admin-ui-navigation/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datasource sqlite {

generator client {
provider = "prisma-client-js"
output = "node_modules/.myprisma/client"
output = "node_modules/myprisma"
}

model Task {
Expand Down
3 changes: 1 addition & 2 deletions examples/custom-admin-ui-pages/keystone.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { config } from '@keystone-6/core'
import { fixPrismaPath } from '../example-utils'
import { lists } from './schema'

export default config({
Expand All @@ -8,7 +7,7 @@ export default config({
url: process.env.DATABASE_URL || 'file:./keystone-example.db',

// WARNING: this is only needed for our monorepo examples, dont do this
...fixPrismaPath,
prismaClientPath: 'node_modules/myprisma',
},
lists,
})
2 changes: 1 addition & 1 deletion examples/custom-admin-ui-pages/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datasource sqlite {

generator client {
provider = "prisma-client-js"
output = "node_modules/.myprisma/client"
output = "node_modules/myprisma"
}

model Task {
Expand Down
3 changes: 1 addition & 2 deletions examples/custom-esbuild/keystone.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { config } from '@keystone-6/core'
import { fixPrismaPath } from '../example-utils'
import { lists } from './schema'
import type { TypeInfo } from '.keystone/types'

Expand All @@ -9,7 +8,7 @@ export default config<TypeInfo>({
url: process.env.DATABASE_URL || 'file:./keystone-example.db',

// WARNING: this is only needed for our monorepo examples, don't do this
...fixPrismaPath,
prismaClientPath: 'node_modules/myprisma',
},
lists,
})
2 changes: 1 addition & 1 deletion examples/custom-esbuild/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datasource sqlite {

generator client {
provider = "prisma-client-js"
output = "node_modules/.myprisma/client"
output = "node_modules/myprisma"
}

model Post {
Expand Down
3 changes: 1 addition & 2 deletions examples/custom-field-view/keystone.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { config } from '@keystone-6/core'
import { fixPrismaPath } from '../example-utils'
import { lists } from './schema'

export default config({
Expand All @@ -8,7 +7,7 @@ export default config({
url: process.env.DATABASE_URL || 'file:./keystone-example.db',

// WARNING: this is only needed for our monorepo examples, dont do this
...fixPrismaPath,
prismaClientPath: 'node_modules/myprisma',
},
lists,
})
2 changes: 1 addition & 1 deletion examples/custom-field-view/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datasource sqlite {

generator client {
provider = "prisma-client-js"
output = "node_modules/.myprisma/client"
output = "node_modules/myprisma"
}

model Task {
Expand Down
3 changes: 1 addition & 2 deletions examples/custom-field/keystone.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { config } from '@keystone-6/core'
import { fixPrismaPath } from '../example-utils'
import { lists } from './schema'
import type { TypeInfo } from '.keystone/types'

Expand All @@ -9,7 +8,7 @@ export default config<TypeInfo>({
url: process.env.DATABASE_URL || 'file:./keystone-example.db',

// WARNING: this is only needed for our monorepo examples, dont do this
...fixPrismaPath,
prismaClientPath: 'node_modules/myprisma',
},
lists,
})
2 changes: 1 addition & 1 deletion examples/custom-field/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datasource sqlite {

generator client {
provider = "prisma-client-js"
output = "node_modules/.myprisma/client"
output = "node_modules/myprisma"
}

model Post {
Expand Down
3 changes: 1 addition & 2 deletions examples/custom-id/keystone.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { config } from '@keystone-6/core'
import { fixPrismaPath } from '../example-utils'
import { lists } from './schema'
import type { TypeInfo } from '.keystone/types'

Expand All @@ -12,7 +11,7 @@ export default config<TypeInfo>({
idField: { kind: 'random', bytes: 16, encoding: 'hex' },

// WARNING: this is only needed for our monorepo examples, don't do this
...fixPrismaPath,
prismaClientPath: 'node_modules/myprisma',
},
lists,
})
2 changes: 1 addition & 1 deletion examples/custom-id/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datasource sqlite {

generator client {
provider = "prisma-client-js"
output = "node_modules/.myprisma/client"
output = "node_modules/myprisma"
}

model Task {
Expand Down
3 changes: 1 addition & 2 deletions examples/custom-session-invalidation/keystone.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { config } from '@keystone-6/core'
import { statelessSessions } from '@keystone-6/core/session'
import { createAuth } from '@keystone-6/auth'
import { fixPrismaPath } from '../example-utils'
import { lists, type Session } from './schema'
import type { Config, Context, TypeInfo } from '.keystone/types'

Expand Down Expand Up @@ -74,7 +73,7 @@ export default withSessionInvalidation(
url: process.env.DATABASE_URL || 'file:./keystone-example.db',

// WARNING: this is only needed for our monorepo examples, dont do this
...fixPrismaPath,
prismaClientPath: 'node_modules/myprisma',
},
lists,
// you can find out more at https://keystonejs.com/docs/apis/session#session-api
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-session-invalidation/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datasource sqlite {

generator client {
provider = "prisma-client-js"
output = "node_modules/.myprisma/client"
output = "node_modules/myprisma"
}

model User {
Expand Down
3 changes: 1 addition & 2 deletions examples/custom-session-jwt/keystone.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import jwt from 'jsonwebtoken'
import { config } from '@keystone-6/core'
import { fixPrismaPath } from '../example-utils'
import { lists, type Session } from './schema'
import type { Context, TypeInfo } from '.keystone/types'

Expand Down Expand Up @@ -83,7 +82,7 @@ export default config<TypeInfo>({
url: process.env.DATABASE_URL || 'file:./keystone-example.db',

// WARNING: this is only needed for our monorepo examples, dont do this
...fixPrismaPath,
prismaClientPath: 'node_modules/myprisma',

onConnect: async () => {
// WARNING: remove this
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-session-jwt/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datasource sqlite {

generator client {
provider = "prisma-client-js"
output = "node_modules/.myprisma/client"
output = "node_modules/myprisma"
}

model Post {
Expand Down
3 changes: 1 addition & 2 deletions examples/custom-session-next-auth/keystone.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { config } from '@keystone-6/core'
import { fixPrismaPath } from '../example-utils'
import { lists } from './schema'

import { type Session, nextAuthSessionStrategy } from './session'
Expand All @@ -15,7 +14,7 @@ export default config<TypeInfo<Session>>({
url: process.env.DATABASE_URL || 'file:./keystone-example.db',

// WARNING: this is only needed for our monorepo examples, dont do this
...fixPrismaPath,
prismaClientPath: 'node_modules/myprisma',
},
ui: {
// the following api routes are required for nextauth.js
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-session-next-auth/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datasource sqlite {

generator client {
provider = "prisma-client-js"
output = "node_modules/.myprisma/client"
output = "node_modules/myprisma"
}

model Post {
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-session-next-auth/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async function getKeystoneContext () {
// We use the prisma client from the .myprisma folder in order to support multiple Prisma Clients in our examples
// your project will only have one Prisma Client, so you can use the following instead:
// await import('@prisma/client')
await import('.myprisma/client')
await import('myprisma')
)
if (process.env.NODE_ENV !== 'production') {
(globalThis as any)._keystoneContext = _keystoneContext
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-session-passport/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Passport } from 'passport'
import { type VerifyCallback } from 'passport-oauth2'
import { Strategy, StrategyOptions, Profile } from 'passport-github2'

import { type Author } from '.myprisma/client'
import { type Author } from 'myprisma'
import { type TypeInfo } from '.keystone/types'

export type Session = Author
Expand Down
3 changes: 1 addition & 2 deletions examples/custom-session-passport/keystone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ import {
session,
passportMiddleware
} from './auth'
import { fixPrismaPath } from '../example-utils'

export default config<TypeInfo<Session>>({
db: {
provider: 'sqlite',
url: 'file:./keystone.db',

// WARNING: this is only needed for our monorepo examples, dont do this
...fixPrismaPath,
prismaClientPath: 'node_modules/myprisma',
},
lists,
session,
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-session-passport/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datasource sqlite {

generator client {
provider = "prisma-client-js"
output = "node_modules/.myprisma/client"
output = "node_modules/myprisma"
}

model Post {
Expand Down
Loading

0 comments on commit 7dda360

Please sign in to comment.