Skip to content

Commit

Permalink
chore: fix workflow os matrix (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud authored Jul 12, 2024
1 parent 63510c4 commit 6b1efb3
Show file tree
Hide file tree
Showing 11 changed files with 97 additions and 88 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

10 changes: 0 additions & 10 deletions .eslintrc

This file was deleted.

1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ on:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: [18.x, 20.x]
node-version: [18, 20]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
package-lock=false
save-exact=true
15 changes: 0 additions & 15 deletions .prettierrc

This file was deleted.

15 changes: 15 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"singleQuote": false,
"trailingComma": "all",
"useTabs": true,
"printWidth": 120,
"overrides": [
{
"files": ["*.yml", "*.json"],
"options": {
"tabWidth": 2,
"useTabs": false
}
}
]
}
22 changes: 22 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import prettierConfig from "eslint-config-prettier";
import prettierPlugin from "eslint-plugin-prettier/recommended";
import globals from "globals";
import js from "@eslint/js";

export default [
js.configs.recommended,
prettierConfig,
prettierPlugin,
{
languageOptions: {
globals: {
...globals.node,
...globals.browser,
global: true,
},
},
},
{
ignores: ["coverage/*", "dist/*"],
},
];
3 changes: 1 addition & 2 deletions lib/client.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use strict";

/* eslint-disable no-underscore-dangle */
/* eslint prefer-rest-params: "off" */

const timeSpan = require("time-span");
Expand Down Expand Up @@ -49,7 +48,7 @@ const MetricsClient = class MetricsClient extends stream.Transform {
[push](metric) {
const met = metric;
met.source = this.id;
// eslint-disable-next-line no-underscore-dangle

if (this._readableState.flowing) {
this.push(met);
return;
Expand Down
101 changes: 51 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,53 @@
{
"name": "@metrics/client",
"version": "2.5.2",
"description": "A streaming metric producer. Allows producing counters, gauges, histograms and summaries in a way that is independent of your metrics system.",
"main": "lib/client.js",
"types": "client.d.ts",
"files": [
"lib",
"client.d.ts"
],
"scripts": {
"bench": "node benchmark/benchmark.js",
"test": "tap test/*.js --disable-coverage --allow-empty-coverage",
"test:coverage": "tap test/*.js",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"author": "Richard Walker <[email protected]>",
"license": "MIT",
"keywords": [
"server-statistics",
"server-stats",
"statistics",
"metrics",
"monitoring"
],
"dependencies": {
"@metrics/metric": "^2.3.2",
"readable-stream": "^3.4.0",
"time-span": "^4.0.0"
},
"devDependencies": {
"@semantic-release/changelog": "6.0.3",
"@semantic-release/commit-analyzer": "11.1.0",
"@semantic-release/git": "10.0.1",
"@semantic-release/github": "9.2.6",
"@semantic-release/npm": "11.0.3",
"@semantic-release/release-notes-generator": "12.1.0",
"@sinonjs/fake-timers": "11.2.2",
"benchmark": "2.1.4",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.1.3",
"prettier": "3.2.5",
"semantic-release": "23.0.2",
"tap": "18.7.1"
},
"repository": {
"type": "git",
"url": "https://github.com/metrics-js/client.git"
}
"name": "@metrics/client",
"version": "2.5.2",
"description": "A streaming metric producer. Allows producing counters, gauges, histograms and summaries in a way that is independent of your metrics system.",
"main": "lib/client.js",
"types": "client.d.ts",
"files": [
"lib",
"client.d.ts"
],
"scripts": {
"bench": "node benchmark/benchmark.js",
"test": "tap test/*.js --disable-coverage --allow-empty-coverage",
"test:coverage": "tap test/*.js",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"author": "Richard Walker <[email protected]>",
"license": "MIT",
"keywords": [
"server-statistics",
"server-stats",
"statistics",
"metrics",
"monitoring"
],
"dependencies": {
"@metrics/metric": "^2.3.2",
"readable-stream": "^3.4.0",
"time-span": "^4.0.0"
},
"devDependencies": {
"@semantic-release/changelog": "6.0.3",
"@semantic-release/commit-analyzer": "11.1.0",
"@semantic-release/git": "10.0.1",
"@semantic-release/github": "9.2.6",
"@semantic-release/npm": "11.0.3",
"@semantic-release/release-notes-generator": "12.1.0",
"@sinonjs/fake-timers": "11.2.2",
"benchmark": "2.1.4",
"eslint": "9.6.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.1.3",
"globals": "15.8.0",
"prettier": "3.2.5",
"semantic-release": "23.0.2",
"tap": "18.7.1"
},
"repository": {
"type": "git",
"url": "https://github.com/metrics-js/client.git"
}
}
10 changes: 3 additions & 7 deletions test/client.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"use strict";

/* eslint-disable no-console */

const stream = require("readable-stream");
const fakeTimers = require("@sinonjs/fake-timers");
const tap = require("tap");
Expand Down Expand Up @@ -170,7 +168,6 @@ tap.test("client.metric() - metrics is not piped anywhere - should not fill stre
});
}

// eslint-disable-next-line no-underscore-dangle
t.equal(client._readableState.buffer.length, 0);
t.end();
});
Expand All @@ -185,7 +182,7 @@ tap.test("client.metric() - destination is buffering - should emit drop events",
const dest = destObjectStream((result) => {
t.equal(result.length, 16);
t.equal(dropped.length, 4);
// eslint-disable-next-line no-underscore-dangle

t.equal(client._readableState.buffer.length, 0);
t.end();
});
Expand All @@ -203,7 +200,6 @@ tap.test("client.metric() - destination is buffering - should emit drop events",
});
}

// eslint-disable-next-line no-underscore-dangle
t.equal(client._readableState.buffer.length, 0);

setImmediate(() => {
Expand All @@ -219,9 +215,9 @@ tap.test("client.pipe() - pipe streams into each other - should pipe metrics thr
t.equal(result.length, 3);
t.equal(result[0].name, "first");
t.equal(result[2].name, "third");
// eslint-disable-next-line no-underscore-dangle

t.equal(clientA._readableState.buffer.length, 0);
// eslint-disable-next-line no-underscore-dangle

t.equal(clientB._readableState.buffer.length, 0);
t.end();
});
Expand Down

0 comments on commit 6b1efb3

Please sign in to comment.