CaliStyle / generator-treefrog

:frog: Treefrog isomorphic Generator for Trails Apps
Other
2 stars 2 forks source link

Why not for generator-trails #2

Closed jaumard closed 8 years ago

jaumard commented 8 years ago

Is there a reason for this ? Because when it will be updated all modifications have to be done here also :/ (except if this generator will don't do anything like the generator-trails). Just curious :)

I just start a refactoring to move all generators global code into generator-util https://github.com/trailsjs/generator-util/pull/2 all api/models/policies/controllers/services are in it. Can be useful here too :)

scott-wyatt commented 8 years ago

Very true. Last time I wrote a generator that did a lot of this same stuff for Angular 1, I added additional files to the generation of additional files for things like models, controllers, api etc. It would be really cool to be able to pull in the default trails generations and just add the treefrog content. That way, we wouldn't have to update Treefrog each time generator-trails was refactored.

scott-wyatt commented 8 years ago

For example: yo treefrog:model <model-name> might add react or angular specific attributes or files.

jaumard commented 8 years ago

I see... Maybe instead of forking we can only use generator-trails as a dependency of this one. Like this we can call all commands of generator-trails, it does his job and then we add specific need from this one.

But to see the best solution we need to know what this generator can do more the generator-trails exactly. Like this we will know if we can reuse it or just copy/paste it ^^

generator-trails commands are classes so maybe we can just extends them and add what we need. Unfortunately not everything is in classes...

scott-wyatt commented 8 years ago

I'm closing this as it is decided that we will include generator trails to initiate normal trails app parts and wrap them in treefrog so that we don't need worry about one or the other.