@igniter-js/cli 0.1.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/dist/index.d.ts +2 -0
- package/dist/index.js +358 -0
- package/dist/templates/components.json.hbs +21 -0
- package/dist/templates/copilot.instructions.hbs +117 -0
- package/dist/templates/docker-compose.hbs +15 -0
- package/dist/templates/env.hbs +33 -0
- package/dist/templates/eslintrc.hbs +3 -0
- package/dist/templates/feature.controller.hbs +83 -0
- package/dist/templates/feature.index.hbs +5 -0
- package/dist/templates/feature.interface.hbs +71 -0
- package/dist/templates/feature.procedure.hbs +76 -0
- package/dist/templates/globals.hbs +198 -0
- package/dist/templates/igniter.client.hbs +21 -0
- package/dist/templates/igniter.context.hbs +23 -0
- package/dist/templates/igniter.hbs +8 -0
- package/dist/templates/igniter.router.hbs +29 -0
- package/dist/templates/layout.hbs +54 -0
- package/dist/templates/page.hbs +313 -0
- package/dist/templates/prisma.hbs +9 -0
- package/dist/templates/readme.hbs +136 -0
- package/dist/templates/vitest.config.hbs +11 -0
- package/dist/utils/analyze.d.ts +17 -0
- package/dist/utils/analyze.js +187 -0
- package/dist/utils/consts.d.ts +26 -0
- package/dist/utils/consts.js +34 -0
- package/dist/utils/handlebars-helpers.d.ts +1 -0
- package/dist/utils/handlebars-helpers.js +43 -0
- package/dist/utils/helpers.d.ts +12 -0
- package/dist/utils/helpers.js +102 -0
- package/dist/utils/prisma-schema-parser.d.ts +59 -0
- package/dist/utils/prisma-schema-parser.js +197 -0
- package/dist/utils/template-handler.d.ts +6 -0
- package/dist/utils/template-handler.js +33 -0
- package/package.json +73 -0
- package/readme.md +143 -0
package/readme.md
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Igniter CLI
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img src="https://img.shields.io/npm/v/@igniter-js/cli" alt="NPM Version" />
|
|
5
|
+
<img src="https://img.shields.io/npm/dm/@igniter-js/cli" alt="NPM Downloads" />
|
|
6
|
+
<img src="https://img.shields.io/github/license/felipebarcelospro/igniter-js" alt="License" />
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<br />
|
|
10
|
+
|
|
11
|
+
Code generation CLI for Igniter.js projects - the essential tool to boost productivity with [Igniter Framework](https://github.com/felipebarcelospro/igniter-js).
|
|
12
|
+
|
|
13
|
+
## Why Igniter CLI?
|
|
14
|
+
|
|
15
|
+
* **Feature-First Architecture**: Generate complete features with best practices and proper structure
|
|
16
|
+
* **Type Safety**: All generated code is fully typed with TypeScript
|
|
17
|
+
* **Best Practices**: Follows modern development patterns and industry standards
|
|
18
|
+
* **Framework Integration**: Seamlessly integrates with Next.js and the Igniter Framework
|
|
19
|
+
* **Developer Experience**: Intuitive commands and helpful error messages
|
|
20
|
+
* **Productivity Boost**: Automates repetitive tasks and enforces consistency
|
|
21
|
+
|
|
22
|
+
## 📦 Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Global installation (recommended)
|
|
26
|
+
npm install -g @igniter-js/cli
|
|
27
|
+
|
|
28
|
+
# Or using npx for one-time execution
|
|
29
|
+
npx @igniter-js/cli
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 🚀 Quick Start
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Initialize a new project with Igniter Framework
|
|
36
|
+
igniter init
|
|
37
|
+
|
|
38
|
+
# Generate a new feature
|
|
39
|
+
igniter generate feature -n users
|
|
40
|
+
|
|
41
|
+
# Generate features from Prisma models
|
|
42
|
+
igniter generate feature
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 🛠️ Available Commands
|
|
46
|
+
|
|
47
|
+
### `init`
|
|
48
|
+
|
|
49
|
+
Initializes a new Next.js project with the complete Igniter Framework structure:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
igniter init
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
This command:
|
|
56
|
+
- Creates a Next.js application with TypeScript, Tailwind, and ESLint
|
|
57
|
+
- Sets up the recommended folder structure for Igniter Framework
|
|
58
|
+
- Initializes Prisma ORM
|
|
59
|
+
- Configures testing environment with Vitest
|
|
60
|
+
- Installs and configures Shadcn/UI
|
|
61
|
+
- Creates necessary Igniter Framework files
|
|
62
|
+
- Sets up Docker for development
|
|
63
|
+
|
|
64
|
+
### `analyze`
|
|
65
|
+
|
|
66
|
+
Analyzes the current project:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
igniter analyze
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
This command checks your project's structure and configuration, providing insights and optimization suggestions.
|
|
73
|
+
|
|
74
|
+
### `generate feature` (alias: `g`)
|
|
75
|
+
|
|
76
|
+
Generates a complete feature:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Generate a specific feature
|
|
80
|
+
igniter generate feature -n users
|
|
81
|
+
|
|
82
|
+
# Generate a feature with specific fields
|
|
83
|
+
igniter generate feature -n products -f name:string price:number
|
|
84
|
+
|
|
85
|
+
# Generate multiple features from Prisma models
|
|
86
|
+
igniter generate feature
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
This command:
|
|
90
|
+
- Creates the feature folder structure
|
|
91
|
+
- Generates base files (controller, procedures, interfaces)
|
|
92
|
+
- Configures the feature based on Prisma model if available
|
|
93
|
+
|
|
94
|
+
## 🏗️ Generated Project Structure
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
src/
|
|
98
|
+
├── app/ # Application routes
|
|
99
|
+
├── configs/ # Global configurations
|
|
100
|
+
├── core/
|
|
101
|
+
│ ├── design-system/ # Shadcn/UI components
|
|
102
|
+
│ ├── utils/ # Utility functions
|
|
103
|
+
│ ├── providers/ # Contexts and providers
|
|
104
|
+
│ ├── factories/ # Base classes
|
|
105
|
+
├── igniter.ts # Core initialization
|
|
106
|
+
├── igniter.client.ts # Client implementation
|
|
107
|
+
├── igniter.context.ts # Context management
|
|
108
|
+
├── igniter.router.ts # Router configuration
|
|
109
|
+
├── features/ # Application features
|
|
110
|
+
│ └── [feature]/
|
|
111
|
+
│ ├── presentation/ # Feature presentation layer
|
|
112
|
+
│ │ ├── components/ # Feature-specific components
|
|
113
|
+
│ │ ├── hooks/ # Custom hooks
|
|
114
|
+
│ │ ├── contexts/ # Feature contexts
|
|
115
|
+
│ │ └── utils/ # Utility functions
|
|
116
|
+
│ ├── controllers/ # Feature controllers
|
|
117
|
+
│ │ └── [feature].controller.ts
|
|
118
|
+
│ ├── procedures/ # Feature procedures/middleware
|
|
119
|
+
│ │ └── [feature].procedure.ts
|
|
120
|
+
│ ├── [feature].interfaces.ts # Type definitions
|
|
121
|
+
│ └── index.ts # Feature exports
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## 🔧 Advanced Configuration
|
|
125
|
+
|
|
126
|
+
The Igniter CLI can be configured through environment variables:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Example of advanced configuration
|
|
130
|
+
IGNITER_TEMPLATE_DIR=/path/to/templates igniter generate feature -n custom
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## 📚 Complete Documentation
|
|
134
|
+
|
|
135
|
+
For complete Igniter Framework documentation, visit our [official documentation](https://github.com/felipebarcelospro/igniter-js).
|
|
136
|
+
|
|
137
|
+
## 🤝 Contributing
|
|
138
|
+
|
|
139
|
+
Contributions are welcome! Please read our [contribution guide](CONTRIBUTING.md) to learn how to participate.
|
|
140
|
+
|
|
141
|
+
## 📄 License
|
|
142
|
+
|
|
143
|
+
This project is licensed under the [MIT License](LICENSE).
|