Commit Graph

321 Commits

Author SHA1 Message Date
Martin Dimitrov
10ded94cd7 fix: fixed an issue where we tried to resolve null as path 2017-12-15 14:14:17 +00:00
Remy Sharp
f8a5abe258 feat: watch script regardless of extension
Fixes the issue where express is a js based project, but the executable
is `www`, so it misses on the match. So now nodemon will watch for
matching extensions but *also* the script the user gave.

Fixes #461

Note that this can't handle the situation where npm is used to run `node
./bin/www` as nodemon can't split out a package script command.
2017-12-15 08:46:11 +00:00
Remy Sharp
30f999a06c feat: support SIGHUP to restart nodemon
Also small linting tweaks and typos in comments.

Fixes #393
2017-12-15 08:46:01 +00:00
Remy Sharp
a282afbbe3 fix: support nodemon index to expand to index.js
With support for custom extensions (picking only the first).

Fixes #1165
2017-12-15 08:45:49 +00:00
Remy Sharp
fd961d6053 fix: defensive check on accessing cmd.args 2017-12-13 22:17:13 +00:00
Remy Sharp
fa64cdcc8a docs: reduce CLI output and add --help options
Also restore missing -L CLI options.

Fixes #1160
2017-12-13 21:55:13 +00:00
Remy Sharp
d9e93ad367 fix: support node arguments again
If node is being passed any arguments (before the script) then use
spawn instead of fork.

Fixes #1161
2017-12-13 21:08:33 +00:00
Remy Sharp
f52615c0f7 fix: only use fork if node>4 2017-12-13 13:08:05 +00:00
Timothy Huang
cf923a8a77 fix: get tests to pass 2017-12-06 14:45:17 -08:00
Tim
f711fb7889 test: fork child node processes 2017-12-06 14:45:10 -08:00
Remy Sharp
6a4fb22602 fix: pass through execArgs from config (#1142)
* fix: pass through execArgs from config

Also updating some deps and linting tweaks

* chore: add message on postinstall

Lost funds from gratipay and codesponsor 😢
2017-12-05 18:01:55 +00:00
Remy Sharp
24a4b84717 feat: disable chokidar globbing on windows (#1140)
Fixes a range of issues, including:

Fixes #1115

* refactor: use Object.assign in place of merge (this will leak to more work)

Since we're now supporting 6 upwards
2017-12-04 20:05:58 +00:00
Remy Sharp
6d57dac0ee fix: bump deps and fix tests for local dev (#1139)
Upgraded tests for node 8
2017-12-04 14:56:44 +00:00
Jay Beavers
5a89df6471 fix: Support for .mjs es6 modules (#1138) 2017-12-04 14:55:16 +00:00
Leonard Martin
f3e0c29f15 fix: read config file before defaulting script parameter (#1110)
If I have a nodemon.json config file with an `exec` property, then this is automatically appended with ` index.js` when running `nodemon` standalone.

I would expect this to be equivalent to running `nodemon --exec "my cmd"` - that is providing an `exec` prevents defaulting of `script` to index.js.

To resolve, move the code which defaults the `script` property when `exec` is undefined to after the config files have been read, so that the behaviour is the same irrespective of whether properties are set in CLI flags or in nodemon.json.
2017-12-04 14:52:23 +00:00
Marcus Noble
29a9a449d5 fix: Add support for multi-level filenames 2017-10-08 16:19:47 +01:00
GerA
469fa80aa7 fix: crash when passing argument to node (windows)
Fixes #1095
2017-09-15 07:40:25 +01:00
Remy Sharp
32aed42f7f chore: linting errors 2017-09-04 20:35:56 +01:00
Steven Patrick
0e4b310c1c Fix: nodemon can't read config files encoded with BOM e.g. UTF-8-BOM #1031 2017-09-04 20:26:28 +01:00
Rich Hodgkins
fb5da380c8 feat: nodemonConfig support in package.json
* feat: support using ‘nodemonConfig’ in package.json

Implements loading configuration options from the `nodemonConfig` value in the package.json, nodemon.json is still preferred before looking at the new option.
Also includes tests.

Closes #873

* docs: update for using ‘nodemonConfig’ in package.json

Add to both the README and `nodemon --help config`.

#1028
2017-09-04 20:26:17 +01:00
Matt Lyons
63e8606748 fix: exit when fail to parse the config file (#921)
Fixes #651
2017-09-04 20:22:21 +01:00
Brian Dentino
facc8cb2c7 fix: exit with code 1 on crash if --exitcrash (#946)
I'm using nodemon in a docker container with a restart policy configured to restart the container in case it crashes. If the app crashes, nodemon exits with code 0 and docker assumes it was a graceful exit, so it does not restart my container. I don't see the harm in changing the exit code here to reflect an unexpected termination, given that this path is only exercised in the event of a crash.
2017-09-04 20:16:40 +01:00
Attila Hajdrik
481dc8f8ef fix: executable path handling under windows (#962)
- If the user configured a *nix compatible npm script where the path contained a forward slash, that failed under windows, since cmd.exe treated that as a command line argument.
- The quote handling was not 100% correct under windows, the whole path needs to be quoted, not just the segments it is also modified.
2017-09-04 19:47:52 +01:00
Tim Kang
3c352f2f27 fix: support signal on CLI (#1061) 2017-09-04 19:41:35 +01:00
Garth Kidd
abc138f570 fix: help truncation on node 6.2 (#842) (#843) 2017-09-04 19:36:06 +01:00
mike
4c81e9aa52 fix: catch module.parent.filename === undefined (#1053)
It happened with electron.js. Maybe some wrapper module has a native nature
2017-09-04 19:27:34 +01:00
Marc Trudel
2cd85b1f60 feat: add support for customisable signal 2016-10-06 19:52:41 +01:00
Remy Sharp
be5d4e8d13 fix: revert 'inherit' on stdin
Fixes #894
Fixes #895

I'll have to continue investigation as to how we deal with spawned clients setting raw on stdin. Will break #890 and https://github.com/FormidableLabs/webpack-dashboard/issues/16
2016-08-18 22:04:42 +01:00
Remy Sharp
58a236e0ce fix: use stdin=inhert on vanilla run
* fix: non-utf8 stdin processing
Fixes #890
Ref https://github.com/FormidableLabs/webpack-dashboard/issues/16

The library blessed inside of the webpack-dashboard does some funky stuff with std streams and the expectation of the encoding. I'm not 100% sure of this change, I've got to see all the tests, but this tweak moves to inherit the child's stdin and doesn't purposely encode the stdin stream as utf8 (which, I don't recall exactly why I did this in the first place…though I'm fairly sure it was another issue somewhere else in nodemon).
* fix: use stdin:inherit when we're not forked
* fix: don't use inherit when required
* style: lint
* style: I am going to 🐎 kick the lint in the 🌰
2016-08-18 15:54:39 +01:00
Kyle Smith
ee110add53 feat: support --config command line arg
Implement `--config <file>` option to allow config loading from an arbitrary file instead of being
bound to the static `$PWD/nodemon.json`.

Closes #755 
Closes #855
2016-07-25 22:01:45 +01:00
Nicolas Chambrier
bded0ac549 fix(stdin): don't watch for 'rs' when --no-stdin is provided 2016-04-10 00:16:21 +02:00
Mark Wubben
6ccb29864c refactor: get default ignoreRoot from ignore-by-default
Switches the default ignoreRoot to a list obtained from the ignore-by-default
package. See <https://github.com/novemberborn/ignore-by-default>.

This allows nodemon to tap into a shared list of directories it should ignore
when watching for changes. E.g. compared to the original list it's already been
extended with `.nyc_output` and `coverage` directories.
2016-02-25 21:08:44 +00:00
Mark Wubben
7152585fa2 fix: don't concatenate ignore regexes
The initial `ignored` may be undefined. If it isn't then a pipe character should
be inserted. This is all unnecessary though if we build up an array like before
4826c87744.
2016-02-25 21:08:44 +00:00
Remy Sharp
b95469aeb4 test: check non-english chrs don't blow up 2016-02-25 11:14:27 +00:00
Lewis Cowper
1addfea880 fix: update regex to include unicode extensions -- no tests yet cc: @remy 2016-02-25 11:35:13 +01:00
Danny Raetzsch
fc2bc168b0 feat: support --polling-interval command line arg 2015-11-09 20:34:43 -06:00
Bence Dányi
3480f37aab fix: watch js, json files by default
In node the file extension is optional, so by default nodemon should watch
js and json files.

Closes #710
2015-10-29 20:03:43 +01:00
Remy Sharp
3b44f669ff chore: merge
Merge branch 'patch-2' of https://github.com/pensierinmusica/nodemon into pensierinmusica-patch-2
2015-10-25 07:12:35 +00:00
Remy Sharp
68cbf47d6a chore: merge branch
Merge branch 'fix-watch-init-restarts' of https://github.com/faergeek/nodemon into faergeek-fix-watch-init-restarts
2015-10-25 07:12:02 +00:00
Sergey Slipchenko
7e7dc0402e Save readiness state on a per-watcher basis 2015-10-22 22:24:06 +03:00
Matt Lyons
f62c0d55ee refactor: remove deprecated util.error
Replace with console.error
Replace util.log with console.log to be consistent with _log
2015-10-21 23:34:39 -07:00
Alessandro Zanardi
4c195df510 fix: JSON extension not watched when "scriptExt" is defined
Fix a bug that caused ".json" files to not be watched by default.

closes #643
2015-10-20 15:38:50 +02:00
Remy Sharp
e6708d220c Merge pull request #693 from pensierinmusica/patch-1
fix: JSON extension not watched outside of coffeescript
2015-10-20 06:55:25 +01:00
Alessandro Zanardi
ceb1515ec0 fix: JSON extension not watched outside of coffeescript
Fix a bug that caused `.json` file to not be watched outside of a coffeescript environment,
and improves the extension formatting regex.

Closes #643
2015-10-19 19:17:49 +02:00
Remy Sharp
2f19ffb5a7 fix: restart on new files added to watched dir
Fixes #664

Also includes tests and quietens the force crash test (though unchanged).
2015-10-19 12:34:38 +01:00
Remy Sharp
931d50050d fix: rs to restart
Always unhook the process.stdin when the child has exited, this allows the `rs` command to be read - otherwise it's ignored.

Fixes #648
2015-09-23 08:34:38 +01:00
Remy Sharp
725a409c69 refactor: allow dev use of nodemon to show githash
Rather than an arbitrary version string - this will only happen when cloned from git, rather than an npm install. This is entirely for debugging.
2015-09-21 14:24:39 +01:00
Alessandro Zanardi
cd4201afa6 feat: add JSON to default watched extensions
Since in a server environment JSON files often contain settings,
nodemon should restart by default when the content of a JSON file is changed.

Closes #643
2015-09-21 11:25:17 +01:00
Remy Sharp
6a5397e166 fix: allows user to not watch
Fixes #516
2015-09-21 11:24:16 +01:00
Remy Sharp
8af4b4bc81 fix: make control over ignoreRoot easier
And add documentation and tests
2015-09-21 10:23:19 +01:00