shama / gaze

:crystal_ball: A globbing fs.watch wrapper built from the best parts of other fine watch libs.
MIT License
1.16k stars 167 forks source link

Fixes #221 #226

Open chebum opened 8 years ago

chebum commented 8 years ago

Please note one test is changed because I doubt it's correct. This line bothers me: var expected = { '.': ['Project (LO)/', 'nested/', 'one.js', 'sub/'], };

The problem I see here is that we didn't add sub dir into the watch list. The test adds folders Project (LO) and nested only.

This may have unpleasant side-effects. For example, gaze is used in metalsmith-watch library. Metalsmith is a static website generator written in Node.JS. Common folder structure is

root
src // pages
build // ready website
node_modules

You configure to watch for changes in src folder and gaze also starts monitoring node_modules folder as well. I believe this is not expected behavior, so I fixed the test.

ghost commented 7 years ago

@chebum Your PR doesn't fix this issue https://github.com/shama/gaze/issues/227 but are located in the same area. Ideas how to fix this? See my reply in that ticket.

chebum commented 7 years ago

@crazyhuggins excessive watches is what I fixed there:

You configure to watch for changes in src folder and gaze also starts monitoring node_modules folder as well.

ghost commented 7 years ago

@chebum I see. For seems to be kind a useless module if it watches more then what it should. and @shama seems to be out of radio range or switched off this days Any idea on how to solve #227 issue?

And monitor node_modules by default is expensive.