Skip to content

Commit

Permalink
tidy up circular comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed Jun 25, 2024
1 parent f52f12c commit 192fd8e
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 8 deletions.
2 changes: 0 additions & 2 deletions packages/core/src/scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/scripts/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/scripts/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
4 changes: 1 addition & 3 deletions packages/core/src/scripts/prisma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/scripts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 192fd8e

Please sign in to comment.