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 ( [
44+ let files = [
4945 'client/favicon.ico' ,
5046 'client/robots.txt' ,
5147 'client/_index.html' ,
52- `client/polyfills.${ script } ` ,
5348 'client/app/app.' + script ,
49+ 'client/app/app.component.' + script ,
5450 'client/app/app.config.' + script ,
5551 'client/app/app.constants.' + script ,
52+ 'client/app/app.module.' + script ,
5653 'client/app/app.' + stylesheet ,
54+ `client/app/polyfills.${ script } ` ,
5755 'client/app/main/main.component.' + script ,
5856 'client/app/main/main.component.spec.' + script ,
59- 'client/app/main/main.routes .' + script ,
57+ 'client/app/main/main.module .' + script ,
6058 'client/app/main/main.' + markup ,
6159 'client/app/main/main.' + stylesheet ,
6260 'client/assets/images/yeoman.png' ,
61+ 'client/components/directives.module.' + script ,
62+ 'client/components/util.' + script ,
6363 'client/components/footer/footer.' + stylesheet ,
6464 'client/components/footer/footer.' + markup ,
6565 'client/components/footer/footer.component.' + script ,
6666 'client/components/navbar/navbar.' + markup ,
6767 'client/components/navbar/navbar.component.' + script ,
68- 'client/components/util/util.module.' + script ,
69- 'client/components/util/util.service.' + script ,
7068 'server/.eslintrc' ,
7169 'server/app.js' ,
7270 'server/index.js' ,
@@ -106,9 +104,10 @@ export function app(options) {
106104 'spec.js' ,
107105 'webpack.build.js' ,
108106 'webpack.dev.js' ,
107+ 'webpack.make.js' ,
109108 'webpack.test.js' ,
110- 'webpack.make .js'
111- ] ) ;
109+ 'webpack.server .js'
110+ ] ;
112111
113112 /* TypeScript */
114113 if ( options . transpiler === 'ts' ) {
@@ -136,15 +135,6 @@ export function app(options) {
136135 ] ) ;
137136 }
138137
139- /* Ui-Bootstrap */
140- if ( options . uibootstrap ) {
141- files = files . concat ( [
142- 'client/components/modal/modal.' + markup ,
143- 'client/components/modal/modal.' + stylesheet ,
144- 'client/components/modal/modal.service.' + script
145- ] ) ;
146- }
147-
148138 /* Models - Mongoose or Sequelize */
149139 if ( models ) {
150140 files = files . concat ( [
@@ -167,18 +157,15 @@ export function app(options) {
167157 'client/app/account/account.module.' + script ,
168158 'client/app/account/account.routes.' + script ,
169159 'client/app/account/login/login.' + markup ,
170- 'client/app/account/login/login.module.' + script ,
171160 'client/app/account/login/login.component.' + script ,
172161 'client/app/account/settings/settings.' + markup ,
173- 'client/app/account/settings/settings.module.' + script ,
174- 'client/app/account/settings/settings.controller.' + script ,
162+ 'client/app/account/settings/settings.component.' + script ,
175163 'client/app/account/signup/signup.' + markup ,
176- 'client/app/account/signup/signup.module.' + script ,
177- 'client/app/account/signup/signup.controller.' + script ,
178- 'client/app/admin/index.' + script ,
164+ 'client/app/account/signup/signup.component.' + script ,
179165 'client/app/admin/admin.' + markup ,
180166 'client/app/admin/admin.' + stylesheet ,
181- 'client/app/admin/admin.controller.' + script ,
167+ 'client/app/admin/admin.component.' + script ,
168+ 'client/app/admin/admin.module.' + script ,
182169 'client/app/admin/admin.routes.' + script ,
183170 'client/components/auth/auth.module.' + script ,
184171 'client/components/auth/auth.service.' + script ,
@@ -207,16 +194,16 @@ export function app(options) {
207194
208195 if ( options . oauth && options . oauth . length ) {
209196 /* OAuth (see oauthFiles function above) */
210- options . oauth . forEach ( function ( type , i ) {
197+ options . oauth . forEach ( type => {
211198 files = files . concat ( oauthFiles ( type . replace ( 'Auth' , '' ) ) ) ;
212199 } ) ;
213200
214201
215202 files = files . concat ( [
216- 'client/components/oauth-buttons/index.' + script ,
217203 'client/components/oauth-buttons/oauth-buttons.' + stylesheet ,
218204 'client/components/oauth-buttons/oauth-buttons.' + markup ,
219- 'client/components/oauth-buttons/oauth-buttons.controller.spec.' + script ,
205+ 'client/components/oauth-buttons/oauth-buttons.component.' + script ,
206+ 'client/components/oauth-buttons/oauth-buttons.component.spec.' + script ,
220207 'client/components/oauth-buttons/oauth-buttons.directive.spec.' + script ,
221208 'e2e/components/oauth-buttons/oauth-buttons.po.js'
222209 ] ) ;
0 commit comments