Skip to content

Commit

Permalink
feat: support prisma up to 2.24 (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt authored Jun 1, 2021
1 parent 661804a commit 2704ff2
Show file tree
Hide file tree
Showing 8 changed files with 944 additions and 1,539 deletions.
2 changes: 0 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { InitialOptionsTsJest } from 'ts-jest/dist/types'

const config: InitialOptionsTsJest = {
preset: 'ts-jest',
testEnvironment: 'node',
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
testPathIgnorePatterns: process.env.CI ? [] : ['.*e2e.*'],
globals: {
Expand All @@ -15,7 +14,6 @@ const config: InitialOptionsTsJest = {
ignoreCodes: [7006, 7031],
}
: false,
babelConfig: false,
tsconfig: '<rootDir>/tests/tsconfig.json',
},
},
Expand Down
40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,48 +44,48 @@
"devDependencies": {
"@homer0/prettier-plugin-jsdoc": "^4.0.0",
"@prisma-labs/prettier-config": "0.1.0",
"@prisma/client": "2.22.1",
"@prisma/sdk": "^2.22.1",
"@prisma/client": "2.24.0",
"@prisma/sdk": "^2.24.0",
"@types/debug": "^4.1.5",
"@types/jest": "26.0.23",
"@types/lodash": "^4.14.168",
"@types/lodash": "^4.14.170",
"@types/pluralize": "^0.0.29",
"@types/semver": "^7.3.5",
"@types/semver": "^7.3.6",
"@types/strip-ansi": "^5.2.1",
"@typescript-eslint/eslint-plugin": "^4.22.1",
"@typescript-eslint/parser": "^4.22.1",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"arg": "^5.0.0",
"cross-env": "^7.0.3",
"dripip": "0.10.0",
"eslint": "^7.25.0",
"eslint": "^7.27.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-only-warn": "^1.0.2",
"execa": "^5.0.0",
"execa": "^5.0.1",
"graphql": "^15.5.0",
"graphql-request": "^3.4.0",
"graphql-tag": "^2.12.4",
"jest": "26.6.3",
"jest-watch-typeahead": "0.6.3",
"jest": "27.0.3",
"jest-watch-typeahead": "0.6.4",
"lodash": "^4.17.21",
"markdown-toc": "^1.2.0",
"nexus": "^1.0.0",
"nodemon": "^2.0.7",
"prettier": "2.2.1",
"prisma": "2.22.1",
"strip-ansi": "6",
"ts-jest": "26.5.6",
"ts-node": "^9.1.1",
"type-fest": "^1.1.0",
"typescript": "^4.2.4",
"zod": "^3.0.0-beta.1"
"prettier": "2.3.0",
"prisma": "2.24.0",
"strip-ansi": "^6",
"ts-jest": "27.0.2",
"ts-node": "^10.0.0",
"type-fest": "^1.2.0",
"typescript": "4.2.x",
"zod": "^3.1.0"
},
"prettier": "@prisma-labs/prettier-config",
"peerDependencies": {
"@prisma/client": "2.17.x || 2.18.x",
"@prisma/client": "2.17.x || 2.18.x || 2.19.x || 2.20.x || 2.21.x || 2.22.x || 2.23.x || 2.24.x",
"nexus": "^1.0.0"
},
"dependencies": {
"@prisma/generator-helper": "^2.22.1",
"@prisma/generator-helper": "^2.24.0",
"debug": "^4.3.1",
"dindist": "^1.0.2",
"fs-jetpack": "^4.1.0",
Expand Down
1 change: 0 additions & 1 deletion settings.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion settings.js

This file was deleted.

14 changes: 6 additions & 8 deletions src/generator/models/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,13 @@ function createNexusEnumTypeDefConfigurations(
settings: Settings
): NexusEnumTypeDefConfigurations {
return chain(dmmf.datamodel.enums)
.map(
(enum_): AnyNexusEnumTypeConfig => {
return {
name: enum_.name,
description: settings.gentime.docPropagation.GraphQLDocs ? enum_.documentation : undefined,
members: enum_.values.map((val) => val.name),
}
.map((enum_): AnyNexusEnumTypeConfig => {
return {
name: enum_.name,
description: settings.gentime.docPropagation.GraphQLDocs ? enum_.documentation : undefined,
members: enum_.values.map((val) => val.name),
}
)
})
.keyBy('name')
.value()
}
14 changes: 9 additions & 5 deletions tests/__helpers__/testers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,15 @@ export function testIntegration(params: IntegrationTestParams) {

const itOrItOnlyOrItSkip = params.only ? it.only : params.skip ? it.skip : it

itOrItOnlyOrItSkip(params.description, async () => {
const result = await integrationTest(params)
expect(result.graphqlSchemaSDL).toMatchSnapshot(`graphqlSchemaSDL`)
expect(result.graphqlOperationExecutionResult).toMatchSnapshot(`graphqlOperationExecutionResult`)
})
itOrItOnlyOrItSkip(
params.description,
async () => {
const result = await integrationTest(params)
expect(result.graphqlSchemaSDL).toMatchSnapshot(`graphqlSchemaSDL`)
expect(result.graphqlOperationExecutionResult).toMatchSnapshot(`graphqlOperationExecutionResult`)
},
30_000
)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,4 +374,4 @@ it('When bundled custom scalars are used the project type checks and generates e
d(`stopped server`)

expect(data).toMatchSnapshot('client request 1')
}, 30_000)
}, 60_000)
Loading

0 comments on commit 2704ff2

Please sign in to comment.