@@ -11,6 +11,7 @@ import picomatch from 'picomatch'
1111import { relative } from 'node:path'
1212import type tsStatic from 'typescript'
1313import prettyHrtime from 'pretty-hrtime'
14+ import { fileURLToPath } from 'node:url'
1415import { type ExecaChildProcess } from 'execa'
1516import { cliui , type Logger } from '@poppinss/cliui'
1617import type { Watcher } from '@poppinss/chokidar-ts'
@@ -168,7 +169,7 @@ export class DevServer {
168169 * Starts the HTTP server
169170 */
170171 #startHTTPServer( port : string , mode : 'blocking' | 'nonblocking' ) {
171- const hooksArgs = { colors : ui . colors , logger : this . #logger }
172+ const hooksArgs = { colors : this . # colors, logger : this . #logger }
172173 this . #httpServer = runNode ( this . #cwd, {
173174 script : this . #scriptFile,
174175 env : { PORT : port , ...this . #options. env } ,
@@ -185,16 +186,16 @@ export class DevServer {
185186 * Handle Hot-Hook messages
186187 */
187188 if ( this . #isHotHookMessage( message ) ) {
188- const path = relative ( this . #cwd. pathname , message . path || message . paths ?. [ 0 ] ! )
189+ const path = relative ( fileURLToPath ( this . #cwd) , message . path || message . paths ?. [ 0 ] ! )
189190 this . #hooks. onSourceFileChanged ( hooksArgs , path )
190191
191192 if ( message . type === 'hot-hook:full-reload' ) {
192193 this . #clearScreen( )
193- this . #logger. log ( `${ ui . colors . green ( 'full-reload' ) } ${ path } ` )
194+ this . #logger. log ( `${ this . # colors. green ( 'full-reload' ) } ${ path } ` )
194195 this . #restartHTTPServer( port )
195196 this . #hooks. onDevServerStarted ( hooksArgs )
196197 } else if ( message . type === 'hot-hook:invalidated' ) {
197- this . #logger. log ( `${ ui . colors . green ( 'invalidated' ) } ${ path } ` )
198+ this . #logger. log ( `${ this . # colors. green ( 'invalidated' ) } ${ path } ` )
198199 }
199200 }
200201
@@ -296,7 +297,6 @@ export class DevServer {
296297 * Handles TypeScript source file change
297298 */
298299 async #handleSourceFileChange( action : string , port : string , relativePath : string ) {
299- console . log ( { relativePath } )
300300 await this . #hooks. onSourceFileChanged ( { colors : ui . colors , logger : this . #logger } , relativePath )
301301
302302 this . #clearScreen( )
0 commit comments