wxt 0.6.5 → 0.6.6
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/cli.cjs +47 -22
- package/dist/index.cjs +36 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +32 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -250,6 +250,8 @@ interface InlineConfig {
|
|
|
250
250
|
/**
|
|
251
251
|
* Explicitly include bundle analysis when running `wxt build`. This can be overridden by the
|
|
252
252
|
* command line `--analysis` option.
|
|
253
|
+
*
|
|
254
|
+
* @default false
|
|
253
255
|
*/
|
|
254
256
|
enabled?: boolean;
|
|
255
257
|
/**
|
|
@@ -257,6 +259,8 @@ interface InlineConfig {
|
|
|
257
259
|
* bundle will be visualized. See
|
|
258
260
|
* [`rollup-plugin-visualizer`](https://github.com/btd/rollup-plugin-visualizer#how-to-use-generated-files)
|
|
259
261
|
* for more details.
|
|
262
|
+
*
|
|
263
|
+
* @default "treemap"
|
|
260
264
|
*/
|
|
261
265
|
template?: PluginVisualizerOptions['template'];
|
|
262
266
|
};
|
|
@@ -487,6 +491,12 @@ interface ConfigEnv {
|
|
|
487
491
|
* Configure how the browser starts up.
|
|
488
492
|
*/
|
|
489
493
|
interface ExtensionRunnerConfig {
|
|
494
|
+
/**
|
|
495
|
+
* Whether or not to open the browser with the extension installed in dev mode.
|
|
496
|
+
*
|
|
497
|
+
* @default false
|
|
498
|
+
*/
|
|
499
|
+
disabled?: boolean;
|
|
490
500
|
/**
|
|
491
501
|
* @see https://extensionworkshop.com/documentation/develop/web-ext-command-reference/#browser-console
|
|
492
502
|
*/
|
|
@@ -538,7 +548,7 @@ type EntrypointGroup = Entrypoint | Entrypoint[];
|
|
|
538
548
|
*/
|
|
539
549
|
declare function clean(root?: string): Promise<void>;
|
|
540
550
|
|
|
541
|
-
var version = "0.6.
|
|
551
|
+
var version = "0.6.6";
|
|
542
552
|
|
|
543
553
|
declare function defineConfig(config: UserConfig): UserConfig;
|
|
544
554
|
|
package/dist/index.d.ts
CHANGED
|
@@ -250,6 +250,8 @@ interface InlineConfig {
|
|
|
250
250
|
/**
|
|
251
251
|
* Explicitly include bundle analysis when running `wxt build`. This can be overridden by the
|
|
252
252
|
* command line `--analysis` option.
|
|
253
|
+
*
|
|
254
|
+
* @default false
|
|
253
255
|
*/
|
|
254
256
|
enabled?: boolean;
|
|
255
257
|
/**
|
|
@@ -257,6 +259,8 @@ interface InlineConfig {
|
|
|
257
259
|
* bundle will be visualized. See
|
|
258
260
|
* [`rollup-plugin-visualizer`](https://github.com/btd/rollup-plugin-visualizer#how-to-use-generated-files)
|
|
259
261
|
* for more details.
|
|
262
|
+
*
|
|
263
|
+
* @default "treemap"
|
|
260
264
|
*/
|
|
261
265
|
template?: PluginVisualizerOptions['template'];
|
|
262
266
|
};
|
|
@@ -487,6 +491,12 @@ interface ConfigEnv {
|
|
|
487
491
|
* Configure how the browser starts up.
|
|
488
492
|
*/
|
|
489
493
|
interface ExtensionRunnerConfig {
|
|
494
|
+
/**
|
|
495
|
+
* Whether or not to open the browser with the extension installed in dev mode.
|
|
496
|
+
*
|
|
497
|
+
* @default false
|
|
498
|
+
*/
|
|
499
|
+
disabled?: boolean;
|
|
490
500
|
/**
|
|
491
501
|
* @see https://extensionworkshop.com/documentation/develop/web-ext-command-reference/#browser-console
|
|
492
502
|
*/
|
|
@@ -538,7 +548,7 @@ type EntrypointGroup = Entrypoint | Entrypoint[];
|
|
|
538
548
|
*/
|
|
539
549
|
declare function clean(root?: string): Promise<void>;
|
|
540
550
|
|
|
541
|
-
var version = "0.6.
|
|
551
|
+
var version = "0.6.6";
|
|
542
552
|
|
|
543
553
|
declare function defineConfig(config: UserConfig): UserConfig;
|
|
544
554
|
|
package/dist/index.js
CHANGED
|
@@ -1382,7 +1382,8 @@ async function getInternalConfig(inlineConfig, command) {
|
|
|
1382
1382
|
cwd: root,
|
|
1383
1383
|
globalRc: true,
|
|
1384
1384
|
rcFile: ".webextrc",
|
|
1385
|
-
overrides:
|
|
1385
|
+
overrides: inlineConfig.runner,
|
|
1386
|
+
defaults: userConfig.runner
|
|
1386
1387
|
});
|
|
1387
1388
|
const finalConfig = {
|
|
1388
1389
|
browser,
|
|
@@ -1624,7 +1625,7 @@ function findEffectedSteps(changedFile, currentOutput) {
|
|
|
1624
1625
|
// src/index.ts
|
|
1625
1626
|
import { Mutex } from "async-mutex";
|
|
1626
1627
|
import { consola as consola3 } from "consola";
|
|
1627
|
-
import { relative as
|
|
1628
|
+
import { relative as relative8 } from "node:path";
|
|
1628
1629
|
|
|
1629
1630
|
// src/core/build/buildEntrypoints.ts
|
|
1630
1631
|
import * as vite3 from "vite";
|
|
@@ -4246,13 +4247,37 @@ function createSafariRunner() {
|
|
|
4246
4247
|
};
|
|
4247
4248
|
}
|
|
4248
4249
|
|
|
4250
|
+
// src/core/runners/manual.ts
|
|
4251
|
+
import { relative as relative7 } from "node:path";
|
|
4252
|
+
function createManualRunner() {
|
|
4253
|
+
return {
|
|
4254
|
+
async openBrowser(config) {
|
|
4255
|
+
config.logger.info(
|
|
4256
|
+
`Load "${relative7(
|
|
4257
|
+
process.cwd(),
|
|
4258
|
+
config.outDir
|
|
4259
|
+
)}" as an unpacked extension manually`
|
|
4260
|
+
);
|
|
4261
|
+
},
|
|
4262
|
+
async closeBrowser() {
|
|
4263
|
+
}
|
|
4264
|
+
};
|
|
4265
|
+
}
|
|
4266
|
+
|
|
4267
|
+
// src/core/utils/wsl.ts
|
|
4268
|
+
async function isWsl() {
|
|
4269
|
+
const { default: isWsl2 } = await import("is-wsl");
|
|
4270
|
+
return isWsl2;
|
|
4271
|
+
}
|
|
4272
|
+
|
|
4249
4273
|
// src/core/runners/index.ts
|
|
4250
4274
|
async function createExtensionRunner(config) {
|
|
4251
4275
|
if (config.browser === "safari")
|
|
4252
4276
|
return createSafariRunner();
|
|
4253
|
-
|
|
4254
|
-
if (isWsl)
|
|
4277
|
+
if (await isWsl())
|
|
4255
4278
|
return createWslRunner();
|
|
4279
|
+
if (config.runnerConfig.config?.disabled)
|
|
4280
|
+
return createManualRunner();
|
|
4256
4281
|
return createWebExtRunner();
|
|
4257
4282
|
}
|
|
4258
4283
|
|
|
@@ -4377,7 +4402,7 @@ async function clean(root = process.cwd()) {
|
|
|
4377
4402
|
}
|
|
4378
4403
|
|
|
4379
4404
|
// package.json
|
|
4380
|
-
var version2 = "0.6.
|
|
4405
|
+
var version2 = "0.6.6";
|
|
4381
4406
|
|
|
4382
4407
|
// src/core/utils/defineConfig.ts
|
|
4383
4408
|
function defineConfig(config) {
|
|
@@ -4425,11 +4450,11 @@ async function createServer2(config) {
|
|
|
4425
4450
|
if (changes.type === "no-change")
|
|
4426
4451
|
return;
|
|
4427
4452
|
internalConfig.logger.info(
|
|
4428
|
-
`Changed: ${Array.from(new Set(fileChanges.map((change) => change[1]))).map((file) => pc5.dim(
|
|
4453
|
+
`Changed: ${Array.from(new Set(fileChanges.map((change) => change[1]))).map((file) => pc5.dim(relative8(internalConfig.root, file))).join(", ")}`
|
|
4429
4454
|
);
|
|
4430
4455
|
const rebuiltNames = changes.rebuildGroups.flat().map((entry) => {
|
|
4431
4456
|
return pc5.cyan(
|
|
4432
|
-
|
|
4457
|
+
relative8(internalConfig.outDir, getEntrypointOutputFile(entry, ""))
|
|
4433
4458
|
);
|
|
4434
4459
|
}).join(pc5.dim(", "));
|
|
4435
4460
|
internalConfig = await getLatestInternalConfig();
|