Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
392 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* eslint-disable max-params */ | ||
'use strict'; | ||
var events = require('events'); | ||
var _ = require('lodash'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'use strict'; | ||
var Generator = require('yeoman-generator'); | ||
|
||
// Example of a simple generator. | ||
// | ||
// A raw function that is executed when this generator is resolved. | ||
// | ||
// It takes a list of arguments (usually CLI args) and a Hash of options | ||
// (CLI options), the context of the function is a `new Generator.Base` | ||
// object, which means that you can use the API as if you were extending | ||
// `Base`. | ||
// | ||
// It works with simple generator. If you need to do a bit more complex | ||
// stuff, extend from Generator.Base and defines your generator steps | ||
// in several methods. | ||
|
||
class SimpleGenerator extends Generator { | ||
exec(toCompose) { | ||
console.log(toCompose); | ||
this.composeWith(toCompose); | ||
} | ||
} | ||
|
||
SimpleGenerator.description = | ||
'And add a custom description by adding a `description` property to your function.'; | ||
SimpleGenerator.usage = 'Usage can be used to customize the help output'; | ||
|
||
module.exports = SimpleGenerator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
'use strict'; | ||
var Generator = require('yeoman-generator'); | ||
|
||
// Example of a simple generator. | ||
// | ||
// A raw function that is executed when this generator is resolved. | ||
// | ||
// It takes a list of arguments (usually CLI args) and a Hash of options | ||
// (CLI options), the context of the function is a `new Generator.Base` | ||
// object, which means that you can use the API as if you were extending | ||
// `Base`. | ||
// | ||
// It works with simple generator. If you need to do a bit more complex | ||
// stuff, extend from Generator.Base and defines your generator steps | ||
// in several methods. | ||
|
||
class SimpleGenerator extends Generator { | ||
exec() { | ||
throw new Error('throwing error'); | ||
} | ||
} | ||
|
||
SimpleGenerator.description = | ||
'And add a custom description by adding a `description` property to your function.'; | ||
SimpleGenerator.usage = 'Usage can be used to customize the help output'; | ||
|
||
module.exports = SimpleGenerator; |
Oops, something went wrong.