Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ash.gen.resource generator #735

Closed
wants to merge 11 commits into from

Conversation

wintermeyer
Copy link
Contributor

Generator for a resource.

$ mix ash.gen.resource Shop Product products name:string price:integer

generator

File.write!(resource_file_path, resource_file_content)
IO.puts("Generated #{resource_file_path}")

if uses_ash_postgres?() do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I'm still pretty torn about putting ash_postgres specific code generation in Ash core. The idea that we're working towards behind the scenes in terms of generators is that we would compose generator modifiers from various extensions that would be able to add their own snippets. i.e --with postgres,graphql or something like that. While having postgres configured automatically would be great I'd rather, at least to start, generate the resource without ash_postgres related code for now. We can always add it back in in a follow up.

@zachdaniel
Copy link
Contributor

We want to use Mix.shell() to print, as opposed to IO.puts

@zachdaniel
Copy link
Contributor

Closing this for now, as we are working on igniter which will be released before long

@zachdaniel zachdaniel closed this May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants