Skip to content

Commit ca95875

Browse files
committed
chore(ts): add root project references for editor tooling
Split shared compiler options into tsconfig.base.json so the root tsconfig.json can describe the workspace project graph. This lets TypeScript language servers resolve references across package boundaries while keeping package builds on the same compiler settings.
1 parent 20935f8 commit ca95875

9 files changed

Lines changed: 36 additions & 23 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"scripts": {
2020
"prepare": "husky || true",
21-
"build": "tsc -b tsconfig.build.json",
21+
"build": "tsc -b tsconfig.json",
2222
"clean": "rimraf -g **/node_modules **/tests/**/package-lock.json **/examples/**/package-lock.json **/dist **/coverage packages/fuzzer/build packages/fuzzer/prebuilds",
2323
"compile:watch": "tsc -b tsconfig.build.json --incremental --pretty --watch",
2424
"test": "run-script-os",

packages/bug-detectors/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"rootDir": ".",
55
"outDir": "dist"

packages/core/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"rootDir": ".",
55
"outDir": "dist"

packages/fuzzer/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"rootDir": ".",
55
"outDir": "dist"

packages/hooking/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"rootDir": ".",
55
"outDir": "dist"

packages/instrumentor/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"rootDir": ".",
55
"outDir": "dist"

packages/jest-runner/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"rootDir": ".",
55
"outDir": "dist"

tsconfig.base.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2020",
4+
"module": "NodeNext",
5+
"baseUrl": "./",
6+
"allowJs": true,
7+
"checkJs": true,
8+
"outDir": "./dist",
9+
"esModuleInterop": true,
10+
"forceConsistentCasingInFileNames": true,
11+
"strict": true,
12+
"skipLibCheck": true,
13+
"declaration": true,
14+
"declarationMap": true,
15+
"composite": true,
16+
"alwaysStrict": true,
17+
"sourceMap": true
18+
}
19+
}

tsconfig.json

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
{
2-
"compilerOptions": {
3-
"target": "ES2020",
4-
"module": "NodeNext",
5-
"baseUrl": "./",
6-
"allowJs": true,
7-
"checkJs": true,
8-
"outDir": "./dist",
9-
"esModuleInterop": true,
10-
"forceConsistentCasingInFileNames": true,
11-
"strict": true,
12-
"skipLibCheck": true,
13-
"declaration": true,
14-
"composite": true,
15-
"alwaysStrict": true,
16-
"sourceMap": true
17-
}
2+
"extends": "./tsconfig.base.json",
3+
"files": [],
4+
"references": [
5+
{ "path": "packages/bug-detectors" },
6+
{ "path": "packages/core" },
7+
{ "path": "packages/fuzzer" },
8+
{ "path": "packages/hooking" },
9+
{ "path": "packages/instrumentor" },
10+
{ "path": "packages/jest-runner" }
11+
]
1812
}

0 commit comments

Comments
 (0)