Commit Graph

58 Commits

Author SHA1 Message Date
Remy Sharp
b0fd56f7de refactor: move watch out in favour of chokidar
Plus jscs clean ups
2015-08-31 18:25:55 +01:00
Remy Sharp
242f03cdd9 Detail which events bound + test fix 2015-01-19 20:13:12 +00:00
Remy Sharp
fa7826a2ac Fixed event binding to nodemon not bus 2015-01-16 17:36:25 +00:00
Remy Sharp
65d2d49120 Merge branch 'master' into feature/pre-post-events 2015-01-16 10:07:03 +00:00
Remy Sharp
c223bfe5d5 Find on linux and detect container offset
Closes #455
Closes #453
Fixes #419

This method creates a file and checks the stat to check of an offset between the date on the machine and the created time on the file system. Docker (in my tests) show that you can get the offset using this method.

Once we have the offset, we tell the user (once) and then we use that to find files that have been modified according to the offset (either looking in the last using -mmin or in the future using -newer + a touched file).
2015-01-08 12:35:58 +00:00
Remy Sharp
8d08b183a1 Fixed nodemon require reset fully
And related events test
2015-01-07 21:45:14 +00:00
Remy Sharp
b09a37f2e8 Fixed "watching extension: undefined" 2015-01-07 21:45:14 +00:00
Remy Sharp
69715211d0 Merge branch 'master' into feature/pre-post-events 2015-01-03 15:49:16 +00:00
Remy Sharp
b70b81612c Removed script, exec, ext from options
This commit removes the duplication that happened at the options and options.execOptions level. Now all exec related information lives in options.execOptions.

I've updated all the references and tests that referred to things like options.script, etc.

This also fixes the (new) bug with exec argments not being placed in the right position when the script is detected via a package (so it reads `node --debug app.js` - this is resolved in command.js (due to the flattening of the config).

I've also fixed a few tests that said they were passing, but actually should have failed (but didn't because I was mocking too much of the code).
2015-01-03 15:35:11 +00:00
Remy Sharp
6f6d7ae496 Early support for event callbacks
Allows user to have event handlers in the nodemon config, such as:

{
  "events": {
    "crash": "say 'your app crashed'",
    "start": "echo 'App started' | tee app.log"
  }
}
2014-12-09 22:56:02 +00:00
Remy Sharp
96bd4b3e79 Fixed tests on Mac
Specifically race conditions where the child process was being left running still
2014-12-04 22:07:34 +00:00
Remy Sharp
dd550f161d Only read stdin if option says so 2014-12-02 13:04:36 +00:00
Ricardo Nogueira
457e87e9b7 Fix minor typo in removeAllListeners 2014-11-07 18:12:25 +00:00
Michael Heuberger
c4e263ed37 expose streams for piping (mh) 2014-06-04 02:49:24 +12:00
Remy Sharp
a34a47bfba Text tweaks 2014-05-28 12:49:11 +01:00
Remy Sharp
50976c2aee Fixed #334
If a single file was being watched, it would use the tryBaseDir method to work out the directory, but fail as a pattern so it would return the base directory - which is too much. Now we test if that string is a real file or a directory, and if it is, it returns *that* back out.
2014-05-14 09:56:44 +01:00
Remy Sharp
59a5851552 fixed #289. setTimeout to the rescue? 2014-04-04 10:50:57 +01:00
Remy Sharp
d5c4d1c594 Revert package version away from RC to 1.0.16
Conflicts:
	package.json
2014-03-20 12:14:13 +00:00
Remy Sharp
641eb96cf5 -w <single file> ignores extension filter
Fixes #299 and fixes #308.

