diff --git a/docs/config.md b/docs/config.md index c7924ca..c7bfe9c 100644 --- a/docs/config.md +++ b/docs/config.md @@ -1,5 +1,11 @@ # Config +## config.description + +- Type: `string` + +Generator description. + ## config.prompts - Type: `Array | (this: Generator) => Array` diff --git a/lib/Generator.js b/lib/Generator.js index c45ec1c..c7d2bf2 100644 --- a/lib/Generator.js +++ b/lib/Generator.js @@ -156,6 +156,10 @@ module.exports = class Generator { const config = validateConfig(this.config, opts.extendConfigSchema) + if (config.description) { + logger.status('green', 'Generator', config.description) + } + if (config.prepare) { await config.prepare.call(this, this) } diff --git a/lib/validateConfig.js b/lib/validateConfig.js index f9ab0b4..8462284 100644 --- a/lib/validateConfig.js +++ b/lib/validateConfig.js @@ -4,6 +4,7 @@ const KopyError = require('./KopyError') module.exports = (config, extendConfigSchema) => { // TODO: improve prompts and actions validation const schema = { + description: struct.optional('string'), prepare: struct.optional('function'), prompts: struct.optional(struct.union(['array', 'function'])), actions: struct.optional(struct.union(['array', 'function'])),