Skip to content

Commit

Permalink
Install and use the most recent Node types for the types tests
Browse files Browse the repository at this point in the history
The types tests run in Node.js and therefore use Node types for e.g.
builtins. However, we didn't explicitly indicate this in
`tsconfig.json` (see [1] for more information and [2] for the PR where
we found this). Moreover, we didn't explicitly install the most recent
version of `@types/node` which implicitly made us fall back to version
14.14.45 (because that was installed as a dependency of other modules)
whereas much newer versions are available and we need those after
changes in Node.js (see [3] for more information and [4] for the PR
where we found this).

This commit fixes both issues by explicitly installing and using the
most recent Node.js types, which should also avoid future issues with
the types tests.

[1] TypeStrong/ts-node#1012
[2] mozilla#18237
[3] https://stackoverflow.com/questions/78790943/in-typescript-5-6-buffer-is-not-assignable-to-arraybufferview-or-uint8arr
[4] mozilla#18959
  • Loading branch information
timvandermeij authored and ryzokuken committed Nov 4, 2024
1 parent f96697f commit c8980ba
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
20 changes: 16 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"@jazzer.js/core": "^2.1.0",
"@metalsmith/layouts": "^2.7.0",
"@metalsmith/markdown": "^1.10.0",
"@types/node": "^22.8.7",
"autoprefixer": "^10.4.20",
"babel-loader": "^9.2.1",
"caniuse-lite": "^1.0.30001677",
Expand Down
2 changes: 1 addition & 1 deletion test/types/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"module": "ESNext",
"baseUrl": "./",
"strict": true,
"types": [],
"types": ["node"],
"lib": ["ESNext", "DOM"],
"paths": {
"pdfjs-dist": ["../../build/typestest"],
Expand Down

0 comments on commit c8980ba

Please sign in to comment.