Skip to content

Commit 53dff01

Browse files
timolegrosrotorsoft
and
rotorsoft
authored
tsconfig builds (#7517)
* update tsconfig configuration in `/model` * update tsconfig configuration in `/core` * update tsconfig configuration in `/chains` * update tsconfig configuration in `/adapters` * update tsconfig configuration in `shared` * update tsconfig configuration in `logging` * `packages/commonwealth` tsconfig update + copy `references` to build tsconfig (microsoft/TypeScript#27098) * specify tsconfig.build.json in references * discobot and snapshot tsconfig.build.json updates * remove test from includes (follow-up PR) * merge resolution * merge resolution * remove "test" from include in snapshot * leaner tsconfig --------- Co-authored-by: rotorsoft <rotorsoft@outlook.com>
1 parent ed0bdc1 commit 53dff01

31 files changed

+166
-97
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ docker-compose.yaml
22
stellar
33
node_modules/
44
**/build
5-
**/dist
5+
**/*.tsbuildinfo
66
**/.DS_Store
77
*.env
88
*.log

libs/adapters/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"main": "build/index",
1010
"types": "src/index",
1111
"scripts": {
12-
"build": "tsc -b",
13-
"clean": "rm -rf build",
12+
"build": "tsc -b tsconfig.build.json",
13+
"clean": "rm -rf build && find . -type f -name '*.tsbuildinfo' -exec rm {} +",
1414
"check-types": "tsc --noEmit",
1515
"test": "NODE_ENV=test ts-mocha 'test/**/*.spec.ts'"
1616
},

libs/adapters/tsconfig.build.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": "src",
5+
"outDir": "build"
6+
},
7+
"include": ["src"],
8+
"references": [
9+
{ "path": "../core/tsconfig.build.json" },
10+
{ "path": "../logging/tsconfig.build.json" }
11+
]
12+
}

libs/adapters/tsconfig.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
{
22
"extends": "../tsconfig.json",
3-
"compilerOptions": {
4-
"rootDir": "src",
5-
"outDir": "build",
6-
"tsBuildInfoFile": "build/.tsbuildinfo",
7-
"strict": true
8-
},
9-
"include": ["src"],
10-
"references": [{ "path": "../core" }, { "path": "../logging" }]
3+
"include": ["src"]
114
}

libs/chains/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"main": "build/index",
1010
"types": "src/index",
1111
"scripts": {
12-
"build": "tsc -b",
13-
"clean": "rm -rf build",
12+
"build": "tsc -b tsconfig.build.json",
13+
"clean": "rm -rf build && find . -type f -name '*.tsbuildinfo' -exec rm {} +",
1414
"check-types": "tsc --noEmit",
1515
"test": "NODE_ENV=test ts-mocha 'test/**/*.spec.ts'"
1616
},

libs/chains/tsconfig.build.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": "src",
5+
"outDir": "build"
6+
},
7+
"include": ["src"]
8+
}

libs/chains/tsconfig.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
{
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
4-
"rootDir": "src",
5-
"outDir": "build",
6-
"tsBuildInfoFile": "build/.tsbuildinfo"
4+
"strict": false
75
},
8-
"include": ["src"]
6+
"include": ["src", "test"]
97
}

libs/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"main": "build/index",
1010
"types": "src/index",
1111
"scripts": {
12-
"build": "tsc -b",
13-
"clean": "rm -rf build",
12+
"build": "tsc -b ./tsconfig.build.json",
13+
"clean": "rm -rf build && find . -type f -name '*.tsbuildinfo' -exec rm {} +",
1414
"check-types": "tsc --noEmit",
1515
"test": "NODE_ENV=test ts-mocha 'test/**/*.spec.ts'"
1616
},

libs/core/tsconfig.build.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": "src",
5+
"outDir": "build"
6+
},
7+
"include": ["src"],
8+
"references": [
9+
{ "path": "../logging/tsconfig.build.json" },
10+
{ "path": "../shared/tsconfig.build.json" }
11+
]
12+
}

libs/core/tsconfig.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
{
22
"extends": "../tsconfig.json",
3-
"compilerOptions": {
4-
"rootDir": "src",
5-
"outDir": "build",
6-
"tsBuildInfoFile": "build/.tsbuildinfo",
7-
"strict": true
8-
},
9-
"include": ["src"],
10-
"references": [{ "path": "../logging" }, { "path": "../shared" }]
3+
"include": ["src", "test"]
114
}

libs/logging/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"main": "build/index",
1010
"types": "src/index",
1111
"scripts": {
12-
"build": "tsc -b",
13-
"clean": "rm -rf build",
12+
"build": "tsc -b ./tsconfig.build.json",
13+
"clean": "rm -rf build && find . -type f -name '*.tsbuildinfo' -exec rm {} +",
1414
"check-types": "tsc --noEmit",
1515
"test": "echo No tests to run"
1616
},

libs/logging/tsconfig.build.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": "src",
5+
"outDir": "build"
6+
},
7+
"include": ["src"]
8+
}

