From 2e6ba5ca0dcdccefa46970f02c9d9864005bd048 Mon Sep 17 00:00:00 2001 From: Daniel Cousens <413395+dcousens@users.noreply.github.com> Date: Thu, 4 Apr 2024 15:58:00 +1100 Subject: [PATCH] fixes for @keystone-6/core/system and resolveDefault changes --- packages/core/src/artifacts.ts | 4 +--- packages/core/src/scripts/build.ts | 1 + packages/core/src/scripts/dev.ts | 5 ++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/core/src/artifacts.ts b/packages/core/src/artifacts.ts index dd574f31054..a6895a4bc59 100644 --- a/packages/core/src/artifacts.ts +++ b/packages/core/src/artifacts.ts @@ -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' @@ -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) { diff --git a/packages/core/src/scripts/build.ts b/packages/core/src/scripts/build.ts index be4a15122ba..3f080363401 100644 --- a/packages/core/src/scripts/build.ts +++ b/packages/core/src/scripts/build.ts @@ -30,6 +30,7 @@ export async function build ( } await system.generateTypes(cwd) + await system.generatePrismaClient(cwd) } if (config.ui?.isDisabled || !ui) return diff --git a/packages/core/src/scripts/dev.ts b/packages/core/src/scripts/dev.ts index 321a87efd85..b5fee29740a 100644 --- a/packages/core/src/scripts/dev.ts +++ b/packages/core/src/scripts/dev.ts @@ -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( @@ -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) @@ -387,4 +386,4 @@ export async function dev ( await initKeystone() return () => Promise.resolve() } -} \ No newline at end of file +}