Templates should be able to be overriden
Originally posted on the mailing list: https://groups.google.com/forum/#!msg/yeoman-dev/M8M-kqw6S28/1FZ0xbMgBXsJ
The behaviour is not implemented yet but should be.
The idea is that when a generator invoke the .template() method, the system looks first into your project lib/templates/<generator>/<namespace> and use the template it finds instead of the built-in.
For instance, you would be able to override the template used in angular:controller generator by placing a template at lib/templates/angular/controller/controller.js
+1
:+1:
Thanks for adding that +1
I think we should re-investigate whether this is still something we want. If so, let's figure out the work required to get it in place :)
I think it makes sense to have this. People have preferences. Instead of us supporting everything. Let us please everyone by letting them override with their own crazy stuff.
+1 As a result it would be useful, when using sub-generators, to see the details of the different steps (e.g. instantiating template xxx into yyy.. etc), and to be able to import a copy of xxx in the local project instance with a simple yo command.
This can be accomplished using this.src.root.
Closing as this can be implemented by generator authors and should be up to them. Like I said, you can specify a path to the template files using this.sourceRoot