babyclara 0.0.6 → 0.0.8

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/core/index.js ADDED
@@ -0,0 +1 @@
1
+ console.log('Baby Clara Launched')
package/index.js CHANGED
@@ -34,15 +34,43 @@ function copyFolder(src, dest) {
34
34
 
35
35
  console.log("Generating Work Station...");
36
36
 
37
+ // Copy folders
37
38
  foldersToCopy.forEach(folder => {
38
39
  const src = path.join(__dirname, folder.from);
39
40
  const dest = path.join(targetDir, folder.to);
40
41
  copyFolder(src, dest);
41
42
  });
42
43
 
43
- // Install gkrane and cross-env locally
44
+ // Install dependencies
44
45
  console.log("Installing Dependencies...");
45
- execSync("npm install gkrane cross-env --save", { cwd: targetDir, stdio: "inherit" });
46
+ execSync("npm install gkrane cross-env --save", {
47
+ cwd: targetDir,
48
+ stdio: "inherit"
49
+ });
50
+
51
+ // Move local ./core into node_modules/babyclara/core
52
+ const localCore = path.join(targetDir, "core");
53
+ const babyclaraCore = path.join(
54
+ targetDir,
55
+ "node_modules",
56
+ "babyclara",
57
+ "core"
58
+ );
59
+
60
+ if (fs.existsSync(localCore)) {
61
+ console.log("Moving ./core into node_modules/babyclara/core...");
62
+ copyFolder(localCore, babyclaraCore);
63
+ fs.rmSync(localCore, { recursive: true, force: true });
64
+ } else {
65
+ console.log("No local ./core folder found, skipping move.");
66
+ }
67
+
68
+ // Delete template folder after setup
69
+ const templatePath = path.join(targetDir, "template");
70
+ if (fs.existsSync(templatePath)) {
71
+ console.log("Removing template folder...");
72
+ fs.rmSync(templatePath, { recursive: true, force: true });
73
+ }
46
74
 
47
75
  // Modify package.json
48
76
  const pkgPath = path.join(targetDir, "package.json");
@@ -52,15 +80,13 @@ if (fs.existsSync(pkgPath)) {
52
80
 
53
81
  pkg.scripts = pkg.scripts || {};
54
82
 
55
- // Start script (normal run)
56
- pkg.scripts.start = "node ./node_modules/gkrane/core/index.js";
83
+ pkg.scripts.start =
84
+ "node ./node_modules/babyclara/core/index.js";
57
85
 
58
- // Build script (with ENV: BUILD=true)
59
86
  pkg.scripts.build =
60
- "cross-env BUILD=true node ./node_modules/gkrane/core/index.js";
87
+ "cross-env BUILD=true node ./node_modules/babyclara/core/index.js";
61
88
 
62
89
  fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
63
-
64
90
  console.log("Updated package.json scripts successfully.");
65
91
  } else {
66
92
  console.warn("⚠️ No package.json found — cannot add scripts.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babyclara",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "A Vue.Js Work Station",
5
5
  "main": "index.js",
6
6
  "author": "Augment Chinedu",
@@ -14,5 +14,8 @@
14
14
  ],
15
15
  "dependencies": {
16
16
  "gkrane": "^3.0.1"
17
+ },
18
+ "scripts": {
19
+ "start": "node --watch core/index.js"
17
20
  }
18
21
  }