From 0e8b6204fce3d9cb24bf678ce496e1f8bd985045 Mon Sep 17 00:00:00 2001 From: Patricio Palladino Date: Fri, 28 Jun 2024 21:11:31 +0000 Subject: [PATCH 1/2] Simplify `tsconfig.json` files with ${configDir} --- config-v-next/tsconfig.json | 8 ++++++-- v-next/core/tsconfig.json | 6 ------ v-next/example-project/tsconfig.json | 10 ---------- v-next/hardhat-build-system/tsconfig.json | 10 ---------- v-next/hardhat-errors/tsconfig.json | 10 ---------- v-next/hardhat-node-test-reporter/tsconfig.json | 6 ------ v-next/hardhat-utils/tsconfig.json | 10 ---------- v-next/hardhat-zod-utils/tsconfig.json | 10 ---------- v-next/hardhat/tsconfig.json | 11 ----------- v-next/template-package/tsconfig.json | 10 ---------- 10 files changed, 6 insertions(+), 85 deletions(-) diff --git a/config-v-next/tsconfig.json b/config-v-next/tsconfig.json index a8d0c00f0b..ec865ffa21 100644 --- a/config-v-next/tsconfig.json +++ b/config-v-next/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.node20.json", "compilerOptions": { + "outDir": "${configDir}/dist", "declaration": true, "declarationMap": true, "forceConsistentCasingInFileNames": true, @@ -9,6 +10,9 @@ "noEmitOnError": true, "noImplicitOverride": true, "skipDefaultLibCheck": true, - "sourceMap": true - } + "sourceMap": true, + "composite": true, + "incremental": true + }, + "exclude": ["${configDir}/dist", "${configDir}/node_modules"] } diff --git a/v-next/core/tsconfig.json b/v-next/core/tsconfig.json index 2b6adb1250..e421d7a2a0 100644 --- a/v-next/core/tsconfig.json +++ b/v-next/core/tsconfig.json @@ -1,11 +1,5 @@ { "extends": "../../config-v-next/tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - "composite": true, - "incremental": true - }, - "exclude": ["./dist", "./node_modules"], "references": [ { "path": "../hardhat-errors" diff --git a/v-next/example-project/tsconfig.json b/v-next/example-project/tsconfig.json index fe5de7c16a..5372c25bb5 100644 --- a/v-next/example-project/tsconfig.json +++ b/v-next/example-project/tsconfig.json @@ -1,15 +1,5 @@ { "extends": "../../config-v-next/tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - "composite": true, - "incremental": true - }, - "exclude": [ - "./dist", - "./node_modules", - "./test/fixture-projects/hardhat.config.ts" - ], "references": [ { "path": "../hardhat" diff --git a/v-next/hardhat-build-system/tsconfig.json b/v-next/hardhat-build-system/tsconfig.json index 034fb3117a..e421d7a2a0 100644 --- a/v-next/hardhat-build-system/tsconfig.json +++ b/v-next/hardhat-build-system/tsconfig.json @@ -1,15 +1,5 @@ { "extends": "../../config-v-next/tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - "composite": true, - "incremental": true - }, - "exclude": [ - "./dist", - "./node_modules", - "./test/fixture-projects/hardhat.config.ts" - ], "references": [ { "path": "../hardhat-errors" diff --git a/v-next/hardhat-errors/tsconfig.json b/v-next/hardhat-errors/tsconfig.json index 426017ab35..d42839db60 100644 --- a/v-next/hardhat-errors/tsconfig.json +++ b/v-next/hardhat-errors/tsconfig.json @@ -1,15 +1,5 @@ { "extends": "../../config-v-next/tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - "composite": true, - "incremental": true - }, - "exclude": [ - "./dist", - "./node_modules", - "./test/fixture-projects/hardhat.config.ts" - ], "references": [ { "path": "../hardhat-node-test-reporter" diff --git a/v-next/hardhat-node-test-reporter/tsconfig.json b/v-next/hardhat-node-test-reporter/tsconfig.json index 918ed695f9..3ef5487469 100644 --- a/v-next/hardhat-node-test-reporter/tsconfig.json +++ b/v-next/hardhat-node-test-reporter/tsconfig.json @@ -1,10 +1,4 @@ { "extends": "../../config-v-next/tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - "composite": true, - "incremental": true - }, - "exclude": ["./dist", "./node_modules"], "references": [] } diff --git a/v-next/hardhat-utils/tsconfig.json b/v-next/hardhat-utils/tsconfig.json index 7da6e253dd..16592c61ae 100644 --- a/v-next/hardhat-utils/tsconfig.json +++ b/v-next/hardhat-utils/tsconfig.json @@ -1,15 +1,5 @@ { "extends": "../../config-v-next/tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - "composite": true, - "incremental": true - }, - "exclude": [ - "./dist", - "./node_modules", - "./test/fixture-projects/hardhat.config.ts" - ], "references": [ { "path": "../hardhat-node-test-reporter" diff --git a/v-next/hardhat-zod-utils/tsconfig.json b/v-next/hardhat-zod-utils/tsconfig.json index 33c1c67b5a..92944d91ec 100644 --- a/v-next/hardhat-zod-utils/tsconfig.json +++ b/v-next/hardhat-zod-utils/tsconfig.json @@ -1,15 +1,5 @@ { "extends": "../../config-v-next/tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - "composite": true, - "incremental": true - }, - "exclude": [ - "./dist", - "./node_modules", - "./test/fixture-projects/hardhat.config.ts" - ], "references": [ { "path": "../core" diff --git a/v-next/hardhat/tsconfig.json b/v-next/hardhat/tsconfig.json index 8a82869d1e..933239e2ee 100644 --- a/v-next/hardhat/tsconfig.json +++ b/v-next/hardhat/tsconfig.json @@ -1,16 +1,5 @@ { "extends": "../../config-v-next/tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - "composite": true, - "incremental": true, - "resolveJsonModule": true - }, - "exclude": [ - "./dist", - "./node_modules", - "./test/fixture-projects/hardhat.config.ts" - ], "references": [ { "path": "../core" diff --git a/v-next/template-package/tsconfig.json b/v-next/template-package/tsconfig.json index 7da6e253dd..16592c61ae 100644 --- a/v-next/template-package/tsconfig.json +++ b/v-next/template-package/tsconfig.json @@ -1,15 +1,5 @@ { "extends": "../../config-v-next/tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - "composite": true, - "incremental": true - }, - "exclude": [ - "./dist", - "./node_modules", - "./test/fixture-projects/hardhat.config.ts" - ], "references": [ { "path": "../hardhat-node-test-reporter" From d47f212735649f363e04a271c2e44c0cdc696b9c Mon Sep 17 00:00:00 2001 From: Patricio Palladino Date: Fri, 28 Jun 2024 21:16:15 +0000 Subject: [PATCH 2/2] Only use each package's `@types/` as typesRoot. This is possible because we use nohoist for @types --- config-v-next/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config-v-next/tsconfig.json b/config-v-next/tsconfig.json index ec865ffa21..7ceae762ab 100644 --- a/config-v-next/tsconfig.json +++ b/config-v-next/tsconfig.json @@ -12,7 +12,8 @@ "skipDefaultLibCheck": true, "sourceMap": true, "composite": true, - "incremental": true + "incremental": true, + "typeRoots": ["${configDir}/node_modules/@types"] }, "exclude": ["${configDir}/dist", "${configDir}/node_modules"] }