build: fix tsconfig monorepo setup (#10028)

Should fix messed up import suggestions and simplifies all tsconfigs
through inheritance.

One main issue was that packages were inheriting `baseURL: "."` from the
root tsconfig. This caused incorrect import suggestions that start with
"packages/...".

This PR ensures that packages do not inherit this baseURL: "." property,
while ensuring the root, non-inherited tsconfig still keeps it to get
tests to work (the importMap needs it)
This commit is contained in:
Alessio Gravili
2024-12-17 12:49:29 -07:00
committed by GitHub
parent 70666a0f7b
commit f5c13deb24
39 changed files with 183 additions and 703 deletions

View File

@@ -1,14 +1,4 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"composite": true, // Make sure typescript knows that this module depends on their references
"noEmit": false /* Do not emit outputs. */,
"emitDeclarationOnly": true,
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
"rootDir": "./src" /* Specify the root folder within your source files. */,
"strict": true
},
"exclude": ["dist", "node_modules"],
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "src/**/*.json"],
"extends": "../../tsconfig.base.json",
"references": [{ "path": "../payload" }, { "path": "../plugin-cloud-storage" }]
}