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 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
- console.log(`\nProject created: ${projectName}`);
18
- console.log(`\nNext steps:`);
19
- console.log(` cd ${projectName}`);
20
- console.log(` npm run dev`);
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
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "create-mb-starter",
3
3
  "type": "commonjs",
4
- "version": "1.1.0",
4
+ "version": "1.2.0",
5
5
  "bin": {
6
6
  "create-mb-starter": "./index.js"
7
+ },
8
+ "dependencies": {
9
+ "chalk": "^4.1.2"
7
10
  }
8
- }
11
+ }
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react'
1
+ import { useState } from 'react'
2
2
  import { useNavigate } from 'react-router'
3
3
 
4
4
  const Felvisz = ({onAdd}) => {