create-zen 1.7.0 → 1.7.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/README.md +192 -192
- package/index.js +19 -21
- package/package.json +3 -3
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
|
@@ -55,36 +55,34 @@ const getProjectName = async () => {
|
|
|
55
55
|
return projectName;
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
//
|
|
59
|
-
const
|
|
58
|
+
// Choose starter variant
|
|
59
|
+
const getStarterVariant = async () => {
|
|
60
60
|
console.log();
|
|
61
|
-
|
|
62
|
-
const { version } = await prompts({
|
|
61
|
+
const { variant } = await prompts({
|
|
63
62
|
type: 'select',
|
|
64
|
-
name: '
|
|
65
|
-
message: 'Select ZEN starter
|
|
63
|
+
name: 'variant',
|
|
64
|
+
message: 'Select ZEN starter variant:',
|
|
66
65
|
choices: [
|
|
67
66
|
{
|
|
68
|
-
title: `${chalk.hex(colors.white)('Standard
|
|
67
|
+
title: `${chalk.hex(colors.white)('Standard')} ${chalk.hex(colors.lightGrey)('(BEM + SCSS + TypeScript)')}`,
|
|
69
68
|
value: 'standard'
|
|
70
69
|
},
|
|
71
70
|
{
|
|
72
|
-
title: `${chalk.hex(colors.purple)('
|
|
73
|
-
value: '
|
|
71
|
+
title: `${chalk.hex(colors.purple)('Express')} ${chalk.hex(colors.lightGrey)('(Tailwind CSS + Alpine.js)')}`,
|
|
72
|
+
value: 'express'
|
|
74
73
|
}
|
|
75
74
|
],
|
|
76
75
|
initial: 0,
|
|
77
76
|
hint: false
|
|
78
77
|
});
|
|
79
|
-
|
|
80
78
|
console.log();
|
|
81
|
-
return
|
|
79
|
+
return variant;
|
|
82
80
|
};
|
|
83
81
|
|
|
84
|
-
// Get repository URL
|
|
85
|
-
const getRepositoryUrl = (
|
|
86
|
-
if (
|
|
87
|
-
return 'https://github.com/dmitry-conquer/zen-
|
|
82
|
+
// Get repository URL
|
|
83
|
+
const getRepositoryUrl = (variant) => {
|
|
84
|
+
if (variant === 'express') {
|
|
85
|
+
return 'https://github.com/dmitry-conquer/zen-express.git';
|
|
88
86
|
}
|
|
89
87
|
return 'https://github.com/dmitry-conquer/zen-starter.git';
|
|
90
88
|
};
|
|
@@ -95,12 +93,12 @@ const main = async () => {
|
|
|
95
93
|
displayHeader();
|
|
96
94
|
|
|
97
95
|
const PROJECT_NAME = await getProjectName();
|
|
98
|
-
const
|
|
99
|
-
const REPO_URL = getRepositoryUrl(
|
|
96
|
+
const variant = await getStarterVariant();
|
|
97
|
+
const REPO_URL = getRepositoryUrl(variant);
|
|
100
98
|
|
|
101
99
|
// Cloning with spinner
|
|
102
100
|
const spinner = ora({
|
|
103
|
-
text: `${chalk.hex(colors.green)('◇')} ${title('
|
|
101
|
+
text: `${chalk.hex(colors.green)('◇')} ${title('Preparing your ZEN project...')}`,
|
|
104
102
|
color: 'green'
|
|
105
103
|
}).start();
|
|
106
104
|
|
|
@@ -108,8 +106,8 @@ const main = async () => {
|
|
|
108
106
|
execSync(`git clone --depth=1 "${REPO_URL}" "${PROJECT_NAME}"`, { stdio: 'pipe' });
|
|
109
107
|
spinner.stop();
|
|
110
108
|
} catch (err) {
|
|
111
|
-
spinner.fail(`${error('
|
|
112
|
-
console.log(` ${subtitle('Please check your internet connection
|
|
109
|
+
spinner.fail(`${error('Setup failed!')}`);
|
|
110
|
+
console.log(` ${subtitle('Please check your internet connection, permissions, and try again.')}`);
|
|
113
111
|
process.exit(1);
|
|
114
112
|
}
|
|
115
113
|
|
|
@@ -122,7 +120,7 @@ const main = async () => {
|
|
|
122
120
|
console.log();
|
|
123
121
|
|
|
124
122
|
// Next steps
|
|
125
|
-
console.log(` ${chalk.hex(colors.green)('◇')} ${title('Next steps
|
|
123
|
+
console.log(` ${chalk.hex(colors.green)('◇')} ${title('Next steps')}`);
|
|
126
124
|
console.log(` ${chalk.hex(colors.purple)('📁')} ${highlight(`cd ${PROJECT_NAME}`)}`);
|
|
127
125
|
console.log(` ${chalk.hex(colors.purple)('📦')} ${highlight('npm install')}`);
|
|
128
126
|
console.log(` ${chalk.hex(colors.purple)('🧑💻')} ${highlight('npm run dev')}`);
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-zen",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "✨ Create a new web development project with modern setup powered by Vite 🚀",
|
|
6
6
|
"bin": {
|
|
7
|
-
"create-zen": "
|
|
7
|
+
"create-zen": "index.js"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"fs-extra": "^11.1.1",
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
"chalk": "^5.3.0",
|
|
13
13
|
"ora": "^7.0.1"
|
|
14
14
|
}
|
|
15
|
-
}
|
|
15
|
+
}
|