wxt 0.17.12 → 0.18.0

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/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 './index-NHTTcok1.cjs';
2
- export { x as BackgroundDefinition, n as BackgroundEntrypoint, i as BackgroundEntrypointOptions, j as BaseContentScriptEntrypointOptions, m as BaseEntrypoint, h as BaseEntrypointOptions, e as BuildStepOutput, J as ConfigEnv, w as ContentScriptDefinition, C as ContentScriptEntrypoint, a5 as Dependency, r as Entrypoint, s as EntrypointGroup, $ as EslintGlobalsPropValue, a0 as Eslintrc, _ as ExtensionRunner, Z as FsCache, G as GenericEntrypoint, X as HookResult, u as IsolatedWorldContentScriptDefinition, k as IsolatedWorldContentScriptEntrypointOptions, L as Logger, v as MainWorldContentScriptDefinition, M as MainWorldContentScriptEntrypointOptions, t as OnContentScriptStopped, p as OptionsEntrypoint, l as OptionsEntrypointOptions, d as OutputAsset, c as OutputChunk, O as OutputFile, A as PerBrowserMap, z as PerBrowserOption, o as PopupEntrypoint, P as PopupEntrypointOptions, f as ReloadContentScriptPayload, R as ResolvedConfig, a1 as ResolvedEslintrc, D as ResolvedPerBrowserOptions, V as ServerInfo, q as SidepanelEntrypoint, S as SidepanelEntrypointOptions, T as TargetBrowser, g as TargetManifestVersion, y as UnlistedScriptDefinition, F as UserManifest, H as UserManifestFn, Y as Wxt, N as WxtBuilder, Q as WxtBuilderServer, K as WxtCommand, b as WxtHooks, a4 as WxtPackageManager, a3 as WxtResolvedUnimportOptions, a2 as WxtUnimportOptions, a as WxtViteConfig } from './index-NHTTcok1.cjs';
1
+ import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './index-DKN-8I90.cjs';
2
+ export { x as BackgroundDefinition, n as BackgroundEntrypoint, i as BackgroundEntrypointOptions, j as BaseContentScriptEntrypointOptions, m as BaseEntrypoint, h as BaseEntrypointOptions, e as BuildStepOutput, J as ConfigEnv, w as ContentScriptDefinition, C as ContentScriptEntrypoint, a5 as Dependency, r as Entrypoint, s as EntrypointGroup, $ as EslintGlobalsPropValue, a0 as Eslintrc, _ as ExtensionRunner, Z as FsCache, G as GenericEntrypoint, X as HookResult, u as IsolatedWorldContentScriptDefinition, k as IsolatedWorldContentScriptEntrypointOptions, L as Logger, v as MainWorldContentScriptDefinition, M as MainWorldContentScriptEntrypointOptions, t as OnContentScriptStopped, p as OptionsEntrypoint, l as OptionsEntrypointOptions, d as OutputAsset, c as OutputChunk, O as OutputFile, A as PerBrowserMap, z as PerBrowserOption, o as PopupEntrypoint, P as PopupEntrypointOptions, f as ReloadContentScriptPayload, R as ResolvedConfig, a1 as ResolvedEslintrc, D as ResolvedPerBrowserOptions, V as ServerInfo, q as SidepanelEntrypoint, S as SidepanelEntrypointOptions, T as TargetBrowser, g as TargetManifestVersion, y as UnlistedScriptDefinition, F as UserManifest, H as UserManifestFn, Y as Wxt, N as WxtBuilder, Q as WxtBuilderServer, K as WxtCommand, b as WxtHooks, a4 as WxtPackageManager, a3 as WxtResolvedUnimportOptions, a2 as WxtUnimportOptions, a as WxtViteConfig } from './index-DKN-8I90.cjs';
3
3
  import 'vite';
4
4
  import 'webextension-polyfill';
