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+
130/**
231 * Generate an array of files to expect from a set of options
332 *
635 *
736 */
837export 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 ] ;
4642
4743 /* Core Files */
48- files = files . concat ( [
49- 'client/.htaccess' ,
44+ let files = [
5045 'client/favicon.ico' ,
5146 'client/robots.txt' ,
5247 'client/_index.html' ,
53- `client/polyfills.${ script } ` ,
5448 'client/app/app.' + script ,
49+ 'client/app/app.component.' + script ,
5550 'client/app/app.config.' + script ,
5651 'client/app/app.constants.' + script ,
52+ 'client/app/app.module.' + script ,
5753 'client/app/app.' + stylesheet ,
54+ `client/app/polyfills.${ script } ` ,
5855 'client/app/main/main.component.' + script ,
5956 'client/app/main/main.component.spec.' + script ,
60- 'client/app/main/main.routes .' + script ,
57+ 'client/app/main/main.module .' + script ,
6158 'client/app/main/main.' + markup ,
6259 'client/app/main/main.' + stylesheet ,
6360 'client/assets/images/yeoman.png' ,
61+ 'client/components/directives.module.' + script ,
62+ 'client/components/util.' + script ,
63+ 'client/components/util.spec.' + script ,
6464 'client/components/footer/footer.' + stylesheet ,
6565 'client/components/footer/footer.' + markup ,
6666 'client/components/footer/footer.component.' + script ,
6767 'client/components/navbar/navbar.' + markup ,
6868 'client/components/navbar/navbar.component.' + script ,
69- 'client/components/util/util.module.' + script ,
70- 'client/components/util/util.service.' + script ,
7169 'server/.eslintrc' ,
7270 'server/app.js' ,
7371 'server/index.js' ,
@@ -107,16 +105,16 @@ export function app(options) {
107105 'spec.js' ,
108106 'webpack.build.js' ,
109107 'webpack.dev.js' ,
108+ 'webpack.make.js' ,
110109 'webpack.test.js' ,
111- 'webpack.make .js'
112- ] ) ;
110+ 'webpack.server .js'
111+ ] ;
113112
114113 /* TypeScript */
115114 if ( options . transpiler === 'ts' ) {
116115 files = files . concat ( [
117116 'tsconfig.client.test.json' ,
118- 'tsconfig.client.json' ,
119- 'typings.json' ,
117+ 'tsconfig.json' ,
120118 'client/tslint.json'
121119 ] ) ;
122120 } else {
@@ -137,15 +135,6 @@ export function app(options) {
137135 ] ) ;
138136 }
139137
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-
149138 /* Models - Mongoose or Sequelize */
150139 if ( models ) {
151140 files = files . concat ( [
@@ -165,21 +154,18 @@ export function app(options) {
165154 /* Authentication */
166155 if ( options . auth ) {
167156 files = files . concat ( [
168- 'client/app/account/index .' + script ,
157+ 'client/app/account/account.module .' + script ,
169158 'client/app/account/account.routes.' + script ,
170159 '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 ,
173161 '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 ,
176163 '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 ,
180165 'client/app/admin/admin.' + markup ,
181166 '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 ,
183169 'client/app/admin/admin.routes.' + script ,
184170 'client/components/auth/auth.module.' + script ,
185171 'client/components/auth/auth.service.' + script ,
@@ -208,17 +194,16 @@ export function app(options) {
208194
209195 if ( options . oauth && options . oauth . length ) {
210196 /* OAuth (see oauthFiles function above) */
211- options . oauth . forEach ( function ( type , i ) {
197+ options . oauth . forEach ( type => {
212198 files = files . concat ( oauthFiles ( type . replace ( 'Auth' , '' ) ) ) ;
213199 } ) ;
214200
215201
216202 files = files . concat ( [
217- 'client/components/oauth-buttons/index.' + script ,
218203 'client/components/oauth-buttons/oauth-buttons.' + stylesheet ,
219204 '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 ,
222207 'e2e/components/oauth-buttons/oauth-buttons.po.js'
223208 ] ) ;
224209 }
0 commit comments