diff --git a/package-lock.json b/package-lock.json index 80fdeef..f612d1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "jsdoc": "^4.0.5", "rollup": "^4.46.2", "tap": "^21.1.0", - "typescript": "^5.9.3" + "typescript": "^6.0.2" }, "engines": { "node": "^20.9.0 || ^22.11.0 || >=24.0.0" @@ -1601,6 +1601,20 @@ "@tapjs/core": "4.5.2" } }, + "node_modules/@tapjs/test/node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/@tapjs/typescript": { "version": "3.5.4", "resolved": "https://registry.npmjs.org/@tapjs/typescript/-/typescript-3.5.4.tgz", @@ -5297,6 +5311,20 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/tshy/node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/tuf-js": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-4.1.0.tgz", @@ -5339,9 +5367,9 @@ } }, "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.2.tgz", + "integrity": "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index 087624e..2d7adb4 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,6 @@ "jsdoc": "^4.0.5", "rollup": "^4.46.2", "tap": "^21.1.0", - "typescript": "^5.9.3" + "typescript": "^6.0.2" } } diff --git a/test/fixtures/types/tsconfig-cjs.test.json b/test/fixtures/types/tsconfig-cjs.test.json index 3126251..27db423 100644 --- a/test/fixtures/types/tsconfig-cjs.test.json +++ b/test/fixtures/types/tsconfig-cjs.test.json @@ -2,11 +2,11 @@ "compilerOptions": { "noEmit": true, "skipLibCheck": true, - "module": "commonjs", + "module": "preserve", "esModuleInterop": true, "target": "ES2022", - "moduleResolution": "node", - "baseUrl": ".", + "moduleResolution": "bundler", + "types": ["node"], "paths": { "node-osc": ["../../../types/index.d.mts"] } diff --git a/test/fixtures/types/tsconfig-esm.test.json b/test/fixtures/types/tsconfig-esm.test.json index ff120df..b727c95 100644 --- a/test/fixtures/types/tsconfig-esm.test.json +++ b/test/fixtures/types/tsconfig-esm.test.json @@ -5,8 +5,9 @@ "esModuleInterop": true, "module": "ES2022", "target": "ES2022", - "moduleResolution": "node", - "baseUrl": ".", + "moduleResolution": "bundler", + "types": ["node"], + "rootDir": ".", "paths": { "node-osc": ["../../../types/index.d.mts"] } diff --git a/tsconfig.json b/tsconfig.json index 6b76141..062d17b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,7 +14,7 @@ // Module settings for ESM (will generate .d.mts files) "module": "ES2022", - "moduleResolution": "node", + "moduleResolution": "bundler", "target": "ES2022", // Allow default imports from modules with no default export @@ -24,12 +24,17 @@ // Strict options for better type inference "strict": false, "skipLibCheck": true, + + // Include Node.js types so EventEmitter inheritance is resolved in generated declarations + "types": ["node"], // Resolve JSON modules "resolveJsonModule": true, - // Base URL for paths - "baseUrl": ".", + // Explicit rootDir since TypeScript 6.0 no longer infers it + "rootDir": "./lib", + + // Use explicit paths relative to root (no baseUrl needed in TS 6.0) "paths": { "#decode": ["./lib/internal/decode.mjs"] }