11const Generator = require ( 'yeoman-generator' ) ;
22const chalk = require ( 'chalk' ) ;
33const yosay = require ( 'yosay' ) ;
4+ const changeCase = require ( 'change-case' ) ;
45
56const pkg = require ( '../../package.json' ) ;
67
78module . exports = class extends Generator {
89 async prompting ( ) {
910 this . log ( yosay ( `Welcome to the ${ chalk . red ( pkg . name ) } generator!` ) ) ;
1011
12+ const appName = changeCase . paramCase ( this . appname ) ;
1113 const gitName = this . user . git . name ( ) || 'organization' ;
1214 const gitEmail = this . user . git . email ( ) || 'hi@domain.com' ;
1315 const githubUsername = await ( async ( ) => {
@@ -24,7 +26,7 @@ module.exports = class extends Generator {
2426 type : 'input' ,
2527 name : 'elementName' ,
2628 message : 'Name of this service?' ,
27- default : this . appname ,
29+ default : appName ,
2830 } ,
2931 {
3032 type : 'input' ,
@@ -36,13 +38,13 @@ module.exports = class extends Generator {
3638 type : 'input' ,
3739 name : 'elementHomepage' ,
3840 message : 'Homepage?' ,
39- default : `https://github.com/${ githubUsername } /${ this . appname } ` ,
41+ default : `https://github.com/${ githubUsername } /${ appName } ` ,
4042 } ,
4143 {
4244 type : 'input' ,
4345 name : 'elementBugs' ,
4446 message : 'Bugs tracker?' ,
45- default : `https://github.com/${ githubUsername } /${ this . appname } /issues` ,
47+ default : `https://github.com/${ githubUsername } /${ appName } /issues` ,
4648 } ,
4749 {
4850 type : 'input' ,
@@ -54,7 +56,7 @@ module.exports = class extends Generator {
5456 type : 'input' ,
5557 name : 'elementRepository' ,
5658 message : 'Repository?' ,
57- default : `https://github.com/${ githubUsername } /${ this . appname } .git` ,
59+ default : `https://github.com/${ githubUsername } /${ appName } .git` ,
5860 } ,
5961 {
6062 type : 'input' ,
0 commit comments