mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
fix cloudflare adapter warm mode and type improvements
Adds warm mode support to cloudflare adapter to enable app instance caching. Improves BkndConfig type handling and makes hybrid mode reader optional. Fixes entity hook types to properly handle Generated ID types from kysely.
This commit is contained in:
@@ -9,7 +9,7 @@ export type BkndHybridModeOptions = {
|
||||
* Reader function to read the configuration from the file system.
|
||||
* This is required for hybrid mode to work.
|
||||
*/
|
||||
reader: (path: string) => MaybePromise<string | object>;
|
||||
reader?: (path: string) => MaybePromise<string | object>;
|
||||
/**
|
||||
* Provided secrets to be merged into the configuration
|
||||
*/
|
||||
@@ -47,7 +47,7 @@ export function hybrid<
|
||||
"You must set a `reader` option when using hybrid mode",
|
||||
);
|
||||
|
||||
const fileContent = await appConfig.reader(configFilePath);
|
||||
const fileContent = await appConfig.reader?.(configFilePath);
|
||||
let fileConfig = typeof fileContent === "string" ? JSON.parse(fileContent) : fileContent;
|
||||
if (!fileConfig) {
|
||||
$console.warn("No config found, using default config");
|
||||
|
||||
Reference in New Issue
Block a user