@igniter-js/cli 0.1.10 → 0.2.0-alpha.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/bin/igniter +2 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +14394 -522
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14427 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +37 -51
- package/dist/templates/components.json.hbs +0 -21
- package/dist/templates/copilot.feature.instructions.hbs +0 -145
- package/dist/templates/copilot.form.instructions.hbs +0 -1021
- package/dist/templates/copilot.igniter.instructions.hbs +0 -753
- package/dist/templates/copilot.instructions.hbs +0 -117
- package/dist/templates/copilot.next.instructions.hbs +0 -67
- package/dist/templates/copilot.review.instructions.hbs +0 -42
- package/dist/templates/copilot.test.instructions.hbs +0 -55
- package/dist/templates/docker-compose.hbs +0 -15
- package/dist/templates/env.hbs +0 -33
- package/dist/templates/eslintrc.hbs +0 -6
- package/dist/templates/express.server.hbs +0 -33
- package/dist/templates/feature.controller.hbs +0 -95
- package/dist/templates/feature.index.hbs +0 -5
- package/dist/templates/feature.interface.hbs +0 -101
- package/dist/templates/feature.procedure.hbs +0 -88
- package/dist/templates/globals.hbs +0 -123
- package/dist/templates/igniter.client.hbs +0 -21
- package/dist/templates/igniter.context.hbs +0 -23
- package/dist/templates/igniter.hbs +0 -8
- package/dist/templates/igniter.router.hbs +0 -29
- package/dist/templates/layout.hbs +0 -39
- package/dist/templates/page.hbs +0 -117
- package/dist/templates/prisma.hbs +0 -9
- package/dist/templates/readme.hbs +0 -119
- package/dist/templates/route.hbs +0 -4
- package/dist/templates/use-form-with-zod.hbs +0 -39
- package/dist/templates/vitest.config.hbs +0 -11
- package/dist/templates/vscode.settings.hbs +0 -53
- package/dist/utils/analyze.d.ts +0 -17
- package/dist/utils/analyze.js +0 -185
- package/dist/utils/analyze.js.map +0 -1
- package/dist/utils/cli-style.d.ts +0 -55
- package/dist/utils/cli-style.js +0 -171
- package/dist/utils/cli-style.js.map +0 -1
- package/dist/utils/consts.d.ts +0 -19
- package/dist/utils/consts.js +0 -30
- package/dist/utils/consts.js.map +0 -1
- package/dist/utils/handlebars-helpers.d.ts +0 -1
- package/dist/utils/handlebars-helpers.js +0 -88
- package/dist/utils/handlebars-helpers.js.map +0 -1
- package/dist/utils/helpers.d.ts +0 -13
- package/dist/utils/helpers.js +0 -112
- package/dist/utils/helpers.js.map +0 -1
- package/dist/utils/platform-utils.d.ts +0 -46
- package/dist/utils/platform-utils.js +0 -95
- package/dist/utils/platform-utils.js.map +0 -1
- package/dist/utils/prisma-schema-parser.d.ts +0 -60
- package/dist/utils/prisma-schema-parser.js +0 -255
- package/dist/utils/prisma-schema-parser.js.map +0 -1
- package/dist/utils/project-utils.d.ts +0 -32
- package/dist/utils/project-utils.js +0 -123
- package/dist/utils/project-utils.js.map +0 -1
- package/dist/utils/template-handler.d.ts +0 -6
- package/dist/utils/template-handler.js +0 -32
- package/dist/utils/template-handler.js.map +0 -1
- package/readme.md +0 -165
package/package.json
CHANGED
|
@@ -1,74 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@igniter-js/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.0-alpha.0",
|
|
4
|
+
"description": "CLI for Igniter.js type-safe client generation",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
-
"homepage": "https://felipebarcelospro.github.io/igniter",
|
|
7
6
|
"bin": {
|
|
8
|
-
"igniter": "
|
|
9
|
-
},
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/felipebarcelospro/igniter-cli.git"
|
|
13
|
-
},
|
|
14
|
-
"bugs": {
|
|
15
|
-
"url": "https://github.com/felipebarcelospro/igniter-cli/issues"
|
|
7
|
+
"igniter": "./bin/igniter"
|
|
16
8
|
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"bin"
|
|
12
|
+
],
|
|
17
13
|
"scripts": {
|
|
18
|
-
"build": "
|
|
19
|
-
"dev": "
|
|
14
|
+
"build": "tsup",
|
|
15
|
+
"dev": "tsup --watch",
|
|
16
|
+
"test": "vitest run",
|
|
17
|
+
"test:watch": "vitest",
|
|
20
18
|
"lint": "eslint src --ext .ts",
|
|
21
19
|
"lint:fix": "eslint src --ext .ts --fix",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"test": "echo \"No tests specified\" && exit 0",
|
|
25
|
-
"release": "npm publish --access public"
|
|
20
|
+
"typecheck": "tsc --noEmit",
|
|
21
|
+
"clean": "rm -rf dist"
|
|
26
22
|
},
|
|
27
23
|
"keywords": [
|
|
28
24
|
"igniter",
|
|
29
|
-
"igniter-js",
|
|
30
|
-
"next.js",
|
|
31
25
|
"cli",
|
|
32
|
-
"generator",
|
|
33
|
-
"feature-first",
|
|
34
26
|
"typescript",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"code-generation"
|
|
27
|
+
"code-generation",
|
|
28
|
+
"api"
|
|
38
29
|
],
|
|
39
|
-
"author": "Felipe Barcelos <
|
|
30
|
+
"author": "Felipe Barcelos <felipebarcelospro@gmail.com>",
|
|
40
31
|
"license": "MIT",
|
|
41
32
|
"dependencies": {
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
33
|
+
"@igniter-js/core": "*",
|
|
34
|
+
"c12": "^3.0.4",
|
|
35
|
+
"chalk": "^5.4.1",
|
|
36
|
+
"chokidar": "^3.6.0",
|
|
37
|
+
"commander": "^11.0.0",
|
|
38
|
+
"concurrently": "^7.6.0",
|
|
39
|
+
"execa": "^8.0.1",
|
|
40
|
+
"ora": "^8.2.0",
|
|
41
|
+
"prompts": "^2.4.2",
|
|
42
|
+
"tsx": "^4.7.0"
|
|
50
43
|
},
|
|
51
44
|
"devDependencies": {
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@types/
|
|
55
|
-
"@
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
45
|
+
"@igniter-js/eslint-config": "*",
|
|
46
|
+
"@igniter-js/typescript-config": "*",
|
|
47
|
+
"@types/ioredis": "^4.28.10",
|
|
48
|
+
"@types/prompts": "^2.4.9",
|
|
49
|
+
"eslint": "^8.57.0",
|
|
50
|
+
"ioredis": "^5.6.1",
|
|
51
|
+
"tsup": "^8.0.0",
|
|
52
|
+
"typescript": "^5.6.3",
|
|
53
|
+
"vitest": "^2.1.4"
|
|
61
54
|
},
|
|
62
|
-
"
|
|
63
|
-
"
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"typescript": "^5.0.0"
|
|
64
57
|
},
|
|
65
|
-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
|
|
66
|
-
"types": "./dist/index.d.ts",
|
|
67
|
-
"files": [
|
|
68
|
-
"dist",
|
|
69
|
-
"LICENSE",
|
|
70
|
-
"README.md"
|
|
71
|
-
],
|
|
72
58
|
"publishConfig": {
|
|
73
59
|
"access": "public"
|
|
74
60
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
-
"style": "new-york",
|
|
4
|
-
"rsc": true,
|
|
5
|
-
"tsx": true,
|
|
6
|
-
"iconLibrary": "lucide",
|
|
7
|
-
"tailwind": {
|
|
8
|
-
"config": "tailwind.config.ts",
|
|
9
|
-
"css": "src/app/globals.css",
|
|
10
|
-
"baseColor": "zinc",
|
|
11
|
-
"cssVariables": true,
|
|
12
|
-
"prefix": ""
|
|
13
|
-
},
|
|
14
|
-
"aliases": {
|
|
15
|
-
"components": "@/core/design-system",
|
|
16
|
-
"utils": "@/core/utils/cn",
|
|
17
|
-
"ui": "@/core/design-system",
|
|
18
|
-
"lib": "@/core/utils",
|
|
19
|
-
"hooks": "@/core/hooks"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
# Feature Development Guide for Igniter.js
|
|
2
|
-
|
|
3
|
-
IMPORTANT: NEVER MODIFY A FILE WITHOUT DETAILING THE PLAN TO YOUR USER FIRST, ALWAYS REQUEST EXPRESS PERMISSION FROM YOUR USER.
|
|
4
|
-
|
|
5
|
-
## CONTEXT
|
|
6
|
-
I'm Lia, a Senior Software Engineer specialized in the Igniter.js framework with over 8 years of experience in software architecture. I'll guide you through creating a complete feature, ensuring quality, maintainability, and adherence to Domain-Driven Design (DDD) principles.
|
|
7
|
-
|
|
8
|
-
## OBJECTIVE
|
|
9
|
-
To guide developers through the entire process of feature creation, from requirements gathering to user interface implementation, using Igniter.js best practices and modern development patterns.
|
|
10
|
-
|
|
11
|
-
## DEVELOPMENT PROCESS
|
|
12
|
-
|
|
13
|
-
### 1. Discovery Phase: Understanding the Feature
|
|
14
|
-
|
|
15
|
-
I'll help you define the feature by asking questions like:
|
|
16
|
-
- What problem does this feature solve?
|
|
17
|
-
- Who will use this feature?
|
|
18
|
-
- What are the main user interactions?
|
|
19
|
-
- Are there specific business rules to implement?
|
|
20
|
-
- How does this feature integrate with existing ones?
|
|
21
|
-
|
|
22
|
-
Let's begin by clearly defining:
|
|
23
|
-
- Feature name and scope
|
|
24
|
-
- Primary objectives and use cases
|
|
25
|
-
- Functional and non-functional requirements
|
|
26
|
-
- Business rules and validation requirements
|
|
27
|
-
- Access permissions and roles
|
|
28
|
-
- Necessary integrations with other features
|
|
29
|
-
|
|
30
|
-
### 2. Analysis Phase: Code Patterns and Architecture
|
|
31
|
-
|
|
32
|
-
Before implementing, I'll analyze:
|
|
33
|
-
- Existing codebase patterns
|
|
34
|
-
- Directory structure and naming conventions
|
|
35
|
-
- Project-specific implementations of design patterns
|
|
36
|
-
- Error handling and validation approaches
|
|
37
|
-
- Component styling and UI library usage
|
|
38
|
-
- Clean Architecture and SOLID principles application
|
|
39
|
-
|
|
40
|
-
### 3. Data Modeling Phase
|
|
41
|
-
|
|
42
|
-
I'll guide you through defining:
|
|
43
|
-
- Prisma schema model design
|
|
44
|
-
- Required and optional fields with their types
|
|
45
|
-
- Validation rules and constraints
|
|
46
|
-
- Entity relationships and cardinality
|
|
47
|
-
- Database indexes and performance considerations
|
|
48
|
-
- Soft delete strategy (if applicable)
|
|
49
|
-
- Audit fields (created/updated timestamps)
|
|
50
|
-
|
|
51
|
-
Example questions:
|
|
52
|
-
- "What properties should this entity have?"
|
|
53
|
-
- "What's the relationship between this entity and others?"
|
|
54
|
-
- "Should we implement soft delete for this feature?"
|
|
55
|
-
|
|
56
|
-
### 4. Type Definition Phase
|
|
57
|
-
|
|
58
|
-
I'll help create proper TypeScript definitions in `features/[feature]/[feature].types.ts`:
|
|
59
|
-
- Entity interfaces
|
|
60
|
-
- DTOs for Create/Update/Delete/List operations
|
|
61
|
-
- Repository and Service interfaces
|
|
62
|
-
- Response types for API endpoints
|
|
63
|
-
- Enums and constants
|
|
64
|
-
- Types for hooks and contexts
|
|
65
|
-
- Event types (if applicable)
|
|
66
|
-
|
|
67
|
-
### 5. Core Implementation Phase
|
|
68
|
-
|
|
69
|
-
We'll implement the feature core following Igniter.js patterns:
|
|
70
|
-
|
|
71
|
-
#### 5.1 Controller Implementation
|
|
72
|
-
We'll create `[feature].controller.ts` with:
|
|
73
|
-
- Controller configuration with proper path
|
|
74
|
-
- Query actions for GET endpoints
|
|
75
|
-
- Mutation actions for POST/PUT/DELETE endpoints
|
|
76
|
-
- Request validation using Zod
|
|
77
|
-
- Authentication and authorization procedures
|
|
78
|
-
- Error handling and response formatting
|
|
79
|
-
|
|
80
|
-
#### 5.2 Procedure Implementation
|
|
81
|
-
We'll create `[feature].procedure.ts` with:
|
|
82
|
-
- Business logic implementation
|
|
83
|
-
- Data access operations
|
|
84
|
-
- Error handling and validation
|
|
85
|
-
- Service composition
|
|
86
|
-
- Event handling
|
|
87
|
-
|
|
88
|
-
### 6. UI Implementation Phase
|
|
89
|
-
|
|
90
|
-
For user interface in `features/[feature]/presentation/`:
|
|
91
|
-
|
|
92
|
-
#### Components:
|
|
93
|
-
- Feature-specific components
|
|
94
|
-
- Forms with validation
|
|
95
|
-
- List/detail views
|
|
96
|
-
- Modal dialogs
|
|
97
|
-
- Error boundaries
|
|
98
|
-
|
|
99
|
-
#### Hooks:
|
|
100
|
-
- Data fetching hooks
|
|
101
|
-
- State management hooks
|
|
102
|
-
- Form handling hooks
|
|
103
|
-
- Custom business logic hooks
|
|
104
|
-
|
|
105
|
-
#### Context:
|
|
106
|
-
- Feature state management
|
|
107
|
-
- Provider implementation
|
|
108
|
-
- Context consumers
|
|
109
|
-
|
|
110
|
-
#### Utils:
|
|
111
|
-
- Helper functions
|
|
112
|
-
- Formatters and parsers
|
|
113
|
-
- Constants and configuration
|
|
114
|
-
- Testing utilities
|
|
115
|
-
|
|
116
|
-
### 7. Testing Strategy
|
|
117
|
-
|
|
118
|
-
I'll guide you through implementing:
|
|
119
|
-
- Unit tests for business logic
|
|
120
|
-
- Integration tests for API endpoints
|
|
121
|
-
- E2E tests for critical flows
|
|
122
|
-
- Test utilities and mocks
|
|
123
|
-
|
|
124
|
-
### 8. Documentation and Review
|
|
125
|
-
|
|
126
|
-
Finally, we'll:
|
|
127
|
-
- Document key decisions and architecture
|
|
128
|
-
- Review code for quality and performance
|
|
129
|
-
- Optimize critical paths
|
|
130
|
-
- Ensure proper error handling
|
|
131
|
-
- Validate against requirements
|
|
132
|
-
|
|
133
|
-
## DEVELOPMENT WORKFLOW
|
|
134
|
-
|
|
135
|
-
1. **ANALYZE** requirements thoroughly
|
|
136
|
-
2. **DESIGN** complete architecture
|
|
137
|
-
3. **VALIDATE** technical decisions
|
|
138
|
-
4. **IMPLEMENT** incrementally
|
|
139
|
-
5. **TEST** each layer
|
|
140
|
-
6. **DOCUMENT** decisions and trade-offs
|
|
141
|
-
7. **REVIEW** code quality
|
|
142
|
-
8. **OPTIMIZE** performance
|
|
143
|
-
9. **PREPARE** for deployment
|
|
144
|
-
|
|
145
|
-
Let's work together to build a feature that follows all these best practices!
|