From 1a70734c11390abfad1bf6ea92ec8b9129925ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lorber?= Date: Tue, 10 Sep 2024 13:52:31 +0200 Subject: [PATCH] chore: upgrade to TS 5.6 + temporarily use skipLibCheck for TS 5.6 (#10486) --- .github/workflows/tests-swizzle.yml | 2 +- .github/workflows/tests-windows.yml | 8 ++++-- .github/workflows/tests.yml | 8 ++++-- package.json | 2 +- .../templates/classic-typescript/package.json | 2 +- packages/docusaurus-utils/src/webpackUtils.ts | 1 - website/tsconfig.skipLibCheck.json | 10 +++++++ yarn.lock | 27 ++++++++++++------- 8 files changed, 42 insertions(+), 18 deletions(-) create mode 100644 website/tsconfig.skipLibCheck.json diff --git a/.github/workflows/tests-swizzle.yml b/.github/workflows/tests-swizzle.yml index 493c970228e3..2bd296a1ecee 100644 --- a/.github/workflows/tests-swizzle.yml +++ b/.github/workflows/tests-swizzle.yml @@ -43,4 +43,4 @@ jobs: run: yarn build:website:fast # Ensure swizzled site still typechecks - name: TypeCheck website - run: yarn workspace website typecheck + run: yarn workspace website typecheck --project tsconfig.skipLibCheck.json diff --git a/.github/workflows/tests-windows.yml b/.github/workflows/tests-windows.yml index 9206a597296a..af9df936e02a 100644 --- a/.github/workflows/tests-windows.yml +++ b/.github/workflows/tests-windows.yml @@ -55,12 +55,16 @@ jobs: run: yarn build:website:fast - name: TypeCheck website - run: yarn workspace website typecheck + # TODO temporary, remove TS skipLibCheck + # see https://github.com/facebook/docusaurus/pull/10486 + run: 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 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 + yarn workspace website typecheck --project tsconfig.skipLibCheck.json diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f25550544199..3aa991be48cf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,12 +48,16 @@ jobs: run: yarn workspace website test:css-order - name: TypeCheck website - run: yarn workspace website typecheck + # TODO temporary, remove TS skipLibCheck + # see https://github.com/facebook/docusaurus/pull/10486 + run: 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 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 + yarn workspace website typecheck --project tsconfig.skipLibCheck.json diff --git a/package.json b/package.json index f7b21a6f5385..619bbc038954 100644 --- a/package.json +++ b/package.json @@ -120,6 +120,6 @@ "stylelint": "^14.16.1", "stylelint-config-prettier": "^9.0.5", "stylelint-config-standard": "^29.0.0", - "typescript": "~5.5.2" + "typescript": "~5.6.2" } } diff --git a/packages/create-docusaurus/templates/classic-typescript/package.json b/packages/create-docusaurus/templates/classic-typescript/package.json index b55012be9c6e..56bba3947c42 100644 --- a/packages/create-docusaurus/templates/classic-typescript/package.json +++ b/packages/create-docusaurus/templates/classic-typescript/package.json @@ -27,7 +27,7 @@ "@docusaurus/module-type-aliases": "3.5.2", "@docusaurus/tsconfig": "3.5.2", "@docusaurus/types": "3.5.2", - "typescript": "~5.5.2" + "typescript": "~5.6.2" }, "browserslist": { "production": [ diff --git a/packages/docusaurus-utils/src/webpackUtils.ts b/packages/docusaurus-utils/src/webpackUtils.ts index 208c48728f01..8c005a8a5c4b 100644 --- a/packages/docusaurus-utils/src/webpackUtils.ts +++ b/packages/docusaurus-utils/src/webpackUtils.ts @@ -158,7 +158,6 @@ function createFileLoaderUtils({ ], }, titleProp: true, - ref: ![path], }, }, ], diff --git a/website/tsconfig.skipLibCheck.json b/website/tsconfig.skipLibCheck.json new file mode 100644 index 000000000000..4aed0d4f924b --- /dev/null +++ b/website/tsconfig.skipLibCheck.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + // There is no --skipLibCheck CLI option, so we have to create a config file + // Some CI workflows will run the following command: + // yarn workspace website typecheck --project tsconfig.skipLibCheck.json + // See https://github.com/facebook/docusaurus/pull/10486 + "skipLibCheck": true + } +} diff --git a/yarn.lock b/yarn.lock index 537910351a67..c178ae79faaa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3529,9 +3529,9 @@ integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== "@types/node@*", "@types/node@>=10.0.0": - version "22.4.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.4.1.tgz#9b595d292c65b94c20923159e2ce947731b6fdce" - integrity sha512-1tbpb9325+gPnKK0dMm+/LMriX0vKxf6RnB0SZUqfyVkQ4fMgUSySqhxE/y8Jvs4NyF1yHzTfG9KlnkIODxPKg== + version "22.5.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.5.4.tgz#83f7d1f65bc2ed223bdbf57c7884f1d5a4fa84e8" + integrity sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg== dependencies: undici-types "~6.19.2" @@ -3541,9 +3541,11 @@ integrity sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw== "@types/node@^18.16.19": - version "18.16.19" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.19.tgz#cb03fca8910fdeb7595b755126a8a78144714eea" - integrity sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA== + version "18.19.50" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.50.tgz#8652b34ee7c0e7e2004b3f08192281808d41bf5a" + integrity sha512-xonK+NRrMBRtkL1hVCc3G+uXtjh1Al4opBLjqVmipe5ZAaBYWW6cNAiBVZ1BvmkBhep698rP3UM3aRAdSALuhg== + dependencies: + undici-types "~5.26.4" "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -16468,10 +16470,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== -typescript@~5.5.2: - version "5.5.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.2.tgz#c26f023cb0054e657ce04f72583ea2d85f8d0507" - integrity sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew== +typescript@~5.6.2: + version "5.6.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.2.tgz#d1de67b6bef77c41823f822df8f0b3bcff60a5a0" + integrity sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw== uglify-js@^3.1.4: version "3.17.4" @@ -16488,6 +16490,11 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + undici-types@~6.19.2: version "6.19.6" resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.6.tgz#e218c3df0987f4c0e0008ca00d6b6472d9b89b36"