* 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
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.
`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. (:
* 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#1294Fixes#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.
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
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
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
* fix: pass through execArgs from config
Also updating some deps and linting tweaks
* chore: add message on postinstall
Lost funds from gratipay and codesponsor 😢
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
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.
* 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
Implement `--config <file>` option to allow config loading from an arbitrary file instead of being
bound to the static `$PWD/nodemon.json`.
Closes#755Closes#855
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.
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
Pass the `usePolling` flag to Chokidar when in legacy mode, which is supposed to/hopefully fix containers watching network attached drives.
Fixes#639Fixes#633