Skip to content

Commit ffb9358

Browse files
committed
refactor: do not clear screen in watch mode
We are now running extra webpack encore process and clearing screen also removes its output
1 parent 7fe7073 commit ffb9358

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

src/DevServer/index.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,6 @@ export class DevServer {
124124
})
125125
}
126126

127-
/**
128-
* Clear stdout
129-
*/
130-
private clearScreen() {
131-
process.stdout.write('\x1B[2J\x1B[3J\x1B[H\x1Bc')
132-
}
133-
134127
/**
135128
* Renders box to notify about the server state
136129
*/
@@ -260,7 +253,6 @@ export class DevServer {
260253
* Source file removed
261254
*/
262255
watcher.on('source:unlink', async ({ absPath, relativePath }) => {
263-
this.clearScreen()
264256
this.watchHelpers.clear(absPath)
265257
this.logger.action('delete').succeeded(relativePath)
266258

@@ -278,7 +270,6 @@ export class DevServer {
278270
* Source file added
279271
*/
280272
watcher.on('source:add', async ({ absPath, relativePath }) => {
281-
this.clearScreen()
282273
this.watchHelpers.clear(absPath)
283274
this.logger.action('add').succeeded(relativePath)
284275

@@ -296,7 +287,6 @@ export class DevServer {
296287
* Source file changed
297288
*/
298289
watcher.on('source:change', async ({ absPath, relativePath }) => {
299-
this.clearScreen()
300290
this.watchHelpers.clear(absPath)
301291
this.logger.action('update').succeeded(relativePath)
302292

@@ -325,13 +315,9 @@ export class DevServer {
325315
return
326316
}
327317

328-
this.clearScreen()
329-
330318
this.logger.action('create').succeeded(relativePath)
331319
if (metaData.reload) {
332320
this.httpServer.restart()
333-
} else {
334-
this.renderSeverIsReady()
335321
}
336322
})
337323

@@ -350,13 +336,10 @@ export class DevServer {
350336
return
351337
}
352338

353-
this.clearScreen()
354339
this.logger.action('update').succeeded(relativePath)
355340

356341
if (metaData.reload || metaData.rcFile) {
357342
this.httpServer.restart()
358-
} else {
359-
this.renderSeverIsReady()
360343
}
361344
})
362345

@@ -375,8 +358,6 @@ export class DevServer {
375358
return
376359
}
377360

378-
this.clearScreen()
379-
380361
if (metaData.rcFile) {
381362
this.logger.info('cannot continue after deletion of .adonisrc.json file')
382363
watcher.chokidar.close()
@@ -387,8 +368,6 @@ export class DevServer {
387368
this.logger.action('delete').succeeded(relativePath)
388369
if (metaData.reload) {
389370
this.httpServer.restart()
390-
} else {
391-
this.renderSeverIsReady()
392371
}
393372
})
394373

0 commit comments

Comments
 (0)