build(types): add node typings for TypeScript 6

This commit is contained in:
xixu-me committed 2026-03-30 22:00:59 +08:00
1 parent d0017f1251
commit 4e47299939
4 files changed
+31 -11

No files matched your search

+9 -10
View File
@@ -15,6 +15,7 @@
"@commitlint/cli": "^20.5.0", "@commitlint/cli": "^20.5.0",
"@commitlint/config-conventional": "^20.5.0", "@commitlint/config-conventional": "^20.5.0",
"@eslint/js": "^10.0.1", "@eslint/js": "^10.0.1",
"@types/node": "^24.0.0",
"@vitest/coverage-istanbul": "^4.1.2", "@vitest/coverage-istanbul": "^4.1.2",
"eslint": "^10.1.0", "eslint": "^10.1.0",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
@@ -2488,14 +2489,13 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "25.3.5", "version": "24.12.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.3.5.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.0.tgz",
"integrity": "sha512-oX8xrhvpiyRCQkG1MFchB09f+cXftgIXb3a7UUa4Y3wpmZPw5tyZGTLWhlESOLq1Rq6oDlc8npVU2/9xiCuXMA==", "integrity": "sha512-GYDxsZi3ChgmckRT9HPU0WEhKLP08ev/Yfcq2AstjrDASOYCSXeyjDsHg4v5t4jOj7cyDX3vmprafKlWIG9MXQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"peer": true,
"dependencies": { "dependencies": {
"undici-types": "~7.18.0" "undici-types": "~7.16.0"
} }
}, },
"node_modules/@typescript-eslint/types": { "node_modules/@typescript-eslint/types": {
@@ -5783,12 +5783,11 @@
} }
}, },
"node_modules/undici-types": { "node_modules/undici-types": {
"version": "7.18.2", "version": "7.16.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
"integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT"
"peer": true
}, },
"node_modules/unenv": { "node_modules/unenv": {
"version": "2.0.0-rc.24", "version": "2.0.0-rc.24",
+1
View File
@@ -8,6 +8,7 @@
"@commitlint/cli": "^20.5.0", "@commitlint/cli": "^20.5.0",
"@commitlint/config-conventional": "^20.5.0", "@commitlint/config-conventional": "^20.5.0",
"@eslint/js": "^10.0.1", "@eslint/js": "^10.0.1",
"@types/node": "^24.0.0",
"@vitest/coverage-istanbul": "^4.1.2", "@vitest/coverage-istanbul": "^4.1.2",
"eslint": "^10.1.0", "eslint": "^10.1.0",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
+19
View File
@@ -0,0 +1,19 @@
// @vitest-environment node
import { createRequire } from 'node:module';
import { describe, expect, it } from 'vitest';
const require = createRequire(import.meta.url);
const tsconfig = require('../../tsconfig.json');
const packageJson = require('../../package.json');
describe('TypeScript config', () => {
it('explicitly includes Node.js types for mixed runtime files', () => {
expect(tsconfig.compilerOptions.types).toContain('node');
});
it('declares Node.js typings as a dev dependency', () => {
expect(packageJson.devDependencies['@types/node']).toBeTruthy();
});
});
+2 -1
View File
@@ -9,7 +9,8 @@
"noEmit": true, "noEmit": true,
"skipLibCheck": true, "skipLibCheck": true,
"strict": true, "strict": true,
"target": "ES2022" "target": "ES2022",
"types": ["node"]
}, },
"exclude": ["node_modules", "dist", "coverage"], "exclude": ["node_modules", "dist", "coverage"],
"include": ["src/**/*", "test/**/*", "node_modules/@cloudflare/vitest-pool-workers/types/**/*"] "include": ["src/**/*", "test/**/*", "node_modules/@cloudflare/vitest-pool-workers/types/**/*"]