From 8726dcd3103d261623de92dbe330c7a5834a1aee Mon Sep 17 00:00:00 2001 From: rory Date: Tue, 15 Sep 2026 20:35:21 -0700 Subject: [PATCH 1/4] chore: bump Node.js types to 26 --- package-lock.json | 12 ++++++++---- package.json | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 46b750fad273..c31efd613f45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -213,7 +213,7 @@ "@types/lodash-es": "4.17.12", "@types/mapbox-gl": "^2.7.13", "@types/mime-db": "^1.43.5", - "@types/node": "^20.11.5", + "@types/node": "^26.6.1", "@types/pako": "^2.0.3", "@types/pusher-js": "^5.1.0", "@types/react": "19.2.3", @@ -19352,10 +19352,12 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.19.9", + "version": "26.6.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.1.tgz", + "integrity": "sha512-VqGJBMCtdhqkBUCcBLvywI0NJ+KLuVzgNnlBUNFOQjqVxzo2lxLUNg1DSey8+u2u6ktswSAxg+s68QLzWHNOuA==", "license": "MIT", "dependencies": { - "undici-types": "~6.21.0" + "undici-types": "~8.9.0" } }, "node_modules/@types/pako": { @@ -40657,7 +40659,9 @@ } }, "node_modules/undici-types": { - "version": "6.21.0", + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", + "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", "license": "MIT" }, "node_modules/unicode-canonical-property-names-ecmascript": { diff --git a/package.json b/package.json index a64e9dde6c0d..034fa6b65cbe 100644 --- a/package.json +++ b/package.json @@ -289,7 +289,7 @@ "@types/lodash-es": "4.17.12", "@types/mapbox-gl": "^2.7.13", "@types/mime-db": "^1.43.5", - "@types/node": "^20.11.5", + "@types/node": "^26.6.1", "@types/pako": "^2.0.3", "@types/pusher-js": "^5.1.0", "@types/react": "19.2.3", From 84313c49aabc4fd6bbca817018bf916416faa21e Mon Sep 17 00:00:00 2001 From: rory Date: Tue, 15 Sep 2026 20:54:50 -0700 Subject: [PATCH 2/4] fix: type git output with Node 26 --- scripts/utils/Git.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/utils/Git.ts b/scripts/utils/Git.ts index 48dcbb6ccebb..56eb8ce221e0 100644 --- a/scripts/utils/Git.ts +++ b/scripts/utils/Git.ts @@ -1,7 +1,7 @@ import CONST from '@github/libs/CONST'; import GitHubUtils from '@github/libs/GithubUtils'; -import type {ExecSyncOptionsWithStringEncoding, ExecOptions as ExecWithCallbackOptions} from 'child_process'; +import type {ExecOptions as ExecWithCallbackOptions, ExecSyncOptionsWithStringEncoding} from 'child_process'; import {context} from '@actions/github'; import {exec as execWithCallback, execSync as originalExecSync} from 'child_process'; @@ -19,7 +19,7 @@ function exec(command: string, options?: ExecOptions) { ...options, }; - return promisify(execWithCallback)(command, optionsWithEncoding); + return promisify(execWithCallback)(command, optionsWithEncoding) as Promise<{stdout: string; stderr: string}>; } type ExecSyncOptions = Omit & { From 2d90ef6aa17108a88633c39854d97c33b05ed750 Mon Sep 17 00:00:00 2001 From: rory Date: Tue, 15 Sep 2026 21:00:46 -0700 Subject: [PATCH 3/4] fix: narrow git command output safely --- scripts/utils/Git.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/utils/Git.ts b/scripts/utils/Git.ts index 56eb8ce221e0..af6f87e19d34 100644 --- a/scripts/utils/Git.ts +++ b/scripts/utils/Git.ts @@ -12,6 +12,11 @@ import {promisify} from 'util'; import {error as logError, warn as logWarn} from './Logger'; type ExecOptions = Omit & {cwd?: ExecWithCallbackOptions['cwd']}; + +function isStringExecResult(result: {stdout: string | Buffer; stderr: string | Buffer}): result is {stdout: string; stderr: string} { + return typeof result.stdout === 'string' && typeof result.stderr === 'string'; +} + function exec(command: string, options?: ExecOptions) { const optionsWithEncoding = { encoding: 'utf8', @@ -19,7 +24,13 @@ function exec(command: string, options?: ExecOptions) { ...options, }; - return promisify(execWithCallback)(command, optionsWithEncoding) as Promise<{stdout: string; stderr: string}>; + return promisify(execWithCallback)(command, optionsWithEncoding).then((result) => { + if (!isStringExecResult(result)) { + throw new Error('Expected git command output to be text'); + } + + return result; + }); } type ExecSyncOptions = Omit & { From dea68d8f66670d14da5f33733c0fd480a1b5fca0 Mon Sep 17 00:00:00 2001 From: rory Date: Tue, 15 Sep 2026 21:10:52 -0700 Subject: [PATCH 4/4] fix: align React Native Web types --- package-lock.json | 12 ------------ package.json | 1 - tests/unit/CloudflareAccessTest.ts | 7 +++++-- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index c31efd613f45..6d24afeded3e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -220,7 +220,6 @@ "@types/react-collapse": "^5.0.1", "@types/react-dom": "19.2.3", "@types/react-is": "^18.3.0", - "@types/react-native-web": "0.19.2", "@types/react-test-renderer": "^19.1.0", "@types/semver": "^7.5.4", "@types/setimmediate": "^1.0.2", @@ -19445,17 +19444,6 @@ "@types/react": "*" } }, - "node_modules/@types/react-native-web": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@types/react-native-web/-/react-native-web-0.19.2.tgz", - "integrity": "sha512-TAgyUi1XcYYUM5j3IwBDufPUD0NaOJiz8ftld6oJPtuIT5lc+uRZZmTcTdflpsVzCtiZ6AjSyLFZ/xD0OtCfJA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/react": "*", - "react-native": "*" - } - }, "node_modules/@types/react-native/node_modules/@react-native/virtualized-lists": { "version": "0.72.8", "resolved": "https://registry.npmjs.org/@react-native/virtualized-lists/-/virtualized-lists-0.72.8.tgz", diff --git a/package.json b/package.json index 034fa6b65cbe..0be60e10b396 100644 --- a/package.json +++ b/package.json @@ -296,7 +296,6 @@ "@types/react-collapse": "^5.0.1", "@types/react-dom": "19.2.3", "@types/react-is": "^18.3.0", - "@types/react-native-web": "0.19.2", "@types/react-test-renderer": "^19.1.0", "@types/semver": "^7.5.4", "@types/setimmediate": "^1.0.2", diff --git a/tests/unit/CloudflareAccessTest.ts b/tests/unit/CloudflareAccessTest.ts index 98d697f3cdec..4cddb4dce245 100644 --- a/tests/unit/CloudflareAccessTest.ts +++ b/tests/unit/CloudflareAccessTest.ts @@ -63,8 +63,11 @@ function resetQAAuthConfig() { beforeEach(() => { jest.clearAllMocks(); resetQAAuthConfig(); - getWebCrypto.getRandomValues.mockImplementation((array: Uint8Array) => webcrypto.getRandomValues(array)); - getWebCrypto.sha256.mockImplementation((data: BufferSource) => webcrypto.subtle.digest('SHA-256', data)); + getWebCrypto.getRandomValues.mockImplementation((array: Uint8Array) => webcrypto.getRandomValues(new Uint8Array(array))); + getWebCrypto.sha256.mockImplementation((data: BufferSource) => { + const bytes = ArrayBuffer.isView(data) ? new Uint8Array(data.buffer.slice(data.byteOffset, data.byteOffset + data.byteLength)) : new Uint8Array(data.slice(0)); + return webcrypto.subtle.digest('SHA-256', bytes); + }); jest.mocked(getAuthServerEndpoints).mockResolvedValue({ authorizationEndpoint: 'https://team.cloudflareaccess.com/cdn-cgi/access/oauth/authorization', tokenEndpoint: 'https://team.cloudflareaccess.com/cdn-cgi/access/oauth/token',