wxt 0.17.7 → 0.17.9
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 +2 -2
- package/dist/{chunk-QFL6IFHC.js → chunk-ONUEB57P.js} +52 -79
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +97 -107
- package/dist/client.d.ts +1 -1
- package/dist/{index-l43sonfW.d.cts → index-mZodC81T.d.cts} +25 -12
- package/dist/{index-l43sonfW.d.ts → index-mZodC81T.d.ts} +25 -12
- package/dist/index.cjs +92 -105
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +41 -27
- package/dist/testing.cjs +40 -77
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +4 -1
package/dist/testing.cjs
CHANGED
|
@@ -1008,7 +1008,7 @@ async function resolveConfig(inlineConfig, command, server) {
|
|
|
1008
1008
|
logger.level = import_consola.LogLevels.debug;
|
|
1009
1009
|
const browser = mergedConfig.browser ?? "chrome";
|
|
1010
1010
|
const manifestVersion = mergedConfig.manifestVersion ?? (browser === "firefox" || browser === "safari" ? 2 : 3);
|
|
1011
|
-
const mode = mergedConfig.mode ??
|
|
1011
|
+
const mode = mergedConfig.mode ?? COMMAND_MODES[command];
|
|
1012
1012
|
const env = { browser, command, manifestVersion, mode };
|
|
1013
1013
|
const root = import_node_path10.default.resolve(
|
|
1014
1014
|
inlineConfig.root ?? userConfig.root ?? process.cwd()
|
|
@@ -1049,12 +1049,6 @@ async function resolveConfig(inlineConfig, command, server) {
|
|
|
1049
1049
|
"~~": root
|
|
1050
1050
|
}).map(([key, value]) => [key, import_node_path10.default.resolve(root, value)])
|
|
1051
1051
|
);
|
|
1052
|
-
const analysisOutputFile = import_node_path10.default.resolve(
|
|
1053
|
-
root,
|
|
1054
|
-
mergedConfig.analysis?.outputFile ?? "stats.html"
|
|
1055
|
-
);
|
|
1056
|
-
const analysisOutputDir = import_node_path10.default.dirname(analysisOutputFile);
|
|
1057
|
-
const analysisOutputName = import_node_path10.default.parse(analysisOutputFile).name;
|
|
1058
1052
|
const finalConfig = {
|
|
1059
1053
|
browser,
|
|
1060
1054
|
command,
|
|
@@ -1077,24 +1071,14 @@ async function resolveConfig(inlineConfig, command, server) {
|
|
|
1077
1071
|
srcDir,
|
|
1078
1072
|
typesDir,
|
|
1079
1073
|
wxtDir,
|
|
1080
|
-
zip:
|
|
1081
|
-
transformManifest
|
|
1082
|
-
|
|
1083
|
-
inlineConfig.transformManifest?.(manifest);
|
|
1084
|
-
},
|
|
1085
|
-
analysis: {
|
|
1086
|
-
enabled: mergedConfig.analysis?.enabled ?? false,
|
|
1087
|
-
template: mergedConfig.analysis?.template ?? "treemap",
|
|
1088
|
-
outputFile: analysisOutputFile,
|
|
1089
|
-
outputDir: analysisOutputDir,
|
|
1090
|
-
outputName: analysisOutputName,
|
|
1091
|
-
keepArtifacts: mergedConfig.analysis?.keepArtifacts ?? false
|
|
1092
|
-
},
|
|
1074
|
+
zip: resolveZipConfig(root, mergedConfig),
|
|
1075
|
+
transformManifest: mergedConfig.transformManifest,
|
|
1076
|
+
analysis: resolveAnalysisConfig(root, mergedConfig),
|
|
1093
1077
|
userConfigMetadata: userConfigMetadata ?? {},
|
|
1094
1078
|
alias,
|
|
1095
|
-
experimental: {
|
|
1096
|
-
includeBrowserPolyfill:
|
|
1097
|
-
},
|
|
1079
|
+
experimental: (0, import_defu.default)(mergedConfig.experimental, {
|
|
1080
|
+
includeBrowserPolyfill: true
|
|
1081
|
+
}),
|
|
1098
1082
|
server,
|
|
1099
1083
|
dev: {
|
|
1100
1084
|
reloadCommand
|
|
@@ -1115,70 +1099,27 @@ async function resolveManifestConfig(env, manifest) {
|
|
|
1115
1099
|
return await (typeof manifest === "function" ? manifest(env) : manifest ?? {});
|
|
1116
1100
|
}
|
|
1117
1101
|
function mergeInlineConfig(inlineConfig, userConfig) {
|
|
1118
|
-
|
|
1119
|
-
if (inlineConfig.imports === false || userConfig.imports === false) {
|
|
1120
|
-
imports = false;
|
|
1121
|
-
} else if (userConfig.imports == null && inlineConfig.imports == null) {
|
|
1122
|
-
imports = void 0;
|
|
1123
|
-
} else {
|
|
1124
|
-
imports = (0, import_defu.default)(inlineConfig.imports ?? {}, userConfig.imports ?? {});
|
|
1125
|
-
}
|
|
1102
|
+
const imports = inlineConfig.imports === false || userConfig.imports === false ? false : userConfig.imports == null && inlineConfig.imports == null ? void 0 : (0, import_defu.default)(inlineConfig.imports ?? {}, userConfig.imports ?? {});
|
|
1126
1103
|
const manifest = async (env) => {
|
|
1127
1104
|
const user = await resolveManifestConfig(env, userConfig.manifest);
|
|
1128
1105
|
const inline = await resolveManifestConfig(env, inlineConfig.manifest);
|
|
1129
1106
|
return (0, import_defu.default)(inline, user);
|
|
1130
1107
|
};
|
|
1131
|
-
const
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
const zip = (0, import_defu.default)(
|
|
1136
|
-
inlineConfig.zip ?? {},
|
|
1137
|
-
userConfig.zip ?? {}
|
|
1138
|
-
);
|
|
1139
|
-
const hooks = (0, import_defu.default)(
|
|
1140
|
-
inlineConfig.hooks ?? {},
|
|
1141
|
-
userConfig.hooks ?? {}
|
|
1142
|
-
);
|
|
1108
|
+
const transformManifest = (manifest2) => {
|
|
1109
|
+
userConfig.transformManifest?.(manifest2);
|
|
1110
|
+
inlineConfig.transformManifest?.(manifest2);
|
|
1111
|
+
};
|
|
1143
1112
|
return {
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
configFile: inlineConfig.configFile,
|
|
1148
|
-
debug: inlineConfig.debug ?? userConfig.debug,
|
|
1149
|
-
entrypointsDir: inlineConfig.entrypointsDir ?? userConfig.entrypointsDir,
|
|
1150
|
-
filterEntrypoints: inlineConfig.filterEntrypoints ?? userConfig.filterEntrypoints,
|
|
1113
|
+
...(0, import_defu.default)(inlineConfig, userConfig),
|
|
1114
|
+
// Custom merge values
|
|
1115
|
+
transformManifest,
|
|
1151
1116
|
imports,
|
|
1152
|
-
logger: inlineConfig.logger ?? userConfig.logger,
|
|
1153
1117
|
manifest,
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
runner,
|
|
1157
|
-
srcDir: inlineConfig.srcDir ?? userConfig.srcDir,
|
|
1158
|
-
outDir: inlineConfig.outDir ?? userConfig.outDir,
|
|
1159
|
-
zip,
|
|
1160
|
-
analysis: {
|
|
1161
|
-
...userConfig.analysis,
|
|
1162
|
-
...inlineConfig.analysis
|
|
1163
|
-
},
|
|
1164
|
-
alias: {
|
|
1165
|
-
...userConfig.alias,
|
|
1166
|
-
...inlineConfig.alias
|
|
1167
|
-
},
|
|
1168
|
-
experimental: {
|
|
1169
|
-
...userConfig.experimental,
|
|
1170
|
-
...inlineConfig.experimental
|
|
1171
|
-
},
|
|
1172
|
-
vite: void 0,
|
|
1173
|
-
transformManifest: void 0,
|
|
1174
|
-
dev: {
|
|
1175
|
-
...userConfig.dev,
|
|
1176
|
-
...inlineConfig.dev
|
|
1177
|
-
},
|
|
1178
|
-
hooks
|
|
1118
|
+
// Vite builder handles merging vite config internally
|
|
1119
|
+
vite: void 0
|
|
1179
1120
|
};
|
|
1180
1121
|
}
|
|
1181
|
-
function
|
|
1122
|
+
function resolveZipConfig(root, mergedConfig) {
|
|
1182
1123
|
const downloadedPackagesDir = import_node_path10.default.resolve(root, ".wxt/local_modules");
|
|
1183
1124
|
return {
|
|
1184
1125
|
name: void 0,
|
|
@@ -1203,6 +1144,23 @@ function resolveInternalZipConfig(root, mergedConfig) {
|
|
|
1203
1144
|
downloadedPackagesDir
|
|
1204
1145
|
};
|
|
1205
1146
|
}
|
|
1147
|
+
function resolveAnalysisConfig(root, mergedConfig) {
|
|
1148
|
+
const analysisOutputFile = import_node_path10.default.resolve(
|
|
1149
|
+
root,
|
|
1150
|
+
mergedConfig.analysis?.outputFile ?? "stats.html"
|
|
1151
|
+
);
|
|
1152
|
+
const analysisOutputDir = import_node_path10.default.dirname(analysisOutputFile);
|
|
1153
|
+
const analysisOutputName = import_node_path10.default.parse(analysisOutputFile).name;
|
|
1154
|
+
return {
|
|
1155
|
+
enabled: mergedConfig.analysis?.enabled ?? false,
|
|
1156
|
+
open: mergedConfig.analysis?.open ?? false,
|
|
1157
|
+
template: mergedConfig.analysis?.template ?? "treemap",
|
|
1158
|
+
outputFile: analysisOutputFile,
|
|
1159
|
+
outputDir: analysisOutputDir,
|
|
1160
|
+
outputName: analysisOutputName,
|
|
1161
|
+
keepArtifacts: mergedConfig.analysis?.keepArtifacts ?? false
|
|
1162
|
+
};
|
|
1163
|
+
}
|
|
1206
1164
|
async function getUnimportOptions(wxtDir, logger, config) {
|
|
1207
1165
|
if (config.imports === false)
|
|
1208
1166
|
return false;
|
|
@@ -1255,6 +1213,10 @@ function logMissingDir(logger, name, expected) {
|
|
|
1255
1213
|
)}`
|
|
1256
1214
|
);
|
|
1257
1215
|
}
|
|
1216
|
+
var COMMAND_MODES = {
|
|
1217
|
+
build: "production",
|
|
1218
|
+
serve: "development"
|
|
1219
|
+
};
|
|
1258
1220
|
|
|
1259
1221
|
// src/core/utils/building/import-entrypoint.ts
|
|
1260
1222
|
var import_jiti = __toESM(require("jiti"), 1);
|
|
@@ -1301,6 +1263,7 @@ var import_defu2 = __toESM(require("defu"), 1);
|
|
|
1301
1263
|
var import_node_path13 = require("path");
|
|
1302
1264
|
var import_consola3 = __toESM(require("consola"), 1);
|
|
1303
1265
|
var import_rollup_plugin_visualizer2 = require("@aklinker1/rollup-plugin-visualizer");
|
|
1266
|
+
var import_ci_info = require("ci-info");
|
|
1304
1267
|
|
|
1305
1268
|
// src/testing/wxt-vitest-plugin.ts
|
|
1306
1269
|
function WxtVitest(inlineConfig) {
|
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 './index-
|
|
3
|
+
import { I as InlineConfig } from './index-mZodC81T.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 './index-
|
|
3
|
+
import { I as InlineConfig } from './index-mZodC81T.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.17.
|
|
4
|
+
"version": "0.17.9",
|
|
5
5
|
"description": "Next gen framework for developing web extensions",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=18",
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"c12": "^1.5.1",
|
|
95
95
|
"cac": "^6.7.14",
|
|
96
96
|
"chokidar": "^3.5.3",
|
|
97
|
+
"ci-info": "^4.0.0",
|
|
97
98
|
"consola": "^3.2.3",
|
|
98
99
|
"defu": "^6.1.3",
|
|
99
100
|
"dequal": "^2.0.3",
|
|
@@ -113,6 +114,7 @@
|
|
|
113
114
|
"natural-compare": "^1.4.0",
|
|
114
115
|
"normalize-path": "^3.0.0",
|
|
115
116
|
"nypm": "^0.3.6",
|
|
117
|
+
"open": "^10.1.0",
|
|
116
118
|
"ora": "^7.0.1",
|
|
117
119
|
"picocolors": "^1.0.0",
|
|
118
120
|
"prompts": "^2.4.2",
|
|
@@ -150,6 +152,7 @@
|
|
|
150
152
|
"vitepress": "1.0.0-rc.34",
|
|
151
153
|
"vitest": "^1.2.2",
|
|
152
154
|
"vitest-mock-extended": "^1.3.1",
|
|
155
|
+
"vitest-plugin-random-seed": "^1.0.2",
|
|
153
156
|
"vue": "^3.3.10"
|
|
154
157
|
},
|
|
155
158
|
"packageManager": "pnpm@8.6.3",
|