Skip to content

Commit 1c39b80

Browse files
authored
refactor [NET-1645]: Clean-up tsconfigs for the cdn-location package (#3269)
This pull request updates TypeScript configuration and build scripts for the `cdn-location` (primarily) and `dht` packages to improve type checking, project references, and test configuration. The main focus is on refining how different parts of the codebase are built and checked, especially for data generation and testing. ### Changes **TypeScript configuration improvements:** * Added a new `tsconfig.data-generation.json` in `cdn-location` for type-checking the `data-generation` directory without emitting output, and updated the main `tsconfig.json` to reference it. * Updated `tsconfig.jest.json` in `cdn-location` to only include the `test` directory, and changed project references to point to the local `tsconfig.node.json` and `test-utils`. * Adjusted `tsconfig.node.json` in `cdn-location` to remove the reference to `test-utils`, keeping only `utils` as a reference. **Build and check script enhancements:** * Improved the `check` script in `cdn-location/package.json` to run type checks for both test and data generation configs, ensuring stricter type safety across the project. **Project references update for `dht` package:** * Changed `dht` package TypeScript configs to reference the entire `cdn-location` project instead of just its `tsconfig.node.json`, simplifying dependency management.
1 parent 6fcdc10 commit 1c39b80

File tree

7 files changed

+18
-12
lines changed

7 files changed

+18
-12
lines changed

packages/cdn-location/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"license": "Apache-2.0",
1919
"author": "Streamr Network AG <[email protected]>",
2020
"scripts": {
21-
"build": "tsc -b tsconfig.node.json",
22-
"check": "tsc -p ./tsconfig.jest.json",
21+
"build": "tsc -b",
22+
"check": "tsc -p ./tsconfig.jest.json && tsc --noEmit -p ./tsconfig.node.json && tsc --noEmit -p ./tsconfig.data-generation.json",
2323
"clean": "jest --clearCache || true; rm -rf dist *.tsbuildinfo node_modules/.cache || true",
2424
"eslint": "eslint --cache --cache-location=node_modules/.cache/.eslintcache/ '*/**/*.{js,ts}'",
2525
"test": "jest test/integration",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.node.json",
3+
"compilerOptions": {
4+
"noEmit": true
5+
},
6+
"include": [
7+
"data-generation"
8+
]
9+
}
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
{
22
"extends": "../../tsconfig.jest.json",
33
"include": [
4-
"src",
5-
"data-generation",
64
"test"
75
],
86
"references": [
9-
{ "path": "../utils/tsconfig.node.json" },
10-
{ "path": "../test-utils/tsconfig.node.json" },
11-
{ "path": "../proto-rpc/tsconfig.node.json" },
12-
{ "path": "../autocertifier-client" }
7+
{ "path": "./tsconfig.node.json" },
8+
{ "path": "../test-utils/tsconfig.node.json" }
139
]
1410
}

packages/cdn-location/tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"composite": true
55
},
66
"references": [
7+
{ "path": "./tsconfig.node.json" },
8+
{ "path": "./tsconfig.data-generation.json" },
79
{ "path": "./tsconfig.jest.json" }
810
]
911
}

packages/cdn-location/tsconfig.node.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"src"
99
],
1010
"references": [
11-
{ "path": "../utils/tsconfig.node.json" },
12-
{ "path": "../test-utils/tsconfig.node.json" }
11+
{ "path": "../utils/tsconfig.node.json" }
1312
]
1413
}

packages/dht/tsconfig.jest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{ "path": "../test-utils/tsconfig.node.json" },
1717
{ "path": "../proto-rpc/tsconfig.node.json" },
1818
{ "path": "../autocertifier-client" },
19-
{ "path": "../cdn-location/tsconfig.node.json" },
19+
{ "path": "../cdn-location" },
2020
{ "path": "../geoip-location/tsconfig.node.json" }
2121
]
2222
}

packages/dht/tsconfig.node.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
{ "path": "../test-utils/tsconfig.node.json" },
1515
{ "path": "../proto-rpc/tsconfig.node.json" },
1616
{ "path": "../autocertifier-client" },
17-
{ "path": "../cdn-location/tsconfig.node.json" },
17+
{ "path": "../cdn-location" },
1818
{ "path": "../geoip-location/tsconfig.node.json" }
1919
]
2020
}

0 commit comments

Comments
 (0)