1
+ const mapping = {
2
+ stylesheet : {
3
+ sass : 'scss' ,
4
+ stylus : 'styl' ,
5
+ less : 'less' ,
6
+ css : 'css'
7
+ } ,
8
+ markup : {
9
+ pug : 'pug' ,
10
+ html : 'html'
11
+ } ,
12
+ script : {
13
+ js : 'js' ,
14
+ ts : 'ts'
15
+ }
16
+ } ;
17
+
18
+ /**
19
+ * Generate an array of OAuth files based on type
20
+ *
21
+ * @param {String } type - type of oauth
22
+ * @return {Array } - array of files
23
+ *
24
+ */
25
+ var oauthFiles = type => ( [
26
+ `server/auth/${ type } /index.js` ,
27
+ `server/auth/${ type } /passport.js` ,
28
+ ] ) ;
29
+
1
30
/**
2
31
* Generate an array of files to expect from a set of options
3
32
*
6
35
*
7
36
*/
8
37
export function app ( options ) {
9
- var mapping = {
10
- stylesheet : {
11
- sass : 'scss' ,
12
- stylus : 'styl' ,
13
- less : 'less' ,
14
- css : 'css'
15
- } ,
16
- markup : {
17
- pug : 'pug' ,
18
- html : 'html'
19
- } ,
20
- script : {
21
- js : 'js' ,
22
- ts : 'ts'
23
- }
24
- } ,
25
- files = [ ] ;
26
-
27
- /**
28
- * Generate an array of OAuth files based on type
29
- *
30
- * @param {String } type - type of oauth
31
- * @return {Array } - array of files
32
- *
33
- */
34
- var oauthFiles = function ( type ) {
35
- return [
36
- 'server/auth/' + type + '/index.js' ,
37
- 'server/auth/' + type + '/passport.js' ,
38
- ] ;
39
- } ;
40
-
41
-
42
- var script = mapping . script [ options . transpiler === 'ts' ? 'ts' : 'js' ] ,
43
- markup = mapping . markup [ options . markup ] ,
44
- stylesheet = mapping . stylesheet [ options . stylesheet ] ,
45
- models = options . models ? options . models : options . odms [ 0 ] ;
38
+ let script = mapping . script [ options . transpiler === 'ts' ? 'ts' : 'js' ] ;
39
+ let markup = mapping . markup [ options . markup ] ;
40
+ let stylesheet = mapping . stylesheet [ options . stylesheet ] ;
41
+ let models = options . models ? options . models : options . odms [ 0 ] ;
46
42
47
43
/* Core Files */
48
- files = files . concat ( [
49
- 'client/.htaccess' ,
44
+ let files = [
50
45
'client/favicon.ico' ,
51
46
'client/robots.txt' ,
52
47
'client/_index.html' ,
53
- `client/polyfills.${ script } ` ,
54
48
'client/app/app.' + script ,
49
+ 'client/app/app.component.' + script ,
55
50
'client/app/app.config.' + script ,
56
51
'client/app/app.constants.' + script ,
52
+ 'client/app/app.module.' + script ,
57
53
'client/app/app.' + stylesheet ,
54
+ `client/app/polyfills.${ script } ` ,
58
55
'client/app/main/main.component.' + script ,
59
56
'client/app/main/main.component.spec.' + script ,
60
- 'client/app/main/main.routes .' + script ,
57
+ 'client/app/main/main.module .' + script ,
61
58
'client/app/main/main.' + markup ,
62
59
'client/app/main/main.' + stylesheet ,
63
60
'client/assets/images/yeoman.png' ,
61
+ 'client/components/directives.module.' + script ,
62
+ 'client/components/util.' + script ,
63
+ 'client/components/util.spec.' + script ,
64
64
'client/components/footer/footer.' + stylesheet ,
65
65
'client/components/footer/footer.' + markup ,
66
66
'client/components/footer/footer.component.' + script ,
67
67
'client/components/navbar/navbar.' + markup ,
68
68
'client/components/navbar/navbar.component.' + script ,
69
- 'client/components/util/util.module.' + script ,
70
- 'client/components/util/util.service.' + script ,
71
69
'server/.eslintrc' ,
72
70
'server/app.js' ,
73
71
'server/index.js' ,
@@ -107,16 +105,16 @@ export function app(options) {
107
105
'spec.js' ,
108
106
'webpack.build.js' ,
109
107
'webpack.dev.js' ,
108
+ 'webpack.make.js' ,
110
109
'webpack.test.js' ,
111
- 'webpack.make .js'
112
- ] ) ;
110
+ 'webpack.server .js'
111
+ ] ;
113
112
114
113
/* TypeScript */
115
114
if ( options . transpiler === 'ts' ) {
116
115
files = files . concat ( [
117
116
'tsconfig.client.test.json' ,
118
- 'tsconfig.client.json' ,
119
- 'typings.json' ,
117
+ 'tsconfig.json' ,
120
118
'client/tslint.json'
121
119
] ) ;
122
120
} else {
@@ -137,15 +135,6 @@ export function app(options) {
137
135
] ) ;
138
136
}
139
137
140
- /* Ui-Bootstrap */
141
- if ( options . uibootstrap ) {
142
- files = files . concat ( [
143
- 'client/components/modal/modal.' + markup ,
144
- 'client/components/modal/modal.' + stylesheet ,
145
- 'client/components/modal/modal.service.' + script
146
- ] ) ;
147
- }
148
-
149
138
/* Models - Mongoose or Sequelize */
150
139
if ( models ) {
151
140
files = files . concat ( [
@@ -165,21 +154,18 @@ export function app(options) {
165
154
/* Authentication */
166
155
if ( options . auth ) {
167
156
files = files . concat ( [
168
- 'client/app/account/index .' + script ,
157
+ 'client/app/account/account.module .' + script ,
169
158
'client/app/account/account.routes.' + script ,
170
159
'client/app/account/login/login.' + markup ,
171
- 'client/app/account/login/index.' + script ,
172
- 'client/app/account/login/login.controller.' + script ,
160
+ 'client/app/account/login/login.component.' + script ,
173
161
'client/app/account/settings/settings.' + markup ,
174
- 'client/app/account/settings/index.' + script ,
175
- 'client/app/account/settings/settings.controller.' + script ,
162
+ 'client/app/account/settings/settings.component.' + script ,
176
163
'client/app/account/signup/signup.' + markup ,
177
- 'client/app/account/signup/index.' + script ,
178
- 'client/app/account/signup/signup.controller.' + script ,
179
- 'client/app/admin/index.' + script ,
164
+ 'client/app/account/signup/signup.component.' + script ,
180
165
'client/app/admin/admin.' + markup ,
181
166
'client/app/admin/admin.' + stylesheet ,
182
- 'client/app/admin/admin.controller.' + script ,
167
+ 'client/app/admin/admin.component.' + script ,
168
+ 'client/app/admin/admin.module.' + script ,
183
169
'client/app/admin/admin.routes.' + script ,
184
170
'client/components/auth/auth.module.' + script ,
185
171
'client/components/auth/auth.service.' + script ,
@@ -208,17 +194,16 @@ export function app(options) {
208
194
209
195
if ( options . oauth && options . oauth . length ) {
210
196
/* OAuth (see oauthFiles function above) */
211
- options . oauth . forEach ( function ( type , i ) {
197
+ options . oauth . forEach ( type => {
212
198
files = files . concat ( oauthFiles ( type . replace ( 'Auth' , '' ) ) ) ;
213
199
} ) ;
214
200
215
201
216
202
files = files . concat ( [
217
- 'client/components/oauth-buttons/index.' + script ,
218
203
'client/components/oauth-buttons/oauth-buttons.' + stylesheet ,
219
204
'client/components/oauth-buttons/oauth-buttons.' + markup ,
220
- 'client/components/oauth-buttons/oauth-buttons.controller.spec .' + script ,
221
- 'client/components/oauth-buttons/oauth-buttons.directive .spec.' + script ,
205
+ 'client/components/oauth-buttons/oauth-buttons.component .' + script ,
206
+ 'client/components/oauth-buttons/oauth-buttons.component .spec.' + script ,
222
207
'e2e/components/oauth-buttons/oauth-buttons.po.js'
223
208
] ) ;
224
209
}
0 commit comments