padrino-framework icon indicating copy to clipboard operation
padrino-framework copied to clipboard

Refactoring Generators

Open DAddYE opened this issue 13 years ago • 14 comments

  • [ ] fix #1963

@achiu,

Im planning to add some new features to our generator, but since you are the Lead of this gem I would to know:

  1. We need to add the ability to create new components after the project was created i.e.
padrino g foo
cd foo
# ... mmm i forgot testsss!!!
padrino g minitest
# ... WTF I forgot also persistence adapter!
padrino g mini_record
# ... now I need some js!
padrino g jquery
  1. We need a -i, --interactive mode, we have 200+ options, so we some like:
padrino g foo -i
Hi Davide D'Agostino,

do you need a persistence adpater? Choose one of:
1) MongoMapper
2) DataMapper
3) MongoID
4) ActiveRecord
5) MiniRecord
6) ...

do you need some js frameworks? Choose one of:
1) jquery
3) mootools

....

@achiu what do you think?? @nesquena?

We can catch the moment also for make a small refactoring on our gen internals, decoupling a rewriting some things... no?

DAddYE avatar Sep 19 '11 20:09 DAddYE

@DAddYE i like 1) because that use case happens alot. Some user wants to generate a component aftewards and can't so i agree with this. 2) Is good it fits with the wizard idea sort of and its a 'nice-to-have'.

I'm in the process of finishing the minitest generator. I'll spend some time seeing how the gen's can be clean up and perhaps add these features in.

achiurizo avatar Sep 19 '11 21:09 achiurizo

woot, thanks man! I will see your changes! Great!

DAddYE avatar Sep 19 '11 21:09 DAddYE

Just putting it out there, let's move this discussion to the next point release. There's a lot going on in this release already. We can incoporate the minitest component in this release though. Is that OK?

nesquena avatar Sep 21 '11 19:09 nesquena

Sure, can we add also mini_record? Requires few code and my staff use it intensively. Is that okey for you guys?

@nate you prefer that I separate DSL/Autorun for the next release? If you want we can create a new branch.

DAddYE avatar Sep 21 '11 19:09 DAddYE

Just my two cents but I am pretty sure installing mini_record involves this gem 'mini_record'. Are you saying seriously that you can't use the ActiveRecord component and add that one line to the gemfile? To me seems a bit unnecessary. @achiu

@daddye Yeah can we move the dsl and autorun to another branch and then wait for the next release. That way we can properly document and add integration tests, etc.

nesquena avatar Sep 21 '11 19:09 nesquena

@DAddYE yeah I agree with @nesquena there. It's relatively simple to incorporate mini_record just by using the AR. perhaps it can be a plugin? That would make much more sense to me.

Let's just push minitest and these ideas to 0.10.4 then as this release already seems to have enough.

achiurizo avatar Sep 21 '11 20:09 achiurizo

@arthur, mmm not at all, mini_record doesn't need schema and migrations so would be better if we can integrate it in our gen tweaking migrations only for those that need to rename columns.

DAddYE avatar Sep 21 '11 21:09 DAddYE

If you feel very strongly about it then go ahead, one more component won't hurt us too much even if a single gemfile addition and the skip migration flag is very similar. Maybe in the next release 0.10.4?

nesquena avatar Sep 22 '11 02:09 nesquena

If isn't unobtrusive I prefer to add it for this release, but the final decision must be taken from @achiu. Feel free to do the best for our gen and our stability.

DAddYE avatar Sep 22 '11 07:09 DAddYE

Agreed, I will happily defer to your guys decision for generator component stuff. I think we should have minitest this version for sure (in the spirit of the switch) and I am Ok with or without mini_record.

nesquena avatar Sep 22 '11 07:09 nesquena

What about planning this for 1.0?

dariocravero avatar Jan 04 '13 22:01 dariocravero

I agree, there's quite similar #470

ujifgc avatar Jan 12 '13 17:01 ujifgc

@dariocravero @ujifgc this most likely will be a 1.0 release. Maybe some of the feature requests for generators can come in before, that way we have some time to feel out how it all fits, and by 1.0, we can better re-factor everything to support them.

achiurizo avatar Jan 12 '13 17:01 achiurizo

Great idea @achiu!

dariocravero avatar Jan 12 '13 17:01 dariocravero