@dudousxd/nestjs-codegen 0.9.0 → 0.10.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/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @dudousxd/nestjs-codegen
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 152a2ab: Narrow the public `ValidationOption` type to `ValidationAdapter` only. The string
8
+ shortcuts (`'zod'` / `'valibot'` / `'arktype'`) were advertised by the type but
9
+ `resolveAdapter` always threw a `ConfigError` for any string, so they never worked
10
+ at runtime. The type now guides TypeScript users to import and pass an adapter
11
+ instance (e.g. `zodAdapter` from `@dudousxd/nestjs-codegen-zod`).
12
+
13
+ The runtime guard is retained: `resolveAdapter` still accepts a `string` and throws
14
+ the helpful "install + import the adapter package" error, so JS callers and untyped
15
+ configs that pass a removed string shortcut get the same actionable message.
16
+
17
+ This is a compile-time-only breaking change for anyone still typing `validation:
18
+ 'zod'` — it never produced working output at runtime, so the bump is minor.
19
+
20
+ ### Patch Changes
21
+
22
+ - 81ba774: Ship TanStack Intent agent skills (SKILL.md) inside the package.
23
+
3
24
  ## 0.9.0
4
25
 
5
26
  ### Minor Changes
package/README.md CHANGED
@@ -15,6 +15,8 @@ layer.
15
15
 
16
16
  ```bash
17
17
  pnpm add -D @dudousxd/nestjs-codegen
18
+ # a validation adapter (no adapter is bundled in core) — zod shown; or -valibot / -arktype:
19
+ pnpm add -D @dudousxd/nestjs-codegen-zod
18
20
  # the runtime the generated client imports its Fetcher type from:
19
21
  pnpm add @dudousxd/nestjs-client
20
22
  ```
@@ -33,6 +35,7 @@ The watcher is a dev/CI concern, so the module skips itself automatically when
33
35
  ```ts title="src/app.module.ts"
34
36
  import { Module } from '@nestjs/common';
35
37
  import { NestjsCodegenModule } from '@dudousxd/nestjs-codegen/nest';
38
+ import { zodAdapter } from '@dudousxd/nestjs-codegen-zod';
36
39
 
37
40
  @Module({
38
41
  imports: [
@@ -42,7 +45,7 @@ import { NestjsCodegenModule } from '@dudousxd/nestjs-codegen/nest';
42
45
  // output directory for the generated files
43
46
  codegen: { outDir: 'src/generated' },
44
47
 
45
- validation: 'zod', // 'zod' (bundled) | valibotAdapter | arktypeAdapter
48
+ validation: zodAdapter, // zodAdapter | valibotAdapter | arktypeAdapter
46
49
  }),
47
50
  ],
48
51
  })
@@ -87,7 +90,7 @@ import { arktypeAdapter } from '@dudousxd/nestjs-codegen-arktype';
87
90
  NestjsCodegenModule.forRoot({
88
91
  contracts: { glob: 'src/**/*.controller.ts' },
89
92
  codegen: { outDir: 'src/generated' },
90
- validation: arktypeAdapter, // render the IR as arktype instead of the bundled zod
93
+ validation: arktypeAdapter, // render the IR as arktype instead of zod
91
94
  extensions: [tanstackQuery(), nestjsFilterCodegen(), nestjsInertiaCodegen()],
92
95
  });
93
96
  ```
@@ -136,11 +139,12 @@ with `defineConfig` and importing them into `forRoot()`:
136
139
 
137
140
  ```ts title="nestjs-codegen.config.ts"
138
141
  import { defineConfig } from '@dudousxd/nestjs-codegen';
142
+ import { zodAdapter } from '@dudousxd/nestjs-codegen-zod';
139
143
 
140
144
  export default defineConfig({
141
145
  contracts: { glob: 'src/**/*.controller.ts' },
142
146
  codegen: { outDir: 'src/generated' },
143
- validation: 'zod',
147
+ validation: zodAdapter,
144
148
  });
145
149
  ```
146
150
 
package/dist/cli/main.cjs CHANGED
@@ -4511,7 +4511,7 @@ async function watch(config, onChange) {
4511
4511
  }
4512
4512
 
4513
4513
  // src/index.ts
4514
- var VERSION = "0.9.0";
4514
+ var VERSION = "0.10.0";
4515
4515
 
4516
4516
  // src/cli/codegen.ts
4517
4517
  async function runCodegen(opts = {}) {