Simple project generator based on a template project
Simple command line utility to create projects from project templates.
This project is inspired by the awesome Cookiecutter.
$ spg add goliatone/core.io-starter-template core
$ spg add goliatone/core.io-module-template module --skip-cache
$ spg new core ./myProject/ --context ./path/context.json
$ spg new app
$ spg new goliatone/app
$ spg new goliatone/app ./target/
-> search template: * local cache * download from github ø option: skip-cache -> copy template to /temp: * temp-dir-cp -> collect config * look for prompt file in template ø option: skipt if -c config.json is set -> clean output dir ø option: skip-clean -> collect-files -> expand-files -> file-processor: * solve template -> copy into target
TODO:
add
commandMiddleware (tasks):
If you want to add template filters from a task you should set it in the context:
KeyPath.set(context, 'config.template.options.filters', { formatDate });
Then it would be used as:
%{date.raw | formatDate }%
In some instances we might include some files, directories, or npm
dependencies based on some user input. For those cases we can use optional files.
It uses the jstransformer jstransformer-swig for swig