Skip to content

Commit

Permalink
fixes for @keystone-6/core/system and resolveDefault changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed Apr 4, 2024
1 parent 722a6b5 commit 2e6ba5c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions packages/core/src/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { printSchema, GraphQLSchema } from 'graphql'
import { getGenerators, formatSchema } from '@prisma/internals'
import { ExitError } from './scripts/utils'
import type { KeystoneConfig } from './types'
import { resolveDefaults } from './lib/defaults'
import { initialiseLists } from './lib/core/initialise-lists'
import { printPrismaSchema } from './lib/core/prisma-schema-printer'

Expand Down Expand Up @@ -70,8 +69,7 @@ export function getBuiltKeystoneConfigurationPath (cwd: string) {
}

export function getBuiltKeystoneConfiguration (cwd: string) {
const configPath = getBuiltKeystoneConfigurationPath(cwd)
return require(configPath).default
return require(getBuiltKeystoneConfigurationPath(cwd)).default
}

function posixify (s: string) {
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export async function build (
}

await system.generateTypes(cwd)
await system.generatePrismaClient(cwd)
}

if (config.ui?.isDisabled || !ui) return
Expand Down
5 changes: 2 additions & 3 deletions packages/core/src/scripts/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export async function dev (
console.log('✨ Generating GraphQL and Prisma schemas')
const prismaSchema = (await system.generateArtifacts(cwd)).prisma
await system.generateTypes(cwd)
const prismaClientGenerationPromise = system.generatePrismaClient(cwd)
await system.generatePrismaClient(cwd)

if (config.db.useMigrations) {
await devMigrations(
Expand All @@ -177,7 +177,6 @@ export async function dev (
console.warn('⚠️ Skipping database schema push')
}

await prismaClientGenerationPromise
const prismaClientModule = require(paths.prisma)
const keystone = system.getKeystone(prismaClientModule)

Expand Down Expand Up @@ -387,4 +386,4 @@ export async function dev (
await initKeystone()
return () => Promise.resolve()
}
}
}

0 comments on commit 2e6ba5c

Please sign in to comment.