Skip to content

Commit b8f121a

Browse files
Support node 18, 20, and 21
* fix: bump @comunica/bus-http to get rid of web-streams-node * test: support Node.js 20 JSON errors * build: bump node versions in manifest and ci workflow Signed-off-by: Wouter Termont <wouter.termont@ugent.be> * build: do not use resolutions Signed-off-by: Wouter Termont <wouter.termont@ugent.be> --------- Signed-off-by: Wouter Termont <wouter.termont@ugent.be> Co-authored-by: Wouter Termont <woutermont@gmail.com>
1 parent 803b0fe commit b8f121a

5 files changed

Lines changed: 527 additions & 409 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
key: ${{ runner.os }}-lint-modules-${{ hashFiles('**/yarn.lock') }}
1313
- uses: actions/setup-node@v2
1414
with:
15-
node-version: 16.x
15+
node-version: 20.x
1616
- run: yarn install
1717
- run: yarn run lint
1818

@@ -24,6 +24,9 @@ jobs:
2424
node-version:
2525
- 14.x
2626
- 16.x
27+
- 18.x
28+
- 20.x
29+
- 21.x
2730
steps:
2831
- name: Use Node.js ${{ matrix.node-version }}
2932
uses: actions/setup-node@v2

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Automatically generate component files from TypeScript classes for the Components.js dependency injection framework",
55
"main": "index.js",
66
"engines": {
7-
"node": ">=12.0"
7+
"node": ">=14"
88
},
99
"scripts": {
1010
"build": "tsc",

test/parse/PackageMetadataLoader.test.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,13 @@ describe('PackageMetadataLoader', () => {
178178
resolutionContext.contentsOverrides = {
179179
[normalizeFilePath('/package.json')]: `{`,
180180
};
181-
await expect(loader.load('/')).rejects
182-
.toThrow(new Error(`Invalid package: Syntax error in ${normalizeFilePath('/package.json')}: Unexpected end of JSON input`));
181+
await expect(loader.load('/')).rejects.toMatchObject({
182+
name: 'Error',
183+
message: expect.stringMatching(
184+
/* eslint-disable max-len */
185+
/Invalid package: Syntax error in .*\/package.json: (Unexpected end of JSON input|Expected property name or '\}')/u,
186+
),
187+
});
183188
});
184189

185190
it('should error when lsd:module is missing', async() => {

test/serialize/ComponentConstructor.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2221,7 +2221,10 @@ describe('ComponentConstructor', () => {
22212221
defaults: [{ type: 'raw', value: '{"a":invalid}' }],
22222222
comment: 'Hi',
22232223
}, parameters, 'mp:components/a/b/file-param.jsonld#MyClass_field', scope))
2224-
.rejects.toThrow(`JSON parsing error in default value of mp:components/a/b/file-param.jsonld#MyClass_field: Unexpected token i in JSON at position 5`);
2224+
.rejects.toThrow(
2225+
/* eslint-disable max-len */
2226+
/JSON parsing error in default value of mp:components\/a\/b\/file-param.jsonld#MyClass_field: Unexpected token (i in JSON at position 5|'i', "\{"a":invalid\}" is not valid JSON)/u,
2227+
);
22252228
});
22262229
});
22272230

0 commit comments

Comments
 (0)