@alevnyacow/nzmt 0.8.5 → 0.8.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.
Files changed (2) hide show
  1. package/README.md +18 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -37,6 +37,24 @@ npx nzmt service product i:ProductStore
37
37
  npx nzmt controller shop i:Logger,ProductService
38
38
  ```
39
39
 
40
+ The entire structure and infrastructure have been generated. All that remains is developing the contracts and the logic. The organization and content of the generated files are clear, and they’re easy to understand.
41
+
42
+ You can use `fromDI` method anywhere you need an instance of a controller or a service:
43
+
44
+ ```ts
45
+ // app/api/shop/route.ts
46
+
47
+ import type { ShopController } from "@/server/controllers/shop"
48
+ import { fromDI } from "@/server/di"
49
+
50
+ // 'ShopController' here is not just a string, you have an
51
+ // intellisense across all injected modules.
52
+ const controller = fromDI<ShopController>('ShopController')
53
+
54
+ // Suppose you have implemented the list_GET method in the controller.
55
+ export const GET = controller.list_GET
56
+ ```
57
+
40
58
  # Design principles
41
59
 
42
60
  ## Core idea
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alevnyacow/nzmt",
3
- "version": "0.8.5",
3
+ "version": "0.8.7",
4
4
  "description": "Next Zod Modules Toolkit",
5
5
  "repository": {
6
6
  "type": "git",