Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: simplify TypeScript configs, use TS 5.5 configDir placeholder #10256

Merged
merged 6 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ jobs:
run: yarn workspace website typecheck
- name: TypeCheck website - min version - v5.1
run: |
yarn add typescript@5.1.6 --exact -D -W
yarn add typescript@5.1.6 --exact -D -W --ignore-scripts
yarn workspace website typecheck
- name: TypeCheck website - max version - Latest
run: |
yarn add typescript@latest --exact -D -W
yarn add typescript@latest --exact -D -W --ignore-scripts
yarn workspace website typecheck
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ jobs:
run: yarn workspace website typecheck
- name: TypeCheck website - min version - v5.1
run: |
yarn add typescript@5.1.6 --exact -D -W
yarn add typescript@5.1.6 --exact -D -W --ignore-scripts
yarn workspace website typecheck
- name: TypeCheck website - max version - Latest
run: |
yarn add typescript@latest --exact -D -W
yarn add typescript@latest --exact -D -W --ignore-scripts
yarn workspace website typecheck
10 changes: 0 additions & 10 deletions __tests__/validate-tsconfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ const tsconfigSchema = Joi.object({
'../../tsconfig.base.json',
'../../tsconfig.base.client.json',
),
compilerOptions: Joi.object({
rootDir: Joi.valid('src').required(),
outDir: Joi.valid('lib').required(),
tsBuildInfoFile: Joi.valid(
'lib/.tsbuildinfo',
'lib/.tsbuildinfo-client',
'lib/.tsbuildinfo-worker',
),
}).unknown(),
}).unknown();

