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
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# https://editorconfig.org/

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{cjs,js,json,jsonld,mjs,yaml,yml}]
indent_style = space
indent_size = 2
15 changes: 0 additions & 15 deletions .eslintrc.cjs

This file was deleted.

30 changes: 18 additions & 12 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
name: Bedrock Node.js CI
name: Main CI

on: [push]

permissions: {}

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [22.x]
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: [20.x, 22.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 @@ -39,16 +44,17 @@ jobs:
cd test
npm test
coverage:
needs: [test-node]
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [22.x]
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 Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ TAGS
coverage
node_modules
reports
package-lock.json
package-lock.json
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
legacy-peer-deps=true
legacy-peer-deps=true
3 changes: 1 addition & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Bedrock Non-Commercial License v1.0
===================================

Copyright (c) 2011-2021 Digital Bazaar, Inc.
All rights reserved.
Copyright (c) 2011-2026 Digital Bazaar, Inc.

Summary
=======
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ TBD

## Install

- Node.js 20+ is required.
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.

### NPM

Expand All @@ -51,11 +54,11 @@ Describe configuration, usage.

## Contribute

See [the contribute file](https://github.com/digitalbazaar/bedrock/blob/master/CONTRIBUTING.md)!
See [the contributing file](https://github.com/digitalbazaar/bedrock/blob/master/CONTRIBUTING.md).

PRs accepted.

If editing the Readme, please conform to the
If editing README.md, please conform to the
[standard-readme](https://github.com/RichardLitt/standard-readme) specification.

## Commercial Support
Expand Down
16 changes: 16 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import config from '@digitalbazaar/eslint-config/node-recommended';

export default [
...config,
{
files: [
'test/mocha/**/*.js'
],
languageOptions: {
globals: {
// @bedrock/test global
assertNoError: true
}
}
}
];
2 changes: 1 addition & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2025 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2026 Digital Bazaar, Inc.
*/
import * as bedrock from '@bedrock/core';
const {config} = bedrock;
Expand Down
6 changes: 3 additions & 3 deletions lib/http.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*!
* Copyright (c) 2025 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2026 Digital Bazaar, Inc.
*/
import * as bedrock from '@bedrock/core';
import {asyncHandler} from '@bedrock/express';
import {example} from '../schemas/bedrock-template.js';
import {namespace} from './config.js';
import {postExample} from '../schemas/bedrock-template.js';
import {createValidateMiddleware as validate} from '@bedrock/validation';

const {util: {BedrockError}} = bedrock;
Expand All @@ -15,7 +15,7 @@ bedrock.events.on('bedrock-express.configure.routes', app => {

app.post(
routes.basePath,
validate({bodySchema: example}),
validate({bodySchema: postExample()}),
asyncHandler(async (/*req, res*/) => {
throw new BedrockError(
'Not implemented.', {
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2025 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2026 Digital Bazaar, Inc.
*/
import '@bedrock/express';

Expand Down
2 changes: 1 addition & 1 deletion lib/logger.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Copyright (c) 2025 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2026 Digital Bazaar, Inc.
*/
import {loggers} from '@bedrock/core';
import {namespace} from './config.js';
Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"schemas/**/*.js"
],
"scripts": {
"test": "cd test && npm run test",
"lint": "eslint ."
},
"repository": {
Expand All @@ -29,17 +30,15 @@
"homepage": "https://github.com/digitalbazaar/bedrock-module-template-http",
"peerDependencies": {
"@bedrock/core": "^6.3.0",
"@bedrock/express": "^8.3.2",
"@bedrock/express": "^8.6.0",
"@bedrock/validation": "^7.1.1"
},
"directories": {
"lib": "./lib"
},
"devDependencies": {
"eslint": "^8.57.1",
"eslint-config-digitalbazaar": "^5.2.0",
"eslint-plugin-jsdoc": "^51.4.1",
"eslint-plugin-unicorn": "^56.0.1"
"@digitalbazaar/eslint-config": "^8.0.1",
"eslint": "^9.39.4"
},
"engines": {
"node": ">=20"
Expand Down
22 changes: 12 additions & 10 deletions schemas/bedrock-template.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
/*!
* Copyright (c) 2025 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2026 Digital Bazaar, Inc.
*/
import {schemas} from '@bedrock/validation';

export const example = {
title: 'Example',
type: 'object',
required: ['id'],
additionalProperties: false,
properties: {
id: schemas.identifier()
}
};
export function postExample() {
return {
title: 'Post Example',
type: 'object',
required: ['id'],
additionalProperties: false,
properties: {
id: schemas.identifier()
}
};
}
9 changes: 0 additions & 9 deletions test/mocha/.eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion test/mocha/10-api.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2026 Digital Bazaar, Inc.
*/
describe('api', () => {
it('should work');
Expand Down
8 changes: 4 additions & 4 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
},
"dependencies": {
"@bedrock/core": "^6.3.0",
"@bedrock/express": "^8.3.2",
"@bedrock/express": "^8.6.0",
"@bedrock/https-agent": "^4.1.0",
"@bedrock/module-template-http": "file:..",
"@bedrock/server": "^5.1.0",
"@bedrock/test": "^8.2.0",
"@bedrock/test": "^9.0.0",
"@bedrock/validation": "^7.1.1",
"c8": "^10.1.3",
"cross-env": "^7.0.3"
"c8": "^11.0.0",
"cross-env": "^10.1.0"
},
"c8": {
"excludeNodeModules": false,
Expand Down
2 changes: 1 addition & 1 deletion test/test.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025 Digital Bazaar, Inc. All rights reserved..
* Copyright (c) 2026 Digital Bazaar, Inc.
*/
import {config} from '@bedrock/core';
import path from 'node:path';
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2025 Digital Bazaar, Inc. All rights reserved.
* Copyright (c) 2026 Digital Bazaar, Inc.
*/
import * as bedrock from '@bedrock/core';
import '@bedrock/https-agent';
Expand Down
Loading