Skip to content
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
12 changes: 2 additions & 10 deletions .github/workflows/tests-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,21 +165,13 @@ jobs:
working-directory: ../test-website
run: yarn typecheck

- name: TypeCheck website - min version - v5.1
- name: TypeCheck website - min version - v6.0
# TODO: there're some lingering issues with PnP + tsc. Enable tsc in PnP later.
if: matrix.variant == '-st' && matrix.nodeLinker != 'pnp'
working-directory: ../test-website
run: |
yarn add typescript@5.1.6 --exact

# Downgrade TS ignoreDeprecations option
node -e "const fs = require('fs'); const f = 'tsconfig.json'; fs.writeFileSync(f, fs.readFileSync(f,'utf8').replace('\"ignoreDeprecations\": \"6.0\"', '\"ignoreDeprecations\": \"5.0\"'))"

yarn add typescript@6.0 --exact
yarn typecheck

# Restore TS ignoreDeprecations option
node -e "const fs = require('fs'); const f = 'tsconfig.json'; fs.writeFileSync(f, fs.readFileSync(f,'utf8').replace('\"ignoreDeprecations\": \"5.0\"', '\"ignoreDeprecations\": \"6.0\"'))"

- name: TypeCheck website - max version - Latest
# TODO: there're some lingering issues with PnP + tsc. Enable tsc in PnP later.
if: matrix.variant == '-st' && matrix.nodeLinker != 'pnp'
Expand Down
18 changes: 5 additions & 13 deletions .github/workflows/tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,14 @@ jobs:
# see https://github.com/facebook/docusaurus/pull/10486
run: yarn workspace website typecheck

- name: TypeCheck website - min version - v6.0
run: |
yarn add typescript@6.0 --exact -D -W --ignore-scripts
yarn workspace website typecheck

- name: TypeCheck website - max version - Latest
# For latest TS there are often lib check errors, so we disable it
# Details: https://github.com/facebook/docusaurus/pull/10486
run: |
yarn add typescript@latest --exact -D -W --ignore-scripts
yarn workspace website typecheck --project tsconfig.skipLibCheck.json

- name: TypeCheck website - min version - v5.1
run: |
yarn add typescript@5.1.6 --exact -D -W --ignore-scripts

# Downgrade TS ignoreDeprecations option
node -e 'const fs = require("fs"); const f = "website/tsconfig.json"; fs.writeFileSync(f, fs.readFileSync(f, "utf8").replace(/"ignoreDeprecations"\s*:\s*"6\.0"/, "\"ignoreDeprecations\": \"5.0\""));'

# DocSearch@4/ai@5 doesn't support TS 5.1 (with skipLibCheck=false)
jq '.resolutions."@docsearch/react" = "^3.9.0"' package.json > package.json.tmp && mv -Force package.json.tmp package.json
yarn add @docsearch/react@^3.9.0 --exact -D -W --ignore-scripts

yarn workspace website typecheck
15 changes: 2 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,11 @@ jobs:
# see https://github.com/facebook/docusaurus/pull/10486
run: yarn workspace website typecheck

- name: TypeCheck website - min version - v5.1
- name: TypeCheck website - min version - v6.0
run: |
yarn add typescript@5.1.6 --exact -D -W --ignore-scripts

# Downgrade TS ignoreDeprecations option
node -e "const fs = require('fs'); const f = 'website/tsconfig.json'; fs.writeFileSync(f, fs.readFileSync(f,'utf8').replace('\"ignoreDeprecations\": \"6.0\"', '\"ignoreDeprecations\": \"5.0\"'))"

# DocSearch@4/ai@5 doesn't support TS 5.1 (with skipLibCheck=false)
jq '.resolutions."@docsearch/react" = "^3.9.0"' package.json > package.json.tmp && mv -f package.json.tmp package.json
yarn add @docsearch/react@^3.9.0 --exact -D -W --ignore-scripts

yarn add typescript@6.0 --exact -D -W --ignore-scripts
yarn workspace website typecheck

# Restore TS ignoreDeprecations option
node -e "const fs = require('fs'); const f = 'website/tsconfig.json'; fs.writeFileSync(f, fs.readFileSync(f,'utf8').replace('\"ignoreDeprecations\": \"5.0\"', '\"ignoreDeprecations\": \"6.0\"'))"

- name: TypeCheck website - max version - Latest
# For latest TS there are often lib check errors, so we disable it
# Details: https://github.com/facebook/docusaurus/pull/10486
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
// This file is not used by "docusaurus start/build" commands.
// It is here to improve your IDE experience (type-checking, autocompletion...),
// and can also run the package.json "typecheck" script manually.
// It helps improve your IDE experience (type-checking, autocompletion...),
// You can also run the package.json "typecheck" script manually.
// Our base config is often good enough, but feel free to customize it!
{
"extends": "@docusaurus/tsconfig",
"compilerOptions": {
"baseUrl": ".",
"ignoreDeprecations": "6.0",
"strict": true
},
"exclude": [".docusaurus", "build"]
"extends": "@docusaurus/tsconfig"
}
5 changes: 4 additions & 1 deletion packages/docusaurus-tsconfig/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-tsconfig"
},
"license": "MIT"
"license": "MIT",
"peerDependencies": {
"typescript": ">=6.0"
}
}
6 changes: 3 additions & 3 deletions packages/docusaurus-tsconfig/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"moduleResolution": "bundler",
"module": "esnext",
"noEmit": true,
"baseUrl": ".",
"paths": {
"@site/*": ["./*"]
"@site/*": ["${configDir}/*"]
},
"skipLibCheck": true
}
},
"exclude": ["${configDir}/.docusaurus", "${configDir}/build"]
}
Loading