43 Commits

Author SHA1 Message Date
Josef Brandl
d78bf3d5d1 fix: watch both js and mjs files if main file is JavaScript 2017-12-29 16:51:17 +00:00
Remy Sharp
de66c6bcea refactor: fix scoping issue in node@4 2017-12-29 10:55:12 +00:00
Remy Sharp
5a914cb35b fix: handle exit(2) better 2017-12-29 10:55:12 +00:00
Remy Sharp
6333fa5a4c chore: fix linting 2017-12-29 10:55:12 +00:00
Remy Sharp
6e839d4a33 fix: support implicit filename extension
Fixes #1193
2017-12-29 10:55:12 +00:00
Dominykas Blyžė
009d868516 feat: support wildcard extension matching 2017-12-20 14:08:32 +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
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
Jay Beavers
5a89df6471 fix: Support for .mjs es6 modules (#1138) 2017-12-04 14:55:16 +00:00
Marcus Noble
29a9a449d5 fix: Add support for multi-level filenames 2017-10-08 16:19:47 +01: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
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
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
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
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
5e07bfef85 fix: supporting env values in package.start
Before it was trying to parse the value in .start, when in fact, the entire value represents the `cmd`.

Fixes #621
Fixes #615
Fixes #577
Fixes #513
2015-09-12 22:51:02 +01:00
Remy Sharp
b0fd56f7de refactor: move watch out in favour of chokidar
Plus jscs clean ups
2015-08-31 18:25:55 +01:00
Doug Patti
a71db72ece when running a coffee file, use --nodejs correctly
Previously, the --nodejs flag was being prepended if you had any
arguments prefixed with '--', even if they were intended for your
application. There is an additional problem where arguments intended for
node js need to be grouped into a single argument passed after --nodejs.

After this patch, any flag before your script is considered a nodejs
argument. These, along with any other exec arguments are bundled into a
single argument separated by spaces.

Fixes #530
2015-04-22 13:42:52 -04:00
Remy Sharp
d796e41120 Remove the need for execArgs when user specifying an exec
- Also update tests to check end value, not individual parts
- Simplify tests to check actual output, rather than the pieces that make the output
- Remove redundant code: such a shame, it was cool code, but I'd rather remove it for simplicity and better support. Woot.
2015-02-01 15:59:49 +00:00
Remy Sharp
afc646f026 Fixed #474
Support spaces in exec - the user must escape using the ^ character as per http://superuser.com/a/279121
2015-01-28 13:27:21 +00:00
Remy Sharp
ce0b5bc9cc Only discover exec from package if no script
Full tests need to run to work out if this is okay to merge, but the logic is that we only go to the package.json for an executable IIF there's no script. If there's a script, then we shouldn't need to discover anything and we'll let the logic fall through the usual path (and usually default to node).
2015-01-20 14:13:25 +00:00
Remy Sharp
9651ab88b0 Escape exec *args* only if space
This matches npm's functionality. It's also been tested against the "some\"file" test, etc. It's hard too...and late.
2015-01-14 22:45:45 +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
b905ffae7d Fixed #448 - but failing other tests WIP
[skip ci]

Currently failing tests around handling of spaces in exec arguments.
2015-01-01 21:39:10 +00:00
Remy Sharp
ee35ef8347 Fixed exec parser
It was losing quotes around arguments, and in fact only needs to capture the first element in the string as the exec, and the rest could be left as is (if I keep the `sh` method of execution).
2015-01-01 20:50:59 +00:00
Remy Sharp
8e3ba1c662 Fixed string interpolation with array exec 2014-12-09 12:24:50 +00:00
Remy Sharp
30a0603744 nodemon api support array for exec + tests 2014-12-09 11:25:37 +00:00
Remy Sharp
acf4d61c79 Correctly parse exec when there's spaces
Closes #418
Closes #419

This version will handle quoted entities in the exec string or escaped spaces correctly, so the user can run:

--exec '"/bin/my cool app" {{filename}}'

Or

--exec '/bin/my\ cool\ app {{filename}}'

This will work both on the command line and from the API.
2014-12-08 09:16:16 +00:00
Remy Sharp
6adea0e893 Tests to show failing support 2014-12-08 08:31:47 +00:00
Remy Sharp
66e71d6b64 Fixes #383
Ensure we look at the package last, after reading cli options and user prefs via nodemon.json
2014-12-05 22:52:06 +00:00
Remy Sharp
7901854408 Ensure *nix kills entire process tree.
Fixes #333 and fixes #335. Amazingly Windows support always had the full process tree being killed, but this solves it for mac and linux now. My only grip is we have a new dependancy for the project, but I don't really think that's such a big deal.
2014-05-12 22:41:26 +01: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
f636bc16f5 execMap uses script ext to lookup. Fixes #265
+ tests
2014-01-16 22:52:39 +00:00
Remy Sharp
7d4c8c14bc cli takes priority over execMap 2014-01-15 14:14:31 +00:00
Remy Sharp
483e70283e Pass non-nodemon args *in order* to exec. Fixes #263 2014-01-15 14:11:56 +00:00
Remy Sharp
bfc4ac1c4d Required nodemon accepts env to pass to spawned process
See https://github.com/ChrisWren/grunt-nodemon/pull/29 for example/request
2014-01-15 14:07:36 +00:00
Remy Sharp
08c758f884 Rule matching tested and passing 2014-01-05 00:45:38 +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
30a4a192f5 Docs and 1.0.0 release. Whoop whoop! 2013-12-29 22:50:02 +00:00
Remy Sharp
999f87eeda Support for execMap #195 and tests 2013-12-10 13:29:35 +00:00
Remy Sharp
9853e089b4 Fixed #118 plus a bunch of jshint fixes 2013-12-04 12:31:37 +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