Generate makes it easy to override templates in general (by adding a custom template to the ~/templates directory).
I'd like to come up with a convention for easily extending templates as well. e.g. since package.json is an object, we should be able to find a way to allow users to customize the templates used in this generator, without having to overwrite them completely.
Here are a couple of ideas for solutions:
- Instead of loading all of the templates using
app.src(), we can load them onto a template collection so that when this generator is used as a plugin, you would be able to get the template and modify it, or extend it and create a new one based on it.
- Support adding custom data to a specific property on
app.cache.data. Then when we can just merge that object onto the template before rendering.
Any other ideas?
Generate makes it easy to override templates in general (by adding a custom template to the
~/templatesdirectory).I'd like to come up with a convention for easily extending templates as well. e.g. since
package.jsonis an object, we should be able to find a way to allow users to customize the templates used in this generator, without having to overwrite them completely.Here are a couple of ideas for solutions:
app.src(), we can load them onto a template collection so that when this generator is used as a plugin, you would be able to get the template and modify it, or extend it and create a new one based on it.app.cache.data. Then when we can just merge that object onto the template before rendering.Any other ideas?