@alevnyacow/nzmt 0.39.1 → 0.39.3
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 +22 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -295,9 +295,26 @@ Once you done implementing controller methods, just run `nmx nzmt rq`. This comm
|
|
|
295
295
|
|
|
296
296
|
# FAQ
|
|
297
297
|
|
|
298
|
-
##
|
|
298
|
+
## Why not use Nest or tRPC?
|
|
299
|
+
|
|
300
|
+
`NZMT` combines the best of both worlds in one package while staying in plain Next.js:
|
|
301
|
+
|
|
302
|
+
| Feature | NZMT | tRPC | Nest |
|
|
303
|
+
| ----------------- | ---- | ---- | ---- |
|
|
304
|
+
| Type safety | ✅ - including run-time checks | ✅ | ⚠️ |
|
|
305
|
+
| Scaffolding | ✅ - production-ready full-stack | ❌ | ⚠️ |
|
|
306
|
+
| Architecture | contract-first, domain-focused | ❌ | module-centric, tightly coupled |
|
|
307
|
+
| Boilerplate | ✅ - Low | ✅ | ❌ - High |
|
|
308
|
+
| No framework lock-in | ✅ | ✅ | ❌ |
|
|
309
|
+
| Single source of truth | ✅ (schemas) | ⚠️ (types only) | ❌ |
|
|
310
|
+
| Time to first feature | ✅ instant full-stack | ⚡ fast | 🐢 slow |
|
|
311
|
+
| Learning curve | Medium | Low | High |
|
|
312
|
+
| Code ownership | ✅ full (generated, editable) | ✅ | ⚠️ (framework patterns) |
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
## What does domain-focused mean?
|
|
299
316
|
|
|
300
|
-
NZMT puts your business domain first. Entities drive the architecture, so backend and frontend stay consistent
|
|
317
|
+
NZMT puts your business domain first. Entities drive the architecture, so backend and frontend stay consistent.
|
|
301
318
|
|
|
302
319
|
## What does contract-first mean?
|
|
303
320
|
|
|
@@ -307,9 +324,9 @@ The behavior of all server modules in NZMT is governed by Zod schemas. Function
|
|
|
307
324
|
|
|
308
325
|
Yes — everything is fully editable, including configuration. Think of NZMT as a shadcn-style approach for full-stack: scaffold first, then fully own the code. Moreover, in most of the cases your changes are preserved on subsequent generations. For example, if you modify a generated query and run `npx nzmt rq` later, your edits stay intact.
|
|
309
326
|
|
|
310
|
-
## Do I really need to understand DI and other fancy concepts to use NZMT?
|
|
327
|
+
## Do I really need to understand DI and other fancy concepts to use NZMT effectively?
|
|
311
328
|
|
|
312
|
-
|
|
329
|
+
Not really. NZMT handles dependency injection (DI) for you using `inversifyjs`. You don’t need to set it up manually.
|
|
313
330
|
To get an instance of a service anywhere in your server code, just use:
|
|
314
331
|
|
|
315
332
|
```tsx
|
|
@@ -322,16 +339,4 @@ Here, `fromDI` is strongly typed — your IDE will give autocomplete automatical
|
|
|
322
339
|
|
|
323
340
|
## Why data layer modules are called `Stores` and not `Repositories`?
|
|
324
341
|
|
|
325
|
-
A “Repository” is a specific design pattern for managing data. NZMT prefers Stores — a simple, flexible abstraction for your data layer that can adapt to your needs regardless of the specific pattern. This approach helps to keep your code simple, and it has been successfully used in other languages, like Go.
|
|
326
|
-
|
|
327
|
-
## Why not use Nest or tRPC?
|
|
328
|
-
|
|
329
|
-
`NZMT` combines the best of both worlds in one package while staying in plain Next.js:
|
|
330
|
-
|
|
331
|
-
| Feature | NZMT | tRPC | Nest |
|
|
332
|
-
| ----------------- | ---- | ---- | ---- |
|
|
333
|
-
| Type safety | ✅ | ✅ | ⚠️ |
|
|
334
|
-
| Scaffolding | ✅ | ❌ | ⚠️ |
|
|
335
|
-
| Architecture | ✅ | ❌ | ✅ |
|
|
336
|
-
| Boilerplate | Low | Low | High |
|
|
337
|
-
| No framework lock-in | ✅ | ✅ | ❌ |
|
|
342
|
+
A “Repository” is a specific design pattern for managing data. NZMT prefers Stores — a simple, flexible abstraction for your data layer that can adapt to your needs regardless of the specific pattern. This approach helps to keep your code simple, and it has been successfully used in other languages, like Go.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alevnyacow/nzmt",
|
|
3
|
-
"version": "0.39.
|
|
3
|
+
"version": "0.39.3",
|
|
4
4
|
"description": "Next Zod Modules Toolkit",
|
|
5
5
|
"keywords": ["next", "full-stack", "server", "backend", "cli", "scaffolding", "zod", "rest", "contract programming", "contract-first", "react-query", "ddd", "domain-driven"],
|
|
6
6
|
"repository": {
|