@polygonlabs/zod-to-openapi-heyapi@2.1.0
Minor Changes
-
#83
340bdb2Thanks @MaximusHaximus! -schemasFromnow resolves from the consumer's perspective —'#schemas'aliases workThe codegen-time audit used to dynamic-import
schemasFromwith the plugin's own install location as the resolution referrer, so a consumer'spackage.json#importsalias ('#schemas') could never resolve — the documented same-package recipe failed for every real installation, while bare package names worked only via the package manager's store layout. The audit now anchors resolution at the codegen output directory — the exact location the generated client's emittedimport { Name } from '<schemasFrom>'statements resolve from — so audit-time and consumer-runtime resolution are identical by construction, includingimportsaliases with their conditions,exportsmaps, and the running process's--conditionsflags.'#schemas'is the canonicalschemasFromfor schemas living in the same package as the codegen: declare the alias underimportsand point it at the schema barrel. No packagename,exportsentry, or self-dependency is needed.- If you adopted the
"<name>": "link:."self-dependency workaround from the 2.0.4 docs: remove the self-link (and theexportsentry, if nothing else consumes it) and switchschemasFromto a#alias. - Package specifiers (
@org/pkg,@org/pkg/zod) for separate schemas packages are unchanged. - Relative paths are now rejected with guidance instead of being undefined behavior: the emitted import must resolve identically from anywhere in the consumer package, which only aliases and package names do.
registryPlugin(the advanced API) gains an optionaloutputDiroption;defineRegistryClientConfigwires it automatically fromoutput.