build: type-check src against the Node 18 declarations

@types/node was not declared. It was installed only because mqtt's @types/readable-stream and @types/ws depend on
"@types/node": "*", and it resolved to 26.6.2, so an API newer than the "engines" floor passed the type check and
the build depended on another package's dependency list.

@types/node ^18.19.130 is now a devDependency (undici-types follows, 8.9.0 -> 5.26.5). A call to
process.loadEnvFile() (Node 20.12) in src/ now fails with TS2339. npm run check passes, the fixture compile with
skipLibCheck off included, so mqtt's declarations hold against the Node 18 types.

First run on the floor: npm test passes 24/24 on Node 18.20.8 and 20.20.2 as well as 24.21.0. No change to src/ or
dist/.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
David 2026-09-28 14:29:15 +00:00
parent f74773132a
commit 09b5da0992
2 changed files with 16 additions and 14 deletions

View file

@ -44,6 +44,7 @@
},
"homepage": "https://git.stormysdream.club/apps/Alex2Node#readme",
"devDependencies": {
"@types/node": "^18.19.130",
"aedes": "^0.51.3",
"dotenv": "^16.5.0",
"typescript": "^5.8.3"