frontend-boilerplate-cli 1.0.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.
Files changed (39) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +418 -0
  3. package/dist/architectures/structures.d.ts +15 -0
  4. package/dist/architectures/structures.d.ts.map +1 -0
  5. package/dist/architectures/structures.js +1018 -0
  6. package/dist/cli/cli.d.ts +3 -0
  7. package/dist/cli/cli.d.ts.map +1 -0
  8. package/dist/cli/cli.js +17 -0
  9. package/dist/commands/create.d.ts +8 -0
  10. package/dist/commands/create.d.ts.map +1 -0
  11. package/dist/commands/create.js +56 -0
  12. package/dist/index.d.ts +4 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +3 -0
  15. package/dist/utils/configSetup.d.ts +5 -0
  16. package/dist/utils/configSetup.d.ts.map +1 -0
  17. package/dist/utils/configSetup.js +225 -0
  18. package/dist/utils/fileSystem.d.ts +7 -0
  19. package/dist/utils/fileSystem.d.ts.map +1 -0
  20. package/dist/utils/fileSystem.js +22 -0
  21. package/dist/utils/folderBuilder.d.ts +7 -0
  22. package/dist/utils/folderBuilder.d.ts.map +1 -0
  23. package/dist/utils/folderBuilder.js +44 -0
  24. package/dist/utils/installer.d.ts +3 -0
  25. package/dist/utils/installer.d.ts.map +1 -0
  26. package/dist/utils/installer.js +23 -0
  27. package/dist/utils/logger.d.ts +9 -0
  28. package/dist/utils/logger.d.ts.map +1 -0
  29. package/dist/utils/logger.js +9 -0
  30. package/package.json +72 -0
  31. package/templates/configs/CHANGELOG.md +59 -0
  32. package/templates/configs/biome.json +61 -0
  33. package/templates/configs/commit-msg +15 -0
  34. package/templates/configs/commitlint.config.js +25 -0
  35. package/templates/configs/github-workflow.yml +100 -0
  36. package/templates/configs/lighthouserc.js +36 -0
  37. package/templates/configs/lint-staged.config.json +8 -0
  38. package/templates/configs/pre-commit +1 -0
  39. package/templates/configs/pull_request_template.md +28 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 kroquetitaa
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,418 @@
1
+ # 🚀 Frontend Boilerplate
2
+
3
+ <p align="center">
4
+ <img src="https://img.shields.io/npm/v/frontend-boilerplate?style=flat-square" alt="npm version" />
5
+ <img src="https://img.shields.io/npm/dm/frontend-boilerplate?style=flat-square" alt="npm downloads" />
6
+ <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="license" />
7
+ <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square" alt="PRs Welcome" />
8
+ </p>
9
+
10
+ <p align="center">
11
+ A modern, scalable, and production-ready CLI to scaffold frontend projects with best practices built-in.
12
+ </p>
13
+
14
+ <p align="center">
15
+ <a href="#-features">Features</a> •
16
+ <a href="#-quick-start">Quick Start</a> •
17
+ <a href="#-architectures">Architectures</a> •
18
+ <a href="#-what-you-get">What You Get</a> •
19
+ <a href="#-documentation">Documentation</a>
20
+ </p>
21
+
22
+ ---
23
+
24
+ ## 🚀 Quick Start
25
+
26
+ ### Installation
27
+ ```bash
28
+ # Using npx (recommended)
29
+ npx frontend-boilerplate my-awesome-app
30
+ npx create-frontend-app my-awesome-app
31
+ ```
32
+
33
+ Or follow these steps:
34
+ ```bash
35
+ # Using npx (recommended)
36
+ npx frontend-boilerplate my-awesome-app
37
+
38
+ # Or install globally
39
+ npm install -g frontend-boilerplate
40
+ create-frontend-app my-awesome-app
41
+
42
+ # Navigate to your project
43
+ cd my-awesome-app
44
+
45
+ # Install dependencies
46
+ npm install
47
+
48
+ # Start developing
49
+ npm run dev
50
+ ```
51
+
52
+ ### 🎯 With Options
53
+ ```bash
54
+ # Specify template
55
+ npx frontend-boilerplate my-app --template react-ts
56
+
57
+ # Choose package manager
58
+ npx frontend-boilerplate my-app --package-manager yarn
59
+
60
+ # Skip automatic dependency installation
61
+ npx frontend-boilerplate my-app --skip-install
62
+ ```
63
+
64
+ ### What happens when you run it?
65
+
66
+ 1. ✅ Creates a Vite + React + TypeScript project
67
+ 2. ✅ Asks you to choose from 7 architecture patterns
68
+ 3. ✅ Generates the complete folder structure
69
+ 4. ✅ Configures GitHub Actions, Husky, Biome, and Lighthouse CI
70
+ 5. ✅ Installs all dependencies
71
+ 6. ✅ Ready to start coding! 🎉
72
+
73
+ ---
74
+
75
+ ## ✨ Features
76
+
77
+ - ⚡ **Vite** - Lightning-fast build tool
78
+ - ⚛️ **React 18 + TypeScript** - Modern React with full type safety
79
+ - 🏗️ **7 Architecture Patterns** - Choose the perfect structure for your project
80
+ - 🔧 **Pre-configured Tools** - GitHub Actions, Husky, Biome, Lighthouse CI
81
+ - 📦 **Ready to Deploy** - Production-ready from day one
82
+ - 🎨 **Best Practices** - Industry-standard patterns and conventions
83
+ - 🚦 **Git Hooks** - Automated linting and testing on commit
84
+ - 📊 **Performance Monitoring** - Lighthouse CI integration
85
+ - 📝 **Documentation** - Auto-generated READMEs in every folder
86
+
87
+ ---
88
+
89
+ ## 🚀 Quick Start
90
+
91
+ ```bash
92
+ # Using npx (recommended)
93
+ npx frontend-boilerplate my-awesome-app
94
+
95
+ # Or install globally
96
+ npm install -g frontend-boilerplate
97
+ create-frontend-app my-awesome-app
98
+
99
+ # Navigate to your project
100
+ cd my-awesome-app
101
+
102
+ # Install dependencies
103
+ npm install
104
+
105
+ # Start developing
106
+ npm run dev
107
+ ```
108
+
109
+ ### 🎯 With Options
110
+
111
+ ```bash
112
+ # Specify template
113
+ npx frontend-boilerplate my-app --template react-ts
114
+
115
+ # Choose package manager
116
+ npx frontend-boilerplate my-app --package-manager yarn
117
+
118
+ # Skip automatic dependency installation
119
+ npx frontend-boilerplate my-app --skip-install
120
+ ```
121
+
122
+ ---
123
+
124
+ ## 🏗️ Architectures
125
+
126
+ Choose from **7 production-ready architectures** during project setup:
127
+
128
+ ### 1. 🎯 Monolithic (Classic SPA)
129
+ **Best for:** Small to medium projects, MVPs, rapid prototyping
130
+
131
+ Simple and traditional structure for Single Page Applications.
132
+
133
+ ```
134
+ src/
135
+ ├── components/ # Reusable UI components
136
+ ├── pages/ # Application pages
137
+ ├── services/ # API services
138
+ ├── hooks/ # Custom React hooks
139
+ └── utils/ # Utilities and helpers
140
+ ```
141
+
142
+ ### 2. 📚 Layered Architecture
143
+ **Best for:** Medium to large projects, clear separation of concerns
144
+
145
+ Clear separation between presentation, business logic, and data layers.
146
+
147
+ ```
148
+ src/
149
+ ├── presentation/ # UI components and pages
150
+ ├── application/ # Business logic and use cases
151
+ ├── domain/ # Domain models and entities
152
+ ├── infrastructure/ # External services and APIs
153
+ └── shared/ # Shared utilities
154
+ ```
155
+
156
+ ### 3. 🧩 Feature-Based / Modular
157
+ **Best for:** Large projects, multiple teams, microservices
158
+
159
+ Organization by features/modules with vertical slicing.
160
+
161
+ ```
162
+ src/
163
+ ├── features/
164
+ │ ├── auth/ # Authentication feature
165
+ │ ├── user/ # User management
166
+ │ └── dashboard/ # Dashboard feature
167
+ └── shared/ # Shared components
168
+ ```
169
+
170
+ ### 4. 🎯 Clean Architecture
171
+ **Best for:** Enterprise applications, long-term maintainability
172
+
173
+ Clean architecture with inverted dependencies and SOLID principles.
174
+
175
+ ```
176
+ src/
177
+ ├── core/ # Business rules and entities
178
+ ├── adapters/ # Interface adapters
179
+ ├── infrastructure/ # External implementations
180
+ └── ui/ # User interface
181
+ ```
182
+
183
+ ### 5. ⚛️ Atomic Design
184
+ **Best for:** Design system projects, component libraries
185
+
186
+ Components organized by complexity level (atoms → molecules → organisms).
187
+
188
+ ```
189
+ src/
190
+ ├── components/
191
+ │ ├── atoms/ # Basic building blocks
192
+ │ ├── molecules/ # Simple combinations
193
+ │ ├── organisms/ # Complex components
194
+ │ └── templates/ # Page layouts
195
+ └── pages/ # Complete pages
196
+ ```
197
+
198
+ ### 6. 🌐 Micro-Frontends
199
+ **Best for:** Large-scale applications, independent teams
200
+
201
+ Independent applications integrated into a single shell.
202
+
203
+ ```
204
+ src/
205
+ ├── apps/
206
+ │ ├── shell/ # Main container
207
+ │ ├── auth/ # Auth micro-app
208
+ │ └── dashboard/ # Dashboard micro-app
209
+ └── shared/ # Shared resources
210
+ ```
211
+
212
+ ### 7. 🎮 MVC / MVVM
213
+ **Best for:** Traditional applications, developers familiar with MVC
214
+
215
+ Model-View-Controller / Model-View-ViewModel pattern.
216
+
217
+ ```
218
+ src/
219
+ ├── models/ # Data models
220
+ ├── views/ # UI components
221
+ ├── controllers/ # Application logic
222
+ └── viewModels/ # View data preparation
223
+ ```
224
+
225
+ ---
226
+
227
+ ## 📦 What You Get
228
+
229
+ ### Development Tools
230
+
231
+ - **🔍 Biome** - Fast linter and formatter (replaces ESLint + Prettier)
232
+ - **🐶 Husky** - Git hooks for automated quality checks
233
+ - **📋 lint-staged** - Run linters on staged files only
234
+ - **✅ Commitlint** - Conventional commits validation
235
+ - **🏠 Lighthouse CI** - Automated performance audits
236
+
237
+ ### GitHub Workflows
238
+
239
+ Pre-configured CI/CD pipeline with:
240
+ - ✅ Automated linting and formatting checks
241
+ - ✅ Build verification
242
+ - ✅ Lighthouse performance reports on PRs
243
+ - ✅ Ready for deployment
244
+
245
+ ### Configuration Files
246
+
247
+ All projects include:
248
+ - ✅ `biome.json` - Linter and formatter config
249
+ - ✅ `lighthouserc.js` - Lighthouse CI config
250
+ - ✅ `CHANGELOG.md` - Track your changes
251
+ - ✅ `.github/pull_request_template.md` - PR template
252
+ - ✅ `.github/workflows/ci.yml` - CI/CD pipeline
253
+ - ✅ Git hooks for pre-commit and commit-msg
254
+
255
+ ---
256
+
257
+ ## 📖 Documentation
258
+
259
+ ### Available Scripts
260
+
261
+ ```bash
262
+ # Development
263
+ npm run dev # Start development server
264
+ npm run build # Build for production
265
+ npm run preview # Preview production build
266
+
267
+ # Code Quality
268
+ npm run lint # Check code with Biome
269
+ npm run lint:fix # Fix linting issues
270
+ npm run format # Format code with Biome
271
+ npm run format:check # Check formatting
272
+
273
+ # Performance
274
+ npm run lighthouse # Run Lighthouse audit
275
+ ```
276
+
277
+ ### Project Structure
278
+
279
+ Every architecture includes detailed `README.md` files in key folders explaining:
280
+ - Purpose of each directory
281
+ - Best practices for that folder
282
+ - Examples and patterns to follow
283
+
284
+ ### Conventional Commits
285
+
286
+ All projects enforce conventional commits:
287
+
288
+ ```bash
289
+ feat: add user authentication
290
+ fix: resolve login redirect issue
291
+ docs: update API documentation
292
+ style: format code with Biome
293
+ refactor: simplify auth logic
294
+ test: add user service tests
295
+ chore: update dependencies
296
+ ```
297
+
298
+ ---
299
+
300
+ ## 🎨 Customization
301
+
302
+ ### Modify Architecture
303
+
304
+ You can easily customize the generated structure by:
305
+
306
+ 1. Editing `src/architectures/structures.ts` in the boilerplate source
307
+ 2. Adding your own architecture patterns
308
+ 3. Extending existing architectures
309
+
310
+ ### Add Your Own Templates
311
+
312
+ ```typescript
313
+ // Example: Add a new architecture
314
+ export const architectures = {
315
+ // ... existing architectures
316
+ myCustomArchitecture: {
317
+ name: 'My Custom Architecture',
318
+ description: 'Custom structure for my needs',
319
+ folders: {
320
+ src: {
321
+ // Your folder structure
322
+ }
323
+ }
324
+ }
325
+ }
326
+ ```
327
+
328
+ ---
329
+
330
+ ## 🤝 Contributing
331
+
332
+ Contributions are welcome! Here's how you can help:
333
+
334
+ 1. 🍴 Fork the repository
335
+ 2. 🌿 Create a feature branch (`git checkout -b feature/amazing-feature`)
336
+ 3. 💾 Commit your changes (`git commit -m 'feat: add amazing feature'`)
337
+ 4. 📤 Push to the branch (`git push origin feature/amazing-feature`)
338
+ 5. 🔀 Open a Pull Request
339
+
340
+ ### Development Setup
341
+
342
+ ```bash
343
+ # Clone the repository
344
+ git clone https://github.com/Kroquetitaa/frontend-boilerplate.git
345
+ cd frontend-boilerplate
346
+
347
+ # Install dependencies
348
+ npm install
349
+
350
+ # Build
351
+ npm run build
352
+
353
+ # Test locally
354
+ npm link
355
+ create-frontend-app test-project
356
+ ```
357
+
358
+ ---
359
+
360
+ ## 📊 Comparison
361
+
362
+ | Feature | CRA | Vite | Next.js | **Frontend Boilerplate** |
363
+ |---------|-----|------|---------|--------------------------|
364
+ | ⚡ Fast HMR | ❌ | ✅ | ✅ | ✅ |
365
+ | 🏗️ Architecture Patterns | ❌ | ❌ | ❌ | ✅ (7 options) |
366
+ | 🔧 Pre-configured Tools | ⚠️ | ❌ | ⚠️ | ✅ |
367
+ | 📊 Performance Monitoring | ❌ | ❌ | ❌ | ✅ |
368
+ | 🐶 Git Hooks | ❌ | ❌ | ❌ | ✅ |
369
+ | 📝 Auto Documentation | ❌ | ❌ | ❌ | ✅ |
370
+ | 🚀 Production Ready | ⚠️ | ❌ | ✅ | ✅ |
371
+
372
+ ---
373
+
374
+ ## 🛠️ Tech Stack
375
+
376
+ <p align="center">
377
+ <img src="https://img.shields.io/badge/React-18-61DAFB?style=for-the-badge&logo=react&logoColor=white" alt="React" />
378
+ <img src="https://img.shields.io/badge/TypeScript-5-3178C6?style=for-the-badge&logo=typescript&logoColor=white" alt="TypeScript" />
379
+ <img src="https://img.shields.io/badge/Vite-5-646CFF?style=for-the-badge&logo=vite&logoColor=white" alt="Vite" />
380
+ <img src="https://img.shields.io/badge/Biome-2.1-60A5FA?style=for-the-badge&logo=biome&logoColor=white" alt="Biome" />
381
+ </p>
382
+
383
+ ---
384
+
385
+ ## 📜 License
386
+
387
+ This project is licensed under the **MIT License**.
388
+
389
+ Copyright © 2026 [kroquetitaa](https://github.com/Kroquetitaa)
390
+
391
+ See the [LICENSE](LICENSE) file for full details.
392
+
393
+ ---
394
+
395
+ ## 💖 Acknowledgments
396
+
397
+ - [Vite](https://vitejs.dev/) - Next generation frontend tooling
398
+ - [Biome](https://biomejs.dev/) - One toolchain for your web project
399
+ - [Husky](https://typicode.github.io/husky/) - Modern native git hooks
400
+ - [Lighthouse](https://github.com/GoogleChrome/lighthouse) - Automated auditing
401
+
402
+ ---
403
+
404
+ ## 📞 Support
405
+
406
+ - 🐛 [Report a bug](https://github.com/Kroquetitaa/frontend-boilerplate/issues)
407
+ - 💡 [Request a feature](https://github.com/Kroquetitaa/frontend-boilerplate/issues)
408
+ - 💬 [Discussions](https://github.com/Kroquetitaa/frontend-boilerplate/discussions)
409
+
410
+ ---
411
+
412
+ <p align="center">
413
+ Made with ❤️ by <a href="https://github.com/Kroquetitaa">kroquetitaa</a>
414
+ </p>
415
+
416
+ <p align="center">
417
+ <sub>If you found this helpful, consider giving it a ⭐️</sub>
418
+ </p>
@@ -0,0 +1,15 @@
1
+ export interface FolderStructure {
2
+ [key: string]: FolderStructure | null;
3
+ }
4
+ export interface Architecture {
5
+ name: string;
6
+ description: string;
7
+ folders: FolderStructure;
8
+ files?: {
9
+ [path: string]: string;
10
+ };
11
+ }
12
+ export declare const architectures: {
13
+ [key: string]: Architecture;
14
+ };
15
+ //# sourceMappingURL=structures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structures.d.ts","sourceRoot":"","sources":["../../src/architectures/structures.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,eAAe,CAAC;IACzB,KAAK,CAAC,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACpC;AAED,eAAO,MAAM,aAAa,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAA;CA+/BxD,CAAC"}