@@ -5,6 +5,11 @@ export default class extends BaseGenerator {
55 constructor ( params ) {
66 super ( params ) ;
77
8+ this . registerTemplates ( "common/" , [
9+ // utils
10+ "utils/mercure.js" ,
11+ ] ) ;
12+
813 this . registerTemplates ( `vue/` , [
914 // modules
1015 "store/modules/foo/index.js" ,
@@ -36,6 +41,10 @@ export default class extends BaseGenerator {
3641 "components/foo/Update.vue" ,
3742 "components/foo/Show.vue" ,
3843
44+ // mixins
45+ "mixins/ItemWatcher.js" ,
46+ "mixins/ListWatcher.js" ,
47+
3948 // routes
4049 "router/foo.js" ,
4150
@@ -102,9 +111,13 @@ export const store = new Vuex.Store({
102111
103112 // Create directories
104113 // 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 ) ) ;
108121
109122 [
110123 `${ dir } /store/modules/${ lc } ` ,
@@ -153,6 +166,10 @@ export const store = new Vuex.Store({
153166 this . createFileFromPattern ( pattern , dir , lc , context )
154167 ) ;
155168
169+ for ( const file of [ "mixins/ItemWatcher.js" , "mixins/ListWatcher.js" ] ) {
170+ this . createFile ( file , `${ dir } /${ file } ` ) ;
171+ }
172+
156173 // error
157174 this . createFile (
158175 "error/SubmissionError.js" ,
@@ -174,5 +191,6 @@ export const store = new Vuex.Store({
174191 { hydraPrefix : this . hydraPrefix } ,
175192 false
176193 ) ;
194+ this . createFile ( "utils/mercure.js" , `${ dir } /utils/mercure.js` ) ;
177195 }
178196}
0 commit comments