147 Commits

Author SHA1 Message Date
Remy Sharp
2967726673 fix: package.main with -- arguments (#1773)
* fix: package.main with -- arguments

Fixes #1758

The combination of using a package.main (which sets the script
position to index zero) and using the -- stop slurp meant that
the arguments had the script appended to the end instead of
prepended to the start. The net result meant that when the script
was forked, it would drop the first user arg.

See diff for details of the fix - a simple check against null.

* fix: protect against missing opts
2020-10-04 16:44:26 +01:00
Remy Sharp
33ae6dae33 test: fix failing test when required
I suspect, though not 100% sure, that this test fails because it was
being required and when so, chokidar is already watching and thus fires
before the config is loaded.
2020-04-08 17:55:50 +01:00
Aurélio A. Heckert
7d6c1a88a1 fix: Replace jade references by pug
close #1595
2019-10-15 19:27:50 -04:00
Leonardo Dino
64b474e9f3 feat: add TypeScript to default execPath (#1552)
`ts-node` is the standard for running typescript node programs on development mode.

Adding this line will enable everyone with a `tsconfig.json` to have a full-refresh server watching experience. (:
2019-05-01 08:04:44 +01:00
Victor Perez
f616258669 fix: {{filename}} is only replaced once 2018-05-05 20:17:54 +01:00
Remy Sharp
97f8d0a175 fix: node_modules watched off relative path (#1328)
* chore: bump chokidar to latest
* test: fix weird output on restart filename
* test: skip old broken test
* fix: node_modules watched off relative path

Fixes #1294
Fixes #1305 (though couldn't confirm - just looks very similar)

I've gone back and forth on this Chokidar option `cwd` and in this fix
I've removed it from the config. I've checked the issues that were
raised that caused me to add the option, and they still appear to pass
in the tests, so I believe it's okay.

However, it _might_ come back in - just a note for Future @remy.
2018-05-05 20:17:21 +01:00
Remy Sharp
9bbc219fd5 fix: only hook SIGINT on boot - not at require
Fixes #1326
2018-05-05 20:16:37 +01:00
Remy Sharp
89d6062c68 fix: prevent throw when args missing (#1288)
Fixes #1286
2018-03-13 21:46:20 +00:00
Remy Sharp
e41f3c3aad feat: feed args to exec when detecting script (#1273)
Fixes #1263

The way it works:

- If the script is detected via index.js from the directory, or from the
package, then all the arguments on the CLI are shifted to execArgs

- If there was a double-dash on the CLI args, then only those before the
double-dash are given to execArgs and the rest remain passed to the
script
2018-02-27 16:42:32 +00:00
Remy Sharp
5e88b04eaa feat: add support for --spawn (#1249)
* docs: add sponsors

[skip ci]

* feat: add support for `--spawn`

Fixes #1245

* docs: remove "simply"
2018-02-15 21:57:30 +00:00
Remy Sharp
c121187611 refactor: indexOf > includes (in node4) 2018-01-08 12:33:51 +00:00
Remy Sharp
718a9ad2e2 fix: correctly pass ignored rules to chokidar
Previous the rules weren't matching fully inside of chokidar, requiring
that, for instance, node_modules is written as **/node_modules/**.

I've also tidied up what's printed in verbose mode, so it doesn't print
default ignores, and doesn't print the full path of an ignored
directory.

This change _also_ fixes notifications from chokidar from user ignored
paths (using the `cwd` argument). This should fix #1202
2018-01-08 12:33:51 +00:00
Remy Sharp
2582d960be fix: clarify which config files are actually used
Fixes #1204
2018-01-06 09:35:16 +00:00
Remy Sharp
8cb26bfe25 refactor: small tweaks to ES6-ish 2018-01-06 09:35:16 +00:00
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
Remy Sharp
c63771726c fix: expose no update flag 2017-12-29 10:54:59 +00:00
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