@@ -3,8 +3,8 @@ var Generator = require('yeoman-generator');
3
3
var chalk = require ( 'chalk' ) ;
4
4
var yosay = require ( 'yosay' ) ;
5
5
6
- module . exports = Generator . extend ( {
7
- prompting : function ( ) {
6
+ class BlockstackGenerator extends Generator {
7
+ prompting ( ) {
8
8
// Have Yeoman greet the user.
9
9
this . log ( yosay (
10
10
'Welcome to the ' + chalk . red ( 'Blockstack' ) + ' app generator!'
@@ -21,80 +21,74 @@ module.exports = Generator.extend({
21
21
// To access props later use this.props.someAnswer
22
22
this . props = props ;
23
23
} . bind ( this ) ) ;
24
- } ,
24
+ }
25
25
26
- writing : {
27
- configs : function ( ) {
28
- this . fs . copy (
29
- this . templatePath ( '_package.json' ) ,
30
- this . destinationPath ( 'package.json' )
31
- ) ;
32
- this . fs . copy (
33
- this . templatePath ( 'editorconfig' ) ,
34
- this . destinationPath ( '.editorconfig' )
35
- ) ;
36
- this . fs . copy (
37
- this . templatePath ( 'gitignore' ) ,
38
- this . destinationPath ( '.gitignore' )
39
- ) ;
40
- this . fs . copy (
41
- this . templatePath ( 'requires.js' ) ,
42
- this . destinationPath ( 'requires.js' )
43
- ) ;
44
- this . fs . copy (
45
- this . templatePath ( 'firebase.json' ) ,
46
- this . destinationPath ( 'firebase.json' )
47
- ) ;
48
- } ,
49
- server : function ( ) {
50
- this . fs . copy (
51
- this . templatePath ( 'server.js' ) ,
52
- this . destinationPath ( 'server.js' )
53
- ) ;
54
- } ,
55
- styles : function ( ) {
56
- this . fs . copy (
57
- this . templatePath ( 'public/app.css' ) ,
58
- this . destinationPath ( 'public/app.css' )
59
- ) ;
60
- this . fs . copy (
61
- this . templatePath ( 'public/bootstrap.min.css' ) ,
62
- this . destinationPath ( 'public/bootstrap.min.css' )
63
- ) ;
64
- } ,
65
- scripts : function ( ) {
66
- this . fs . copy (
67
- this . templatePath ( 'public/app.js' ) ,
68
- this . destinationPath ( 'public/app.js' )
69
- ) ;
70
- } ,
71
- images : function ( ) {
72
- this . fs . copy (
73
- this . templatePath ( 'public/icon-192x192.png' ) ,
74
- this . destinationPath ( 'public/icon-192x192.png' )
75
- )
76
- } ,
77
- html : function ( ) {
78
- this . fs . copy (
79
- this . templatePath ( 'public/index.html' ) ,
80
- this . destinationPath ( 'public/index.html' )
81
- ) ;
82
- } ,
83
- publicExtras : function ( ) {
84
- this . fs . copy (
85
- this . templatePath ( 'public/robots.txt' ) ,
86
- this . destinationPath ( 'public/robots.txt' )
87
- ) ;
88
- this . fs . copy (
89
- this . templatePath ( 'public/manifest.json' ) ,
90
- this . destinationPath ( 'public/manifest.json' )
91
- ) ;
92
- }
93
- } ,
26
+ writing ( ) {
27
+ this . fs . copy (
28
+ this . templatePath ( '_package.json' ) ,
29
+ this . destinationPath ( 'package.json' )
30
+ ) ;
31
+ this . fs . copy (
32
+ this . templatePath ( 'editorconfig' ) ,
33
+ this . destinationPath ( '.editorconfig' )
34
+ ) ;
35
+ this . fs . copy (
36
+ this . templatePath ( 'gitignore' ) ,
37
+ this . destinationPath ( '.gitignore' )
38
+ ) ;
39
+ this . fs . copy (
40
+ this . templatePath ( 'requires.js' ) ,
41
+ this . destinationPath ( 'requires.js' )
42
+ ) ;
43
+ this . fs . copy (
44
+ this . templatePath ( 'firebase.json' ) ,
45
+ this . destinationPath ( 'firebase.json' )
46
+ ) ;
47
+ // server
48
+ this . fs . copy (
49
+ this . templatePath ( 'server.js' ) ,
50
+ this . destinationPath ( 'server.js' )
51
+ ) ;
52
+ // styles
53
+ this . fs . copy (
54
+ this . templatePath ( 'public/app.css' ) ,
55
+ this . destinationPath ( 'public/app.css' )
56
+ ) ;
57
+ this . fs . copy (
58
+ this . templatePath ( 'public/bootstrap.min.css' ) ,
59
+ this . destinationPath ( 'public/bootstrap.min.css' )
60
+ ) ;
61
+ // scripts
62
+ this . fs . copy (
63
+ this . templatePath ( 'public/app.js' ) ,
64
+ this . destinationPath ( 'public/app.js' )
65
+ ) ;
66
+ // images
67
+ this . fs . copy (
68
+ this . templatePath ( 'public/icon-192x192.png' ) ,
69
+ this . destinationPath ( 'public/icon-192x192.png' )
70
+ )
71
+ // html
72
+ this . fs . copy (
73
+ this . templatePath ( 'public/index.html' ) ,
74
+ this . destinationPath ( 'public/index.html' )
75
+ ) ;
76
+ // publicExtras
77
+ this . fs . copy (
78
+ this . templatePath ( 'public/robots.txt' ) ,
79
+ this . destinationPath ( 'public/robots.txt' )
80
+ ) ;
81
+ this . fs . copy (
82
+ this . templatePath ( 'public/manifest.json' ) ,
83
+ this . destinationPath ( 'public/manifest.json' )
84
+ ) ;
85
+ }
94
86
95
- install : function ( ) {
87
+ install ( ) {
96
88
this . installDependencies ( {
97
89
bower : false
98
90
} ) ;
99
91
}
100
- } ) ;
92
+ }
93
+
94
+ module . exports = BlockstackGenerator ;
0 commit comments