Skip to content

Commit 26a2cb7

Browse files
committed
fix: update on doc
1 parent 0add5b5 commit 26a2cb7

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ graph TD
4949
- 💎 **Clean Architecture by Design**: Strict separation into Domain, Application, Infrastructure, and Interface layers.
5050
- 💉 **Native Dependency Injection**: Fully pre-configured for **Awilix**, providing seamless DI management.
5151
- 🧪 **Test-Ready Scaffolding**: Automatically generates **Jest** test suites for Controllers and Use Cases.
52-
- 🚀 **Modern Tooling**: Native support for **ES Modules (ESM)**, **Prisma ORM**, and **Joi/Zod** DTO patterns.
52+
- 🚀 **Full ESM Support**: Native support for **ECMAScript Modules (ESM)** with consistent **kebab-case** file naming.
5353
- 🤖 **Granular Control**: Generate full modules or individual components (UseCases, Repos, DTOs) without disrupting existing code.
5454

5555
---
@@ -127,25 +127,25 @@ Scaffolding a module (e.g., `nmg module Product`) produces the following industr
127127
```text
128128
src/modules/Product/
129129
├── application/
130-
│ ├── dtos/ # DTO schemas (e.g., product.dto.js)
130+
│ ├── dtos/ # DTO schemas (e.g., product-dto.js)
131131
│ └── usecases/ # Business orchestration
132-
│ ├── ProductUseCase.js # Logic implementation
133-
│ └── ProductUseCase.test.js # Unit tests
132+
│ ├── product-use-case.js # Logic implementation
133+
│ └── product-use-case.test.js # Unit tests
134134
├── domain/
135135
│ ├── entities/ # Business entity definitions
136-
│ │ └── Product.js
136+
│ │ └── product-entity.js
137137
│ └── repositories/ # Repository Interface (Contracts)
138-
│ └── ProductRepository.js
138+
│ └── product-repository.js
139139
├── infrastructure/
140140
│ ├── repositories/ # Implementation (default: Prisma)
141-
│ │ └── PrismaProductRepository.js
141+
│ │ └── prisma-product-repository.js
142142
├── interfaces/
143143
│ ├── controllers/ # Express handlers
144-
│ │ ├── ProductController.js
145-
│ │ └── ProductController.test.js
144+
│ │ ├── product-controller.js
145+
│ │ └── product-controller.test.js
146146
│ └── routes/ # Express routes & method binding
147-
│ └── product.routes.js
148-
└── Product.module.js # Central Awilix Module Registration
147+
│ └── product-routes.js
148+
└── product.module.js # Central Awilix Module Registration
149149
```
150150

151151
---
@@ -157,7 +157,8 @@ To finalize your new module integration, follow these standard steps:
157157
1. **DI Registration**: Open `src/container.js` and register any specific repository aliases or scoped usecases.
158158
2. **Route Mounting**: Mount the generated router in `src/app.js`:
159159
```javascript
160-
app.use('/api/v1/product', container.resolve('productRoutes'));
160+
import productRoutes from './modules/Product/interfaces/routes/product-routes.js';
161+
app.use('/api/v1/product', productRoutes);
161162
```
162163
3. **Detailed Implementation**: Build out the specific logic in the generated templates (which are already integrated via Awilix).
163164

0 commit comments

Comments
 (0)