feat: Replace web-ext with web-ext-run (#101)
This commit is contained in:
+1
-4
@@ -84,7 +84,7 @@
|
||||
"unimport": "^3.1.0",
|
||||
"vite": "^4.4.7",
|
||||
"vite-tsconfig-paths": "^4.2.0",
|
||||
"web-ext": "^7.6.2",
|
||||
"web-ext-run": "^0.1.0",
|
||||
"webextension-polyfill": "^0.10.0",
|
||||
"zip-dir": "^2.0.0"
|
||||
},
|
||||
@@ -127,9 +127,6 @@
|
||||
"ignoreMissing": [
|
||||
"@algolia/client-search",
|
||||
"search-insights"
|
||||
],
|
||||
"allowAny": [
|
||||
"node-fetch"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+52
-1465
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -1,4 +1,4 @@
|
||||
declare module 'web-ext' {
|
||||
declare module 'web-ext-run' {
|
||||
export interface WebExtRunInstance {
|
||||
reloadAllExtensions(): Promise<void>;
|
||||
exit(): Promise<void>;
|
||||
@@ -12,7 +12,7 @@ declare module 'web-ext' {
|
||||
export default webExt;
|
||||
}
|
||||
|
||||
declare module 'web-ext/util/logger' {
|
||||
declare module 'web-ext-run/util/logger' {
|
||||
// https://github.com/mozilla/web-ext/blob/e37e60a2738478f512f1255c537133321f301771/src/util/logger.js#L43
|
||||
export interface IConsoleStream {
|
||||
stopCapturing(): void;
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { WebExtRunInstance } from 'web-ext';
|
||||
import type { WebExtRunInstance } from 'web-ext-run';
|
||||
import { ExtensionRunner } from './ExtensionRunner';
|
||||
|
||||
/**
|
||||
@@ -15,7 +15,7 @@ export function createWebExtRunner(): ExtensionRunner {
|
||||
}
|
||||
|
||||
// Use the plugin's logger instead of web-ext's built-in one.
|
||||
const webExtLogger = await import('web-ext/util/logger');
|
||||
const webExtLogger = await import('web-ext-run/util/logger');
|
||||
webExtLogger.consoleStream.write = ({ level, msg, name }) => {
|
||||
if (level >= ERROR_LOG_LEVEL) config.logger.error(name, msg);
|
||||
if (level >= WARN_LOG_LEVEL) config.logger.warn(msg);
|
||||
@@ -55,7 +55,7 @@ export function createWebExtRunner(): ExtensionRunner {
|
||||
config.logger.debug('web-ext config:', finalConfig);
|
||||
config.logger.debug('web-ext options:', options);
|
||||
|
||||
const webExt = await import('web-ext');
|
||||
const webExt = await import('web-ext-run');
|
||||
runner = await webExt.default.cmd.run(finalConfig, options);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user