wxt 0.14.1 → 0.14.2-alpha2
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/dist/chunk-JPUPWTMG.js +7 -0
- package/dist/{chunk-B7XRXAP5.js → chunk-Y6R4JWTX.js} +246 -106
- package/dist/cli.js +263 -121
- package/dist/{external-tVP-84Pg.d.cts → external-d6JYvU3i.d.cts} +6 -0
- package/dist/{external-tVP-84Pg.d.ts → external-d6JYvU3i.d.ts} +6 -0
- package/dist/i18n.cjs +69 -0
- package/dist/i18n.d.cts +30 -0
- package/dist/i18n.d.ts +30 -0
- package/dist/i18n.js +33 -0
- package/dist/index.cjs +302 -160
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -1
- package/dist/storage.js +3 -4
- package/dist/testing.cjs +23 -13
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +12 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './external-
|
|
2
|
-
export { q as BackgroundDefinition, h as BackgroundEntrypoint, g as BaseEntrypoint, f as BaseEntrypointOptions, d as BuildStepOutput, w as ConfigEnv, p as ContentScriptBaseDefinition, m as ContentScriptDefinition, C as ContentScriptEntrypoint, n as ContentScriptIsolatedWorldDefinition, o as ContentScriptMainWorldDefinition, j as Entrypoint, k as EntrypointGroup, t as ExcludableEntrypoint, G as GenericEntrypoint, L as Logger, l as OnContentScriptStopped, i as OptionsEntrypoint, c as OutputAsset, b as OutputChunk, O as OutputFile, s as PerBrowserOption, P as PopupEntrypoint, S as ServerInfo, T as TargetBrowser, e as TargetManifestVersion, r as UnlistedScriptDefinition, u as UserManifest, v as UserManifestFn, x as WxtBuilder, y as WxtBuilderServer, a as WxtViteConfig } from './external-
|
|
1
|
+
import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './external-d6JYvU3i.cjs';
|
|
2
|
+
export { q as BackgroundDefinition, h as BackgroundEntrypoint, g as BaseEntrypoint, f as BaseEntrypointOptions, d as BuildStepOutput, w as ConfigEnv, p as ContentScriptBaseDefinition, m as ContentScriptDefinition, C as ContentScriptEntrypoint, n as ContentScriptIsolatedWorldDefinition, o as ContentScriptMainWorldDefinition, j as Entrypoint, k as EntrypointGroup, t as ExcludableEntrypoint, G as GenericEntrypoint, L as Logger, l as OnContentScriptStopped, i as OptionsEntrypoint, c as OutputAsset, b as OutputChunk, O as OutputFile, s as PerBrowserOption, P as PopupEntrypoint, S as ServerInfo, T as TargetBrowser, e as TargetManifestVersion, r as UnlistedScriptDefinition, u as UserManifest, v as UserManifestFn, x as WxtBuilder, y as WxtBuilderServer, a as WxtViteConfig } from './external-d6JYvU3i.cjs';
|
|
3
3
|
import 'vite';
|
|
4
4
|
import 'webextension-polyfill';
|
|
5
5
|
import 'unimport';
|
|
@@ -62,6 +62,6 @@ declare function prepare(config: InlineConfig): Promise<void>;
|
|
|
62
62
|
*/
|
|
63
63
|
declare function zip(config?: InlineConfig): Promise<string[]>;
|
|
64
64
|
|
|
65
|
-
var version = "0.14.
|
|
65
|
+
var version = "0.14.2-alpha2";
|
|
66
66
|
|
|
67
67
|
export { BuildOutput, ExtensionRunnerConfig, InlineConfig, UserConfig, WxtDevServer, build, clean, createServer, defineConfig, defineRunnerConfig, initialize, prepare, version, zip };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './external-
|
|
2
|
-
export { q as BackgroundDefinition, h as BackgroundEntrypoint, g as BaseEntrypoint, f as BaseEntrypointOptions, d as BuildStepOutput, w as ConfigEnv, p as ContentScriptBaseDefinition, m as ContentScriptDefinition, C as ContentScriptEntrypoint, n as ContentScriptIsolatedWorldDefinition, o as ContentScriptMainWorldDefinition, j as Entrypoint, k as EntrypointGroup, t as ExcludableEntrypoint, G as GenericEntrypoint, L as Logger, l as OnContentScriptStopped, i as OptionsEntrypoint, c as OutputAsset, b as OutputChunk, O as OutputFile, s as PerBrowserOption, P as PopupEntrypoint, S as ServerInfo, T as TargetBrowser, e as TargetManifestVersion, r as UnlistedScriptDefinition, u as UserManifest, v as UserManifestFn, x as WxtBuilder, y as WxtBuilderServer, a as WxtViteConfig } from './external-
|
|
1
|
+
import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './external-d6JYvU3i.js';
|
|
2
|
+
export { q as BackgroundDefinition, h as BackgroundEntrypoint, g as BaseEntrypoint, f as BaseEntrypointOptions, d as BuildStepOutput, w as ConfigEnv, p as ContentScriptBaseDefinition, m as ContentScriptDefinition, C as ContentScriptEntrypoint, n as ContentScriptIsolatedWorldDefinition, o as ContentScriptMainWorldDefinition, j as Entrypoint, k as EntrypointGroup, t as ExcludableEntrypoint, G as GenericEntrypoint, L as Logger, l as OnContentScriptStopped, i as OptionsEntrypoint, c as OutputAsset, b as OutputChunk, O as OutputFile, s as PerBrowserOption, P as PopupEntrypoint, S as ServerInfo, T as TargetBrowser, e as TargetManifestVersion, r as UnlistedScriptDefinition, u as UserManifest, v as UserManifestFn, x as WxtBuilder, y as WxtBuilderServer, a as WxtViteConfig } from './external-d6JYvU3i.js';
|
|
3
3
|
import 'vite';
|
|
4
4
|
import 'webextension-polyfill';
|
|
5
5
|
import 'unimport';
|
|
@@ -62,6 +62,6 @@ declare function prepare(config: InlineConfig): Promise<void>;
|
|
|
62
62
|
*/
|
|
63
63
|
declare function zip(config?: InlineConfig): Promise<string[]>;
|
|
64
64
|
|
|
65
|
-
var version = "0.14.
|
|
65
|
+
var version = "0.14.2-alpha2";
|
|
66
66
|
|
|
67
67
|
export { BuildOutput, ExtensionRunnerConfig, InlineConfig, UserConfig, WxtDevServer, build, clean, createServer, defineConfig, defineRunnerConfig, initialize, prepare, version, zip };
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
rebuild,
|
|
16
16
|
resolvePerBrowserOption,
|
|
17
17
|
version
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-Y6R4JWTX.js";
|
|
19
19
|
import "./chunk-VBXJIVYU.js";
|
|
20
20
|
|
|
21
21
|
// src/core/build.ts
|
|
@@ -288,8 +288,10 @@ function createFileReloader(options) {
|
|
|
288
288
|
relative4(config.outDir, getEntrypointOutputFile(entry, ""))
|
|
289
289
|
);
|
|
290
290
|
}).join(pc2.dim(", "));
|
|
291
|
+
const allEntrypoints = await findEntrypoints(config);
|
|
291
292
|
const { output: newOutput } = await rebuild(
|
|
292
293
|
config,
|
|
294
|
+
allEntrypoints,
|
|
293
295
|
// TODO: this excludes new entrypoints, so they're not built until the dev command is restarted
|
|
294
296
|
changes.rebuildGroups,
|
|
295
297
|
changes.cachedOutput
|
package/dist/storage.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
browser
|
|
3
|
+
} from "./chunk-JPUPWTMG.js";
|
|
1
4
|
import "./chunk-VBXJIVYU.js";
|
|
2
5
|
|
|
3
|
-
// src/browser.ts
|
|
4
|
-
import originalBrowser from "webextension-polyfill";
|
|
5
|
-
var browser = originalBrowser;
|
|
6
|
-
|
|
7
6
|
// src/storage.ts
|
|
8
7
|
import { dequal } from "dequal/lite";
|
|
9
8
|
var storage = createStorage();
|
package/dist/testing.cjs
CHANGED
|
@@ -44,8 +44,8 @@ var import_node_path2 = __toESM(require("path"), 1);
|
|
|
44
44
|
// src/core/utils/paths.ts
|
|
45
45
|
var import_node_path = __toESM(require("path"), 1);
|
|
46
46
|
var import_normalize_path = __toESM(require("normalize-path"), 1);
|
|
47
|
-
function normalizePath(
|
|
48
|
-
return (0, import_normalize_path.default)(
|
|
47
|
+
function normalizePath(path5) {
|
|
48
|
+
return (0, import_normalize_path.default)(path5);
|
|
49
49
|
}
|
|
50
50
|
var CSS_EXTENSIONS = ["css", "scss", "sass", "less", "styl", "stylus"];
|
|
51
51
|
var CSS_EXTENSIONS_PATTERN = `+(${CSS_EXTENSIONS.join("|")})`;
|
|
@@ -337,7 +337,8 @@ function getUnimportOptions(config) {
|
|
|
337
337
|
debugLog: config.logger.debug,
|
|
338
338
|
imports: [
|
|
339
339
|
{ name: "defineConfig", from: "wxt" },
|
|
340
|
-
{ name: "fakeBrowser", from: "wxt/testing" }
|
|
340
|
+
{ name: "fakeBrowser", from: "wxt/testing" },
|
|
341
|
+
{ name: "i18n", from: "wxt/i18n" }
|
|
341
342
|
],
|
|
342
343
|
presets: [
|
|
343
344
|
{ package: "wxt/client" },
|
|
@@ -635,13 +636,19 @@ async function writeFileIfDifferent(file, newContents) {
|
|
|
635
636
|
|
|
636
637
|
// src/core/utils/building/build-entrypoints.ts
|
|
637
638
|
var import_fs_extra4 = __toESM(require("fs-extra"), 1);
|
|
639
|
+
var import_node_path6 = require("path");
|
|
638
640
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
639
641
|
|
|
642
|
+
// src/i18n/node.ts
|
|
643
|
+
var import_promises = require("fs/promises");
|
|
644
|
+
var import_json5 = __toESM(require("json5"), 1);
|
|
645
|
+
var import_yaml = __toESM(require("yaml"), 1);
|
|
646
|
+
|
|
640
647
|
// src/core/utils/building/find-entrypoints.ts
|
|
641
648
|
var import_fs_extra5 = __toESM(require("fs-extra"), 1);
|
|
642
649
|
var import_minimatch = require("minimatch");
|
|
643
650
|
var import_linkedom2 = require("linkedom");
|
|
644
|
-
var
|
|
651
|
+
var import_json52 = __toESM(require("json5"), 1);
|
|
645
652
|
var import_fast_glob2 = __toESM(require("fast-glob"), 1);
|
|
646
653
|
var PATH_GLOB_TO_TYPE_MAP = {
|
|
647
654
|
"sandbox.html": "sandbox",
|
|
@@ -686,7 +693,7 @@ var PATH_GLOB_TO_TYPE_MAP = {
|
|
|
686
693
|
// src/core/utils/building/generate-wxt-dir.ts
|
|
687
694
|
var import_unimport3 = require("unimport");
|
|
688
695
|
var import_fs_extra6 = __toESM(require("fs-extra"), 1);
|
|
689
|
-
var
|
|
696
|
+
var import_fast_glob3 = __toESM(require("fast-glob"), 1);
|
|
690
697
|
|
|
691
698
|
// src/core/utils/building/get-internal-config.ts
|
|
692
699
|
var import_c12 = require("c12");
|
|
@@ -699,14 +706,14 @@ function createFsCache(wxtDir) {
|
|
|
699
706
|
const getPath = (key) => (0, import_path3.resolve)(wxtDir, "cache", encodeURIComponent(key));
|
|
700
707
|
return {
|
|
701
708
|
async set(key, value) {
|
|
702
|
-
const
|
|
703
|
-
await (0, import_fs_extra7.ensureDir)((0, import_path3.dirname)(
|
|
704
|
-
await writeFileIfDifferent(
|
|
709
|
+
const path5 = getPath(key);
|
|
710
|
+
await (0, import_fs_extra7.ensureDir)((0, import_path3.dirname)(path5));
|
|
711
|
+
await writeFileIfDifferent(path5, value);
|
|
705
712
|
},
|
|
706
713
|
async get(key) {
|
|
707
|
-
const
|
|
714
|
+
const path5 = getPath(key);
|
|
708
715
|
try {
|
|
709
|
-
return await import_fs_extra7.default.readFile(
|
|
716
|
+
return await import_fs_extra7.default.readFile(path5, "utf-8");
|
|
710
717
|
} catch {
|
|
711
718
|
return void 0;
|
|
712
719
|
}
|
|
@@ -718,7 +725,7 @@ function createFsCache(wxtDir) {
|
|
|
718
725
|
var import_consola = __toESM(require("consola"), 1);
|
|
719
726
|
|
|
720
727
|
// src/core/builders/vite/index.ts
|
|
721
|
-
async function
|
|
728
|
+
async function createViteBuilder(inlineConfig, userConfig, wxtConfig) {
|
|
722
729
|
const vite = await import("vite");
|
|
723
730
|
const getBaseConfig = async () => {
|
|
724
731
|
const resolvedInlineConfig = await inlineConfig.vite?.(wxtConfig.env) ?? {};
|
|
@@ -956,6 +963,7 @@ async function getInternalConfig(inlineConfig, command, server) {
|
|
|
956
963
|
mergedConfig.entrypointsDir ?? "entrypoints"
|
|
957
964
|
);
|
|
958
965
|
const publicDir = import_node_path7.default.resolve(srcDir, mergedConfig.publicDir ?? "public");
|
|
966
|
+
const localesDir = import_node_path7.default.resolve(srcDir, mergedConfig.localesDir ?? "locales");
|
|
959
967
|
const typesDir = import_node_path7.default.resolve(wxtDir, "types");
|
|
960
968
|
const outBaseDir = import_node_path7.default.resolve(root, mergedConfig.outDir ?? ".output");
|
|
961
969
|
const outDir = import_node_path7.default.resolve(outBaseDir, `${browser}-mv${manifestVersion}`);
|
|
@@ -991,6 +999,7 @@ async function getInternalConfig(inlineConfig, command, server) {
|
|
|
991
999
|
outBaseDir,
|
|
992
1000
|
outDir,
|
|
993
1001
|
publicDir,
|
|
1002
|
+
localesDir,
|
|
994
1003
|
root,
|
|
995
1004
|
runnerConfig,
|
|
996
1005
|
srcDir,
|
|
@@ -1012,7 +1021,7 @@ async function getInternalConfig(inlineConfig, command, server) {
|
|
|
1012
1021
|
},
|
|
1013
1022
|
server
|
|
1014
1023
|
};
|
|
1015
|
-
const builder = await
|
|
1024
|
+
const builder = await createViteBuilder(
|
|
1016
1025
|
inlineConfig,
|
|
1017
1026
|
userConfig,
|
|
1018
1027
|
finalConfig
|
|
@@ -1059,6 +1068,7 @@ function mergeInlineConfig(inlineConfig, userConfig) {
|
|
|
1059
1068
|
manifest,
|
|
1060
1069
|
mode: inlineConfig.mode ?? userConfig.mode,
|
|
1061
1070
|
publicDir: inlineConfig.publicDir ?? userConfig.publicDir,
|
|
1071
|
+
localesDir: inlineConfig.localesDir ?? userConfig.localesDir,
|
|
1062
1072
|
runner,
|
|
1063
1073
|
srcDir: inlineConfig.srcDir ?? userConfig.srcDir,
|
|
1064
1074
|
outDir: inlineConfig.outDir ?? userConfig.outDir,
|
|
@@ -1136,7 +1146,7 @@ var import_picocolors3 = __toESM(require("picocolors"), 1);
|
|
|
1136
1146
|
var import_consola2 = require("consola");
|
|
1137
1147
|
|
|
1138
1148
|
// src/core/utils/building/internal-build.ts
|
|
1139
|
-
var
|
|
1149
|
+
var import_fast_glob4 = __toESM(require("fast-glob"), 1);
|
|
1140
1150
|
|
|
1141
1151
|
// src/core/utils/manifest.ts
|
|
1142
1152
|
var import_fs_extra11 = __toESM(require("fs-extra"), 1);
|
package/dist/testing.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { FakeBrowser, fakeBrowser } from '@webext-core/fake-browser';
|
|
2
2
|
import * as vite from 'vite';
|
|
3
|
-
import { I as InlineConfig } from './external-
|
|
3
|
+
import { I as InlineConfig } from './external-d6JYvU3i.cjs';
|
|
4
4
|
import 'webextension-polyfill';
|
|
5
5
|
import 'unimport';
|
|
6
6
|
import 'consola';
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { FakeBrowser, fakeBrowser } from '@webext-core/fake-browser';
|
|
2
2
|
import * as vite from 'vite';
|
|
3
|
-
import { I as InlineConfig } from './external-
|
|
3
|
+
import { I as InlineConfig } from './external-d6JYvU3i.js';
|
|
4
4
|
import 'webextension-polyfill';
|
|
5
5
|
import 'unimport';
|
|
6
6
|
import 'consola';
|
package/dist/testing.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.2-alpha2",
|
|
5
5
|
"description": "Next gen framework for developing web extensions",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=18",
|
|
@@ -77,6 +77,16 @@
|
|
|
77
77
|
"default": "./dist/storage.cjs"
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
|
+
"./i18n": {
|
|
81
|
+
"import": {
|
|
82
|
+
"types": "./dist/i18n.d.ts",
|
|
83
|
+
"default": "./dist/i18n.js"
|
|
84
|
+
},
|
|
85
|
+
"require": {
|
|
86
|
+
"types": "./dist/i18n.d.cts",
|
|
87
|
+
"default": "./dist/i18n.cjs"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
80
90
|
"./vite-builder-env": {
|
|
81
91
|
"types": "./dist/vite-builder-env.d.ts"
|
|
82
92
|
}
|
|
@@ -114,6 +124,7 @@
|
|
|
114
124
|
"vite": "^5.0.0",
|
|
115
125
|
"web-ext-run": "^0.1.0",
|
|
116
126
|
"webextension-polyfill": "^0.10.0",
|
|
127
|
+
"yaml": "^2.3.4",
|
|
117
128
|
"zip-dir": "^2.0.0"
|
|
118
129
|
},
|
|
119
130
|
"devDependencies": {
|