diff --git a/packages/core/src/scripts/build.ts b/packages/core/src/scripts/build.ts index 002958efdac..4c45c1ae1e0 100644 --- a/packages/core/src/scripts/build.ts +++ b/packages/core/src/scripts/build.ts @@ -21,9 +21,7 @@ export async function build ( // TODO: should this happen if frozen? await esbuild.build(getEsbuildConfig(cwd)) - // TODO: this cannot be changed for now, circular dependency with getSystemPaths, getEsbuildConfig const system = createSystem(await importBuiltKeystoneConfiguration(cwd)) - if (prisma) { if (frozen) { await validateArtifacts(cwd, system) diff --git a/packages/core/src/scripts/dev.ts b/packages/core/src/scripts/dev.ts index 28a1b69b0f5..b735999ebf5 100644 --- a/packages/core/src/scripts/dev.ts +++ b/packages/core/src/scripts/dev.ts @@ -125,7 +125,7 @@ export async function dev ( if (exit) throw new ExitError(1) } - // TODO: this cannot be changed for now, circular dependency with getSystemPaths, getEsbuildConfig + const app = server ? express() : null const httpServer = app ? createServer(app) : null let expressServer: express.Express | null = null diff --git a/packages/core/src/scripts/migrate.ts b/packages/core/src/scripts/migrate.ts index 4b529ec9cd3..6fbf03aa27f 100644 --- a/packages/core/src/scripts/migrate.ts +++ b/packages/core/src/scripts/migrate.ts @@ -58,9 +58,7 @@ export async function migrateCreate ( ) { await esbuild.build(getEsbuildConfig(cwd)) - // TODO: this cannot be changed for now, circular dependency with getSystemPaths, getEsbuildConfig const system = createSystem(await importBuiltKeystoneConfiguration(cwd)) - if (frozen) { await validateArtifacts(cwd, system) console.log('✨ GraphQL and Prisma schemas are up to date') diff --git a/packages/core/src/scripts/prisma.ts b/packages/core/src/scripts/prisma.ts index 40034609f53..a200eba238b 100644 --- a/packages/core/src/scripts/prisma.ts +++ b/packages/core/src/scripts/prisma.ts @@ -34,9 +34,7 @@ async function spawnPrisma3 (cwd: string, system: { export async function prisma (cwd: string, args: string[], frozen: boolean) { // TODO: should build unless --frozen? - // TODO: this cannot be changed for now, circular dependency with getSystemPaths, getEsbuildConfig - const config = await importBuiltKeystoneConfiguration(cwd) - const system = createSystem(config) + const system = createSystem(await importBuiltKeystoneConfiguration(cwd)) await validateArtifacts(cwd, system) console.log('✨ GraphQL and Prisma schemas are up to date') diff --git a/packages/core/src/scripts/utils.ts b/packages/core/src/scripts/utils.ts index 8f73769573a..840c6c420c2 100644 --- a/packages/core/src/scripts/utils.ts +++ b/packages/core/src/scripts/utils.ts @@ -8,6 +8,7 @@ export class ExitError extends Error { } } +// TODO: this cannot be changed for now, circular dependency with getSystemPaths, getEsbuildConfig export async function importBuiltKeystoneConfiguration (cwd: string) { try { return require(getBuiltKeystoneConfigurationPath(cwd)).default