Skip to content

Map generated proxy types to imports from other packages - #141

Merged
woksin merged 3 commits into
mainfrom
feature/113-proxy-type-mappings
Sep 29, 2026
Merged

woksin merged 3 commits into
mainfrom
feature/113-proxy-type-mappings

Conversation

@woksin

@woksin woksin commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Added

  • The source proxy generator can import a type from another package instead of generating it. Pass --type-mapping <Type>=<package>[#<export>] (repeatable) or typeMappings to generateFromSource/analyzeSource. A mapped class or enum works as a field, array element, result or base class.
  • Limits: the package must export a class usable as a runtime constructor, and is installed separately. Only types below the artifacts root match, the fields of a mapped type are not analyzed, each type maps once, and a mapping that matches nothing is reported as a warning.

Review: Opus-only (same-provider) review.

Closes #113

Add typeMappings / --type-mapping so a type is imported from an npm
package instead of being generated. Types are matched by their resolved
declaration and namespace-qualified name; a mapped export that collides
with another import or declaration in a generated file fails generation.

Refs #113
@woksin woksin added the minor New backward-compatible capabilities label Sep 29, 2026
@woksin woksin self-assigned this Sep 29, 2026
@woksin
woksin merged commit b455598 into main Sep 29, 2026
5 checks passed
@cratis-direct
cratis-direct Bot deleted the feature/113-proxy-type-mappings branch September 29, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor New backward-compatible capabilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Map external types and packages in generated proxies

1 participant