lepikhinb / laravel-typescript

MIT License
391 stars 46 forks source link

feat: add support for Enum casts, Attribute-based accessors, Output Modifiers #14

Open superbiche opened 2 years ago

superbiche commented 2 years ago

This is an early PR to open a discussion on the following improvements (see #3):

What must be done before merging it:

What would be nice to have, but can totally be done later:

This is a "quick and dirty" implementation that was written on the go for a project I'm working on, but it works quite well - right now we can use the generated typings as-is without modifying those manually.

It does need some polishing before merging it.

Also I've copied the files from what I've written by hand so there may be a few typos, missing use statements...
I just wanted to publish it as soon as possible to collect feedback, and take some time the next weekend to polish it accordingly.

Thanks in advance for your feedback :)

lepikhinb commented 2 years ago

Thanks for the PR! I’m going to review it and give a more detailed answer once I’m at the workplace.

tcampbPPU commented 2 years ago

Very interesting approach! @superbiche I was working on similar functionality over at https://github.com/fumeapp/modeltyper What all is difference between ReflectionEnumBackedCase instead of using something like:

$enum = (new ReflectionEnum($enumClass));
$enum->getConstants()

I am still trying myself to figure out all the new reflection stuff for enums

rollsover commented 1 year ago

@superbiche Why was PR abandoned? There is information?

superbiche commented 1 year ago

@rollsover nope, it's waiting for a review by the maintainer

rollsover commented 1 year ago

@lepikhinb need review

rollsover commented 1 year ago

@superbiche can you remove the "draft" mark and put a reviewer?

superbiche commented 1 year ago

@rollsover nope, I can't add a reviewer and there's still some work left like writing tests & docs. I'd like to get a review first before spending time on tests and documentation. But feel free to review it too!

Healyhatman commented 11 months ago

+1