[PM-35903] Update clients to node 24 (#20400)

* [PM-35903] Update clients to node 24

* Fix lockfile

* Add missing jest dep

* Fix dispose polyfill

* Revert jest-jsdom

* Bump dockerfile

* Add missing dep

* Fix node 24.16 bug

---------

Co-authored-by: kmancusi0105 <kmancusi@bitwarden.com>
This commit is contained in:
Daniel García 2026-07-08 16:32:10 +02:00 committed by GitHub
parent 9b9a360c39
commit 8eed0189bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 32 additions and 8 deletions

View File

@ -72,7 +72,6 @@ jobs:
- name: Get Node Version
id: retrieve-node-version
working-directory: ./
run: |
NODE_NVMRC=$(cat .nvmrc)
NODE_VERSION="${NODE_NVMRC/v/''}"

2
.nvmrc
View File

@ -1 +1 @@
v22
v24

1
apps/cli/.nvmrc Normal file
View File

@ -0,0 +1 @@
v22

View File

@ -90,5 +90,9 @@
"semver": "7.7.3",
"tldts": "7.4.2",
"zxcvbn": "4.4.2"
},
"engines": {
"node": "~22",
"npm": "~10"
}
}

View File

@ -19,6 +19,13 @@ import { LinuxBiometricsSystem, WindowsBiometricsSystem } from "./native-v2";
import OsBiometricsServiceMac from "./os-biometrics-mac.service";
import { OsBiometricService } from "./os-biometrics.service";
jest.mock("electron", () => ({
systemPreferences: {
canPromptTouchID: jest.fn(),
promptTouchID: jest.fn(),
},
}));
jest.mock("@bitwarden/desktop-napi", () => {
return {
passwords: jest.fn(),

View File

@ -7,6 +7,13 @@ import { passwords } from "@bitwarden/desktop-napi";
import OsBiometricsServiceMac from "./os-biometrics-mac.service";
jest.mock("electron", () => ({
systemPreferences: {
canPromptTouchID: jest.fn(),
promptTouchID: jest.fn(),
},
}));
jest.mock("@bitwarden/desktop-napi", () => ({
biometrics: {
setBiometricSecret: jest.fn(),

View File

@ -1,7 +1,7 @@
###############################################
# Node.js build stage (alpine) #
###############################################
ARG NODE_VERSION=20
ARG NODE_VERSION=24
FROM --platform=$BUILDPLATFORM node:${NODE_VERSION}-alpine AS node-build
WORKDIR /source

View File

@ -1,3 +1,6 @@
// Polyfill for Symbol.dispose required by the service's use of `using` keyword
import "core-js/proposals/explicit-resource-management";
// Mock asUuid to return the input value for test consistency
jest.mock("@bitwarden/common/platform/abstractions/sdk/sdk.service", () => ({
asUuid: (x: any) => x,
@ -163,7 +166,6 @@ describe("LoginDecryptionOptionsComponent", () => {
jest.mock("@bitwarden/common/platform/abstractions/sdk/sdk.service", () => ({
asUuid: (x: any) => x,
}));
(Symbol as any).dispose = Symbol("dispose");
mockPrivateKey = "mock-private-key";
mockSignedPublicKey = "mock-signed-public-key";

8
package-lock.json generated
View File

@ -193,8 +193,8 @@
"webpack-node-externals": "3.0.0"
},
"engines": {
"node": ">=22.12.0",
"npm": "~10"
"node": ">=24.17.0",
"npm": "~11"
}
},
"apps/browser": {
@ -236,6 +236,10 @@
},
"bin": {
"bw": "build/bw.js"
},
"engines": {
"node": "~22",
"npm": "~10"
}
},
"apps/desktop": {

View File

@ -241,7 +241,7 @@
"tmp": ">=0.2.4"
},
"engines": {
"node": ">=22.12.0",
"npm": "~10"
"node": ">=24.17.0",
"npm": "~11"
}
}