@alevnyacow/nzmt 0.8.2 → 0.8.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.
Files changed (3) hide show
  1. package/README.md +7 -2
  2. package/bin/cli.js +3 -3
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -13,11 +13,16 @@ NZMT is an opinionated toolkit with scaffolding for building structured Next.js
13
13
  - ⚡ **Dependency Injection** powered by Inversify with no setup required.
14
14
  - 🚀 Comes with **scaffolding system** to generate and organize application structure via CLI.
15
15
 
16
- # Quick start with scaffolding
16
+ # Quick start (example with Prisma)
17
+
18
+ 1. Generate Prisma client.
19
+ 2. Install required peer dependencies (`inversify`, `zod`, `reflect-metadata`).
20
+ 2. Enable `Experimental decorators` and `Emit Decorator Metadata` options in your tsconfig.json.
21
+ 3. Run the following:
17
22
 
18
23
  ```bash
19
24
  # scaffolder initialization with Prisma (must be done once)
20
- npx nzmt init prismaClientPath:@prisma/client
25
+ npx nzmt init prismaClientPath:./app/generated/prisma/client
21
26
 
22
27
  # product entity with title and price fields
23
28
  npx nzmt entity product f:title-string,price-int.positive
package/bin/cli.js CHANGED
@@ -433,7 +433,7 @@ function generateStores(lowerCase, upperCase, withEntityPreset) {
433
433
  fs.writeFileSync(path.resolve(folder, `${entityName}.store.prisma.ts`), [
434
434
  `import type { Prisma, PrismaClient } from '${prismaPath}'`,
435
435
  `import { DITokens } from '${config?.paths?.di?.replace('.', '@')}'`,
436
- "import { injectable } from 'inversify'",
436
+ "import { injectable, inject } from 'inversify'",
437
437
  "import { Store } from '@alevnyacow/nzmt'",
438
438
  `import { type ${upperCase}Store, ${lowerCase}StoreMetadata } from './${entityName}.store'`,
439
439
  "",
@@ -771,7 +771,7 @@ function generateService(lowerCase, upperCase) {
771
771
  // Service body
772
772
 
773
773
  fs.writeFileSync(path.resolve(folder, `${entityName}.service.ts`), [
774
- "import { injectable } from 'inversify'",
774
+ "import { injectable, inject } from 'inversify'",
775
775
  injections.length ? `import { DITokens } from '${config?.paths?.di?.replace('.', '@')}'` : undefined,
776
776
  `import { ${lowerCase}ServiceMetadata } from './${entityName}.service.metadata'`,
777
777
  "import { Module } from '@alevnyacow/nzmt'",
@@ -859,7 +859,7 @@ function generateController(upperCase, lowerCase) {
859
859
 
860
860
  fs.writeFileSync(path.resolve(folder, `${entityName}.controller.ts`), [
861
861
  `import { Controller } from '@alevnyacow/nzmt'`,
862
- `import { injectable } from 'inversify'`,
862
+ `import { injectable, inject } from 'inversify'`,
863
863
  `import { DITokens } from '${config?.paths?.di?.replace('.', '@')}'`,
864
864
  `import { ${lowerCase}ControllerMetadata } from './${entityName}.controller.metadata'`,
865
865
  ...importInjections,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alevnyacow/nzmt",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Next Zod Modules Toolkit",
5
5
  "repository": {
6
6
  "type": "git",
@@ -44,7 +44,8 @@
44
44
  "peerDependencies": {
45
45
  "next": ">=13 <17",
46
46
  "zod": ">=4 <5",
47
- "inversify": ">=7 <9"
47
+ "inversify": ">=7 <9",
48
+ "reflect-metadata": "^0.2.2"
48
49
  },
49
50
  "private": false
50
51
  }