A new command line tool and developer framework for scaffolding out GitHub projects. Generate offers the robustness and configurability of Yeoman, the expressiveness and simplicity of Slush, and more powerful flow control and composability than either.
answers
passed in the callback is defined { '¯_(ツ)_/¯': { why: 'dunno' } }
base-questions
stores the answers on app.cache.answers
after the question is asked. I copied your example and it works for me. I changed the imports
to var foo = require(‘…’)
and changed export default
to module.exports =
since I’m not sure how you’re doing the transpiling step.
generate
are you using?
base-questions
or that something is happening during the transpiling… also, you should be passing a callback to the default task and calling it after the console.log
to indicate that the task has finished.
./packages
├── generator-slo-mo
│ ├── dist
│ │ └── index.html
│ ├── generator.js
│ ├── package.json
│ └── src
│ ├── generator.js
│ └── index.html
└── slo-mo
├── bin
│ └── cli.js
├── dist
│ ├── github.js
│ ├── slack.js
│ ├── slo-mo.js
│ ├── speedcurve.js
│ └── task.js
├── package.json
├── src
│ ├── github.js
│ ├── slack.js
│ ├── slo-mo.js
│ ├── speedcurve.js
│ └── task.js
└── test
└── sample-spec.js
generate
in an npm script in package.json
answers
appended on the cache
answers
would be added to app.cache.answers
after the ask
"version": "0.9.8"
[14:13:48] ✔ running tasks: [ 'default:default' ]
default
?
default
task on the default
generator (which is the local generator.js if you happen to have one)
module.exports = function(app) {
this.task('default', function(cb) {
console.log(app.namespace, 'task >', this.name);
cb();
});
// sub-generator "foo"
this.generator('foo', function(foo) {
this.task('default', function(cb) {
console.log(foo.namespace, 'task >', this.name);
// run the `default` task on `app`
app.build('default', cb);
});
// sub-generator "foo.bar"
this.generator('bar', function(bar) {
this.task('default', function(cb) {
console.log(bar.namespace, 'task >', this.name);
// run the `default` task on `foo`
foo.build('default', cb);
});
});
});
};