@@ -5,6 +5,11 @@ export default class extends BaseGenerator {
5
5
constructor ( params ) {
6
6
super ( params ) ;
7
7
8
+ this . registerTemplates ( "common/" , [
9
+ // utils
10
+ "utils/mercure.js" ,
11
+ ] ) ;
12
+
8
13
this . registerTemplates ( `vue/` , [
9
14
// modules
10
15
"store/modules/foo/index.js" ,
@@ -36,6 +41,10 @@ export default class extends BaseGenerator {
36
41
"components/foo/Update.vue" ,
37
42
"components/foo/Show.vue" ,
38
43
44
+ // mixins
45
+ "mixins/ItemWatcher.js" ,
46
+ "mixins/ListWatcher.js" ,
47
+
39
48
// routes
40
49
"router/foo.js" ,
41
50
@@ -102,9 +111,13 @@ export const store = new Vuex.Store({
102
111
103
112
// Create directories
104
113
// These directories may already exist
105
- [ `${ dir } /config` , `${ dir } /error` , `${ dir } /router` , `${ dir } /utils` ] . forEach (
106
- ( dir ) => this . createDir ( dir , false )
107
- ) ;
114
+ [
115
+ `${ dir } /config` ,
116
+ `${ dir } /error` ,
117
+ `${ dir } /mixins` ,
118
+ `${ dir } /router` ,
119
+ `${ dir } /utils` ,
120
+ ] . forEach ( ( dir ) => this . createDir ( dir , false ) ) ;
108
121
109
122
[
110
123
`${ dir } /store/modules/${ lc } ` ,
@@ -153,6 +166,10 @@ export const store = new Vuex.Store({
153
166
this . createFileFromPattern ( pattern , dir , lc , context )
154
167
) ;
155
168
169
+ for ( const file of [ "mixins/ItemWatcher.js" , "mixins/ListWatcher.js" ] ) {
170
+ this . createFile ( file , `${ dir } /${ file } ` ) ;
171
+ }
172
+
156
173
// error
157
174
this . createFile (
158
175
"error/SubmissionError.js" ,
@@ -174,5 +191,6 @@ export const store = new Vuex.Store({
174
191
{ hydraPrefix : this . hydraPrefix } ,
175
192
false
176
193
) ;
194
+ this . createFile ( "utils/mercure.js" , `${ dir } /utils/mercure.js` ) ;
177
195
}
178
196
}
0 commit comments