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 a --with-page flag to gen.action.browser task #1795

Closed
jwoertink opened this issue Mar 27, 2023 · 4 comments · Fixed by #1819
Closed

Add a --with-page flag to gen.action.browser task #1795

jwoertink opened this issue Mar 27, 2023 · 4 comments · Fixed by #1819

Comments

@jwoertink
Copy link
Member

jwoertink commented Mar 27, 2023

Ref: #1794

This would be lucky gen.action.browser Posts::Index --with-page which would generate

src/actions/posts/index.cr
src/pages/posts/index_page.cr

Maybe the lucky gen.page task could also have a --with-action just for the inverse consistency too....

@robacarp
Copy link
Contributor

Yeah, it's always been weird to me that those two generators are separate. The landslide majority of the time I'm adding an action, I want a page too.

Is there room for a combo-blaster generator instead of tying these two generators together? lucky gen.actionpage or something?

@jwoertink
Copy link
Member Author

Is there room for a combo-blaster generator

I'm open to one. It would need to be named something clear with the understanding that it's a BrowserAction being generated. I don't think you'd generate an ApiAction with a page since you'll usually just return JSON...

The other option suggested was using lucky gen.resource without the model, migration, operations, queries....

@zw963
Copy link

zw963 commented Mar 30, 2023

I consider only lucky gen.action.browser Posts::Index --with-page is enough, inverse no need. it rarely happens there exists page but no action?

@zw963
Copy link

zw963 commented Mar 30, 2023

I created two bash script for make create CRUD only(no db) and Action + Page more easier.

The good part is, no need wait compile, and support create namespaced CRUD.
bad part is, the db column never be checked, so, new generated file probably exists error, need adjust.

luckygen.tar.gz

I do create a luckyframework/avram#935 for refine the CRUD templates make it more consistent.

  1. links use non keyword argument form.
  2. Remove unnecessary namespaces.

jwoertink added a commit that referenced this issue Aug 12, 2023
…ace. Adding new --with-page arg for Browser actions. Fixes #1795
jwoertink added a commit that referenced this issue Sep 1, 2023
…ace. Adding new --with-page arg for Browser actions. Fixes #1795 (#1819)
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 a pull request may close this issue.

3 participants