Skip to content

Releases: toiroakr/zinfer

v1.0.0-next.1

v1.0.0-next.1 Pre-release
Pre-release

Choose a tag to compare

@toiroakr-release-bot toiroakr-release-bot released this 16 Jul 13:35
7cf2703

Patch Changes

  • 733fbd1: Fix TsgoHost (tsgo/Corsa API backend, see #200) mishandling real tsconfig.json files that use extends or contain comments/trailing commas. Previously, --project support extracted CompilerOptions via parseConfigFile() and re-embedded them into a synthetic config elsewhere, which broke relative extends/typeRoots resolution for real-world configs. It now serves a patched copy of the original tsconfig.json at its own path (parsed with jsonc-parser, only files appended to), so extends and every other config-relative path resolve exactly as they would for the real project.

v0.2.7

Choose a tag to compare

@toiroakr-release-bot toiroakr-release-bot released this 16 Jul 14:53
574fd9f

Patch Changes

  • 5210bb4: Fix description extraction stack-overflowing on self-recursive Zod schemas (e.g. a get accessor 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

Choose a tag to compare

@toiroakr-release-bot toiroakr-release-bot released this 16 Jul 04:09
9824d7d

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

v1.0.0-next.0 Pre-release
Pre-release

Choose a tag to compare

@toiroakr-release-bot toiroakr-release-bot released this 15 Jul 14:08
d4992e7

Major Changes

  • 08b0f77: Replace ts-morph with TypeScript's native tsgo/Corsa API (@typescript/native-preview) as the type-resolution engine (see #200). ts-morph is dropped entirely; @typescript/native-preview moves from a dev-only dependency (used just for the tsgo typecheck script) to a runtime dependency.

    Internals:

    • TsHost (introduced as prep work) is now implemented by TsgoHost, which resolves temporary type aliases via a virtual-FS overlay instead of mutating a live ts-morph SourceFile.
    • SchemaDetector, GetterResolver, ImportResolver, BrandDetector, and SchemaReferenceAnalyzer are reimplemented against the Corsa ast/checker API. Cross-file import resolution now goes through Checker.getSymbolAtLocation (real module resolution) instead of ts-morph's getModuleSpecifierSourceFile, which incidentally fixes a known limitation resolving named imports through an intermediate re-export index file.

    Breaking change: SchemaDetector and BrandDetector are no longer exported. They operated on a ts-morph SourceFile, 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 through ZodTypeExtractor's output (ExtractResult#isExported/#brands) and ZodTypeExtractor#getSchemaNames. ZodTypeExtractor's public methods and the top-level extractZodTypes/extractAndFormat/extractAllSchemas helpers 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

Choose a tag to compare

@toiroakr-release-bot toiroakr-release-bot released this 10 Jul 23:44
e997dba

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

Choose a tag to compare

@toiroakr-release-bot toiroakr-release-bot released this 10 Jul 12:03
58bf255

Patch Changes

  • 0dc4e66: Preserve named schema references when .describe() (or another type-preserving method such as .meta(), .superRefine(), .check()) wraps a schema reference or a z.union() / z.discriminatedUnion() declaration, instead of expanding the referenced schema inline. Inline expansion previously degraded recursive schemas to unknown / 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

Choose a tag to compare

@toiroakr-release-bot toiroakr-release-bot released this 24 Jun 07:34
da95fed

Patch Changes

  • 8ec6316: Preserve named schema references inside z.strictObject() and z.looseObject() fields instead of expanding them inline.

v0.2.2

Choose a tag to compare

@toiroakr-release-bot toiroakr-release-bot released this 18 Jun 00:24
7fc2759

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 .ts source under
    moduleResolution: bundler/nodenext). The previous fix only stripped a
    trailing *, so a suffix like .ts was 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

Choose a tag to compare

@toiroakr-release-bot toiroakr-release-bot released this 17 Jun 15:05
ea08a7b

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 nearest package.json imports field 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

Choose a tag to compare

@toiroakr-release-bot toiroakr-release-bot released this 17 Jun 13:29
a10e7b2

Minor Changes

  • 8858d6a: Support subpath imports (the package.json imports field), 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.