nextgen icon indicating copy to clipboard operation
nextgen copied to clipboard

Features request

Open zhandao opened this issue 1 year ago • 7 comments

Hi @mattbrictson

I'm enjoying using nextgen and have some ideas want to share with you, so I open this. 😄

The changes:

  1. Make select more easier (by tty-prompt's options cycle, enum, filter)
  2. Underline the keywords in the questions for clearer display
  3. Group generators into: basic, job_backend, workflows, checkers, code_snippets, gems, and they only appear after yes -> More detailed configuration

The adding:

  1. Job backend selection solid_queue
  2. "Second level question" -- to customize some generators after selecting
    • tailwind: whether to add puma plugin
    • solid_queue: whether to add puma plugin
  3. Code snippets selection Current.user

Refactoring:
I extracted the helper methods from Commands::Create into Commands::Helpers to reduce the length of file.
But this caused a big git changes, may take some of your time, so sorry.

zhandao avatar Mar 12 '24 18:03 zhandao

Thanks for the suggestions! It may take some time for me to review this.

In the meantime, I want to say up front that some of these enhancements, like soild_queue, I probably will not accept at this time. I have not used solid_queue (yet) and I would like to keep nextgen limited to libraries where I have first-hand experience.

That said, I see how there is value to extending nextgen to support more styles of Rails apps beyond my own preferences.

Do you have any ideas for how nextgen could accommodate plugins/extensions, or otherwise be customizable so that interested developers can add their own custom generators?

mattbrictson avatar Mar 12 '24 18:03 mattbrictson

To customize enhancement selections, actually it's about customizing config/*.yml(and its generator templates).

I think we can add "style" argument for nextgen create. (or interactively ask "Which style?")

  1. "styles" presets here: nextgen create myapp --style=style1 -- It will apply the YML files (e.g. job.yml) under config/styles/style1.
  2. nextgen create myapp --style=LOCAL_PATH/my_style

zhandao avatar Mar 13 '24 02:03 zhandao

To customize enhancement selections, actually it's about customizing config/*.yml(and its generator templates).

I think we can add "style" argument for nextgen create. (or interactively ask "Which style?")

  1. "styles" presets here: nextgen create myapp --style=style1 -- It will apply the YML files (e.g. job.yml) under config/styles/style1.
  2. nextgen create myapp --style=LOCAL_PATH/my_style

Implemented.

zhandao avatar Mar 15 '24 07:03 zhandao

@zhandao thanks again for your suggestions.

I'm still deciding which of your proposals to merge into nextgen.

For now, I would like to incorporate your idea to turn on the :cycle option for the select menus, as well as the improved color helpers. I opened PR #61 based on one of your commits. I plan on merging it if you have no objections.

I also like the idea of organizing the generators into groups. The number of generators is really long, and I think organizing them will make for a better experience. I'll look into incorporating your ideas on that.

mattbrictson avatar Apr 12 '24 00:04 mattbrictson

@mattbrictson I have no objections 😄

Additionally, I've just found out that solid_queue will be the default job backend for Rails 8 (https://github.com/rails/rails/issues/50442), so the idea should perhaps be reconsidered after Rails 8 release.

zhandao avatar Apr 12 '24 03:04 zhandao

EDIT: Moved to new issue at https://github.com/mattbrictson/nextgen/issues/110

jon-sully avatar Sep 17 '24 11:09 jon-sully

EDIT: Moved to #110

mattbrictson avatar Sep 17 '24 17:09 mattbrictson