Skip to content

Commit

Permalink
Refactor cache.ts: Update cache configuration to use sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Adammatthiesen committed Dec 17, 2024
1 parent 3ec7ef6 commit 8dfd290
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/studiocms_core/src/hooks/config-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const configSetup = defineUtility('astro:config:setup')(
export const AuthConfig = ${JSON.stringify(options.dashboardConfig.AuthConfig)};
export const developerConfig = ${JSON.stringify(options.dashboardConfig.developerConfig)};
export const defaultFrontEndConfig = ${JSON.stringify(options.defaultFrontEndConfig)};
export const sdkConfig = ${JSON.stringify(options.sdk)};
export const sdk = ${JSON.stringify(options.sdk)};
`,
'studiocms:version': `
export default '${version}';
Expand Down
4 changes: 2 additions & 2 deletions packages/studiocms_core/src/sdk-utils/cache.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sdkConfig } from 'studiocms:config';
import { sdk } from 'studiocms:config';
import { CMSSiteConfigId } from '../consts';
import studioCMS_SDK_GET from './get';
import type {
Expand All @@ -15,7 +15,7 @@ export type { STUDIOCMS_SDK_CACHE, PageDataCacheObject, SiteConfigCacheObject };
const {
cacheConfig,
cacheConfig: { enabled: isEnabled },
} = sdkConfig;
} = sdk;

/**
* Cache object to store content retrieved from the database.
Expand Down
2 changes: 1 addition & 1 deletion packages/studiocms_core/src/stubs/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dtsFile.addModule('studiocms:config', {
typeDef: `import('${resolve('../schemas/config/index.ts')}').StudioCMSConfig['defaultFrontEndConfig']`,
},
{
name: 'sdkConfig',
name: 'sdk',
typeDef: `import('${resolve('../schemas/config/index.ts')}').StudioCMSConfig['sdk']`,
},
],
Expand Down

0 comments on commit 8dfd290

Please sign in to comment.