From b19b7dc5ed29e7b3ebc9aa89101fbd5ae5b90be2 Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Sun, 22 Apr 2018 14:33:56 +0200 Subject: [PATCH 1/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7704e73..7b5a773 100644 --- a/README.md +++ b/README.md @@ -166,7 +166,7 @@ $ svr -i .cache -i public ## Tips -### Development Server +### Main file This could be a good start point for a HTTP server: From db5f02b8dc8595c3a0b6b39942b5920a3ec3a5c4 Mon Sep 17 00:00:00 2001 From: Gabriel JUCHAULT Date: Tue, 24 Apr 2018 09:39:10 +0200 Subject: [PATCH 2/3] fix(log): show correct filename when a file change --- bin/watch/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/watch/index.js b/bin/watch/index.js index e755855..d18ab9a 100644 --- a/bin/watch/index.js +++ b/bin/watch/index.js @@ -23,6 +23,7 @@ const doRestart = ({ ignored, sockets, server, + filename, filepath, pkg, pwd, @@ -32,7 +33,6 @@ const doRestart = ({ watcher, port }) => { - const filename = path.basename(filepath) const spinner = logRestart({ filename, forcing }) destroySockets(sockets) server.close( @@ -69,12 +69,13 @@ module.exports = ({ const toWatch = [].concat(watchFiles, pwd) const watcher = watch(toWatch, watchConfig) - const restart = ({ forcing }) => + const restart = ({ forcing, filename }) => doRestart({ watchFiles, ignored, sockets, server, + filename, filepath, pwd, pkg, @@ -85,7 +86,7 @@ module.exports = ({ watcher.once( 'all', - debounce((event, filename) => restart({ forcing: false })), + debounce((event, filename) => restart({ forcing: false, filename: path.basename(filename) })), 10 ) From b586d46b9a3eb45ba2bed940fceccc0bbd91598e Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Tue, 24 Apr 2018 12:50:35 +0200 Subject: [PATCH 3/3] Print the relative filepath --- bin/watch/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/watch/index.js b/bin/watch/index.js index d18ab9a..17d9413 100644 --- a/bin/watch/index.js +++ b/bin/watch/index.js @@ -86,8 +86,11 @@ module.exports = ({ watcher.once( 'all', - debounce((event, filename) => restart({ forcing: false, filename: path.basename(filename) })), - 10 + debounce( + (event, filename) => + restart({ forcing: false, filename: path.relative(pwd, filename) }), + 10 + ) ) if (!firsTime) {