Releases: toiroakr/zinfer
Release list
v1.0.0-next.1
Patch Changes
- 733fbd1: Fix
TsgoHost(tsgo/Corsa API backend, see #200) mishandling realtsconfig.jsonfiles that useextendsor contain comments/trailing commas. Previously,--projectsupport extractedCompilerOptionsviaparseConfigFile()and re-embedded them into a synthetic config elsewhere, which broke relativeextends/typeRootsresolution for real-world configs. It now serves a patched copy of the original tsconfig.json at its own path (parsed withjsonc-parser, onlyfilesappended to), soextendsand every other config-relative path resolve exactly as they would for the real project.
v0.2.7
Patch Changes
- 5210bb4: Fix description extraction stack-overflowing on self-recursive Zod schemas (e.g. a
getaccessor referencing the schema itself), which silently dropped every.describe()comment for the whole file. Field description extraction now tracks visited object schemas per recursion path and stops descending on a cycle, and a single schema's extraction failure no longer discards descriptions already collected for other schemas in the same file.
v0.2.6
Patch Changes
- 07d3613: Fix
.describe()text on an inlined nested field being replaced by an unrelated same-named field's text elsewhere in the file. Field descriptions were looked up by field name only, because the nested object formatter never actually tracked nesting depth (including across sibling objects in the same union/tuple). Also extend description extraction to recurse into array element and union member types, since those types print inline at the same path as their containing field.
v1.0.0-next.0
Major Changes
-
08b0f77: Replace
ts-morphwith TypeScript's nativetsgo/Corsa API (@typescript/native-preview) as the type-resolution engine (see #200).ts-morphis dropped entirely;@typescript/native-previewmoves from a dev-only dependency (used just for thetsgotypecheck script) to a runtime dependency.Internals:
TsHost(introduced as prep work) is now implemented byTsgoHost, which resolves temporary type aliases via a virtual-FS overlay instead of mutating a livets-morphSourceFile.SchemaDetector,GetterResolver,ImportResolver,BrandDetector, andSchemaReferenceAnalyzerare reimplemented against the Corsaast/checker API. Cross-file import resolution now goes throughChecker.getSymbolAtLocation(real module resolution) instead of ts-morph'sgetModuleSpecifierSourceFile, which incidentally fixes a known limitation resolving named imports through an intermediate re-export index file.
Breaking change:
SchemaDetectorandBrandDetectorare no longer exported. They operated on a ts-morphSourceFile, which the new Corsa-API-backed implementation has no public, supported way to construct, so continuing to export them would have been a half-usable API. Everything they exposed is already available throughZodTypeExtractor's output (ExtractResult#isExported/#brands) andZodTypeExtractor#getSchemaNames.ZodTypeExtractor's public methods and the top-levelextractZodTypes/extractAndFormat/extractAllSchemashelpers are unaffected.A handful of generated snapshots changed to reflect the new checker's (arguably more correct) member ordering: object/mapped types now print in source declaration order, and
z.enum([...])-derived string literal unions print in alphabetical order.
v0.2.5
Patch Changes
- 054a3a5: Preserve exported schema aliases inside unions with imported or non-exported members, including references inherited from shared object shapes.
v0.2.4
Patch Changes
- 0dc4e66: Preserve named schema references when
.describe()(or another type-preserving method such as.meta(),.superRefine(),.check()) wraps a schema reference or az.union()/z.discriminatedUnion()declaration, instead of expanding the referenced schema inline. Inline expansion previously degraded recursive schemas tounknown/any. Also detect schemas whose builder chain is formatted across multiple lines (e.g.z\n .union([...])\n .describe(...)), which were previously skipped entirely.
v0.2.3
Patch Changes
- 8ec6316: Preserve named schema references inside
z.strictObject()andz.looseObject()fields instead of expanding them inline.
v0.2.2
Patch Changes
- 7926250: Preserve JSDoc/TSDoc field descriptions for
#/*subpath imports whose target
has a suffix after the wildcard, such as"#/*": "./src/*.ts"(the form
TypeScript requires to map a#/subpath import to.tssource under
moduleResolution: bundler/nodenext). The previous fix only stripped a
trailing*, so a suffix like.tswas left in the jiti alias as a literal
*, making the import unresolvable and dropping every description. The wildcard
and any suffix after it are now stripped, letting jiti resolve the extension.
v0.2.1
Patch Changes
- c315901: Preserve JSDoc/TSDoc field descriptions for schemas imported via the bare
#/*
subpath import form on Node < 26. Description extraction uses jiti, which
delegates subpath-imports resolution to the running Node; only Node 26+ resolves
the bare#/form natively, while older Node rejects it as an invalid internal
imports specifier, causing the whole module import — and thus every description —
to be dropped. The nearestpackage.jsonimportsfield is now read and
registered as jiti aliases (the same mechanism already used for tsconfig
paths), so#/,#src/, and exact subpath imports all keep their
descriptions regardless of the Node version.
v0.2.0
Minor Changes
- 8858d6a: Support subpath imports (the package.json
importsfield), including the#/*wildcard form supported by TypeScript 6 / Node 26. Schemas imported via#-prefixed specifiers are now resolved instead of being skipped as bare module specifiers. ts-morph is upgraded to v28 (which bundles TypeScript 6), so the#/*pattern is resolved natively by TypeScript's own module resolution.