From 2ae9c5d7dc1a92eaf3d3d718e86a72f7328a77ec Mon Sep 17 00:00:00 2001 From: Daniel Lautzenheiser Date: Wed, 12 Jul 2023 15:11:08 -0400 Subject: [PATCH] fix: bug fixes --- packages/core/src/index.ts | 2 ++ packages/core/src/lib/registry.ts | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index d954ce9d..b4ab9d72 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -10,6 +10,7 @@ import useEntries from './lib/hooks/useEntries'; import useHasChildErrors from './lib/hooks/useHasChildErrors'; import useMediaFiles from './lib/hooks/useMediaFiles'; import useFolderSupport from './lib/hooks/useFolderSupport'; +import { currentBackend } from './backend'; export * from './backends'; export * from './interface'; @@ -20,6 +21,7 @@ export * from './widgets'; const CMS = { ...Registry, init: bootstrap, + currentBackend, }; if (typeof window !== 'undefined') { diff --git a/packages/core/src/lib/registry.ts b/packages/core/src/lib/registry.ts index b329b130..73ed45bb 100644 --- a/packages/core/src/lib/registry.ts +++ b/packages/core/src/lib/registry.ts @@ -583,8 +583,7 @@ export async function invokeEvent(event: { console.info( `[StaticCMS] Firing change event for field "${field}" for${ event.file ? ` "${event.file}" file in` : '' - } "${collection}" collection, new value:`, - data, + } "${collection}" collection`, ); const collectionHandlers = registry.eventHandlers[name][collection] ?? {}; @@ -790,7 +789,7 @@ export function getAdditionalLink(id: string): AdditionalLink | undefined { * Markdown editor shortcodes */ export function registerShortcode

(name: string, config: ShortcodeConfig

) { - if (registry.backends[name]) { + if (registry.shortcodes[name]) { console.error(`Shortcode [${name}] already registered. Please choose a different name.`); return; }