create-letswhim 1.0.0 β 1.1.4
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/index.js +32 -13
- package/package.json +16 -8
package/index.js
CHANGED
|
@@ -4,31 +4,50 @@ const { execSync } = require('child_process');
|
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const fs = require('fs');
|
|
6
6
|
|
|
7
|
-
//
|
|
7
|
+
// Warna Terminal Minimalis
|
|
8
|
+
const pc = {
|
|
9
|
+
blue: (s) => `\x1b[34m${s}\x1b[0m`,
|
|
10
|
+
green: (s) => `\x1b[32m${s}\x1b[0m`,
|
|
11
|
+
dim: (s) => `\x1b[2m${s}\x1b[0m`,
|
|
12
|
+
bold: (s) => `\x1b[1m${s}\x1b[0m`,
|
|
13
|
+
cyan: (s) => `\x1b[36m${s}\x1b[0m`
|
|
14
|
+
};
|
|
15
|
+
|
|
8
16
|
const projectName = process.argv[2] || 'my-whim-project';
|
|
9
17
|
const targetPath = path.join(process.cwd(), projectName);
|
|
10
18
|
|
|
11
|
-
console.log(`\n
|
|
19
|
+
console.log(`\n${pc.bold('LETSWHIM')} ${pc.dim('v1.1.0')}`);
|
|
20
|
+
console.log(`${pc.blue('βLetβs just start.β')}\n`);
|
|
12
21
|
|
|
13
22
|
try {
|
|
14
|
-
// 1.
|
|
15
|
-
|
|
16
|
-
|
|
23
|
+
// 1. Cek jika folder sudah ada
|
|
24
|
+
if (fs.existsSync(targetPath)) {
|
|
25
|
+
console.error(`\x1b[31mβ Error:\x1b[0m Folder ${projectName} sudah ada.`);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// 2. Clone dari REPO STARTER BARU (Public)
|
|
30
|
+
console.log(`${pc.dim('π¦ Fetching the minimalist engine...')}`);
|
|
31
|
+
|
|
32
|
+
// Ganti URL ini dengan URL Repo Starter Public lo yang baru
|
|
33
|
+
const repoUrl = "https://github.com/ripkiiii/letswhim-starter.git";
|
|
34
|
+
|
|
35
|
+
execSync(`git clone ${repoUrl} "${projectName}"`, { stdio: 'ignore' });
|
|
17
36
|
|
|
18
|
-
//
|
|
19
|
-
console.log('\nπ§Ή Cleaning up metadata...');
|
|
37
|
+
// 3. Hapus metadata Git agar menjadi project baru milik user
|
|
20
38
|
const gitDir = path.join(targetPath, '.git');
|
|
21
39
|
if (fs.existsSync(gitDir)) {
|
|
22
40
|
fs.rmSync(gitDir, { recursive: true, force: true });
|
|
23
41
|
}
|
|
24
42
|
|
|
25
|
-
|
|
26
|
-
console.log(`\
|
|
27
|
-
console.log(
|
|
28
|
-
console.log(`
|
|
29
|
-
console.log(`
|
|
43
|
+
// 4. Instruksi Selesai
|
|
44
|
+
console.log(`\n${pc.green('β¨ Project created successfully!')}`);
|
|
45
|
+
console.log(`\n${pc.bold('Next steps:')}`);
|
|
46
|
+
console.log(` ${pc.cyan(`cd ${projectName}`)}`);
|
|
47
|
+
console.log(` ${pc.cyan('npm install')}`);
|
|
48
|
+
console.log(` ${pc.cyan('npm run dev')}\n`);
|
|
30
49
|
|
|
31
50
|
} catch (error) {
|
|
32
|
-
console.error(
|
|
51
|
+
console.error(`\x1b[31mβ Error:\x1b[0m Gagal membuat project.`, error.message);
|
|
33
52
|
process.exit(1);
|
|
34
53
|
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-letswhim",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "The official starter for
|
|
3
|
+
"version": "1.1.4",
|
|
4
|
+
"description": "The official human-readable starter for LetsWhim Framework.",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"main": "index.js",
|
|
6
7
|
"bin": {
|
|
7
8
|
"create-letswhim": "index.js"
|
|
8
9
|
},
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
"keywords": [
|
|
11
|
+
"letswhim",
|
|
12
|
+
"ssg",
|
|
13
|
+
"terminal-ui",
|
|
14
|
+
"minimalist-framework",
|
|
15
|
+
"human-readable"
|
|
16
|
+
],
|
|
17
|
+
"author": "Rifky",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"picocolors": "^1.0.0",
|
|
21
|
+
"prompts": "^2.4.2"
|
|
22
|
+
}
|
|
15
23
|
}
|