diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 63ddb66d..05b9aa4d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,6 +54,10 @@ We develop on the `dev` branch. All new pull requests should be targeted to `dev You can get the dev branch checked out using `git checkout dev`. +Once checked out, install the dependencies using `npm install`, then copy the included `my.env.template`file to `my.env` and edit the file to include your settings (like the Mongo URL). Leave the `NODE_ENV=development` line intact. Once set, run the site using `npm run dev`. This will start Nigthscout in the development mode, with different code packaging rules and automatic restarting of the server using nodemon, when you save changed files on disk. The client also hot-reloads new code in, but it's recommended to reload the the website after changes due to the way the plugin sandbox works. + +If you want to additionaly test the site in production mode, create a file called `my.prod.env` that's a copy of the dev file but with `NODE_ENV=production` and start the site using `npm run prod`. + ## Style Guide Some simple rules that will make it easier to maintain our codebase: diff --git a/README.md b/README.md index 3958f79e..070d4457 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,10 @@ SCM_COMMAND_IDLE_TIMEOUT=300 - See [install MongoDB, Node.js, and Nightscouton a single Windows system](https://github.com/jaylagorio/Nightscout-on-Windows-Server). if you want to host your Nightscout outside of the cloud. Although the instructions are intended for Windows Server the procedure is compatible with client versions of Windows such as Windows 7 and Windows 10. - If you deploy to Windows and want to develop or test you need to install [Cygwin](https://www.cygwin.com/) (use [setup-x86_64.exe](https://www.cygwin.com/setup-x86_64.exe) and make sure to install `build-essential` package. Test your configuration by executing `make` and check if all tests are ok. +# Development + +Wanna help with development, or just see how Nigthscout works? Great! See [CONTRIBUTING.md](CONTRIBUTING.md) for development related documentation. + # Usage The data being uploaded from the server to the client is from a diff --git a/app.js b/app.js index aa84a5ec..d79b3178 100644 --- a/app.js +++ b/app.js @@ -234,19 +234,6 @@ function create(env, ctx) { console.log('Development mode'); - const chokidar = require('chokidar'); - - const watcher = chokidar.watch('lib/', { - ignored: 'lib/client/**/*.js' - }); - - watcher.on('change', function () { - console.log("Clearing /lib/ module cache from server"); - Object.keys(require.cache).forEach(function (id) { - if (/[\/\\]lib[\/\\]/.test(id)) delete require.cache[id]; - }); - }); - app.locals.bundle = '/devbundle'; const webpack = require('webpack'); diff --git a/package.json b/package.json index 33c4005c..93611a0a 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,6 @@ "nodemon": "^1.19.0", "babel-eslint": "^10.0.2", "benv": "^3.3.0", - "chokidar": "^3.0.1", "env-cmd": "^8.0.2", "eslint": "^6.0.1", "eslint-loader": "^2.1.2",