hubot-grafana 3.2.2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.js ADDED
@@ -0,0 +1,16 @@
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ es2021: true,
5
+ sinon: true,
6
+ },
7
+ extends: 'airbnb-base',
8
+ overrides: [
9
+ ],
10
+ parserOptions: {
11
+ ecmaVersion: 'latest',
12
+ sourceType: 'module',
13
+ },
14
+ rules: {
15
+ },
16
+ };
@@ -8,19 +8,28 @@ jobs:
8
8
  runs-on: ubuntu-latest
9
9
 
10
10
  strategy:
11
+ fail-fast: false
11
12
  matrix:
12
- node-version: [12.x, 14.x, 16.x]
13
+ node-version: [16.x, 18.x, 20.x]
13
14
 
14
15
  steps:
15
- - uses: actions/checkout@v1
16
+ - uses: actions/checkout@v3
17
+
16
18
  - name: Use Node.js ${{ matrix.node-version }}
17
- uses: actions/setup-node@v1
19
+ uses: actions/setup-node@v3
18
20
  with:
19
21
  node-version: ${{ matrix.node-version }}
20
- - name: npm install, build, and test
22
+
23
+ - name: npm install, build
21
24
  run: |
22
25
  npm ci
23
26
  npm run build --if-present
27
+ env:
28
+ CI: true
29
+
30
+ - name: npm test
31
+ run: |
24
32
  npm test
25
33
  env:
26
34
  CI: true
35
+
package/README.md CHANGED
@@ -60,8 +60,7 @@ export HUBOT_GRAFANA_HOST=https://play.grafana.org
60
60
  export HUBOT_GRAFANA_API_KEY=abcd01234deadbeef01234
61
61
  export HUBOT_GRAFANA_QUERY_TIME_RANGE=1h
62
62
  export HUBOT_GRAFANA_S3_BUCKET=mybucket
63
- export HUBOT_GRAFANA_S3_ACCESS_KEY_ID=ABCDEF123456XYZ
64
- export HUBOT_GRAFANA_S3_SECRET_ACCESS_KEY=aBcD01234dEaDbEef01234
63
+ export HUBOT_GRAFANA_S3_BUCKET_REGION=us-east-1
65
64
  export HUBOT_GRAFANA_S3_PREFIX=graphs
66
65
  ```
67
66
 
package/index.js ADDED
@@ -0,0 +1,21 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ module.exports = function(robot, scripts) {
5
+ const scriptsPath = path.resolve(__dirname, 'src');
6
+ if (fs.existsSync(scriptsPath)) {
7
+ return (() => {
8
+ const result = [];
9
+ for (let script of Array.from(fs.readdirSync(scriptsPath).sort())) {
10
+ if ((scripts != null) && !Array.from(scripts).includes('*')) {
11
+ if (Array.from(scripts).includes(script)) { result.push(robot.loadFile(scriptsPath, script)); } else {
12
+ result.push(undefined);
13
+ }
14
+ } else {
15
+ result.push(robot.loadFile(scriptsPath, script));
16
+ }
17
+ }
18
+ return result;
19
+ })();
20
+ }
21
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hubot-grafana",
3
3
  "description": "Query Grafana dashboards",
4
- "version": "3.2.2",
4
+ "version": "4.0.0",
5
5
  "author": "Stephen Yeargin <stephen@yearg.in>",
6
6
  "license": "MIT",
7
7
  "keywords": [
@@ -18,29 +18,32 @@
18
18
  "url": "https://github.com/stephenyeargin/hubot-grafana/issues"
19
19
  },
20
20
  "dependencies": {
21
- "knox-s3": "^0.9.5",
21
+ "@aws-sdk/client-s3": "^3.370.0",
22
22
  "request": "^2.88.2"
23
23
  },
24
24
  "peerDependencies": {
25
- "hubot": "^3"
25
+ "hubot": ">=2 <10 || 0.0.0-development"
26
26
  },
27
27
  "devDependencies": {
28
28
  "chai": "^4.3.7",
29
- "coffee-script": "^1.12.7",
29
+ "eslint": "^8.45.0",
30
+ "eslint-config-airbnb-base": "^15.0.0",
31
+ "eslint-plugin-import": "^2.27.5",
30
32
  "hubot-test-helper": "^1.9.0",
31
- "husky": "^8.0.2",
32
- "mocha": "^10.1.0",
33
- "nock": "^13.2.9",
34
- "release-it": "^15.5.1",
33
+ "husky": "^8.0.3",
34
+ "mocha": "^10.2.0",
35
+ "nock": "^13.3.2",
36
+ "release-it": "^16.1.0",
35
37
  "require-dir": "^1.2.0",
36
- "sinon": "^15.0.0",
38
+ "sinon": "^15.2.0",
37
39
  "sinon-chai": "^3.7.0",
38
40
  "travis-cov": "^0.2.5"
39
41
  },
40
- "main": "index.coffee",
42
+ "main": "index.js",
41
43
  "scripts": {
42
44
  "release": "release-it",
43
- "test": "mocha --require coffee-script/register \"test/**/*.coffee\" --reporter spec",
44
- "prepare": "husky install"
45
+ "test": "mocha \"test/**/*.js\" --reporter spec",
46
+ "prepare": "husky install",
47
+ "lint": "eslint src/ test/"
45
48
  }
46
49
  }
package/script/bootstrap CHANGED
@@ -4,7 +4,7 @@
4
4
  export NODE_ENV=development
5
5
 
6
6
  # Load environment specific environment variables
7
- if [ -f .env ]; then
7
+ if [ -f .env ]; then
8
8
  source .env
9
9
  fi
10
10
 
@@ -13,6 +13,3 @@ if [ -f .env.${NODE_ENV} ]; then
13
13
  fi
14
14
 
15
15
  npm install
16
-
17
- # Make sure coffee and mocha are on the path
18
- export PATH="node_modules/.bin:$PATH"
package/script/test CHANGED
@@ -3,4 +3,4 @@
3
3
  # bootstrap environment
4
4
  source script/bootstrap
5
5
 
6
- mocha --compilers coffee:coffee-script
6
+ mocha