Skip to content

Generate inheriting and union types as classes under Pascal paths - #28

Merged
rmcfadden merged 1 commit into
mainfrom
inherit-and-union-types
Oct 7, 2026
Merged

rmcfadden merged 1 commit into
mainfrom
inherit-and-union-types

Conversation

@rmcfadden

Copy link
Copy Markdown
Contributor

Summary

  • Datasource and view types extend a parent class only when the child still covers every parent field. remove_fields that drops a parent member emits a flat class so those properties stay gone. set, dictionary, and file are not bases, and StandardDataSource is no longer emitted.
  • Union types are classes whose properties are the composed fields after remove_fields. Validators include the parent validator and rules for the fields the child declares.
  • Generated types land in Types/Generated/Datasource and Types/Generated/Views (validators nested underneath), with Pascal file and directory names from the shared casing default.

Test plan

  • node --experimental-strip-types --test test/*.test.ts src/common/default-casing.test.ts src/import-generator.test.ts (84 passing)
  • Install against generators-common main (18cd03e) so Auto casing resolves to Pascal

Made with Cursor

C# cannot omit inherited members, so a child extends its parent only when it still covers every parent field. Unions emit the composed properties after remove_fields, and generated types land in Types/Generated with Pascal file names.

Co-authored-by: Cursor <cursoragent@cursor.com>
@rmcfadden
rmcfadden merged commit 2831535 into main Oct 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant