From be41b2919921bb9baf833b51b39baa80418aa0d7 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Mon, 3 Apr 2023 15:58:56 -0230 Subject: [PATCH] Update `@metamask/obs-store` (#18421) `@metamask/obs-store` has been updated from v5 to v8. The breaking changes include updating the minimum supported Node.js version to v12, and removing an unused class `LocalStorageStore`. v8 includes a bugfix that resolves an accidental breaking change in v6.0.2; it's non- breaking when updating from older versions. This update includes type improvements. The main improvement is that now we can type the observational store using generic parameters. The previous version used `unknown` for the store contents. --- lavamoat/browserify/beta/policy.json | 3 --- lavamoat/browserify/desktop/policy.json | 23 +++++++++++++++++++---- lavamoat/browserify/flask/policy.json | 23 +++++++++++++++++++---- lavamoat/browserify/main/policy.json | 3 --- package.json | 2 +- yarn.lock | 12 +++++++++++- 6 files changed, 50 insertions(+), 16 deletions(-) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 08574f4a4..98b889720 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -1336,9 +1336,6 @@ } }, "@metamask/obs-store": { - "globals": { - "localStorage": true - }, "packages": { "@metamask/obs-store>through2": true, "@metamask/safe-event-emitter": true, diff --git a/lavamoat/browserify/desktop/policy.json b/lavamoat/browserify/desktop/policy.json index f1b1e3a49..167424fd4 100644 --- a/lavamoat/browserify/desktop/policy.json +++ b/lavamoat/browserify/desktop/policy.json @@ -857,9 +857,9 @@ "setTimeout": true }, "packages": { + "@metamask/desktop>@metamask/obs-store": true, "@metamask/desktop>eciesjs": true, "@metamask/desktop>otpauth": true, - "@metamask/obs-store": true, "browserify>buffer": true, "browserify>events": true, "browserify>process": true, @@ -872,6 +872,24 @@ "webextension-polyfill": true } }, + "@metamask/desktop>@metamask/obs-store": { + "globals": { + "localStorage": true + }, + "packages": { + "@metamask/desktop>@metamask/obs-store>through2": true, + "browserify>stream-browserify": true, + "json-rpc-engine>@metamask/safe-event-emitter": true + } + }, + "@metamask/desktop>@metamask/obs-store>through2": { + "packages": { + "browserify>process": true, + "browserify>util": true, + "readable-stream": true, + "watchify>xtend": true + } + }, "@metamask/desktop>eciesjs": { "packages": { "@metamask/desktop>eciesjs>futoin-hkdf": true, @@ -1402,9 +1420,6 @@ } }, "@metamask/obs-store": { - "globals": { - "localStorage": true - }, "packages": { "@metamask/obs-store>through2": true, "@metamask/safe-event-emitter": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index f1b1e3a49..167424fd4 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -857,9 +857,9 @@ "setTimeout": true }, "packages": { + "@metamask/desktop>@metamask/obs-store": true, "@metamask/desktop>eciesjs": true, "@metamask/desktop>otpauth": true, - "@metamask/obs-store": true, "browserify>buffer": true, "browserify>events": true, "browserify>process": true, @@ -872,6 +872,24 @@ "webextension-polyfill": true } }, + "@metamask/desktop>@metamask/obs-store": { + "globals": { + "localStorage": true + }, + "packages": { + "@metamask/desktop>@metamask/obs-store>through2": true, + "browserify>stream-browserify": true, + "json-rpc-engine>@metamask/safe-event-emitter": true + } + }, + "@metamask/desktop>@metamask/obs-store>through2": { + "packages": { + "browserify>process": true, + "browserify>util": true, + "readable-stream": true, + "watchify>xtend": true + } + }, "@metamask/desktop>eciesjs": { "packages": { "@metamask/desktop>eciesjs>futoin-hkdf": true, @@ -1402,9 +1420,6 @@ } }, "@metamask/obs-store": { - "globals": { - "localStorage": true - }, "packages": { "@metamask/obs-store>through2": true, "@metamask/safe-event-emitter": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 08574f4a4..98b889720 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -1336,9 +1336,6 @@ } }, "@metamask/obs-store": { - "globals": { - "localStorage": true - }, "packages": { "@metamask/obs-store>through2": true, "@metamask/safe-event-emitter": true, diff --git a/package.json b/package.json index 4116e0895..d53e20a06 100644 --- a/package.json +++ b/package.json @@ -248,7 +248,7 @@ "@metamask/message-manager": "^2.0.0", "@metamask/metamask-eth-abis": "^3.0.0", "@metamask/notification-controller": "^1.0.0", - "@metamask/obs-store": "^5.0.0", + "@metamask/obs-store": "^8.0.0", "@metamask/permission-controller": "^3.1.0", "@metamask/phishing-controller": "^2.0.0", "@metamask/post-message-stream": "^6.0.0", diff --git a/yarn.lock b/yarn.lock index d3962c019..832517322 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4150,6 +4150,16 @@ __metadata: languageName: node linkType: hard +"@metamask/obs-store@npm:^8.0.0": + version: 8.0.0 + resolution: "@metamask/obs-store@npm:8.0.0" + dependencies: + "@metamask/safe-event-emitter": ^2.0.0 + through2: ^2.0.3 + checksum: 232362e65a3563f0bd3299cec48f5adb37e68d4f066b7de90f2b044480d3b16c2d918c12d672c825e1d9b55344ae818fb8494d91129e4613555097653b9bb887 + languageName: node + linkType: hard + "@metamask/permission-controller@npm:^1.0.1": version: 1.0.2 resolution: "@metamask/permission-controller@npm:1.0.2" @@ -24289,7 +24299,7 @@ __metadata: "@metamask/message-manager": ^2.0.0 "@metamask/metamask-eth-abis": ^3.0.0 "@metamask/notification-controller": ^1.0.0 - "@metamask/obs-store": ^5.0.0 + "@metamask/obs-store": ^8.0.0 "@metamask/permission-controller": ^3.1.0 "@metamask/phishing-controller": ^2.0.0 "@metamask/phishing-warning": ^2.1.0