Skip to content

Commit 0b12d17

Browse files
Merge pull request #2 from nightscout/dev
Dev
2 parents 8fb02e6 + 9236771 commit 0b12d17

File tree

213 files changed

+16188
-3393
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+16188
-3393
lines changed

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ module.exports = {
99
"commonjs": true,
1010
"es6": true,
1111
"node": true,
12+
"mocha": true,
1213
"jquery": true
14+
},
15+
"rules": {
16+
"no-unused-vars": [
17+
"error",
18+
{
19+
"varsIgnorePattern": "should|expect"
20+
}
21+
]
1322
}
1423
};

.github/workflows/main.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-16.04
9+
10+
strategy:
11+
matrix:
12+
node-version: [10.x, 12.x]
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- name: Install dependencies
21+
run: npm install
22+
- name: Install MongoDB
23+
run: |
24+
wget -qO - https://www.mongodb.org/static/pgp/server-3.6.asc | sudo apt-key add -
25+
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
26+
sudo apt-get update
27+
sudo apt-get install -y mongodb-org
28+
sudo apt-get install -y --allow-downgrades mongodb-org=3.6.14 mongodb-org-server=3.6.14 mongodb-org-shell=3.6.14 mongodb-org-mongos=3.6.14 mongodb-org-tools=3.6.14
29+
- name: Start MongoDB
30+
run: sudo systemctl start mongod
31+
- name: Run Tests
32+
run: npm run-script test-ci
33+
- name: Send Coverage
34+
run: npm run-script coverage

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ bundle/bundle.out.js
88
.idea/
99
*.iml
1010
my.env
11+
my.*.env
1112

12-
*.env
1313
static/bower_components/
1414
.*.sw?
1515
.DS_Store
@@ -24,3 +24,9 @@ npm-debug.log
2424
*.heapsnapshot
2525

