It's a template repository for Fung.
Create a repository on GitHub, and push some templates as branches to the repository.
There is a one-to-one match between each templates and each branches.
template structure:
├── template/
│ ├── ...
│ └── package.json
└── fung-config.js
add a template folder to save your template.
add a config file named fung-config.json in your template folder.
fung-config.js
{
"prompts": {
"name": {
"type": "string",
"required": true,
"message": "Project name"
},
"description": {
"type": "string",
"required": true,
"message": "Project description",
"default": "A Vue.js project"
},
"author": {
"type": "string",
"message": "Author"
},
"license": {
"type": "string",
"message": "License",
"default": "MIT"
}
},
"completeMessage": "To get started:\n\n npm install\n npm run dev"
}
prompts: a question array containing Question Object.completeMessage:show a message after completing the build command.
A question object is a hash containing question related values:
- type: (String) Type of the prompt. Defaults:
input- Possible values:input,confirm,list,rawlist,expand,checkbox,password,editor - message: (String|Function) The question to print. If defined as a function, the first parameter will be the current inquirer session answers.
- default: (String|Number|Array|Function) Default value(s) to use if nothing is entered, or a function that returns the default value(s). If defined as a function, the first parameter will be the current inquirer session answers.
- choices: (Array|Function) Choices array or a function returning a choices array. If defined as a function, the first parameter will be the current inquirer session answers.
Array values can be simple
strings, orobjectscontaining aname(to display in list), avalue(to save in the answers hash) and ashort(to display after selection) properties.
Fung use handlebars render templates.
Use {{ placeholder }} to add placeholders in the files.
{
"name": "{{ name }}",
"description": "{{ description }}",
"version": "{{ version }}",
"author": "{{ author ? author : 'leechikit'}}",
"license": "{{ license }}",
"scripts": {},
"dependencies": {},
"devDependencies": {
"babel-core": "^6.26.0",
{{#sass}}
"node-sass": "^4.5.3",
"sass-loader": "^6.0.6",
{{/sass}}
"webpack": "^3.6.0",
"webpack-dev-server": "^2.9.1"
}
}