slush uses gulp for scaffolding
# install slush
npm install -g slush
# install a slush generator
npm install -g slush-angular
# usage: slush <generator>[:<tasks>] [<args>]
slush angular
slush angular:component myNewComponent
# list available generators
slush
# list tasks in generator
slush <generator> --tasks
# check generator version
slush <generator> -v
a slush generator is an npm package that:
named "slush-yourGeneratorName"
contains a slushfile.js (is actually a gulp file)
"slushgenerator" as a keyword in package.json
need "gulp" as a local dependency (normal, not dev)
to be found, needs to be installed globally
In slushfile, use "gulp.src(__dirname + '/templates/**')" to refer files under the directory of the generator, not the files under the destination dir, as the root will be the destination, not the generator. (Node.js __dirname is directory name of the current module)
https://www.npmjs.com/package/slush-generator
Single task: default
What's inside:
slushfile.js:
function "defaults" to gather default information such as author name, email, etc.
single default task, prompts a string of questions, then duplicate with template rendering files under /templates/**, replace "_" to "." for hidden files & install
some basic README, CONTRIBUTING etc. stuff
Best guide I have read: https://medium.com/@horte/how-to-create-a-slush-generator-part-1-eafece6c1ca8
Example slushfile.js, see https://github.com/slushjs/slush
Use "slush generator" generator to create slush generator... https://www.npmjs.com/package/slush-generator
Uses lodash templates: see http://2ality.com/2012/06/underscore-templates.html