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 8 to 1

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.

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.

jg-made

jg-made

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

type1fool

type1fool

Thank you for the link. This should be documented.

chrisjowen

chrisjowen OP

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

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

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.

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.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
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
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
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
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
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
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews