create-nextjs-cms 0.9.29 → 0.9.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-nextjs-cms",
3
- "version": "0.9.29",
3
+ "version": "0.9.31",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
@@ -29,8 +29,8 @@
29
29
  "tsx": "^4.20.6",
30
30
  "typescript": "^5.9.2",
31
31
  "@lzcms/eslint-config": "0.3.0",
32
- "@lzcms/tsconfig": "0.1.0",
33
- "@lzcms/prettier-config": "0.1.0"
32
+ "@lzcms/prettier-config": "0.1.0",
33
+ "@lzcms/tsconfig": "0.1.0"
34
34
  },
35
35
  "prettier": "@lzcms/prettier-config",
36
36
  "scripts": {
@@ -1,3 +1,4 @@
1
+ import dynamic from 'next/dynamic'
1
2
  import type { ComponentType } from 'react'
2
3
 
3
4
  export const pluginNamesMap: Record<string, string> = {
@@ -12,11 +13,14 @@ export const getPluginServerComponent = async (
12
13
  pluginName: string,
13
14
  componentName: string | undefined,
14
15
  ): Promise<ComponentType | null> => {
15
- const modulePath = pluginNamesMap[pluginName] ?? pluginNamesMap.blank
16
+ const modulePath = pluginNamesMap[pluginName]
16
17
  if (!modulePath) return null
17
-
18
- const mod = (await import(modulePath)) as Record<string, unknown>
19
- const component = (componentName ? mod[componentName] : mod.default) as ComponentType | undefined
20
-
21
- return component ?? null
18
+ const Component = dynamic(
19
+ () =>
20
+ import(modulePath ?? 'nextjs-cms/plugins/blank-component').then(
21
+ (mod) => (componentName ? mod[componentName] : mod.default) as ComponentType,
22
+ ),
23
+ { ssr: true },
24
+ )
25
+ return Component
22
26
  }
@@ -70,7 +70,7 @@
70
70
  "nanoid": "^5.1.2",
71
71
  "next": "16.2.5",
72
72
  "next-themes": "^0.4.6",
73
- "nextjs-cms": "0.9.29",
73
+ "nextjs-cms": "0.9.31",
74
74
  "plaiceholder": "^3.0.0",
75
75
  "prettier-plugin-tailwindcss": "^0.7.2",
76
76
  "qrcode": "^1.5.4",