@alevnyacow/nzmt 0.21.4 → 0.22.1
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 +21 -0
- package/bin/cli.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -124,6 +124,27 @@ export default async function Page() {
|
|
|
124
124
|
}
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
+
# Scaffolder commands glossary
|
|
128
|
+
|
|
129
|
+
## Complex scaffolding
|
|
130
|
+
|
|
131
|
+
| Command | Scaffolding result |
|
|
132
|
+
|---------|-------------|
|
|
133
|
+
| `npx nzmt crud-api <name>` | CRUD via Server Actions and React Query hooks. |
|
|
134
|
+
| `npx nzmt crud-service <name>` | CRUD via Server Actions (no Controllers, API Routes and React Query hooks). |
|
|
135
|
+
| `npx nzmt se <name>` | **s**tored **e**ntity: entity + store (contracts linked). |
|
|
136
|
+
| `npx nzmt rq` | API **r**outes and React **q**eries for all of your controllers. This command will also remove endpoints which don't exist anymore with according React query hooks |
|
|
137
|
+
|
|
138
|
+
## Single module scaffolding
|
|
139
|
+
|
|
140
|
+
| Command | Scaffolding result |Options|
|
|
141
|
+
|---------|-------------|-------|
|
|
142
|
+
| `npx nzmt e <name>` | **e**ntity ||
|
|
143
|
+
| `npx nzmt vo <name>` | **v**alue **o**bject ||
|
|
144
|
+
| `npx nzmt cs <name>` | **c**ustom **s**tore (all schemas are `z.object({})`) ||
|
|
145
|
+
| `npx nzmt s <name>` | **s**ervice |`i:UserStore,Logger` will automatically inject `UserStore` and `Logger`. E.g. `npx nzmt s shop i:UserStore,ProductStore` will create `ShopService` with already injected `UserStore` and `ProductStore`|
|
|
146
|
+
| `npx nzmt c <name>` | **c**ontroller |`i:UserService` will automatically inject `UserService`. `Logger` and `Guared` are injected by default regardless of `i:` option|
|
|
147
|
+
|
|
127
148
|
# FAQ
|
|
128
149
|
|
|
129
150
|
## What does DDD-inspired mean?
|
package/bin/cli.js
CHANGED
|
@@ -686,7 +686,7 @@ function generateStores(lowerCase, upperCase, withEntityPreset) {
|
|
|
686
686
|
|
|
687
687
|
}
|
|
688
688
|
|
|
689
|
-
if (command.toLowerCase() === 'store' || command === '
|
|
689
|
+
if (command.toLowerCase() === 'store' || command === 'cs') {
|
|
690
690
|
var [lowerCase, upperCase] = camelizeVariants(entityName)
|
|
691
691
|
generateStores(lowerCase, upperCase)
|
|
692
692
|
process.exit(0);
|
|
@@ -954,7 +954,7 @@ function generateService(lowerCase, upperCase, store) {
|
|
|
954
954
|
)
|
|
955
955
|
}
|
|
956
956
|
|
|
957
|
-
if (command.toLowerCase() === 'service' || command === '
|
|
957
|
+
if (command.toLowerCase() === 'service' || command === 's') {
|
|
958
958
|
var [lowerCase, upperCase] = camelizeVariants(entityName)
|
|
959
959
|
generateService(lowerCase, upperCase, false)
|
|
960
960
|
process.exit(0)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alevnyacow/nzmt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.1",
|
|
4
4
|
"description": "Next Zod Modules Toolkit",
|
|
5
5
|
"keywords": ["next", "full-stack", "server", "backend", "cli", "scaffolder", "zod", "rest", "contract programming", "react-query", "ddd", "domain-driven"],
|
|
6
6
|
"repository": {
|