create-mb-starter 1.1.0 → 1.2.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 +41 -6
- package/package.json +5 -2
- package/template/src/pages/Felvisz.jsx +1 -1
package/index.js
CHANGED
|
@@ -1,20 +1,55 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const { execSync } = require("child_process");
|
|
6
|
+
const chalk = require("chalk");
|
|
6
7
|
|
|
7
8
|
const projectName = process.argv[2] || "my-app";
|
|
8
9
|
const targetDir = path.join(process.cwd(), projectName);
|
|
9
10
|
const templateDir = path.join(__dirname, "template");
|
|
10
11
|
|
|
12
|
+
// Banner
|
|
13
|
+
console.log(
|
|
14
|
+
chalk.cyan(`
|
|
15
|
+
╔══════════════════════════════════════╗
|
|
16
|
+
║ 🚀 MB STARTER TEMPLATE ║
|
|
17
|
+
╚══════════════════════════════════════╝
|
|
18
|
+
`)
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
console.log(chalk.yellow("📦 Creating project:"), chalk.green(projectName));
|
|
22
|
+
console.log(chalk.gray("--------------------------------------------------"));
|
|
23
|
+
|
|
24
|
+
// Feature list
|
|
25
|
+
console.log(chalk.magenta("✨ This starter includes:"));
|
|
26
|
+
console.log(chalk.white(" ⚛ React (Vite powered)"));
|
|
27
|
+
console.log(chalk.white(" 🔀 React Router"));
|
|
28
|
+
console.log(chalk.white(" 📡 GET / POST / DELETE examples"));
|
|
29
|
+
console.log(chalk.white(" ✅ Input validation"));
|
|
30
|
+
console.log(chalk.white(" 🎨 Bootstrap styling"));
|
|
31
|
+
console.log(chalk.gray("--------------------------------------------------"));
|
|
32
|
+
|
|
11
33
|
// Copy template
|
|
34
|
+
if (fs.existsSync(targetDir)) {
|
|
35
|
+
console.log(chalk.red("❌ Folder already exists!"));
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
|
|
12
39
|
fs.cpSync(templateDir, targetDir, { recursive: true });
|
|
13
40
|
|
|
14
|
-
console.log("Installing dependencies
|
|
41
|
+
console.log(chalk.blue("\n📥 Installing dependencies...\n"));
|
|
42
|
+
|
|
15
43
|
execSync("npm install", { cwd: targetDir, stdio: "inherit" });
|
|
16
44
|
|
|
17
|
-
|
|
18
|
-
console.log(
|
|
19
|
-
|
|
20
|
-
|
|
45
|
+
// Success message
|
|
46
|
+
console.log(
|
|
47
|
+
chalk.green(`
|
|
48
|
+
🎉 Project successfully created!
|
|
49
|
+
`)
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
console.log(chalk.cyan("👉 Next steps:"));
|
|
53
|
+
console.log(chalk.white(` cd ${projectName}`));
|
|
54
|
+
console.log(chalk.white(` npm run dev`));
|
|
55
|
+
console.log(chalk.gray("\nHappy coding! 💻🔥\n"));
|
package/package.json
CHANGED