create-letswhim 2.0.2 → 2.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.
Files changed (2) hide show
  1. package/index.js +32 -44
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -2,30 +2,30 @@
2
2
  import { execSync } from 'child_process';
3
3
  import path from 'path';
4
4
  import fs from 'fs';
5
- import pc from 'picocolors';
6
- import prompts from 'prompts';
5
+ import pc from 'picocolors'; // Menggunakan picocolors
6
+ import prompts from 'prompts'; // Menggunakan prompts
7
7
 
8
- // --- FRAME 1: Orang Jalan di Tempat Bawa Papan ---
8
+ // --- FRAME 1: Orang Jalan di Tempat (NASA-Blue/Cyan) ---
9
9
  const walkingFrames = [
10
- ` ${pc.blue(' ( ) ')}
11
- ${pc.blue(' /| |\\ ')}
12
- ${pc.blue(' / \\ ')}
13
- ${pc.cyan('~~~~~~~~~~')}`,
14
- ` ${pc.blue(' ( ) ')}
15
- ${pc.blue(' | |/ ')}
16
- ${pc.blue(' | | ')}
17
- ${pc.cyan('~~~~~~~~~~')}`
10
+ ` ${pc.cyan(' ( ) ')}
11
+ ${pc.cyan(' /| |\\ ')}
12
+ ${pc.cyan(' / \\ ')}
13
+ ${pc.blue('~~~~~~~~~~')}`,
14
+ ` ${pc.cyan(' ( ) ')}
15
+ ${pc.cyan(' | |/ ')}
16
+ ${pc.cyan(' | | ')}
17
+ ${pc.blue('~~~~~~~~~~')}`
18
18
  ];
19
19
 
20
- // --- FRAME 2: Orang Menerjang Ombak (Victory) ---
20
+ // --- FRAME 2: Orang Menerjang Ombak (Success) ---
21
21
  const surfingArt = `
22
- ${pc.blue(' ( ) /')}
23
- ${pc.blue(' /| |/')}
24
- ${pc.blue(' /_|_|/')} ${pc.white("let's just start")}
25
- ${pc.cyan('~')} ${pc.blue(' / \\')}
26
- ${pc.cyan('~~~')} ${pc.blue(' / \\')}
27
- ${pc.cyan('~~~~~')} ${pc.blue(' / \\')}
28
- ${pc.cyan('~~~~~~~~~~~~~~~~~~~~~~~~~~~~')}
22
+ ${pc.cyan(' ( ) /')}
23
+ ${pc.cyan(' /| |/')}
24
+ ${pc.cyan(' /_|_|/')} ${pc.white("let's just start")}
25
+ ${pc.blue('~')} ${pc.cyan(' / \\')}
26
+ ${pc.blue('~~~')} ${pc.cyan(' / \\')}
27
+ ${pc.blue('~~~~~')} ${pc.cyan(' / \\')}
28
+ ${pc.blue('~~~~~~~~~~~~~~~~~~~~~~~~~~~~')}
29
29
  `;
30
30
 
