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
29 changes: 17 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Bedrock Node.js CI

on: [push]

permissions: {}

jobs:
lint:
runs-on: ubuntu-latest
Expand All @@ -10,25 +12,28 @@ jobs:
matrix:
node-version: [24.x]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Run eslint
run: npm run lint
test-node:
needs: [lint]
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [22.x, 24.x]
node-version: [20.x, 22.x, 24.x]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- run: |
Expand All @@ -40,16 +45,17 @@ jobs:
cd test
npm test
coverage:
needs: [test-node]
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [24.x]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- run: |
Expand All @@ -61,9 +67,8 @@ jobs:
cd test
npm run coverage-ci
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
file: ./test/coverage/lcov.info
files: ./test/coverage/lcov.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# bedrock-express ChangeLog

## 8.6.0 - 2026-04-xx

### Changed
- **BREAKING**: Update dependencies:
- `@fastify/express@4`
- `body-parser@2`
- `fastify@5`
- Update minor dependencies.
- Update peer minor dependencies:
- Update test dependencies.
- **NOTE**: Update supported platforms.
- Test on Node.js >=20.
- Update `engines.node` to `>=20`.
- Update README requirements section.

## 8.5.2 - 2025-12-16

### Fixed
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ server.

## Requirements

- node v18+
- npm v9+
This software requires and supports maintained recent versions of Node.js.
Updates may remove support for older unmaintained platform versions. Please use
dependency version lock files and testing to ensure compatibility with this
software.

## Quick Examples

Expand Down
19 changes: 6 additions & 13 deletions .eslintrc.cjs → eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright 2022 - 2024 Digital Bazaar, Inc.
* Copyright 2022 - 2026 Digital Bazaar, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,15 +16,8 @@
* SPDX-License-Identifier: Apache-2.0
*/

module.exports = {
root: true,
parserOptions: {
// this is required for dynamic import()
ecmaVersion: 2020
},
env: {
node: true
},
extends: ['digitalbazaar', 'digitalbazaar/jsdoc'],
ignorePatterns: ['node_modules/']
};
import config from '@digitalbazaar/eslint-config/node-recommended';

export default [
...config
];
35 changes: 19 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
"description": "Bedrock express module",
"license": "Apache-2.0",
"main": "./lib/index.js",
"files": [
".reuse/dep5",
"LICENSES/**/*.txt",
"lib/**/*.js"
],
"scripts": {
"test": "node test.js",
"lint": "eslint ."
"test": "cd test && npm run test",
"lint": "eslint"
},
"repository": {
"type": "git",
Expand All @@ -27,32 +32,30 @@
},
"homepage": "https://github.com/digitalbazaar/bedrock-express",
"dependencies": {
"@fastify/express": "^3.0.0",
"body-parser": "^1.20.3",
"@fastify/express": "^4.0.4",
"body-parser": "^2.2.2",
"compression": "^1.8.1",
"cookie-parser": "^1.4.7",
"cors": "^2.8.5",
"errorhandler": "^1.5.1",
"express": "^4.21.2",
"express-session": "^1.18.2",
"fastify": "^4.29.1",
"cors": "^2.8.6",
"errorhandler": "^1.5.2",
"express": "^4.22.1",
"express-session": "^1.19.0",
"fastify": "^5.8.4",
"method-override": "^3.0.0",
"morgan": "^1.10.1"
},
"peerDependencies": {
"@bedrock/core": "^6.0.0",
"@bedrock/server": "^5.0.0"
"@bedrock/core": "^6.3.0",
"@bedrock/server": "^5.1.0"
},
"directories": {
"lib": "./lib"
},
"devDependencies": {
"eslint": "^8.57.0",
"eslint-config-digitalbazaar": "^5.2.0",
"eslint-plugin-jsdoc": "^48.5.0",
"jsdoc-to-markdown": "^8.0.1"
"@digitalbazaar/eslint-config": "^8.0.1",
"eslint": "^9.39.4"
},
"engines": {
"node": ">=18"
"node": ">=20"
}
}
9 changes: 0 additions & 9 deletions test/mocha/.eslintrc.cjs

This file was deleted.

20 changes: 10 additions & 10 deletions test/mocha/01-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
*/

