Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .eslintrc.cjs

This file was deleted.

90 changes: 90 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Main CI

on: [push]

permissions: {}

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
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:
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]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

18 is EOL so we don't need to test against it.

Suggested change
node-version: [18.x, 20.x, 22.x, 24.x]
node-version: [20.x, 22.x, 24.x]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood. I was leaving it at 18.x since the only support issue is the trivial testing need to use chai@4 vs 5+. I thought it would be good to be a bit more conservative in this case since this library might have wider use than many of our others in part due to the use in jsonld.js, which still supports 18.x. An undici@7 update would force the issue, so I thought it would be fine to wait until that change is tested to drop old version testing.

steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- 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
with:
persist-credentials: false
- 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
with:
persist-credentials: false
- 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@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
files: ./coverage/lcov.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# @digitalbazaar/http-client ChangeLog

## 4.2.1 - 2025-xx-xx
## 4.3.0 - 2026-01-xx

### Changed
- Update dependencies.
- `[email protected]`.
- `[email protected]`.
- 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
Expand Down
5 changes: 5 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import config from '@digitalbazaar/eslint-config/universal-recommended';

export default [
...config
];
2 changes: 1 addition & 1 deletion karma.conf.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = async function(config) {
//httpServer,
//httpsServer,
httpHost: testHttpHost,
httpsHost: testHttpsHost,
httpsHost: testHttpsHost
} = await startServers();

config.set({
Expand Down
1 change: 0 additions & 1 deletion lib/agentCompatibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
}
2 changes: 1 addition & 1 deletion lib/deferred.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export function deferred(f) {
onfulfilled,
onrejected
);
},
}
};
}
24 changes: 11 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,38 +30,36 @@
"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/*",
"dist/*"
],
"dependencies": {
"ky": "^1.7.5",
"undici": "^6.21.2"
"ky": "^1.14.2",
"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",
"cross-env": "^10.1.0",
"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",
"express": "^4.21.2",
"eslint": "^9.39.2",
"express": "^5.2.1",
"karma": "^6.4.4",
"karma-chai": "^0.1.0",
"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.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",
Expand Down
5 changes: 3 additions & 2 deletions tests/10-client-api.spec.common.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down