Fidev-io / framy

A convenient code generator for app styleguide, gallery, wireframes and/or storyboard.
https://framy.dev
GNU Lesser General Public License v3.0
148 stars 16 forks source link

Support for auto including models without putting @framyModel annotation #123

Open nateshmbhat opened 4 years ago

nateshmbhat commented 4 years ago

It's possible to look at the imports of the current file and look for the model class in those files without requiring the user to manually put framy model annotation.

If you have seen "auto_route" library, it uses something like this to auto include all the parameters for the Widget.

This will greatly help with seeing framy model annotations everywhere.

TimWhiting commented 4 years ago

Yes, I ran into this issue, because I separate my backend and frontend code into separate packages, but use common models that are defined in the backend. The generator freezes when I try to annotate the models with framyModel in the backend package (probably because there is no FramyApp() in the backend).

MarcinusX commented 4 years ago

That's not good :/ What do you mean it freezes? The build never ends or does it end with an error?

TimWhiting commented 4 years ago

Hmm, can't seem to reproduce the freezing, I'll file a separate issue if I see that again. When I saw it the build_runner build command just never ended, and kept reanalyzing files and spitting out warnings.

TimWhiting commented 4 years ago

I guess what I want now is really #133, because the framy generator in the frontend doesn't find my model classes in my backend package.