mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-02 07:43:42 +08:00
The declaration-typed boundary already reaches zod 4 schemas and hono's
c.req.valid(): zod 4's z.infer and hono's validator Input generics resolve
to plain object types in the declaration world. Three gaps remained:
- Boolean literal types printed as `false` (the TS7 facade leaves
intrinsicName unset), so `{ ok: true } | { ok: false }` lost its true
arm and `boolean | undefined` became `undefined | false`. The printer
reads the literal's value.
- `r.data` after `const r = S.safeParse(x); if (r.success)` never
crossed: zod 4's result union is not data (its error arm is a class),
and reads on projectable receivers were skipped on the assumption that
something else types the receiver. Such reads now cross when the
receiver is a package call whose type does not project, or a const
bound to one.
- Reads through bindings annotated with a projected type no longer get a
redundant cast, and aliases are named only for casts that survive.
New npm cases zod4-boundary and hono-zod-validator run real zod 4.6.7,
hono 4.13.13 and @hono/zod-validator 0.9.1 (vendored file closures) under
Node and natively; decl-boundary.test.ts checks that c.req.valid() is a
checked cast with a path TypeError.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
539 B
JSON
24 lines
539 B
JSON
{
|
|
"name": "zod",
|
|
"version": "4.6.7",
|
|
"description": "Test fixture: zod 4's classic API, its core and locales, and the declarations @hono/zod-validator reads (the files the npm cases load).",
|
|
"type": "module",
|
|
"license": "MIT",
|
|
"types": "./index.d.cts",
|
|
"exports": {
|
|
".": {
|
|
"types": "./index.d.cts",
|
|
"import": "./index.js"
|
|
},
|
|
"./v3": {
|
|
"types": "./v3/index.d.cts"
|
|
},
|
|
"./v4": {
|
|
"types": "./v4/index.d.cts"
|
|
},
|
|
"./v4/core": {
|
|
"types": "./v4/core/index.d.cts"
|
|
}
|
|
}
|
|
}
|