describe('tsconfig files', () => {
Expand All @@ -52,7 +43,6 @@ describe('tsconfig files', () => {

tsconfigFiles
// Ignore noEmit configs
.filter((file) => !(file.content.compilerOptions!.noEmit === true))
.forEach((file) => {
try {
Joi.attempt(file.content, tsconfigSchema);
Expand Down
6 changes: 1 addition & 5 deletions packages/create-docusaurus/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"noEmit": false,
"composite": true,
"incremental": true,
"tsBuildInfoFile": "lib/.tsbuildinfo",
"rootDir": "src",
"outDir": "lib"
"tsBuildInfoFile": "lib/.tsbuildinfo-build"
},
"include": ["src"],
"exclude": ["templates/", "**/__tests__/**"]
Expand Down
2 changes: 1 addition & 1 deletion packages/create-docusaurus/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"noEmit": true,
"rootDir": "."
},
"include": ["bin"],
"include": ["package.json", "bin"],
"exclude": ["**/__tests__/**"]
}
6 changes: 1 addition & 5 deletions packages/docusaurus-cssnano-preset/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"noEmit": false,
"incremental": true,
"tsBuildInfoFile": "lib/.tsbuildinfo",
"rootDir": "src",
"outDir": "lib"
"noEmit": false
},
"include": ["src"],
"exclude": ["**/__tests__/**"]
Expand Down
6 changes: 1 addition & 5 deletions packages/docusaurus-logger/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"noEmit": false,
"incremental": true,
"tsBuildInfoFile": "lib/.tsbuildinfo",
"sourceMap": true,
"declarationMap": true,
"rootDir": "src",
"outDir": "lib"
"declarationMap": true
},
"include": ["src"],
"exclude": ["**/__tests__/**"]
Expand Down
9 changes: 2 additions & 7 deletions packages/docusaurus-mdx-loader/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"noEmit": false,
"incremental": true,
"tsBuildInfoFile": "lib/.tsbuildinfo",
"sourceMap": true,
"declarationMap": true,
"rootDir": "src",
"outDir": "lib",
"types": []
"declarationMap": true
},
"include": ["src"],
"include": ["package.json", "src"],
"exclude": ["**/__tests__/**"]
}
6 changes: 1 addition & 5 deletions packages/docusaurus-plugin-client-redirects/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"noEmit": false,
"incremental": true,
"tsBuildInfoFile": "lib/.tsbuildinfo",
"rootDir": "src",
"outDir": "lib"
"noEmit": false
},
"include": ["src"],
"exclude": ["**/__tests__/**"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"extends": "../../tsconfig.base.client.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"tsBuildInfoFile": "lib/.tsbuildinfo-client"
},
"include": ["src/client", "src/*.d.ts"],
"exclude": ["**/__tests__/**"]
}
6 changes: 1 addition & 5 deletions packages/docusaurus-plugin-content-blog/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
"extends": "../../tsconfig.base.json",
"references": [{"path": "./tsconfig.client.json"}],
"compilerOptions": {
"noEmit": false,
"incremental": true,
"tsBuildInfoFile": "lib/.tsbuildinfo",
"rootDir": "src",
"outDir": "lib"
"noEmit": false
},
"include": ["src"],
"exclude": ["src/client", "**/__tests__/**"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"extends": "../../tsconfig.base.client.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"tsBuildInfoFile": "lib/.tsbuildinfo-client"
},
"include": ["src/client", "src/*.d.ts"],
"exclude": ["**/__tests__/**"]
}
6 changes: 1 addition & 5 deletions packages/docusaurus-plugin-content-docs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
"extends": "../../tsconfig.base.json",
"references": [{"path": "./tsconfig.client.json"}],
"compilerOptions": {
"noEmit": false,
"incremental": true,
"tsBuildInfoFile": "lib/.tsbuildinfo",
"rootDir": "src",
"outDir": "lib"
"noEmit": false
},
"include": ["src"],
"exclude": ["src/client", "**/__tests__/**"]
Expand Down
6 changes: 1 addition & 5 deletions packages/docusaurus-plugin-content-pages/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"noEmit": false,
"incremental": true,
"tsBuildInfoFile": "lib/.tsbuildinfo",
"rootDir": "src",
"outDir": "lib"
"noEmit": false
},
"include": ["src"],
"exclude": ["**/__tests__/**"]
Expand Down
5 changes: 0 additions & 5 deletions packages/docusaurus-plugin-debug/tsconfig.client.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"extends": "../../tsconfig.base.client.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"tsBuildInfoFile": "lib/.tsbuildinfo-client"
},
"include": ["src/theme", "src/*.d.ts"],
"exclude": ["**/__tests__/**"]
}
6 changes: 1 addition & 5 deletions packages/docusaurus-plugin-debug/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
"extends": "../../tsconfig.base.json",
"references": [{"path": "./tsconfig.client.json"}],
"compilerOptions": {
"noEmit": false,
"incremental": true,
"tsBuildInfoFile": "lib/.tsbuildinfo",
"rootDir": "src",
"outDir": "lib"
"noEmit": false
},
"include": ["src"],
"exclude": ["src/theme", "**/__tests__/**"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"extends": "../../tsconfig.base.client.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"tsBuildInfoFile": "lib/.tsbuildinfo-client"
},
"include": ["src/analytics.ts", "src/*.d.ts"],
"exclude": ["**/__tests__/**"]
}
6 changes: 1 addition & 5 deletions packages/docusaurus-plugin-google-analytics/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
"extends": "../../tsconfig.base.json",
"references": [{"path": "./tsconfig.client.json"}],
"compilerOptions": {
"noEmit": false,
"incremental": true,
"tsBuildInfoFile": "lib/.tsbuildinfo",
"rootDir": "src",
"outDir": "lib"
"noEmit": false
},
"include": ["src"],
"exclude": ["src/analytics.ts", "**/__tests__/**"]
Expand Down
5 changes: 0 additions & 5 deletions packages/docusaurus-plugin-google-gtag/tsconfig.client.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"extends": "../../tsconfig.base.client.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"tsBuildInfoFile": "lib/.tsbuildinfo-client"
},
"include": ["src/gtag.ts", "src/*.d.ts"],
"exclude": ["**/__tests__/**"]
}
6 changes: 1 addition & 5 deletions packages/docusaurus-plugin-google-gtag/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
"extends": "../../tsconfig.base.json",
"references": [{"path": "./tsconfig.client.json"}],
"compilerOptions": {
"noEmit": false,
"incremental": true,
"tsBuildInfoFile": "lib/.tsbuildinfo",
"rootDir": "src",
"outDir": "lib"
"noEmit": false
},
"include": ["src"],
"exclude": ["src/gtag.ts", "**/__tests__/**"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"extends": "../../tsconfig.base.client.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"tsBuildInfoFile": "lib/.tsbuildinfo-client"
},
"include": ["src/*.d.ts"],
"exclude": ["**/__tests__/**"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
"extends": "../../tsconfig.base.json",
"references": [{"path": "./tsconfig.client.json"}],
"compilerOptions": {
"noEmit": false,
"incremental": true,
"tsBuildInfoFile": "lib/.tsbuildinfo",
"rootDir": "src",
"outDir": "lib"
"noEmit": false
},
"include": ["src"],
"exclude": ["**/__tests__/**"]
Expand Down
5 changes: 0 additions & 5 deletions packages/docusaurus-plugin-ideal-image/tsconfig.client.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"extends": "../../tsconfig.base.client.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"tsBuildInfoFile": "lib/.tsbuildinfo-client"
},
"include": ["src/theme", "src/*.d.ts"],
"exclude": ["**/__tests__/**"]
}
6 changes: 1 addition & 5 deletions packages/docusaurus-plugin-ideal-image/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
"extends": "../../tsconfig.base.json",
"references": [{"path": "./tsconfig.client.json"}],
"compilerOptions": {
"noEmit": false,
"incremental": true,
"tsBuildInfoFile": "lib/.tsbuildinfo",
"rootDir": "src",
"outDir": "lib"
"noEmit": false
},
"include": ["src"],
"exclude": ["src/theme", "**/__tests__/**"]
Expand Down
5 changes: 0 additions & 5 deletions packages/docusaurus-plugin-pwa/tsconfig.client.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"extends": "../../tsconfig.base.client.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"tsBuildInfoFile": "lib/.tsbuildinfo-client"
},
"include": [
"src/theme/",
"src/*.d.ts",
Expand Down
6 changes: 1 addition & 5 deletions packages/docusaurus-plugin-pwa/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
{"path": "./tsconfig.worker.json"}
],
"compilerOptions": {
"noEmit": false,
"incremental": true,
"tsBuildInfoFile": "lib/.tsbuildinfo",
"rootDir": "src",
"outDir": "lib"
"noEmit": false
},
"include": ["src"],
"exclude": [
Expand Down
4 changes: 0 additions & 4 deletions packages/docusaurus-plugin-pwa/tsconfig.worker.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"noEmit": false,
"composite": true,
"incremental": true,
"lib": ["webworker", "esnext"],
"tsBuildInfoFile": "lib/.tsbuildinfo-worker",
"rootDir": "src",
"outDir": "lib",
"moduleResolution": "bundler",
"module": "esnext",
"target": "esnext",
Expand Down
6 changes: 1 addition & 5 deletions packages/docusaurus-plugin-sitemap/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"noEmit": false,
"incremental": true,
"tsBuildInfoFile": "lib/.tsbuildinfo",
"rootDir": "src",
"outDir": "lib"
"noEmit": false
},
"include": ["src"],
"exclude": ["**/__tests__/**"]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"extends": "../../tsconfig.base.client.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"tsBuildInfoFile": "lib/.tsbuildinfo-client"
},
"include": ["src/analytics.ts", "src/options.ts", "src/*.d.ts"],
"exclude": ["**/__tests__/**"]
}
6 changes: 1 addition & 5 deletions packages/docusaurus-plugin-vercel-analytics/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@
"extends": "../../tsconfig.base.json",
"references": [{"path": "./tsconfig.client.json"}],
"compilerOptions": {
"noEmit": false,
"incremental": true,
"tsBuildInfoFile": "lib/.tsbuildinfo",
"rootDir": "src",
"outDir": "lib"
"noEmit": false
},
"include": ["src"],
"exclude": ["src/analytics.ts", "**/__tests__/**"]
Expand Down
6 changes: 1 addition & 5 deletions packages/docusaurus-preset-classic/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"noEmit": false,
"incremental": true,
"tsBuildInfoFile": "lib/.tsbuildinfo",
"rootDir": "src",
"outDir": "lib"
"noEmit": false
},
"include": ["src"],
"exclude": ["**/__tests__/**"]
Expand Down
Loading