From 830592b379926170a653459aa4d8938e67b74291 Mon Sep 17 00:00:00 2001 From: zouhang Date: Thu, 30 Mar 2023 11:58:05 +0800 Subject: [PATCH] chore: fix deprecated webextension-polyfill-ts --- package.json | 4 ++-- .../createExternalExtensionProvider.ts | 2 +- yarn.lock | 12 +++++------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 4ec1876b..0cab9cd2 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "@metamask/object-multiplex": "^1.1.0", "@metamask/safe-event-emitter": "^2.0.0", "@types/chrome": "^0.0.136", + "@types/webextension-polyfill": "^0.10.0", "detect-browser": "^5.2.0", "eth-rpc-errors": "^4.0.2", "extension-port-stream": "^2.0.1", @@ -51,8 +52,7 @@ "is-stream": "^2.0.0", "json-rpc-engine": "^6.1.0", "json-rpc-middleware-stream": "^4.2.1", - "pump": "^3.0.0", - "webextension-polyfill-ts": "^0.25.0" + "pump": "^3.0.0" }, "devDependencies": { "@lavamoat/allow-scripts": "^2.0.3", diff --git a/src/extension-provider/createExternalExtensionProvider.ts b/src/extension-provider/createExternalExtensionProvider.ts index 29f84a04..dce82ce6 100644 --- a/src/extension-provider/createExternalExtensionProvider.ts +++ b/src/extension-provider/createExternalExtensionProvider.ts @@ -1,6 +1,6 @@ import PortStream from 'extension-port-stream'; import { detect } from 'detect-browser'; -import { Runtime } from 'webextension-polyfill-ts'; +import type { Runtime } from 'webextension-polyfill'; import { MetaMaskInpageProviderStreamName } from '../MetaMaskInpageProvider'; import { StreamProvider } from '../StreamProvider'; import { getDefaultExternalMiddleware } from '../utils'; diff --git a/yarn.lock b/yarn.lock index d6e9f952..5777c693 100644 --- a/yarn.lock +++ b/yarn.lock @@ -830,6 +830,11 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.0.tgz#7036640b4e21cc2f259ae826ce843d277dad8cff" integrity sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw== +"@types/webextension-polyfill@^0.10.0": + version "0.10.0" + resolved "https://registry.yarnpkg.com/@types/webextension-polyfill/-/webextension-polyfill-0.10.0.tgz#e87b5e2c101599779a584cdb043887ad73b37b0e" + integrity sha512-If4EcaHzYTqcbNMp/FdReVdRmLL/Te42ivnJII551bYjhX19bWem5m14FERCqdJA732OloGuxCRvLBvcMGsn4A== + "@types/yargs-parser@*": version "15.0.0" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-15.0.0.tgz#cb3f9f741869e20cce330ffbeb9271590483882d" @@ -5301,13 +5306,6 @@ webextension-polyfill-ts@^0.22.0: dependencies: webextension-polyfill "^0.7.0" -webextension-polyfill-ts@^0.25.0: - version "0.25.0" - resolved "https://registry.yarnpkg.com/webextension-polyfill-ts/-/webextension-polyfill-ts-0.25.0.tgz#fff041626365dbd0e29c40b197e989a55ec221ca" - integrity sha512-ikQhwwHYkpBu00pFaUzIKY26I6L87DeRI+Q6jBT1daZUNuu8dSrg5U9l/ZbqdaQ1M/TTSPKeAa3kolP5liuedw== - dependencies: - webextension-polyfill "^0.7.0" - webextension-polyfill@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/webextension-polyfill/-/webextension-polyfill-0.7.0.tgz#0df1120ff0266056319ce1a622b09ad8d4a56505"