From 93821d8202e31b8bc5d0ca80ba44afb502fe59bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 11:34:36 +0000 Subject: [PATCH 1/4] web: bump typescript from 5.8.3 to 5.9.3 in /web Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.8.3 to 5.9.3. - [Release notes](https://github.com/microsoft/TypeScript/releases) - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml) - [Commits](https://github.com/microsoft/TypeScript/compare/v5.8.3...v5.9.3) --- updated-dependencies: - dependency-name: typescript dependency-version: 5.9.3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- web/package-lock.json | 11 +++++------ web/package.json | 2 +- web/packages/core/package.json | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/web/package-lock.json b/web/package-lock.json index cb72e5acf7f7..66d9670e8e30 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -64,7 +64,6 @@ "change-case": "^5.4.4", "chart.js": "^4.5.1", "chartjs-adapter-date-fns": "^3.0.0", - "chromedriver": "^141.0.3", "codemirror": "^6.0.2", "core-js": "^3.46.0", "country-flag-icons": "^1.5.21", @@ -108,7 +107,7 @@ "ts-pattern": "^5.8.0", "turnstile-types": "^1.2.3", "type-fest": "^5.1.0", - "typescript": "^5.8.3", + "typescript": "^5.9.3", "typescript-eslint": "^8.46.1", "unist-util-visit": "^5.0.0", "vite": "^7.1.10", @@ -17974,9 +17973,9 @@ } }, "node_modules/typescript": { - "version": "5.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", - "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -19201,7 +19200,7 @@ "@types/semver": "^7.7.1", "prettier": "^3.6.2", "semver": "^7.7.3", - "typescript": "^5.8.3" + "typescript": "^5.9.3" }, "engines": { "node": ">=24" diff --git a/web/package.json b/web/package.json index 00fafd2a7d22..520058d17646 100644 --- a/web/package.json +++ b/web/package.json @@ -179,7 +179,7 @@ "ts-pattern": "^5.8.0", "turnstile-types": "^1.2.3", "type-fest": "^5.1.0", - "typescript": "^5.8.3", + "typescript": "^5.9.3", "typescript-eslint": "^8.46.1", "unist-util-visit": "^5.0.0", "vite": "^7.1.10", diff --git a/web/packages/core/package.json b/web/packages/core/package.json index 91838a4a18de..0f41cdf523ef 100644 --- a/web/packages/core/package.json +++ b/web/packages/core/package.json @@ -51,7 +51,7 @@ "@types/semver": "^7.7.1", "prettier": "^3.6.2", "semver": "^7.7.3", - "typescript": "^5.8.3" + "typescript": "^5.9.3" }, "engines": { "node": ">=24" From 07ffc3b838373147422bf06b06b3131b36e0721d Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 10 Oct 2025 14:07:20 +0200 Subject: [PATCH 2/4] fix up ish Signed-off-by: Jens Langhammer --- web/packages/sfe/src/index.ts | 47 ------------------------------ web/src/common/helpers/webauthn.ts | 6 ++-- 2 files changed, 3 insertions(+), 50 deletions(-) diff --git a/web/packages/sfe/src/index.ts b/web/packages/sfe/src/index.ts index 81978c2639a4..40cfcfd80e5c 100644 --- a/web/packages/sfe/src/index.ts +++ b/web/packages/sfe/src/index.ts @@ -311,53 +311,6 @@ class AuthenticatorValidateStage extends Stage return false; } - /** - * Transforms items in the credentialCreateOptions generated on the server - * into byte arrays expected by the navigator.credentials.create() call - */ - transformCredentialCreateOptions( - credentialCreateOptions: PublicKeyCredentialCreationOptions, - userId: string, - ): PublicKeyCredentialCreationOptions { - const user = credentialCreateOptions.user; - // Because json can't contain raw bytes, the server base64-encodes the User ID - // So to get the base64 encoded byte array, we first need to convert it to a regular - // string, then a byte array, re-encode it and wrap that in an array. - const stringId = decodeURIComponent(window.atob(userId)); - user.id = this.u8arr(this.b64enc(this.u8arr(stringId))); - const challenge = this.u8arr(credentialCreateOptions.challenge.toString()); - - return Object.assign({}, credentialCreateOptions, { - challenge, - user, - }); - } - - /** - * Transforms the binary data in the credential into base64 strings - * for posting to the server. - * @param {PublicKeyCredential} newAssertion - */ - transformNewAssertionForServer(newAssertion: PublicKeyCredential): Assertion { - const attObj = new Uint8Array( - (newAssertion.response as AuthenticatorAttestationResponse).attestationObject, - ); - const clientDataJSON = new Uint8Array(newAssertion.response.clientDataJSON); - const rawId = new Uint8Array(newAssertion.rawId); - - const registrationClientExtensions = newAssertion.getClientExtensionResults(); - return { - id: newAssertion.id, - rawId: this.b64enc(rawId), - type: newAssertion.type, - registrationClientExtensions: JSON.stringify(registrationClientExtensions), - response: { - clientDataJSON: this.b64enc(clientDataJSON), - attestationObject: this.b64enc(attObj), - }, - }; - } - transformCredentialRequestOptions( credentialRequestOptions: PublicKeyCredentialRequestOptions, ): PublicKeyCredentialRequestOptions { diff --git a/web/src/common/helpers/webauthn.ts b/web/src/common/helpers/webauthn.ts index 68b29ce76064..8bed59e545b8 100644 --- a/web/src/common/helpers/webauthn.ts +++ b/web/src/common/helpers/webauthn.ts @@ -39,12 +39,12 @@ export function transformCredentialCreateOptions( // So to get the base64 encoded byte array, we first need to convert it to a regular // string, then a byte array, re-encode it and wrap that in an array. const stringId = decodeURIComponent(window.atob(userId)); - user.id = u8arr(b64enc(u8arr(stringId))); + user.id = u8arr(b64enc(u8arr(stringId))) as BufferSource; const challenge = u8arr(credentialCreateOptions.challenge.toString()); return { ...credentialCreateOptions, - challenge, + challenge: challenge as BufferSource, user, }; } @@ -99,7 +99,7 @@ export function transformCredentialRequestOptions( return { ...credentialRequestOptions, - challenge, + challenge: challenge as BufferSource, allowCredentials, }; } From 7929f32a980407f88d066e37b7d9ac5bb4f3d03b Mon Sep 17 00:00:00 2001 From: Teffen Ellis Date: Thu, 16 Oct 2025 23:11:46 +0200 Subject: [PATCH 3/4] web: Fix typing. --- web/scripts/build-locales.mjs | 9 ++++++--- web/scripts/pseudolocalize.mjs | 2 ++ web/tsconfig.json | 4 ++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/web/scripts/build-locales.mjs b/web/scripts/build-locales.mjs index dde6e901994c..4ed931af1a08 100644 --- a/web/scripts/build-locales.mjs +++ b/web/scripts/build-locales.mjs @@ -1,6 +1,4 @@ -import { spawnSync } from "node:child_process"; -import { readFileSync, statSync } from "node:fs"; -import path from "node:path"; +/// /** * @file Lit Localize build script. @@ -16,6 +14,11 @@ import path from "node:path"; * @import { ConfigFile } from "@lit/localize-tools/lib/types/config.js" * @import { Stats } from "node:fs"; */ + +import { spawnSync } from "node:child_process"; +import { readFileSync, statSync } from "node:fs"; +import path from "node:path"; + import { PackageRoot } from "#paths/node"; /** diff --git a/web/scripts/pseudolocalize.mjs b/web/scripts/pseudolocalize.mjs index 421b28c4403b..2e3cb1f10e09 100644 --- a/web/scripts/pseudolocalize.mjs +++ b/web/scripts/pseudolocalize.mjs @@ -1,3 +1,5 @@ +/// + /** * @file Pseudo-localization script. * diff --git a/web/tsconfig.json b/web/tsconfig.json index 1893378ad1a1..bb6cb7b63b16 100644 --- a/web/tsconfig.json +++ b/web/tsconfig.json @@ -45,6 +45,10 @@ "storybook-static", "src/**/*.test.ts", "./tests", + // TODO: @lit/localize-tools v0.8.0 has a nullish coalescing typing error. + // Remove when we upgrade past that. + "scripts/pseudolocalize.mjs", + "scripts/build-locales.mjs", // TODO: Remove after monorepo cleanup. "src/**/*.comp.ts" From e4db8996748aee444265756f378cfdef30263463 Mon Sep 17 00:00:00 2001 From: Teffen Ellis Date: Thu, 16 Oct 2025 23:12:04 +0200 Subject: [PATCH 4/4] web: assign array type. --- web/src/common/helpers/webauthn.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/common/helpers/webauthn.ts b/web/src/common/helpers/webauthn.ts index 8bed59e545b8..d3985440d0d2 100644 --- a/web/src/common/helpers/webauthn.ts +++ b/web/src/common/helpers/webauthn.ts @@ -10,7 +10,7 @@ export function b64RawEnc(buf: Uint8Array): string { return base64js.fromByteArray(buf).replace(/\+/g, "-").replace(/\//g, "_"); } -export function u8arr(input: string): Uint8Array { +export function u8arr(input: string): Uint8Array { return Uint8Array.from(atob(input.replace(/_/g, "/").replace(/-/g, "+")), (c) => c.charCodeAt(0), ); @@ -39,12 +39,12 @@ export function transformCredentialCreateOptions( // So to get the base64 encoded byte array, we first need to convert it to a regular // string, then a byte array, re-encode it and wrap that in an array. const stringId = decodeURIComponent(window.atob(userId)); - user.id = u8arr(b64enc(u8arr(stringId))) as BufferSource; + user.id = u8arr(b64enc(u8arr(stringId))); const challenge = u8arr(credentialCreateOptions.challenge.toString()); return { ...credentialCreateOptions, - challenge: challenge as BufferSource, + challenge, user, }; } @@ -99,7 +99,7 @@ export function transformCredentialRequestOptions( return { ...credentialRequestOptions, - challenge: challenge as BufferSource, + challenge, allowCredentials, }; }