libs/logging/tsconfig.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
{
22
"extends": "../tsconfig.json",
3-
"compilerOptions": {
4-
"rootDir": "src",
5-
"outDir": "build",
6-
"tsBuildInfoFile": "build/.tsbuildinfo",
7-
"strict": true
8-
},
9-
"include": ["src"]
3+
"include": ["src", "test"]
104
}

libs/model/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"main": "build/index",
1010
"types": "src/index",
1111
"scripts": {
12-
"build": "tsc -b",
13-
"clean": "rm -rf build",
12+
"build": "tsc -b ./tsconfig.build.json",
13+
"clean": "rm -rf build && find . -type f -name '*.tsbuildinfo' -exec rm {} +",
1414
"check-types": "tsc --noEmit",
1515
"test": "yarn build && NODE_ENV=test ts-mocha 'test/**/*.spec.ts'"
1616
},

libs/model/tsconfig.build.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": "src",
5+
"outDir": "build"
6+
},
7+
"include": ["src"],
8+
"references": [
9+
{ "path": "../core/tsconfig.build.json" },
10+
{ "path": "../chains/tsconfig.build.json" },
11+
{ "path": "../shared/tsconfig.build.json" },
12+
{ "path": "../logging/tsconfig.build.json" }
13+
]
14+
}

libs/model/tsconfig.json

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
{
22
"extends": "../tsconfig.json",
3-
"compilerOptions": {
4-
"rootDir": "src",
5-
"outDir": "build",
6-
"tsBuildInfoFile": "build/.tsbuildinfo",
7-
"strict": true
8-
},
9-
"include": ["src"],
10-
"references": [
11-
{ "path": "../core" },
12-
{ "path": "../chains" },
13-
{ "path": "../shared" },
14-
{ "path": "../logging" }
15-
]
3+
"include": ["src"]
164
}

libs/shared/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"main": "build/index",
1010
"types": "src/index",
1111
"scripts": {
12-
"build": "tsc -b",
13-
"clean": "rm -rf build",
12+
"build": "tsc -b ./tsconfig.build.json",
13+
"clean": "rm -rf build && find . -type f -name '*.tsbuildinfo' -exec rm {} +",
1414
"check-types": "tsc --noEmit",
1515
"test": "echo No tests for @hicommonwealth/shared"
1616
},

libs/shared/tsconfig.build.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": "src",
5+
"outDir": "build"
6+
},
7+
"include": ["src"]
8+
}

libs/shared/tsconfig.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
{
22
"extends": "../tsconfig.json",
3-
"compilerOptions": {
4-
"rootDir": "src",
5-
"outDir": "build",
6-
"tsBuildInfoFile": "build/.tsbuildinfo",
7-
"strict": true
8-
},
9-
"include": ["src"]
3+
"include": ["src", "test"]
104
}

libs/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"target": "ESNext",
55
"baseUrl": ".",
66
"composite": true,
7+
"strict": true,
78

89
"forceConsistentCasingInFileNames": true,
910
"preserveConstEnums": true,
@@ -19,5 +20,5 @@
1920
"@hicommonwealth/*": ["libs/*/src"]
2021
}
2122
},
22-
"exclude": ["**/node_modules", "**/build", "**/test", "**/__mocks__"]
23+
"exclude": ["**/node_modules", "**/build"]
2324
}

packages/commonwealth/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"add-component-showcase": "tsx ./scripts/add-component-showcase.ts",
77
"archive-outbox": "tsx -r tsconfig-paths/register ./scripts/archive-outbox.ts",
8-
"build": "tsc -b && tsc-alias",
8+
"build": "tsc -b ./tsconfig.build.json && tsc-alias -p ./tsconfig.build.json",
99
"clean": "rm -rf build",
1010
"check-types": "tsc --noEmit",
1111
"bundle": "webpack --config webpack/webpack.prod.config.js --progress",
@@ -19,7 +19,6 @@
1919
"emit-notification": "tsx -r tsconfig-paths/register server/scripts/emitTestNotification.ts",
2020
"emit-webhook": "tsx -r tsconfig-paths/register server/scripts/emitWebhook.ts",
2121
"format": "prettier --ignore-path ../../.prettierignore --config ../../.prettierrc.json --write .",
22-
"heroku-postbuild": "NODE_OPTIONS=--max-old-space-size=$(../../scripts/get-max-old-space-size.sh) webpack --config webpack/webpack.prod.config.js --progress && yarn build-consumer",
2322
"integration-test": "NODE_ENV=test nyc ts-mocha -r tsconfig-paths/register './test/integration/**/*.spec.ts'",
2423
"lint-all": "eslint client/\\**/*.{ts,tsx} server/\\**/*.ts",
2524
"lint-diff": "NODE_OPTIONS='--max-old-space-size=16384' eslint --cache -c .eslintrc-diff.js client/\\**/*.{ts,tsx} server/\\**/*.ts scripts/\\**/*.ts shared/\\**/*.ts test/\\**/*.ts",
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "build"
5+
},
6+
"include": [
7+
"./client",
8+
"./shared",
9+
"./globals.d.ts",
10+
"./server",
11+
"./server.ts",
12+
"./scripts"
13+
],
14+
"references": [
15+
{ "path": "../../libs/adapters/tsconfig.build.json" },
16+
{ "path": "../../libs/chains/tsconfig.build.json" },
17+
{ "path": "../../libs/core/tsconfig.build.json" },
18+
{ "path": "../../libs/model/tsconfig.build.json" },
19+
{ "path": "../../libs/logging/tsconfig.build.json" },
20+
{ "path": "../../libs/shared/tsconfig.build.json" }
21+
]
22+
}

