create-zen 1.7.1 โ 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.
- package/.claude/settings.local.json +7 -0
- package/README.md +192 -192
- package/index.js +177 -110
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -1,193 +1,193 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
|
-
[](https://git.io/typing-svg)
|
|
4
|
-
|
|
5
|
-
</div>
|
|
6
|
-
|
|
7
|
-
A premium Vite starter kit for rapid web development, designed to streamline your development process. It comes pre-configured with essential tools like TypeScript, Vite, SCSS, and modern UI components.
|
|
8
|
-
|
|
9
|
-
<p align="center">
|
|
10
|
-
<img src="https://img.shields.io/badge/Vite-646CFF?style=for-the-badge&logo=vite&logoColor=white" alt="Vite"/>
|
|
11
|
-
<img src="https://img.shields.io/badge/TypeScript-3178C6?style=for-the-badge&logo=typescript&logoColor=white" alt="TypeScript"/>
|
|
12
|
-
<img src="https://img.shields.io/badge/Sass-CC6699?style=for-the-badge&logo=sass&logoColor=white" alt="Sass"/>
|
|
13
|
-
<img src="https://img.shields.io/badge/PostCSS-DD3A0A?style=for-the-badge&logo=postcss&logoColor=white" alt="PostCSS"/>
|
|
14
|
-
<img src="https://img.shields.io/badge/Handlebars.js-f0772b?style=for-the-badge&logo=handlebars.js&logoColor=white" alt="Handlebars"/>
|
|
15
|
-
<img src="https://img.shields.io/badge/Lenis-000000?style=for-the-badge&logo=lenis&logoColor=white" alt="Lenis"/>
|
|
16
|
-
</p>
|
|
17
|
-
|
|
18
|
-
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif" alt="line" />
|
|
19
|
-
|
|
20
|
-
## โจ Features
|
|
21
|
-
|
|
22
|
-
- **๐ Vite**: Next-generation frontend tooling for a blazing fast development experience
|
|
23
|
-
- **๐ก๏ธ TypeScript**: Strong typing for more robust and maintainable code
|
|
24
|
-
- **๐จ SCSS**: CSS with superpowers, enabling variables, nesting, and mixins
|
|
25
|
-
- **๐ง ESLint & Prettier**: Code quality and formatting tools
|
|
26
|
-
- **โก PostCSS**: Advanced CSS processing with plugins
|
|
27
|
-
- **๐ Handlebars**: Templating engine for clean HTML organization
|
|
28
|
-
- **๐ Lenis**: Buttery smooth scrolling experience
|
|
29
|
-
- **๐ญ Ready-to-use Components**: Tabs, Modals, Accordions, Theme Switcher
|
|
30
|
-
- **๐ฑ Responsive Design**: Mobile-first approach with modern breakpoints
|
|
31
|
-
- **๐ Dark/Light Theme**: Built-in theme switching with persistence
|
|
32
|
-
- **๐ฆ Modern Build**: Optimized for production with tree-shaking
|
|
33
|
-
|
|
34
|
-
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif" alt="line" />
|
|
35
|
-
|
|
36
|
-
## ๐ Getting Started
|
|
37
|
-
|
|
38
|
-
### Prerequisites
|
|
39
|
-
|
|
40
|
-
- [Node.js](https://nodejs.org/) (version 18.x or higher)
|
|
41
|
-
- [npm](https://www.npmjs.com/)
|
|
42
|
-
|
|
43
|
-
### Installation
|
|
44
|
-
|
|
45
|
-
You can create a new project using `npm create`:
|
|
46
|
-
```bash
|
|
47
|
-
npm create zen@latest
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**Why `@latest`?** This ensures you always get the most recent version of the ZEN starter kit. Without it, npm might use a cached or outdated version.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif" alt="line" />
|
|
61
|
-
|
|
62
|
-
## ๐ ๏ธ Available Scripts
|
|
63
|
-
|
|
64
|
-
- `npm run dev` - Starts the development server
|
|
65
|
-
- `npm run host` - Starts the development server, accessible on your local network
|
|
66
|
-
- `npm run build` - Builds the project for production
|
|
67
|
-
- `npm run preview` - Serves the production build locally for preview
|
|
68
|
-
- `npm run lint` - Lints the TypeScript files in the project
|
|
69
|
-
- `npm run lint:fix` - Lints and automatically fixes problems in TypeScript files
|
|
70
|
-
|
|
71
|
-
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif" alt="line" />
|
|
72
|
-
|
|
73
|
-
## ๐ Project Structure
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
zen-starter/
|
|
77
|
-
โโโ components/ # Reusable HTML partials
|
|
78
|
-
โ โโโ accordion.html # Accordion component template
|
|
79
|
-
โ โโโ footer.html # Footer component template
|
|
80
|
-
โ โโโ header.html # Header component template
|
|
81
|
-
โ โโโ modal.html # Modal component template
|
|
82
|
-
โ โโโ tabs.html # Tabs component template
|
|
83
|
-
โโโ pages/ # Project pages
|
|
84
|
-
โ โโโ 404.html # 404 error page
|
|
85
|
-
โ โโโ index.html # Main application page
|
|
86
|
-
โโโ public/ # Static assets
|
|
87
|
-
โ โโโ fonts/ # Font files
|
|
88
|
-
โ โโโ images/ # Image assets
|
|
89
|
-
โโโ src/
|
|
90
|
-
โ โโโ scripts/ # TypeScript source code
|
|
91
|
-
โ โ โโโ components/ # UI component classes
|
|
92
|
-
โ โ โ โโโ Accordion.ts # Accordion component logic
|
|
93
|
-
โ โ โ โโโ BackTopButton.ts # Back to top button
|
|
94
|
-
โ โ โ โโโ Header.ts # Header component logic
|
|
95
|
-
โ โ โ โโโ Tabs.ts # Tabs component logic
|
|
96
|
-
โ โ โ โโโ Theme.ts # Theme switcher
|
|
97
|
-
โ โ โ โโโ index.ts # Component exports
|
|
98
|
-
โ โ โโโ services/ # Service layer
|
|
99
|
-
โ โ โ โโโ api.ts # API utilities
|
|
100
|
-
โ โ โ โโโ scroll.ts # Smooth scroll service
|
|
101
|
-
โ โ โ โโโ storage.ts # Local storage wrapper
|
|
102
|
-
โ โ โ โโโ index.ts # Service exports
|
|
103
|
-
โ โ โโโ types/ # TypeScript type definitions
|
|
104
|
-
โ โ โ โโโ global.d.ts # Global type definitions
|
|
105
|
-
โ โ โโโ utils/ # Utility functions
|
|
106
|
-
โ โ โ โโโ modal.ts # Modal utilities
|
|
107
|
-
โ โ โโโ main.ts # Main entry point
|
|
108
|
-
โ โโโ styles/ # SCSS stylesheets
|
|
109
|
-
โ โโโ core/ # Core styles
|
|
110
|
-
โ โ โโโ components/ # Component styles
|
|
111
|
-
โ โ โ โโโ back-top-button.scss
|
|
112
|
-
โ โ โ โโโ footer.scss
|
|
113
|
-
โ โ โ โโโ header.scss
|
|
114
|
-
โ โ โ โโโ modal.scss
|
|
115
|
-
โ โ โ โโโ index.scss
|
|
116
|
-
โ โ โโโ helpers/ # SCSS helpers
|
|
117
|
-
โ โ โ โโโ functions.scss
|
|
118
|
-
โ โ โ โโโ media.scss
|
|
119
|
-
โ โ โ โโโ mixins.scss
|
|
120
|
-
โ โ โ โโโ index.scss
|
|
121
|
-
โ โ โโโ fonts.scss # Font definitions
|
|
122
|
-
โ โ โโโ globals.scss # Global styles
|
|
123
|
-
โ โ โโโ reset.scss # CSS reset
|
|
124
|
-
โ โ โโโ typography.scss # Typography styles
|
|
125
|
-
โ โ โโโ utils.scss # Utility classes
|
|
126
|
-
โ โ โโโ variables.scss # SCSS variables
|
|
127
|
-
โ โ โโโ index.scss # Core styles index
|
|
128
|
-
โ โโโ main.scss # Main stylesheet
|
|
129
|
-
โโโ .eslintrc.js # ESLint configuration
|
|
130
|
-
โโโ .prettierrc # Prettier configuration
|
|
131
|
-
โโโ index.html # Landing page
|
|
132
|
-
โโโ package.json # Project dependencies
|
|
133
|
-
โโโ postcss.config.js # PostCSS configuration
|
|
134
|
-
โโโ tsconfig.json # TypeScript configuration
|
|
135
|
-
โโโ vite.config.js # Vite configuration
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif" alt="line" />
|
|
139
|
-
|
|
140
|
-
## ๐ฏ Key Components
|
|
141
|
-
|
|
142
|
-
### UI Components
|
|
143
|
-
- **Accordion**: Collapsible content sections with smooth animations
|
|
144
|
-
- **Tabs**: Tabbed interface with keyboard navigation
|
|
145
|
-
- **Modal**: Lightweight modal system with backdrop
|
|
146
|
-
- **Header**: Responsive navigation with mobile menu
|
|
147
|
-
- **BackTopButton**: Smooth scroll-to-top functionality
|
|
148
|
-
- **ThemeToggle**: Dark/light theme switcher
|
|
149
|
-
|
|
150
|
-
### Services
|
|
151
|
-
- **Scroll**: Lenis-powered smooth scrolling
|
|
152
|
-
- **Storage**: Type-safe local storage wrapper
|
|
153
|
-
- **API**: HTTP request utilities
|
|
154
|
-
|
|
155
|
-
### Utilities
|
|
156
|
-
- **Modal Management**: Easy modal initialization and control
|
|
157
|
-
- **Type Definitions**: Comprehensive TypeScript types
|
|
158
|
-
|
|
159
|
-
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif" alt="line" />
|
|
160
|
-
|
|
161
|
-
## ๐จ Styling
|
|
162
|
-
|
|
163
|
-
The project uses a well-organized SCSS structure:
|
|
164
|
-
|
|
165
|
-
- **Variables**: Centralized design tokens
|
|
166
|
-
- **Mixins**: Reusable style patterns
|
|
167
|
-
- **Functions**: SCSS utility functions
|
|
168
|
-
- **Media Queries**: Responsive breakpoint helpers
|
|
169
|
-
- **Component Styles**: Modular component styling
|
|
170
|
-
- **Utility Classes**: Helper classes for common patterns
|
|
171
|
-
|
|
172
|
-
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif" alt="line" />
|
|
173
|
-
|
|
174
|
-
## ๐ง Configuration
|
|
175
|
-
|
|
176
|
-
### Vite Configuration
|
|
177
|
-
- Multi-page application support
|
|
178
|
-
- SCSS preprocessing with modern compiler API
|
|
179
|
-
- PostCSS integration with autoprefixer
|
|
180
|
-
- Handlebars templating support
|
|
181
|
-
- Optimized build output
|
|
182
|
-
|
|
183
|
-
### TypeScript Configuration
|
|
184
|
-
- Strict type checking
|
|
185
|
-
- Modern ES modules
|
|
186
|
-
- Path mapping for clean imports
|
|
187
|
-
|
|
188
|
-
### Code Quality
|
|
189
|
-
- ESLint with TypeScript support
|
|
190
|
-
- Prettier for consistent formatting
|
|
191
|
-
- Pre-commit hooks ready
|
|
192
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
[](https://git.io/typing-svg)
|
|
4
|
+
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
A premium Vite starter kit for rapid web development, designed to streamline your development process. It comes pre-configured with essential tools like TypeScript, Vite, SCSS, and modern UI components.
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<img src="https://img.shields.io/badge/Vite-646CFF?style=for-the-badge&logo=vite&logoColor=white" alt="Vite"/>
|
|
11
|
+
<img src="https://img.shields.io/badge/TypeScript-3178C6?style=for-the-badge&logo=typescript&logoColor=white" alt="TypeScript"/>
|
|
12
|
+
<img src="https://img.shields.io/badge/Sass-CC6699?style=for-the-badge&logo=sass&logoColor=white" alt="Sass"/>
|
|
13
|
+
<img src="https://img.shields.io/badge/PostCSS-DD3A0A?style=for-the-badge&logo=postcss&logoColor=white" alt="PostCSS"/>
|
|
14
|
+
<img src="https://img.shields.io/badge/Handlebars.js-f0772b?style=for-the-badge&logo=handlebars.js&logoColor=white" alt="Handlebars"/>
|
|
15
|
+
<img src="https://img.shields.io/badge/Lenis-000000?style=for-the-badge&logo=lenis&logoColor=white" alt="Lenis"/>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif" alt="line" />
|
|
19
|
+
|
|
20
|
+
## โจ Features
|
|
21
|
+
|
|
22
|
+
- **๐ Vite**: Next-generation frontend tooling for a blazing fast development experience
|
|
23
|
+
- **๐ก๏ธ TypeScript**: Strong typing for more robust and maintainable code
|
|
24
|
+
- **๐จ SCSS**: CSS with superpowers, enabling variables, nesting, and mixins
|
|
25
|
+
- **๐ง ESLint & Prettier**: Code quality and formatting tools
|
|
26
|
+
- **โก PostCSS**: Advanced CSS processing with plugins
|
|
27
|
+
- **๐ Handlebars**: Templating engine for clean HTML organization
|
|
28
|
+
- **๐ Lenis**: Buttery smooth scrolling experience
|
|
29
|
+
- **๐ญ Ready-to-use Components**: Tabs, Modals, Accordions, Theme Switcher
|
|
30
|
+
- **๐ฑ Responsive Design**: Mobile-first approach with modern breakpoints
|
|
31
|
+
- **๐ Dark/Light Theme**: Built-in theme switching with persistence
|
|
32
|
+
- **๐ฆ Modern Build**: Optimized for production with tree-shaking
|
|
33
|
+
|
|
34
|
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif" alt="line" />
|
|
35
|
+
|
|
36
|
+
## ๐ Getting Started
|
|
37
|
+
|
|
38
|
+
### Prerequisites
|
|
39
|
+
|
|
40
|
+
- [Node.js](https://nodejs.org/) (version 18.x or higher)
|
|
41
|
+
- [npm](https://www.npmjs.com/)
|
|
42
|
+
|
|
43
|
+
### Installation
|
|
44
|
+
|
|
45
|
+
You can create a new project using `npm create`:
|
|
46
|
+
```bash
|
|
47
|
+
npm create zen@latest -- --yes
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Why `@latest`?** This ensures you always get the most recent version of the ZEN starter kit. Without it, npm might use a cached or outdated version.
|
|
51
|
+
|
|
52
|
+
**Why `--yes`?** This skips the initial "install create-zen" confirmation and starts the setup immediately.
|
|
53
|
+
|
|
54
|
+
The tool will interactively prompt you to:
|
|
55
|
+
1. **Enter your project name** (with a default fallback)
|
|
56
|
+
2. **Choose a starter variant**:
|
|
57
|
+
- **Standard**: BEM + SCSS + TypeScript (`zen-starter`)
|
|
58
|
+
- **Express**: Tailwind CSS + Alpine.js (`zen-express`)
|
|
59
|
+
|
|
60
|
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif" alt="line" />
|
|
61
|
+
|
|
62
|
+
## ๐ ๏ธ Available Scripts
|
|
63
|
+
|
|
64
|
+
- `npm run dev` - Starts the development server
|
|
65
|
+
- `npm run host` - Starts the development server, accessible on your local network
|
|
66
|
+
- `npm run build` - Builds the project for production
|
|
67
|
+
- `npm run preview` - Serves the production build locally for preview
|
|
68
|
+
- `npm run lint` - Lints the TypeScript files in the project
|
|
69
|
+
- `npm run lint:fix` - Lints and automatically fixes problems in TypeScript files
|
|
70
|
+
|
|
71
|
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif" alt="line" />
|
|
72
|
+
|
|
73
|
+
## ๐ Project Structure
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
zen-starter/
|
|
77
|
+
โโโ components/ # Reusable HTML partials
|
|
78
|
+
โ โโโ accordion.html # Accordion component template
|
|
79
|
+
โ โโโ footer.html # Footer component template
|
|
80
|
+
โ โโโ header.html # Header component template
|
|
81
|
+
โ โโโ modal.html # Modal component template
|
|
82
|
+
โ โโโ tabs.html # Tabs component template
|
|
83
|
+
โโโ pages/ # Project pages
|
|
84
|
+
โ โโโ 404.html # 404 error page
|
|
85
|
+
โ โโโ index.html # Main application page
|
|
86
|
+
โโโ public/ # Static assets
|
|
87
|
+
โ โโโ fonts/ # Font files
|
|
88
|
+
โ โโโ images/ # Image assets
|
|
89
|
+
โโโ src/
|
|
90
|
+
โ โโโ scripts/ # TypeScript source code
|
|
91
|
+
โ โ โโโ components/ # UI component classes
|
|
92
|
+
โ โ โ โโโ Accordion.ts # Accordion component logic
|
|
93
|
+
โ โ โ โโโ BackTopButton.ts # Back to top button
|
|
94
|
+
โ โ โ โโโ Header.ts # Header component logic
|
|
95
|
+
โ โ โ โโโ Tabs.ts # Tabs component logic
|
|
96
|
+
โ โ โ โโโ Theme.ts # Theme switcher
|
|
97
|
+
โ โ โ โโโ index.ts # Component exports
|
|
98
|
+
โ โ โโโ services/ # Service layer
|
|
99
|
+
โ โ โ โโโ api.ts # API utilities
|
|
100
|
+
โ โ โ โโโ scroll.ts # Smooth scroll service
|
|
101
|
+
โ โ โ โโโ storage.ts # Local storage wrapper
|
|
102
|
+
โ โ โ โโโ index.ts # Service exports
|
|
103
|
+
โ โ โโโ types/ # TypeScript type definitions
|
|
104
|
+
โ โ โ โโโ global.d.ts # Global type definitions
|
|
105
|
+
โ โ โโโ utils/ # Utility functions
|
|
106
|
+
โ โ โ โโโ modal.ts # Modal utilities
|
|
107
|
+
โ โ โโโ main.ts # Main entry point
|
|
108
|
+
โ โโโ styles/ # SCSS stylesheets
|
|
109
|
+
โ โโโ core/ # Core styles
|
|
110
|
+
โ โ โโโ components/ # Component styles
|
|
111
|
+
โ โ โ โโโ back-top-button.scss
|
|
112
|
+
โ โ โ โโโ footer.scss
|
|
113
|
+
โ โ โ โโโ header.scss
|
|
114
|
+
โ โ โ โโโ modal.scss
|
|
115
|
+
โ โ โ โโโ index.scss
|
|
116
|
+
โ โ โโโ helpers/ # SCSS helpers
|
|
117
|
+
โ โ โ โโโ functions.scss
|
|
118
|
+
โ โ โ โโโ media.scss
|
|
119
|
+
โ โ โ โโโ mixins.scss
|
|
120
|
+
โ โ โ โโโ index.scss
|
|
121
|
+
โ โ โโโ fonts.scss # Font definitions
|
|
122
|
+
โ โ โโโ globals.scss # Global styles
|
|
123
|
+
โ โ โโโ reset.scss # CSS reset
|
|
124
|
+
โ โ โโโ typography.scss # Typography styles
|
|
125
|
+
โ โ โโโ utils.scss # Utility classes
|
|
126
|
+
โ โ โโโ variables.scss # SCSS variables
|
|
127
|
+
โ โ โโโ index.scss # Core styles index
|
|
128
|
+
โ โโโ main.scss # Main stylesheet
|
|
129
|
+
โโโ .eslintrc.js # ESLint configuration
|
|
130
|
+
โโโ .prettierrc # Prettier configuration
|
|
131
|
+
โโโ index.html # Landing page
|
|
132
|
+
โโโ package.json # Project dependencies
|
|
133
|
+
โโโ postcss.config.js # PostCSS configuration
|
|
134
|
+
โโโ tsconfig.json # TypeScript configuration
|
|
135
|
+
โโโ vite.config.js # Vite configuration
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif" alt="line" />
|
|
139
|
+
|
|
140
|
+
## ๐ฏ Key Components
|
|
141
|
+
|
|
142
|
+
### UI Components
|
|
143
|
+
- **Accordion**: Collapsible content sections with smooth animations
|
|
144
|
+
- **Tabs**: Tabbed interface with keyboard navigation
|
|
145
|
+
- **Modal**: Lightweight modal system with backdrop
|
|
146
|
+
- **Header**: Responsive navigation with mobile menu
|
|
147
|
+
- **BackTopButton**: Smooth scroll-to-top functionality
|
|
148
|
+
- **ThemeToggle**: Dark/light theme switcher
|
|
149
|
+
|
|
150
|
+
### Services
|
|
151
|
+
- **Scroll**: Lenis-powered smooth scrolling
|
|
152
|
+
- **Storage**: Type-safe local storage wrapper
|
|
153
|
+
- **API**: HTTP request utilities
|
|
154
|
+
|
|
155
|
+
### Utilities
|
|
156
|
+
- **Modal Management**: Easy modal initialization and control
|
|
157
|
+
- **Type Definitions**: Comprehensive TypeScript types
|
|
158
|
+
|
|
159
|
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif" alt="line" />
|
|
160
|
+
|
|
161
|
+
## ๐จ Styling
|
|
162
|
+
|
|
163
|
+
The project uses a well-organized SCSS structure:
|
|
164
|
+
|
|
165
|
+
- **Variables**: Centralized design tokens
|
|
166
|
+
- **Mixins**: Reusable style patterns
|
|
167
|
+
- **Functions**: SCSS utility functions
|
|
168
|
+
- **Media Queries**: Responsive breakpoint helpers
|
|
169
|
+
- **Component Styles**: Modular component styling
|
|
170
|
+
- **Utility Classes**: Helper classes for common patterns
|
|
171
|
+
|
|
172
|
+
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif" alt="line" />
|
|
173
|
+
|
|
174
|
+
## ๐ง Configuration
|
|
175
|
+
|
|
176
|
+
### Vite Configuration
|
|
177
|
+
- Multi-page application support
|
|
178
|
+
- SCSS preprocessing with modern compiler API
|
|
179
|
+
- PostCSS integration with autoprefixer
|
|
180
|
+
- Handlebars templating support
|
|
181
|
+
- Optimized build output
|
|
182
|
+
|
|
183
|
+
### TypeScript Configuration
|
|
184
|
+
- Strict type checking
|
|
185
|
+
- Modern ES modules
|
|
186
|
+
- Path mapping for clean imports
|
|
187
|
+
|
|
188
|
+
### Code Quality
|
|
189
|
+
- ESLint with TypeScript support
|
|
190
|
+
- Prettier for consistent formatting
|
|
191
|
+
- Pre-commit hooks ready
|
|
192
|
+
|
|
193
193
|
<img src="https://user-images.githubusercontent.com/73097560/115834477-dbab4500-a447-11eb-908a-139a6edaec5c.gif" alt="line" />
|
package/index.js
CHANGED
|
@@ -1,110 +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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
white: '#
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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.
|
|
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
|
+
}
|