Skip to content

Commit 86fa31f

Browse files
authored
chore: adopt typescript project references (#322)
- adopt project references for the main packages - add `yarn build:watch` command using new config ref: https://www.typescriptlang.org/docs/handbook/project-references.html
1 parent 3420e3a commit 86fa31f

File tree

11 files changed

+49
-28
lines changed

11 files changed

+49
-28
lines changed

e2e/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"extends": "../tsconfig.json",
2+
"extends": "../tsconfig.base.json",
33
"compilerOptions": {
4+
"composite": false,
45
"outDir": "./dist",
56
"rootDir": "./src"
67
},

integration-tests/typescript-axios/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4+
"composite": false,
45
"outDir": "./dist",
56
"rootDir": "./src",
67
/* exercise the code path where exactOptionalPropertyTypes is enabled */

integration-tests/typescript-fetch/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4+
"composite": false,
45
"outDir": "./dist",
56
"rootDir": "./src",
67
/* exercise the code path where exactOptionalPropertyTypes is disabled */

integration-tests/typescript-koa/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4+
"composite": false,
45
"outDir": "./dist",
56
"rootDir": "./src",
67
"types": [],

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"lint": "biome lint --write .",
2525
"format": "biome check --write .",
2626
"build": "node ./scripts/generate-ajv-validator.js && lerna run build --stream --scope '@nahkies/*'",
27+
"build:watch": "tsc -b tsconfig.json -w",
2728
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
2829
"integration:generate": "node ./scripts/generate.mjs",
2930
"integration:validate": "lerna run validate --stream",
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "./dist",
55
"rootDir": "./src"
66
},
7-
"include": ["src/**/*"]
7+
"include": ["src/**/*"],
8+
"references": []
89
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "./dist",
55
"rootDir": "./src"
66
},
7-
"include": ["src/**/*"]
7+
"include": ["src/**/*"],
8+
"references": []
89
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "./dist",
55
"rootDir": "./src"
66
},
7-
"include": ["src/**/*"]
7+
"include": ["src/**/*"],
8+
"references": []
89
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "./dist",
55
"rootDir": "./src"
66
},
7-
"include": ["src/**/*"]
7+
"include": ["src/**/*"],
8+
"references": []
89
}

tsconfig.base.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"extends": ["@tsconfig/strictest/tsconfig", "@tsconfig/node22/tsconfig"],
3+
"compilerOptions": {
4+
"composite": true,
5+
"skipLibCheck": true,
6+
"declaration": true,
7+
"sourceMap": true,
8+
"importHelpers": true,
9+
"resolveJsonModule": true,
10+
// prefer linter rule
11+
"noUnusedLocals": false,
12+
"noUnusedParameters": false,
13+
// incompatible with https://biomejs.dev/linter/rules/use-literal-keys/
14+
"noPropertyAccessFromIndexSignature": false,
15+
"moduleResolution": "Node16",
16+
"paths": {
17+
"@nahkies/*": ["./packages/*/src"]
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)