Skip to content

Commit

Permalink
Remove KeystoneConfig parameter from getAdditionalFiles function …
Browse files Browse the repository at this point in the history
…type
  • Loading branch information
dcousens committed Apr 4, 2024
1 parent 31986c1 commit fb5b7f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/no-additional-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-6/core': major
---

Remove `KeystoneConfig` parameter from getAdditionalFiles function type
2 changes: 1 addition & 1 deletion packages/core/src/admin-ui/system/generateAdminUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export async function generateAdminUI (
}

// Write out the files configured by the user
const userFiles = config.ui?.getAdditionalFiles?.map(x => x(config)) ?? []
const userFiles = config.ui?.getAdditionalFiles?.map(x => x()) ?? []
const userFilesToWrite = (await Promise.all(userFiles)).flat()
const savedFiles = await Promise.all(
userFilesToWrite.map(file => writeAdminFile(file, projectAdminPath))
Expand Down
5 changes: 2 additions & 3 deletions packages/core/src/types/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export type KeystoneConfig<TypeInfo extends BaseKeystoneTypeInfo = BaseKeystoneT
storage?: Record<string, StorageConfig>
/** Telemetry boolean to disable telemetry for this project */
telemetry?: boolean

ui?: AdminUIConfig<TypeInfo>
}

Expand Down Expand Up @@ -161,9 +162,7 @@ export type AdminUIConfig<TypeInfo extends BaseKeystoneTypeInfo> = {
/** The Base Path for Keystones Admin UI */
basePath?: string

getAdditionalFiles?: readonly ((
config: KeystoneConfig<TypeInfo>
) => MaybePromise<readonly AdminFileToWrite[]>)[]
getAdditionalFiles?: readonly (() => MaybePromise<readonly AdminFileToWrite[]>)[]

/** An async middleware function that can optionally return a redirect */
pageMiddleware?: (args: {
Expand Down

0 comments on commit fb5b7f1

Please sign in to comment.