@@ -37,6 +37,7 @@ import { load, commands } from 'npm'
3737import generateTsConfig from '../generators/tsconfig.gen'
3838import generateTsDeclartionFile from '../generators/declarations.gen'
3939import generateDotEnv from '../generators/env.gen'
40+ import generateIdeStubs from '../generators/ide.gen'
4041
4142command (
4243 'create [overwrite]' ,
@@ -51,6 +52,11 @@ command(
5152 description : 'Overwrite existing application folder'
5253} )
5354
55+ export enum IDE {
56+ VISUAL_STUDIO_CODE = 'Visual Studio Code' ,
57+ OTHER = 'Other'
58+ }
59+
5460interface QustionResponse {
5561 readonly name : string
5662 readonly answer : string | boolean
@@ -59,6 +65,7 @@ interface QustionResponse {
5965interface AnswersDictionary {
6066 readonly fullname : string
6167 readonly isUniversalApp : boolean
68+ readonly ide : IDE
6269}
6370
6471interface WorkingAnswersDictionary {
@@ -105,15 +112,17 @@ const Q_SHORT_NAME = {
105112 current : WorkingAnswersDictionary ,
106113 stream : Subject < any >
107114 ) => {
108- stream . next ( Q_APP_TYPE . question )
115+ stream . next ( Q_IDE . question )
109116 }
110117}
111118
112- const Q_APP_TYPE = {
119+ const Q_IDE = {
113120 question : {
114- type : 'confirm' ,
115- name : 'isUniversalApp' ,
116- message : 'Server rendered (Angular Universal)?'
121+ type : 'list' ,
122+ name : 'ide' ,
123+ message : 'Which IDE are you using?' ,
124+ default : 'Visual Studio Code' ,
125+ choices : [ 'Visual Studio Code' , 'Other' ]
117126 } ,
118127 answerHandler : (
119128 response : QustionResponse ,
@@ -124,6 +133,21 @@ const Q_APP_TYPE = {
124133 }
125134}
126135
136+ // const Q_APP_TYPE = {
137+ // question: {
138+ // type: 'confirm',
139+ // name: 'isUniversalApp',
140+ // message: 'Server rendered (Angular Universal)?'
141+ // },
142+ // answerHandler: (
143+ // response: QustionResponse,
144+ // current: WorkingAnswersDictionary,
145+ // stream: Subject<any>
146+ // ) => {
147+ // stream.complete()
148+ // }
149+ // }
150+
127151const Q_TEST_RUNNERS = {
128152 question : {
129153 type : 'list' ,
@@ -144,7 +168,8 @@ const QUESTION_DICT = [
144168 Q_FULL_NAME ,
145169 Q_SHORT_NAME ,
146170 Q_TEST_RUNNERS ,
147- Q_APP_TYPE
171+ Q_IDE
172+ // Q_APP_TYPE
148173] . reduce (
149174 ( acc , curr ) => {
150175 return { ...acc , [ curr . question . name ] : curr }
@@ -313,7 +338,8 @@ function create(overwriteExisting = false) {
313338 generateDotEnv ( path , overwriteExisting ) ,
314339 generateFngConfig ( path , overwriteExisting ) ,
315340 generateTsConfig ( path , overwriteExisting ) ,
316- generateTsDeclartionFile ( path , overwriteExisting )
341+ generateTsDeclartionFile ( path , overwriteExisting ) ,
342+ generateIdeStubs ( im . config . ide , path , overwriteExisting )
317343 ] )
318344 } , im => im ) ,
319345 take ( 1 )
0 commit comments