@@ -130,23 +130,24 @@ export async function watch(sourceDirectory: string, hackmudDirectory: string, {
130130 const usersToPushTo = [ ...usersToPushToSet ] . filter ( user => ! scriptNamesToUsersToSkip . has ( user ) )
131131
132132 if ( ! usersToPushTo . length ) {
133- onPush ?.( { path, users : [ ] , characterCount : 0 , error : new Error ( `no users to push to` ) } )
133+ onPush ?.( { path, users : [ ] , characterCount : 0 , error : new Error ( `no users to push to` ) , warnings : [ ] } )
134134
135135 return
136136 }
137137
138138 const uniqueId = Math . floor ( Math . random ( ) * ( 2 ** 52 ) ) . toString ( 36 ) . padStart ( 11 , `0` )
139139 const filePath = resolvePath ( sourceDirectory , path )
140140 let minifiedCode : string
141+ let warnings
141142
142143 try {
143- ( { script : minifiedCode } = await processScript (
144+ ( { script : minifiedCode , warnings } = await processScript (
144145 await readFile ( filePath , { encoding : `utf8` } ) ,
145146 { minify, scriptUser : true , scriptName, uniqueId, filePath, mangleNames, forceQuineCheats }
146147 ) )
147148 } catch ( error ) {
148149 assert ( error instanceof Error , HERE )
149- onPush ?.( { path, users : [ ] , characterCount : 0 , error } )
150+ onPush ?.( { path, users : [ ] , characterCount : 0 , error, warnings : [ ] } )
150151
151152 return
152153 }
@@ -157,9 +158,13 @@ export async function watch(sourceDirectory: string, hackmudDirectory: string, {
157158 . replace ( new RegExp ( `\\$${ uniqueId } \\$FULL_SCRIPT_NAME\\$` , `g` ) , `${ user } .${ scriptName } ` )
158159 ) ) )
159160
160- onPush ?.(
161- { path, users : usersToPushTo , characterCount : countHackmudCharacters ( minifiedCode ) , error : undefined }
162- )
161+ onPush ?.( {
162+ path,
163+ users : usersToPushTo ,
164+ characterCount : countHackmudCharacters ( minifiedCode ) ,
165+ error : undefined ,
166+ warnings
167+ } )
163168
164169 return
165170 }
@@ -174,21 +179,22 @@ export async function watch(sourceDirectory: string, hackmudDirectory: string, {
174179 const filePath = resolvePath ( sourceDirectory , path )
175180 const sourceCode = await readFile ( filePath , { encoding : `utf8` } )
176181 let script
182+ let warnings
177183
178184 try {
179- ( { script } = await processScript (
185+ ( { script, warnings } = await processScript (
180186 sourceCode ,
181187 { minify, scriptUser : user , scriptName, filePath, mangleNames, forceQuineCheats }
182188 ) )
183189 } catch ( error ) {
184190 assert ( error instanceof Error , HERE )
185- onPush ?.( { path, users : [ ] , characterCount : 0 , error } )
191+ onPush ?.( { path, users : [ ] , characterCount : 0 , error, warnings : [ ] } )
186192
187193 return
188194 }
189195
190196 await writeFilePersistent ( resolvePath ( hackmudDirectory , user , `scripts` , `${ scriptName } .js` ) , script )
191- onPush ?.( { path, users : [ user ] , characterCount : countHackmudCharacters ( script ) , error : undefined } )
197+ onPush ?.( { path, users : [ user ] , characterCount : countHackmudCharacters ( script ) , error : undefined , warnings } )
192198 } )
193199
194200 if ( onReady )
0 commit comments