This means if you use nodemon to monitor a .js script, but explicitly watch another file (that isn't .js) then nodemon *will* restart as expected.
2014-03-19 15:33:35 +00:00
Remy Sharp
a9f8dd97ec Work on #304 and #304 to read the stdout *stream*
Changed it from using `.on('data')` to using a PassThrough stream which does the job much better, but the readline demos don't work when they're doing anything special on stdout, like `.cursorTo`. WIP.
2014-03-19 14:27:03 +00:00
Remy Sharp
25abc37fd2 allow dump to run without any extra args 2014-01-15 14:14:45 +00:00
Remy Sharp
169d3fb11d Add support for --cwd (and .cwd) to run nodemon from that root 2014-01-09 13:09:39 +00:00
Remy Sharp
b35c3347b2 Merge branch 'fix/74' of github.com:remy/nodemon into fix/74
Conflicts:
	lib/monitor/watch.js
2014-01-07 22:59:11 +00:00
Remy Sharp
96e78e672d If user exec, then don't require script. Fixes #259. 2014-01-07 22:34:15 +00:00
Remy Sharp
c78bcb9faa Documentation of required nodemon 2014-01-05 22:59:23 +00:00
Remy Sharp
cf070d4ae3 Merge branch 'fix/74' of github.com:remy/nodemon into fix/74
Conflicts:
	lib/monitor/watch.js
	lib/nodemon.js
	package.json
2014-01-05 16:03:22 +00:00
Remy Sharp
ab549a1e85 All tests passing (damn race conditions) 2014-01-05 10:16:39 +00:00
Remy Sharp
13770da9f3 Fixed nodemon.once. Add config.run. Tests not 100% passing
Something weird is happening with required nodemon and re-running lots of times, that somehow resets the config. I know it's due to my tests, but I'm unsure which one is actually causing the damn issue. Anyway, bed for me, it's almost 2am. Sod this for a game of cricket.
2014-01-05 01:42:37 +00:00
Remy Sharp
bdcf4478c2 nodemon without args and no package, show usage.txt 2014-01-03 18:39:56 +00:00
Remy Sharp
b429f800a8 Don't show "false" on "watching" boot up 2014-01-03 18:31:15 +00:00
Remy Sharp
7959c5bf00 Refactor watch & ignore logic in favour of monitor
Now using minimatch to match globs to files that have changed. Logic orders the rules in order of specificity (i.e. deeper paths have higher specificity) and the file runs through the rules.
2014-01-03 18:27:24 +00:00
Remy Sharp
f3e76157d2 Tweaking how watching works
Fixed nodemon to echo out what's being watched in the regexp instead of the config.dir path.

Also allowing patterns on the "watch" config setting, rather than just paths.

Removed useless test (that kept failing...incorrectly).
2014-01-03 14:20:46 +00:00
Remy Sharp
e92d29316f Fixed default ignore rule overriding all 2014-01-02 18:17:26 +00:00
Remy Sharp
64d593b6d9 Passes tests again 2013-12-30 15:09:44 +00:00
Remy Sharp
ab464021df 78 tests passing on mac. 2013-12-29 20:26:28 +00:00
Remy Sharp
1fcc30d272 Fixing coffeescript tests for windows 2013-12-15 13:56:33 +00:00
Remy Sharp
86d32281ce Passing all tests on linux 2013-12-14 20:20:27 +00:00
Remy Sharp
5c7af6bfc4 More tests. 79% code coverage + more docs
- Events documented
- Require working nicely
- If nodemon is required, nodemon message are emitted rather than console.log'ged
2013-12-14 00:57:41 +00:00
Remy Sharp
c7d18c01f9 Fix require test. Reset event state after complete 2013-12-12 12:46:43 +00:00
Remy Sharp
36e779d830 Testing required restart 2013-12-12 12:10:16 +00:00
Remy Sharp
ad0eba36aa Required nodemon, upon quit, correctly unwatches files 2013-12-12 11:44:59 +00:00
Remy Sharp
4f5593d439 Fix nodemon.config.required flag, and expose config
For when nodemon is required in to projects like grunt.
2013-12-11 16:17:26 +00:00
Remy Sharp
6877d57ba6 On exception, ask for issue to be filed 2013-12-10 13:39:27 +00:00
Remy Sharp
90f3bcd891 Test help 2013-12-05 09:45:53 +00:00
Remy Sharp
d092d71775 Ignore .git & node_modules/**/node_modules by default. Closes #230
Also linting, tests and cleaned up filename that's echoed triggering the change
2013-12-05 00:12:24 +00:00
Remy Sharp
ae184b73e6 Passing tests on linux 2013-12-04 12:45:47 +00:00
Remy Sharp
c503222f30 Refactoring.
* userScript => script
* simplified exec library
* removed dead code in config loading
* nodemon now knows when it's being required (and goes dark)
* etc...
2013-12-03 13:34:40 +00:00
Remy Sharp
d7c3647405 Using event bus for tests and requirable nodmeon
TODO: remove stdout inside tests
2013-11-25 01:04:52 +00:00
Remy Sharp
2909a17a8f First tests to ensure nodemon is actually restarting correctly 2013-11-14 14:09:14 +00:00
Remy Sharp
f6887c9f31 making main based off the module, not the "binary" 2013-11-12 20:13:50 +00:00