create-letswhim 1.0.0
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 +34 -0
- package/package.json +15 -0
package/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execSync } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
|
|
7
|
+
// Ambil nama folder dari input user, kalau gak ada kasih default
|
|
8
|
+
const projectName = process.argv[2] || 'my-whim-project';
|
|
9
|
+
const targetPath = path.join(process.cwd(), projectName);
|
|
10
|
+
|
|
11
|
+
console.log(`\n🚀 Preparing your Lightweight project: ${projectName}...\n`);
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
// 1. Clone dari branch STARTER yang sudah kita bantai mobile responsive-nya
|
|
15
|
+
console.log('📦 Fetching letswhim-official starter template...');
|
|
16
|
+
execSync(`git clone -b starter https://github.com/guug-labs/letswhim-official.git "${projectName}"`, { stdio: 'inherit' });
|
|
17
|
+
|
|
18
|
+
// 2. Hapus folder .git biar project user gak nyambung ke repo lo
|
|
19
|
+
console.log('\n🧹 Cleaning up metadata...');
|
|
20
|
+
const gitDir = path.join(targetPath, '.git');
|
|
21
|
+
if (fs.existsSync(gitDir)) {
|
|
22
|
+
fs.rmSync(gitDir, { recursive: true, force: true });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
console.log('\n✅ Letswhim is ready for action!');
|
|
26
|
+
console.log(`\nNext steps:`);
|
|
27
|
+
console.log(` 1. cd ${projectName}`);
|
|
28
|
+
console.log(` 2. npm install`);
|
|
29
|
+
console.log(` 3. npm run dev\n`);
|
|
30
|
+
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.error('\n❌ Bjir, ada error:', error.message);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-letswhim",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "The official starter for Letswhim Framework",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"create-letswhim": "index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
|
+
},
|
|
12
|
+
"keywords": ["letswhim", "astro", "starter"],
|
|
13
|
+
"author": "GUUG Labs",
|
|
14
|
+
"license": "MIT"
|
|
15
|
+
}
|