create-zen 1.0.1

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 +44 -0
  2. package/package.json +11 -0
package/index.js ADDED
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execSync } = require('child_process');
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+
7
+ const PROJECT_NAME = process.argv[2] || 'zen-starter-app';
8
+
9
+ const green = (msg) => `\x1b[32m${msg}\x1b[0m`;
10
+ const yellow = (msg) => `\x1b[33m${msg}\x1b[0m`;
11
+ const red = (msg) => `\x1b[31m${msg}\x1b[0m`;
12
+ const cyan = (msg) => `\x1b[36m${msg}\x1b[0m`;
13
+
14
+ console.log();
15
+ console.log('✨', cyan('Welcome to'), green('ZEN!'), '✨');
16
+ console.log();
17
+
18
+ if (fs.existsSync(PROJECT_NAME)) {
19
+ console.error(red('⛔ Directory "' + PROJECT_NAME + '" already exists!'));
20
+ process.exit(1);
21
+ }
22
+
23
+ console.log('🚀', yellow(`Cloning ZEN template into "${PROJECT_NAME}"...`));
24
+ try {
25
+ execSync(`git clone --depth=1 https://github.com/dmitry-conquer/zen-starter.git "${PROJECT_NAME}"`, { stdio: 'inherit' });
26
+ } catch (err) {
27
+ console.error(red('❌ Clone failed. Check your internet connection or permissions.'));
28
+ process.exit(1);
29
+ }
30
+
31
+ // Remove .git so the created project is not a git repo
32
+ fs.rmSync(path.join(PROJECT_NAME, '.git'), { recursive: true, force: true });
33
+
34
+ console.log();
35
+ console.log(green('✅ All done! Your project is ready.'));
36
+ console.log();
37
+ console.log('👉', cyan('Next steps:'));
38
+ console.log();
39
+ console.log(` 📁 ${yellow('cd ' + PROJECT_NAME)}`);
40
+ console.log(' 📦', yellow('npm install'));
41
+ console.log(' 🧑‍💻', yellow('npm run dev'));
42
+ console.log();
43
+ console.log('🌿 Happy coding!');
44
+ console.log();
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "create-zen",
3
+ "version": "1.0.1",
4
+ "description": "✨ Create a new project from dmitry-conquer/zen-starter template 🚀",
5
+ "bin": {
6
+ "create-zen": "./index.js"
7
+ },
8
+ "dependencies": {
9
+ "fs-extra": "^11.1.1"
10
+ }
11
+ }