Skip to content

Commit

Permalink
Support node 18, 20, and 21
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* build: do not use resolutions

Signed-off-by: Wouter Termont <[email protected]>

---------

Signed-off-by: Wouter Termont <[email protected]>
Co-authored-by: Wouter Termont <[email protected]>
  • Loading branch information
termontwouter and woutermont authored Nov 24, 2023
1 parent 803b0fe commit b8f121a
Show file tree
Hide file tree
Showing 5 changed files with 527 additions and 409 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
key: ${{ runner.os }}-lint-modules-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v2
with:
node-version: 16.x
node-version: 20.x
- run: yarn install
- run: yarn run lint

Expand All @@ -24,6 +24,9 @@ jobs:
node-version:
- 14.x
- 16.x
- 18.x
- 20.x
- 21.x
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Automatically generate component files from TypeScript classes for the Components.js dependency injection framework",
"main": "index.js",
"engines": {
"node": ">=12.0"
"node": ">=14"
},
"scripts": {
"build": "tsc",
Expand Down
9 changes: 7 additions & 2 deletions test/parse/PackageMetadataLoader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,13 @@ describe('PackageMetadataLoader', () => {
resolutionContext.contentsOverrides = {
[normalizeFilePath('/package.json')]: `{`,
};
await expect(loader.load('/')).rejects
.toThrow(new Error(`Invalid package: Syntax error in ${normalizeFilePath('/package.json')}: Unexpected end of JSON input`));
await expect(loader.load('/')).rejects.toMatchObject({
name: 'Error',
message: expect.stringMatching(
/* eslint-disable max-len */
/Invalid package: Syntax error in .*\/package.json: (Unexpected end of JSON input|Expected property name or '\}')/u,
),
});
});

it('should error when lsd:module is missing', async() => {
Expand Down
5 changes: 4 additions & 1 deletion test/serialize/ComponentConstructor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2221,7 +2221,10 @@ describe('ComponentConstructor', () => {
defaults: [{ type: 'raw', value: '{"a":invalid}' }],
comment: 'Hi',
}, parameters, 'mp:components/a/b/file-param.jsonld#MyClass_field', scope))
.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`);
.rejects.toThrow(
/* eslint-disable max-len */
/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,
);
});
});

Expand Down
Loading

0 comments on commit b8f121a

Please sign in to comment.