@alevnyacow/nzmt 0.18.9 → 0.19.0
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 +1 -1
- package/bin/cli.js +7 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ Edit scaffolded `/server/infrastructure/prisma/client.ts` file
|
|
|
66
66
|
|
|
67
67
|
## Making full-stack CRUD for `User` entity with React queries and Server Actions
|
|
68
68
|
|
|
69
|
-
Assuming you have `User` prisma schema.
|
|
69
|
+
Assuming you have some `User` prisma schema.
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
72
|
npx nzmt crud-api user
|
package/bin/cli.js
CHANGED
|
@@ -935,6 +935,9 @@ function generateController(upperCase, lowerCase, crudService) {
|
|
|
935
935
|
if (crudService && !injections.includes(crudService)) {
|
|
936
936
|
injections = injections.concat(crudService)
|
|
937
937
|
}
|
|
938
|
+
if (!injections.includes('Logger')) {
|
|
939
|
+
injections = injections.concat('Logger')
|
|
940
|
+
}
|
|
938
941
|
|
|
939
942
|
const crudServiceLowercase = crudService ? crudService.substring(0, 1).toLowerCase() + crudService.substring(1) : undefined
|
|
940
943
|
|
|
@@ -1016,7 +1019,10 @@ function generateController(upperCase, lowerCase, crudService) {
|
|
|
1016
1019
|
...injections.map(x => `\t\t@inject('${x}' satisfies DITokens) private readonly ${x.charAt(0).toLowerCase() + x.slice(1)}: ${x},`),
|
|
1017
1020
|
`\t) {}`,
|
|
1018
1021
|
``,
|
|
1019
|
-
`\tprivate readonly endpoints = Controller.endpoints(
|
|
1022
|
+
`\tprivate readonly endpoints = Controller.endpoints(',
|
|
1023
|
+
'\t\t${lowerCase}ControllerMetadata,`,
|
|
1024
|
+
'\t\t{ onErrorHandlers: [this.logger.error] }',
|
|
1025
|
+
'\t)',
|
|
1020
1026
|
``,
|
|
1021
1027
|
crudService ? [
|
|
1022
1028
|
`\tGET = this.endpoints('GET', async (x) => {`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alevnyacow/nzmt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
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": {
|