diff options
Diffstat (limited to 'node_modules/nodemon')
45 files changed, 0 insertions, 3794 deletions
diff --git a/node_modules/nodemon/.eslintrc.json b/node_modules/nodemon/.eslintrc.json deleted file mode 100644 index 4fe6572..0000000 --- a/node_modules/nodemon/.eslintrc.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "env": { - "browser": true, - "commonjs": true, - "es2021": true - }, - "parserOptions": { - "ecmaVersion": 12 - }, - "rules": { - "space-before-function-paren": [ - 2, - { - "anonymous": "ignore", - "named": "never" - } - ] - } -} diff --git a/node_modules/nodemon/.jshintrc b/node_modules/nodemon/.jshintrc deleted file mode 100644 index fb991ae..0000000 --- a/node_modules/nodemon/.jshintrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "browser": true, - "camelcase": true, - "curly": true, - "devel": true, - "eqeqeq": true, - "forin": true, - "indent": 2, - "noarg": true, - "node": true, - "quotmark": "single", - "undef": true, - "strict": false, - "unused": true -} - diff --git a/node_modules/nodemon/.releaserc b/node_modules/nodemon/.releaserc deleted file mode 100644 index 0a563ee..0000000 --- a/node_modules/nodemon/.releaserc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "branches": ["main"] -} diff --git a/node_modules/nodemon/.travis.yml b/node_modules/nodemon/.travis.yml deleted file mode 100644 index 8057e91..0000000 --- a/node_modules/nodemon/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: node_js -cache: - directories: - - ~/.npm -notifications: - email: false -node_js: - - '14' - - '12' - - '10' -before_install: - - if [ "$TRAVIS_PULL_REQUEST_BRANCH" == "" ]; then echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> .npmrc; fi -after_success: - - npm run semantic-release -branches: - except: - - /^v\d+\.\d+\.\d+$/ diff --git a/node_modules/nodemon/LICENSE b/node_modules/nodemon/LICENSE deleted file mode 100644 index 19c91a2..0000000 --- a/node_modules/nodemon/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2010 - present, Remy Sharp, https://remysharp.com <remy@remysharp.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/node_modules/nodemon/README.md b/node_modules/nodemon/README.md deleted file mode 100644 index 9c46f93..0000000 --- a/node_modules/nodemon/README.md +++ /dev/null @@ -1,379 +0,0 @@ -<p align="center"> - <img src="https://user-images.githubusercontent.com/13700/35731649-652807e8-080e-11e8-88fd-1b2f6d553b2d.png" alt="Nodemon Logo"> -</p> - -# nodemon - -nodemon is a tool that helps develop node.js based applications by automatically restarting the node application when file changes in the directory are detected. - -nodemon does **not** require *any* additional changes to your code or method of development. nodemon is a replacement wrapper for `node`. To use `nodemon`, replace the word `node` on the command line when executing your script. - -[![NPM version](https://badge.fury.io/js/nodemon.svg)](https://npmjs.org/package/nodemon) -[![Travis Status](https://travis-ci.org/remy/nodemon.svg?branch=master)](https://travis-ci.org/remy/nodemon) [![Backers on Open Collective](https://opencollective.com/nodemon/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/nodemon/sponsors/badge.svg)](#sponsors) - -# Installation - -Either through cloning with git or by using [npm](http://npmjs.org) (the recommended way): - -```bash -npm install -g nodemon # or using yarn: yarn global add nodemon -``` - -And nodemon will be installed globally to your system path. - -You can also install nodemon as a development dependency: - -```bash -npm install --save-dev nodemon # or using yarn: yarn add nodemon -D -``` - -With a local installation, nodemon will not be available in your system path or you can't use it directly from the command line. Instead, the local installation of nodemon can be run by calling it from within an npm script (such as `npm start`) or using `npx nodemon`. - -# Usage - -nodemon wraps your application, so you can pass all the arguments you would normally pass to your app: - -```bash -nodemon [your node app] -``` - -For CLI options, use the `-h` (or `--help`) argument: - -```bash -nodemon -h -``` - -Using nodemon is simple, if my application accepted a host and port as the arguments, I would start it as so: - -```bash -nodemon ./server.js localhost 8080 -``` - -Any output from this script is prefixed with `[nodemon]`, otherwise all output from your application, errors included, will be echoed out as expected. - -You can also pass the `inspect` flag to node through the command line as you would normally: - -```bash -nodemon --inspect ./server.js 80 -``` - -If you have a `package.json` file for your app, you can omit the main script entirely and nodemon will read the `package.json` for the `main` property and use that value as the app ([ref](https://github.com/remy/nodemon/issues/14)). - -nodemon will also search for the `scripts.start` property in `package.json` (as of nodemon 1.1.x). - -Also check out the [FAQ](https://github.com/remy/nodemon/blob/master/faq.md) or [issues](https://github.com/remy/nodemon/issues) for nodemon. - -## Automatic re-running - -nodemon was originally written to restart hanging processes such as web servers, but now supports apps that cleanly exit. If your script exits cleanly, nodemon will continue to monitor the directory (or directories) and restart the script if there are any changes. - -## Manual restarting - -Whilst nodemon is running, if you need to manually restart your application, instead of stopping and restart nodemon, you can type `rs` with a carriage return, and nodemon will restart your process. - -## Config files - -nodemon supports local and global configuration files. These are usually named `nodemon.json` and can be located in the current working directory or in your home directory. An alternative local configuration file can be specified with the `--config <file>` option. - -The specificity is as follows, so that a command line argument will always override the config file settings: - -- command line arguments -- local config -- global config - -A config file can take any of the command line arguments as JSON key values, for example: - -```json -{ - "verbose": true, - "ignore": ["*.test.js", "fixtures/*"], - "execMap": { - "rb": "ruby", - "pde": "processing --sketch={{pwd}} --run" - } -} -``` - -The above `nodemon.json` file might be my global config so that I have support for ruby files and processing files, and I can run `nodemon demo.pde` and nodemon will automatically know how to run the script even though out of the box support for processing scripts. - -A further example of options can be seen in [sample-nodemon.md](https://github.com/remy/nodemon/blob/master/doc/sample-nodemon.md) - -### package.json - -If you want to keep all your package configurations in one place, nodemon supports using `package.json` for configuration. -Specify the config in the same format as you would for a config file but under `nodemonConfig` in the `package.json` file, for example, take the following `package.json`: - -```json -{ - "name": "nodemon", - "homepage": "http://nodemon.io", - "...": "... other standard package.json values", - "nodemonConfig": { - "ignore": ["test/*", "docs/*"], - "delay": 2500 - } -} -``` - -Note that if you specify a `--config` file or provide a local `nodemon.json` any `package.json` config is ignored. - -*This section needs better documentation, but for now you can also see `nodemon --help config` ([also here](https://github.com/remy/nodemon/blob/master/doc/cli/config.txt))*. - -## Using nodemon as a module - -Please see [doc/requireable.md](doc/requireable.md) - -## Using nodemon as child process - -Please see [doc/events.md](doc/events.md#Using_nodemon_as_child_process) - -## Running non-node scripts - -nodemon can also be used to execute and monitor other programs. nodemon will read the file extension of the script being run and monitor that extension instead of `.js` if there's no `nodemon.json`: - -```bash -nodemon --exec "python -v" ./app.py -``` - -Now nodemon will run `app.py` with python in verbose mode (note that if you're not passing args to the exec program, you don't need the quotes), and look for new or modified files with the `.py` extension. - -### Default executables - -Using the `nodemon.json` config file, you can define your own default executables using the `execMap` property. This is particularly useful if you're working with a language that isn't supported by default by nodemon. - -To add support for nodemon to know about the `.pl` extension (for Perl), the `nodemon.json` file would add: - -```json -{ - "execMap": { - "pl": "perl" - } -} -``` - -Now running the following, nodemon will know to use `perl` as the executable: - -```bash -nodemon script.pl -``` - -It's generally recommended to use the global `nodemon.json` to add your own `execMap` options. However, if there's a common default that's missing, this can be merged in to the project so that nodemon supports it by default, by changing [default.js](https://github.com/remy/nodemon/blob/master/lib/config/defaults.js) and sending a pull request. - -## Monitoring multiple directories - -By default nodemon monitors the current working directory. If you want to take control of that option, use the `--watch` option to add specific paths: - -```bash -nodemon --watch app --watch libs app/server.js -``` - -Now nodemon will only restart if there are changes in the `./app` or `./libs` directory. By default nodemon will traverse sub-directories, so there's no need in explicitly including sub-directories. - -Don't use unix globbing to pass multiple directories, e.g `--watch ./lib/*`, it won't work. You need a `--watch` flag per directory watched. - -## Specifying extension watch list - -By default, nodemon looks for files with the `.js`, `.mjs`, `.coffee`, `.litcoffee`, and `.json` extensions. If you use the `--exec` option and monitor `app.py` nodemon will monitor files with the extension of `.py`. However, you can specify your own list with the `-e` (or `--ext`) switch like so: - -```bash -nodemon -e js,pug -``` - -Now nodemon will restart on any changes to files in the directory (or subdirectories) with the extensions `.js`, `.pug`. - -## Ignoring files - -By default, nodemon will only restart when a `.js` JavaScript file changes. In some cases you will want to ignore some specific files, directories or file patterns, to prevent nodemon from prematurely restarting your application. - -This can be done via the command line: - -```bash -nodemon --ignore lib/ --ignore tests/ -``` - -Or specific files can be ignored: - -```bash -nodemon --ignore lib/app.js -``` - -Patterns can also be ignored (but be sure to quote the arguments): - -```bash -nodemon --ignore 'lib/*.js' -``` - -Note that by default, nodemon will ignore the `.git`, `node_modules`, `bower_components`, `.nyc_output`, `coverage` and `.sass-cache` directories and *add* your ignored patterns to the list. If you want to indeed watch a directory like `node_modules`, you need to [override the underlying default ignore rules](https://github.com/remy/nodemon/blob/master/faq.md#overriding-the-underlying-default-ignore-rules). - -## Application isn't restarting - -In some networked environments (such as a container running nodemon reading across a mounted drive), you will need to use the `legacyWatch: true` which enables Chokidar's polling. - -Via the CLI, use either `--legacy-watch` or `-L` for short: - -```bash -nodemon -L -``` - -Though this should be a last resort as it will poll every file it can find. - -## Delaying restarting - -In some situations, you may want to wait until a number of files have changed. The timeout before checking for new file changes is 1 second. If you're uploading a number of files and it's taking some number of seconds, this could cause your app to restart multiple times unnecessarily. - -To add an extra throttle, or delay restarting, use the `--delay` command: - -```bash -nodemon --delay 10 server.js -``` - -For more precision, milliseconds can be specified. Either as a float: - -```bash -nodemon --delay 2.5 server.js -``` - -Or using the time specifier (ms): - -```bash -nodemon --delay 2500ms server.js -``` - -The delay figure is number of seconds (or milliseconds, if specified) to delay before restarting. So nodemon will only restart your app the given number of seconds after the *last* file change. - -If you are setting this value in `nodemon.json`, the value will always be interpreted in milliseconds. E.g., the following are equivalent: - -```bash -nodemon --delay 2.5 - -{ - "delay": 2500 -} -``` - -## Gracefully reloading down your script - -It is possible to have nodemon send any signal that you specify to your application. - -```bash -nodemon --signal SIGHUP server.js -``` - -Your application can handle the signal as follows. - -```js -process.once("SIGHUP", function () { - reloadSomeConfiguration(); -}) -``` - -Please note that nodemon will send this signal to every process in the process tree. - -If you are using `cluster`, then each workers (as well as the master) will receive the signal. If you wish to terminate all workers on receiving a `SIGHUP`, a common pattern is to catch the `SIGHUP` in the master, and forward `SIGTERM` to all workers, while ensuring that all workers ignore `SIGHUP`. - -```js -if (cluster.isMaster) { - process.on("SIGHUP", function () { - for (const worker of Object.values(cluster.workers)) { - worker.process.kill("SIGTERM"); - } - }); -} else { - process.on("SIGHUP", function() {}) -} -``` - -## Controlling shutdown of your script - -nodemon sends a kill signal to your application when it sees a file update. If you need to clean up on shutdown inside your script you can capture the kill signal and handle it yourself. - -The following example will listen once for the `SIGUSR2` signal (used by nodemon to restart), run the clean up process and then kill itself for nodemon to continue control: - -```js -process.once('SIGUSR2', function () { - gracefulShutdown(function () { - process.kill(process.pid, 'SIGUSR2'); - }); -}); -``` - -Note that the `process.kill` is *only* called once your shutdown jobs are complete. Hat tip to [Benjie Gillam](http://www.benjiegillam.com/2011/08/node-js-clean-restart-and-faster-development-with-nodemon/) for writing this technique up. - -## Triggering events when nodemon state changes - -If you want growl like notifications when nodemon restarts or to trigger an action when an event happens, then you can either `require` nodemon or add event actions to your `nodemon.json` file. - -For example, to trigger a notification on a Mac when nodemon restarts, `nodemon.json` looks like this: - -```json -{ - "events": { - "restart": "osascript -e 'display notification \"app restarted\" with title \"nodemon\"'" - } -} -``` - -A full list of available events is listed on the [event states wiki](https://github.com/remy/nodemon/wiki/Events#states). Note that you can bind to both states and messages. - -## Pipe output to somewhere else - -```js -nodemon({ - script: ..., - stdout: false // important: this tells nodemon not to output to console -}).on('readable', function() { // the `readable` event indicates that data is ready to pick up - this.stdout.pipe(fs.createWriteStream('output.txt')); - this.stderr.pipe(fs.createWriteStream('err.txt')); -}); -``` - -## Using nodemon in your gulp workflow - -Check out the [gulp-nodemon](https://github.com/JacksonGariety/gulp-nodemon) plugin to integrate nodemon with the rest of your project's gulp workflow. - -## Using nodemon in your Grunt workflow - -Check out the [grunt-nodemon](https://github.com/ChrisWren/grunt-nodemon) plugin to integrate nodemon with the rest of your project's grunt workflow. - -## Pronunciation - -> nodemon, is it pronounced: node-mon, no-demon or node-e-mon (like pokémon)? - -Well...I've been asked this many times before. I like that I've been asked this before. There's been bets as to which one it actually is. - -The answer is simple, but possibly frustrating. I'm not saying (how I pronounce it). It's up to you to call it as you like. All answers are correct :) - -## Design principles - -- Fewer flags is better -- Works across all platforms -- Fewer features -- Let individuals build on top of nodemon -- Offer all CLI functionality as an API -- Contributions must have and pass tests - -Nodemon is not perfect, and CLI arguments has sprawled beyond where I'm completely happy, but perhaps it can be reduced a little one day. - -## FAQ - -See the [FAQ](https://github.com/remy/nodemon/blob/master/faq.md) and please add your own questions if you think they would help others. - -## Backers - -Thank you to all [our backers](https://opencollective.com/nodemon#backer)! 🙏 - -[![nodemon backers](https://opencollective.com/nodemon/backers.svg?width=890)](https://opencollective.com/nodemon#backers) - -## Sponsors - -Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Sponsor this project today ❤️](https://opencollective.com/nodemon#sponsor) - -<!-- generated with https://jqterm.com/8d123effeb793313c2a0ad559adbc6a4?query=def%20getImage%3A%0A%09.%20as%20%24_%20%7C%0A%09%7B%20%0A%20%20%20%20%20%20%22206432%22%3A%20%22https%3A%2F%2Fuser-images.githubusercontent.com%2F13700%2F127474039-8ba5ac8c-2095-4984-9309-54ff15e95340.png%22%2C%0A%09%20%20%22215800%22%3A%20%22https%3A%2F%2Fimages.opencollective.com%2Faussielowdepositcasino%2Fd85338f%2Flogo%2F256.png%22%20%0A%20%20%20%20%7D%20%7C%20%28.%5B%22%5C%28%24_.MemberId%29%22%5D%20%2F%2F%20%24_.image%29%0A%3B%0A%0Adef%20tohtml%3A%0A%09%22%3Ca%20href%3D%27%5C%28.website%29%27%3E%3Cimg%20src%3D%27%5C%28.%20%7C%20getImage%29%27%20style%3D%27object-fit%3A%20contain%3B%20float%3A%20left%3B%20margin%3A12px%27%20height%3D%27120%27%20width%3D%27120%27%3E%3C%2Fa%3E%22%0A%3B%0A%0Asort_by%28.createdAt%29%20%7C%20map%28select%28.isActive%20%3D%3D%20true%20and%20.image%29%20%7C%20tohtml%29%20%7C%20join%28%22%22%29&raw=true --> -<div style="overflow: hidden; margin-bottom: 80px;"> -<a href='https://www.topratedcasinosites.co.uk/'><img src='https://opencollective-production.s3.us-west-1.amazonaws.com/2c1d1cb0-623b-11eb-a737-2bef0291120b.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://najlepsibukmacherzy.pl/ranking-legalnych-bukmacherow/'><img src='https://opencollective-production.s3.us-west-1.amazonaws.com/52acecf0-608a-11eb-b17f-5bca7c67fe7b.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://topaussiecasinos.com/'><img src='https://opencollective-production.s3.us-west-1.amazonaws.com/89ea5890-6d1c-11ea-9dd9-330b3b2faf8b.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://netticasinohex.com/'><img src='https://opencollective-production.s3.us-west-1.amazonaws.com/b802aa50-7b1a-11ea-bcaf-0dc68ad9bc17.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://kasynohex.com/'><img src='https://opencollective-production.s3.us-west-1.amazonaws.com/2bb0d6e0-99c8-11ea-9349-199aa0d5d24a.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://hollandsegokken.nl/'><img src='https://opencollective-production.s3.us-west-1.amazonaws.com/3af13c90-8b43-11eb-9237-593e900cd7df.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://www.casinoonlineaams.com'><img src='https://opencollective-production.s3.us-west-1.amazonaws.com/a0694620-b88f-11eb-b3a4-b97529e4b911.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://slotokingua.com'><img src='https://opencollective-production.s3.us-west-1.amazonaws.com/3c173eb0-96b7-11eb-84a7-571f6970ac83.jpg' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://gamblizardcanada.com/free-spins/'><img src='https://logo.clearbit.com/gamblizardcanada.com' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://anbefaltcasino.com/'><img src='https://opencollective-production.s3.us-west-1.amazonaws.com/9d50eb20-eb92-11ea-bffe-c532c6ce425f.jpg' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://www.bitcoinbuster.com/'><img src='https://logo.clearbit.com/bitcoinbuster.com' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://casinosters.com/minimum-deposit-casinos/'><img src='https://user-images.githubusercontent.com/13700/127474039-8ba5ac8c-2095-4984-9309-54ff15e95340.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://www.casinotopp.net/sv/'><img src='https://logo.clearbit.com/casinotopp.net' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://www.casinoutanlicens.io/'><img src='https://opencollective-production.s3.us-west-1.amazonaws.com/52f13c30-0d78-11eb-88e4-510439e2a88d.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://casinowhizz.com'><img src='https://opencollective-production.s3.us-west-1.amazonaws.com/23256a80-f5c1-11eb-99f7-fbf8e4d6c6be.jpg' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://aussielowdepositcasino.com/'><img src='https://images.opencollective.com/aussielowdepositcasino/d85338f/logo/256.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://www.casinot.net'><img src='https://opencollective-production.s3.us-west-1.amazonaws.com/73b4fc10-7591-11ea-a1d4-01a20d893b4f.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://www.parhaatkasinot.com'><img src='https://opencollective-production.s3.us-west-1.amazonaws.com/4dfc1820-b6ee-11ea-9fa9-e39f53823609.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://www.cryptosnacks.org/bitcoin-casino/'><img src='https://opencollective-production.s3.us-west-1.amazonaws.com/db217a90-122f-11ec-81e8-594bc2daa9dc.png' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://www.kasinot.fi'><img src='https://logo.clearbit.com/www.kasinot.fi' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://betomania.pl/ranking-bukmacherow/'><img src='https://logo.clearbit.com/betomania.pl' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a><a href='https://www.targetedwebtraffic.com'><img src='https://logo.clearbit.com/targetedwebtraffic.com' style='object-fit: contain; float: left; margin:12px' height='120' width='120'></a> - -</div> - -# License - -MIT [http://rem.mit-license.org](http://rem.mit-license.org) diff --git a/node_modules/nodemon/bin/nodemon.js b/node_modules/nodemon/bin/nodemon.js deleted file mode 100755 index 31aff34..0000000 --- a/node_modules/nodemon/bin/nodemon.js +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env node - -const cli = require('../lib/cli'); -const nodemon = require('../lib/'); -const options = cli.parse(process.argv); - -nodemon(options); - -const fs = require('fs'); - -// checks for available update and returns an instance -const pkg = JSON.parse(fs.readFileSync(__dirname + '/../package.json')); - -if (pkg.version.indexOf('0.0.0') !== 0 && options.noUpdateNotifier !== true) { - require('update-notifier')({ pkg }).notify(); -} diff --git a/node_modules/nodemon/bin/postinstall.js b/node_modules/nodemon/bin/postinstall.js deleted file mode 100755 index 34c8194..0000000 --- a/node_modules/nodemon/bin/postinstall.js +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env node - -function main() { - if (process.env.SUPPRESS_SUPPORT || process.env.OPENCOLLECTIVE_HIDE || process.env.CI) { - return; - } - - const message = '\u001b[32mLove nodemon? You can now support the project via the open collective:\u001b[22m\u001b[39m\n > \u001b[96m\u001b[1mhttps://opencollective.com/nodemon/donate\u001b[0m\n'; - - try { - const Configstore = require('configstore'); - const pkg = require(__dirname + '/../package.json'); - const now = Date.now(); - - var week = 1000 * 60 * 60 * 24 * 7; - - // create a Configstore instance with an unique ID e.g. - // Package name and optionally some default values - const conf = new Configstore(pkg.name); - const last = conf.get('lastCheck'); - - if (!last || now - week > last) { - console.log(message); - conf.set('lastCheck', now); - } - } catch (e) { - console.log(message); - } -} - -main(); diff --git a/node_modules/nodemon/bin/windows-kill.exe b/node_modules/nodemon/bin/windows-kill.exe Binary files differdeleted file mode 100644 index 98d7d7f..0000000 --- a/node_modules/nodemon/bin/windows-kill.exe +++ /dev/null diff --git a/node_modules/nodemon/commitlint.config.js b/node_modules/nodemon/commitlint.config.js deleted file mode 100644 index 84dcb12..0000000 --- a/node_modules/nodemon/commitlint.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - extends: ['@commitlint/config-conventional'], -}; diff --git a/node_modules/nodemon/doc/cli/authors.txt b/node_modules/nodemon/doc/cli/authors.txt deleted file mode 100644 index 6c77a12..0000000 --- a/node_modules/nodemon/doc/cli/authors.txt +++ /dev/null @@ -1,8 +0,0 @@ - - Remy Sharp - author and maintainer - https://github.com/remy - https://twitter.com/rem - - Contributors: https://github.com/remy/nodemon/graphs/contributors ❤︎ - - Please help make nodemon better: https://github.com/remy/nodemon/ diff --git a/node_modules/nodemon/doc/cli/config.txt b/node_modules/nodemon/doc/cli/config.txt deleted file mode 100644 index 5de9bba..0000000 --- a/node_modules/nodemon/doc/cli/config.txt +++ /dev/null @@ -1,44 +0,0 @@ - - Typically the options to control nodemon are passed in via the CLI and are - listed under: nodemon --help options - - nodemon can also be configured via a local and global config file: - - * $HOME/nodemon.json - * $PWD/nodemon.json OR --config <file> - * nodemonConfig in package.json - - All config options in the .json file map 1-to-1 with the CLI options, so a - config could read as: - - { - "ext": "*.pde", - "verbose": true, - "exec": "processing --sketch=game --run" - } - - There are a limited number of variables available in the config (since you - could use backticks on the CLI to use a variable, backticks won't work in - the .json config). - - * {{pwd}} - the current directory - * {{filename}} - the filename you pass to nodemon - - For example: - - { - "ext": "*.pde", - "verbose": true, - "exec": "processing --sketch={{pwd}} --run" - } - - The global config file is useful for setting up default executables - instead of repeating the same option in each of your local configs: - - { - "verbose": true, - "execMap": { - "rb": "ruby", - "pde": "processing --sketch={{pwd}} --run" - } - } diff --git a/node_modules/nodemon/doc/cli/help.txt b/node_modules/nodemon/doc/cli/help.txt deleted file mode 100644 index 7ba4ff2..0000000 --- a/node_modules/nodemon/doc/cli/help.txt +++ /dev/null @@ -1,29 +0,0 @@ - Usage: nodemon [options] [script.js] [args] - - Options: - - --config file ............ alternate nodemon.json config file to use - -e, --ext ................ extensions to look for, ie. js,pug,hbs. - -x, --exec app ........... execute script with "app", ie. -x "python -v". - -w, --watch path ......... watch directory "path" or files. use once for - each directory or file to watch. - -i, --ignore ............. ignore specific files or directories. - -V, --verbose ............ show detail on what is causing restarts. - -- <your args> ........... to tell nodemon stop slurping arguments. - - Note: if the script is omitted, nodemon will try to read "main" from - package.json and without a nodemon.json, nodemon will monitor .js, .mjs, .coffee, - .litcoffee, and .json by default. - - For advanced nodemon configuration use nodemon.json: nodemon --help config - See also the sample: https://github.com/remy/nodemon/wiki/Sample-nodemon.json - - Examples: - - $ nodemon server.js - $ nodemon -w ../foo server.js apparg1 apparg2 - $ nodemon --exec python app.py - $ nodemon --exec "make build" -e "styl hbs" - $ nodemon app.js -- --config # pass config to app.js - - \x1B[1mAll options are documented under: \x1B[4mnodemon --help options\x1B[0m diff --git a/node_modules/nodemon/doc/cli/logo.txt b/node_modules/nodemon/doc/cli/logo.txt deleted file mode 100644 index 150f97f..0000000 --- a/node_modules/nodemon/doc/cli/logo.txt +++ /dev/null @@ -1,20 +0,0 @@ - ; ; - kO. x0 - KMX, .:x0kc. 'KMN - 0MMM0: 'oKMMMMMMMXd, ;OMMMX - oMMMMMWKOONMMMMMMMMMMMMMWOOKWMMMMMx - OMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMK. - .oWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMd. - KMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN - KMMMMMMMMMMMMMMW0k0WMMMMMMMMMMMMMMW - KMMMMMMMMMMMNk:. :xNMMMMMMMMMMMW - KMMMMMMMMMMK OMMMMMMMMMMW - KMMMMMMMMMMO xMMMMMMMMMMN - KMMMMMMMMMMO xMMMMMMMMMMN - KMMMMMMMMMMO xMMMMMMMMMMN - KMMMMMMMMMMO xMMMMMMMMMMN - KMMMMMMMMMMO xMMMMMMMMMMN - KMMMMMMMMMNc ;NMMMMMMMMMN - KMMMMMW0o' .lOWMMMMMN - KMMKd; ,oKMMN - kX: ,K0
\ No newline at end of file diff --git a/node_modules/nodemon/doc/cli/options.txt b/node_modules/nodemon/doc/cli/options.txt deleted file mode 100644 index 598ae63..0000000 --- a/node_modules/nodemon/doc/cli/options.txt +++ /dev/null @@ -1,36 +0,0 @@ - -Configuration - --config <file> .......... alternate nodemon.json config file to use - --exitcrash .............. exit on crash, allows nodemon to work with other watchers - -i, --ignore ............. ignore specific files or directories - --no-colors .............. disable color output - --signal <signal> ........ use specified kill signal instead of default (ex. SIGTERM) - -w, --watch path ......... watch directory "dir" or files. use once for each - directory or file to watch - --no-update-notifier ..... opt-out of update version check - -Execution - -C, --on-change-only ..... execute script on change only, not startup - --cwd <dir> .............. change into <dir> before running the script - -e, --ext ................ extensions to look for, ie. "js,pug,hbs" - -I, --no-stdin ........... nodemon passes stdin directly to child process - --spawn .................. force nodemon to use spawn (over fork) [node only] - -x, --exec app ........... execute script with "app", ie. -x "python -v" - -- <your args> ........... to tell nodemon stop slurping arguments - -Watching - -d, --delay n ............ debounce restart for "n" seconds - -L, --legacy-watch ....... use polling to watch for changes (typically needed - when watching over a network/Docker) - -P, --polling-interval ... combined with -L, milliseconds to poll for (default 100) - -Information - --dump ................... print full debug configuration - -h, --help ............... default help - --help <topic> ........... help on a specific feature. Try "--help topics" - -q, --quiet .............. minimise nodemon messages to start/stop only - -v, --version ............ current nodemon version - -V, --verbose ............ show detail on what is causing restarts - - -> Note that any unrecognised arguments are passed to the executing command. diff --git a/node_modules/nodemon/doc/cli/topics.txt b/node_modules/nodemon/doc/cli/topics.txt deleted file mode 100644 index 9fe3e2b..0000000 --- a/node_modules/nodemon/doc/cli/topics.txt +++ /dev/null @@ -1,8 +0,0 @@ - - options .................. show all available nodemon options - config ................... default config options using nodemon.json - authors .................. contributors to this project - logo ..................... <3 - whoami ................... I, AM, NODEMON \o/ - - Please support https://github.com/remy/nodemon/ diff --git a/node_modules/nodemon/doc/cli/usage.txt b/node_modules/nodemon/doc/cli/usage.txt deleted file mode 100644 index bca98b5..0000000 --- a/node_modules/nodemon/doc/cli/usage.txt +++ /dev/null @@ -1,3 +0,0 @@ - Usage: nodemon [nodemon options] [script.js] [args] - - See "nodemon --help" for more. diff --git a/node_modules/nodemon/doc/cli/whoami.txt b/node_modules/nodemon/doc/cli/whoami.txt deleted file mode 100644 index efc3382..0000000 --- a/node_modules/nodemon/doc/cli/whoami.txt +++ /dev/null @@ -1,9 +0,0 @@ -__/\\\\\_____/\\\_______/\\\\\_______/\\\\\\\\\\\\_____/\\\\\\\\\\\\\\\__/\\\\____________/\\\\_______/\\\\\_______/\\\\\_____/\\\_ - _\/\\\\\\___\/\\\_____/\\\///\\\____\/\\\////////\\\__\/\\\///////////__\/\\\\\\________/\\\\\\_____/\\\///\\\____\/\\\\\\___\/\\\_ - _\/\\\/\\\__\/\\\___/\\\/__\///\\\__\/\\\______\//\\\_\/\\\_____________\/\\\//\\\____/\\\//\\\___/\\\/__\///\\\__\/\\\/\\\__\/\\\_ - _\/\\\//\\\_\/\\\__/\\\______\//\\\_\/\\\_______\/\\\_\/\\\\\\\\\\\_____\/\\\\///\\\/\\\/_\/\\\__/\\\______\//\\\_\/\\\//\\\_\/\\\_ - _\/\\\\//\\\\/\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/\\\///////______\/\\\__\///\\\/___\/\\\_\/\\\_______\/\\\_\/\\\\//\\\\/\\\_ - _\/\\\_\//\\\/\\\_\//\\\______/\\\__\/\\\_______\/\\\_\/\\\_____________\/\\\____\///_____\/\\\_\//\\\______/\\\__\/\\\_\//\\\/\\\_ - _\/\\\__\//\\\\\\__\///\\\__/\\\____\/\\\_______/\\\__\/\\\_____________\/\\\_____________\/\\\__\///\\\__/\\\____\/\\\__\//\\\\\\_ - _\/\\\___\//\\\\\____\///\\\\\/_____\/\\\\\\\\\\\\/___\/\\\\\\\\\\\\\\\_\/\\\_____________\/\\\____\///\\\\\/_____\/\\\___\//\\\\\_ - _\///_____\/////_______\/////_______\////////////_____\///////////////__\///______________\///_______\/////_______\///_____\/////__
\ No newline at end of file diff --git a/node_modules/nodemon/lib/cli/index.js b/node_modules/nodemon/lib/cli/index.js deleted file mode 100644 index bf9e809..0000000 --- a/node_modules/nodemon/lib/cli/index.js +++ /dev/null @@ -1,49 +0,0 @@ -var parse = require('./parse'); - -/** - * Converts a string to command line args, in particular - * groups together quoted values. - * This is a utility function to allow calling nodemon as a required - * library, but with the CLI args passed in (instead of an object). - * - * @param {String} string - * @return {Array} - */ -function stringToArgs(string) { - var args = []; - - var parts = string.split(' '); - var length = parts.length; - var i = 0; - var open = false; - var grouped = ''; - var lead = ''; - - for (; i < length; i++) { - lead = parts[i].substring(0, 1); - if (lead === '"' || lead === '\'') { - open = lead; - grouped = parts[i].substring(1); - } else if (open && parts[i].slice(-1) === open) { - open = false; - grouped += ' ' + parts[i].slice(0, -1); - args.push(grouped); - } else if (open) { - grouped += ' ' + parts[i]; - } else { - args.push(parts[i]); - } - } - - return args; -} - -module.exports = { - parse: function (argv) { - if (typeof argv === 'string') { - argv = stringToArgs(argv); - } - - return parse(argv); - }, -};
\ No newline at end of file diff --git a/node_modules/nodemon/lib/cli/parse.js b/node_modules/nodemon/lib/cli/parse.js deleted file mode 100644 index ad74003..0000000 --- a/node_modules/nodemon/lib/cli/parse.js +++ /dev/null @@ -1,230 +0,0 @@ -/* - -nodemon is a utility for node, and replaces the use of the executable -node. So the user calls `nodemon foo.js` instead. - -nodemon can be run in a number of ways: - -`nodemon` - tries to use package.json#main property to run -`nodemon` - if no package, looks for index.js -`nodemon app.js` - runs app.js -`nodemon --arg app.js --apparg` - eats arg1, and runs app.js with apparg -`nodemon --apparg` - as above, but passes apparg to package.json#main (or - index.js) -`nodemon --debug app.js - -*/ - -var fs = require('fs'); -var path = require('path'); -var existsSync = fs.existsSync || path.existsSync; - -module.exports = parse; - -/** - * Parses the command line arguments `process.argv` and returns the - * nodemon options, the user script and the executable script. - * - * @param {Array} full process arguments, including `node` leading arg - * @return {Object} { options, script, args } - */ -function parse(argv) { - if (typeof argv === 'string') { - argv = argv.split(' '); - } - - var eat = function (i, args) { - if (i <= args.length) { - return args.splice(i + 1, 1).pop(); - } - }; - - var args = argv.slice(2); - var script = null; - var nodemonOptions = { scriptPosition: null }; - - var nodemonOpt = nodemonOption.bind(null, nodemonOptions); - var lookForArgs = true; - - // move forward through the arguments - for (var i = 0; i < args.length; i++) { - // if the argument looks like a file, then stop eating - if (!script) { - if (args[i] === '.' || existsSync(args[i])) { - script = args.splice(i, 1).pop(); - - // we capture the position of the script because we'll reinsert it in - // the right place in run.js:command (though I'm not sure we should even - // take it out of the array in the first place, but this solves passing - // arguments to the exec process for now). - nodemonOptions.scriptPosition = i; - i--; - continue; - } - } - - if (lookForArgs) { - // respect the standard way of saying: hereafter belongs to my script - if (args[i] === '--') { - args.splice(i, 1); - nodemonOptions.scriptPosition = i; - // cycle back one argument, as we just ate this one up - i--; - - // ignore all further nodemon arguments - lookForArgs = false; - - // move to the next iteration - continue; - } - - if (nodemonOpt(args[i], eat.bind(null, i, args)) !== false) { - args.splice(i, 1); - // cycle back one argument, as we just ate this one up - i--; - } - } - } - - nodemonOptions.script = script; - nodemonOptions.args = args; - - return nodemonOptions; -} - - -/** - * Given an argument (ie. from process.argv), sets nodemon - * options and can eat up the argument value - * - * @param {Object} options object that will be updated - * @param {Sting} current argument from argv - * @param {Function} the callback to eat up the next argument in argv - * @return {Boolean} false if argument was not a nodemon arg - */ -function nodemonOption(options, arg, eatNext) { - // line separation on purpose to help legibility - if (arg === '--help' || arg === '-h' || arg === '-?') { - var help = eatNext(); - options.help = help ? help : true; - } else - - if (arg === '--version' || arg === '-v') { - options.version = true; - } else - - if (arg === '--no-update-notifier') { - options.noUpdateNotifier = true; - } else - - if (arg === '--spawn') { - options.spawn = true; - } else - - if (arg === '--dump') { - options.dump = true; - } else - - if (arg === '--verbose' || arg === '-V') { - options.verbose = true; - } else - - if (arg === '--legacy-watch' || arg === '-L') { - options.legacyWatch = true; - } else - - if (arg === '--polling-interval' || arg === '-P') { - options.pollingInterval = parseInt(eatNext(), 10); - } else - - // Depricated as this is "on" by default - if (arg === '--js') { - options.js = true; - } else - - if (arg === '--quiet' || arg === '-q') { - options.quiet = true; - } else - - if (arg === '--config') { - options.configFile = eatNext(); - } else - - if (arg === '--watch' || arg === '-w') { - if (!options.watch) { options.watch = []; } - options.watch.push(eatNext()); - } else - - if (arg === '--ignore' || arg === '-i') { - if (!options.ignore) { options.ignore = []; } - options.ignore.push(eatNext()); - } else - - if (arg === '--exitcrash') { - options.exitcrash = true; - } else - - if (arg === '--delay' || arg === '-d') { - options.delay = parseDelay(eatNext()); - } else - - if (arg === '--exec' || arg === '-x') { - options.exec = eatNext(); - } else - - if (arg === '--no-stdin' || arg === '-I') { - options.stdin = false; - } else - - if (arg === '--on-change-only' || arg === '-C') { - options.runOnChangeOnly = true; - } else - - if (arg === '--ext' || arg === '-e') { - options.ext = eatNext(); - } else - - if (arg === '--no-colours' || arg === '--no-colors') { - options.colours = false; - } else - - if (arg === '--signal' || arg === '-s') { - options.signal = eatNext(); - } else - - if (arg === '--cwd') { - options.cwd = eatNext(); - - // go ahead and change directory. This is primarily for nodemon tools like - // grunt-nodemon - we're doing this early because it will affect where the - // user script is searched for. - process.chdir(path.resolve(options.cwd)); - } else { - - // this means we didn't match - return false; - } -} - -/** - * Given an argument (ie. from nodemonOption()), will parse and return the - * equivalent millisecond value or 0 if the argument cannot be parsed - * - * @param {String} argument value given to the --delay option - * @return {Number} millisecond equivalent of the argument - */ -function parseDelay(value) { - var millisPerSecond = 1000; - var millis = 0; - - if (value.match(/^\d*ms$/)) { - // Explicitly parse for milliseconds when using ms time specifier - millis = parseInt(value, 10); - } else { - // Otherwise, parse for seconds, with or without time specifier then convert - millis = parseFloat(value) * millisPerSecond; - } - - return isNaN(millis) ? 0 : millis; -} - diff --git a/node_modules/nodemon/lib/config/command.js b/node_modules/nodemon/lib/config/command.js deleted file mode 100644 index 9839b5c..0000000 --- a/node_modules/nodemon/lib/config/command.js +++ /dev/null @@ -1,43 +0,0 @@ -module.exports = command; - -/** - * command constructs the executable command to run in a shell including the - * user script, the command arguments. - * - * @param {Object} settings Object as: - * { execOptions: { - * exec: String, - * [script: String], - * [scriptPosition: Number], - * [execArgs: Array<string>] - * } - * } - * @return {Object} an object with the node executable and the - * arguments to the command - */ -function command(settings) { - var options = settings.execOptions; - var executable = options.exec; - var args = []; - - // after "executable" go the exec args (like --debug, etc) - if (options.execArgs) { - [].push.apply(args, options.execArgs); - } - - // then goes the user's script arguments - if (options.args) { - [].push.apply(args, options.args); - } - - // after the "executable" goes the user's script - if (options.script) { - args.splice((options.scriptPosition || 0) + - options.execArgs.length, 0, options.script); - } - - return { - executable: executable, - args: args, - }; -} diff --git a/node_modules/nodemon/lib/config/defaults.js b/node_modules/nodemon/lib/config/defaults.js deleted file mode 100644 index e2a448b..0000000 --- a/node_modules/nodemon/lib/config/defaults.js +++ /dev/null @@ -1,28 +0,0 @@ -var ignoreRoot = require('ignore-by-default').directories(); - -// default options for config.options -module.exports = { - restartable: 'rs', - colours: true, - execMap: { - py: 'python', - rb: 'ruby', - ts: 'ts-node', - // more can be added here such as ls: lsc - but please ensure it's cross - // compatible with linux, mac and windows, or make the default.js - // dynamically append the `.cmd` for node based utilities - }, - ignoreRoot: ignoreRoot.map(_ => `**/${_}/**`), - watch: ['*.*'], - stdin: true, - runOnChangeOnly: false, - verbose: false, - signal: 'SIGUSR2', - // 'stdout' refers to the default behaviour of a required nodemon's child, - // but also includes stderr. If this is false, data is still dispatched via - // nodemon.on('stdout/stderr') - stdout: true, - watchOptions: { - - }, -}; diff --git a/node_modules/nodemon/lib/config/exec.js b/node_modules/nodemon/lib/config/exec.js deleted file mode 100644 index 68c2a2d..0000000 --- a/node_modules/nodemon/lib/config/exec.js +++ /dev/null @@ -1,225 +0,0 @@ -const path = require('path'); -const fs = require('fs'); -const existsSync = fs.existsSync; -const utils = require('../utils'); - -module.exports = exec; -module.exports.expandScript = expandScript; - -/** - * Reads the cwd/package.json file and looks to see if it can load a script - * and possibly an exec first from package.main, then package.start. - * - * @return {Object} exec & script if found - */ -function execFromPackage() { - // doing a try/catch because we can't use the path.exist callback pattern - // or we could, but the code would get messy, so this will do exactly - // what we're after - if the file doesn't exist, it'll throw. - try { - // note: this isn't nodemon's package, it's the user's cwd package - var pkg = require(path.join(process.cwd(), 'package.json')); - if (pkg.main !== undefined) { - // no app found to run - so give them a tip and get the feck out - return { exec: null, script: pkg.main }; - } - - if (pkg.scripts && pkg.scripts.start) { - return { exec: pkg.scripts.start }; - } - } catch (e) { } - - return null; -} - -function replace(map, str) { - var re = new RegExp('{{(' + Object.keys(map).join('|') + ')}}', 'g'); - return str.replace(re, function (all, m) { - return map[m] || all || ''; - }); -} - -function expandScript(script, ext) { - if (!ext) { - ext = '.js'; - } - if (script.indexOf(ext) !== -1) { - return script; - } - - if (existsSync(path.resolve(script))) { - return script; - } - - if (existsSync(path.resolve(script + ext))) { - return script + ext; - } - - return script; -} - -/** - * Discovers all the options required to run the script - * and if a custom exec has been passed in, then it will - * also try to work out what extensions to monitor and - * whether there's a special way of running that script. - * - * @param {Object} nodemonOptions - * @param {Object} execMap - * @return {Object} new and updated version of nodemonOptions - */ -function exec(nodemonOptions, execMap) { - if (!execMap) { - execMap = {}; - } - - var options = utils.clone(nodemonOptions || {}); - var script; - - // if there's no script passed, try to get it from the first argument - if (!options.script && (options.args || []).length) { - script = expandScript(options.args[0], - options.ext && ('.' + (options.ext || 'js').split(',')[0])); - - // if the script was found, shift it off our args - if (script !== options.args[0]) { - options.script = script; - options.args.shift(); - } - } - - // if there's no exec found yet, then try to read it from the local - // package.json this logic used to sit in the cli/parse, but actually the cli - // should be parsed first, then the user options (via nodemon.json) then - // finally default down to pot shots at the directory via package.json - if (!options.exec && !options.script) { - var found = execFromPackage(); - if (found !== null) { - if (found.exec) { - options.exec = found.exec; - } - if (!options.script) { - options.script = found.script; - } - if (Array.isArray(options.args) && - options.scriptPosition === null) { - options.scriptPosition = options.args.length; - } - } - } - - // var options = utils.clone(nodemonOptions || {}); - script = path.basename(options.script || ''); - - var scriptExt = path.extname(script).slice(1); - - var extension = options.ext; - if (extension === undefined) { - var isJS = scriptExt === 'js' || scriptExt === 'mjs'; - extension = (isJS || !scriptExt) ? 'js,mjs' : scriptExt; - extension += ',json'; // Always watch JSON files - } - - var execDefined = !!options.exec; - - // allows the user to simplify cli usage: - // https://github.com/remy/nodemon/issues/195 - // but always give preference to the user defined argument - if (!options.exec && execMap[scriptExt] !== undefined) { - options.exec = execMap[scriptExt]; - execDefined = true; - } - - options.execArgs = nodemonOptions.execArgs || []; - - if (Array.isArray(options.exec)) { - options.execArgs = options.exec; - options.exec = options.execArgs.shift(); - } - - if (options.exec === undefined) { - options.exec = 'node'; - } else { - // allow variable substitution for {{filename}} and {{pwd}} - var substitution = replace.bind(null, { - filename: options.script, - pwd: process.cwd(), - }); - - var newExec = substitution(options.exec); - if (newExec !== options.exec && - options.exec.indexOf('{{filename}}') !== -1) { - options.script = null; - } - options.exec = newExec; - - var newExecArgs = options.execArgs.map(substitution); - if (newExecArgs.join('') !== options.execArgs.join('')) { - options.execArgs = newExecArgs; - delete options.script; - } - } - - - if (options.exec === 'node' && options.nodeArgs && options.nodeArgs.length) { - options.execArgs = options.execArgs.concat(options.nodeArgs); - } - - // note: indexOf('coffee') handles both .coffee and .litcoffee - if (!execDefined && options.exec === 'node' && - scriptExt.indexOf('coffee') !== -1) { - options.exec = 'coffee'; - - // we need to get execArgs set before the script - // for example, in `nodemon --debug my-script.coffee --my-flag`, debug is an - // execArg, while my-flag is a script arg - var leadingArgs = (options.args || []).splice(0, options.scriptPosition); - options.execArgs = options.execArgs.concat(leadingArgs); - options.scriptPosition = 0; - - if (options.execArgs.length > 0) { - // because this is the coffee executable, we need to combine the exec args - // into a single argument after the nodejs flag - options.execArgs = ['--nodejs', options.execArgs.join(' ')]; - } - } - - if (options.exec === 'coffee') { - // don't override user specified extension tracking - if (options.ext === undefined) { - if (extension) { extension += ','; } - extension += 'coffee,litcoffee'; - } - - // because windows can't find 'coffee', it needs the real file 'coffee.cmd' - if (utils.isWindows) { - options.exec += '.cmd'; - } - } - - // allow users to make a mistake on the extension to monitor - // converts .js, pug => js,pug - // BIG NOTE: user can't do this: nodemon -e *.js - // because the terminal will automatically expand the glob against - // the file system :( - extension = (extension.match(/[^,*\s]+/g) || []) - .map(ext => ext.replace(/^\./, '')) - .join(','); - - options.ext = extension; - - if (options.script) { - options.script = expandScript(options.script, - extension && ('.' + extension.split(',')[0])); - } - - options.env = {}; - // make sure it's an object (and since we don't have ) - if (({}).toString.apply(nodemonOptions.env) === '[object Object]') { - options.env = utils.clone(nodemonOptions.env); - } else if (nodemonOptions.env !== undefined) { - throw new Error('nodemon env values must be an object: { PORT: 8000 }'); - } - - return options; -} diff --git a/node_modules/nodemon/lib/config/index.js b/node_modules/nodemon/lib/config/index.js deleted file mode 100644 index c78c435..0000000 --- a/node_modules/nodemon/lib/config/index.js +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Manages the internal config of nodemon, checking for the state of support - * with fs.watch, how nodemon can watch files (using find or fs methods). - * - * This is *not* the user's config. - */ -var debug = require('debug')('nodemon'); -var load = require('./load'); -var rules = require('../rules'); -var utils = require('../utils'); -var pinVersion = require('../version').pin; -var command = require('./command'); -var rulesToMonitor = require('../monitor/match').rulesToMonitor; -var bus = utils.bus; - -function reset() { - rules.reset(); - - config.dirs = []; - config.options = { ignore: [], watch: [], monitor: [] }; - config.lastStarted = 0; - config.loaded = []; -} - -var config = { - run: false, - system: { - cwd: process.cwd(), - }, - required: false, - dirs: [], - timeout: 1000, - options: {}, -}; - -/** - * Take user defined settings, then detect the local machine capability, then - * look for local and global nodemon.json files and merge together the final - * settings with the config for nodemon. - * - * @param {Object} settings user defined settings for nodemon (typically on - * the cli) - * @param {Function} ready callback fired once the config is loaded - */ -config.load = function (settings, ready) { - reset(); - var config = this; - load(settings, config.options, config, function (options) { - config.options = options; - - if (options.watch.length === 0) { - // this is to catch when the watch is left blank - options.watch.push('*.*'); - } - - if (options['watch_interval']) { // jshint ignore:line - options.watchInterval = options['watch_interval']; // jshint ignore:line - } - - config.watchInterval = options.watchInterval || null; - if (options.signal) { - config.signal = options.signal; - } - - var cmd = command(config.options); - config.command = { - raw: cmd, - string: utils.stringify(cmd.executable, cmd.args), - }; - - // now run automatic checks on system adding to the config object - options.monitor = rulesToMonitor(options.watch, options.ignore, config); - - var cwd = process.cwd(); - debug('config: dirs', config.dirs); - if (config.dirs.length === 0) { - config.dirs.unshift(cwd); - } - - bus.emit('config:update', config); - pinVersion().then(function () { - ready(config); - }).catch(e => { - // this doesn't help testing, but does give exposure on syntax errors - console.error(e.stack); - setTimeout(() => { throw e; }, 0); - }); - }); -}; - -config.reset = reset; - -module.exports = config; diff --git a/node_modules/nodemon/lib/config/load.js b/node_modules/nodemon/lib/config/load.js deleted file mode 100644 index bd5a03d..0000000 --- a/node_modules/nodemon/lib/config/load.js +++ /dev/null @@ -1,256 +0,0 @@ -var debug = require('debug')('nodemon'); -var fs = require('fs'); -var path = require('path'); -var exists = fs.exists || path.exists; -var utils = require('../utils'); -var rules = require('../rules'); -var parse = require('../rules/parse'); -var exec = require('./exec'); -var defaults = require('./defaults'); - -module.exports = load; -module.exports.mutateExecOptions = mutateExecOptions; - -var existsSync = fs.existsSync || path.existsSync; - -function findAppScript() { - // nodemon has been run alone, so try to read the package file - // or try to read the index.js file - if (existsSync('./index.js')) { - return 'index.js'; - } -} - -/** - * Load the nodemon config, first reading the global root/nodemon.json, then - * the local nodemon.json to the exec and then overwriting using any user - * specified settings (i.e. from the cli) - * - * @param {Object} settings user defined settings - * @param {Function} ready callback that receives complete config - */ -function load(settings, options, config, callback) { - config.loaded = []; - // first load the root nodemon.json - loadFile(options, config, utils.home, function (options) { - // then load the user's local configuration file - if (settings.configFile) { - options.configFile = path.resolve(settings.configFile); - } - loadFile(options, config, process.cwd(), function (options) { - // Then merge over with the user settings (parsed from the cli). - // Note that merge protects and favours existing values over new values, - // and thus command line arguments get priority - options = utils.merge(settings, options); - - // legacy support - if (!Array.isArray(options.ignore)) { - options.ignore = [options.ignore]; - } - - if (!options.ignoreRoot) { - options.ignoreRoot = defaults.ignoreRoot; - } - - // blend the user ignore and the default ignore together - if (options.ignoreRoot && options.ignore) { - if (!Array.isArray(options.ignoreRoot)) { - options.ignoreRoot = [options.ignoreRoot]; - } - options.ignore = options.ignoreRoot.concat(options.ignore); - } else { - options.ignore = defaults.ignore.concat(options.ignore); - } - - - // add in any missing defaults - options = utils.merge(options, defaults); - - if (!options.script && !options.exec) { - var found = findAppScript(); - if (found) { - if (!options.args) { - options.args = []; - } - // if the script is found as a result of not being on the command - // line, then we move any of the pre double-dash args in execArgs - const n = options.scriptPosition === null ? - options.args.length : options.scriptPosition; - - options.execArgs = (options.execArgs || []) - .concat(options.args.splice(0, n)); - options.scriptPosition = null; - - options.script = found; - } - } - - mutateExecOptions(options); - - if (options.quiet) { - utils.quiet(); - } - - if (options.verbose) { - utils.debug = true; - } - - // simplify the ready callback to be called after the rules are normalised - // from strings to regexp through the rules lib. Note that this gets - // created *after* options is overwritten twice in the lines above. - var ready = function (options) { - normaliseRules(options, callback); - }; - - // if we didn't pick up a nodemon.json file & there's no cli ignores - // then try loading an old style .nodemonignore file - if (config.loaded.length === 0) { - var legacy = loadLegacyIgnore.bind(null, options, config, ready); - - // first try .nodemonignore, if that doesn't exist, try nodemon-ignore - return legacy('.nodemonignore', function () { - legacy('nodemon-ignore', function (options) { - ready(options); - }); - }); - } - - ready(options); - }); - }); -} - -/** - * Loads the old style nodemonignore files which is a list of patterns - * in a file to ignore - * - * @param {Object} options nodemon user options - * @param {Function} success - * @param {String} filename ignore file (.nodemonignore or nodemon-ignore) - * @param {Function} fail (optional) failure callback - */ -function loadLegacyIgnore(options, config, success, filename, fail) { - var ignoreFile = path.join(process.cwd(), filename); - - exists(ignoreFile, function (exists) { - if (exists) { - config.loaded.push(ignoreFile); - return parse(ignoreFile, function (error, rules) { - options.ignore = rules.raw; - success(options); - }); - } - - if (fail) { - fail(options); - } else { - success(options); - } - }); -} - -function normaliseRules(options, ready) { - // convert ignore and watch options to rules/regexp - rules.watch.add(options.watch); - rules.ignore.add(options.ignore); - - // normalise the watch and ignore arrays - options.watch = options.watch === false ? false : rules.rules.watch; - options.ignore = rules.rules.ignore; - - ready(options); -} - -/** - * Looks for a config in the current working directory, and a config in the - * user's home directory, merging the two together, giving priority to local - * config. This can then be overwritten later by command line arguments - * - * @param {Function} ready callback to pass loaded settings to - */ -function loadFile(options, config, dir, ready) { - if (!ready) { - ready = function () { }; - } - - var callback = function (settings) { - // prefer the local nodemon.json and fill in missing items using - // the global options - ready(utils.merge(settings, options)); - }; - - if (!dir) { - return callback({}); - } - - var filename = options.configFile || path.join(dir, 'nodemon.json'); - - if (config.loaded.indexOf(filename) !== -1) { - // don't bother re-parsing the same config file - return callback({}); - } - - fs.readFile(filename, 'utf8', function (err, data) { - if (err) { - if (err.code === 'ENOENT') { - if (!options.configFile && dir !== utils.home) { - // if no specified local config file and local nodemon.json - // doesn't exist, try the package.json - return loadPackageJSON(config, callback); - } - } - return callback({}); - } - - var settings = {}; - - try { - settings = JSON.parse(data.toString('utf8').replace(/^\uFEFF/, '')); - if (!filename.endsWith('package.json') || settings.nodemonConfig) { - config.loaded.push(filename); - } - } catch (e) { - utils.log.fail('Failed to parse config ' + filename); - console.error(e); - process.exit(1); - } - - // options values will overwrite settings - callback(settings); - }); -} - -function loadPackageJSON(config, ready) { - if (!ready) { - ready = () => { }; - } - - const dir = process.cwd(); - const filename = path.join(dir, 'package.json'); - const packageLoadOptions = { configFile: filename }; - return loadFile(packageLoadOptions, config, dir, settings => { - ready(settings.nodemonConfig || {}); - }); -} - -function mutateExecOptions(options) { - // work out the execOptions based on the final config we have - options.execOptions = exec({ - script: options.script, - exec: options.exec, - args: options.args, - scriptPosition: options.scriptPosition, - nodeArgs: options.nodeArgs, - execArgs: options.execArgs, - ext: options.ext, - env: options.env, - }, options.execMap); - - // clean up values that we don't need at the top level - delete options.scriptPosition; - delete options.script; - delete options.args; - delete options.ext; - - return options; -} diff --git a/node_modules/nodemon/lib/help/index.js b/node_modules/nodemon/lib/help/index.js deleted file mode 100644 index 1054b60..0000000 --- a/node_modules/nodemon/lib/help/index.js +++ /dev/null @@ -1,27 +0,0 @@ -var fs = require('fs'); -var path = require('path'); -const supportsColor = require('supports-color'); - -module.exports = help; - -const highlight = supportsColor.stdout ? '\x1B\[$1m' : ''; - -function help(item) { - if (!item) { - item = 'help'; - } else if (item === true) { // if used with -h or --help and no args - item = 'help'; - } - - // cleanse the filename to only contain letters - // aka: /\W/g but figured this was eaiser to read - item = item.replace(/[^a-z]/gi, ''); - - try { - var dir = path.join(__dirname, '..', '..', 'doc', 'cli', item + '.txt'); - var body = fs.readFileSync(dir, 'utf8'); - return body.replace(/\\x1B\[(.)m/g, highlight); - } catch (e) { - return '"' + item + '" help can\'t be found'; - } -} diff --git a/node_modules/nodemon/lib/index.js b/node_modules/nodemon/lib/index.js deleted file mode 100644 index 0eca5c4..0000000 --- a/node_modules/nodemon/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./nodemon');
\ No newline at end of file diff --git a/node_modules/nodemon/lib/monitor/index.js b/node_modules/nodemon/lib/monitor/index.js deleted file mode 100644 index 89db029..0000000 --- a/node_modules/nodemon/lib/monitor/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - run: require('./run'), - watch: require('./watch').watch, -}; diff --git a/node_modules/nodemon/lib/monitor/match.js b/node_modules/nodemon/lib/monitor/match.js deleted file mode 100644 index 2ac3b29..0000000 --- a/node_modules/nodemon/lib/monitor/match.js +++ /dev/null @@ -1,276 +0,0 @@ -const minimatch = require('minimatch'); -const path = require('path'); -const fs = require('fs'); -const debug = require('debug')('nodemon:match'); -const utils = require('../utils'); - -module.exports = match; -module.exports.rulesToMonitor = rulesToMonitor; - -function rulesToMonitor(watch, ignore, config) { - var monitor = []; - - if (!Array.isArray(ignore)) { - if (ignore) { - ignore = [ignore]; - } else { - ignore = []; - } - } - - if (!Array.isArray(watch)) { - if (watch) { - watch = [watch]; - } else { - watch = []; - } - } - - if (watch && watch.length) { - monitor = utils.clone(watch); - } - - if (ignore) { - [].push.apply(monitor, (ignore || []).map(function (rule) { - return '!' + rule; - })); - } - - var cwd = process.cwd(); - - // next check if the monitored paths are actual directories - // or just patterns - and expand the rule to include *.* - monitor = monitor.map(function (rule) { - var not = rule.slice(0, 1) === '!'; - - if (not) { - rule = rule.slice(1); - } - - if (rule === '.' || rule === '.*') { - rule = '*.*'; - } - - var dir = path.resolve(cwd, rule); - - try { - var stat = fs.statSync(dir); - if (stat.isDirectory()) { - rule = dir; - if (rule.slice(-1) !== '/') { - rule += '/'; - } - rule += '**/*'; - - // `!not` ... sorry. - if (!not) { - config.dirs.push(dir); - } - } else { - // ensures we end up in the check that tries to get a base directory - // and then adds it to the watch list - throw new Error(); - } - } catch (e) { - var base = tryBaseDir(dir); - if (!not && base) { - if (config.dirs.indexOf(base) === -1) { - config.dirs.push(base); - } - } - } - - if (rule.slice(-1) === '/') { - // just slap on a * anyway - rule += '*'; - } - - // if the url ends with * but not **/* and not *.* - // then convert to **/* - somehow it was missed :-\ - if (rule.slice(-4) !== '**/*' && - rule.slice(-1) === '*' && - rule.indexOf('*.') === -1) { - - if (rule.slice(-2) !== '**') { - rule += '*/*'; - } - } - - - return (not ? '!' : '') + rule; - }); - - return monitor; -} - -function tryBaseDir(dir) { - var stat; - if (/[?*\{\[]+/.test(dir)) { // if this is pattern, then try to find the base - try { - var base = path.dirname(dir.replace(/([?*\{\[]+.*$)/, 'foo')); - stat = fs.statSync(base); - if (stat.isDirectory()) { - return base; - } - } catch (error) { - // console.log(error); - } - } else { - try { - stat = fs.statSync(dir); - // if this path is actually a single file that exists, then just monitor - // that, *specifically*. - if (stat.isFile() || stat.isDirectory()) { - return dir; - } - } catch (e) { } - } - - return false; -} - -function match(files, monitor, ext) { - // sort the rules by highest specificity (based on number of slashes) - // ignore rules (!) get sorted highest as they take precedent - const cwd = process.cwd(); - var rules = monitor.sort(function (a, b) { - var r = b.split(path.sep).length - a.split(path.sep).length; - var aIsIgnore = a.slice(0, 1) === '!'; - var bIsIgnore = b.slice(0, 1) === '!'; - - if (aIsIgnore || bIsIgnore) { - if (aIsIgnore) { - return -1; - } - - return 1; - } - - if (r === 0) { - return b.length - a.length; - } - return r; - }).map(function (s) { - var prefix = s.slice(0, 1); - - if (prefix === '!') { - if (s.indexOf('!' + cwd) === 0) { - return s; - } - - // if it starts with a period, then let's get the relative path - if (s.indexOf('!.') === 0) { - return '!' + path.resolve(cwd, s.substring(1)); - } - - return '!**' + (prefix !== path.sep ? path.sep : '') + s.slice(1); - } - - // if it starts with a period, then let's get the relative path - if (s.indexOf('.') === 0) { - return path.resolve(cwd, s); - } - - if (s.indexOf(cwd) === 0) { - return s; - } - - return '**' + (prefix !== path.sep ? path.sep : '') + s; - }); - - debug('rules', rules); - - var good = []; - var whitelist = []; // files that we won't check against the extension - var ignored = 0; - var watched = 0; - var usedRules = []; - var minimatchOpts = { - dot: true, - }; - - // enable case-insensitivity on Windows - if (utils.isWindows) { - minimatchOpts.nocase = true; - } - - files.forEach(function (file) { - file = path.resolve(cwd, file); - - var matched = false; - for (var i = 0; i < rules.length; i++) { - if (rules[i].slice(0, 1) === '!') { - if (!minimatch(file, rules[i], minimatchOpts)) { - debug('ignored', file, 'rule:', rules[i]); - ignored++; - matched = true; - break; - } - } else { - debug('matched', file, 'rule:', rules[i]); - if (minimatch(file, rules[i], minimatchOpts)) { - watched++; - - // don't repeat the output if a rule is matched - if (usedRules.indexOf(rules[i]) === -1) { - usedRules.push(rules[i]); - utils.log.detail('matched rule: ' + rules[i]); - } - - // if the rule doesn't match the WATCH EVERYTHING - // but *does* match a rule that ends with *.*, then - // white list it - in that we don't run it through - // the extension check too. - if (rules[i] !== '**' + path.sep + '*.*' && - rules[i].slice(-3) === '*.*') { - whitelist.push(file); - } else if (path.basename(file) === path.basename(rules[i])) { - // if the file matches the actual rule, then it's put on whitelist - whitelist.push(file); - } else { - good.push(file); - } - matched = true; - break; - } else { - // utils.log.detail('no match: ' + rules[i], file); - } - } - } - if (!matched) { - ignored++; - } - }); - - debug('good', good) - - // finally check the good files against the extensions that we're monitoring - if (ext) { - if (ext.indexOf(',') === -1) { - ext = '**/*.' + ext; - } else { - ext = '**/*.{' + ext + '}'; - } - - good = good.filter(function (file) { - // only compare the filename to the extension test - return minimatch(path.basename(file), ext, minimatchOpts); - }); - } // else assume *.* - - var result = good.concat(whitelist); - - if (utils.isWindows) { - // fix for windows testing - I *think* this is okay to do - result = result.map(function (file) { - return file.slice(0, 1).toLowerCase() + file.slice(1); - }); - } - - return { - result: result, - ignored: ignored, - watched: watched, - total: files.length, - }; -} diff --git a/node_modules/nodemon/lib/monitor/run.js b/node_modules/nodemon/lib/monitor/run.js deleted file mode 100644 index 36a4864..0000000 --- a/node_modules/nodemon/lib/monitor/run.js +++ /dev/null @@ -1,541 +0,0 @@ -var debug = require('debug')('nodemon:run'); -const statSync = require('fs').statSync; -var utils = require('../utils'); -var bus = utils.bus; -var childProcess = require('child_process'); -var spawn = childProcess.spawn; -var exec = childProcess.exec; -var execSync = childProcess.execSync; -var fork = childProcess.fork; -var watch = require('./watch').watch; -var config = require('../config'); -var child = null; // the actual child process we spawn -var killedAfterChange = false; -var noop = () => {}; -var restart = null; -var psTree = require('pstree.remy'); -var path = require('path'); -var signals = require('./signals'); -const osRelease = parseInt(require('os').release().split('.')[0], 10); - -function run(options) { - var cmd = config.command.raw; - // moved up - // we need restart function below in the global scope for run.kill - /*jshint validthis:true*/ - restart = run.bind(this, options); - run.restart = restart; - - // binding options with instance of run - // so that we can use it in run.kill - run.options = options; - - var runCmd = !options.runOnChangeOnly || config.lastStarted !== 0; - if (runCmd) { - utils.log.status('starting `' + config.command.string + '`'); - } else { - // should just watch file if command is not to be run - // had another alternate approach - // to stop process being forked/spawned in the below code - // but this approach does early exit and makes code cleaner - debug('start watch on: %s', config.options.watch); - if (config.options.watch !== false) { - watch(); - return; - } - } - - config.lastStarted = Date.now(); - - var stdio = ['pipe', 'pipe', 'pipe']; - - if (config.options.stdout) { - stdio = ['pipe', process.stdout, process.stderr]; - } - - if (config.options.stdin === false) { - stdio = [process.stdin, process.stdout, process.stderr]; - } - - var sh = 'sh'; - var shFlag = '-c'; - - const binPath = process.cwd() + '/node_modules/.bin'; - - const spawnOptions = { - env: Object.assign({}, process.env, options.execOptions.env, { - PATH: binPath + ':' + process.env.PATH, - }), - stdio: stdio, - }; - - var executable = cmd.executable; - - if (utils.isWindows) { - // if the exec includes a forward slash, reverse it for windows compat - // but *only* apply to the first command, and none of the arguments. - // ref #1251 and #1236 - if (executable.indexOf('/') !== -1) { - executable = executable - .split(' ') - .map((e, i) => { - if (i === 0) { - return path.normalize(e); - } - return e; - }) - .join(' '); - } - // taken from npm's cli: https://git.io/vNFD4 - sh = process.env.comspec || 'cmd'; - shFlag = '/d /s /c'; - spawnOptions.windowsVerbatimArguments = true; - } - - var args = runCmd ? utils.stringify(executable, cmd.args) : ':'; - var spawnArgs = [sh, [shFlag, args], spawnOptions]; - - const firstArg = cmd.args[0] || ''; - - var inBinPath = false; - try { - inBinPath = statSync(`${binPath}/${executable}`).isFile(); - } catch (e) {} - - // hasStdio allows us to correctly handle stdin piping - // see: https://git.io/vNtX3 - const hasStdio = utils.satisfies('>= 6.4.0 || < 5'); - - // forking helps with sub-process handling and tends to clean up better - // than spawning, but it should only be used under specific conditions - const shouldFork = - !config.options.spawn && - !inBinPath && - !(firstArg.indexOf('-') === 0) && // don't fork if there's a node exec arg - firstArg !== 'inspect' && // don't fork it's `inspect` debugger - executable === 'node' && // only fork if node - utils.version.major > 4; // only fork if node version > 4 - - if (shouldFork) { - // this assumes the first argument is the script and slices it out, since - // we're forking - var forkArgs = cmd.args.slice(1); - var env = utils.merge(options.execOptions.env, process.env); - stdio.push('ipc'); - child = fork(options.execOptions.script, forkArgs, { - env: env, - stdio: stdio, - silent: !hasStdio, - }); - utils.log.detail('forking'); - debug('fork', sh, shFlag, args); - } else { - utils.log.detail('spawning'); - child = spawn.apply(null, spawnArgs); - debug('spawn', sh, shFlag, args); - } - - if (config.required) { - var emit = { - stdout: function (data) { - bus.emit('stdout', data); - }, - stderr: function (data) { - bus.emit('stderr', data); - }, - }; - - // now work out what to bind to... - if (config.options.stdout) { - child.on('stdout', emit.stdout).on('stderr', emit.stderr); - } else { - child.stdout.on('data', emit.stdout); - child.stderr.on('data', emit.stderr); - - bus.stdout = child.stdout; - bus.stderr = child.stderr; - } - - if (shouldFork) { - child.on('message', function (message, sendHandle) { - bus.emit('message', message, sendHandle); - }); - } - } - - bus.emit('start'); - - utils.log.detail('child pid: ' + child.pid); - - child.on('error', function (error) { - bus.emit('error', error); - if (error.code === 'ENOENT') { - utils.log.error('unable to run executable: "' + cmd.executable + '"'); - process.exit(1); - } else { - utils.log.error('failed to start child process: ' + error.code); - throw error; - } - }); - - child.on('exit', function (code, signal) { - if (child && child.stdin) { - process.stdin.unpipe(child.stdin); - } - - if (code === 127) { - utils.log.error( - 'failed to start process, "' + cmd.executable + '" exec not found' - ); - bus.emit('error', code); - process.exit(); - } - - // If the command failed with code 2, it may or may not be a syntax error - // See: http://git.io/fNOAR - // We will only assume a parse error, if the child failed quickly - if (code === 2 && Date.now() < config.lastStarted + 500) { - utils.log.error('process failed, unhandled exit code (2)'); - utils.log.error(''); - utils.log.error('Either the command has a syntax error,'); - utils.log.error('or it is exiting with reserved code 2.'); - utils.log.error(''); - utils.log.error('To keep nodemon running even after a code 2,'); - utils.log.error('add this to the end of your command: || exit 1'); - utils.log.error(''); - utils.log.error('Read more here: https://git.io/fNOAG'); - utils.log.error(''); - utils.log.error('nodemon will stop now so that you can fix the command.'); - utils.log.error(''); - bus.emit('error', code); - process.exit(); - } - - // In case we killed the app ourselves, set the signal thusly - if (killedAfterChange) { - killedAfterChange = false; - signal = config.signal; - } - // this is nasty, but it gives it windows support - if (utils.isWindows && signal === 'SIGTERM') { - signal = config.signal; - } - - if (signal === config.signal || code === 0) { - // this was a clean exit, so emit exit, rather than crash - debug('bus.emit(exit) via ' + config.signal); - bus.emit('exit', signal); - - // exit the monitor, but do it gracefully - if (signal === config.signal) { - return restart(); - } - - if (code === 0) { - // clean exit - wait until file change to restart - if (runCmd) { - utils.log.status('clean exit - waiting for changes before restart'); - } - child = null; - } - } else { - bus.emit('crash'); - if (options.exitcrash) { - utils.log.fail('app crashed'); - if (!config.required) { - process.exit(1); - } - } else { - utils.log.fail( - 'app crashed - waiting for file changes before' + ' starting...' - ); - child = null; - } - } - - if (config.options.restartable) { - // stdin needs to kick in again to be able to listen to the - // restart command - process.stdin.resume(); - } - }); - - // moved the run.kill outside to handle both the cases - // intial start - // no start - - // connect stdin to the child process (options.stdin is on by default) - if (options.stdin) { - process.stdin.resume(); - // FIXME decide whether or not we need to decide the encoding - // process.stdin.setEncoding('utf8'); - - // swallow the stdin error if it happens - // ref: https://github.com/remy/nodemon/issues/1195 - if (hasStdio) { - child.stdin.on('error', () => {}); - process.stdin.pipe(child.stdin); - } else { - if (child.stdout) { - child.stdout.pipe(process.stdout); - } else { - utils.log.error( - 'running an unsupported version of node ' + process.version - ); - utils.log.error( - 'nodemon may not work as expected - ' + - 'please consider upgrading to LTS' - ); - } - } - - bus.once('exit', function () { - if (child && process.stdin.unpipe) { - // node > 0.8 - process.stdin.unpipe(child.stdin); - } - }); - } - - debug('start watch on: %s', config.options.watch); - if (config.options.watch !== false) { - watch(); - } -} - -function waitForSubProcesses(pid, callback) { - debug('checking ps tree for pids of ' + pid); - psTree(pid, (err, pids) => { - if (!pids.length) { - return callback(); - } - - utils.log.status( - `still waiting for ${pids.length} sub-process${ - pids.length > 2 ? 'es' : '' - } to finish...` - ); - setTimeout(() => waitForSubProcesses(pid, callback), 1000); - }); -} - -function kill(child, signal, callback) { - if (!callback) { - callback = noop; - } - - if (utils.isWindows) { - const taskKill = () => { - try { - exec('taskkill /pid ' + child.pid + ' /T /F'); - } catch (e) { - utils.log.error('Could not shutdown sub process cleanly'); - } - }; - - // We are handling a 'SIGKILL' , 'SIGUSR2' and 'SIGUSR1' POSIX signal under Windows the - // same way it is handled on a UNIX system: We are performing - // a hard shutdown without waiting for the process to clean-up. - if (signal === 'SIGKILL' || osRelease < 10 || signal === 'SIGUSR2' || signal==="SIGUSR1" ) { - debug('terminating process group by force: %s', child.pid); - - // We are using the taskkill utility to terminate the whole - // process group ('/t') of the child ('/pid') by force ('/f'). - // We need to end all sub processes, because the 'child' - // process in this context is actually a cmd.exe wrapper. - taskKill(); - callback(); - return; - } - - try { - // We are using the Windows Management Instrumentation Command-line - // (wmic.exe) to resolve the sub-child process identifier, because the - // 'child' process in this context is actually a cmd.exe wrapper. - // We want to send the termination signal directly to the node process. - // The '2> nul' silences the no process found error message. - const resultBuffer = execSync( - `wmic process where (ParentProcessId=${child.pid}) get ProcessId 2> nul` - ); - const result = resultBuffer.toString().match(/^[0-9]+/m); - - // If there is no sub-child process we fall back to the child process. - const processId = Array.isArray(result) ? result[0] : child.pid; - - debug('sending kill signal SIGINT to process: %s', processId); - - // We are using the standalone 'windows-kill' executable to send the - // standard POSIX signal 'SIGINT' to the node process. This fixes #1720. - const windowsKill = path.normalize( - `${__dirname}/../../bin/windows-kill.exe` - ); - - // We have to detach the 'windows-kill' execution completely from this - // process group to avoid terminating the nodemon process itself. - // See: https://github.com/alirdn/windows-kill#how-it-works--limitations - // - // Therefore we are using 'start' to create a new cmd.exe context. - // The '/min' option hides the new terminal window and the '/wait' - // option lets the process wait for the command to finish. - - execSync( - `start "windows-kill" /min /wait "${windowsKill}" -SIGINT ${processId}` - ); - } catch (e) { - taskKill(); - } - callback(); - } else { - // we use psTree to kill the full subtree of nodemon, because when - // spawning processes like `coffee` under the `--debug` flag, it'll spawn - // it's own child, and that can't be killed by nodemon, so psTree gives us - // an array of PIDs that have spawned under nodemon, and we send each the - // configured signal (default: SIGUSR2) signal, which fixes #335 - // note that psTree also works if `ps` is missing by looking in /proc - let sig = signal.replace('SIG', ''); - - psTree(child.pid, function (err, pids) { - // if ps isn't native to the OS, then we need to send the numeric value - // for the signal during the kill, `signals` is a lookup table for that. - if (!psTree.hasPS) { - sig = signals[signal]; - } - - // the sub processes need to be killed from smallest to largest - debug('sending kill signal to ' + pids.join(', ')); - - child.kill(signal); - - pids.sort().forEach((pid) => exec(`kill -${sig} ${pid}`, noop)); - - waitForSubProcesses(child.pid, () => { - // finally kill the main user process - exec(`kill -${sig} ${child.pid}`, callback); - }); - }); - } -} - -run.kill = function (noRestart, callback) { - // I hate code like this :( - Remy (author of said code) - if (typeof noRestart === 'function') { - callback = noRestart; - noRestart = false; - } - - if (!callback) { - callback = noop; - } - - if (child !== null) { - // if the stdin piping is on, we need to unpipe, but also close stdin on - // the child, otherwise linux can throw EPIPE or ECONNRESET errors. - if (run.options.stdin) { - process.stdin.unpipe(child.stdin); - } - - // For the on('exit', ...) handler above the following looks like a - // crash, so we set the killedAfterChange flag if a restart is planned - if (!noRestart) { - killedAfterChange = true; - } - - /* Now kill the entire subtree of processes belonging to nodemon */ - var oldPid = child.pid; - if (child) { - kill(child, config.signal, function () { - // this seems to fix the 0.11.x issue with the "rs" restart command, - // though I'm unsure why. it seems like more data is streamed in to - // stdin after we close. - if (child && run.options.stdin && child.stdin && oldPid === child.pid) { - child.stdin.end(); - } - callback(); - }); - } - } else if (!noRestart) { - // if there's no child, then we need to manually start the process - // this is because as there was no child, the child.on('exit') event - // handler doesn't exist which would normally trigger the restart. - bus.once('start', callback); - run.restart(); - } else { - callback(); - } -}; - -run.restart = noop; - -bus.on('quit', function onQuit(code) { - if (code === undefined) { - code = 0; - } - - // remove event listener - var exitTimer = null; - var exit = function () { - clearTimeout(exitTimer); - exit = noop; // null out in case of race condition - child = null; - if (!config.required) { - // Execute all other quit listeners. - bus.listeners('quit').forEach(function (listener) { - if (listener !== onQuit) { - listener(); - } - }); - process.exit(code); - } else { - bus.emit('exit'); - } - }; - - // if we're not running already, don't bother with trying to kill - if (config.run === false) { - return exit(); - } - - // immediately try to stop any polling - config.run = false; - - if (child) { - // give up waiting for the kids after 10 seconds - exitTimer = setTimeout(exit, 10 * 1000); - child.removeAllListeners('exit'); - child.once('exit', exit); - - kill(child, 'SIGINT'); - } else { - exit(); - } -}); - -bus.on('restart', function () { - // run.kill will send a SIGINT to the child process, which will cause it - // to terminate, which in turn uses the 'exit' event handler to restart - run.kill(); -}); - -// remove the child file on exit -process.on('exit', function () { - utils.log.detail('exiting'); - if (child) { - child.kill(); - } -}); - -// because windows borks when listening for the SIG* events -if (!utils.isWindows) { - bus.once('boot', () => { - // usual suspect: ctrl+c exit - process.once('SIGINT', () => bus.emit('quit', 130)); - process.once('SIGTERM', () => { - bus.emit('quit', 143); - if (child) { - child.kill('SIGTERM'); - } - }); - }); -} - -module.exports = run; diff --git a/node_modules/nodemon/lib/monitor/signals.js b/node_modules/nodemon/lib/monitor/signals.js deleted file mode 100644 index daff6e0..0000000 --- a/node_modules/nodemon/lib/monitor/signals.js +++ /dev/null @@ -1,34 +0,0 @@ -module.exports = { - SIGHUP: 1, - SIGINT: 2, - SIGQUIT: 3, - SIGILL: 4, - SIGTRAP: 5, - SIGABRT: 6, - SIGBUS: 7, - SIGFPE: 8, - SIGKILL: 9, - SIGUSR1: 10, - SIGSEGV: 11, - SIGUSR2: 12, - SIGPIPE: 13, - SIGALRM: 14, - SIGTERM: 15, - SIGSTKFLT: 16, - SIGCHLD: 17, - SIGCONT: 18, - SIGSTOP: 19, - SIGTSTP: 20, - SIGTTIN: 21, - SIGTTOU: 22, - SIGURG: 23, - SIGXCPU: 24, - SIGXFSZ: 25, - SIGVTALRM: 26, - SIGPROF: 27, - SIGWINCH: 28, - SIGIO: 29, - SIGPWR: 30, - SIGSYS: 31, - SIGRTMIN: 35, -} diff --git a/node_modules/nodemon/lib/monitor/watch.js b/node_modules/nodemon/lib/monitor/watch.js deleted file mode 100644 index 1ef1408..0000000 --- a/node_modules/nodemon/lib/monitor/watch.js +++ /dev/null @@ -1,239 +0,0 @@ -module.exports.watch = watch; -module.exports.resetWatchers = resetWatchers; - -var debug = require('debug')('nodemon:watch'); -var debugRoot = require('debug')('nodemon'); -var chokidar = require('chokidar'); -var undefsafe = require('undefsafe'); -var config = require('../config'); -var path = require('path'); -var utils = require('../utils'); -var bus = utils.bus; -var match = require('./match'); -var watchers = []; -var debouncedBus; - -bus.on('reset', resetWatchers); - -function resetWatchers() { - debugRoot('resetting watchers'); - watchers.forEach(function (watcher) { - watcher.close(); - }); - watchers = []; -} - -function watch() { - if (watchers.length) { - debug('early exit on watch, still watching (%s)', watchers.length); - return; - } - - var dirs = [].slice.call(config.dirs); - - debugRoot('start watch on: %s', dirs.join(', ')); - const rootIgnored = config.options.ignore; - debugRoot('ignored', rootIgnored); - - var watchedFiles = []; - - const promise = new Promise(function (resolve) { - const dotFilePattern = /[/\\]\./; - var ignored = match.rulesToMonitor( - [], // not needed - Array.from(rootIgnored), - config - ).map(pattern => pattern.slice(1)); - - const addDotFile = dirs.filter(dir => dir.match(dotFilePattern)); - - // don't ignore dotfiles if explicitly watched. - if (addDotFile.length === 0) { - ignored.push(dotFilePattern); - } - - var watchOptions = { - ignorePermissionErrors: true, - ignored: ignored, - persistent: true, - usePolling: config.options.legacyWatch || false, - interval: config.options.pollingInterval, - // note to future developer: I've gone back and forth on adding `cwd` - // to the props and in some cases it fixes bugs but typically it causes - // bugs elsewhere (since nodemon is used is so many ways). the final - // decision is to *not* use it at all and work around it - // cwd: ... - }; - - if (utils.isWindows) { - watchOptions.disableGlobbing = true; - } - - if (process.env.TEST) { - watchOptions.useFsEvents = false; - } - - var watcher = chokidar.watch( - dirs, - Object.assign({}, watchOptions, config.options.watchOptions || {}) - ); - - watcher.ready = false; - - var total = 0; - - watcher.on('change', filterAndRestart); - watcher.on('add', function (file) { - if (watcher.ready) { - return filterAndRestart(file); - } - - watchedFiles.push(file); - bus.emit('watching', file); - debug('chokidar watching: %s', file); - }); - watcher.on('ready', function () { - watchedFiles = Array.from(new Set(watchedFiles)); // ensure no dupes - total = watchedFiles.length; - watcher.ready = true; - resolve(total); - debugRoot('watch is complete'); - }); - - watcher.on('error', function (error) { - if (error.code === 'EINVAL') { - utils.log.error( - 'Internal watch failed. Likely cause: too many ' + - 'files being watched (perhaps from the root of a drive?\n' + - 'See https://github.com/paulmillr/chokidar/issues/229 for details' - ); - } else { - utils.log.error('Internal watch failed: ' + error.message); - process.exit(1); - } - }); - - watchers.push(watcher); - }); - - return promise.catch(e => { - // this is a core error and it should break nodemon - so I have to break - // out of a promise using the setTimeout - setTimeout(() => { - throw e; - }); - }).then(function () { - utils.log.detail(`watching ${watchedFiles.length} file${ - watchedFiles.length === 1 ? '' : 's'}`); - return watchedFiles; - }); -} - -function filterAndRestart(files) { - if (!Array.isArray(files)) { - files = [files]; - } - - if (files.length) { - var cwd = process.cwd(); - if (this.options && this.options.cwd) { - cwd = this.options.cwd; - } - - utils.log.detail( - 'files triggering change check: ' + - files - .map(file => { - const res = path.relative(cwd, file); - return res; - }) - .join(', ') - ); - - // make sure the path is right and drop an empty - // filenames (sometimes on windows) - files = files.filter(Boolean).map(file => { - return path.relative(process.cwd(), path.relative(cwd, file)); - }); - - if (utils.isWindows) { - // ensure the drive letter is in uppercase (c:\foo -> C:\foo) - files = files.map(f => { - if (f.indexOf(':') === -1) { return f; } - return f[0].toUpperCase() + f.slice(1); - }); - } - - - debug('filterAndRestart on', files); - - var matched = match( - files, - config.options.monitor, - undefsafe(config, 'options.execOptions.ext') - ); - - debug('matched?', JSON.stringify(matched)); - - // if there's no matches, then test to see if the changed file is the - // running script, if so, let's allow a restart - if (config.options.execOptions && config.options.execOptions.script) { - const script = path.resolve(config.options.execOptions.script); - if (matched.result.length === 0 && script) { - const length = script.length; - files.find(file => { - if (file.substr(-length, length) === script) { - matched = { - result: [file], - total: 1, - }; - return true; - } - }); - } - } - - utils.log.detail( - 'changes after filters (before/after): ' + - [files.length, matched.result.length].join('/') - ); - - // reset the last check so we're only looking at recently modified files - config.lastStarted = Date.now(); - - if (matched.result.length) { - if (config.options.delay > 0) { - utils.log.detail('delaying restart for ' + config.options.delay + 'ms'); - if (debouncedBus === undefined) { - debouncedBus = debounce(restartBus, config.options.delay); - } - debouncedBus(matched); - } else { - return restartBus(matched); - } - } - } -} - -function restartBus(matched) { - utils.log.status('restarting due to changes...'); - matched.result.map(file => { - utils.log.detail(path.relative(process.cwd(), file)); - }); - - if (config.options.verbose) { - utils.log._log(''); - } - - bus.emit('restart', matched.result); -} - -function debounce(fn, delay) { - var timer = null; - return function () { - const context = this; - const args = arguments; - clearTimeout(timer); - timer = setTimeout(() =>fn.apply(context, args), delay); - }; -} diff --git a/node_modules/nodemon/lib/nodemon.js b/node_modules/nodemon/lib/nodemon.js deleted file mode 100644 index ce649cb..0000000 --- a/node_modules/nodemon/lib/nodemon.js +++ /dev/null @@ -1,311 +0,0 @@ -var debug = require('debug')('nodemon'); -var path = require('path'); -var monitor = require('./monitor'); -var cli = require('./cli'); -var version = require('./version'); -var util = require('util'); -var utils = require('./utils'); -var bus = utils.bus; -var help = require('./help'); -var config = require('./config'); -var spawn = require('./spawn'); -const defaults = require('./config/defaults') -var eventHandlers = {}; - -// this is fairly dirty, but theoretically sound since it's part of the -// stable module API -config.required = utils.isRequired; - -function nodemon(settings) { - bus.emit('boot'); - nodemon.reset(); - - // allow the cli string as the argument to nodemon, and allow for - // `node nodemon -V app.js` or just `-V app.js` - if (typeof settings === 'string') { - settings = settings.trim(); - if (settings.indexOf('node') !== 0) { - if (settings.indexOf('nodemon') !== 0) { - settings = 'nodemon ' + settings; - } - settings = 'node ' + settings; - } - settings = cli.parse(settings); - } - - // set the debug flag as early as possible to get all the detailed logging - if (settings.verbose) { - utils.debug = true; - } - - if (settings.help) { - if (process.stdout.isTTY) { - process.stdout._handle.setBlocking(true); // nodejs/node#6456 - } - console.log(help(settings.help)); - if (!config.required) { - process.exit(0); - } - } - - if (settings.version) { - version().then(function (v) { - console.log(v); - if (!config.required) { - process.exit(0); - } - }); - return; - } - - // nodemon tools like grunt-nodemon. This affects where - // the script is being run from, and will affect where - // nodemon looks for the nodemon.json files - if (settings.cwd) { - // this is protection to make sure we haven't dont the chdir already... - // say like in cli/parse.js (which is where we do this once already!) - if (process.cwd() !== path.resolve(config.system.cwd, settings.cwd)) { - process.chdir(settings.cwd); - } - } - - const cwd = process.cwd(); - - config.load(settings, function (config) { - if (!config.options.dump && !config.options.execOptions.script && - config.options.execOptions.exec === 'node') { - if (!config.required) { - console.log(help('usage')); - process.exit(); - } - return; - } - - // before we print anything, update the colour setting on logging - utils.colours = config.options.colours; - - // always echo out the current version - utils.log.info(version.pinned); - - const cwd = process.cwd(); - - if (config.options.cwd) { - utils.log.detail('process root: ' + cwd); - } - - config.loaded.map(file => file.replace(cwd, '.')).forEach(file => { - utils.log.detail('reading config ' + file); - }); - - if (config.options.stdin && config.options.restartable) { - // allow nodemon to restart when the use types 'rs\n' - process.stdin.resume(); - process.stdin.setEncoding('utf8'); - process.stdin.on('data', data => { - const str = data.toString().trim().toLowerCase(); - - // if the keys entered match the restartable value, then restart! - if (str === config.options.restartable) { - bus.emit('restart'); - } else if (data.charCodeAt(0) === 12) { // ctrl+l - console.clear(); - } - }); - } else if (config.options.stdin) { - // so let's make sure we don't eat the key presses - // but also, since we're wrapping, watch out for - // special keys, like ctrl+c x 2 or '.exit' or ctrl+d or ctrl+l - var ctrlC = false; - var buffer = ''; - - process.stdin.on('data', function (data) { - data = data.toString(); - buffer += data; - const chr = data.charCodeAt(0); - - // if restartable, echo back - if (chr === 3) { - if (ctrlC) { - process.exit(0); - } - - ctrlC = true; - return; - } else if (buffer === '.exit' || chr === 4) { // ctrl+d - process.exit(); - } else if (chr === 13 || chr === 10) { // enter / carriage return - buffer = ''; - } else if (chr === 12) { // ctrl+l - console.clear(); - buffer = ''; - } - ctrlC = false; - }); - if (process.stdin.setRawMode) { - process.stdin.setRawMode(true); - } - } - - if (config.options.restartable) { - utils.log.info('to restart at any time, enter `' + - config.options.restartable + '`'); - } - - if (!config.required) { - const restartSignal = config.options.signal === 'SIGUSR2' ? 'SIGHUP' : 'SIGUSR2'; - process.on(restartSignal, nodemon.restart); - utils.bus.on('error', () => { - utils.log.fail((new Error().stack)); - }); - utils.log.detail((config.options.restartable ? 'or ' : '') + 'send ' + - restartSignal + ' to ' + process.pid + ' to restart'); - } - - const ignoring = config.options.monitor.map(function (rule) { - if (rule.slice(0, 1) !== '!') { - return false; - } - - rule = rule.slice(1); - - // don't notify of default ignores - if (defaults.ignoreRoot.indexOf(rule) !== -1) { - return false; - return rule.slice(3).slice(0, -3); - } - - if (rule.startsWith(cwd)) { - return rule.replace(cwd, '.'); - } - - return rule; - }).filter(Boolean).join(' '); - if (ignoring) utils.log.detail('ignoring: ' + ignoring); - - utils.log.info('watching path(s): ' + config.options.monitor.map(function (rule) { - if (rule.slice(0, 1) !== '!') { - try { - rule = path.relative(process.cwd(), rule); - } catch (e) {} - - return rule; - } - - return false; - }).filter(Boolean).join(' ')); - - utils.log.info('watching extensions: ' + (config.options.execOptions.ext || '(all)')); - - if (config.options.dump) { - utils.log._log('log', '--------------'); - utils.log._log('log', 'node: ' + process.version); - utils.log._log('log', 'nodemon: ' + version.pinned); - utils.log._log('log', 'command: ' + process.argv.join(' ')); - utils.log._log('log', 'cwd: ' + cwd); - utils.log._log('log', ['OS:', process.platform, process.arch].join(' ')); - utils.log._log('log', '--------------'); - utils.log._log('log', util.inspect(config, { depth: null })); - utils.log._log('log', '--------------'); - if (!config.required) { - process.exit(); - } - - return; - } - - config.run = true; - - if (config.options.stdout === false) { - nodemon.on('start', function () { - nodemon.stdout = bus.stdout; - nodemon.stderr = bus.stderr; - - bus.emit('readable'); - }); - } - - if (config.options.events && Object.keys(config.options.events).length) { - Object.keys(config.options.events).forEach(function (key) { - utils.log.detail('bind ' + key + ' -> `' + - config.options.events[key] + '`'); - nodemon.on(key, function () { - if (config.options && config.options.events) { - spawn(config.options.events[key], config, - [].slice.apply(arguments)); - } - }); - }); - } - - monitor.run(config.options); - - }); - - return nodemon; -} - -nodemon.restart = function () { - utils.log.status('restarting child process'); - bus.emit('restart'); - return nodemon; -}; - -nodemon.addListener = nodemon.on = function (event, handler) { - if (!eventHandlers[event]) { eventHandlers[event] = []; } - eventHandlers[event].push(handler); - bus.on(event, handler); - return nodemon; -}; - -nodemon.once = function (event, handler) { - if (!eventHandlers[event]) { eventHandlers[event] = []; } - eventHandlers[event].push(handler); - bus.once(event, function () { - debug('bus.once(%s)', event); - eventHandlers[event].splice(eventHandlers[event].indexOf(handler), 1); - handler.apply(this, arguments); - }); - return nodemon; -}; - -nodemon.emit = function () { - bus.emit.apply(bus, [].slice.call(arguments)); - return nodemon; -}; - -nodemon.removeAllListeners = function (event) { - // unbind only the `nodemon.on` event handlers - Object.keys(eventHandlers).filter(function (e) { - return event ? e === event : true; - }).forEach(function (event) { - eventHandlers[event].forEach(function (handler) { - bus.removeListener(event, handler); - eventHandlers[event].splice(eventHandlers[event].indexOf(handler), 1); - }); - }); - - return nodemon; -}; - -nodemon.reset = function (done) { - bus.emit('reset', done); -}; - -bus.on('reset', function (done) { - debug('reset'); - nodemon.removeAllListeners(); - monitor.run.kill(true, function () { - utils.reset(); - config.reset(); - config.run = false; - if (done) { - done(); - } - }); -}); - -// expose the full config -nodemon.config = config; - -module.exports = nodemon; - diff --git a/node_modules/nodemon/lib/rules/add.js b/node_modules/nodemon/lib/rules/add.js deleted file mode 100644 index de85bb7..0000000 --- a/node_modules/nodemon/lib/rules/add.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -var utils = require('../utils'); - -// internal -var reEscComments = /\\#/g; -// note that '^^' is used in place of escaped comments -var reUnescapeComments = /\^\^/g; -var reComments = /#.*$/; -var reEscapeChars = /[.|\-[\]()\\]/g; -var reAsterisk = /\*/g; - -module.exports = add; - -/** - * Converts file patterns or regular expressions to nodemon - * compatible RegExp matching rules. Note: the `rules` argument - * object is modified to include the new rule and new RegExp - * - * ### Example: - * - * var rules = { watch: [], ignore: [] }; - * add(rules, 'watch', '*.js'); - * add(rules, 'ignore', '/public/'); - * add(rules, 'watch', ':(\d)*\.js'); // note: string based regexp - * add(rules, 'watch', /\d*\.js/); - * - * @param {Object} rules containing `watch` and `ignore`. Also updated during - * execution - * @param {String} which must be either "watch" or "ignore" - * @param {String|RegExp} the actual rule. - */ -function add(rules, which, rule) { - if (!{ ignore: 1, watch: 1}[which]) { - throw new Error('rules/index.js#add requires "ignore" or "watch" as the ' + - 'first argument'); - } - - if (Array.isArray(rule)) { - rule.forEach(function (rule) { - add(rules, which, rule); - }); - return; - } - - // support the rule being a RegExp, but reformat it to - // the custom :<regexp> format that we're working with. - if (rule instanceof RegExp) { - // rule = ':' + rule.toString().replace(/^\/(.*?)\/$/g, '$1'); - utils.log.error('RegExp format no longer supported, but globs are.'); - return; - } - - // remove comments and trim lines - // this mess of replace methods is escaping "\#" to allow for emacs temp files - - // first up strip comments and remove blank head or tails - rule = (rule || '').replace(reEscComments, '^^') - .replace(reComments, '') - .replace(reUnescapeComments, '#').trim(); - - var regexp = false; - - if (typeof rule === 'string' && rule.substring(0, 1) === ':') { - rule = rule.substring(1); - utils.log.error('RegExp no longer supported: ' + rule); - regexp = true; - } else if (rule.length === 0) { - // blank line (or it was a comment) - return; - } - - if (regexp) { - // rules[which].push(rule); - } else { - // rule = rule.replace(reEscapeChars, '\\$&') - // .replace(reAsterisk, '.*'); - - rules[which].push(rule); - // compile a regexp of all the rules for this ignore or watch - var re = rules[which].map(function (rule) { - return rule.replace(reEscapeChars, '\\$&') - .replace(reAsterisk, '.*'); - }).join('|'); - - // used for the directory matching - rules[which].re = new RegExp(re); - } -} diff --git a/node_modules/nodemon/lib/rules/index.js b/node_modules/nodemon/lib/rules/index.js deleted file mode 100644 index 04aa92f..0000000 --- a/node_modules/nodemon/lib/rules/index.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; -var utils = require('../utils'); -var add = require('./add'); -var parse = require('./parse'); - -// exported -var rules = { ignore: [], watch: [] }; - -/** - * Loads a nodemon config file and populates the ignore - * and watch rules with it's contents, and calls callback - * with the new rules - * - * @param {String} filename - * @param {Function} callback - */ -function load(filename, callback) { - parse(filename, function (err, result) { - if (err) { - // we should have bombed already, but - utils.log.error(err); - callback(err); - } - - if (result.raw) { - result.raw.forEach(add.bind(null, rules, 'ignore')); - } else { - result.ignore.forEach(add.bind(null, rules, 'ignore')); - result.watch.forEach(add.bind(null, rules, 'watch')); - } - - callback(null, rules); - }); -} - -module.exports = { - reset: function () { // just used for testing - rules.ignore.length = rules.watch.length = 0; - delete rules.ignore.re; - delete rules.watch.re; - }, - load: load, - ignore: { - test: add.bind(null, rules, 'ignore'), - add: add.bind(null, rules, 'ignore'), - }, - watch: { - test: add.bind(null, rules, 'watch'), - add: add.bind(null, rules, 'watch'), - }, - add: add.bind(null, rules), - rules: rules, -};
\ No newline at end of file diff --git a/node_modules/nodemon/lib/rules/parse.js b/node_modules/nodemon/lib/rules/parse.js deleted file mode 100644 index 6e1cace..0000000 --- a/node_modules/nodemon/lib/rules/parse.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; -var fs = require('fs'); - -/** - * Parse the nodemon config file, supporting both old style - * plain text config file, and JSON version of the config - * - * @param {String} filename - * @param {Function} callback - */ -function parse(filename, callback) { - var rules = { - ignore: [], - watch: [], - }; - - fs.readFile(filename, 'utf8', function (err, content) { - - if (err) { - return callback(err); - } - - var json = null; - try { - json = JSON.parse(content); - } catch (e) {} - - if (json !== null) { - rules = { - ignore: json.ignore || [], - watch: json.watch || [], - }; - - return callback(null, rules); - } - - // otherwise return the raw file - return callback(null, { raw: content.split(/\n/) }); - }); -} - -module.exports = parse; - diff --git a/node_modules/nodemon/lib/spawn.js b/node_modules/nodemon/lib/spawn.js deleted file mode 100644 index 9aa4f80..0000000 --- a/node_modules/nodemon/lib/spawn.js +++ /dev/null @@ -1,73 +0,0 @@ -const path = require('path'); -const utils = require('./utils'); -const merge = utils.merge; -const bus = utils.bus; -const spawn = require('child_process').spawn; - -module.exports = function spawnCommand(command, config, eventArgs) { - var stdio = ['pipe', 'pipe', 'pipe']; - - if (config.options.stdout) { - stdio = ['pipe', process.stdout, process.stderr]; - } - - const env = merge(process.env, { FILENAME: eventArgs[0] }); - - var sh = 'sh'; - var shFlag = '-c'; - var spawnOptions = { - env: merge(config.options.execOptions.env, env), - stdio: stdio, - }; - - if (!Array.isArray(command)) { - command = [command]; - } - - if (utils.isWindows) { - // if the exec includes a forward slash, reverse it for windows compat - // but *only* apply to the first command, and none of the arguments. - // ref #1251 and #1236 - command = command.map(executable => { - if (executable.indexOf('/') === -1) { - return executable; - } - - return executable.split(' ').map((e, i) => { - if (i === 0) { - return path.normalize(e); - } - return e; - }).join(' '); - }); - // taken from npm's cli: https://git.io/vNFD4 - sh = process.env.comspec || 'cmd'; - shFlag = '/d /s /c'; - spawnOptions.windowsVerbatimArguments = true; - } - - const args = command.join(' '); - const child = spawn(sh, [shFlag, args], spawnOptions); - - if (config.required) { - var emit = { - stdout: function (data) { - bus.emit('stdout', data); - }, - stderr: function (data) { - bus.emit('stderr', data); - }, - }; - - // now work out what to bind to... - if (config.options.stdout) { - child.on('stdout', emit.stdout).on('stderr', emit.stderr); - } else { - child.stdout.on('data', emit.stdout); - child.stderr.on('data', emit.stderr); - - bus.stdout = child.stdout; - bus.stderr = child.stderr; - } - } -}; diff --git a/node_modules/nodemon/lib/utils/bus.js b/node_modules/nodemon/lib/utils/bus.js deleted file mode 100644 index 4e120c5..0000000 --- a/node_modules/nodemon/lib/utils/bus.js +++ /dev/null @@ -1,44 +0,0 @@ -var events = require('events'); -var debug = require('debug')('nodemon'); -var util = require('util'); - -var Bus = function () { - events.EventEmitter.call(this); -}; - -util.inherits(Bus, events.EventEmitter); - -var bus = new Bus(); - -// /* -var collected = {}; -bus.on('newListener', function (event) { - debug('bus new listener: %s (%s)', event, bus.listeners(event).length); - if (!collected[event]) { - collected[event] = true; - bus.on(event, function () { - debug('bus emit: %s', event); - }); - } -}); - -// */ - -// proxy process messages (if forked) to the bus -process.on('message', function (event) { - debug('process.message(%s)', event); - bus.emit(event); -}); - -var emit = bus.emit; - -// if nodemon was spawned via a fork, allow upstream communication -// via process.send -if (process.send) { - bus.emit = function (event, data) { - process.send({ type: event, data: data }); - emit.apply(bus, arguments); - }; -} - -module.exports = bus; diff --git a/node_modules/nodemon/lib/utils/clone.js b/node_modules/nodemon/lib/utils/clone.js deleted file mode 100644 index 6ba6330..0000000 --- a/node_modules/nodemon/lib/utils/clone.js +++ /dev/null @@ -1,40 +0,0 @@ -module.exports = clone; - -// via http://stackoverflow.com/a/728694/22617 -function clone(obj) { - // Handle the 3 simple types, and null or undefined - if (null === obj || 'object' !== typeof obj) { - return obj; - } - - var copy; - - // Handle Date - if (obj instanceof Date) { - copy = new Date(); - copy.setTime(obj.getTime()); - return copy; - } - - // Handle Array - if (obj instanceof Array) { - copy = []; - for (var i = 0, len = obj.length; i < len; i++) { - copy[i] = clone(obj[i]); - } - return copy; - } - - // Handle Object - if (obj instanceof Object) { - copy = {}; - for (var attr in obj) { - if (obj.hasOwnProperty && obj.hasOwnProperty(attr)) { - copy[attr] = clone(obj[attr]); - } - } - return copy; - } - - throw new Error('Unable to copy obj! Its type isn\'t supported.'); -}
\ No newline at end of file diff --git a/node_modules/nodemon/lib/utils/colour.js b/node_modules/nodemon/lib/utils/colour.js deleted file mode 100644 index 8c1b590..0000000 --- a/node_modules/nodemon/lib/utils/colour.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Encodes a string in a colour: red, yellow or green - * @param {String} c colour to highlight in - * @param {String} str the string to encode - * @return {String} coloured string for terminal printing - */ -function colour(c, str) { - return (colour[c] || colour.black) + str + colour.black; -} - -function strip(str) { - re.lastIndex = 0; // reset position - return str.replace(re, ''); -} - -colour.red = '\x1B[31m'; -colour.yellow = '\x1B[33m'; -colour.green = '\x1B[32m'; -colour.black = '\x1B[39m'; - -var reStr = Object.keys(colour).map(key => colour[key]).join('|'); -var re = new RegExp(('(' + reStr + ')').replace(/\[/g, '\\['), 'g'); - -colour.strip = strip; - -module.exports = colour; diff --git a/node_modules/nodemon/lib/utils/index.js b/node_modules/nodemon/lib/utils/index.js deleted file mode 100644 index c480338..0000000 --- a/node_modules/nodemon/lib/utils/index.js +++ /dev/null @@ -1,102 +0,0 @@ -var noop = function () { }; -var path = require('path'); -const semver = require('semver'); -var version = process.versions.node.split('.') || [null, null, null]; - -var utils = (module.exports = { - semver: semver, - satisfies: test => semver.satisfies(process.versions.node, test), - version: { - major: parseInt(version[0] || 0, 10), - minor: parseInt(version[1] || 0, 10), - patch: parseInt(version[2] || 0, 10), - }, - clone: require('./clone'), - merge: require('./merge'), - bus: require('./bus'), - isWindows: process.platform === 'win32', - isMac: process.platform === 'darwin', - isLinux: process.platform === 'linux', - isRequired: (function () { - var p = module.parent; - while (p) { - // in electron.js engine it happens - if (!p.filename) { - return true; - } - if (p.filename.indexOf('bin' + path.sep + 'nodemon.js') !== -1) { - return false; - } - p = p.parent; - } - - return true; - })(), - home: process.env.HOME || process.env.HOMEPATH, - quiet: function () { - // nukes the logging - if (!this.debug) { - for (var method in utils.log) { - if (typeof utils.log[method] === 'function') { - utils.log[method] = noop; - } - } - } - }, - reset: function () { - if (!this.debug) { - for (var method in utils.log) { - if (typeof utils.log[method] === 'function') { - delete utils.log[method]; - } - } - } - this.debug = false; - }, - regexpToText: function (t) { - return t - .replace(/\.\*\\./g, '*.') - .replace(/\\{2}/g, '^^') - .replace(/\\/g, '') - .replace(/\^\^/g, '\\'); - }, - stringify: function (exec, args) { - // serializes an executable string and array of arguments into a string - args = args || []; - - return [exec] - .concat( - args.map(function (arg) { - // if an argument contains a space, we want to show it with quotes - // around it to indicate that it is a single argument - if (arg.length > 0 && arg.indexOf(' ') === -1) { - return arg; - } - // this should correctly escape nested quotes - return JSON.stringify(arg); - }) - ) - .join(' ') - .trim(); - }, -}); - -utils.log = require('./log')(utils.isRequired); - -Object.defineProperty(utils, 'debug', { - set: function (value) { - this.log.debug = value; - }, - get: function () { - return this.log.debug; - }, -}); - -Object.defineProperty(utils, 'colours', { - set: function (value) { - this.log.useColours = value; - }, - get: function () { - return this.log.useColours; - }, -}); diff --git a/node_modules/nodemon/lib/utils/log.js b/node_modules/nodemon/lib/utils/log.js deleted file mode 100644 index 6580087..0000000 --- a/node_modules/nodemon/lib/utils/log.js +++ /dev/null @@ -1,82 +0,0 @@ -var colour = require('./colour'); -var bus = require('./bus'); -var required = false; -var useColours = true; - -var coding = { - log: 'black', - info: 'yellow', - status: 'green', - detail: 'yellow', - fail: 'red', - error: 'red', -}; - -function log(type, text) { - var msg = '[nodemon] ' + (text || ''); - - if (useColours) { - msg = colour(coding[type], msg); - } - - // always push the message through our bus, using nextTick - // to help testing and get _out of_ promises. - process.nextTick(() => { - bus.emit('log', { type: type, message: text, colour: msg }); - }); - - // but if we're running on the command line, also echo out - // question: should we actually just consume our own events? - if (!required) { - if (type === 'error') { - console.error(msg); - } else { - console.log(msg || ''); - } - } -} - -var Logger = function (r) { - if (!(this instanceof Logger)) { - return new Logger(r); - } - this.required(r); - return this; -}; - -Object.keys(coding).forEach(function (type) { - Logger.prototype[type] = log.bind(null, type); -}); - -// detail is for messages that are turned on during debug -Logger.prototype.detail = function (msg) { - if (this.debug) { - log('detail', msg); - } -}; - -Logger.prototype.required = function (val) { - required = val; -}; - -Logger.prototype.debug = false; -Logger.prototype._log = function (type, msg) { - if (required) { - bus.emit('log', { type: type, message: msg || '', colour: msg || '' }); - } else if (type === 'error') { - console.error(msg); - } else { - console.log(msg || ''); - } -}; - -Object.defineProperty(Logger.prototype, 'useColours', { - set: function (val) { - useColours = val; - }, - get: function () { - return useColours; - }, -}); - -module.exports = Logger; diff --git a/node_modules/nodemon/lib/utils/merge.js b/node_modules/nodemon/lib/utils/merge.js deleted file mode 100644 index 1f3440b..0000000 --- a/node_modules/nodemon/lib/utils/merge.js +++ /dev/null @@ -1,47 +0,0 @@ -var clone = require('./clone'); - -module.exports = merge; - -function typesMatch(a, b) { - return (typeof a === typeof b) && (Array.isArray(a) === Array.isArray(b)); -} - -/** - * A deep merge of the source based on the target. - * @param {Object} source [description] - * @param {Object} target [description] - * @return {Object} [description] - */ -function merge(source, target, result) { - if (result === undefined) { - result = clone(source); - } - - // merge missing values from the target to the source - Object.getOwnPropertyNames(target).forEach(function (key) { - if (source[key] === undefined) { - result[key] = target[key]; - } - }); - - Object.getOwnPropertyNames(source).forEach(function (key) { - var value = source[key]; - - if (target[key] && typesMatch(value, target[key])) { - // merge empty values - if (value === '') { - result[key] = target[key]; - } - - if (Array.isArray(value)) { - if (value.length === 0 && target[key].length) { - result[key] = target[key].slice(0); - } - } else if (typeof value === 'object') { - result[key] = merge(value, target[key]); - } - } - }); - - return result; -}
\ No newline at end of file diff --git a/node_modules/nodemon/lib/version.js b/node_modules/nodemon/lib/version.js deleted file mode 100644 index d0f5104..0000000 --- a/node_modules/nodemon/lib/version.js +++ /dev/null @@ -1,100 +0,0 @@ -module.exports = version; -module.exports.pin = pin; - -var fs = require('fs'); -var path = require('path'); -var exec = require('child_process').exec; -var root = null; - -function pin() { - return version().then(function (v) { - version.pinned = v; - }); -} - -function version(callback) { - // first find the package.json as this will be our root - var promise = findPackage(path.dirname(module.parent.filename)) - .then(function (dir) { - // now try to load the package - var v = require(path.resolve(dir, 'package.json')).version; - - if (v && v !== '0.0.0-development') { - return v; - } - - root = dir; - - // else we're in development, give the commit out - // get the last commit and whether the working dir is dirty - var promises = [ - branch().catch(function () { return 'master'; }), - commit().catch(function () { return '<none>'; }), - dirty().catch(function () { return 0; }), - ]; - - // use the cached result as the export - return Promise.all(promises).then(function (res) { - var branch = res[0]; - var commit = res[1]; - var dirtyCount = parseInt(res[2], 10); - var curr = branch + ': ' + commit; - if (dirtyCount !== 0) { - curr += ' (' + dirtyCount + ' dirty files)'; - } - - return curr; - }); - }).catch(function (error) { - console.log(error.stack); - throw error; - }); - - if (callback) { - promise.then(function (res) { - callback(null, res); - }, callback); - } - - return promise; -} - -function findPackage(dir) { - if (dir === '/') { - return Promise.reject(new Error('package not found')); - } - return new Promise(function (resolve) { - fs.stat(path.resolve(dir, 'package.json'), function (error, exists) { - if (error || !exists) { - return resolve(findPackage(path.resolve(dir, '..'))); - } - - resolve(dir); - }); - }); -} - -function command(cmd) { - return new Promise(function (resolve, reject) { - exec(cmd, { cwd: root }, function (err, stdout, stderr) { - var error = stderr.trim(); - if (error) { - return reject(new Error(error)); - } - resolve(stdout.split('\n').join('')); - }); - }); -} - -function commit() { - return command('git rev-parse HEAD'); -} - -function branch() { - return command('git rev-parse --abbrev-ref HEAD'); -} - -function dirty() { - return command('expr $(git status --porcelain 2>/dev/null| ' + - 'egrep "^(M| M)" | wc -l)'); -} diff --git a/node_modules/nodemon/package.json b/node_modules/nodemon/package.json deleted file mode 100644 index b07a63b..0000000 --- a/node_modules/nodemon/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "nodemon", - "homepage": "https://nodemon.io", - "author": { - "name": "Remy Sharp", - "url": "https://github.com/remy" - }, - "bin": { - "nodemon": "./bin/nodemon.js" - }, - "engines": { - "node": ">=8.10.0" - }, - "repository": { - "type": "git", - "url": "https://github.com/remy/nodemon.git" - }, - "description": "Simple monitor script for use during development of a node.js app.", - "keywords": [ - "cli", - "monitor", - "monitor", - "development", - "restart", - "autoload", - "reload", - "terminal" - ], - "license": "MIT", - "main": "./lib/nodemon", - "scripts": { - "commitmsg": "commitlint -e", - "coverage": "istanbul cover _mocha -- --timeout 30000 --ui bdd --reporter list test/**/*.test.js", - "lint": "eslint lib/**/*.js", - ":spec": "node_modules/.bin/mocha --timeout 30000 --ui bdd test/**/*.test.js", - "test": "npm run lint && npm run spec", - "spec": "for FILE in test/**/*.test.js; do echo $FILE; TEST=1 mocha --exit --timeout 30000 $FILE; if [ $? -ne 0 ]; then exit 1; fi; sleep 1; done", - "postspec": "npm run clean", - "clean": "rm -rf test/fixtures/test*.js test/fixtures/test*.md", - "web": "node web", - "semantic-release": "semantic-release", - "prepush": "npm run lint", - "killall": "ps auxww | grep node | grep -v grep | awk '{ print $2 }' | xargs kill -9", - "postinstall": "node bin/postinstall || exit 0" - }, - "devDependencies": { - "@commitlint/cli": "^11.0.0", - "@commitlint/config-conventional": "^11.0.0", - "async": "1.4.2", - "coffee-script": "~1.7.1", - "eslint": "^7.32.0", - "husky": "^7.0.4", - "mocha": "^2.5.3", - "nyc": "^15.1.0", - "proxyquire": "^1.8.0", - "semantic-release": "^18.0.0", - "should": "~4.0.0" - }, - "dependencies": { - "chokidar": "^3.5.2", - "debug": "^3.2.7", - "ignore-by-default": "^1.0.1", - "minimatch": "^3.0.4", - "pstree.remy": "^1.1.8", - "semver": "^5.7.1", - "supports-color": "^5.5.0", - "touch": "^3.1.0", - "undefsafe": "^2.0.5", - "update-notifier": "^5.1.0" - }, - "version": "2.0.15", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/nodemon" - } -} |