31
31
  async function startLoading(message) {
@@ -35,17 +35,13 @@ async function startLoading(message) {
35
35
 
36
36
  for (let i = 0; i <= total; i++) {
37
37
  const percent = Math.round((i / total) * 100);
38
- const bar = pc.blue('█').repeat(i) + pc.gray('░').repeat(total - i);
38
+ // Ganti pc.blue ke pc.cyan biar gak ungu!
39
+ const bar = pc.cyan('█').repeat(i) + pc.gray('░').repeat(total - i);
39
40
 
40
- // Reset kursor ke atas (5 baris)
41
41
  process.stdout.write('\u001b[5A');
42
-
43
- // Render Frame Jalan
44
42
  console.log(walkingFrames[frameIndex]);
45
-
46
- // Render Progress Bar
47
43
  console.log(`${pc.cyan('▹')} ${pc.white(message)}`);
48
- process.stdout.write(` ${bar} ${pc.blue(percent + '%')}\r`);
44
+ process.stdout.write(` ${bar} ${pc.cyan(percent + '%')}\r`);
49
45
 
50
46
  if (i % 3 === 0) frameIndex = frameIndex === 0 ? 1 : 0;
51
47
  await new Promise(resolve => setTimeout(resolve, 50));
@@ -54,10 +50,9 @@ async function startLoading(message) {
54
50
  }
55
51
 
56
52
  async function init() {
57
- // Clear Terminal Biar Aesthetic
58
- process.stdout.write('\x1Bc');
53
+ process.stdout.write('\x1Bc'); // Clear terminal biar rapi
59
54
 
60
- console.log(`\n${pc.bold(pc.blue('🌊 LETSWHIM'))} ${pc.gray('v2.0.2')}`);
55
+ console.log(`\n${pc.bold(pc.cyan('🌊 LETSWHIM'))} ${pc.gray('v2.0.3')}`);
61
56
  console.log(`${pc.white('The Ultralight Web Engine for Modern Logic')}\n`);
62
57
 
63
58
  const response = await prompts({
@@ -76,35 +71,28 @@ async function init() {
76
71
  process.exit(1);
77
72
  }
78
73
 
79
- // 1. ANIMASI JALAN DI TEMPAT
80
74
  await startLoading('Preparing your surfboard...');
81
75
 
82
76
  try {
83
- // 2. PROSES CLONE
84
- process.stdout.write(`${pc.blue('▹')} ${pc.gray('Catching the waves (Cloning template)...')}`);
77
+ process.stdout.write(`${pc.cyan('▹')} ${pc.gray('Catching the waves (Cloning template)...')}`);
85
78
  execSync(`git clone ${repoUrl} "${projectName}"`, { stdio: 'ignore' });
86
79
 
87
- // 3. PAKSA HAPUS .GIT (Anti ENOTEMPTY)
80
+ // Hapus .git biar user punya repo bersih
88
81
  const gitFolder = path.join(targetDir, '.git');
89
82
  if (fs.existsSync(gitFolder)) {
90
- try {
91
- fs.rmSync(gitFolder, { recursive: true, force: true });
92
- } catch (e) {
93
- const cmd = process.platform === 'win32' ? `rmdir /s /q "${gitFolder}"` : `rm -rf "${gitFolder}"`;
94
- execSync(cmd);
95
- }
83
+ const cmd = process.platform === 'win32' ? `rmdir /s /q "${gitFolder}"` : `rm -rf "${gitFolder}"`;
84
+ execSync(cmd);
96
85
  }
97
86
 
98
- // 4. DISPLAY SURFER MENERJANG OMBAK
99
- console.log(`\n\n${pc.bold(pc.blue('🚀 MISSION ACCOMPLISHED'))}`);
87
+ console.log(`\n\n${pc.bold(pc.cyan('🚀 MISSION ACCOMPLISHED'))}`);
100
88
  console.log(surfingArt);
101
89
 
102
90
  console.log(`${pc.gray('Project created at')} ${pc.cyan(`./${projectName}`)}`);
103
91
 
104
92
  console.log(`\n${pc.bold(pc.white('Next steps to surf:'))}`);
105
- console.log(` ${pc.blue('1.')} cd ${pc.white(projectName)}`);
106
- console.log(` ${pc.blue('2.')} npm install`);
107
- console.log(` ${pc.blue('3.')} npm run dev`);
93
+ console.log(` ${pc.cyan('1.')} cd ${pc.white(projectName)}`);
94
+ console.log(` ${pc.cyan('2.')} npm install`);
95
+ console.log(` ${pc.cyan('3.')} npm run dev`);
108
96
 
109
97
  console.log(`\n${pc.gray("Happy surfing, Developer!")} 🏄‍♂️\n`);
110
98
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-letswhim",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "The official ultralight CLI to initialize your LetsWhim project in seconds.",
5
5
  "type": "module",
6
6
  "main": "index.js",