@@ -13,6 +13,7 @@ export const generatePrimaryInterfaces = (
13
13
const CommonNamespace = [ 'namespace Common {' , eventExport ] ;
14
14
const MainNamespace = [ 'namespace Main {' , eventExport ] ;
15
15
const RendererNamespace = [ 'namespace Renderer {' , eventExport ] ;
16
+ const UtilityNamespace = [ 'namespace Utility {' , eventExport ] ;
16
17
const MainInterfaceForRemote = [ 'interface RemoteMainInterface {' ] ;
17
18
const CrossProcessExportsNamespace = [ 'namespace CrossProcessExports {' , eventExport ] ;
18
19
const constDeclarations : string [ ] = [ ] ;
@@ -102,16 +103,18 @@ export const generatePrimaryInterfaces = (
102
103
}
103
104
if ( TargetNamespace ) {
104
105
debug ( classify ( module . name ) . toLowerCase ( ) , EMRI [ classify ( module . name ) . toLowerCase ( ) ] ) ;
105
- if ( ! EMRI [ classify ( module . name ) . toLowerCase ( ) ] ) {
106
- if ( moduleString ) TargetNamespace . push ( moduleString ) ;
107
- if ( moduleString ) CrossProcessExportsNamespace . push ( moduleString ) ;
106
+ if ( ! EMRI [ classify ( module . name ) . toLowerCase ( ) ] && moduleString ) {
107
+ TargetNamespace . push ( moduleString ) ;
108
+ CrossProcessExportsNamespace . push ( moduleString ) ;
109
+ if ( module . process . utility ) UtilityNamespace . push ( moduleString ) ;
108
110
}
109
111
EMRI [ classify ( module . name ) . toLowerCase ( ) ] = true ;
110
112
const declarations = [ ...newConstDeclarations , ...newTypeAliases ] . map (
111
113
s => ` ${ s . substr ( 0 , s . length - 1 ) } ` ,
112
114
) ;
113
115
TargetNamespace . push ( ...declarations ) ;
114
116
CrossProcessExportsNamespace . push ( ...declarations ) ;
117
+ if ( module . process . utility ) UtilityNamespace . push ( ...declarations ) ;
115
118
}
116
119
} ) ;
117
120
@@ -122,12 +125,14 @@ export const generatePrimaryInterfaces = (
122
125
CommonNamespace . push ( alias ) ;
123
126
MainNamespace . push ( alias ) ;
124
127
RendererNamespace . push ( alias ) ;
128
+ UtilityNamespace . push ( alias ) ;
125
129
CrossProcessExportsNamespace . push ( alias ) ;
126
130
}
127
131
128
132
CommonNamespace . push ( '}' ) ;
129
133
MainNamespace . push ( '}' ) ;
130
134
RendererNamespace . push ( '}' ) ;
135
+ UtilityNamespace . push ( '}' ) ;
131
136
CrossProcessExportsNamespace . push ( '}' ) ;
132
137
133
138
const withSemicolons = ( lines : string [ ] ) => {
@@ -137,6 +142,7 @@ export const generatePrimaryInterfaces = (
137
142
addToOutput ( withSemicolons ( CommonNamespace ) ) ;
138
143
addToOutput ( withSemicolons ( MainNamespace ) ) ;
139
144
addToOutput ( withSemicolons ( RendererNamespace ) ) ;
145
+ addToOutput ( withSemicolons ( UtilityNamespace ) ) ;
140
146
addToOutput ( withSemicolons ( CrossProcessExportsNamespace ) ) ;
141
147
addToOutput ( constDeclarations ) ;
142
148
} ;
0 commit comments