packages/commonwealth/tsconfig.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"skipLibCheck": true,
66
"sourceMap": true,
77
"rootDir": ".",
8-
"outDir": "build",
98
"baseUrl": ".",
109
"paths": {
1110
"@hicommonwealth/*": ["../../libs/*/src"],
@@ -19,14 +18,15 @@
1918
"./globals.d.ts",
2019
"./server",
2120
"./server.ts",
21+
"./server-test.ts",
2222
"./scripts"
2323
],
2424
"references": [
25-
{ "path": "../../libs/adapters" },
26-
{ "path": "../../libs/chains" },
27-
{ "path": "../../libs/core" },
28-
{ "path": "../../libs/model" },
29-
{ "path": "../../libs/logging" },
30-
{ "path": "../../libs/shared" }
25+
{ "path": "../../libs/adapters/tsconfig.build.json" },
26+
{ "path": "../../libs/chains/tsconfig.build.json" },
27+
{ "path": "../../libs/core/tsconfig.build.json" },
28+
{ "path": "../../libs/model/tsconfig.build.json" },
29+
{ "path": "../../libs/logging/tsconfig.build.json" },
30+
{ "path": "../../libs/shared/tsconfig.build.json" }
3131
]
3232
}

packages/discord-bot/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"description": "",
55
"scripts": {
6-
"build": "tsc -b && tsc-alias",
6+
"build": "tsc -b ./tsconfig.build.json && tsc-alias -p ./tsconfig.build.json",
77
"clean": "rm -rf build",
88
"check-types": "tsc --noEmit",
99
"dev": "concurrently -n watcher,listener,consumer -c red,green,yellow 'tsc -b -w' 'yarn start' 'yarn start-consumer'",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": "src",
5+
"outDir": "build"
6+
},
7+
"include": ["src"],
8+
"references": [
9+
{ "path": "../../libs/adapters/tsconfig.build.json" },
10+
{ "path": "../../libs/core/tsconfig.build.json" },
11+
{ "path": "../../libs/model/tsconfig.build.json" },
12+
{ "path": "../../libs/logging/tsconfig.build.json" }
13+
]
14+
}

packages/discord-bot/tsconfig.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
"lib": ["es2020"],
55
"typeRoots": ["./node_modules/@types"],
66
"skipLibCheck": true,
7-
"rootDir": "src",
8-
"outDir": "build"
7+
"rootDir": "."
98
},
109
"include": ["src"],
1110
"references": [
12-
{ "path": "../../libs/adapters" },
13-
{ "path": "../../libs/core" },
14-
{ "path": "../../libs/model" },
15-
{ "path": "../../libs/logging" }
11+
{ "path": "../../libs/adapters/tsconfig.build.json" },
12+
{ "path": "../../libs/core/tsconfig.build.json" },
13+
{ "path": "../../libs/model/tsconfig.build.json" },
14+
{ "path": "../../libs/logging/tsconfig.build.json" }
1615
]
1716
}

packages/scripts/tsconfig.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
},
1010
"include": ["src"],
1111
"references": [
12-
{ "path": "../../libs/adapters" },
13-
{ "path": "../../libs/core" },
14-
{ "path": "../../libs/model" },
15-
{ "path": "../../libs/logging" }
12+
{ "path": "../../libs/adapters/tsconfig.build.json" },
13+
{ "path": "../../libs/core/tsconfig.build.json" },
14+
{ "path": "../../libs/model/tsconfig.build.json" },
15+
{ "path": "../../libs/logging/tsconfig.build.json" }
1616
]
1717
}

packages/snapshot-listener/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"private": true,
55
"scripts": {
6-
"build": "tsc -b && tsc-alias",
6+
"build": "tsc -b ./tsconfig.build.json && tsc-alias -p ./tsconfig.build.json",
77
"clean": "rm -rf build",
88
"check-types": "tsc --noEmit",
99
"lint-all": "eslint './**/*.ts'",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": "src",
5+
"outDir": "build"
6+
},
7+
"include": ["src"],
8+
"references": [
9+
{ "path": "../../libs/adapters/tsconfig.build.json" },
10+
{ "path": "../../libs/core/tsconfig.build.json" },
11+
{ "path": "../../libs/logging/tsconfig.build.json" }
12+
]
13+
}

0 commit comments

Comments
 (0)