zod-nest 0.8.1 → 0.9.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 +15 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -461,6 +461,21 @@ If you're coming from `nestjs-zod`, the headline changes are:
|
|
|
461
461
|
|
|
462
462
|
Full guide with side-by-side diffs and a 19-row breaking-changes table in [`MIGRATION.md`](MIGRATION.md).
|
|
463
463
|
|
|
464
|
+
## AI tooling — `npx skills`
|
|
465
|
+
|
|
466
|
+
`zod-nest` ships two AI-agent skills you can install into your project via [`npx skills`](https://github.com/vercel-labs/skills) (Claude Code primary; Cursor / Continue best-effort):
|
|
467
|
+
|
|
468
|
+
- **`zod-nest-migrate`** — walks an agent through the 8-step `nestjs-zod` → `zod-nest` migration, plan-then-apply per step.
|
|
469
|
+
- **`zod-nest`** — diagnostic best-practices skill for schema and `@ZodResponse` ergonomics; auto-triggers on edits to `*.controller.ts` / `*.dto.ts` files that import from `zod-nest`.
|
|
470
|
+
|
|
471
|
+
```bash
|
|
472
|
+
npx skills add rodrigowbazevedo/zod-nest # both skills
|
|
473
|
+
npx skills add rodrigowbazevedo/zod-nest --skill zod-nest-migrate # migration only
|
|
474
|
+
npx skills add rodrigowbazevedo/zod-nest --skill zod-nest # best-practices only
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
Full details, agent compatibility notes, and what each skill diagnoses: [`docs/skills.md`](docs/skills.md).
|
|
478
|
+
|
|
464
479
|
## Contributing
|
|
465
480
|
|
|
466
481
|
`zod-nest` is a young, single-maintainer OSS project — contributions and issues are welcome. The codebase is well-tested (>340 tests, full coverage on document/schema layers) and is meant to stay small enough that a first-time contributor can hold the whole surface in their head.
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var zod = require('zod');
|
|
|
4
4
|
var common = require('@nestjs/common');
|
|
5
5
|
var rxjs = require('rxjs');
|
|
6
6
|
var operators = require('rxjs/operators');
|
|
7
|
-
var
|
|
7
|
+
var constants_js = require('@nestjs/common/constants.js');
|
|
8
8
|
var core = require('@nestjs/core');
|
|
9
9
|
var stringify = require('fast-json-stable-stringify');
|
|
10
10
|
|
|
@@ -719,11 +719,11 @@ var ZodResponse = (opts) => {
|
|
|
719
719
|
var POST_DEFAULT_STATUS = 201;
|
|
720
720
|
var GENERIC_DEFAULT_STATUS = 200;
|
|
721
721
|
var defaultStatusFor = (handler) => {
|
|
722
|
-
const httpCode = Reflect.getMetadata(
|
|
722
|
+
const httpCode = Reflect.getMetadata(constants_js.HTTP_CODE_METADATA, handler);
|
|
723
723
|
if (typeof httpCode === "number") {
|
|
724
724
|
return httpCode;
|
|
725
725
|
}
|
|
726
|
-
const method = Reflect.getMetadata(
|
|
726
|
+
const method = Reflect.getMetadata(constants_js.METHOD_METADATA, handler);
|
|
727
727
|
if (method === common.RequestMethod.POST) {
|
|
728
728
|
return POST_DEFAULT_STATUS;
|
|
729
729
|
}
|