generate-package icon indicating copy to clipboard operation
generate-package copied to clipboard

feature: customizing templates

Open jonschlinkert opened this issue 7 years ago • 0 comments

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:

  1. 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.
  2. 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?

jonschlinkert avatar Sep 18 '16 22:09 jonschlinkert