2626
/tmp
27+
/.vs
28+
/cgm-remote-monitor.njsproj
29+
/cgm-remote-monitor.sln
30+
/obj/Debug
31+
/bin
32+
/*.bat

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ matrix:
2626
include:
2727
- node_js: "10"
2828
<<: *node_js-steps
29-
- node_js: "node" # Latest Node is not supported, and recommend, but we'll test it to know incompatibility issues
29+
- node_js: "12" # Latest Node is not supported, and recommend, but we'll test it to know incompatibility issues
3030
<<: *node_js-steps

CONTRIBUTING.md

Lines changed: 27 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,62 +25,52 @@
2525
[![Build Status][build-img]][build-url]
2626
[![Dependency Status][dependency-img]][dependency-url]
2727
[![Coverage Status][coverage-img]][coverage-url]
28-
[![Gitter chat][gitter-img]][gitter-url]
29-
[![Stories in Ready][ready-img]][waffle]
30-
[![Stories in Progress][progress-img]][waffle]
28+
[![Discord chat][discord-img]][discord-url]
3129

3230
[build-img]: https://img.shields.io/travis/nightscout/cgm-remote-monitor.svg
3331
[build-url]: https://travis-ci.org/nightscout/cgm-remote-monitor
3432
[dependency-img]: https://img.shields.io/david/nightscout/cgm-remote-monitor.svg
3533
[dependency-url]: https://david-dm.org/nightscout/cgm-remote-monitor
3634
[coverage-img]: https://img.shields.io/coveralls/nightscout/cgm-remote-monitor/master.svg
3735
[coverage-url]: https://coveralls.io/r/nightscout/cgm-remote-monitor?branch=master
38-
[gitter-img]: https://img.shields.io/badge/Gitter-Join%20Chat%20%E2%86%92-1dce73.svg
39-
[gitter-url]: https://gitter.im/nightscout/public
40-
[ready-img]: https://badge.waffle.io/nightscout/cgm-remote-monitor.svg?label=ready&title=Ready
41-
[waffle]: https://waffle.io/nightscout/cgm-remote-monitor
42-
[progress-img]: https://badge.waffle.io/nightscout/cgm-remote-monitor.svg?label=in+progress&title=In+Progress
36+
[discord-img]: https://img.shields.io/discord/629952586895851530?label=discord%20chat
37+
[discord-url]: https://discord.gg/rTKhrqz
4338

4439
## Installation for development
4540

4641
Nightscout is a Node.js application. The basic installation of the software for local purposes is:
4742

4843
1. Clone the software to your local machine using git
4944
2. Install Node from https://nodejs.org/en/download/
50-
2. Use `npm` to install Nightscout dependencies by invokin `npm install` in the project directory. Note the
51-
dependency installation has to be done usign a non-root user - _do not use root_ for development and hosting
45+
2. Use `npm` to install Nightscout dependencies by invoking `npm install` in the project directory. Note the
46+
dependency installation has to be done using a non-root user - _do not use root_ for development and hosting
5247
the software!
53-
3. Get a Mongo database by either installing Mongo locally, or get a free cloud account from mLab or Mongodb Atlas.
54-
4. Configure nightscout by copying `my.env.template` to `my.env` and run it - see the next chapter in the instructions
48+
3. Get a Mongo database by either installing Mongo locally, or get a free cloud account from mLab or MongoDB Atlas.
49+
4. Configure Nightscout by copying `my.env.template` to `my.env` and run it - see the next chapter in the instructions
5550

5651
## Develop on `dev`
5752

5853
We develop on the `dev` branch. All new pull requests should be targeted to `dev`. The `master` branch is only used for distributing the latest version of the tested sources.
5954

6055
You can get the `dev` branch checked out using `git checkout dev`.
6156

62-
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.
57+
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 Nightscout 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 website after changes due to the way the plugin sandbox works.
6358

6459
Note the template sets `INSECURE_USE_HTTP` to `true` to enable the site to work over HTTP in local development.
6560

6661
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`.
6762

6863
## REST API
6964

70-
Nightscout implements a REST API for data syncronization. The API is documented using Swagger. To access the documentation
71-
for the API, run Nightscout locally and load the documentation from /api-docs (or read the associated swagger.json and swagger.yaml
72-
files locally).
65+
Nightscout implements a REST API for data syncronization. The API is documented using Swagger. To access the documentation for the API, run Nightscout locally and load the documentation from /api-docs (or read the associated swagger.json and swagger.yaml files locally).
7366

74-
Note all dates used to access the API and dates stored in the objects are expected to comply with the ISO-8601 format and
75-
be deserializable by the Javascript Date class. Of note here is the dates can contain a plus sign which has a special meaning in
76-
URL encoding, so when issuing requests that place dates to the URL, take special care to ensure the data is properly URL
77-
encoded.
67+
Note all dates used to access the API and dates stored in the objects are expected to comply with the ISO-8601 format and be deserializable by the Javascript Date class. Of note here is the dates can contain a plus sign which has a special meaning in URL encoding, so when issuing requests that place dates to the URL, take special care to ensure the data is properly URL encoded.
7868

7969
## Design & new features
8070

8171
If you intend to add a new feature, please allow the community to participate in the design process by creating an issue to discuss your design. For new features, the issue should describe what use cases the new feature intends to solve, or which existing use cases are being improved.
8272

83-
Note Nighscout has a plugin architecture for adding new features. We expect most code for new features live inside a Plugin, so the code retains a clear separation of concerns. If the Plugin API doesn't implement all features you need to implement your feature, please discuss with us on adding those features to the API. Note new features should under almost no circumstances require changes to the existing plugins.
73+
Note Nightscout has a plugin architecture for adding new features. We expect most code for new features live inside a Plugin, so the code retains a clear separation of concerns. If the Plugin API doesn't implement all features you need to implement your feature, please discuss with us on adding those features to the API. Note new features should under almost no circumstances require changes to the existing plugins.
8474

8575
## Style Guide
8676

@@ -105,7 +95,7 @@ If in doubt, format your code with `js-beautify --indent-size 2 --comma-first -
10595

10696
## Create a prototype
10797

108-
Fork cgm-remote-monitor and create a branch. You can create a branch using `git checkout -b wip/add-my-widget`. This creates a new branch called `wip/add-my-widget`. The `wip` stands for work in progress and is a common prefix so that when know what to expect when reviewing many branches.
98+
Fork cgm-remote-monitor and create a branch. You can create a branch using `git checkout -b wip/add-my-widget`. This creates a new branch called `wip/add-my-widget`. The "`wip`" stands for work-in-progress and is a common prefix so that we know what to expect when reviewing many branches.
10999

110100
## Submit a pull request
111101

@@ -115,11 +105,9 @@ This can be done by checking your code `git commit -avm 'my improvements are her
115105

116106
Now that the commits are available on github, you can click on the compare buttons on your fork to create a pull request. Make sure to select [Nightscout's `dev` branch](https://github.com/nightscout/cgm-remote-monitor/tree/dev).
117107

118-
We assume all new Pull Requests are at least smoke tested by the author and all code in the PR actually works.
119-
Please include a description of what the features do and rationalize why the changes are needed.
108+
We assume all new Pull Requests are at least smoke tested by the author and all code in the PR actually works. Please include a description of what the features do and rationalize why the changes are needed.
120109

121-
If you add any new NPM module dependencies, you have to rationalize why there are needed - we prefer pull requests that reduce dependencies, not add them.
122-
Before releasing a a new version, we check with `npm audit` if our dependencies don't have known security issues.
110+
If you add any new NPM module dependencies, you have to rationalize why they are needed - we prefer pull requests that reduce dependencies, not add them. Before releasing a a new version, we check with `npm audit` if our dependencies don't have known security issues.
123111

124112
When adding new features that add configuration options, please ensure the `README` document is amended with information on the new configuration.
125113

@@ -142,7 +130,7 @@ We encourage liberal use of the comments, including images where appropriate.
142130

143131
## Co-ordination
144132

145-
Most cgm-remote-monitor hackers use github's ticketing system, along with Facebook cgm-in-the-cloud, and gitter.
133+
We primarily use GitHub's ticketing system for discussing PRs and bugs, and [Discord][discord-url] for general development chatter.
146134

147135
We use git-flow, with `master` as our production, stable branch, and `dev` is used to queue up for upcoming releases. Everything else is done on branches, hopefully with names that indicate what to expect.
148136

@@ -152,7 +140,7 @@ Every commit is tested by travis. We encourage adding tests to validate your de
152140

153141
## Other Dev Tips
154142

155-
* Join the [Gitter chat][gitter-url]
143+
* Join the [Discord chat][discord-url].
156144
* Get a local dev environment setup if you haven't already.
157145
* Try breaking up big features/improvements into small parts. It's much easier to accept small PR's.
158146
* Create tests for your new code as well as the old code. We are aiming for a full test coverage.
@@ -193,6 +181,7 @@ Also if you can't code, it's possible to contribute by improving the documentati
193181
[@unsoluble]: https://github.com/unsoluble
194182
[@viderehh]: https://github.com/viderehh
195183
[@OpossumGit]: https://github.com/OpossumGit
184+
[@Bartlomiejsz]: https://github.com/Bartlomiejsz
196185

197186
| Contribution area | List of contributors |
198187
| ------------------------------------- | ---------------------------------- |
@@ -203,13 +192,13 @@ Also if you can't code, it's possible to contribute by improving the documentati
203192
| Release coordination 0.11.x: | [@PieterGit] |
204193
| Issue/Pull request coordination: | Please volunteer |
205194
| Cleaning up git fork spam: | Please volunteer |
206-
| Documentation writers: | [@andrew-warrington][@unsoluble] [@tynbendad] [@danamlewis] [@rarneson] |
195+
| Documentation writers: | [@andrew-warrington] [@unsoluble] [@tynbendad] [@danamlewis] [@rarneson] |
207196

208197
### Plugin contributors
209198

210199
| Contribution area | List of developers | List of testers
211200
| ------------------------------------- | -------------------- | -------------------- |
212-
| [`alexa` (Amazon Alexa)](README.md#alexa-amazon-alexa)| Please volunteer | Please volunteer |
201+
| [`alexa` (Amazon Alexa)](README.md#alexa-amazon-alexa)| [@inventor96] | Please volunteer |
213202
| [`ar2` (AR2 Forecasting)](README.md#ar2-ar2-forecasting)| Please volunteer | Please volunteer |
214203
| [`basal` (Basal Profile)](README.md#basal-basal-profile)| Please volunteer | Please volunteer |
215204
| [`boluscalc` (Bolus Wizard)](README.md#boluscalc-bolus-wizard)| Please volunteer | Please volunteer |
@@ -224,7 +213,7 @@ Also if you can't code, it's possible to contribute by improving the documentati
224213
| [`direction` (BG Direction)](README.md#direction-bg-direction)| Please volunteer | Please volunteer |
225214
| [`errorcodes` (CGM Error Codes)](README.md#errorcodes-cgm-error-codes)| Please volunteer | Please volunteer |
226215
| [`food` (Custom Foods)](README.md#food-custom-foods)| Please volunteer | Please volunteer |
227-
| [`googlehome` (Google Home)](README.md#google-home) |[@mdomox] [@rickfriele] | [@mcdafydd] [@oteroos] [@jamieowendexcom] |
216+
| [`googlehome` (Google Home/DialogFlow)](README.md#googlehome-google-homedialogflow)| [@mdomox] [@rickfriele] [@inventor96] | [@mcdafydd] [@oteroos] [@jamieowendexcom] |
228217
| [`iage` (Insulin Age)](README.md#iage-insulin-age)| Please volunteer | Please volunteer |
229218
| [`iob` (Insulin-on-Board)](README.md#iob-insulin-on-board)| Please volunteer | Please volunteer |
230219
| [`loop` (Loop)](README.md#loop-loop)| Please volunteer | Please volunteer |
@@ -233,9 +222,9 @@ Also if you can't code, it's possible to contribute by improving the documentati
233222
| [`profile` (Treatment Profile)](README.md#profile-treatment-profile)| Please volunteer | Please volunteer |
234223
| [`pump` (Pump Monitoring)](README.md#pump-pump-monitoring)| Please volunteer | Please volunteer |
235224
| [`rawbg` (Raw BG)](README.md#rawbg-raw-bg)| [@jpcunningh] | Please volunteer |
236-
| [`sage` (Sensor Age)](README.md#sage-sensor-age)| @jpcunningh | Please volunteer |
225+
| [`sage` (Sensor Age)](README.md#sage-sensor-age)| [@jpcunningh] | Please volunteer |
237226
| [`simplealarms` (Simple BG Alarms)](README.md#simplealarms-simple-bg-alarms)| Please volunteer | Please volunteer |
238-
| [`speech` (Speech)](README.md#speech-speech) | [@sulkaharo] | Please volunteer |
227+
| [`speech` (Speech)](README.md#speech-speech)| [@sulkaharo] | Please volunteer |
239228
| [`timeago` (Time Ago)](README.md#timeago-time-ago)| Please volunteer | Please volunteer |
240229
| [`treatmentnotify` (Treatment Notifications)](README.md#treatmentnotify-treatment-notifications)| Please volunteer | Please volunteer |
241230
| [`upbat` (Uploader Battery)](README.md#upbat-uploader-battery)| [@jpcunningh] | Please volunteer |
@@ -252,19 +241,19 @@ Languages with less than 90% coverage will be removed in a future Nightscout ver
252241
| Čeština (`cs`) |Please volunteer|OK |
253242
| Deutsch (`de`) |[@viderehh] [@herzogmedia] |OK |
254243
| Dansk (`dk`) | [@janrpn] |OK |
255-
| Ελληνικά `(el`)|Please volunteer|Needs attention: 68.5%|
244+
| Ελληνικά (`el`)|Please volunteer|Needs attention: 68.5%|
256245
| English (`en`)|Please volunteer|OK|
257246
| Español (`es`) |Please volunteer|OK|
258247
| Suomi (`fi`)|[@sulkaharo] |OK|
259248
| Français (`fr`)|Please volunteer|OK|
260-
| עברית (`he`)|Please volunteer|OK|
261-
| Hrvatski (`hr`)|[@OpossumGit]|Needs attention: 47.8% - committed 100% to dev|
249+
| עברית (`he`)| [@jakebloom] |OK|
250+
| Hrvatski (`hr`)|[@OpossumGit]|OK|
262251
| Italiano (`it`)|Please volunteer|OK|
263252
| 日本語 (`ja`)|[@LuminaryXion]|Working on this|
264253
| 한국어 (`ko`)|Please volunteer|Needs attention: 80.6%|
265254
| Norsk (Bokmål) (`nb`)|Please volunteer|OK|
266255
| Nederlands (`nl`)|[@PieterGit]|OK|
267-
| Polski (`pl`)|Please volunteer|OK|
256+
| Polski (`pl`)|[@Bartlomiejsz]|OK|
268257
| Português (Brasil) (`pt`)|Please volunteer|OK|
269258
| Română (`ro`)|Please volunteer|OK|
270259
| Русский (`ru`)|[@apanasef]|OK|
@@ -279,7 +268,7 @@ Languages with less than 90% coverage will be removed in a future Nightscout ver
279268
### List of all contributors
280269
| Contribution area | List of contributors |
281270
| ------------------------------------- | -------------------- |
282-
| All active developers: | [@jasoncalabrese] [@jpcunningh] [@jweismann] [@komarserjio] [@mdomox] [@MilosKozak] [@PieterGit] [@rickfriele] [@sulkaharo]
271+
| All active developers: | [@jasoncalabrese] [@jpcunningh] [@jweismann] [@komarserjio] [@mdomox] [@MilosKozak] [@PieterGit] [@rickfriele] [@sulkaharo] [@unsoluble]
283272
| All active testers/documentors: | [@danamlewis] [@jamieowendexcom] [@mcdafydd] [@oteroos] [@rarneson] [@tynbendad] [@unsoluble]
284273
| All active translators: | [@apanasef] [@jizhongwen] [@viderehh] [@herzogmedia] [@LuminaryXion] [@OpossumGit]
285274

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ report:
4343

4444
test_onebyone:
4545
python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
46-
$(foreach var,$(wildcard tests/*.js),${MONGO_SETTINGS} ${MOCHA} --timeout 30000 --exit --bail -R tap $(var);)
46+
for var in tests/*.js; do ${MONGO_SETTINGS} ${MOCHA} --timeout 30000 --exit --bail -R tap $$var; done | tap-set-exit
4747

4848
test:
4949
${MONGO_SETTINGS} ${MOCHA} --timeout 30000 --exit --bail -R tap ${TESTS}
@@ -52,7 +52,7 @@ travis:
5252
python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
5353
# NODE_ENV=test ${MONGO_SETTINGS} \
5454
# ${ISTANBUL} cover ${MOCHA} --report lcovonly -- --timeout 5000 -R tap ${TESTS}
55-
$(foreach var,$(wildcard tests/*.js),${MONGO_SETTINGS} ${MOCHA} --timeout 30000 --exit --bail -R tap $(var);)
55+
for var in tests/*.js; do ${MONGO_SETTINGS} ${MOCHA} --timeout 30000 --exit --bail -R tap $$var; done
5656

5757
docker_release:
5858
# Get the version from the package.json file

0 commit comments

Comments
 (0)