@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 +21 -0
- package/README.md +7 -3
- package/dist/cli/main.cjs +1 -1
- package/dist/cli/main.cjs.map +1 -1
- package/dist/cli/main.js +1 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/extension/index.d.cts +1 -1
- package/dist/extension/index.d.ts +1 -1
- package/dist/{index-SJc0gya_.d.cts → index-CxkGbILp.d.cts} +13 -3
- package/dist/{index-SJc0gya_.d.ts → index-CxkGbILp.d.ts} +13 -3
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/nest/index.cjs.map +1 -1
- package/dist/nest/index.d.cts +1 -1
- package/dist/nest/index.d.ts +1 -1
- package/dist/nest/index.js.map +1 -1
- package/package.json +6 -2
- package/skills/codegen-serialization-output/SKILL.md +148 -0
- package/skills/codegen-setup/SKILL.md +159 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { m as ApiClientLayer, n as ApiHeaderContribution, o as ApiModuleDeps, C as CodegenExtension, p as EmittedFile, E as ExtensionContext, L as LeafModel, q as RequestModel, s as RequestShape, t as defineExtension, u as requestShape } from '../index-
|
|
1
|
+
export { m as ApiClientLayer, n as ApiHeaderContribution, o as ApiModuleDeps, C as CodegenExtension, p as EmittedFile, E as ExtensionContext, L as LeafModel, q as RequestModel, s as RequestShape, t as defineExtension, u as requestShape } from '../index-CxkGbILp.cjs';
|
|
2
2
|
import 'ts-morph';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { m as ApiClientLayer, n as ApiHeaderContribution, o as ApiModuleDeps, C as CodegenExtension, p as EmittedFile, E as ExtensionContext, L as LeafModel, q as RequestModel, s as RequestShape, t as defineExtension, u as requestShape } from '../index-
|
|
1
|
+
export { m as ApiClientLayer, n as ApiHeaderContribution, o as ApiModuleDeps, C as CodegenExtension, p as EmittedFile, E as ExtensionContext, L as LeafModel, q as RequestModel, s as RequestShape, t as defineExtension, u as requestShape } from '../index-CxkGbILp.js';
|
|
2
2
|
import 'ts-morph';
|
|
@@ -189,19 +189,29 @@ interface ValidationAdapter {
|
|
|
189
189
|
inferType(schemaConst: string): string;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
/**
|
|
193
|
-
|
|
192
|
+
/**
|
|
193
|
+
* A validation adapter instance. No adapter is bundled in core — import one from
|
|
194
|
+
* its own package (`zodAdapter`/`valibotAdapter`/`arktypeAdapter`) or pass a custom
|
|
195
|
+
* object. String shortcuts (`'zod'` etc.) are intentionally not part of this type:
|
|
196
|
+
* they always threw at runtime, so the type guides you to an imported instance.
|
|
197
|
+
*/
|
|
198
|
+
type ValidationOption = ValidationAdapter;
|
|
194
199
|
/**
|
|
195
200
|
* Resolve a `validation` config value to a {@link ValidationAdapter}. No adapter is
|
|
196
201
|
* bundled in core — the zod/valibot/arktype adapters ship as their own packages.
|
|
197
202
|
* Import the adapter instance and pass it directly (it passes through here). A
|
|
198
203
|
* custom adapter object also passes through.
|
|
199
204
|
*
|
|
205
|
+
* The parameter also accepts a `string` so the runtime guard still fires for JS
|
|
206
|
+
* callers / untyped configs that pass a removed string shortcut (e.g. `'zod'`):
|
|
207
|
+
* those throw a helpful error pointing at the adapter package. TypeScript users
|
|
208
|
+
* are steered away from strings by the narrowed {@link ValidationOption} type.
|
|
209
|
+
*
|
|
200
210
|
* @example
|
|
201
211
|
* import { zodAdapter } from '@dudousxd/nestjs-codegen-zod';
|
|
202
212
|
* defineConfig({ validation: zodAdapter });
|
|
203
213
|
*/
|
|
204
|
-
declare function resolveAdapter(option: ValidationOption): ValidationAdapter;
|
|
214
|
+
declare function resolveAdapter(option: ValidationOption | string): ValidationAdapter;
|
|
205
215
|
|
|
206
216
|
interface UserConfig {
|
|
207
217
|
/**
|
|
@@ -189,19 +189,29 @@ interface ValidationAdapter {
|
|
|
189
189
|
inferType(schemaConst: string): string;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
/**
|
|
193
|
-
|
|
192
|
+
/**
|
|
193
|
+
* A validation adapter instance. No adapter is bundled in core — import one from
|
|
194
|
+
* its own package (`zodAdapter`/`valibotAdapter`/`arktypeAdapter`) or pass a custom
|
|
195
|
+
* object. String shortcuts (`'zod'` etc.) are intentionally not part of this type:
|
|
196
|
+
* they always threw at runtime, so the type guides you to an imported instance.
|
|
197
|
+
*/
|
|
198
|
+
type ValidationOption = ValidationAdapter;
|
|
194
199
|
/**
|
|
195
200
|
* Resolve a `validation` config value to a {@link ValidationAdapter}. No adapter is
|
|
196
201
|
* bundled in core — the zod/valibot/arktype adapters ship as their own packages.
|
|
197
202
|
* Import the adapter instance and pass it directly (it passes through here). A
|
|
198
203
|
* custom adapter object also passes through.
|
|
199
204
|
*
|
|
205
|
+
* The parameter also accepts a `string` so the runtime guard still fires for JS
|
|
206
|
+
* callers / untyped configs that pass a removed string shortcut (e.g. `'zod'`):
|
|
207
|
+
* those throw a helpful error pointing at the adapter package. TypeScript users
|
|
208
|
+
* are steered away from strings by the narrowed {@link ValidationOption} type.
|
|
209
|
+
*
|
|
200
210
|
* @example
|
|
201
211
|
* import { zodAdapter } from '@dudousxd/nestjs-codegen-zod';
|
|
202
212
|
* defineConfig({ validation: zodAdapter });
|
|
203
213
|
*/
|
|
204
|
-
declare function resolveAdapter(option: ValidationOption): ValidationAdapter;
|
|
214
|
+
declare function resolveAdapter(option: ValidationOption | string): ValidationAdapter;
|
|
205
215
|
|
|
206
216
|
interface UserConfig {
|
|
207
217
|
/**
|
package/dist/index.cjs
CHANGED
|
@@ -4628,7 +4628,7 @@ function createChainModuleRenderer(opts) {
|
|
|
4628
4628
|
}
|
|
4629
4629
|
|
|
4630
4630
|
// src/index.ts
|
|
4631
|
-
var VERSION = "0.
|
|
4631
|
+
var VERSION = "0.10.0";
|
|
4632
4632
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4633
4633
|
0 && (module.exports = {
|
|
4634
4634
|
CodegenError,
|