chrisjowen

chrisjowen

Hey All,

Im probably in the minority in that I generally dislike some of the way that the Ecto/Phoenix generators work in and would like to have more control over what they produce. Im not here to argue this, and I havent enough Elixir experience to solidify my arguments againt them.

I usually avoid using them, but for a recent project I tried to get running as quickly as possible and relied on they heavily. I believe that generators are very useful for quick scaffolding and I would use them if they fit my defaults more (which change per project).

With this in mind do we have anything the elixir community that is a generator of generator such as GitHub - foundweekends/giter8: a command line tool to apply templates defined on GitHub · GitHub or https://yeoman.io/?

Note: I’m not looking at these as shining example in their respective ecosystems I have used both and disliked the experience but I have never sat down and thought what good would look like for such a tool I just have a feeling that a flexible easy to use generator would be extreemly useful for me.

Chris

Showing Posts 1 to 8

adrianrl

adrianrl

Hi,

I’ve used aspnet-codegenerator (extremely opinionated, but flexible) and the generator for Symfony and Laravel, (both are very opinionated, but flexible). I think Phoenix’s generator is poorly opinionated, and flexible enough; it just generates what you need without extra markup. I like being poorly opinionated, the framework shouldn’t make decisions for you, sometimes you don’t want to use Bootstrap as a CSS framework, or jQuery for client-side validation.

However the generator lacks a bit in terms of flexibility, sometimes you don’t want to generate all of the templates or you just want to start from scratch without all of the basic functionality, and for that specific things you may want to build your own generator, it doesn’t have to be perfect, just something that covers your needs.

chrisjowen

chrisjowen OP

Can you explain more when you say it’s flexible enough? Can this be extended in some way? Looking at the code seems like a custom set of mix tasks and not something that can be extended.

LostKobrakai

LostKobrakai

You can copy the templates phoenix/priv/templates at main · phoenixframework/phoenix · GitHub into your own priv/templates folder and the mix tasks will use those. You’re free to edit them there.

27
Post #3
chrisjowen

chrisjowen OP

Thanks I really didn’t know you could do this, that’s awesome.

type1fool

type1fool

Thank you for the link. This should be documented.

jg-made

jg-made

Has anyone out there made any LiveView generators? If so, would you please share? :slight_smile:

crova

crova

Thanks for that link.
Overriding the default templates was something on my “list of things to discover how to do” and now I know how.

OndrejValenta

OndrejValenta

I’m planning to use for our projects LLBLGen, which was originally intended for .NET projects but their generators are quite universal and they are developing their tools for at least 15 years what I can remember.

We are now investigating how ecto files actually look like for real aplications and then we’ll look into the templates.

It’s not free but it has quite powerful UI and you can pretty well set up how you want to generate your models. It can even create typed views for database views or stored procedures.

It deals only with RDBMS though and it also has some issues with postrgres custom types and enums.

— All posts loaded —

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews