refactor: use TS project references instead of running tsc multiple times (#7437)

* refactor: use TS project references instead of running tsc multiple times

* deduplicate

* dedup

* eliminate --project

* add swc config

* add target
This commit is contained in:
Joshua Chen 2022-05-17 15:21:44 +08:00 committed by GitHub
parent 1bec5f673a
commit 7613ecb9ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
76 changed files with 233 additions and 145 deletions

View file

@ -1,4 +1,4 @@
copyUntypedFiles.mjs
.tsbuildinfo
.tsbuildinfo*
tsconfig*
__tests__

View file

@ -21,11 +21,7 @@
},
"license": "MIT",
"scripts": {
"build": "yarn build:server && yarn build:client && yarn build:copy && yarn build:format",
"build:server": "tsc --project tsconfig.server.json",
"build:client": "tsc --project tsconfig.client.json",
"build:copy": "node copyUntypedFiles.mjs",
"build:format": "prettier --config ../../.prettierrc --write \"lib/**/*.js\""
"build": "tsc --build && node copyUntypedFiles.mjs && prettier --config ../../.prettierrc --write \"lib/theme/**/*.js\""
},
"dependencies": {
"@docsearch/react": "^3.0.0",

View file

@ -1,8 +1,13 @@
{
"extends": "./tsconfig.json",
"extends": "../../tsconfig.json",
"compilerOptions": {
"composite": true,
"incremental": true,
"tsBuildInfoFile": "./lib/.tsbuildinfo-client",
"rootDir": "src",
"outDir": "lib",
"module": "esnext",
"jsx": "react-native"
"target": "esnext"
},
"include": ["src/theme/", "src/client/", "src/*.d.ts"]
"include": ["src/theme", "src/client", "src/*.d.ts"]
}

View file

@ -1,8 +1,12 @@
{
"extends": "../../tsconfig.json",
"references": [{"path": "./tsconfig.client.json"}],
"compilerOptions": {
"lib": ["DOM", "ES2019"],
"incremental": true,
"tsBuildInfoFile": "./lib/.tsbuildinfo",
"rootDir": "src",
"outDir": "lib"
}
},
"include": ["src"],
"exclude": ["src/client", "src/theme", "**/__tests__/**"]
}

View file

@ -1,4 +0,0 @@
{
"extends": "./tsconfig.json",
"include": ["src/*.ts", "src/templates/*.ts"]
}