create-zen 1.6.0 → 1.6.2
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 +9 -88
- package/package.json +2 -3
package/index.js
CHANGED
|
@@ -6,7 +6,6 @@ import path from 'path';
|
|
|
6
6
|
import prompts from 'prompts';
|
|
7
7
|
import chalk from 'chalk';
|
|
8
8
|
import ora from 'ora';
|
|
9
|
-
import boxen from 'boxen';
|
|
10
9
|
|
|
11
10
|
// Color palette inspired by the ZEN website
|
|
12
11
|
const colors = {
|
|
@@ -29,24 +28,12 @@ const error = (text) => chalk.red.bold(text);
|
|
|
29
28
|
const success = (text) => chalk.green.bold(text);
|
|
30
29
|
const info = (text) => chalk.blue(text);
|
|
31
30
|
|
|
32
|
-
// Display
|
|
31
|
+
// Display minimalistic header
|
|
33
32
|
const displayHeader = () => {
|
|
34
33
|
console.clear();
|
|
35
34
|
console.log();
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
`${zen('ZEN')} - ${title('The Professional Web Development Starter')}\n${subtitle('v1.6.0 • Professional Starter Kit • MIT License')}`,
|
|
39
|
-
{
|
|
40
|
-
padding: 1,
|
|
41
|
-
margin: 1,
|
|
42
|
-
borderStyle: 'round',
|
|
43
|
-
borderColor: colors.green,
|
|
44
|
-
backgroundColor: colors.bgDark,
|
|
45
|
-
textAlignment: 'center'
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
console.log(headerBox);
|
|
35
|
+
console.log(` ${zen('ZEN')} - ${title('The Professional Web Development Starter')}`);
|
|
36
|
+
console.log(` ${subtitle('v1.6.1')}`);
|
|
50
37
|
console.log();
|
|
51
38
|
};
|
|
52
39
|
|
|
@@ -64,20 +51,15 @@ const getProjectName = async () => {
|
|
|
64
51
|
}
|
|
65
52
|
});
|
|
66
53
|
|
|
67
|
-
console.log(` ${chalk.hex(colors.green)('◇')} ${title('Project name:')} ${highlight(projectName)}`);
|
|
68
54
|
return projectName;
|
|
69
55
|
};
|
|
70
56
|
|
|
71
57
|
// Get project version with beautiful selection
|
|
72
58
|
const getProjectVersion = async () => {
|
|
73
|
-
console.log();
|
|
74
|
-
console.log(` ${chalk.hex(colors.green)('◇')} ${title('Select ZEN starter version:')}`);
|
|
75
|
-
console.log();
|
|
76
|
-
|
|
77
59
|
const { version } = await prompts({
|
|
78
60
|
type: 'select',
|
|
79
61
|
name: 'version',
|
|
80
|
-
message: '',
|
|
62
|
+
message: 'Select ZEN starter version:',
|
|
81
63
|
choices: [
|
|
82
64
|
{
|
|
83
65
|
title: `${chalk.hex(colors.white)('Standard Version')} ${chalk.hex(colors.lightGrey)('(Full-featured with all components)')}`,
|
|
@@ -91,9 +73,6 @@ const getProjectVersion = async () => {
|
|
|
91
73
|
initial: 0
|
|
92
74
|
});
|
|
93
75
|
|
|
94
|
-
const selectedText = version === 'lite' ? 'Lite Version' : 'Standard Version';
|
|
95
|
-
console.log(` ${chalk.hex(colors.green)('◇')} ${title('Selected:')} ${highlight(selectedText)}`);
|
|
96
|
-
|
|
97
76
|
return version === 'lite';
|
|
98
77
|
};
|
|
99
78
|
|
|
@@ -105,37 +84,6 @@ const getRepositoryUrl = (isLite) => {
|
|
|
105
84
|
return 'https://github.com/dmitry-conquer/zen-starter.git';
|
|
106
85
|
};
|
|
107
86
|
|
|
108
|
-
// Get version description
|
|
109
|
-
const getVersionDescription = (isLite) => {
|
|
110
|
-
if (isLite) {
|
|
111
|
-
return 'Lite Version - Essential features only';
|
|
112
|
-
}
|
|
113
|
-
return 'Standard Version - Full-featured with all components';
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
// Display project summary in a beautiful box
|
|
117
|
-
const displaySummary = (projectName, versionDesc, repoUrl) => {
|
|
118
|
-
console.log();
|
|
119
|
-
|
|
120
|
-
const summaryBox = boxen(
|
|
121
|
-
`${chalk.hex(colors.green)('📋')} ${title('Project Summary')}\n\n` +
|
|
122
|
-
`${chalk.hex(colors.purple)('🏷️')} ${title('Project Name:')} ${highlight(projectName)}\n` +
|
|
123
|
-
`${chalk.hex(colors.purple)('🎯')} ${title('Version:')} ${highlight(versionDesc)}\n` +
|
|
124
|
-
`${chalk.hex(colors.purple)('🔗')} ${title('Repository:')} ${subtitle(repoUrl)}`,
|
|
125
|
-
{
|
|
126
|
-
padding: 1,
|
|
127
|
-
margin: 1,
|
|
128
|
-
borderStyle: 'round',
|
|
129
|
-
borderColor: colors.purple,
|
|
130
|
-
backgroundColor: colors.bgDark,
|
|
131
|
-
textAlignment: 'left'
|
|
132
|
-
}
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
console.log(summaryBox);
|
|
136
|
-
console.log();
|
|
137
|
-
};
|
|
138
|
-
|
|
139
87
|
// Main function with enhanced UX
|
|
140
88
|
const main = async () => {
|
|
141
89
|
try {
|
|
@@ -144,9 +92,6 @@ const main = async () => {
|
|
|
144
92
|
const PROJECT_NAME = await getProjectName();
|
|
145
93
|
const isLite = await getProjectVersion();
|
|
146
94
|
const REPO_URL = getRepositoryUrl(isLite);
|
|
147
|
-
const VERSION_DESC = getVersionDescription(isLite);
|
|
148
|
-
|
|
149
|
-
displaySummary(PROJECT_NAME, VERSION_DESC, REPO_URL);
|
|
150
95
|
|
|
151
96
|
// Cloning with spinner
|
|
152
97
|
const spinner = ora({
|
|
@@ -156,9 +101,9 @@ const main = async () => {
|
|
|
156
101
|
|
|
157
102
|
try {
|
|
158
103
|
execSync(`git clone --depth=1 "${REPO_URL}" "${PROJECT_NAME}"`, { stdio: 'pipe' });
|
|
159
|
-
spinner.succeed(`${
|
|
104
|
+
spinner.succeed(`${success('Repository cloned successfully!')}`);
|
|
160
105
|
} catch (err) {
|
|
161
|
-
spinner.fail(`${
|
|
106
|
+
spinner.fail(`${error('Clone failed!')}`);
|
|
162
107
|
console.log(` ${subtitle('Please check your internet connection or permissions.')}`);
|
|
163
108
|
process.exit(1);
|
|
164
109
|
}
|
|
@@ -166,21 +111,9 @@ const main = async () => {
|
|
|
166
111
|
// Remove .git
|
|
167
112
|
fs.rmSync(path.join(PROJECT_NAME, '.git'), { recursive: true, force: true });
|
|
168
113
|
|
|
169
|
-
// Success message
|
|
114
|
+
// Success message
|
|
170
115
|
console.log();
|
|
171
|
-
|
|
172
|
-
`${chalk.hex(colors.green)('✅')} ${success('SUCCESS! Your project is ready to go!')} ${chalk.hex(colors.purple)('🎉')}`,
|
|
173
|
-
{
|
|
174
|
-
padding: 1,
|
|
175
|
-
margin: 1,
|
|
176
|
-
borderStyle: 'round',
|
|
177
|
-
borderColor: colors.green,
|
|
178
|
-
backgroundColor: colors.bgDark,
|
|
179
|
-
textAlignment: 'center'
|
|
180
|
-
}
|
|
181
|
-
);
|
|
182
|
-
|
|
183
|
-
console.log(successBox);
|
|
116
|
+
console.log(` ${success('✅ SUCCESS! Your project is ready to go!')} ${chalk.hex(colors.purple)('🎉')}`);
|
|
184
117
|
console.log();
|
|
185
118
|
|
|
186
119
|
// Next steps
|
|
@@ -191,19 +124,7 @@ const main = async () => {
|
|
|
191
124
|
console.log();
|
|
192
125
|
|
|
193
126
|
// Final message
|
|
194
|
-
|
|
195
|
-
`${zen('Happy coding with ZEN!')} ${chalk.hex(colors.purple)('✨')}`,
|
|
196
|
-
{
|
|
197
|
-
padding: 1,
|
|
198
|
-
margin: 1,
|
|
199
|
-
borderStyle: 'round',
|
|
200
|
-
borderColor: colors.purple,
|
|
201
|
-
backgroundColor: colors.bgDark,
|
|
202
|
-
textAlignment: 'center'
|
|
203
|
-
}
|
|
204
|
-
);
|
|
205
|
-
|
|
206
|
-
console.log(finalBox);
|
|
127
|
+
console.log(` ${zen('Happy coding with ZEN!')} ${chalk.hex(colors.purple)('✨')}`);
|
|
207
128
|
console.log();
|
|
208
129
|
|
|
209
130
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-zen",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "✨ Create a new web development project with modern setup powered by Vite 🚀",
|
|
6
6
|
"bin": {
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"fs-extra": "^11.1.1",
|
|
11
11
|
"prompts": "^2.4.2",
|
|
12
12
|
"chalk": "^5.3.0",
|
|
13
|
-
"ora": "^7.0.1"
|
|
14
|
-
"boxen": "^7.1.1"
|
|
13
|
+
"ora": "^7.0.1"
|
|
15
14
|
}
|
|
16
15
|
}
|