wxt 0.19.11 → 0.19.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/browser/index.d.ts +8 -0
- package/dist/cli/cli-utils.mjs +2 -2
- package/dist/client/content-scripts/content-script-context.d.ts +7 -1
- package/dist/client/content-scripts/content-script-context.mjs +13 -13
- package/dist/client/content-scripts/ui/index.d.ts +3 -3
- package/dist/core/builders/vite/index.mjs +2 -1
- package/dist/core/package-managers/bun.mjs +2 -2
- package/dist/core/package-managers/npm.mjs +3 -4
- package/dist/core/package-managers/pnpm.mjs +2 -2
- package/dist/core/package-managers/yarn.mjs +2 -2
- package/dist/core/resolve-config.mjs +8 -2
- package/dist/core/utils/env.d.ts +3 -2
- package/dist/core/utils/env.mjs +12 -2
- package/dist/core/utils/testing/fake-objects.d.ts +189 -79
- package/dist/core/wxt.mjs +14 -0
- package/dist/core/zip.mjs +3 -1
- package/dist/types.d.ts +16 -3
- package/dist/version.mjs +1 -1
- package/package.json +21 -24
package/README.md
CHANGED
|
@@ -71,7 +71,7 @@ Or see the [installation guide](https://wxt.dev/guide/installation.html) to get
|
|
|
71
71
|
- 🦾 Auto-imports
|
|
72
72
|
- 🤖 Automated publishing
|
|
73
73
|
- 🎨 Frontend framework agnostic: works with Vue, React, Svelte, etc
|
|
74
|
-
- 📦
|
|
74
|
+
- 📦 [Module system](https://wxt.dev/guide/essentials/wxt-modules.html#overview) for reusing code between extensions
|
|
75
75
|
- 🖍️ Quickly bootstrap a new project
|
|
76
76
|
- 📏 Bundle analysis
|
|
77
77
|
- ⬇️ Download and bundle remote URL imports
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -8,8 +8,16 @@ export type AugmentedBrowser = Omit<Browser, 'runtime' | 'i18n'> & {
|
|
|
8
8
|
runtime: WxtRuntime & Omit<Browser['runtime'], 'getURL'>;
|
|
9
9
|
i18n: WxtI18n & Omit<Browser['i18n'], 'getMessage'>;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* This interface is empty because it is generated per-project when running `wxt prepare`. See:
|
|
13
|
+
* - `.wxt/types/paths.d.ts`
|
|
14
|
+
*/
|
|
11
15
|
export interface WxtRuntime {
|
|
12
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* This interface is empty because it is generated per-project when running `wxt prepare`. See:
|
|
19
|
+
* - `.wxt/types/i18n.d.ts`
|
|
20
|
+
*/
|
|
13
21
|
export interface WxtI18n {
|
|
14
22
|
}
|
|
15
23
|
export declare const browser: AugmentedBrowser;
|
package/dist/cli/cli-utils.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import { printHeader } from "../core/utils/log/index.mjs";
|
|
|
4
4
|
import { formatDuration } from "../core/utils/time.mjs";
|
|
5
5
|
import { ValidationError } from "../core/utils/validation.mjs";
|
|
6
6
|
import { registerWxt } from "../core/wxt.mjs";
|
|
7
|
+
import spawn from "nano-spawn";
|
|
7
8
|
export function wrapAction(cb, options) {
|
|
8
9
|
return async (...args) => {
|
|
9
10
|
const isDebug = !!args.find((arg) => arg?.debug);
|
|
@@ -43,8 +44,7 @@ export function createAliasedCommand(base, name, alias, bin, docsUrl) {
|
|
|
43
44
|
const args = process.argv.slice(
|
|
44
45
|
process.argv.indexOf(aliasedCommand.name) + 1
|
|
45
46
|
);
|
|
46
|
-
|
|
47
|
-
await execa(bin, args, {
|
|
47
|
+
await spawn(bin, args, {
|
|
48
48
|
stdio: "inherit"
|
|
49
49
|
});
|
|
50
50
|
} catch {
|
|
@@ -31,10 +31,12 @@ import { WxtLocationChangeEvent } from './custom-events';
|
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
33
33
|
export declare class ContentScriptContext implements AbortController {
|
|
34
|
-
#private;
|
|
35
34
|
private readonly contentScriptName;
|
|
36
35
|
readonly options?: Omit<ContentScriptDefinition, "main"> | undefined;
|
|
37
36
|
private static SCRIPT_STARTED_MESSAGE_TYPE;
|
|
37
|
+
private isTopFrame;
|
|
38
|
+
private abortController;
|
|
39
|
+
private locationWatcher;
|
|
38
40
|
constructor(contentScriptName: string, options?: Omit<ContentScriptDefinition, "main"> | undefined);
|
|
39
41
|
get signal(): AbortSignal;
|
|
40
42
|
abort(reason?: any): void;
|
|
@@ -107,6 +109,10 @@ export declare class ContentScriptContext implements AbortController {
|
|
|
107
109
|
* Abort the abort controller and execute all `onInvalidated` listeners.
|
|
108
110
|
*/
|
|
109
111
|
notifyInvalidated(): void;
|
|
112
|
+
stopOldScripts(): void;
|
|
113
|
+
listenForNewerScripts(options?: {
|
|
114
|
+
ignoreFirstEvent?: boolean;
|
|
115
|
+
}): void;
|
|
110
116
|
}
|
|
111
117
|
interface WxtContentScriptEventMap extends WindowEventMap {
|
|
112
118
|
'wxt:locationchange': WxtLocationChangeEvent;
|
|
@@ -6,23 +6,23 @@ export class ContentScriptContext {
|
|
|
6
6
|
constructor(contentScriptName, options) {
|
|
7
7
|
this.contentScriptName = contentScriptName;
|
|
8
8
|
this.options = options;
|
|
9
|
-
this
|
|
10
|
-
if (this
|
|
11
|
-
this
|
|
12
|
-
this
|
|
9
|
+
this.abortController = new AbortController();
|
|
10
|
+
if (this.isTopFrame) {
|
|
11
|
+
this.listenForNewerScripts({ ignoreFirstEvent: true });
|
|
12
|
+
this.stopOldScripts();
|
|
13
13
|
} else {
|
|
14
|
-
this
|
|
14
|
+
this.listenForNewerScripts();
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
static SCRIPT_STARTED_MESSAGE_TYPE = "wxt:content-script-started";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
isTopFrame = window.self === window.top;
|
|
19
|
+
abortController;
|
|
20
|
+
locationWatcher = createLocationWatcher(this);
|
|
21
21
|
get signal() {
|
|
22
|
-
return this
|
|
22
|
+
return this.abortController.signal;
|
|
23
23
|
}
|
|
24
24
|
abort(reason) {
|
|
25
|
-
return this
|
|
25
|
+
return this.abortController.abort(reason);
|
|
26
26
|
}
|
|
27
27
|
get isInvalid() {
|
|
28
28
|
if (browser.runtime.id == null) {
|
|
@@ -126,7 +126,7 @@ export class ContentScriptContext {
|
|
|
126
126
|
*/
|
|
127
127
|
addEventListener(target, type, handler, options) {
|
|
128
128
|
if (type === "wxt:locationchange") {
|
|
129
|
-
if (this.isValid) this
|
|
129
|
+
if (this.isValid) this.locationWatcher.run();
|
|
130
130
|
}
|
|
131
131
|
target.addEventListener?.(
|
|
132
132
|
type.startsWith("wxt:") ? getUniqueEventName(type) : type,
|
|
@@ -148,7 +148,7 @@ export class ContentScriptContext {
|
|
|
148
148
|
`Content script "${this.contentScriptName}" context invalidated`
|
|
149
149
|
);
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
stopOldScripts() {
|
|
152
152
|
window.postMessage(
|
|
153
153
|
{
|
|
154
154
|
type: ContentScriptContext.SCRIPT_STARTED_MESSAGE_TYPE,
|
|
@@ -157,7 +157,7 @@ export class ContentScriptContext {
|
|
|
157
157
|
"*"
|
|
158
158
|
);
|
|
159
159
|
}
|
|
160
|
-
|
|
160
|
+
listenForNewerScripts(options) {
|
|
161
161
|
let isFirst = true;
|
|
162
162
|
const cb = (event) => {
|
|
163
163
|
if (event.data?.type === ContentScriptContext.SCRIPT_STARTED_MESSAGE_TYPE && event.data?.contentScriptName === this.contentScriptName) {
|
|
@@ -4,13 +4,13 @@ export * from './types';
|
|
|
4
4
|
/**
|
|
5
5
|
* Create a content script UI without any isolation.
|
|
6
6
|
*
|
|
7
|
-
* @see https://wxt.dev/guide/
|
|
7
|
+
* @see https://wxt.dev/guide/essentials/content-scripts.html#integrated
|
|
8
8
|
*/
|
|
9
9
|
export declare function createIntegratedUi<TMounted>(ctx: ContentScriptContext, options: IntegratedContentScriptUiOptions<TMounted>): IntegratedContentScriptUi<TMounted>;
|
|
10
10
|
/**
|
|
11
11
|
* Create a content script UI using an iframe.
|
|
12
12
|
*
|
|
13
|
-
* @see https://wxt.dev/guide/
|
|
13
|
+
* @see https://wxt.dev/guide/essentials/content-scripts.html#iframe
|
|
14
14
|
*/
|
|
15
15
|
export declare function createIframeUi<TMounted>(ctx: ContentScriptContext, options: IframeContentScriptUiOptions<TMounted>): IframeContentScriptUi<TMounted>;
|
|
16
16
|
/**
|
|
@@ -18,6 +18,6 @@ export declare function createIframeUi<TMounted>(ctx: ContentScriptContext, opti
|
|
|
18
18
|
*
|
|
19
19
|
* > This function is async because it has to load the CSS via a network call.
|
|
20
20
|
*
|
|
21
|
-
* @see https://wxt.dev/guide/
|
|
21
|
+
* @see https://wxt.dev/guide/essentials/content-scripts.html#shadowroot
|
|
22
22
|
*/
|
|
23
23
|
export declare function createShadowRootUi<TMounted>(ctx: ContentScriptContext, options: ShadowRootContentScriptUiOptions<TMounted>): Promise<ShadowRootContentScriptUi<TMounted>>;
|
|
@@ -17,6 +17,7 @@ export async function createViteBuilder(wxtConfig, hooks, server) {
|
|
|
17
17
|
config.configFile = false;
|
|
18
18
|
config.logLevel = "warn";
|
|
19
19
|
config.mode = wxtConfig.mode;
|
|
20
|
+
config.envPrefix ??= ["VITE_", "WXT_"];
|
|
20
21
|
config.build ??= {};
|
|
21
22
|
config.publicDir = wxtConfig.publicDir;
|
|
22
23
|
config.build.copyPublicDir = false;
|
|
@@ -67,7 +68,7 @@ export async function createViteBuilder(wxtConfig, hooks, server) {
|
|
|
67
68
|
plugins,
|
|
68
69
|
esbuild: {
|
|
69
70
|
// Add a footer with the returned value so it can return values to `scripting.executeScript`
|
|
70
|
-
// Footer is added
|
|
71
|
+
// Footer is added a part of esbuild to make sure it's not minified. It
|
|
71
72
|
// get's removed if added to `build.rollupOptions.output.footer`
|
|
72
73
|
// See https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/scripting/executeScript#return_value
|
|
73
74
|
footer: iifeReturnValueName + ";"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { dedupeDependencies, npm } from "./npm.mjs";
|
|
2
|
+
import spawn from "nano-spawn";
|
|
2
3
|
export const bun = {
|
|
3
4
|
overridesKey: "overrides",
|
|
4
5
|
// But also supports "resolutions"
|
|
@@ -10,8 +11,7 @@ export const bun = {
|
|
|
10
11
|
if (options?.all) {
|
|
11
12
|
args.push("--all");
|
|
12
13
|
}
|
|
13
|
-
const
|
|
14
|
-
const res = await execa("bun", args, { cwd: options?.cwd });
|
|
14
|
+
const res = await spawn("bun", args, { cwd: options?.cwd });
|
|
15
15
|
return dedupeDependencies(
|
|
16
16
|
res.stdout.split("\n").slice(1).map((line) => line.trim()).map((line) => /.* (@?\S+)@(\S+)$/.exec(line)).filter((match) => !!match).map(([_, name, version]) => ({ name, version }))
|
|
17
17
|
);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { ensureDir } from "fs-extra";
|
|
3
|
+
import spawn from "nano-spawn";
|
|
3
4
|
export const npm = {
|
|
4
5
|
overridesKey: "overrides",
|
|
5
6
|
async downloadDependency(id, downloadDir) {
|
|
6
7
|
await ensureDir(downloadDir);
|
|
7
|
-
const
|
|
8
|
-
const res = await execa("npm", ["pack", id, "--json"], {
|
|
8
|
+
const res = await spawn("npm", ["pack", id, "--json"], {
|
|
9
9
|
cwd: downloadDir
|
|
10
10
|
});
|
|
11
11
|
const packed = JSON.parse(res.stdout);
|
|
@@ -16,8 +16,7 @@ export const npm = {
|
|
|
16
16
|
if (options?.all) {
|
|
17
17
|
args.push("--depth", "Infinity");
|
|
18
18
|
}
|
|
19
|
-
const
|
|
20
|
-
const res = await execa("npm", args, { cwd: options?.cwd });
|
|
19
|
+
const res = await spawn("npm", args, { cwd: options?.cwd });
|
|
21
20
|
const project = JSON.parse(res.stdout);
|
|
22
21
|
return flattenNpmListOutput([project]);
|
|
23
22
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { flattenNpmListOutput, npm } from "./npm.mjs";
|
|
2
|
+
import spawn from "nano-spawn";
|
|
2
3
|
export const pnpm = {
|
|
3
4
|
overridesKey: "resolutions",
|
|
4
5
|
// "pnpm.overrides" has a higher priority, but I don't want to deal with nesting
|
|
@@ -13,8 +14,7 @@ export const pnpm = {
|
|
|
13
14
|
if (typeof process !== "undefined" && process.env.WXT_PNPM_IGNORE_WORKSPACE === "true") {
|
|
14
15
|
args.push("--ignore-workspace");
|
|
15
16
|
}
|
|
16
|
-
const
|
|
17
|
-
const res = await execa("pnpm", args, { cwd: options?.cwd });
|
|
17
|
+
const res = await spawn("pnpm", args, { cwd: options?.cwd });
|
|
18
18
|
const projects = JSON.parse(res.stdout);
|
|
19
19
|
return flattenNpmListOutput(projects);
|
|
20
20
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { dedupeDependencies, npm } from "./npm.mjs";
|
|
2
|
+
import spawn from "nano-spawn";
|
|
2
3
|
export const yarn = {
|
|
3
4
|
overridesKey: "resolutions",
|
|
4
5
|
downloadDependency(...args) {
|
|
@@ -9,8 +10,7 @@ export const yarn = {
|
|
|
9
10
|
if (options?.all) {
|
|
10
11
|
args.push("--depth", "Infinity");
|
|
11
12
|
}
|
|
12
|
-
const
|
|
13
|
-
const res = await execa("yarn", args, { cwd: options?.cwd });
|
|
13
|
+
const res = await spawn("yarn", args, { cwd: options?.cwd });
|
|
14
14
|
const tree = res.stdout.split("\n").map((line) => JSON.parse(line)).find((line) => line.type === "tree")?.data;
|
|
15
15
|
if (tree == null) throw Error("'yarn list --json' did not output a tree");
|
|
16
16
|
const queue = [...tree.trees];
|
|
@@ -34,7 +34,7 @@ export async function resolveConfig(inlineConfig, command) {
|
|
|
34
34
|
const manifestVersion = mergedConfig.manifestVersion ?? (browser === "firefox" || browser === "safari" ? 2 : 3);
|
|
35
35
|
const mode = mergedConfig.mode ?? COMMAND_MODES[command];
|
|
36
36
|
const env = { browser, command, manifestVersion, mode };
|
|
37
|
-
loadEnv(mode);
|
|
37
|
+
loadEnv(mode, browser);
|
|
38
38
|
const root = path.resolve(
|
|
39
39
|
inlineConfig.root ?? userConfig.root ?? process.cwd()
|
|
40
40
|
);
|
|
@@ -53,7 +53,12 @@ export async function resolveConfig(inlineConfig, command) {
|
|
|
53
53
|
const publicDir = path.resolve(srcDir, mergedConfig.publicDir ?? "public");
|
|
54
54
|
const typesDir = path.resolve(wxtDir, "types");
|
|
55
55
|
const outBaseDir = path.resolve(root, mergedConfig.outDir ?? ".output");
|
|
56
|
-
const
|
|
56
|
+
const modeSuffixes = {
|
|
57
|
+
production: "",
|
|
58
|
+
development: "-dev"
|
|
59
|
+
};
|
|
60
|
+
const outDirTemplate = (mergedConfig.outDirTemplate ?? `${browser}-mv${manifestVersion}`).replaceAll("{{browser}}", browser).replaceAll("{{manifestVersion}}", manifestVersion.toString()).replaceAll("{{modeSuffix}}", modeSuffixes[mode] ?? `-${mode}`).replaceAll("{{mode}}", mode).replaceAll("{{command}}", command);
|
|
61
|
+
const outDir = path.resolve(outBaseDir, outDirTemplate);
|
|
57
62
|
const reloadCommand = mergedConfig.dev?.reloadCommand ?? "Alt+R";
|
|
58
63
|
const runnerConfig = await loadConfig({
|
|
59
64
|
name: "web-ext",
|
|
@@ -339,6 +344,7 @@ export async function resolveWxtUserModules(modulesDir, modules = []) {
|
|
|
339
344
|
cwd: modulesDir,
|
|
340
345
|
onlyFiles: true
|
|
341
346
|
}).catch(() => []);
|
|
347
|
+
localModulePaths.sort();
|
|
342
348
|
const localModules = await Promise.all(
|
|
343
349
|
localModulePaths.map(async (file) => {
|
|
344
350
|
const absolutePath = normalizePath(path.resolve(modulesDir, file));
|
package/dist/core/utils/env.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import type { TargetBrowser } from '../../types';
|
|
1
2
|
/**
|
|
2
|
-
* Load environment files based on the current mode.
|
|
3
|
+
* Load environment files based on the current mode and browser.
|
|
3
4
|
*/
|
|
4
|
-
export declare function loadEnv(mode: string): import("dotenv").DotenvConfigOutput;
|
|
5
|
+
export declare function loadEnv(mode: string, browser: TargetBrowser): import("dotenv").DotenvConfigOutput;
|
package/dist/core/utils/env.mjs
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { config } from "dotenv";
|
|
2
|
-
export function loadEnv(mode) {
|
|
2
|
+
export function loadEnv(mode, browser) {
|
|
3
3
|
return config({
|
|
4
|
-
|
|
4
|
+
// Files on top override files below
|
|
5
|
+
path: [
|
|
6
|
+
`.env.${mode}.${browser}.local`,
|
|
7
|
+
`.env.${mode}.${browser}`,
|
|
8
|
+
`.env.${browser}.local`,
|
|
9
|
+
`.env.${browser}`,
|
|
10
|
+
`.env.${mode}.local`,
|
|
11
|
+
`.env.${mode}`,
|
|
12
|
+
`.env.local`,
|
|
13
|
+
`.env`
|
|
14
|
+
]
|
|
5
15
|
});
|
|
6
16
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type Manifest } from 'wxt/browser';
|
|
2
2
|
import { ResolvedConfig, WxtDevServer, BackgroundEntrypoint, ContentScriptEntrypoint, GenericEntrypoint, OptionsEntrypoint, PopupEntrypoint, OutputChunk, OutputFile, OutputAsset, BuildOutput, BuildStepOutput, UserManifest, Wxt, SidepanelEntrypoint } from '../../../types';
|
|
3
3
|
type DeepPartial<T> = T extends object ? {
|
|
4
4
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
@@ -11,13 +11,13 @@ export declare const fakeContentScriptEntrypoint: (overrides?: {
|
|
|
11
11
|
type?: "content-script" | undefined;
|
|
12
12
|
options?: {
|
|
13
13
|
world?: "ISOLATED" | "MAIN" | undefined;
|
|
14
|
-
matches?: import("../../../types").PerBrowserOption<
|
|
15
|
-
runAt?: import("../../../types").PerBrowserOption<
|
|
16
|
-
matchAboutBlank?: import("../../../types").PerBrowserOption<
|
|
17
|
-
excludeMatches?: import("../../../types").PerBrowserOption<
|
|
18
|
-
includeGlobs?: import("../../../types").PerBrowserOption<
|
|
19
|
-
excludeGlobs?: import("../../../types").PerBrowserOption<
|
|
20
|
-
allFrames?: import("../../../types").PerBrowserOption<
|
|
14
|
+
matches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["matches"]>;
|
|
15
|
+
runAt?: import("../../../types").PerBrowserOption<Manifest.ContentScript["run_at"]>;
|
|
16
|
+
matchAboutBlank?: import("../../../types").PerBrowserOption<Manifest.ContentScript["match_about_blank"]>;
|
|
17
|
+
excludeMatches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_matches"]>;
|
|
18
|
+
includeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["include_globs"]>;
|
|
19
|
+
excludeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_globs"]>;
|
|
20
|
+
allFrames?: import("../../../types").PerBrowserOption<Manifest.ContentScript["all_frames"]>;
|
|
21
21
|
matchOriginAsFallback?: boolean | undefined;
|
|
22
22
|
cssInjectionMode?: "manifest" | "manual" | "ui" | undefined;
|
|
23
23
|
registration?: "manifest" | "runtime" | undefined;
|
|
@@ -545,8 +545,21 @@ export declare const fakeResolvedConfig: (overrides?: {
|
|
|
545
545
|
warn?: {} | undefined;
|
|
546
546
|
debugLog?: {} | undefined;
|
|
547
547
|
addons?: {
|
|
548
|
+
addons?: ({
|
|
549
|
+
name?: string | undefined;
|
|
550
|
+
transform?: {} | undefined;
|
|
551
|
+
declaration?: {} | undefined;
|
|
552
|
+
matchImports?: {} | undefined;
|
|
553
|
+
extendImports?: {} | undefined;
|
|
554
|
+
injectImportsResolved?: {} | undefined;
|
|
555
|
+
injectImportsStringified?: {} | undefined;
|
|
556
|
+
} | undefined)[] | undefined;
|
|
548
557
|
vueTemplate?: boolean | undefined;
|
|
558
|
+
vueDirectives?: true | {
|
|
559
|
+
isDirective?: {} | undefined;
|
|
560
|
+
} | undefined;
|
|
549
561
|
} | ({
|
|
562
|
+
name?: string | undefined;
|
|
550
563
|
transform?: {} | undefined;
|
|
551
564
|
declaration?: {} | undefined;
|
|
552
565
|
matchImports?: {} | undefined;
|
|
@@ -1370,6 +1383,7 @@ export declare const fakeResolvedConfig: (overrides?: {
|
|
|
1370
1383
|
modulesDir?: string | undefined;
|
|
1371
1384
|
filterEntrypoints?: (string | undefined)[] | undefined;
|
|
1372
1385
|
outDir?: string | undefined;
|
|
1386
|
+
outDirTemplate?: string | undefined;
|
|
1373
1387
|
debug?: boolean | undefined;
|
|
1374
1388
|
imports?: false | {
|
|
1375
1389
|
imports?: ({
|
|
@@ -1449,8 +1463,21 @@ export declare const fakeResolvedConfig: (overrides?: {
|
|
|
1449
1463
|
warn?: {} | undefined;
|
|
1450
1464
|
debugLog?: {} | undefined;
|
|
1451
1465
|
addons?: {
|
|
1466
|
+
addons?: ({
|
|
1467
|
+
name?: string | undefined;
|
|
1468
|
+
transform?: {} | undefined;
|
|
1469
|
+
declaration?: {} | undefined;
|
|
1470
|
+
matchImports?: {} | undefined;
|
|
1471
|
+
extendImports?: {} | undefined;
|
|
1472
|
+
injectImportsResolved?: {} | undefined;
|
|
1473
|
+
injectImportsStringified?: {} | undefined;
|
|
1474
|
+
} | undefined)[] | undefined;
|
|
1452
1475
|
vueTemplate?: boolean | undefined;
|
|
1476
|
+
vueDirectives?: true | {
|
|
1477
|
+
isDirective?: {} | undefined;
|
|
1478
|
+
} | undefined;
|
|
1453
1479
|
} | ({
|
|
1480
|
+
name?: string | undefined;
|
|
1454
1481
|
transform?: {} | undefined;
|
|
1455
1482
|
declaration?: {} | undefined;
|
|
1456
1483
|
matchImports?: {} | undefined;
|
|
@@ -2065,6 +2092,7 @@ export declare const fakeResolvedConfig: (overrides?: {
|
|
|
2065
2092
|
modulesDir?: string | undefined;
|
|
2066
2093
|
filterEntrypoints?: (string | undefined)[] | undefined;
|
|
2067
2094
|
outDir?: string | undefined;
|
|
2095
|
+
outDirTemplate?: string | undefined;
|
|
2068
2096
|
debug?: boolean | undefined;
|
|
2069
2097
|
imports?: false | {
|
|
2070
2098
|
imports?: ({
|
|
@@ -2144,8 +2172,21 @@ export declare const fakeResolvedConfig: (overrides?: {
|
|
|
2144
2172
|
warn?: {} | undefined;
|
|
2145
2173
|
debugLog?: {} | undefined;
|
|
2146
2174
|
addons?: {
|
|
2175
|
+
addons?: ({
|
|
2176
|
+
name?: string | undefined;
|
|
2177
|
+
transform?: {} | undefined;
|
|
2178
|
+
declaration?: {} | undefined;
|
|
2179
|
+
matchImports?: {} | undefined;
|
|
2180
|
+
extendImports?: {} | undefined;
|
|
2181
|
+
injectImportsResolved?: {} | undefined;
|
|
2182
|
+
injectImportsStringified?: {} | undefined;
|
|
2183
|
+
} | undefined)[] | undefined;
|
|
2147
2184
|
vueTemplate?: boolean | undefined;
|
|
2185
|
+
vueDirectives?: true | {
|
|
2186
|
+
isDirective?: {} | undefined;
|
|
2187
|
+
} | undefined;
|
|
2148
2188
|
} | ({
|
|
2189
|
+
name?: string | undefined;
|
|
2149
2190
|
transform?: {} | undefined;
|
|
2150
2191
|
declaration?: {} | undefined;
|
|
2151
2192
|
matchImports?: {} | undefined;
|
|
@@ -2786,6 +2827,7 @@ export declare const fakeResolvedConfig: (overrides?: {
|
|
|
2786
2827
|
modulesDir?: string | undefined;
|
|
2787
2828
|
filterEntrypoints?: (string | undefined)[] | undefined;
|
|
2788
2829
|
outDir?: string | undefined;
|
|
2830
|
+
outDirTemplate?: string | undefined;
|
|
2789
2831
|
debug?: boolean | undefined;
|
|
2790
2832
|
imports?: false | {
|
|
2791
2833
|
imports?: ({
|
|
@@ -2865,8 +2907,21 @@ export declare const fakeResolvedConfig: (overrides?: {
|
|
|
2865
2907
|
warn?: {} | undefined;
|
|
2866
2908
|
debugLog?: {} | undefined;
|
|
2867
2909
|
addons?: {
|
|
2910
|
+
addons?: ({
|
|
2911
|
+
name?: string | undefined;
|
|
2912
|
+
transform?: {} | undefined;
|
|
2913
|
+
declaration?: {} | undefined;
|
|
2914
|
+
matchImports?: {} | undefined;
|
|
2915
|
+
extendImports?: {} | undefined;
|
|
2916
|
+
injectImportsResolved?: {} | undefined;
|
|
2917
|
+
injectImportsStringified?: {} | undefined;
|
|
2918
|
+
} | undefined)[] | undefined;
|
|
2868
2919
|
vueTemplate?: boolean | undefined;
|
|
2920
|
+
vueDirectives?: true | {
|
|
2921
|
+
isDirective?: {} | undefined;
|
|
2922
|
+
} | undefined;
|
|
2869
2923
|
} | ({
|
|
2924
|
+
name?: string | undefined;
|
|
2870
2925
|
transform?: {} | undefined;
|
|
2871
2926
|
declaration?: {} | undefined;
|
|
2872
2927
|
matchImports?: {} | undefined;
|
|
@@ -3971,8 +4026,21 @@ export declare const fakeWxt: (overrides?: {
|
|
|
3971
4026
|
warn?: {} | undefined;
|
|
3972
4027
|
debugLog?: {} | undefined;
|
|
3973
4028
|
addons?: {
|
|
4029
|
+
addons?: ({
|
|
4030
|
+
name?: string | undefined;
|
|
4031
|
+
transform?: {} | undefined;
|
|
4032
|
+
declaration?: {} | undefined;
|
|
4033
|
+
matchImports?: {} | undefined;
|
|
4034
|
+
extendImports?: {} | undefined;
|
|
4035
|
+
injectImportsResolved?: {} | undefined;
|
|
4036
|
+
injectImportsStringified?: {} | undefined;
|
|
4037
|
+
} | undefined)[] | undefined;
|
|
3974
4038
|
vueTemplate?: boolean | undefined;
|
|
4039
|
+
vueDirectives?: true | {
|
|
4040
|
+
isDirective?: {} | undefined;
|
|
4041
|
+
} | undefined;
|
|
3975
4042
|
} | ({
|
|
4043
|
+
name?: string | undefined;
|
|
3976
4044
|
transform?: {} | undefined;
|
|
3977
4045
|
declaration?: {} | undefined;
|
|
3978
4046
|
matchImports?: {} | undefined;
|
|
@@ -4796,6 +4864,7 @@ export declare const fakeWxt: (overrides?: {
|
|
|
4796
4864
|
modulesDir?: string | undefined;
|
|
4797
4865
|
filterEntrypoints?: (string | undefined)[] | undefined;
|
|
4798
4866
|
outDir?: string | undefined;
|
|
4867
|
+
outDirTemplate?: string | undefined;
|
|
4799
4868
|
debug?: boolean | undefined;
|
|
4800
4869
|
imports?: false | {
|
|
4801
4870
|
imports?: ({
|
|
@@ -4875,8 +4944,21 @@ export declare const fakeWxt: (overrides?: {
|
|
|
4875
4944
|
warn?: {} | undefined;
|
|
4876
4945
|
debugLog?: {} | undefined;
|
|
4877
4946
|
addons?: {
|
|
4947
|
+
addons?: ({
|
|
4948
|
+
name?: string | undefined;
|
|
4949
|
+
transform?: {} | undefined;
|
|
4950
|
+
declaration?: {} | undefined;
|
|
4951
|
+
matchImports?: {} | undefined;
|
|
4952
|
+
extendImports?: {} | undefined;
|
|
4953
|
+
injectImportsResolved?: {} | undefined;
|
|
4954
|
+
injectImportsStringified?: {} | undefined;
|
|
4955
|
+
} | undefined)[] | undefined;
|
|
4878
4956
|
vueTemplate?: boolean | undefined;
|
|
4957
|
+
vueDirectives?: true | {
|
|
4958
|
+
isDirective?: {} | undefined;
|
|
4959
|
+
} | undefined;
|
|
4879
4960
|
} | ({
|
|
4961
|
+
name?: string | undefined;
|
|
4880
4962
|
transform?: {} | undefined;
|
|
4881
4963
|
declaration?: {} | undefined;
|
|
4882
4964
|
matchImports?: {} | undefined;
|
|
@@ -5491,6 +5573,7 @@ export declare const fakeWxt: (overrides?: {
|
|
|
5491
5573
|
modulesDir?: string | undefined;
|
|
5492
5574
|
filterEntrypoints?: (string | undefined)[] | undefined;
|
|
5493
5575
|
outDir?: string | undefined;
|
|
5576
|
+
outDirTemplate?: string | undefined;
|
|
5494
5577
|
debug?: boolean | undefined;
|
|
5495
5578
|
imports?: false | {
|
|
5496
5579
|
imports?: ({
|
|
@@ -5570,8 +5653,21 @@ export declare const fakeWxt: (overrides?: {
|
|
|
5570
5653
|
warn?: {} | undefined;
|
|
5571
5654
|
debugLog?: {} | undefined;
|
|
5572
5655
|
addons?: {
|
|
5656
|
+
addons?: ({
|
|
5657
|
+
name?: string | undefined;
|
|
5658
|
+
transform?: {} | undefined;
|
|
5659
|
+
declaration?: {} | undefined;
|
|
5660
|
+
matchImports?: {} | undefined;
|
|
5661
|
+
extendImports?: {} | undefined;
|
|
5662
|
+
injectImportsResolved?: {} | undefined;
|
|
5663
|
+
injectImportsStringified?: {} | undefined;
|
|
5664
|
+
} | undefined)[] | undefined;
|
|
5573
5665
|
vueTemplate?: boolean | undefined;
|
|
5666
|
+
vueDirectives?: true | {
|
|
5667
|
+
isDirective?: {} | undefined;
|
|
5668
|
+
} | undefined;
|
|
5574
5669
|
} | ({
|
|
5670
|
+
name?: string | undefined;
|
|
5575
5671
|
transform?: {} | undefined;
|
|
5576
5672
|
declaration?: {} | undefined;
|
|
5577
5673
|
matchImports?: {} | undefined;
|
|
@@ -6212,6 +6308,7 @@ export declare const fakeWxt: (overrides?: {
|
|
|
6212
6308
|
modulesDir?: string | undefined;
|
|
6213
6309
|
filterEntrypoints?: (string | undefined)[] | undefined;
|
|
6214
6310
|
outDir?: string | undefined;
|
|
6311
|
+
outDirTemplate?: string | undefined;
|
|
6215
6312
|
debug?: boolean | undefined;
|
|
6216
6313
|
imports?: false | {
|
|
6217
6314
|
imports?: ({
|
|
@@ -6291,8 +6388,21 @@ export declare const fakeWxt: (overrides?: {
|
|
|
6291
6388
|
warn?: {} | undefined;
|
|
6292
6389
|
debugLog?: {} | undefined;
|
|
6293
6390
|
addons?: {
|
|
6391
|
+
addons?: ({
|
|
6392
|
+
name?: string | undefined;
|
|
6393
|
+
transform?: {} | undefined;
|
|
6394
|
+
declaration?: {} | undefined;
|
|
6395
|
+
matchImports?: {} | undefined;
|
|
6396
|
+
extendImports?: {} | undefined;
|
|
6397
|
+
injectImportsResolved?: {} | undefined;
|
|
6398
|
+
injectImportsStringified?: {} | undefined;
|
|
6399
|
+
} | undefined)[] | undefined;
|
|
6294
6400
|
vueTemplate?: boolean | undefined;
|
|
6401
|
+
vueDirectives?: true | {
|
|
6402
|
+
isDirective?: {} | undefined;
|
|
6403
|
+
} | undefined;
|
|
6295
6404
|
} | ({
|
|
6405
|
+
name?: string | undefined;
|
|
6296
6406
|
transform?: {} | undefined;
|
|
6297
6407
|
declaration?: {} | undefined;
|
|
6298
6408
|
matchImports?: {} | undefined;
|
|
@@ -7312,7 +7422,7 @@ export declare const fakeWxt: (overrides?: {
|
|
|
7312
7422
|
command?: string | undefined;
|
|
7313
7423
|
version?: string | undefined;
|
|
7314
7424
|
majorVersion?: string | undefined;
|
|
7315
|
-
lockFile?: string | undefined;
|
|
7425
|
+
lockFile?: string | (string | undefined)[] | undefined;
|
|
7316
7426
|
files?: (string | undefined)[] | undefined;
|
|
7317
7427
|
} | undefined;
|
|
7318
7428
|
server?: {
|
|
@@ -7343,13 +7453,13 @@ export declare const fakeWxt: (overrides?: {
|
|
|
7343
7453
|
type?: "content-script" | undefined;
|
|
7344
7454
|
options?: {
|
|
7345
7455
|
world?: "ISOLATED" | "MAIN" | undefined;
|
|
7346
|
-
matches?: import("../../../types").PerBrowserOption<
|
|
7347
|
-
runAt?: import("../../../types").PerBrowserOption<
|
|
7348
|
-
matchAboutBlank?: import("../../../types").PerBrowserOption<
|
|
7349
|
-
excludeMatches?: import("../../../types").PerBrowserOption<
|
|
7350
|
-
includeGlobs?: import("../../../types").PerBrowserOption<
|
|
7351
|
-
excludeGlobs?: import("../../../types").PerBrowserOption<
|
|
7352
|
-
allFrames?: import("../../../types").PerBrowserOption<
|
|
7456
|
+
matches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["matches"]>;
|
|
7457
|
+
runAt?: import("../../../types").PerBrowserOption<Manifest.ContentScript["run_at"]>;
|
|
7458
|
+
matchAboutBlank?: import("../../../types").PerBrowserOption<Manifest.ContentScript["match_about_blank"]>;
|
|
7459
|
+
excludeMatches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_matches"]>;
|
|
7460
|
+
includeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["include_globs"]>;
|
|
7461
|
+
excludeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_globs"]>;
|
|
7462
|
+
allFrames?: import("../../../types").PerBrowserOption<Manifest.ContentScript["all_frames"]>;
|
|
7353
7463
|
matchOriginAsFallback?: boolean | undefined;
|
|
7354
7464
|
cssInjectionMode?: "manifest" | "manual" | "ui" | undefined;
|
|
7355
7465
|
registration?: "manifest" | "runtime" | undefined;
|
|
@@ -7431,13 +7541,13 @@ export declare const fakeWxt: (overrides?: {
|
|
|
7431
7541
|
type?: "content-script" | undefined;
|
|
7432
7542
|
options?: {
|
|
7433
7543
|
world?: "ISOLATED" | "MAIN" | undefined;
|
|
7434
|
-
matches?: import("../../../types").PerBrowserOption<
|
|
7435
|
-
runAt?: import("../../../types").PerBrowserOption<
|
|
7436
|
-
matchAboutBlank?: import("../../../types").PerBrowserOption<
|
|
7437
|
-
excludeMatches?: import("../../../types").PerBrowserOption<
|
|
7438
|
-
includeGlobs?: import("../../../types").PerBrowserOption<
|
|
7439
|
-
excludeGlobs?: import("../../../types").PerBrowserOption<
|
|
7440
|
-
allFrames?: import("../../../types").PerBrowserOption<
|
|
7544
|
+
matches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["matches"]>;
|
|
7545
|
+
runAt?: import("../../../types").PerBrowserOption<Manifest.ContentScript["run_at"]>;
|
|
7546
|
+
matchAboutBlank?: import("../../../types").PerBrowserOption<Manifest.ContentScript["match_about_blank"]>;
|
|
7547
|
+
excludeMatches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_matches"]>;
|
|
7548
|
+
includeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["include_globs"]>;
|
|
7549
|
+
excludeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_globs"]>;
|
|
7550
|
+
allFrames?: import("../../../types").PerBrowserOption<Manifest.ContentScript["all_frames"]>;
|
|
7441
7551
|
matchOriginAsFallback?: boolean | undefined;
|
|
7442
7552
|
cssInjectionMode?: "manifest" | "manual" | "ui" | undefined;
|
|
7443
7553
|
registration?: "manifest" | "runtime" | undefined;
|
|
@@ -7642,13 +7752,13 @@ export declare const fakeWxtDevServer: (overrides?: {
|
|
|
7642
7752
|
type?: "content-script" | undefined;
|
|
7643
7753
|
options?: {
|
|
7644
7754
|
world?: "ISOLATED" | "MAIN" | undefined;
|
|
7645
|
-
matches?: import("../../../types").PerBrowserOption<
|
|
7646
|
-
runAt?: import("../../../types").PerBrowserOption<
|
|
7647
|
-
matchAboutBlank?: import("../../../types").PerBrowserOption<
|
|
7648
|
-
excludeMatches?: import("../../../types").PerBrowserOption<
|
|
7649
|
-
includeGlobs?: import("../../../types").PerBrowserOption<
|
|
7650
|
-
excludeGlobs?: import("../../../types").PerBrowserOption<
|
|
7651
|
-
allFrames?: import("../../../types").PerBrowserOption<
|
|
7755
|
+
matches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["matches"]>;
|
|
7756
|
+
runAt?: import("../../../types").PerBrowserOption<Manifest.ContentScript["run_at"]>;
|
|
7757
|
+
matchAboutBlank?: import("../../../types").PerBrowserOption<Manifest.ContentScript["match_about_blank"]>;
|
|
7758
|
+
excludeMatches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_matches"]>;
|
|
7759
|
+
includeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["include_globs"]>;
|
|
7760
|
+
excludeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_globs"]>;
|
|
7761
|
+
allFrames?: import("../../../types").PerBrowserOption<Manifest.ContentScript["all_frames"]>;
|
|
7652
7762
|
matchOriginAsFallback?: boolean | undefined;
|
|
7653
7763
|
cssInjectionMode?: "manifest" | "manual" | "ui" | undefined;
|
|
7654
7764
|
registration?: "manifest" | "runtime" | undefined;
|
|
@@ -7730,13 +7840,13 @@ export declare const fakeWxtDevServer: (overrides?: {
|
|
|
7730
7840
|
type?: "content-script" | undefined;
|
|
7731
7841
|
options?: {
|
|
7732
7842
|
world?: "ISOLATED" | "MAIN" | undefined;
|
|
7733
|
-
matches?: import("../../../types").PerBrowserOption<
|
|
7734
|
-
runAt?: import("../../../types").PerBrowserOption<
|
|
7735
|
-
matchAboutBlank?: import("../../../types").PerBrowserOption<
|
|
7736
|
-
excludeMatches?: import("../../../types").PerBrowserOption<
|
|
7737
|
-
includeGlobs?: import("../../../types").PerBrowserOption<
|
|
7738
|
-
excludeGlobs?: import("../../../types").PerBrowserOption<
|
|
7739
|
-
allFrames?: import("../../../types").PerBrowserOption<
|
|
7843
|
+
matches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["matches"]>;
|
|
7844
|
+
runAt?: import("../../../types").PerBrowserOption<Manifest.ContentScript["run_at"]>;
|
|
7845
|
+
matchAboutBlank?: import("../../../types").PerBrowserOption<Manifest.ContentScript["match_about_blank"]>;
|
|
7846
|
+
excludeMatches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_matches"]>;
|
|
7847
|
+
includeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["include_globs"]>;
|
|
7848
|
+
excludeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_globs"]>;
|
|
7849
|
+
allFrames?: import("../../../types").PerBrowserOption<Manifest.ContentScript["all_frames"]>;
|
|
7740
7850
|
matchOriginAsFallback?: boolean | undefined;
|
|
7741
7851
|
cssInjectionMode?: "manifest" | "manual" | "ui" | undefined;
|
|
7742
7852
|
registration?: "manifest" | "runtime" | undefined;
|
|
@@ -7933,13 +8043,13 @@ export declare const fakeBuildOutput: (overrides?: {
|
|
|
7933
8043
|
type?: "content-script" | undefined;
|
|
7934
8044
|
options?: {
|
|
7935
8045
|
world?: "ISOLATED" | "MAIN" | undefined;
|
|
7936
|
-
matches?: import("../../../types").PerBrowserOption<
|
|
7937
|
-
runAt?: import("../../../types").PerBrowserOption<
|
|
7938
|
-
matchAboutBlank?: import("../../../types").PerBrowserOption<
|
|
7939
|
-
excludeMatches?: import("../../../types").PerBrowserOption<
|
|
7940
|
-
includeGlobs?: import("../../../types").PerBrowserOption<
|
|
7941
|
-
excludeGlobs?: import("../../../types").PerBrowserOption<
|
|
7942
|
-
allFrames?: import("../../../types").PerBrowserOption<
|
|
8046
|
+
matches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["matches"]>;
|
|
8047
|
+
runAt?: import("../../../types").PerBrowserOption<Manifest.ContentScript["run_at"]>;
|
|
8048
|
+
matchAboutBlank?: import("../../../types").PerBrowserOption<Manifest.ContentScript["match_about_blank"]>;
|
|
8049
|
+
excludeMatches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_matches"]>;
|
|
8050
|
+
includeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["include_globs"]>;
|
|
8051
|
+
excludeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_globs"]>;
|
|
8052
|
+
allFrames?: import("../../../types").PerBrowserOption<Manifest.ContentScript["all_frames"]>;
|
|
7943
8053
|
matchOriginAsFallback?: boolean | undefined;
|
|
7944
8054
|
cssInjectionMode?: "manifest" | "manual" | "ui" | undefined;
|
|
7945
8055
|
registration?: "manifest" | "runtime" | undefined;
|
|
@@ -8021,13 +8131,13 @@ export declare const fakeBuildOutput: (overrides?: {
|
|
|
8021
8131
|
type?: "content-script" | undefined;
|
|
8022
8132
|
options?: {
|
|
8023
8133
|
world?: "ISOLATED" | "MAIN" | undefined;
|
|
8024
|
-
matches?: import("../../../types").PerBrowserOption<
|
|
8025
|
-
runAt?: import("../../../types").PerBrowserOption<
|
|
8026
|
-
matchAboutBlank?: import("../../../types").PerBrowserOption<
|
|
8027
|
-
excludeMatches?: import("../../../types").PerBrowserOption<
|
|
8028
|
-
includeGlobs?: import("../../../types").PerBrowserOption<
|
|
8029
|
-
excludeGlobs?: import("../../../types").PerBrowserOption<
|
|
8030
|
-
allFrames?: import("../../../types").PerBrowserOption<
|
|
8134
|
+
matches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["matches"]>;
|
|
8135
|
+
runAt?: import("../../../types").PerBrowserOption<Manifest.ContentScript["run_at"]>;
|
|
8136
|
+
matchAboutBlank?: import("../../../types").PerBrowserOption<Manifest.ContentScript["match_about_blank"]>;
|
|
8137
|
+
excludeMatches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_matches"]>;
|
|
8138
|
+
includeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["include_globs"]>;
|
|
8139
|
+
excludeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_globs"]>;
|
|
8140
|
+
allFrames?: import("../../../types").PerBrowserOption<Manifest.ContentScript["all_frames"]>;
|
|
8031
8141
|
matchOriginAsFallback?: boolean | undefined;
|
|
8032
8142
|
cssInjectionMode?: "manifest" | "manual" | "ui" | undefined;
|
|
8033
8143
|
registration?: "manifest" | "runtime" | undefined;
|
|
@@ -8121,13 +8231,13 @@ export declare const fakeBuildStepOutput: (overrides?: {
|
|
|
8121
8231
|
type?: "content-script" | undefined;
|
|
8122
8232
|
options?: {
|
|
8123
8233
|
world?: "ISOLATED" | "MAIN" | undefined;
|
|
8124
|
-
matches?: import("../../../types").PerBrowserOption<
|
|
8125
|
-
runAt?: import("../../../types").PerBrowserOption<
|
|
8126
|
-
matchAboutBlank?: import("../../../types").PerBrowserOption<
|
|
8127
|
-
excludeMatches?: import("../../../types").PerBrowserOption<
|
|
8128
|
-
includeGlobs?: import("../../../types").PerBrowserOption<
|
|
8129
|
-
excludeGlobs?: import("../../../types").PerBrowserOption<
|
|
8130
|
-
allFrames?: import("../../../types").PerBrowserOption<
|
|
8234
|
+
matches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["matches"]>;
|
|
8235
|
+
runAt?: import("../../../types").PerBrowserOption<Manifest.ContentScript["run_at"]>;
|
|
8236
|
+
matchAboutBlank?: import("../../../types").PerBrowserOption<Manifest.ContentScript["match_about_blank"]>;
|
|
8237
|
+
excludeMatches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_matches"]>;
|
|
8238
|
+
includeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["include_globs"]>;
|
|
8239
|
+
excludeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_globs"]>;
|
|
8240
|
+
allFrames?: import("../../../types").PerBrowserOption<Manifest.ContentScript["all_frames"]>;
|
|
8131
8241
|
matchOriginAsFallback?: boolean | undefined;
|
|
8132
8242
|
cssInjectionMode?: "manifest" | "manual" | "ui" | undefined;
|
|
8133
8243
|
registration?: "manifest" | "runtime" | undefined;
|
|
@@ -8209,13 +8319,13 @@ export declare const fakeBuildStepOutput: (overrides?: {
|
|
|
8209
8319
|
type?: "content-script" | undefined;
|
|
8210
8320
|
options?: {
|
|
8211
8321
|
world?: "ISOLATED" | "MAIN" | undefined;
|
|
8212
|
-
matches?: import("../../../types").PerBrowserOption<
|
|
8213
|
-
runAt?: import("../../../types").PerBrowserOption<
|
|
8214
|
-
matchAboutBlank?: import("../../../types").PerBrowserOption<
|
|
8215
|
-
excludeMatches?: import("../../../types").PerBrowserOption<
|
|
8216
|
-
includeGlobs?: import("../../../types").PerBrowserOption<
|
|
8217
|
-
excludeGlobs?: import("../../../types").PerBrowserOption<
|
|
8218
|
-
allFrames?: import("../../../types").PerBrowserOption<
|
|
8322
|
+
matches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["matches"]>;
|
|
8323
|
+
runAt?: import("../../../types").PerBrowserOption<Manifest.ContentScript["run_at"]>;
|
|
8324
|
+
matchAboutBlank?: import("../../../types").PerBrowserOption<Manifest.ContentScript["match_about_blank"]>;
|
|
8325
|
+
excludeMatches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_matches"]>;
|
|
8326
|
+
includeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["include_globs"]>;
|
|
8327
|
+
excludeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_globs"]>;
|
|
8328
|
+
allFrames?: import("../../../types").PerBrowserOption<Manifest.ContentScript["all_frames"]>;
|
|
8219
8329
|
matchOriginAsFallback?: boolean | undefined;
|
|
8220
8330
|
cssInjectionMode?: "manifest" | "manual" | "ui" | undefined;
|
|
8221
8331
|
registration?: "manifest" | "runtime" | undefined;
|
|
@@ -8316,13 +8426,13 @@ export declare const fakeDevServer: (overrides?: {
|
|
|
8316
8426
|
type?: "content-script" | undefined;
|
|
8317
8427
|
options?: {
|
|
8318
8428
|
world?: "ISOLATED" | "MAIN" | undefined;
|
|
8319
|
-
matches?: import("../../../types").PerBrowserOption<
|
|
8320
|
-
runAt?: import("../../../types").PerBrowserOption<
|
|
8321
|
-
matchAboutBlank?: import("../../../types").PerBrowserOption<
|
|
8322
|
-
excludeMatches?: import("../../../types").PerBrowserOption<
|
|
8323
|
-
includeGlobs?: import("../../../types").PerBrowserOption<
|
|
8324
|
-
excludeGlobs?: import("../../../types").PerBrowserOption<
|
|
8325
|
-
allFrames?: import("../../../types").PerBrowserOption<
|
|
8429
|
+
matches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["matches"]>;
|
|
8430
|
+
runAt?: import("../../../types").PerBrowserOption<Manifest.ContentScript["run_at"]>;
|
|
8431
|
+
matchAboutBlank?: import("../../../types").PerBrowserOption<Manifest.ContentScript["match_about_blank"]>;
|
|
8432
|
+
excludeMatches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_matches"]>;
|
|
8433
|
+
includeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["include_globs"]>;
|
|
8434
|
+
excludeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_globs"]>;
|
|
8435
|
+
allFrames?: import("../../../types").PerBrowserOption<Manifest.ContentScript["all_frames"]>;
|
|
8326
8436
|
matchOriginAsFallback?: boolean | undefined;
|
|
8327
8437
|
cssInjectionMode?: "manifest" | "manual" | "ui" | undefined;
|
|
8328
8438
|
registration?: "manifest" | "runtime" | undefined;
|
|
@@ -8404,13 +8514,13 @@ export declare const fakeDevServer: (overrides?: {
|
|
|
8404
8514
|
type?: "content-script" | undefined;
|
|
8405
8515
|
options?: {
|
|
8406
8516
|
world?: "ISOLATED" | "MAIN" | undefined;
|
|
8407
|
-
matches?: import("../../../types").PerBrowserOption<
|
|
8408
|
-
runAt?: import("../../../types").PerBrowserOption<
|
|
8409
|
-
matchAboutBlank?: import("../../../types").PerBrowserOption<
|
|
8410
|
-
excludeMatches?: import("../../../types").PerBrowserOption<
|
|
8411
|
-
includeGlobs?: import("../../../types").PerBrowserOption<
|
|
8412
|
-
excludeGlobs?: import("../../../types").PerBrowserOption<
|
|
8413
|
-
allFrames?: import("../../../types").PerBrowserOption<
|
|
8517
|
+
matches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["matches"]>;
|
|
8518
|
+
runAt?: import("../../../types").PerBrowserOption<Manifest.ContentScript["run_at"]>;
|
|
8519
|
+
matchAboutBlank?: import("../../../types").PerBrowserOption<Manifest.ContentScript["match_about_blank"]>;
|
|
8520
|
+
excludeMatches?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_matches"]>;
|
|
8521
|
+
includeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["include_globs"]>;
|
|
8522
|
+
excludeGlobs?: import("../../../types").PerBrowserOption<Manifest.ContentScript["exclude_globs"]>;
|
|
8523
|
+
allFrames?: import("../../../types").PerBrowserOption<Manifest.ContentScript["all_frames"]>;
|
|
8414
8524
|
matchOriginAsFallback?: boolean | undefined;
|
|
8415
8525
|
cssInjectionMode?: "manifest" | "manual" | "ui" | undefined;
|
|
8416
8526
|
registration?: "manifest" | "runtime" | undefined;
|
package/dist/core/wxt.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { createHooks } from "hookable";
|
|
|
3
3
|
import { createWxtPackageManager } from "./package-managers/index.mjs";
|
|
4
4
|
import { createViteBuilder } from "./builders/vite/index.mjs";
|
|
5
5
|
import { builtinModules } from "../builtin-modules/index.mjs";
|
|
6
|
+
import { relative } from "path";
|
|
6
7
|
export let wxt;
|
|
7
8
|
export async function registerWxt(command, inlineConfig = {}, getServer) {
|
|
8
9
|
process.env.NODE_ENV ??= command === "serve" ? "development" : "production";
|
|
@@ -36,6 +37,19 @@ export async function registerWxt(command, inlineConfig = {}, getServer) {
|
|
|
36
37
|
for (const builtinModule of builtinModules) await initModule(builtinModule);
|
|
37
38
|
for (const userModule of config.userModules) await initModule(userModule);
|
|
38
39
|
wxt.hooks.addHooks(config.hooks);
|
|
40
|
+
if (wxt.config.debug) {
|
|
41
|
+
const order = [
|
|
42
|
+
...builtinModules.map((module) => module.name),
|
|
43
|
+
...config.userModules.map(
|
|
44
|
+
(module) => relative(wxt.config.root, module.id)
|
|
45
|
+
),
|
|
46
|
+
"wxt.config.ts > hooks"
|
|
47
|
+
];
|
|
48
|
+
wxt.logger.debug("Hook execution order:");
|
|
49
|
+
order.forEach((name, i) => {
|
|
50
|
+
wxt.logger.debug(` ${i + 1}. ${name}`);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
39
53
|
await wxt.hooks.callHook("ready", wxt);
|
|
40
54
|
}
|
|
41
55
|
export function setWxtForTesting(testInstance) {
|
package/dist/core/zip.mjs
CHANGED
|
@@ -17,7 +17,9 @@ export async function zip(config) {
|
|
|
17
17
|
const start = Date.now();
|
|
18
18
|
wxt.logger.info("Zipping extension...");
|
|
19
19
|
const zipFiles = [];
|
|
20
|
-
const projectName = wxt.config.zip.name ?? safeFilename(
|
|
20
|
+
const projectName = wxt.config.zip.name ?? safeFilename(
|
|
21
|
+
(await getPackageJson())?.name || path.basename(process.cwd())
|
|
22
|
+
);
|
|
21
23
|
const applyTemplate = (template) => template.replaceAll("{{name}}", projectName).replaceAll("{{browser}}", wxt.config.browser).replaceAll(
|
|
22
24
|
"{{version}}",
|
|
23
25
|
output.manifest.version_name ?? output.manifest.version
|
package/dist/types.d.ts
CHANGED
|
@@ -52,6 +52,19 @@ export interface InlineConfig {
|
|
|
52
52
|
* @default ".output"
|
|
53
53
|
*/
|
|
54
54
|
outDir?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Template string for customizing the output directory structure.
|
|
57
|
+
* Available variables:
|
|
58
|
+
* - <span v-pre>`{{browser}}`</span>: The target browser (e.g., 'chrome', 'firefox')
|
|
59
|
+
* - <span v-pre>`{{manifestVersion}}`</span>: The manifest version (e.g., 2 or 3)
|
|
60
|
+
* - <span v-pre>`{{mode}}`</span>: The build mode (e.g., 'development', 'production')
|
|
61
|
+
* - <span v-pre>`{{modeSuffix}}`</span>: A suffix based on the mode ('-dev' for development, '' for production)
|
|
62
|
+
* - <span v-pre>`{{command}}`</span>: The WXT command being run (e.g., 'build', 'serve')
|
|
63
|
+
*
|
|
64
|
+
* @example "{{browser}}-mv{{manifestVersion}}{{modeSuffix}}"
|
|
65
|
+
* @default <span v-pre>`"{{browser}}-mv{{manifestVersion}}"`</span>
|
|
66
|
+
*/
|
|
67
|
+
outDirTemplate?: string;
|
|
55
68
|
/**
|
|
56
69
|
* > Only available when using the JS API. Not available in `wxt.config.ts` files
|
|
57
70
|
*
|
|
@@ -61,7 +74,7 @@ export interface InlineConfig {
|
|
|
61
74
|
*/
|
|
62
75
|
configFile?: string | false;
|
|
63
76
|
/**
|
|
64
|
-
* Set to `true` to show debug logs.
|
|
77
|
+
* Set to `true` to show debug logs. Overridden by the command line `--debug` option.
|
|
65
78
|
*
|
|
66
79
|
* @default false
|
|
67
80
|
*/
|
|
@@ -314,7 +327,7 @@ export interface InlineConfig {
|
|
|
314
327
|
* Which extension API to use.
|
|
315
328
|
*
|
|
316
329
|
* - `"webextension-polyfill"`: Use `browser` and types from [`webextension-polyfill`](https://www.npmjs.com/package/webextension-polyfill).
|
|
317
|
-
* - `"chrome"
|
|
330
|
+
* - `"chrome"`: Use the regular `chrome` (or `browser` for Firefox/Safari) globals provided by the browser. Types provided by [`@types/chrome`](https://www.npmjs.com/package/@types/chrome).
|
|
318
331
|
*
|
|
319
332
|
* @default "webextension-polyfill"
|
|
320
333
|
* @since 0.19.0
|
|
@@ -1109,7 +1122,7 @@ export interface Wxt {
|
|
|
1109
1122
|
*/
|
|
1110
1123
|
pm: WxtPackageManager;
|
|
1111
1124
|
/**
|
|
1112
|
-
* If the dev server was started, it will be
|
|
1125
|
+
* If the dev server was started, it will be available.
|
|
1113
1126
|
*/
|
|
1114
1127
|
server?: WxtDevServer;
|
|
1115
1128
|
/**
|
package/dist/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "0.19.
|
|
1
|
+
export const version = "0.19.13";
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.19.
|
|
4
|
+
"version": "0.19.13",
|
|
5
5
|
"description": "Next gen framework for developing web extensions",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/wxt-dev/wxt"
|
|
8
|
+
"url": "git+https://github.com/wxt-dev/wxt.git"
|
|
9
9
|
},
|
|
10
10
|
"homepage": "https://wxt.dev",
|
|
11
11
|
"keywords": [
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@webext-core/isolated-element": "^1.1.2",
|
|
78
78
|
"@webext-core/match-patterns": "^1.0.3",
|
|
79
79
|
"async-mutex": "^0.5.0",
|
|
80
|
-
"c12": "^1.11.
|
|
80
|
+
"c12": "^1.11.2",
|
|
81
81
|
"cac": "^6.7.14",
|
|
82
82
|
"chokidar": "^3.6.0",
|
|
83
83
|
"ci-info": "^4.0.0",
|
|
@@ -85,10 +85,9 @@
|
|
|
85
85
|
"defu": "^6.1.4",
|
|
86
86
|
"dequal": "^2.0.3",
|
|
87
87
|
"dotenv": "^16.4.5",
|
|
88
|
-
"esbuild": "^0.
|
|
89
|
-
"execa": "^9.3.1",
|
|
88
|
+
"esbuild": "^0.21.5",
|
|
90
89
|
"fast-glob": "^3.3.2",
|
|
91
|
-
"filesize": "^10.1.
|
|
90
|
+
"filesize": "^10.1.6",
|
|
92
91
|
"fs-extra": "^11.2.0",
|
|
93
92
|
"get-port": "^7.1.0",
|
|
94
93
|
"giget": "^1.2.3",
|
|
@@ -97,23 +96,23 @@
|
|
|
97
96
|
"jiti": "^1.21.6",
|
|
98
97
|
"json5": "^2.2.3",
|
|
99
98
|
"jszip": "^3.10.1",
|
|
100
|
-
"linkedom": "^0.18.
|
|
101
|
-
"magicast": "^0.3.
|
|
99
|
+
"linkedom": "^0.18.5",
|
|
100
|
+
"magicast": "^0.3.5",
|
|
102
101
|
"minimatch": "^10.0.1",
|
|
103
|
-
"
|
|
102
|
+
"nano-spawn": "^0.1.0",
|
|
104
103
|
"normalize-path": "^3.0.0",
|
|
105
|
-
"nypm": "^0.3.
|
|
106
|
-
"ohash": "^1.1.
|
|
104
|
+
"nypm": "^0.3.12",
|
|
105
|
+
"ohash": "^1.1.4",
|
|
107
106
|
"open": "^10.1.0",
|
|
108
107
|
"ora": "^8.1.0",
|
|
109
108
|
"perfect-debounce": "^1.0.0",
|
|
110
|
-
"picocolors": "^1.0
|
|
109
|
+
"picocolors": "^1.1.0",
|
|
111
110
|
"prompts": "^2.4.2",
|
|
112
|
-
"publish-browser-extension": "^2.
|
|
111
|
+
"publish-browser-extension": "^2.2.2",
|
|
113
112
|
"scule": "^1.3.0",
|
|
114
|
-
"unimport": "^3.
|
|
115
|
-
"vite": "^5.
|
|
116
|
-
"vite-node": "^2.
|
|
113
|
+
"unimport": "^3.13.1",
|
|
114
|
+
"vite": "^5.4.8",
|
|
115
|
+
"vite-node": "^2.1.2",
|
|
117
116
|
"web-ext-run": "^0.2.1",
|
|
118
117
|
"webextension-polyfill": "^0.12.0"
|
|
119
118
|
},
|
|
@@ -122,20 +121,18 @@
|
|
|
122
121
|
"@faker-js/faker": "^8.4.1",
|
|
123
122
|
"@types/fs-extra": "^11.0.4",
|
|
124
123
|
"@types/lodash.merge": "^4.6.9",
|
|
125
|
-
"@types/
|
|
126
|
-
"@types/node": "^20.14.12",
|
|
124
|
+
"@types/node": "^20.16.10",
|
|
127
125
|
"@types/normalize-path": "^3.0.2",
|
|
128
126
|
"@types/prompts": "^2.4.9",
|
|
129
127
|
"extract-zip": "^2.0.1",
|
|
130
128
|
"happy-dom": "^14.12.3",
|
|
131
129
|
"lodash.merge": "^4.6.2",
|
|
132
|
-
"oxlint": "^0.9.
|
|
133
|
-
"
|
|
134
|
-
"publint": "^0.2.9",
|
|
130
|
+
"oxlint": "^0.9.9",
|
|
131
|
+
"publint": "^0.2.11",
|
|
135
132
|
"tsx": "4.15.7",
|
|
136
|
-
"typescript": "^5.
|
|
133
|
+
"typescript": "^5.6.2",
|
|
137
134
|
"unbuild": "^2.0.0",
|
|
138
|
-
"vitest": "^2.
|
|
135
|
+
"vitest": "^2.1.2",
|
|
139
136
|
"vitest-plugin-random-seed": "^1.1.0"
|
|
140
137
|
},
|
|
141
138
|
"peerDependenciesMeta": {
|
|
@@ -146,7 +143,7 @@
|
|
|
146
143
|
"scripts": {
|
|
147
144
|
"wxt": "tsx src/cli/index.ts",
|
|
148
145
|
"build": "buildc -- unbuild",
|
|
149
|
-
"check": "pnpm build && run
|
|
146
|
+
"check": "pnpm build && pnpm run --reporter-hide-prefix /^check:.*/",
|
|
150
147
|
"check:default": "check",
|
|
151
148
|
"check:tsc-virtual": "tsc --noEmit -p src/virtual",
|
|
152
149
|
"test": "buildc --deps-only -- vitest",
|