babyclara 0.0.1 → 0.0.3
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/.gitignore +139 -0
- package/index.js +44 -27
- package/package.json +5 -2
- package/template/.env +0 -0
package/.gitignore
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Logs
|
|
2
|
+
logs
|
|
3
|
+
*.log
|
|
4
|
+
npm-debug.log*
|
|
5
|
+
yarn-debug.log*
|
|
6
|
+
yarn-error.log*
|
|
7
|
+
lerna-debug.log*
|
|
8
|
+
|
|
9
|
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
10
|
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
11
|
+
|
|
12
|
+
# Runtime data
|
|
13
|
+
pids
|
|
14
|
+
*.pid
|
|
15
|
+
*.seed
|
|
16
|
+
*.pid.lock
|
|
17
|
+
|
|
18
|
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
19
|
+
lib-cov
|
|
20
|
+
|
|
21
|
+
# Coverage directory used by tools like istanbul
|
|
22
|
+
coverage
|
|
23
|
+
*.lcov
|
|
24
|
+
|
|
25
|
+
# nyc test coverage
|
|
26
|
+
.nyc_output
|
|
27
|
+
|
|
28
|
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
29
|
+
.grunt
|
|
30
|
+
|
|
31
|
+
# Bower dependency directory (https://bower.io/)
|
|
32
|
+
bower_components
|
|
33
|
+
|
|
34
|
+
# node-waf configuration
|
|
35
|
+
.lock-wscript
|
|
36
|
+
|
|
37
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
38
|
+
build/Release
|
|
39
|
+
|
|
40
|
+
# Dependency directories
|
|
41
|
+
node_modules/
|
|
42
|
+
jspm_packages/
|
|
43
|
+
|
|
44
|
+
# Snowpack dependency directory (https://snowpack.dev/)
|
|
45
|
+
web_modules/
|
|
46
|
+
|
|
47
|
+
# TypeScript cache
|
|
48
|
+
*.tsbuildinfo
|
|
49
|
+
|
|
50
|
+
# Optional npm cache directory
|
|
51
|
+
.npm
|
|
52
|
+
|
|
53
|
+
# Optional eslint cache
|
|
54
|
+
.eslintcache
|
|
55
|
+
|
|
56
|
+
# Optional stylelint cache
|
|
57
|
+
.stylelintcache
|
|
58
|
+
|
|
59
|
+
# Optional REPL history
|
|
60
|
+
.node_repl_history
|
|
61
|
+
|
|
62
|
+
# Output of 'npm pack'
|
|
63
|
+
*.tgz
|
|
64
|
+
|
|
65
|
+
# Yarn Integrity file
|
|
66
|
+
.yarn-integrity
|
|
67
|
+
|
|
68
|
+
# dotenv environment variable files
|
|
69
|
+
.env
|
|
70
|
+
.env.*
|
|
71
|
+
!.env.example
|
|
72
|
+
|
|
73
|
+
# parcel-bundler cache (https://parceljs.org/)
|
|
74
|
+
.cache
|
|
75
|
+
.parcel-cache
|
|
76
|
+
|
|
77
|
+
# Next.js build output
|
|
78
|
+
.next
|
|
79
|
+
out
|
|
80
|
+
|
|
81
|
+
# Nuxt.js build / generate output
|
|
82
|
+
.nuxt
|
|
83
|
+
dist
|
|
84
|
+
|
|
85
|
+
# Gatsby files
|
|
86
|
+
.cache/
|
|
87
|
+
# Comment in the public line in if your project uses Gatsby and not Next.js
|
|
88
|
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
89
|
+
# public
|
|
90
|
+
|
|
91
|
+
# vuepress build output
|
|
92
|
+
.vuepress/dist
|
|
93
|
+
|
|
94
|
+
# vuepress v2.x temp and cache directory
|
|
95
|
+
.temp
|
|
96
|
+
.cache
|
|
97
|
+
|
|
98
|
+
# Sveltekit cache directory
|
|
99
|
+
.svelte-kit/
|
|
100
|
+
|
|
101
|
+
# vitepress build output
|
|
102
|
+
**/.vitepress/dist
|
|
103
|
+
|
|
104
|
+
# vitepress cache directory
|
|
105
|
+
**/.vitepress/cache
|
|
106
|
+
|
|
107
|
+
# Docusaurus cache and generated files
|
|
108
|
+
.docusaurus
|
|
109
|
+
|
|
110
|
+
# Serverless directories
|
|
111
|
+
.serverless/
|
|
112
|
+
|
|
113
|
+
# FuseBox cache
|
|
114
|
+
.fusebox/
|
|
115
|
+
|
|
116
|
+
# DynamoDB Local files
|
|
117
|
+
.dynamodb/
|
|
118
|
+
|
|
119
|
+
# Firebase cache directory
|
|
120
|
+
.firebase/
|
|
121
|
+
|
|
122
|
+
# TernJS port file
|
|
123
|
+
.tern-port
|
|
124
|
+
|
|
125
|
+
# Stores VSCode versions used for testing VSCode extensions
|
|
126
|
+
.vscode-test
|
|
127
|
+
|
|
128
|
+
# yarn v3
|
|
129
|
+
.pnp.*
|
|
130
|
+
.yarn/*
|
|
131
|
+
!.yarn/patches
|
|
132
|
+
!.yarn/plugins
|
|
133
|
+
!.yarn/releases
|
|
134
|
+
!.yarn/sdks
|
|
135
|
+
!.yarn/versions
|
|
136
|
+
|
|
137
|
+
# Vite logs files
|
|
138
|
+
vite.config.js.timestamp-*
|
|
139
|
+
vite.config.ts.timestamp-*
|
package/index.js
CHANGED
|
@@ -4,49 +4,66 @@ const fs = require("fs");
|
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const { execSync } = require("child_process");
|
|
6
6
|
|
|
7
|
-
// Folders in your npm package to copy
|
|
8
|
-
// key = folder in CLI package
|
|
9
|
-
// value = destination folder name inside user's project
|
|
10
7
|
const foldersToCopy = [
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
{ from: "template", to: "." },
|
|
9
|
+
{ from: "data", to: "data" }
|
|
13
10
|
];
|
|
14
11
|
|
|
15
|
-
// Target folder (user directory)
|
|
16
12
|
const targetDir = process.cwd();
|
|
17
13
|
|
|
18
|
-
//
|
|
14
|
+
// Recursive folder copy
|
|
19
15
|
function copyFolder(src, dest) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
if (!fs.existsSync(dest)) {
|
|
17
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
18
|
+
}
|
|
23
19
|
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
const items = fs.readdirSync(src);
|
|
21
|
+
if (items.length === 0) return;
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
items.forEach(item => {
|
|
24
|
+
const from = path.join(src, item);
|
|
25
|
+
const to = path.join(dest, item);
|
|
30
26
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
if (fs.lstatSync(from).isDirectory()) {
|
|
28
|
+
copyFolder(from, to);
|
|
29
|
+
} else {
|
|
30
|
+
fs.copyFileSync(from, to);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
37
33
|
}
|
|
38
34
|
|
|
39
35
|
console.log("Generating Work Station...");
|
|
40
36
|
|
|
41
|
-
// Copy template and data folders
|
|
42
37
|
foldersToCopy.forEach(folder => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
const src = path.join(__dirname, folder.from);
|
|
39
|
+
const dest = path.join(targetDir, folder.to);
|
|
40
|
+
copyFolder(src, dest);
|
|
46
41
|
});
|
|
47
42
|
|
|
48
|
-
// Install gkrane
|
|
43
|
+
// Install gkrane
|
|
49
44
|
console.log("Installing Dependencies...");
|
|
50
|
-
execSync("npm install gkrane", { cwd: targetDir, stdio: "inherit" });
|
|
45
|
+
execSync("npm install gkrane chokidar", { cwd: targetDir, stdio: "inherit" });
|
|
46
|
+
|
|
47
|
+
// Modify package.json
|
|
48
|
+
const pkgPath = path.join(targetDir, "package.json");
|
|
49
|
+
|
|
50
|
+
if (fs.existsSync(pkgPath)) {
|
|
51
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
52
|
+
|
|
53
|
+
pkg.scripts = pkg.scripts || {};
|
|
54
|
+
|
|
55
|
+
// Add or override your scripts
|
|
56
|
+
pkg.scripts.start =
|
|
57
|
+
"npx chokidar '**/*' '!apps/**' '!games/**' -c 'node ./node_modules/gkrane/core/index.js'";
|
|
58
|
+
|
|
59
|
+
pkg.scripts.dev =
|
|
60
|
+
"node ./node_modules/gkrane/core/dev.js";
|
|
61
|
+
|
|
62
|
+
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
|
|
63
|
+
|
|
64
|
+
console.log("Updated package.json scripts successfully.");
|
|
65
|
+
} else {
|
|
66
|
+
console.warn("⚠️ No package.json found — cannot add scripts.");
|
|
67
|
+
}
|
|
51
68
|
|
|
52
69
|
console.log("Done!");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babyclara",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "A Vue.Js Work Station",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Augment Chinedu",
|
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
"bin": {
|
|
10
10
|
"babyclara": "index.js"
|
|
11
11
|
},
|
|
12
|
+
"files": [
|
|
13
|
+
"*"
|
|
14
|
+
],
|
|
12
15
|
"dependencies": {
|
|
13
16
|
"gkrane": "^3.0.1"
|
|
14
17
|
}
|
|
15
|
-
}
|
|
18
|
+
}
|
package/template/.env
ADDED
|
File without changes
|