From 4da7a9aa29be6d3d6488fdfac6e390455ee10c39 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sun, 10 May 2026 18:34:23 +0200 Subject: [PATCH] Upgrade `typescript` to version 6.0.3 This is a major version bump containing two breaking changes for us: - the `baseUrl` option is removed; - the `moduleResolution` option doesn't support `node10` (or the `node` alias) anymore. The migration guide at https://github.com/microsoft/TypeScript/issues/62508 indicates that we can remove `baseUrl` and change `moduleResolution` to `bundler` (the latter is consistent with what other projects do that are linked to the issue, and more details on that configuration option can be found at https://www.typescriptlang.org/tsconfig/#moduleResolution). Note that this is enough to get `npx gulp typestest` green and that is all validation we can do on our side, so as usual if any follow-up fixes for types are necessary we rely on the community to provide patches and extend the types test where possible to improve validation. --- package-lock.json | 8 ++++---- package.json | 2 +- test/types/tsconfig.json | 3 +-- tsconfig.json | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index bb89d2297..e407bbf56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,7 +62,7 @@ "terser-webpack-plugin": "^5.6.0", "tsc-alias": "^1.8.17", "ttest": "^4.0.0", - "typescript": "^5.9.3", + "typescript": "^6.0.3", "vinyl": "^3.0.1", "webpack": "^5.106.2", "webpack-stream": "^7.0.0" @@ -11849,9 +11849,9 @@ "license": "MIT" }, "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index e78b5d10d..0424149a4 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "terser-webpack-plugin": "^5.6.0", "tsc-alias": "^1.8.17", "ttest": "^4.0.0", - "typescript": "^5.9.3", + "typescript": "^6.0.3", "vinyl": "^3.0.1", "webpack": "^5.106.2", "webpack-stream": "^7.0.0" diff --git a/test/types/tsconfig.json b/test/types/tsconfig.json index 5cd8ef450..5a8cef756 100644 --- a/test/types/tsconfig.json +++ b/test/types/tsconfig.json @@ -3,12 +3,11 @@ "outDir": "../../build/tmp", "sourceMap": true, "declaration": false, - "moduleResolution": "node10", + "moduleResolution": "bundler", "emitDecoratorMetadata": true, "experimentalDecorators": true, "target": "ESNext", "module": "ESNext", - "baseUrl": "./", "strict": true, "types": [], "lib": ["ESNext", "DOM"], diff --git a/tsconfig.json b/tsconfig.json index 0e31e918c..ad957e5a2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,7 @@ "emitDeclarationOnly": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, - "moduleResolution": "node", + "moduleResolution": "bundler", "paths": { "pdfjs-lib": ["./src/pdf"], "display-binary_data_factory": ["./src/display/binary_data_factory"],