From a002fb56b619750d28912885e269f81f6982702d Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Wed, 14 Jan 2026 19:58:37 -0500 Subject: [PATCH 1/7] Update dependencies. - `ky@1.14.2`. - `undici@6.23.0`. --- CHANGELOG.md | 7 ++++++- package.json | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b4e925..28f8e62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # @digitalbazaar/http-client ChangeLog -## 4.2.1 - 2025-xx-xx +## 4.3.0 - 2026-01-xx + +### Changed +- Update dependencies. + - `ky@1.14.2`. + - `undici@6.23.0`. ### Fixed - Update HTTPS test endpoint from dead service to to github.com. May hit rate diff --git a/package.json b/package.json index 128c04c..29cb784 100644 --- a/package.json +++ b/package.json @@ -37,8 +37,8 @@ "dist/*" ], "dependencies": { - "ky": "^1.7.5", - "undici": "^6.21.2" + "ky": "^1.14.2", + "undici": "^6.23.0" }, "devDependencies": { "c8": "^10.1.3", From 539b457a11646fe18474c31872a7c209922ca3bc Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Wed, 14 Jan 2026 20:18:42 -0500 Subject: [PATCH 2/7] Update to `eslint@9`. - `eslint@9`. - `eslint-config-digitalbazaar` to `@digitalbazaar/eslint-config@7`. - Fix lint issues. --- .eslintrc.cjs | 16 ---------------- CHANGELOG.md | 4 ++++ eslint.config.js | 5 +++++ karma.conf.cjs | 2 +- lib/agentCompatibility.js | 1 - lib/deferred.js | 2 +- package.json | 8 +++----- tests/10-client-api.spec.common.cjs | 5 +++-- 8 files changed, 17 insertions(+), 26 deletions(-) delete mode 100644 .eslintrc.cjs create mode 100644 eslint.config.js diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 58fe5d6..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = { - root: true, - env: { - browser: true, - node: true - }, - extends: [ - 'digitalbazaar', - 'digitalbazaar/jsdoc', - 'digitalbazaar/module' - ], - ignorePatterns: ['dist/'], - rules: { - 'unicorn/prefer-node-protocol': 'error' - } -}; diff --git a/CHANGELOG.md b/CHANGELOG.md index 28f8e62..b1b07c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - Update dependencies. - `ky@1.14.2`. - `undici@6.23.0`. +- Update dev dependencies. + - `eslint@9`. + - `eslint-config-digitalbazaar` to `@digitalbazaar/eslint-config@7`. +- Update test dependencies. ### Fixed - Update HTTPS test endpoint from dead service to to github.com. May hit rate diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..45e2405 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,5 @@ +import config from '@digitalbazaar/eslint-config/universal-recommended'; + +export default [ + ...config +]; diff --git a/karma.conf.cjs b/karma.conf.cjs index cdabdc6..b9377fc 100644 --- a/karma.conf.cjs +++ b/karma.conf.cjs @@ -10,7 +10,7 @@ module.exports = async function(config) { //httpServer, //httpsServer, httpHost: testHttpHost, - httpsHost: testHttpsHost, + httpsHost: testHttpsHost } = await startServers(); config.set({ diff --git a/lib/agentCompatibility.js b/lib/agentCompatibility.js index 80a7aa5..edf24c1 100644 --- a/lib/agentCompatibility.js +++ b/lib/agentCompatibility.js @@ -47,7 +47,6 @@ function createFetch(dispatcher) { return function fetch(...args) { dispatcher = (args[1] && args[1].dispatcher) || dispatcher; args[1] = {...args[1], dispatcher}; - // eslint-disable-next-line no-undef return globalThis.fetch(...args); }; } diff --git a/lib/deferred.js b/lib/deferred.js index 06ec4a0..3a41152 100644 --- a/lib/deferred.js +++ b/lib/deferred.js @@ -13,6 +13,6 @@ export function deferred(f) { onfulfilled, onrejected ); - }, + } }; } diff --git a/package.json b/package.json index 29cb784..36ad7c1 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "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 --ext .cjs,.js --ignore-pattern rollup.config.js ." + "lint": "eslint" }, "files": [ "lib/*", @@ -41,15 +41,13 @@ "undici": "^6.23.0" }, "devDependencies": { + "@digitalbazaar/eslint-config": "^7.0.0", "c8": "^10.1.3", "chai": "^4.5.0", "cors": "^2.8.5", "cross-env": "^7.0.3", "detect-node": "^2.1.0", - "eslint": "^8.57.1", - "eslint-config-digitalbazaar": "^5.2.0", - "eslint-plugin-jsdoc": "^50.6.9", - "eslint-plugin-unicorn": "^56.0.1", + "eslint": "^9.39.2", "express": "^4.21.2", "karma": "^6.4.4", "karma-chai": "^0.1.0", diff --git a/tests/10-client-api.spec.common.cjs b/tests/10-client-api.spec.common.cjs index c9edde0..02b4ebc 100644 --- a/tests/10-client-api.spec.common.cjs +++ b/tests/10-client-api.spec.common.cjs @@ -6,7 +6,8 @@ exports.test = function({ kyPromise, httpClient, DEFAULT_HEADERS, isNode, utils }) { -/* eslint-disable indent */ +/* eslint-disable @stylistic/indent */ +/* global after, before, describe, it, should */ describe('http-client API', () => { // start/close local test server let serverInfo; @@ -181,7 +182,7 @@ describe('http-client API', () => { const url = `http://${httpHost}/delay/2`; try { response = await httpClient.get(url, { - timeout: 1000, + timeout: 1000 }); } catch(e) { err = e; From fb33eaee26ba4f15a5fa7192b53b9433fc45cc67 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Wed, 14 Jan 2026 20:21:15 -0500 Subject: [PATCH 3/7] Update dependencies. - Update dev dependencies. - Update test dependencies. --- package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 36ad7c1..c1a026e 100644 --- a/package.json +++ b/package.json @@ -43,12 +43,12 @@ "devDependencies": { "@digitalbazaar/eslint-config": "^7.0.0", "c8": "^10.1.3", - "chai": "^4.5.0", + "chai": "^6.2.2", "cors": "^2.8.5", - "cross-env": "^7.0.3", + "cross-env": "^10.1.0", "detect-node": "^2.1.0", "eslint": "^9.39.2", - "express": "^4.21.2", + "express": "^5.2.1", "karma": "^6.4.4", "karma-chai": "^0.1.0", "karma-chrome-launcher": "^3.2.0", @@ -56,10 +56,10 @@ "karma-mocha-reporter": "^2.2.5", "karma-sourcemap-loader": "^0.4.0", "karma-webpack": "^5.0.1", - "mocha": "^11.1.0", - "rimraf": "^6.0.1", - "rollup": "^4.37.0", - "webpack": "^5.98.0" + "mocha": "^11.7.5", + "rimraf": "^6.1.2", + "rollup": "^4.55.1", + "webpack": "^5.104.1" }, "repository": { "type": "git", From bfeb0d9d81a81d8e3c43e5d4de14b849cd137087 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Wed, 14 Jan 2026 21:26:07 -0500 Subject: [PATCH 4/7] Revert to `chai@4` to keep Node.js 18 working. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c1a026e..6c2ba20 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "devDependencies": { "@digitalbazaar/eslint-config": "^7.0.0", "c8": "^10.1.3", - "chai": "^6.2.2", + "chai": "^4.5.0", "cors": "^2.8.5", "cross-env": "^10.1.0", "detect-node": "^2.1.0", From 6b8064be2f71c460550621ef3de4be25cc75649a Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Wed, 14 Jan 2026 21:30:16 -0500 Subject: [PATCH 5/7] Update node.js and action versions. --- .github/workflows/main.yaml | 80 +++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/main.yaml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..f93a9b1 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,80 @@ +name: Node.js CI + +on: [push] + +jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 10 + strategy: + matrix: + node-version: [24.x] + steps: + - uses: actions/checkout@v6 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - name: Run eslint + run: npm run lint + test-node: + runs-on: ubuntu-latest + needs: [lint] + timeout-minutes: 10 + strategy: + matrix: + node-version: [18.x, 20.x, 22.x, 24.x] + steps: + - uses: actions/checkout@v6 + - name: Install with Node.js 24.x + uses: actions/setup-node@v6 + with: + node-version: 24.x + - run: npm install + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + - name: Run ESM test with Node.js ${{ matrix.node-version }} + run: npm run test-node + - name: Run CJS test with Node.js ${{ matrix.node-version }} + run: npm run test-node-cjs + test-karma: + runs-on: ubuntu-latest + needs: [lint, test-node] + timeout-minutes: 10 + strategy: + matrix: + node-version: [24.x] + steps: + - uses: actions/checkout@v6 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - name: Run karma tests + run: npm run test-karma + coverage: + needs: [test-node, test-karma] + runs-on: ubuntu-latest + timeout-minutes: 10 + strategy: + matrix: + node-version: [24.x] + steps: + - uses: actions/checkout@v6 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v6 + 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@v5 + with: + files: ./coverage/lcov.info + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} From 75ee1fd4b45f463cb5b7b8634f7563b6953d60bb Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Wed, 14 Jan 2026 21:37:33 -0500 Subject: [PATCH 6/7] Change workflow name. --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f93a9b1..70174fd 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,4 +1,4 @@ -name: Node.js CI +name: Main CI on: [push] From db8ff8e471f90473a1907537773c763580c1d2a3 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Wed, 14 Jan 2026 21:42:41 -0500 Subject: [PATCH 7/7] Fix zizmor issues. --- .github/workflows/main.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 70174fd..9a0596c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -2,6 +2,8 @@ name: Main CI on: [push] +permissions: {} + jobs: lint: runs-on: ubuntu-latest @@ -11,6 +13,8 @@ jobs: node-version: [24.x] steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v6 with: @@ -27,6 +31,8 @@ jobs: node-version: [18.x, 20.x, 22.x, 24.x] steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Install with Node.js 24.x uses: actions/setup-node@v6 with: @@ -49,6 +55,8 @@ jobs: node-version: [24.x] steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v6 with: @@ -65,6 +73,8 @@ jobs: node-version: [24.x] steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v6 with: @@ -73,7 +83,7 @@ jobs: - name: Generate coverage report run: npm run coverage-ci - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 with: files: ./coverage/lcov.info fail_ci_if_error: true