diff --git a/.eslintrc.cjs b/.eslintrc.cjs index ceabaee..58fe5d6 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -9,5 +9,8 @@ module.exports = { 'digitalbazaar/jsdoc', 'digitalbazaar/module' ], - ignorePatterns: ['dist/'] + ignorePatterns: ['dist/'], + rules: { + 'unicorn/prefer-node-protocol': 'error' + } }; diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c10ce15..1306e5a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,11 +8,11 @@ jobs: timeout-minutes: 10 strategy: matrix: - node-version: [20.x] + node-version: [22.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm install @@ -24,16 +24,16 @@ jobs: timeout-minutes: 10 strategy: matrix: - node-version: [18.x, 20.x] + node-version: [18.x, 20.x, 22.x] steps: - - uses: actions/checkout@v3 - - name: Install with Node.js 20.x - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - name: Install with Node.js 22.x + uses: actions/setup-node@v4 with: - node-version: 20.x + node-version: 22.x - run: npm install - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Run ESM test with Node.js ${{ matrix.node-version }} @@ -46,11 +46,11 @@ jobs: timeout-minutes: 10 strategy: matrix: - node-version: [20.x] + node-version: [22.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm install @@ -62,18 +62,19 @@ jobs: timeout-minutes: 10 strategy: matrix: - node-version: [20.x] + node-version: [22.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm install - name: Generate coverage report run: npm run coverage-ci - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: file: ./coverage/lcov.info fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index b9b3e55..26515b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # @digitalbazaar/http-client ChangeLog +## 4.2.0 - 2025-03-xx + +### Changed +- Update dependencies. + - `ky@1.7.5`. + - `undici@6.21.2`. +- Update dev dependencies. +- Update test dependencies. + ## 4.1.1 - 2024-02-21 ### Fixed diff --git a/package.json b/package.json index 3e40c53..9d31a56 100644 --- a/package.json +++ b/package.json @@ -30,39 +30,38 @@ "coverage": "cross-env NODE_ENV=test c8 npm run test-node", "coverage-ci": "cross-env NODE_ENV=test c8 --reporter=lcovonly --reporter=text-summary --reporter=text npm run test-node", "coverage-report": "c8 report", - "lint": "eslint --ignore-pattern rollup.config.js ." + "lint": "eslint --ext .cjs,.js --ignore-pattern rollup.config.js ." }, "files": [ "lib/*", "dist/*" ], "dependencies": { - "ky": "^1.0.1", - "undici": "^6.6.2" + "ky": "^1.7.5", + "undici": "^6.21.2" }, "devDependencies": { - "c8": "^7.13.0", - "chai": "^4.3.7", + "c8": "^10.1.3", + "chai": "^4.5.0", "cors": "^2.8.5", "cross-env": "^7.0.3", - "delay": "^5.0.0", "detect-node": "^2.1.0", - "eslint": "^8.38.0", - "eslint-config-digitalbazaar": "^4.2.0", - "eslint-plugin-jsdoc": "^41.1.1", - "eslint-plugin-unicorn": "^46.0.0", - "express": "^4.18.2", - "karma": "^6.4.1", + "eslint": "^8.57.1", + "eslint-config-digitalbazaar": "^5.2.0", + "eslint-plugin-jsdoc": "^50.6.9", + "eslint-plugin-unicorn": "^56.0.1", + "express": "^4.21.2", + "karma": "^6.4.4", "karma-chai": "^0.1.0", - "karma-chrome-launcher": "^3.1.1", + "karma-chrome-launcher": "^3.2.0", "karma-mocha": "^2.0.1", "karma-mocha-reporter": "^2.2.5", "karma-sourcemap-loader": "^0.4.0", - "karma-webpack": "^5.0.0", - "mocha": "^10.2.0", - "rimraf": "^5.0.0", - "rollup": "^3.20.2", - "webpack": "^5.79.0" + "karma-webpack": "^5.0.1", + "mocha": "^11.1.0", + "rimraf": "^6.0.1", + "rollup": "^4.37.0", + "webpack": "^5.98.0" }, "repository": { "type": "git", diff --git a/rollup.config.js b/rollup.config.js index f08fbaa..366fe25 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,4 +1,4 @@ -import pkg from './package.json' assert {type: 'json'}; +import pkg from './package.json' with {type: 'json'}; function preserveDynamicImportPlugin() { return { diff --git a/tests/utils.cjs b/tests/utils.cjs index 6d2b1d3..c988f1e 100644 --- a/tests/utils.cjs +++ b/tests/utils.cjs @@ -3,13 +3,13 @@ */ 'use strict'; +const {setTimeout} = require('node:timers/promises'); const cors = require('cors'); -const delay = require('delay'); const express = require('express'); -const fs = require('fs').promises; -const http = require('http'); -const https = require('https'); -const path = require('path'); +const fs = require('node:fs').promises; +const http = require('node:http'); +const https = require('node:https'); +const path = require('node:path'); const api = {}; module.exports = api; @@ -95,7 +95,7 @@ function createApp() { }); app.get('/delay/:seconds', cors(), async (req, res) => { - await delay(req.params.seconds * 1000); + await setTimeout(req.params.seconds * 1000); res.status(200).send(); });