dynamic-zone 1.0.3 → 1.0.5

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.
Files changed (2) hide show
  1. package/index.js +7 -7
  2. package/package.json +10 -10
package/index.js CHANGED
@@ -5,20 +5,20 @@ const path = require("path");
5
5
 
6
6
  const basePath = process.cwd();
7
7
 
8
- // Safety check: prevent creating inside node_modules
8
+ // Prevent creating inside node_modules
9
9
  if (basePath.includes("node_modules")) {
10
10
  console.log("❌ Do not run inside node_modules");
11
11
  process.exit(0);
12
12
  }
13
13
 
14
- // Use src folder
15
- const srcPath = path.join(basePath, "src");
14
+ // Ensure src folder exists
15
+ const srcPath = path.join(basePath, "app");
16
16
  if (!fs.existsSync(srcPath)) {
17
- console.log("⚠️ No src folder found, skipping dynamic-zone setup");
17
+ console.log("⚠️ No app folder found. Please create a 'app' folder first.");
18
18
  process.exit(0);
19
19
  }
20
20
 
21
- // Paths
21
+ // Paths for folders
22
22
  const cmsPath = path.join(srcPath, "cms");
23
23
  const componentsPath = path.join(cmsPath, "components");
24
24
  const dynamicZonePath = path.join(cmsPath, "dynamic-zone");
@@ -31,7 +31,7 @@ const dynamicZonePath = path.join(cmsPath, "dynamic-zone");
31
31
  }
32
32
  });
33
33
 
34
- // File content
34
+ // Section Renderer file content
35
35
  const fileContent = `import dynamic from "next/dynamic";
36
36
  import { Suspense } from "react";
37
37
 
@@ -97,7 +97,7 @@ export default function SectionRenderer({ sections, slug }: Props) {
97
97
  }
98
98
  `;
99
99
 
100
- // Create file
100
+ // Write file
101
101
  const filePath = path.join(dynamicZonePath, "section-renderer.tsx");
102
102
  if (!fs.existsSync(filePath)) {
103
103
  fs.writeFileSync(filePath, fileContent);
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "dynamic-zone",
3
- "version": "1.0.3",
4
- "description": "dynamic zone for cms platforms",
3
+ "version": "1.0.5",
4
+ "description": "Dynamic zone scaffolding for Next.js apps",
5
+ "main": "index.js",
6
+ "type": "commonjs",
7
+ "author": "Web Dev Simplified",
8
+ "license": "ISC",
5
9
  "keywords": [
6
- "dynamic-zone"
10
+ "dynamic-zone",
11
+ "cms",
12
+ "nextjs",
13
+ "scaffold"
7
14
  ],
8
- "license": "ISC",
9
- "author": "Web Dev Simplified",
10
- "type": "commonjs",
11
- "main": "index.js",
12
- "scripts": {
13
- "test": "echo \"Error: no test specified\" && exit 1"
14
- },
15
15
  "bin": {
16
16
  "dynamic-zone": "./index.js"
17
17
  }