create-letswhim 1.1.4 → 1.1.5

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 +19 -40
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,53 +1,32 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { execSync } = require('child_process');
4
- const path = require('path');
5
- const fs = require('fs');
3
+ import { execSync } from 'child_process';
4
+ import path from 'path';
5
+ import fs from 'fs';
6
6
 
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
- };
7
+ const projectName = process.argv[2] || "my-whim-project";
8
+ const repoUrl = "https://github.com/ripkiiii/letswhim-starter.git";
15
9
 
16
- const projectName = process.argv[2] || 'my-whim-project';
17
- const targetPath = path.join(process.cwd(), projectName);
18
-
19
- console.log(`\n${pc.bold('LETSWHIM')} ${pc.dim('v1.1.0')}`);
20
- console.log(`${pc.blue('“Let’s just start.”')}\n`);
10
+ console.log(`\n🚀 Preparing your Lightweight project: ${projectName}...`);
21
11
 
22
12
  try {
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
-
13
+ // 1. Clone dari repo Public yang baru
35
14
  execSync(`git clone ${repoUrl} "${projectName}"`, { stdio: 'ignore' });
36
15
 
37
- // 3. Hapus metadata Git agar menjadi project baru milik user
38
- const gitDir = path.join(targetPath, '.git');
39
- if (fs.existsSync(gitDir)) {
40
- fs.rmSync(gitDir, { recursive: true, force: true });
16
+ // 2. Hapus folder .git bawaan starter biar user bisa git init sendiri
17
+ const targetPath = path.join(process.cwd(), projectName);
18
+ const gitFolder = path.join(targetPath, '.git');
19
+
20
+ if (fs.existsSync(gitFolder)) {
21
+ fs.rmSync(gitFolder, { recursive: true, force: true });
41
22
  }
42
23
 
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`);
24
+ console.log(`\n✅ Project created! Let's start whiming.`);
25
+ console.log(`\nNext steps:`);
26
+ console.log(` cd ${projectName}`);
27
+ console.log(` npm install`);
28
+ console.log(` npm run dev\n`);
49
29
 
50
30
  } catch (error) {
51
- console.error(`\x1b[31mError:\x1b[0m Gagal membuat project.`, error.message);
52
- process.exit(1);
31
+ console.error(`\nBjir, ada error: ${error.message}`);
53
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-letswhim",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "The official human-readable starter for LetsWhim Framework.",
5
5
  "type": "module",
6
6
  "main": "index.js",