Skip to content

Commit

Permalink
chore: update devdependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud committed Mar 7, 2024
1 parent de7fb47 commit cc0fad9
Show file tree
Hide file tree
Showing 33 changed files with 1,915 additions and 1,718 deletions.
25 changes: 7 additions & 18 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
{
"env": {
"es6": true,
"node": true
},
"extends": "airbnb-base",
"rules": {
"strict": [0, "global"],
"prefer-const": 1,
"indent": [1, 4],
"class-methods-use-this": [0],
"import/no-extraneous-dependencies": [0],
"arrow-body-style": [0, "always"],
"no-multiple-empty-lines": [0],
"no-underscore-dangle": [0],
"comma-dangle": [0],
"no-plusplus": [0],
"no-console": [0],
"new-cap": [0]
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"plugins": ["prettier"],
"env": { "es6": true, "node": true },
"parserOptions": {
"requireConfigFile": false,
"ecmaVersion": 2020,
"sourceType": "module"
}
}
64 changes: 32 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
name: Release on main

permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance

on:
push:
branches:
- main
push:
branches:
- main

# Cancel previous workflows which might still be running
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install dependencies
run: npm install

- name: Run all tests
run: npm test

- name: Release and publish
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm install

- name: Run all tests
run: npm test

- name: Release and publish
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
40 changes: 20 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
name: Run Lint and Tests

on:
pull_request:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: [10.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v3
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install
- name: Install dependencies
run: npm install

- name: Lint
run: npm run lint
- name: Lint
run: npm run lint

- name: Run tests
run: npm test
- name: Run tests
run: npm test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ tmp/**/*
*.log
package-lock.json
.nyc_output
.tap
15 changes: 15 additions & 0 deletions .prettierrc
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"],
"options": {
"tabWidth": 2,
"useTabs": false
}
}
]
}
52 changes: 27 additions & 25 deletions lib/collector-active-handles-total.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
'use strict';
"use strict";

const Metric = require('@metrics/metric');
const Metric = require("@metrics/metric");

const CollectorActiveHandlesTotal = class CollectorActiveHandlesTotal {
constructor(prefix = '') {
Object.defineProperty(this, 'prefix', {
value: prefix,
});
constructor(prefix = "") {
Object.defineProperty(this, "prefix", {
value: prefix,
});

Object.defineProperty(this, 'collectable', {
value: (typeof process._getActiveHandles === 'function'),
});
}
Object.defineProperty(this, "collectable", {
value: typeof process._getActiveHandles === "function",
});
}

get [Symbol.toStringTag]() {
return 'CollectorActiveHandlesTotal';
}
get [Symbol.toStringTag]() {
return "CollectorActiveHandlesTotal";
}

collect(timestamp) {
if (!this.collectable) {
return null;
}
collect(timestamp) {
if (!this.collectable) {
return null;
}

return [new Metric({
name: `${this.prefix}nodejs_active_handles_total`,
description: 'Total number of handles',
type: 1,
value: process._getActiveHandles().length,
timestamp,
})];
}
return [
new Metric({
name: `${this.prefix}nodejs_active_handles_total`,
description: "Total number of handles",
type: 1,
value: process._getActiveHandles().length,
timestamp,
}),
];
}
};

module.exports = CollectorActiveHandlesTotal;
52 changes: 27 additions & 25 deletions lib/collector-active-requests-total.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
'use strict';
"use strict";

const Metric = require('@metrics/metric');
const Metric = require("@metrics/metric");

const CollectorActiveRequestsTotal = class CollectorActiveRequestsTotal {
constructor(prefix = '') {
Object.defineProperty(this, 'prefix', {
value: prefix,
});
constructor(prefix = "") {
Object.defineProperty(this, "prefix", {
value: prefix,
});

Object.defineProperty(this, 'collectable', {
value: (typeof process._getActiveRequests === 'function'),
});
}
Object.defineProperty(this, "collectable", {
value: typeof process._getActiveRequests === "function",
});
}

get [Symbol.toStringTag]() {
return 'CollectorActiveRequestsTotal';
}
get [Symbol.toStringTag]() {
return "CollectorActiveRequestsTotal";
}

collect(timestamp) {
if (!this.collectable) {
return null;
}
collect(timestamp) {
if (!this.collectable) {
return null;
}

return [new Metric({
name: `${this.prefix}nodejs_active_requests_total`,
description: 'Total number of active requests',
type: 1,
value: process._getActiveRequests().length,
timestamp,
})];
}
return [
new Metric({
name: `${this.prefix}nodejs_active_requests_total`,
description: "Total number of active requests",
type: 1,
value: process._getActiveRequests().length,
timestamp,
}),
];
}
};

module.exports = CollectorActiveRequestsTotal;
Loading

0 comments on commit cc0fad9

Please sign in to comment.