@alevnyacow/nzmt 0.16.5 → 0.16.7
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 +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Next Zod Modules Toolkit. Next.js tools you actually missed + a scaffolder for s
|
|
|
15
15
|
- ☕ Keep using plain Next.js — just faster and cleaner.
|
|
16
16
|
- 🧙 Focus on your domain logic without drowning in full-blown DDD.
|
|
17
17
|
- ✨ DI, handy API controllers and a bunch of other cool things out of the box aimed at improving your DX.
|
|
18
|
-
- 🪄 Services, controllers, client queries, and other programmer stuff appear at the snap of a finger.
|
|
18
|
+
- 🪄 Services, controllers, client queries, and other programmer stuff appear at the snap of a finger.
|
|
19
19
|
|
|
20
20
|
# Quick start with Prisma
|
|
21
21
|
|
|
@@ -23,7 +23,7 @@ Assuming you have a Next.js project with a generated Prisma client, and configur
|
|
|
23
23
|
|
|
24
24
|
## Setup phase
|
|
25
25
|
|
|
26
|
-
1. Install NZMT
|
|
26
|
+
1. Install NZMT with peer dependencies:
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
29
|
npm i inversify zod reflect-metadata @alevnyacow/nzmt
|
|
@@ -55,7 +55,7 @@ This command generates:
|
|
|
55
55
|
|
|
56
56
|
4. Import and set up there the necessary Prisma adapter in `/server/infrastructure/prisma/client.ts`
|
|
57
57
|
|
|
58
|
-
## Example 1. CRUD for `User` entity with
|
|
58
|
+
## Example 1. CRUD for `User` entity with React queries and Server Actions
|
|
59
59
|
|
|
60
60
|
Assuming you have `User` prisma schema.
|
|
61
61
|
|
|
@@ -76,13 +76,13 @@ This command generates:
|
|
|
76
76
|
|
|
77
77
|
Everything is wired automatically via DI — no manual setup needed.
|
|
78
78
|
|
|
79
|
-
2. Describe your entity in `/shared/entities/user/user.entity.ts` (
|
|
79
|
+
2. Describe your entity in scaffolded `/shared/entities/user/user.entity.ts` (static `schema` field).
|
|
80
80
|
|
|
81
|
-
3. Tweak `UserStore` schemas if needed in `/server/stores/users/user.store.ts
|
|
81
|
+
3. Tweak `UserStore` schemas if needed in scaffolded `/server/stores/users/user.store.ts`.
|
|
82
82
|
|
|
83
|
-
4. Describe how your `UserStore` contracts map to your `Prisma` client contracts in `server/stores/users/user.store.prisma.ts` (
|
|
83
|
+
4. Describe how your `UserStore` contracts map to your `Prisma` client contracts in scaffolded `server/stores/users/user.store.prisma.ts` (`mappers` object is already there for you with all functions, just implement them).
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
So, after one CLI command and few tweaks you can use your React query hooks or Server actions. 🪄
|
|
86
86
|
|
|
87
87
|
### How to use React query hooks
|
|
88
88
|
|