import {agent} from '@bedrock/https-agent';
import {fileURLToPath} from 'node:url';
import fs from 'node:fs';
import {httpClient} from '@digitalbazaar/http-client';
import path from 'node:path';

const {readFile} = fs.promises;
const __dirname = path.dirname(fileURLToPath(import.meta.url));

describe('configured routes', () => {
const BASE_URL = `https://localhost:18443`;
Expand Down Expand Up @@ -106,7 +104,7 @@ describe('configured routes', () => {
let err;
try {
res = await httpClient.get(`${BASE_URL}/static/foo`, {
agent,
agent
});
} catch(e) {
err = e;
Expand All @@ -115,7 +113,7 @@ describe('configured routes', () => {
should.not.exist(err);
res.status.should.equal(200);
const body = await res.text();
const filepath = path.join(__dirname, '..', 'static', 'foo.html');
const filepath = path.join(import.meta.dirname, '..', 'static', 'foo.html');
const content = await readFile(filepath, 'utf-8');
body.should.equal(content);
});
Expand All @@ -126,7 +124,7 @@ describe('configured routes', () => {
let err;
try {
res = await httpClient.get(`${BASE_URL}/static/bar.html`, {
agent,
agent
});
} catch(e) {
err = e;
Expand All @@ -135,7 +133,8 @@ describe('configured routes', () => {
should.not.exist(err);
res.status.should.equal(200);
const body = await res.text();
const filepath = path.join(__dirname, '..', 'static', 'bar.html');
const filepath = path.join(
import.meta.dirname, '..', 'static', 'bar.html');
const content = await readFile(filepath, 'utf-8');
body.should.equal(content);
});
Expand All @@ -146,7 +145,7 @@ describe('configured routes', () => {
let err;
try {
res = await httpClient.get(`${BASE_URL}/bar.html`, {
agent,
agent
});
} catch(e) {
err = e;
Expand All @@ -155,7 +154,8 @@ describe('configured routes', () => {
should.not.exist(err);
res.status.should.equal(200);
const body = await res.text();
const filepath = path.join(__dirname, '..', 'static', 'bar.html');
const filepath = path.join(
import.meta.dirname, '..', 'static', 'bar.html');
const content = await readFile(filepath, 'utf-8');
body.should.equal(content);
});
Expand All @@ -165,7 +165,7 @@ describe('configured routes', () => {
let err;
try {
res = await httpClient.get(`${BASE_URL}/baz.html`, {
agent,
agent
});
} catch(e) {
err = e;
Expand All @@ -181,7 +181,7 @@ describe('configured routes', () => {
let err;
try {
res = await httpClient.get(`${BASE_URL}/static/baz.html`, {
agent,
agent
});
} catch(e) {
err = e;
Expand Down
14 changes: 7 additions & 7 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
"coverage-report": "c8 report"
},
"dependencies": {
"@digitalbazaar/http-client": "^3.0.0",
"@bedrock/core": "^6.0.0",
"@digitalbazaar/http-client": "^4.3.0",
"@bedrock/core": "^6.3.0",
"@bedrock/express": "file:..",
"@bedrock/https-agent": "^4.0.0",
"@bedrock/server": "^5.0.0",
"@bedrock/test": "^8.0.0",
"c8": "^7.11.0",
"cross-env": "^7.0.3"
"@bedrock/https-agent": "^4.1.0",
"@bedrock/server": "^5.1.0",
"@bedrock/test": "^9.0.0",
"c8": "^11.0.0",
"cross-env": "^10.1.0"
},
"c8": {
"excludeNodeModules": false,
Expand Down
7 changes: 2 additions & 5 deletions test/test.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@
* SPDX-License-Identifier: Apache-2.0
*/
import {config} from '@bedrock/core';
import {fileURLToPath} from 'url';
import path from 'path';
import path from 'node:path';
import '@bedrock/https-agent';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

// set this to false to ignore SSL errors in development
config['https-agent'].rejectUnauthorized = false;

Expand Down Expand Up @@ -57,4 +54,4 @@ config.express.bodyParser.routes['/json-size-limit/any/101kb/*'] = {
}
};

config.mocha.tests.push(path.join(__dirname, 'mocha'));
config.mocha.tests.push(path.join(import.meta.dirname, 'mocha'));
Loading
Loading