11import  *  as  path  from  'path' ; 
22import  {  addModuleToRouter ,  addModuleToState  }  from  '../ast' ; 
3- import  {  Config  }  from  '../../models/Config ' ; 
3+ import  {  VuesionConfig  }  from  '../../models/VuesionConfig ' ; 
44import  {  folderExists ,  runtimeRoot  }  from  '../../utils/path' ; 
55
66export  =  { 
@@ -15,7 +15,7 @@ export = {
1515          return  'name is required' ; 
1616        } 
1717
18-         return  folderExists ( runtimeRoot ( path . join ( Config . generators . outputDirectory ,  value ) ) ) 
18+         return  folderExists ( runtimeRoot ( path . join ( VuesionConfig . generators . outputDirectory ,  value ) ) ) 
1919          ? `folder already exists (${ value }  )` 
2020          : true ; 
2121      } , 
@@ -38,19 +38,27 @@ export = {
3838
3939    data . moduleName  =  filePath . pop ( ) ; 
4040    data . componentName  =  data . moduleName ; 
41-     data . basePath  =  path . join ( process . cwd ( ) ,  Config . generators . outputDirectory ,  filePath . join ( '/' ) ) ; 
41+     data . basePath  =  path . join ( process . cwd ( ) ,  VuesionConfig . generators . outputDirectory ,  filePath . join ( '/' ) ) ; 
4242
4343    let  actions : any [ ]  =  [ 
4444      { 
4545        type : 'add' , 
4646        path : '{{basePath}}/{{camelCase moduleName}}/{{properCase componentName}}/{{properCase componentName}}.vue' , 
47-         templateFile : path . join ( process . cwd ( ) ,  Config . generators . blueprintDirectory ,  'connected/connected.vue.hbs' ) , 
47+         templateFile : path . join ( 
48+           process . cwd ( ) , 
49+           VuesionConfig . generators . blueprintDirectory , 
50+           'connected/connected.vue.hbs' , 
51+         ) , 
4852        abortOnFail : true , 
4953      } , 
5054      { 
5155        type : 'add' , 
5256        path : '{{basePath}}/{{camelCase moduleName}}/{{properCase componentName}}/{{properCase componentName}}.spec.ts' , 
53-         templateFile : path . join ( process . cwd ( ) ,  Config . generators . blueprintDirectory ,  'connected/connected.spec.ts.hbs' ) , 
57+         templateFile : path . join ( 
58+           process . cwd ( ) , 
59+           VuesionConfig . generators . blueprintDirectory , 
60+           'connected/connected.spec.ts.hbs' , 
61+         ) , 
5462        abortOnFail : true , 
5563      } , 
5664    ] ; 
@@ -59,66 +67,82 @@ export = {
5967      actions . push ( { 
6068        type : 'add' , 
6169        path : '{{basePath}}/{{camelCase moduleName}}/routes.ts' , 
62-         templateFile : path . join ( process . cwd ( ) ,  Config . generators . blueprintDirectory ,  'module/routes.ts.hbs' ) , 
70+         templateFile : path . join ( process . cwd ( ) ,  VuesionConfig . generators . blueprintDirectory ,  'module/routes.ts.hbs' ) , 
6371        abortOnFail : true , 
6472      } ) ; 
6573
66-       addModuleToRouter ( path . join ( path . resolve ( process . cwd ( ) ) ,  Config . generators . routerFile ) ,  data . moduleName ) ; 
74+       addModuleToRouter ( path . join ( path . resolve ( process . cwd ( ) ) ,  VuesionConfig . generators . routerFile ) ,  data . moduleName ) ; 
6775    } 
6876
6977    if  ( data . wantVuex )  { 
7078      actions  =  actions . concat ( [ 
7179        { 
7280          type : 'add' , 
7381          path : '{{basePath}}/{{camelCase moduleName}}/actions.spec.ts' , 
74-           templateFile : path . join ( process . cwd ( ) ,  Config . generators . blueprintDirectory ,  'module/actions.spec.ts.hbs' ) , 
82+           templateFile : path . join ( 
83+             process . cwd ( ) , 
84+             VuesionConfig . generators . blueprintDirectory , 
85+             'module/actions.spec.ts.hbs' , 
86+           ) , 
7587          abortOnFail : true , 
7688        } , 
7789        { 
7890          type : 'add' , 
7991          path : '{{basePath}}/{{camelCase moduleName}}/actions.ts' , 
80-           templateFile : path . join ( process . cwd ( ) ,  Config . generators . blueprintDirectory ,  'module/actions.ts.hbs' ) , 
92+           templateFile : path . join ( process . cwd ( ) ,  VuesionConfig . generators . blueprintDirectory ,  'module/actions.ts.hbs' ) , 
8193          abortOnFail : true , 
8294        } , 
8395        { 
8496          type : 'add' , 
8597          path : '{{basePath}}/{{camelCase moduleName}}/getters.spec.ts' , 
86-           templateFile : path . join ( process . cwd ( ) ,  Config . generators . blueprintDirectory ,  'module/getters.spec.ts.hbs' ) , 
98+           templateFile : path . join ( 
99+             process . cwd ( ) , 
100+             VuesionConfig . generators . blueprintDirectory , 
101+             'module/getters.spec.ts.hbs' , 
102+           ) , 
87103          abortOnFail : true , 
88104        } , 
89105        { 
90106          type : 'add' , 
91107          path : '{{basePath}}/{{camelCase moduleName}}/getters.ts' , 
92-           templateFile : path . join ( process . cwd ( ) ,  Config . generators . blueprintDirectory ,  'module/getters.ts.hbs' ) , 
108+           templateFile : path . join ( process . cwd ( ) ,  VuesionConfig . generators . blueprintDirectory ,  'module/getters.ts.hbs' ) , 
93109          abortOnFail : true , 
94110        } , 
95111        { 
96112          type : 'add' , 
97113          path : '{{basePath}}/{{camelCase moduleName}}/module.ts' , 
98-           templateFile : path . join ( process . cwd ( ) ,  Config . generators . blueprintDirectory ,  'module/module.ts.hbs' ) , 
114+           templateFile : path . join ( process . cwd ( ) ,  VuesionConfig . generators . blueprintDirectory ,  'module/module.ts.hbs' ) , 
99115          abortOnFail : true , 
100116        } , 
101117        { 
102118          type : 'add' , 
103119          path : '{{basePath}}/{{camelCase moduleName}}/mutations.spec.ts' , 
104-           templateFile : path . join ( process . cwd ( ) ,  Config . generators . blueprintDirectory ,  'module/mutations.spec.ts.hbs' ) , 
120+           templateFile : path . join ( 
121+             process . cwd ( ) , 
122+             VuesionConfig . generators . blueprintDirectory , 
123+             'module/mutations.spec.ts.hbs' , 
124+           ) , 
105125          abortOnFail : true , 
106126        } , 
107127        { 
108128          type : 'add' , 
109129          path : '{{basePath}}/{{camelCase moduleName}}/mutations.ts' , 
110-           templateFile : path . join ( process . cwd ( ) ,  Config . generators . blueprintDirectory ,  'module/mutations.ts.hbs' ) , 
130+           templateFile : path . join ( 
131+             process . cwd ( ) , 
132+             VuesionConfig . generators . blueprintDirectory , 
133+             'module/mutations.ts.hbs' , 
134+           ) , 
111135          abortOnFail : true , 
112136        } , 
113137        { 
114138          type : 'add' , 
115139          path : '{{basePath}}/{{camelCase moduleName}}/state.ts' , 
116-           templateFile : path . join ( process . cwd ( ) ,  Config . generators . blueprintDirectory ,  'module/state.ts.hbs' ) , 
140+           templateFile : path . join ( process . cwd ( ) ,  VuesionConfig . generators . blueprintDirectory ,  'module/state.ts.hbs' ) , 
117141          abortOnFail : true , 
118142        } , 
119143      ] ) ; 
120144
121-       addModuleToState ( path . join ( path . resolve ( process . cwd ( ) ) ,  Config . generators . stateFile ) ,  data . moduleName ) ; 
145+       addModuleToState ( path . join ( path . resolve ( process . cwd ( ) ) ,  VuesionConfig . generators . stateFile ) ,  data . moduleName ) ; 
122146    } 
123147
124148    return  actions ; 
0 commit comments