create-zen 1.7.2 → 1.8.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.
@@ -0,0 +1,7 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(npm publish:*)"
5
+ ]
6
+ }
7
+ }
package/index.js CHANGED
@@ -1,140 +1,177 @@
1
- #!/usr/bin/env node
2
-
3
- import { execSync } from 'child_process';
4
- import fs from 'fs';
5
- import path from 'path';
6
- import prompts from 'prompts';
7
- import chalk from 'chalk';
8
- import ora from 'ora';
9
-
10
- // Color palette inspired by the ZEN website
11
- const colors = {
12
- green: '#00D4AA', // Less acidic, more blue-green
13
- lightGreen: '#00B894', // Darker blue-green
14
- purple: '#8B5CF6', // Purple accent
15
- darkPurple: '#7C3AED', // Darker purple
16
- lightPurple: '#A78BFA', // Light purple
17
- white: '#FFFFFF', // Pure white
18
- lightGrey: '#9CA3AF', // Light grey
19
- darkGrey: '#374151', // Dark grey
20
- bgDark: '#1F2937' // Background dark
21
- };
22
-
23
- // Enhanced text styling with chalk
24
- const zen = (text) => chalk.hex(colors.green).bold(text);
25
- const accent = (text) => chalk.hex(colors.purple).bold(text);
26
- const title = (text) => chalk.hex(colors.white).bold(text);
27
- const subtitle = (text) => chalk.hex(colors.lightGrey)(text);
28
- const highlight = (text) => chalk.hex(colors.lightGreen)(text);
29
- const error = (text) => chalk.red.bold(text);
30
- const success = (text) => chalk.green.bold(text);
31
- const info = (text) => chalk.blue(text);
32
-
33
- // Display minimalistic header
34
- const displayHeader = () => {
35
- console.clear();
36
- console.log();
37
- console.log(` ${zen('ZEN')} - ${title('The Professional Web Development Starter')}`);
38
- console.log();
39
- };
40
-
41
- // Get project name with enhanced styling
42
- const getProjectName = async () => {
43
- const { projectName } = await prompts({
44
- type: 'text',
45
- name: 'projectName',
46
- message: 'Project name:',
47
- initial: 'zen-starter-app',
48
- validate: (value) => {
49
- if (!value.trim()) return 'Project name is required';
50
- if (fs.existsSync(value.trim())) return 'Directory already exists';
51
- return true;
52
- }
53
- });
54
-
55
- return projectName;
56
- };
57
-
58
- // Choose starter variant
59
- const getStarterVariant = async () => {
60
- console.log();
61
- const { variant } = await prompts({
62
- type: 'select',
63
- name: 'variant',
64
- message: 'Select ZEN starter variant:',
65
- choices: [
66
- {
67
- title: `${chalk.hex(colors.white)('Standard')} ${chalk.hex(colors.lightGrey)('(BEM + SCSS + TypeScript)')}`,
68
- value: 'standard'
69
- },
70
- {
71
- title: `${chalk.hex(colors.purple)('Express')} ${chalk.hex(colors.lightGrey)('(Tailwind CSS + Alpine.js)')}`,
72
- value: 'express'
73
- }
74
- ],
75
- initial: 0,
76
- hint: false
77
- });
78
- console.log();
79
- return variant;
80
- };
81
-
82
- // Get repository URL
83
- const getRepositoryUrl = (variant) => {
84
- if (variant === 'express') {
85
- return 'https://github.com/dmitry-conquer/zen-express.git';
86
- }
87
- return 'https://github.com/dmitry-conquer/zen-starter.git';
88
- };
89
-
90
- // Main function with enhanced UX
91
- const main = async () => {
92
- try {
93
- displayHeader();
94
-
95
- const PROJECT_NAME = await getProjectName();
96
- const variant = await getStarterVariant();
97
- const REPO_URL = getRepositoryUrl(variant);
98
-
99
- // Cloning with spinner
100
- const spinner = ora({
101
- text: `${chalk.hex(colors.green)('◇')} ${title('Preparing your ZEN project...')}`,
102
- color: 'green'
103
- }).start();
104
-
105
- try {
106
- execSync(`git clone --depth=1 "${REPO_URL}" "${PROJECT_NAME}"`, { stdio: 'pipe' });
107
- spinner.stop();
108
- } catch (err) {
109
- spinner.fail(`${error('Setup failed!')}`);
110
- console.log(` ${subtitle('Please check your internet connection, permissions, and try again.')}`);
111
- process.exit(1);
112
- }
113
-
114
- // Remove .git
115
- fs.rmSync(path.join(PROJECT_NAME, '.git'), { recursive: true, force: true });
116
-
117
- // Success message
118
- console.log();
119
- console.log(` ${chalk.hex(colors.darkPurple)('✅ SUCCESS! Your project is ready to go!')} ${chalk.hex(colors.lightPurple)('🎉')}`);
120
- console.log();
121
-
122
- // Next steps
123
- console.log(` ${chalk.hex(colors.green)('◇')} ${title('Next steps')}`);
124
- console.log(` ${chalk.hex(colors.purple)('📁')} ${highlight(`cd ${PROJECT_NAME}`)}`);
125
- console.log(` ${chalk.hex(colors.purple)('📦')} ${highlight('npm install')}`);
126
- console.log(` ${chalk.hex(colors.purple)('🧑‍💻')} ${highlight('npm run dev')}`);
127
- console.log();
128
-
129
- // Final message
130
- console.log(` ${zen('Happy coding with ZEN!')} ${chalk.hex(colors.lightPurple)('✨')}`);
131
- console.log();
132
-
133
- } catch (err) {
134
- console.log(` ${error('❌ An error occurred:')} ${err.message}`);
135
- process.exit(1);
136
- }
137
- };
138
-
139
- // Run the main function
140
- main();
1
+ #!/usr/bin/env node
2
+
3
+ import { execSync } from 'child_process';
4
+ import fs from 'fs';
5
+ import path from 'path';
6
+ import prompts from 'prompts';
7
+ import chalk from 'chalk';
8
+ import ora from 'ora';
9
+
10
+ const c = {
11
+ teal: (t) => chalk.hex('#2DD4BF').bold(t),
12
+ tealDim: (t) => chalk.hex('#2DD4BF')(t),
13
+ violet: (t) => chalk.hex('#A78BFA').bold(t),
14
+ violetDim: (t) => chalk.hex('#A78BFA')(t),
15
+ amber: (t) => chalk.hex('#FCD34D').bold(t),
16
+ amberDim: (t) => chalk.hex('#FCD34D')(t),
17
+ white: (t) => chalk.hex('#F9FAFB').bold(t),
18
+ muted: (t) => chalk.hex('#6B7280')(t),
19
+ dim: (t) => chalk.hex('#374151')(t),
20
+ green: (t) => chalk.hex('#34D399')(t),
21
+ red: (t) => chalk.hex('#F87171')(t),
22
+ };
23
+
24
+ const line = () => c.dim(' ' + '─'.repeat(44));
25
+
26
+ const displayHeader = () => {
27
+ console.clear();
28
+ console.log();
29
+ console.log(` ${c.teal('ZEN')} ${c.muted('·')} ${c.white('Web Development Starters')}`);
30
+ console.log(line());
31
+ console.log();
32
+ };
33
+
34
+ const getProjectName = async () => {
35
+ const { projectName } = await prompts({
36
+ type: 'text',
37
+ name: 'projectName',
38
+ message: c.white('Project name'),
39
+ initial: 'my-project',
40
+ validate: (value) => {
41
+ if (!value.trim()) return 'Project name is required';
42
+ if (fs.existsSync(value.trim())) return `"${value.trim()}" already exists`;
43
+ return true;
44
+ }
45
+ });
46
+
47
+ if (!projectName) process.exit(0);
48
+ return projectName;
49
+ };
50
+
51
+ const getStarterVariant = async () => {
52
+ console.log();
53
+ const { variant } = await prompts({
54
+ type: 'select',
55
+ name: 'variant',
56
+ message: c.white('Choose a starter'),
57
+ choices: [
58
+ {
59
+ title: `${c.teal('Express')} ${c.muted('Tailwind CSS + Alpine.js')}`,
60
+ description: 'Fast, utility-first setup for modern projects',
61
+ value: 'express'
62
+ },
63
+ {
64
+ title: `${c.violet('AI')} ${c.muted('Tailwind CSS + Alpine.js + Claude Code')}`,
65
+ description: 'AI-powered automatic site builder using Claude Code',
66
+ value: 'ai'
67
+ },
68
+ {
69
+ title: `${c.muted('Standard')} ${c.muted('BEM + SCSS + TypeScript')}`,
70
+ description: 'Classic setup · not actively maintained',
71
+ value: 'standard'
72
+ }
73
+ ],
74
+ initial: 0,
75
+ hint: ' '
76
+ });
77
+
78
+ if (!variant) process.exit(0);
79
+ console.log();
80
+ return variant;
81
+ };
82
+
83
+ const getRepositoryUrl = (variant) => {
84
+ const repos = {
85
+ express: 'https://github.com/dmitry-conquer/zen-express.git',
86
+ ai: 'https://github.com/dmitry-conquer/zen-ai.git',
87
+ standard: 'https://github.com/dmitry-conquer/zen-starter.git',
88
+ };
89
+ return repos[variant];
90
+ };
91
+
92
+ const getNextSteps = (variant, name) => {
93
+ const steps = [
94
+ { cmd: `cd ${name}`, label: 'enter project' },
95
+ { cmd: 'npm install', label: 'install deps' },
96
+ ];
97
+
98
+ if (variant === 'ai') {
99
+ steps.push({ cmd: 'claude', label: 'open claude code' });
100
+ steps.push({ cmd: 'npm run dev', label: 'start dev server' });
101
+ } else {
102
+ steps.push({ cmd: 'npm run dev', label: 'start dev server' });
103
+ }
104
+
105
+ return steps;
106
+ };
107
+
108
+ const main = async () => {
109
+ try {
110
+ displayHeader();
111
+
112
+ const PROJECT_NAME = await getProjectName();
113
+ const variant = await getStarterVariant();
114
+ const REPO_URL = getRepositoryUrl(variant);
115
+
116
+ const spinner = ora({
117
+ text: ` ${c.muted('Cloning repository...')}`,
118
+ spinner: 'dots',
119
+ color: 'cyan'
120
+ }).start();
121
+
122
+ try {
123
+ execSync(`git clone --depth=1 "${REPO_URL}" "${PROJECT_NAME}"`, { stdio: 'pipe' });
124
+ spinner.stop();
125
+ } catch (err) {
126
+ spinner.stop();
127
+ console.log();
128
+ console.log(` ${c.red('✗')} ${c.white('Clone failed.')} ${c.muted('Check your connection and try again.')}`);
129
+ console.log();
130
+ process.exit(1);
131
+ }
132
+
133
+ fs.rmSync(path.join(PROJECT_NAME, '.git'), { recursive: true, force: true });
134
+
135
+ // Success
136
+ console.log(` ${c.green('✓')} ${c.white('Project ready')} ${c.tealDim(PROJECT_NAME)}`);
137
+ console.log();
138
+ console.log(line());
139
+ console.log();
140
+
141
+ // Next steps
142
+ const steps = getNextSteps(variant, PROJECT_NAME);
143
+ console.log(` ${c.muted('Next steps')}`);
144
+ console.log();
145
+ steps.forEach(({ cmd, label }, i) => {
146
+ const num = c.dim(`${i + 1}.`);
147
+ console.log(` ${num} ${c.tealDim(cmd)} ${c.muted(label)}`);
148
+ });
149
+
150
+ if (variant === 'ai') {
151
+ console.log();
152
+ console.log(` ${c.muted('─'.repeat(44))}`);
153
+ console.log(` ${c.violetDim('tip')} ${c.muted('Open Claude Code and let the AI build your site')}`);
154
+ console.log(` ${c.muted('automatically from your project description.')}`);
155
+ }
156
+
157
+ if (variant === 'standard') {
158
+ console.log();
159
+ console.log(` ${c.muted('note')} ${c.muted('Standard starter is not actively maintained.')}`);
160
+ console.log(` ${c.muted('Consider using Express for new projects.')}`);
161
+ }
162
+
163
+ console.log();
164
+ console.log(line());
165
+ console.log();
166
+ console.log(` ${c.teal('ZEN')} ${c.muted('Happy building.')}`);
167
+ console.log();
168
+
169
+ } catch (err) {
170
+ console.log();
171
+ console.log(` ${c.red('✗')} ${err.message}`);
172
+ console.log();
173
+ process.exit(1);
174
+ }
175
+ };
176
+
177
+ main();
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
- {
2
- "name": "create-zen",
3
- "version": "1.7.2",
4
- "type": "module",
5
- "description": "✨ Create a new web development project with modern setup powered by Vite 🚀",
6
- "bin": {
7
- "create-zen": "index.js"
8
- },
9
- "dependencies": {
10
- "fs-extra": "^11.1.1",
11
- "prompts": "^2.4.2",
12
- "chalk": "^5.3.0",
13
- "ora": "^7.0.1"
14
- }
15
- }
1
+ {
2
+ "name": "create-zen",
3
+ "version": "1.8.0",
4
+ "type": "module",
5
+ "description": "✨ Create a new web development project with modern setup powered by Vite 🚀",
6
+ "bin": {
7
+ "create-zen": "index.js"
8
+ },
9
+ "dependencies": {
10
+ "fs-extra": "^11.1.1",
11
+ "prompts": "^2.4.2",
12
+ "chalk": "^5.3.0",
13
+ "ora": "^7.0.1"
14
+ }
15
+ }