mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 14:53:33 +00:00
Update sdk-internal to 374 (fix breaking changes) (#17325)
* feat: update sdk-internal * fix: symbol.dispose breaking change * fix: TextEncoder/Decoder breaking change * fix: move polyfills to a global setup script * typo
This commit is contained in:
@@ -5,7 +5,8 @@ export interface IpcMessage {
|
|||||||
message: SerializedOutgoingMessage;
|
message: SerializedOutgoingMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SerializedOutgoingMessage extends Omit<OutgoingMessage, "free" | "payload"> {
|
export interface SerializedOutgoingMessage
|
||||||
|
extends Omit<OutgoingMessage, typeof Symbol.dispose | "free" | "payload"> {
|
||||||
payload: number[];
|
payload: number[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -249,6 +249,7 @@ function createMockClient(): MockProxy<BitwardenClient> {
|
|||||||
state: jest.fn().mockReturnValue(mock()),
|
state: jest.fn().mockReturnValue(mock()),
|
||||||
load_flags: jest.fn().mockReturnValue(mock()),
|
load_flags: jest.fn().mockReturnValue(mock()),
|
||||||
free: mock(),
|
free: mock(),
|
||||||
|
[Symbol.dispose]: jest.fn(),
|
||||||
});
|
});
|
||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ module.exports = {
|
|||||||
// Also anecdotally improves performance when run locally
|
// Also anecdotally improves performance when run locally
|
||||||
maxWorkers: 3,
|
maxWorkers: 3,
|
||||||
|
|
||||||
|
setupFiles: ["<rootDir>/../../libs/shared/polyfill-node-globals.ts"],
|
||||||
|
|
||||||
transform: {
|
transform: {
|
||||||
"^.+\\.tsx?$": [
|
"^.+\\.tsx?$": [
|
||||||
"ts-jest",
|
"ts-jest",
|
||||||
|
|||||||
11
libs/shared/polyfill-node-globals.ts
Normal file
11
libs/shared/polyfill-node-globals.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { TextEncoder, TextDecoder } from "util";
|
||||||
|
|
||||||
|
// SDK/WASM code relies on TextEncoder/TextDecoder being available globally
|
||||||
|
// We can't use `test.environment.ts` because that breaks other tests that rely on
|
||||||
|
// the default jest jsdom environment
|
||||||
|
if (!(globalThis as any).TextEncoder) {
|
||||||
|
(globalThis as any).TextEncoder = TextEncoder;
|
||||||
|
}
|
||||||
|
if (!(globalThis as any).TextDecoder) {
|
||||||
|
(globalThis as any).TextDecoder = TextDecoder as unknown as typeof globalThis.TextDecoder;
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ module.exports = {
|
|||||||
testMatch: ["**/+(*.)+(spec).+(ts)"],
|
testMatch: ["**/+(*.)+(spec).+(ts)"],
|
||||||
preset: "ts-jest",
|
preset: "ts-jest",
|
||||||
testEnvironment: "jsdom",
|
testEnvironment: "jsdom",
|
||||||
|
setupFiles: ["<rootDir>/../../../../../libs/shared/polyfill-node-globals.ts"],
|
||||||
moduleNameMapper: pathsToModuleNameMapper(
|
moduleNameMapper: pathsToModuleNameMapper(
|
||||||
{ "@bitwarden/common/spec": ["libs/common/spec"], ...(compilerOptions?.paths ?? {}) },
|
{ "@bitwarden/common/spec": ["libs/common/spec"], ...(compilerOptions?.paths ?? {}) },
|
||||||
{
|
{
|
||||||
|
|||||||
16
package-lock.json
generated
16
package-lock.json
generated
@@ -23,8 +23,8 @@
|
|||||||
"@angular/platform-browser": "19.2.14",
|
"@angular/platform-browser": "19.2.14",
|
||||||
"@angular/platform-browser-dynamic": "19.2.14",
|
"@angular/platform-browser-dynamic": "19.2.14",
|
||||||
"@angular/router": "19.2.14",
|
"@angular/router": "19.2.14",
|
||||||
"@bitwarden/commercial-sdk-internal": "0.2.0-main.369",
|
"@bitwarden/commercial-sdk-internal": "0.2.0-main.374",
|
||||||
"@bitwarden/sdk-internal": "0.2.0-main.369",
|
"@bitwarden/sdk-internal": "0.2.0-main.374",
|
||||||
"@electron/fuses": "1.8.0",
|
"@electron/fuses": "1.8.0",
|
||||||
"@emotion/css": "11.13.5",
|
"@emotion/css": "11.13.5",
|
||||||
"@koa/multer": "4.0.0",
|
"@koa/multer": "4.0.0",
|
||||||
@@ -4607,9 +4607,9 @@
|
|||||||
"link": true
|
"link": true
|
||||||
},
|
},
|
||||||
"node_modules/@bitwarden/commercial-sdk-internal": {
|
"node_modules/@bitwarden/commercial-sdk-internal": {
|
||||||
"version": "0.2.0-main.369",
|
"version": "0.2.0-main.374",
|
||||||
"resolved": "https://registry.npmjs.org/@bitwarden/commercial-sdk-internal/-/commercial-sdk-internal-0.2.0-main.369.tgz",
|
"resolved": "https://registry.npmjs.org/@bitwarden/commercial-sdk-internal/-/commercial-sdk-internal-0.2.0-main.374.tgz",
|
||||||
"integrity": "sha512-O+EaPQJQah9j3yWzgw+dwFk5iOxPXdKf1FDeykbt+cxygSYbWTR60RXenG1LysknOdy8fiTfHEaPD+LP1LxrdA==",
|
"integrity": "sha512-OYNjEv9Z9Y1vCDWtlp7m49+Fu0WxCyJt+DDupF8T73JqWIl2SdY3ugLtLnCUnqause5VY7OAfa4eOxwn2ONKZg==",
|
||||||
"license": "BITWARDEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT",
|
"license": "BITWARDEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"type-fest": "^4.41.0"
|
"type-fest": "^4.41.0"
|
||||||
@@ -4712,9 +4712,9 @@
|
|||||||
"link": true
|
"link": true
|
||||||
},
|
},
|
||||||
"node_modules/@bitwarden/sdk-internal": {
|
"node_modules/@bitwarden/sdk-internal": {
|
||||||
"version": "0.2.0-main.369",
|
"version": "0.2.0-main.374",
|
||||||
"resolved": "https://registry.npmjs.org/@bitwarden/sdk-internal/-/sdk-internal-0.2.0-main.369.tgz",
|
"resolved": "https://registry.npmjs.org/@bitwarden/sdk-internal/-/sdk-internal-0.2.0-main.374.tgz",
|
||||||
"integrity": "sha512-gyp4Wd1YbkANA0/RNxHfVk+DuiJqxItzk/YUyQ2HsLeP07xOljftmA0XspLQz59ovs7e1jHMCpH1r/XcyKiQSw==",
|
"integrity": "sha512-P9td//6M22Eg8YcVOVtcvkD9wfdbnwNe7lZ1HGn74o3CTgDtNq0mE5x00rDeNZq0ctBaUDaqw6XS0jC/tehcag==",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"type-fest": "^4.41.0"
|
"type-fest": "^4.41.0"
|
||||||
|
|||||||
@@ -160,8 +160,8 @@
|
|||||||
"@angular/platform-browser": "19.2.14",
|
"@angular/platform-browser": "19.2.14",
|
||||||
"@angular/platform-browser-dynamic": "19.2.14",
|
"@angular/platform-browser-dynamic": "19.2.14",
|
||||||
"@angular/router": "19.2.14",
|
"@angular/router": "19.2.14",
|
||||||
"@bitwarden/sdk-internal": "0.2.0-main.369",
|
"@bitwarden/sdk-internal": "0.2.0-main.374",
|
||||||
"@bitwarden/commercial-sdk-internal": "0.2.0-main.369",
|
"@bitwarden/commercial-sdk-internal": "0.2.0-main.374",
|
||||||
"@electron/fuses": "1.8.0",
|
"@electron/fuses": "1.8.0",
|
||||||
"@emotion/css": "11.13.5",
|
"@emotion/css": "11.13.5",
|
||||||
"@koa/multer": "4.0.0",
|
"@koa/multer": "4.0.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user