11const Generator = require ( 'yeoman-generator' ) ;
2- const chalk = require ( "chalk" ) ;
3- const yosay = require ( "yosay" ) ;
2+ const chalk = require ( 'chalk' ) ;
3+ const yosay = require ( 'yosay' ) ;
4+
45const pkg = require ( '../../package.json' ) ;
56
67module . exports = class extends Generator {
78 async prompting ( ) {
89 this . log (
9- yosay (
10- `Welcome to the astounding ${ chalk . red ( pkg . name ) } generator!`
11- )
10+ yosay ( `Welcome to the astounding ${ chalk . red ( pkg . name ) } generator!` ) ,
1211 ) ;
13-
12+
1413 const prompts = [
1514 {
16- type : " input" ,
17- name : " elementName" ,
18- message : " What is the name of your package?" ,
19- default : " my-awesome-package"
15+ type : ' input' ,
16+ name : ' elementName' ,
17+ message : ' What is the name of your package?' ,
18+ default : ' my-awesome-package' ,
2019 } ,
2120 {
22- type : " input" ,
23- name : " elementDescription" ,
24- message : " Give us some small description of your package" ,
25- default : ""
21+ type : ' input' ,
22+ name : ' elementDescription' ,
23+ message : ' Give us some small description of your package' ,
24+ default : '' ,
2625 } ,
2726 {
28- type : " input" ,
29- name : " elementAuthor" ,
30- message : " Who is the author of this package?" ,
31- default : ""
27+ type : ' input' ,
28+ name : ' elementAuthor' ,
29+ message : ' Who is the author of this package?' ,
30+ default : '' ,
3231 } ,
3332 ] ;
3433
@@ -40,15 +39,13 @@ module.exports = class extends Generator {
4039
4140 writing ( ) {
4241 this . fs . copyTpl (
43- [
44- this . templatePath ( '**' ) ,
45- ] ,
42+ [ this . templatePath ( '**' ) ] ,
4643 this . destinationPath ( ) ,
4744 this . props ,
4845 ) ;
4946 }
5047
51- install ( ) {
48+ install ( ) {
5249 this . installDependencies ( ) ;
5350 }
5451} ;
0 commit comments