Closed cmalven closed 7 years ago
Pushed a few more updates to make this a little bit better by adding the concept of "Platform Templates" for the gulp generator, which are basically just a set of simple defaults for various platforms (currently just "none" – for static projects – and "craft). This can be pretty easily extend to add additional platform sets (e.g. Wordpress), but also makes it a lot easier to re-run this in a previously-created project because you can just choose the default set to match the existing platform and not have to remember what all of the paths should be, etc.
Would love to get some eyeballs on this soon if possible.
Sorry @cmalven I still haven't had a chance to look through this / try it out.
Have you used it on any projects yet?
@brianjhanson haven't used it on any ODC projects but I've used it on several of my own without an issue. It's pretty easy to test on an existing project, and you'll be able to check the git diff to see exactly what it changed.
Pretty please, someone review this.
Decouples some of the logic between the base generator and the
gulp
sub-generator, which allows the sub-generator to be run entirely on it's own (if you want to add gulp or update the gulp setup for an existing project, for instance), while also allowing it to be used seamlessly by the parent generator, passing in any questions we know the answers to.Shockingly, there is basically not Yeoman-provided API for passing the answers to the base generators prompts down as answers to a sub-generators prompts, so we have to kind of hack it by checking for existing answers in the sub-generator and only asking questions we don't have the answers to, but it's actually not that bad code-wise.