sfc.gen.live - a translation of the phx.gen.live generator to Surface

I’ve been working with Surface and missing the phx.gen.live generator, so I translated it to surface. Github repo

Currently it is just a straightforward translation with the same pieces as phx.gen.live but in Surface form, but later I may pull out more components, e.g.: a generic resource listing component, edit/save/delete buttons etc.

It also contains a simple generator for new Surface components, allowing you to specify props and their types and defaults similarly to generating a schema with columns.

7 Likes

sfc.gen.live now also has a sfc.gen.init generator that sets up a project to use Surface.

6 Likes

@lastobelus You should reach out to @msaraiva on Elixir Slack. I haven’t tried these out, but it would make sense to me to have this merged into Surface proper. Or at least house it in the surface-ui GitHub organization as an official Surface tool like SurfaceFormatter.

1 Like

Thanks! We have been having a conversation about it, it is here.

2 Likes