Commit Graph

127 Commits

Author SHA1 Message Date
Remy Sharp
4589bc8a60 fix: properly ignore defaults, don't match partial
Changed to passing Chokidar simple strings instead of custom regexp, only had to prefix with **/ to get it to match the ignore directories properly.

Fixes #916
2017-12-20 23:21:35 +00:00
Dominykas Blyžė
009d868516 feat: support wildcard extension matching 2017-12-20 14:08:32 +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
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
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
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
Marc Trudel
2cd85b1f60 feat: add support for customisable signal 2016-10-06 19:52:41 +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
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
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
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
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
Remy Sharp
d98301d436 chore: Merge branch 'feature/legacy-polling-mode'
Conflicts:
	test/cli/parse.test.js
2015-09-19 10:43:08 +01:00
Remy Sharp
f4b12476e1 chore: Merge branch 'master' into feature/disable-colour 2015-09-19 10:29:08 +01:00
Remy Sharp
489f22dc93 fix: restore --legacy-watch
Pass the `usePolling` flag to Chokidar when in legacy mode, which is supposed to/hopefully fix containers watching network attached drives.

Fixes #639
Fixes #633
2015-09-19 08:20:39 +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
6e40e9adfd feat: support disabling colour output
via cli --no-color/--no-colour and via nodemon.json colours: false
2015-09-12 22:34:07 +01:00
Remy Sharp
15b0b88d0f feat: merge ignore rules with defaults
And allow the user to override the defaults from their config
2015-09-12 11:34:28 +01:00
Remy Sharp
7250919e6d fix: restore file count in verbose mode 2015-09-12 11:34:20 +01:00
Remy Sharp
438b8d7c0e refactor: passing jscs 2015-09-09 22:30:43 +01:00
Remy Sharp
7496f08330 fix: incorrectly exiting when required
test: updated travis tests
2015-09-09 22:29:26 +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
Remy Sharp
e177dd7865 Merge pull request #578 from khoomeister/ck-disable-startup
add option --no-startup to not run command on startup
2015-07-27 21:44:05 +01:00
Chris Khoo
50f5994ee6 change --no-startup to --on-change-only 2015-07-20 18:40:45 -07:00
Remy Sharp
4de7033898 Merge pull request #585 from halt-hammerzeit/fix_watch_interval
Fixes watch interval
2015-07-20 21:35:27 +01:00
Nikolay Kuchumov
8eefdd0d00 Fixes watch interval 2015-07-11 20:06:54 +03:00
Chris Khoo
db196733b7 add option --no-startup to not run command on startup 2015-07-05 16:19:11 -07:00
Matan Shukry
abd3e27a24 Added closeSync() to trigger watch 2015-06-13 20:14:57 +03:00
Doug Patti
56c4caf2ed pull command stringification into a utility
This was copied and pasted more than a handful of times around the
library and tests. Some implementations were more naive and did not
try to add quotes if there are spaces within a single argument.

There is one slight oddity in one of the cli parse tests. Stringifying
the command causes many of the arguments to show up in quotes when they
probably shouldn't. This seems to trace back to a deep problem related
to how commands are pulled out of package.scripts.start and is out of
scope for this patch. Even though the test might look incorrect now, it
is an accurate reflection of what the generated command is.
2015-04-22 13:42:55 -04: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
7e6fe7c945 Fixes #352
The find method wasn't known when it tries to add the directories to monitor. This change fixes that
2015-02-10 19:22:40 +00: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
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
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