chore: add @types/node and update tsconfig

Add @types/node as a dev dependency and include it in tsconfig types
to support Node.js globals. Also expand tsconfig include to cover
configuration files.
This commit is contained in:
hypercross 2026-04-20 11:34:40 +08:00
parent 5e172c61bb
commit 90cb97e0ae
4 changed files with 29 additions and 9 deletions

18
package-lock.json generated
View File

@ -10,6 +10,7 @@
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@preact/signals-core": "^1.5.1", "@preact/signals-core": "^1.5.1",
"@types/node": "^25.6.0",
"inline-schema": "file:../inline-schema", "inline-schema": "file:../inline-schema",
"mutative": "^1.3.0", "mutative": "^1.3.0",
"tsup": "^8.0.2", "tsup": "^8.0.2",
@ -958,6 +959,16 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/node": {
"version": "25.6.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.6.0.tgz",
"integrity": "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~7.19.0"
}
},
"node_modules/@vitest/expect": { "node_modules/@vitest/expect": {
"version": "1.6.1", "version": "1.6.1",
"resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.1.tgz", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.1.tgz",
@ -2469,6 +2480,13 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/undici-types": {
"version": "7.19.2",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.19.2.tgz",
"integrity": "sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg==",
"dev": true,
"license": "MIT"
},
"node_modules/vite": { "node_modules/vite": {
"version": "5.4.21", "version": "5.4.21",
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz",

View File

@ -30,6 +30,7 @@
}, },
"devDependencies": { "devDependencies": {
"@preact/signals-core": "^1.5.1", "@preact/signals-core": "^1.5.1",
"@types/node": "^25.6.0",
"inline-schema": "file:../inline-schema", "inline-schema": "file:../inline-schema",
"mutative": "^1.3.0", "mutative": "^1.3.0",
"tsup": "^8.0.2", "tsup": "^8.0.2",

View File

@ -5,6 +5,7 @@
"lib": ["ES2020"], "lib": ["ES2020"],
"moduleResolution": "bundler", "moduleResolution": "bundler",
"strict": true, "strict": true,
"types": ["node"],
"esModuleInterop": true, "esModuleInterop": true,
"skipLibCheck": true, "skipLibCheck": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
@ -18,6 +19,6 @@
"@/*": ["src/*"], "@/*": ["src/*"],
}, },
}, },
"include": ["src/**/*", "tests/**/*"], "include": ["src/**/*", "tests/**/*", "*.config.ts"],
"exclude": ["node_modules", "dist"], "exclude": ["node_modules", "dist"],
} }

View File

@ -1,20 +1,20 @@
import { defineConfig } from 'tsup'; import { defineConfig } from "tsup";
import { fileURLToPath } from 'url'; import { fileURLToPath } from "url";
import { csvLoader } from 'inline-schema/csv-loader/rollup'; import { csvLoader } from "inline-schema/csv-loader/rollup";
const srcDir = fileURLToPath(new URL('./src', import.meta.url)); const srcDir = fileURLToPath(new URL("./src", import.meta.url));
export default defineConfig({ export default defineConfig({
entry: ['src/index.ts'], entry: ["src/index.ts"],
format: ['esm'], format: ["esm"],
dts: true, dts: true,
clean: true, clean: true,
sourcemap: true, sourcemap: true,
external: ['@preact/signals-core', 'mutative', 'inline-schema'], external: ["@preact/signals-core", "mutative", "inline-schema"],
plugins: [csvLoader()], plugins: [csvLoader()],
esbuildOptions(options) { esbuildOptions(options) {
options.alias = { options.alias = {
'@': srcDir, "@": srcDir,
}; };
}, },
}); });