Skip to content
10 changes: 5 additions & 5 deletions .github/workflows/main.yml → .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
node-version: [18.x]
node-version: [24.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -23,7 +23,7 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x, 22.x]
node-version: [18.x, 20.x, 22.x, 24.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -41,7 +41,7 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
node-version: [16.x]
node-version: [24.x]
bundler: [webpack, browserify]
steps:
- uses: actions/checkout@v4
Expand All @@ -62,7 +62,7 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
node-version: [16.x]
node-version: [24.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -78,7 +78,7 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
node-version: [18.x]
node-version: [24.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# jsonld ChangeLog

## 9.0.0 - 2025-xx-xx

### Changed
- **BREAKING**: Drop support for Node.js < 18.
- **BREAKING**: Upgrade dependencies.
- `@digitalbazaar/http-client@4`.
- `canonicalize@2`.
- `rdf-canonize@4`: See the [rdf-canonize][] 4.0.0 changelog for
**important** changes and upgrade notes. Of note:
- The `URDNA2015` default algorithm has been changed to `RDFC-1.0` from
[rdf-canon][].
- Complexity control defaults `maxWorkFactor` or `maxDeepIterations` may
need to be adjusted to process graphs with certain blank node constructs.
- A `signal` option is available to use an `AbortSignal` to limit resource
usage.
- The internal digest algorithm can be changed.
- Update development dependencies.
- Update karma testing.
- Remove older fixes in favor of more default behavior.
- Update bundle build.
- Use newer corejs version.
- Build with modern browserslist defaults and no IE support.
- Support for older browsers requires a custom build.
- Refactor test framework.
- Test runtime loads test files from a web server.
- Allows testing of manifests on remote web servers.
- Trading off some performance to align node and browser testing.
- Moves some test setup code into config data and manifest.

### Removed
- **BREAKING**: Remove `application/nquads` alias for `application/n-quads`.

## 8.3.3 - 2024-12-21

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
jsonld.js
=========

[![Build status](https://img.shields.io/github/actions/workflow/status/digitalbazaar/jsonld.js/main.yml)](https://github.com/digitalbazaar/jsonld.js/actions/workflows/main.yml)
[![Build status](https://img.shields.io/github/actions/workflow/status/digitalbazaar/jsonld.js/main.yaml)](https://github.com/digitalbazaar/jsonld.js/actions/workflows/main.yaml)
[![Coverage status](https://img.shields.io/codecov/c/github/digitalbazaar/jsonld.js)](https://codecov.io/gh/digitalbazaar/jsonld.js)
[![npm](https://img.shields.io/npm/v/jsonld)](https://npm.im/jsonld)

Expand Down
104 changes: 60 additions & 44 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,40 @@
*/
const os = require('os');
const webpack = require('webpack');
const {TestServer} = require('./tests/test-server.js');

// karma test server proxy details
const _proxyTestsPrefix = '/tests';

let testServer;

// shutdown test server "reporter" hook
function ShutdownTestServer(baseReporterDecorator) {
baseReporterDecorator(this);

this.onRunComplete = async function() {
await testServer.close();
};
}

// Inject the base reporter
ShutdownTestServer.$inject = ['baseReporterDecorator', 'config'];

// local "reporter" plugin
const shutdownTestServer = {
'reporter:shutdown-test-server': ['type', ShutdownTestServer]
};

module.exports = async function(config) {
testServer = new TestServer({
earlFilename: process.env.EARL
});
await testServer.start();

module.exports = function(config) {
// bundler to test: webpack, browserify
const bundler = process.env.BUNDLER || 'webpack';

const frameworks = ['mocha', 'server-side'];
const frameworks = ['mocha'];
// main bundle preprocessors
const preprocessors = ['babel'];

Expand Down Expand Up @@ -66,7 +94,8 @@ module.exports = function(config) {
'process.env.EARL': JSON.stringify(process.env.EARL),
'process.env.TESTS': JSON.stringify(process.env.TESTS),
'process.env.TEST_ENV': JSON.stringify(process.env.TEST_ENV),
'process.env.TEST_ROOT_DIR': JSON.stringify(__dirname),
'process.env.TEST_SERVER_URL': JSON.stringify(_proxyTestsPrefix),
'process.env.AUTH_TOKEN': JSON.stringify(testServer.authToken),
'process.env.VERBOSE_SKIP': JSON.stringify(process.env.VERBOSE_SKIP),
// for 'auto' test env
'process.env._TEST_ENV_ARCH': JSON.stringify(process.arch),
Expand All @@ -81,18 +110,11 @@ module.exports = function(config) {
rules: [
{
test: /\.js$/,
include: [{
// exclude node_modules by default
exclude: /(node_modules)/
}, {
// include specific packages
include: [
/(node_modules\/canonicalize)/,
/(node_modules\/lru-cache)/,
/(node_modules\/rdf-canonize)/,
/(node_modules\/yallist)/
]
}],
// avoid processing core-js
include: {
and: [/node_modules/],
not: [/core-js/]
},
use: {
loader: 'babel-loader',
options: {
Expand All @@ -101,38 +123,31 @@ module.exports = function(config) {
'@babel/preset-env',
{
useBuiltIns: 'usage',
corejs: '3.9',
corejs: '3.46',
bugfixes: true,
//debug: true,
targets: {
// test with slightly looser browserslist defaults
browsers: 'defaults, > 0.25%'
browsers: 'defaults, > 0.25%, not IE 11'
}
}
]
],
plugins: [
[
'@babel/plugin-proposal-object-rest-spread',
{useBuiltIns: true}
],
'@babel/plugin-transform-modules-commonjs',
'@babel/plugin-transform-runtime'
]
}
}
}
],
noParse: [
// avoid munging internal benchmark script magic
/benchmark/
]
//noParse: [
// // avoid munging internal benchmark script magic
// /benchmark/
//]
},
node: {
Buffer: false,
process: false,
crypto: false,
setImmediate: false
output: {
globalObject: 'this'
}
},

Expand All @@ -147,7 +162,8 @@ module.exports = function(config) {
EARL: process.env.EARL,
TESTS: process.env.TESTS,
TEST_ENV: process.env.TEST_ENV,
TEST_ROOT_DIR: __dirname,
TEST_SERVER_URL: _proxyTestsPrefix,
AUTH_TOKEN: testServer.authToken,
VERBOSE_SKIP: process.env.VERBOSE_SKIP,
// for 'auto' test env
_TEST_ENV_ARCH: process.arch,
Expand All @@ -165,11 +181,20 @@ module.exports = function(config) {
]
},

// local server shutdown plugin
plugins: [
'karma-*',
shutdownTestServer
],

// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
//reporters: ['progress'],
reporters: ['mocha'],
reporters: [
'mocha',
'shutdown-test-server'
],

// web server port
port: 9876,
Expand All @@ -192,17 +217,6 @@ module.exports = function(config) {
//browsers: ['ChromeHeadless', 'Chrome', 'Firefox', 'Safari'],
browsers: ['ChromeHeadless'],

customLaunchers: {
IE9: {
base: 'IE',
'x-ua-compatible': 'IE=EmulateIE9'
},
IE8: {
base: 'IE',
'x-ua-compatible': 'IE=EmulateIE8'
}
},

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
Expand All @@ -222,6 +236,8 @@ module.exports = function(config) {
},

// Proxied paths
proxies: {}
proxies: {
'/tests': testServer.url
}
});
};
Loading