Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix transaction passthrough types, and add linting for examples #9301

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/tests_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ jobs:
- name: Prisma Filters
run: pnpm test:filters

linting-examples:
name: Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: ./.github/actions/ci-setup-examples

- name: TypeScript
run: pnpm test:types

unit_tests:
name: Package Unit Tests
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion examples/custom-output-paths/my-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ export type TypeInfo<Session = any> = {
readonly Post: Lists.Post.TypeInfo<Session>
}
prisma: import('./node_modules/myprisma').PrismaClient
prismaTypes: import('./node_modules/myprisma').Prisma
session: Session
}

Expand Down
1 change: 0 additions & 1 deletion examples/extend-graphql-schema-nexus/keystone-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ export type TypeInfo<Session = any> = {
readonly Author: Lists.Author.TypeInfo<Session>
}
prisma: import('./node_modules/myprisma').PrismaClient
prismaTypes: import('./node_modules/myprisma').Prisma
session: Session
}

Expand Down
1 change: 0 additions & 1 deletion packages/core/src/lib/typescript-schema-printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ export function printGeneratedTypes (
})(),
` }`,
` prisma: import('${prismaClientPath}').PrismaClient`,
` prismaTypes: import('${prismaClientPath}').Prisma`,
` session: Session`,
`}`,
``,
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/types/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export type KeystoneContext<TypeInfo extends BaseKeystoneTypeInfo = BaseKeystone
options?: {
maxWait?: number
timeout?: number
isolationLevel?: TypeInfo['prismaTypes']['TransactionIsolationLevel']
isolationLevel?: {
Serializable: 'Serializable'
}
}
) => Promise<T>

Expand Down
1 change: 0 additions & 1 deletion packages/core/src/types/type-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@ export type KeystoneContextFromListTypeInfo<ListTypeInfo extends BaseListTypeInf
export type BaseKeystoneTypeInfo<Session = any> = {
lists: Record<string, BaseListTypeInfo<Session>>
prisma: any
prismaTypes: any
session: any
}
1 change: 0 additions & 1 deletion packages/core/src/types/type-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const someContext: KeystoneContext<{
ListOrSingleton: BaseListTypeInfo
}
prisma: any
prismaTypes: any
session: any
}> = undefined!

Expand Down
1 change: 0 additions & 1 deletion tests/cli-tests/__snapshots__/artifacts.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ export type TypeInfo<Session = any> = {
readonly Todo: Lists.Todo.TypeInfo<Session>
}
prisma: import('@prisma/client').PrismaClient
prismaTypes: import('@prisma/client').Prisma
session: Session
}

Expand Down
Loading