5
5
  import 'unimport';
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 './index-NHTTcok1.js';
2
- export { x as BackgroundDefinition, n as BackgroundEntrypoint, i as BackgroundEntrypointOptions, j as BaseContentScriptEntrypointOptions, m as BaseEntrypoint, h as BaseEntrypointOptions, e as BuildStepOutput, J as ConfigEnv, w as ContentScriptDefinition, C as ContentScriptEntrypoint, a5 as Dependency, r as Entrypoint, s as EntrypointGroup, $ as EslintGlobalsPropValue, a0 as Eslintrc, _ as ExtensionRunner, Z as FsCache, G as GenericEntrypoint, X as HookResult, u as IsolatedWorldContentScriptDefinition, k as IsolatedWorldContentScriptEntrypointOptions, L as Logger, v as MainWorldContentScriptDefinition, M as MainWorldContentScriptEntrypointOptions, t as OnContentScriptStopped, p as OptionsEntrypoint, l as OptionsEntrypointOptions, d as OutputAsset, c as OutputChunk, O as OutputFile, A as PerBrowserMap, z as PerBrowserOption, o as PopupEntrypoint, P as PopupEntrypointOptions, f as ReloadContentScriptPayload, R as ResolvedConfig, a1 as ResolvedEslintrc, D as ResolvedPerBrowserOptions, V as ServerInfo, q as SidepanelEntrypoint, S as SidepanelEntrypointOptions, T as TargetBrowser, g as TargetManifestVersion, y as UnlistedScriptDefinition, F as UserManifest, H as UserManifestFn, Y as Wxt, N as WxtBuilder, Q as WxtBuilderServer, K as WxtCommand, b as WxtHooks, a4 as WxtPackageManager, a3 as WxtResolvedUnimportOptions, a2 as WxtUnimportOptions, a as WxtViteConfig } from './index-NHTTcok1.js';
1
+ import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './index-DKN-8I90.js';
2
+ export { x as BackgroundDefinition, n as BackgroundEntrypoint, i as BackgroundEntrypointOptions, j as BaseContentScriptEntrypointOptions, m as BaseEntrypoint, h as BaseEntrypointOptions, e as BuildStepOutput, J as ConfigEnv, w as ContentScriptDefinition, C as ContentScriptEntrypoint, a5 as Dependency, r as Entrypoint, s as EntrypointGroup, $ as EslintGlobalsPropValue, a0 as Eslintrc, _ as ExtensionRunner, Z as FsCache, G as GenericEntrypoint, X as HookResult, u as IsolatedWorldContentScriptDefinition, k as IsolatedWorldContentScriptEntrypointOptions, L as Logger, v as MainWorldContentScriptDefinition, M as MainWorldContentScriptEntrypointOptions, t as OnContentScriptStopped, p as OptionsEntrypoint, l as OptionsEntrypointOptions, d as OutputAsset, c as OutputChunk, O as OutputFile, A as PerBrowserMap, z as PerBrowserOption, o as PopupEntrypoint, P as PopupEntrypointOptions, f as ReloadContentScriptPayload, R as ResolvedConfig, a1 as ResolvedEslintrc, D as ResolvedPerBrowserOptions, V as ServerInfo, q as SidepanelEntrypoint, S as SidepanelEntrypointOptions, T as TargetBrowser, g as TargetManifestVersion, y as UnlistedScriptDefinition, F as UserManifest, H as UserManifestFn, Y as Wxt, N as WxtBuilder, Q as WxtBuilderServer, K as WxtCommand, b as WxtHooks, a4 as WxtPackageManager, a3 as WxtResolvedUnimportOptions, a2 as WxtUnimportOptions, a as WxtViteConfig } from './index-DKN-8I90.js';
3
3
  import 'vite';
4
4
  import 'webextension-polyfill';
5
5
  import 'unimport';
package/dist/index.js CHANGED
@@ -19,8 +19,11 @@ import {
19
19
  unnormalizePath,
20
20
  version,
21
21
  wxt
22
- } from "./chunk-C4ZVXF53.js";
22
+ } from "./chunk-A7YRDAFI.js";
23
23
  import "./chunk-5X3S6AWF.js";
24
+ import {
25
+ consola
26
+ } from "./chunk-ZZCTFNQ5.js";
24
27
  import "./chunk-VBXJIVYU.js";
25
28
 
26
29
  // src/core/build.ts
