@alevnyacow/nzmt 0.13.0 → 0.13.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 +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@ Batteries included!
|
|
|
21
21
|
- You want your application to be runtime-safe
|
|
22
22
|
- You want to move fast without losing predictability
|
|
23
23
|
- You want a backend that can evolve into a full-stack solution
|
|
24
|
+
- You dig cool cartoonish fonts in logos
|
|
24
25
|
|
|
25
26
|
You focus on business logic; NZMT handles the infrastructure.
|
|
26
27
|
|
|
@@ -35,7 +36,6 @@ npm install inversify zod reflect-metadata @alevnyacow/nzmt
|
|
|
35
36
|
|
|
36
37
|
2. Enable `Experimental decorators` and `Emit Decorator Metadata` options in your `tsconfig.json`.
|
|
37
38
|
```json
|
|
38
|
-
// tsconfig.json
|
|
39
39
|
{
|
|
40
40
|
"compilerOptions": {
|
|
41
41
|
"experimentalDecorators": true,
|
|
@@ -44,7 +44,7 @@ npm install inversify zod reflect-metadata @alevnyacow/nzmt
|
|
|
44
44
|
}
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
3. Initialize NZMT. This will set up all required infrastructure and configuration for you:
|
|
47
|
+
3. Initialize NZMT (must be done once). This will set up all required infrastructure and configuration for you:
|
|
48
48
|
```bash
|
|
49
49
|
npx nzmt init prismaClientPath:@/app/generated/prisma/client
|
|
50
50
|
```
|
|
@@ -57,7 +57,7 @@ npx nzmt crud-api user
|
|
|
57
57
|
This will generate:
|
|
58
58
|
|
|
59
59
|
- `User` entity
|
|
60
|
-
- `UserStore` contract, `UserRAMStore` and `UserPrismaStore`
|
|
60
|
+
- `UserStore` contract, `UserRAMStore` and `UserPrismaStore` implementations
|
|
61
61
|
- `UserService` proxying all `UserStore` methods
|
|
62
62
|
- `UserController` proxying all `UserService` methods.
|
|
63
63
|
|
|
@@ -66,7 +66,7 @@ All code is editable - you stay in full control.
|
|
|
66
66
|
5. **Describe entity properties and validation rules using Zod** for the `User` entity in the scaffolded file `/shared/entities/user/user.entity.ts`.
|
|
67
67
|
|
|
68
68
|
6. **Implement Prisma mappers** in `/server/stores/user/user.store.prisma.ts`.
|
|
69
|
-
All methods and contracts are already scaffolded; you only need to describe the mappers themselves.
|
|
69
|
+
All methods and contracts are already scaffolded; you only need to describe the mappers themselves. RAM store implementation works out of the box.
|
|
70
70
|
|
|
71
71
|
7. Use generated controller in `app/api/user/route.ts` file via DI.
|
|
72
72
|
|