babyclara 0.0.5 → 0.0.7
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 +1 -0
- package/index.js +20 -7
- package/package.json +4 -1
package/core/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
console.log('Baby Clara Launched')
|
package/index.js
CHANGED
|
@@ -40,9 +40,22 @@ foldersToCopy.forEach(folder => {
|
|
|
40
40
|
copyFolder(src, dest);
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
// Install gkrane
|
|
43
|
+
// Install gkrane and cross-env locally
|
|
44
44
|
console.log("Installing Dependencies...");
|
|
45
|
-
execSync("npm install gkrane
|
|
45
|
+
execSync("npm install gkrane cross-env --save", { cwd: targetDir, stdio: "inherit" });
|
|
46
|
+
|
|
47
|
+
// Move local ./core into node_modules/core
|
|
48
|
+
const localCore = path.join(targetDir, "core");
|
|
49
|
+
const nodeModulesCore = path.join(targetDir, "node_modules", "core");
|
|
50
|
+
|
|
51
|
+
if (fs.existsSync(localCore)) {
|
|
52
|
+
console.log("Moving ./core into node_modules/core...");
|
|
53
|
+
copyFolder(localCore, nodeModulesCore);
|
|
54
|
+
fs.rmSync(localCore, { recursive: true, force: true });
|
|
55
|
+
} else {
|
|
56
|
+
console.log("No local ./core folder found, skipping move.");
|
|
57
|
+
}
|
|
58
|
+
|
|
46
59
|
|
|
47
60
|
// Modify package.json
|
|
48
61
|
const pkgPath = path.join(targetDir, "package.json");
|
|
@@ -52,12 +65,12 @@ if (fs.existsSync(pkgPath)) {
|
|
|
52
65
|
|
|
53
66
|
pkg.scripts = pkg.scripts || {};
|
|
54
67
|
|
|
55
|
-
//
|
|
56
|
-
pkg.scripts.start =
|
|
57
|
-
"./node_modules/.bin/chokidar \"**/*\" \"!apps/**\" \"!games/**\" -c \"node ./node_modules/gkrane/core/index.js\"";
|
|
68
|
+
// Start script (normal run)
|
|
69
|
+
pkg.scripts.start = "node ./node_modules/core/index.js";
|
|
58
70
|
|
|
59
|
-
|
|
60
|
-
|
|
71
|
+
// Build script (with ENV: BUILD=true)
|
|
72
|
+
pkg.scripts.build =
|
|
73
|
+
"cross-env BUILD=true node ./node_modules/core/index.js";
|
|
61
74
|
|
|
62
75
|
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
|
|
63
76
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babyclara",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
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
|
}
|