You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(core): add schemas.importPath for package import specifiers (#3535)
Allow generated client files to import schema types from a package
specifier (e.g. '@acme/models') instead of computing a relative
filesystem path. This unblocks use cases where the schemas and client
outputs sit in separate TypeScript compilation roots or in
secondary entrypoint packages.
When `schemas.importPath` is set, all four write modes and the
factory generators emit imports from the configured package
specifier. The filesystem `path` is still used for the on-disk
schema output, and validation rejects empty strings, relative paths,
absolute paths, and whitespace-only values.
- core: add `importPath` to `SchemaOptions` / `NormalizedSchemaOptions`
- core: extract `getSchemasImportPath` helper into its own module
- core: update all writers (single/split/tags/split-tags) to use the helper
- core: update factory.ts to resolve factory and type imports from `importPath`
- core: skip per-file extension in `generateImportsForBuilder` for package imports
- orval: tighten `normalizeSchemasOption` validation for `importPath`
- docs: document `schemas` object form and `importPath` requirements
- tests: cover all four modes, zod suffix, faker subpath, and
`outputDirectory` bypass
Closes#3535
0 commit comments