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
{{ message }}
Repository navigation
Feature Request / RFC: export Enum type as object #54
Hi there,
This is a great package, and thank you so much for putting it together. I wanted to throw out an idea for feedback and see if it's something you might consider accepting as a PR if I were to put it together.
In summary, when generating enum types, we get output that looks something like this:
This works very well if all I need is the type definition, but what if I want to use the object directly - e.g. to populate a select box or something? As-is, I have to duplicate the object elsewhere in my code.
It would seem nicer to do something like this instead:
Yea I think adding that as an optional flag works, I'd be down to review a PR for that.
Some pointers on the codebase, is pretty much all starts with the ModelTyperCommand so here you can create your additional flag. Then everything else is a independent Action, so the action for this would be WriteEnumConst. So you just need to pass the CLI argument into that action.
Activity
tcampbPPU commentedon May 10, 2023
Hey @jseitel if I follow you would prefer if both Enum generated values could be exported, so per your example like:
Yea I think adding that as an optional flag works, I'd be down to review a PR for that.
Some pointers on the codebase, is pretty much all starts with the
ModelTyperCommandso here you can create your additional flag. Then everything else is a independent Action, so the action for this would beWriteEnumConst. So you just need to pass the CLI argument into that action.github-actions commentedon Jul 29, 2023
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Rod911 commentedon Jun 24, 2025
Yes please, need this
github-actions commentedon Jul 25, 2025
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.