Dancer2
Dancer2 copied to clipboard
Profiles for command line scaffolding
The dancer2 command line utility could make use of different profiles (one using a JS client-side framework, one built on Bootstrap and FontAwesome, etc.).
I have an idea I would be willing to pursue:
Give dancer2 gen a -t / --template option to specify a template to be used for generation of the application. That template can be a URL (to a Github or Bitbucket repo, for example), a file URL (for templates you may have created locally), or the name of a template to use.
Template names could be specified in a .dancer2templaterc in your home dir. A simple key/value list, like bootstrap = https://your.url.com/repo/name reactjs = https://your.other.url.com/repo/other
Each template needs a .dancer2template file that says what template engine is needed, plus whatever other information we decide we need to put there.
Like dancer2 gen does now, a new app is built from the template. dancer2 gen will go to the specified URL, grab the files, and use them as the template for the new app being created.
This gives us the ability to have pre-defined templates that use different frameworks and template engines. It also allows people to build and share templates with other Dancer developers.
Thoughts? Feedback welcome. I came up with this on my second glass of bourbon tonight, so it might be complete bunk ;)
you can specify a path to an alternate skeleton with the -s option, but it like other ideas
While on this topic, it would also be nice to have a --tag-style option to change the tags that the template is generated with.
Admittedly while this would only be useful for some types of templating engines, it would still be useful.
The upside would be that you could maintain only one skeleton and output for multiple templates. the downside that I can see is it might make the skeleton writing process more difficult