@@ -33,7 +36,6 @@ async function build(config) {
33
36
  import path from "node:path";
34
37
  import glob from "fast-glob";
35
38
  import fs from "fs-extra";
36
- import { consola } from "consola";
37
39
  import pc from "picocolors";
38
40
  async function clean(root = process.cwd()) {
39
41
  consola.info("Cleaning Project");
@@ -219,7 +221,6 @@ async function createExtensionRunner() {
219
221
  }
220
222
 
221
223
  // src/core/create-server.ts
222
- import { consola as consola2 } from "consola";
223
224
  import { Mutex } from "async-mutex";
224
225
  import pc2 from "picocolors";
225
226
  import { relative as relative4 } from "node:path";
@@ -342,19 +343,19 @@ function createFileReloader(server) {
342
343
  switch (changes.type) {
343
344
  case "extension-reload":
344
345
  server.reloadExtension();
345
- consola2.success(`Reloaded extension`);
346
+ consola.success(`Reloaded extension`);
346
347
  break;
347
348
  case "html-reload":
348
349
  const { reloadedNames } = reloadHtmlPages(
349
350
  changes.rebuildGroups,
350
351
  server
351
352
  );
352
- consola2.success(`Reloaded: ${getFilenameList(reloadedNames)}`);
353
+ consola.success(`Reloaded: ${getFilenameList(reloadedNames)}`);
353
354
  break;
354
355
  case "content-script-reload":
355
356
  reloadContentScripts(changes.changedSteps, server);
356
357
  const rebuiltNames = changes.rebuildGroups.flat().map((entry) => entry.name);
357
- consola2.success(`Reloaded: ${getFilenameList(rebuiltNames)}`);
358
+ consola.success(`Reloaded: ${getFilenameList(rebuiltNames)}`);
358
359
  break;
359
360
  }
360
361
  } catch (err) {
@@ -418,13 +419,12 @@ function getExternalOutputDependencies(server) {
418
419
 
419
420
  // src/core/initialize.ts
420
421
  import prompts from "prompts";
421
- import { consola as consola3 } from "consola";
422
422
  import { downloadTemplate } from "giget";
423
423
  import fs2 from "fs-extra";
424
424
  import path2 from "node:path";
425
425
  import pc3 from "picocolors";
426
426
  async function initialize(options) {
427
- consola3.info("Initalizing new project");
427
+ consola.info("Initalizing new project");
428
428
  const templates = await listTemplates();
429
429
  const defaultTemplate = templates.find(
430
430
  (template) => template.name === options.template?.toLowerCase().trim()
@@ -472,7 +472,7 @@ async function initialize(options) {
472
472
  if (isExists) {
473
473
  const isEmpty = (await fs2.readdir(input.directory)).length === 0;
474
474
  if (!isEmpty) {
475
- consola3.error(
475
+ consola.error(
476
476
  `The directory ${path2.resolve(input.directory)} is not empty. Aborted.`
477
477
  );
478
478
  process.exit(1);
@@ -481,15 +481,15 @@ async function initialize(options) {
481
481
  await cloneProject(input);
482
482
  const cdPath = path2.relative(process.cwd(), path2.resolve(input.directory));
483
483
  console.log();
484
- consola3.log(
484
+ consola.log(
485
485
  `\u2728 WXT project created with the ${TEMPLATE_COLORS[input.template.name]?.(input.template.name) ?? input.template.name} template.`
486
486
  );
487
487
  console.log();
488
- consola3.log("Next steps:");
488
+ consola.log("Next steps:");
489
489
  let step = 0;
490
490
  if (cdPath !== "")
491
- consola3.log(` ${++step}.`, pc3.cyan(`cd ${cdPath}`));
492
- consola3.log(` ${++step}.`, pc3.cyan(`${input.packageManager} install`));
491
+ consola.log(` ${++step}.`, pc3.cyan(`cd ${cdPath}`));
492
+ consola.log(` ${++step}.`, pc3.cyan(`${input.packageManager} install`));
493
493
  console.log();
494
494
  }
495
495
  async function listTemplates() {
@@ -507,7 +507,7 @@ async function listTemplates() {
507
507
  return l.name.localeCompare(r.name);
508
508
  });
509
509
  } catch (err) {
510
- consola3.error(err);
510
+ consola.error(err);
511
511
  throw Error(`Failed to load templates`);
512
512
  }
513
513
  }
@@ -527,7 +527,7 @@ async function cloneProject({
527
527
  path2.join(directory, "_gitignore"),
528
528
  path2.join(directory, ".gitignore")
529
529
  ).catch(
530
- (err) => consola3.warn("Failed to move _gitignore to .gitignore:", err)
530
+ (err) => consola.warn("Failed to move _gitignore to .gitignore:", err)
531
531
  );
532
532
  spinner.succeed();
533
533
  } catch (err) {
@@ -641,7 +641,13 @@ async function zipDir(directory, outputPath, options) {
641
641
  }
642
642
  }
643
643
  await options?.additionalWork?.(archive);
644
- const buffer = await archive.generateAsync({ type: "base64" });
644
+ const buffer = await archive.generateAsync({
645
+ type: "base64",
646
+ ...wxt.config.zip.compressionLevel === 0 ? { compression: "STORE" } : {
647
+ compression: "DEFLATE",
648
+ compressionOptions: { level: wxt.config.zip.compressionLevel }
649
+ }
650
+ });
645
651
  await fs3.writeFile(outputPath, buffer, "base64");
646
652
  }
647
653
  async function downloadPrivatePackages() {