wxt 0.18.5 → 0.18.7

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.
Files changed (35) hide show
  1. package/dist/{chunk-7AOGIMIM.js → chunk-A3R6ZPUA.js} +120 -175
  2. package/dist/{chunk-5X3S6AWF.js → chunk-BERPNPEZ.js} +2 -4
  3. package/dist/{chunk-ZZCTFNQ5.js → chunk-BM6QYGAW.js} +1 -1
  4. package/dist/{chunk-NAMV4VWQ.js → chunk-KPD5J7PZ.js} +1 -1
  5. package/dist/{chunk-VBXJIVYU.js → chunk-QGM4M3NI.js} +1 -2
  6. package/dist/{chunk-73I7FAJU.js → chunk-SGKCDMVR.js} +1 -2
  7. package/dist/cli.js +141 -213
  8. package/dist/client.js +12 -24
  9. package/dist/{execa-QQUOQNS3.js → execa-ATHZH2Y4.js} +1576 -610
  10. package/dist/{execa-5TSWMF32.js → execa-D7CMCKO2.js} +1576 -610
  11. package/dist/{index-q2ZwJBs6.d.cts → index-D6lH9OkP.d.cts} +7 -3
  12. package/dist/{index-q2ZwJBs6.d.ts → index-D6lH9OkP.d.ts} +7 -3
  13. package/dist/index.cjs +2187 -1176
  14. package/dist/index.d.cts +3 -3
  15. package/dist/index.d.ts +3 -3
  16. package/dist/index.js +23 -38
  17. package/dist/modules.cjs +11 -2
  18. package/dist/modules.d.cts +31 -3
  19. package/dist/modules.d.ts +31 -3
  20. package/dist/modules.js +11 -3
  21. package/dist/{prompt-Y7B5HSD5.js → prompt-25QIVJDC.js} +28 -55
  22. package/dist/{prompt-TFJ7OLL7.js → prompt-7BMKNSWS.js} +28 -55
  23. package/dist/sandbox.js +2 -4
  24. package/dist/storage.cjs +4 -8
  25. package/dist/storage.js +6 -10
  26. package/dist/testing.cjs +47 -72
  27. package/dist/testing.d.cts +1 -1
  28. package/dist/testing.d.ts +1 -1
  29. package/dist/testing.js +4 -4
  30. package/dist/virtual/background-entrypoint.js +3 -6
  31. package/dist/virtual/content-script-isolated-world-entrypoint.js +1 -2
  32. package/dist/virtual/content-script-main-world-entrypoint.js +1 -2
  33. package/dist/virtual/reload-html.js +1 -2
  34. package/dist/virtual/unlisted-script-entrypoint.js +1 -2
  35. package/package.json +34 -33
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-q2ZwJBs6.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, a9 as ResolvedPublicFile, 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, a8 as WxtModule, a6 as WxtModuleOptions, a7 as WxtModuleSetup, a4 as WxtPackageManager, aa as WxtPlugin, a3 as WxtResolvedUnimportOptions, a2 as WxtUnimportOptions, a as WxtViteConfig } from './index-q2ZwJBs6.cjs';
1
+ import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './index-D6lH9OkP.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, aa as ResolvedPublicFile, 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, a8 as WxtModule, a6 as WxtModuleOptions, a7 as WxtModuleSetup, a9 as WxtModuleWithMetadata, a4 as WxtPackageManager, ab as WxtPlugin, a3 as WxtResolvedUnimportOptions, a2 as WxtUnimportOptions, a as WxtViteConfig } from './index-D6lH9OkP.cjs';
3
3
  import 'vite';
4
4
  import 'webextension-polyfill';
5
5
  import 'unimport';
@@ -65,6 +65,6 @@ declare function prepare(config: InlineConfig): Promise<void>;
65
65
  */
66
66
  declare function zip(config?: InlineConfig): Promise<string[]>;
67
67
 
68
- var version = "0.18.5";
68
+ var version = "0.18.6";
69
69
 
70
70
  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 './index-q2ZwJBs6.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, a9 as ResolvedPublicFile, 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, a8 as WxtModule, a6 as WxtModuleOptions, a7 as WxtModuleSetup, a4 as WxtPackageManager, aa as WxtPlugin, a3 as WxtResolvedUnimportOptions, a2 as WxtUnimportOptions, a as WxtViteConfig } from './index-q2ZwJBs6.js';
1
+ import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './index-D6lH9OkP.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, aa as ResolvedPublicFile, 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, a8 as WxtModule, a6 as WxtModuleOptions, a7 as WxtModuleSetup, a9 as WxtModuleWithMetadata, a4 as WxtPackageManager, ab as WxtPlugin, a3 as WxtResolvedUnimportOptions, a2 as WxtUnimportOptions, a as WxtViteConfig } from './index-D6lH9OkP.js';
3
3
  import 'vite';
4
4
  import 'webextension-polyfill';
5
5
  import 'unimport';
@@ -65,6 +65,6 @@ declare function prepare(config: InlineConfig): Promise<void>;
65
65
  */
66
66
  declare function zip(config?: InlineConfig): Promise<string[]>;
67
67
 
68
- var version = "0.18.5";
68
+ var version = "0.18.6";
69
69
 
70
70
  export { BuildOutput, ExtensionRunnerConfig, InlineConfig, UserConfig, WxtDevServer, build, clean, createServer, defineConfig, defineRunnerConfig, initialize, prepare, version, zip };
package/dist/index.js CHANGED
@@ -19,12 +19,12 @@ import {
19
19
  unnormalizePath,
20
20
  version,
21
21
  wxt
22
- } from "./chunk-7AOGIMIM.js";
23
- import "./chunk-5X3S6AWF.js";
22
+ } from "./chunk-A3R6ZPUA.js";
23
+ import "./chunk-BERPNPEZ.js";
24
24
  import {
25
25
  consola
26
- } from "./chunk-ZZCTFNQ5.js";
27
- import "./chunk-VBXJIVYU.js";
26
+ } from "./chunk-BM6QYGAW.js";
27
+ import "./chunk-QGM4M3NI.js";
28
28
 
29
29
  // src/core/build.ts
30
30
  async function build(config) {
@@ -107,10 +107,8 @@ function createWebExtRunner() {
107
107
  }
108
108
  const webExtLogger = await import("web-ext-run/util/logger");
109
109
  webExtLogger.consoleStream.write = ({ level, msg, name }) => {
110
- if (level >= ERROR_LOG_LEVEL)
111
- wxt.logger.error(name, msg);
112
- if (level >= WARN_LOG_LEVEL)
113
- wxt.logger.warn(msg);
110
+ if (level >= ERROR_LOG_LEVEL) wxt.logger.error(name, msg);
111
+ if (level >= WARN_LOG_LEVEL) wxt.logger.warn(msg);
114
112
  };
115
113
  const wxtUserConfig = wxt.config.runnerConfig.config;
116
114
  const userConfig = {
@@ -212,12 +210,9 @@ async function isWsl() {
212
210
 
213
211
  // src/core/runners/index.ts
214
212
  async function createExtensionRunner() {
215
- if (wxt.config.browser === "safari")
216
- return createSafariRunner();
217
- if (await isWsl())
218
- return createWslRunner();
219
- if (wxt.config.runnerConfig.config?.disabled)
220
- return createManualRunner();
213
+ if (wxt.config.browser === "safari") return createSafariRunner();
214
+ if (await isWsl()) return createWslRunner();
215
+ if (wxt.config.runnerConfig.config?.disabled) return createManualRunner();
221
216
  return createWebExtRunner();
222
217
  }
223
218
 
@@ -294,8 +289,7 @@ async function createServer(inlineConfig) {
294
289
  runner = await createExtensionRunner();
295
290
  };
296
291
  server.ws.on("wxt:background-initialized", () => {
297
- if (server.currentOutput == null)
298
- return;
292
+ if (server.currentOutput == null) return;
299
293
  reloadContentScripts(server.currentOutput.steps, server);
300
294
  });
301
295
  const reloadOnChange = createFileReloader(server);
@@ -307,18 +301,14 @@ function createFileReloader(server) {
307
301
  const changeQueue = [];
308
302
  return async (event, path4) => {
309
303
  await wxt.reloadConfig();
310
- if (path4.startsWith(wxt.config.outBaseDir))
311
- return;
304
+ if (path4.startsWith(wxt.config.outBaseDir)) return;
312
305
  changeQueue.push([event, path4]);
313
306
  await fileChangedMutex.runExclusive(async () => {
314
- if (server.currentOutput == null)
315
- return;
307
+ if (server.currentOutput == null) return;
316
308
  const fileChanges = changeQueue.splice(0, changeQueue.length).map(([_, file]) => file);
317
- if (fileChanges.length === 0)
318
- return;
309
+ if (fileChanges.length === 0) return;
319
310
  const changes = detectDevChanges(fileChanges, server.currentOutput);
320
- if (changes.type === "no-change")
321
- return;
311
+ if (changes.type === "no-change") return;
322
312
  if (changes.type === "full-restart") {
323
313
  wxt.logger.info("Config changed, restarting server...");
324
314
  server.restart();
@@ -367,11 +357,9 @@ function createFileReloader(server) {
367
357
  function reloadContentScripts(steps, server) {
368
358
  if (wxt.config.manifestVersion === 3) {
369
359
  steps.forEach((step) => {
370
- if (server.currentOutput == null)
371
- return;
360
+ if (server.currentOutput == null) return;
372
361
  const entry = step.entrypoints;
373
- if (Array.isArray(entry) || entry.type !== "content-script")
374
- return;
362
+ if (Array.isArray(entry) || entry.type !== "content-script") return;
375
363
  const js = getContentScriptJs(wxt.config, entry);
376
364
  const cssMap = getContentScriptsCssMap(server.currentOutput, [entry]);
377
365
  const css = getContentScriptCssFiles([entry], cssMap);
@@ -409,8 +397,7 @@ function getExternalOutputDependencies(server) {
409
397
  return [];
410
398
  }
411
399
  return step.chunks.flatMap((chunk) => {
412
- if (chunk.type === "asset")
413
- return [];
400
+ if (chunk.type === "asset") return [];
414
401
  return chunk.moduleIds;
415
402
  });
416
403
  }).filter(
@@ -488,8 +475,7 @@ async function initialize(options) {
488
475
  console.log();
489
476
  consola.log("Next steps:");
490
477
  let step = 0;
491
- if (cdPath !== "")
492
- consola.log(` ${++step}.`, pc3.cyan(`cd ${cdPath}`));
478
+ if (cdPath !== "") consola.log(` ${++step}.`, pc3.cyan(`cd ${cdPath}`));
493
479
  consola.log(` ${++step}.`, pc3.cyan(`${input.packageManager} install`));
494
480
  console.log();
495
481
  }
@@ -503,8 +489,7 @@ async function listTemplates() {
503
489
  const lWeight = TEMPLATE_SORT_WEIGHT[l.name] ?? Number.MAX_SAFE_INTEGER;
504
490
  const rWeight = TEMPLATE_SORT_WEIGHT[r.name] ?? Number.MAX_SAFE_INTEGER;
505
491
  const diff = lWeight - rWeight;
506
- if (diff !== 0)
507
- return diff;
492
+ if (diff !== 0) return diff;
508
493
  return l.name.localeCompare(r.name);
509
494
  });
510
495
  } catch (err) {
@@ -614,8 +599,9 @@ async function zipDir(directory, outputPath, options) {
614
599
  cwd: directory,
615
600
  // Ignore node_modules, otherwise this glob step takes forever
616
601
  ignore: ["**/node_modules"],
617
- onlyFiles: true,
618
- dot: true
602
+ onlyFiles: true
603
+ // TODO: Fix #738
604
+ // dot: true,
619
605
  })).filter((relativePath) => {
620
606
  return options?.include?.some((pattern) => minimatch(relativePath, pattern)) || !options?.exclude?.some((pattern) => minimatch(relativePath, pattern));
621
607
  });
@@ -674,8 +660,7 @@ async function downloadPrivatePackages() {
674
660
  return { overrides, files };
675
661
  }
676
662
  function addOverridesToPackageJson(absolutePackageJsonPath, content, overrides) {
677
- if (Object.keys(overrides).length === 0)
678
- return content;
663
+ if (Object.keys(overrides).length === 0) return content;
679
664
  const packageJsonDir = path3.dirname(absolutePackageJsonPath);
680
665
  const oldPackage = JSON.parse(content);
681
666
  const newPackage = {
package/dist/modules.cjs CHANGED
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var modules_exports = {};
32
32
  __export(modules_exports, {
33
33
  addEntrypoint: () => addEntrypoint,
34
+ addImportPreset: () => addImportPreset,
34
35
  addPublicAssets: () => addPublicAssets,
35
36
  addViteConfig: () => addViteConfig,
36
37
  addWxtPlugin: () => addWxtPlugin,
@@ -41,8 +42,7 @@ var vite = __toESM(require("vite"), 1);
41
42
  var import_fast_glob = __toESM(require("fast-glob"), 1);
42
43
  var import_node_path = require("path");
43
44
  function defineWxtModule(module2) {
44
- if (typeof module2 === "function")
45
- return { setup: module2 };
45
+ if (typeof module2 === "function") return { setup: module2 };
46
46
  return module2;
47
47
  }
48
48
  function addEntrypoint(wxt, entrypoint) {
@@ -78,9 +78,18 @@ function addWxtPlugin(wxt, plugin) {
78
78
  wxt2.config.plugins.push(plugin);
79
79
  });
80
80
  }
81
+ function addImportPreset(wxt, preset) {
82
+ wxt.hooks.hook("ready", (wxt2) => {
83
+ if (!wxt2.config.imports) return;
84
+ wxt2.config.imports.presets ??= [];
85
+ if (wxt2.config.imports.presets.includes(preset)) return;
86
+ wxt2.config.imports.presets.push(preset);
87
+ });
88
+ }
81
89
  // Annotate the CommonJS export names for ESM import in node:
82
90
  0 && (module.exports = {
83
91
  addEntrypoint,
92
+ addImportPreset,
84
93
  addPublicAssets,
85
94
  addViteConfig,
86
95
  addWxtPlugin,
@@ -1,7 +1,7 @@
1
- import { a6 as WxtModuleOptions, a8 as WxtModule, a7 as WxtModuleSetup, Y as Wxt, r as Entrypoint } from './index-q2ZwJBs6.cjs';
1
+ import { a6 as WxtModuleOptions, a8 as WxtModule, a7 as WxtModuleSetup, Y as Wxt, r as Entrypoint } from './index-D6lH9OkP.cjs';
2
2
  import * as vite from 'vite';
3
+ import { UnimportOptions } from 'unimport';
3
4
  import 'webextension-polyfill';
4
- import 'unimport';
5
5
  import 'consola';
6
6
  import '@aklinker1/rollup-plugin-visualizer';
7
7
  import 'chokidar';
@@ -87,5 +87,33 @@ declare function addViteConfig(wxt: Wxt, viteConfig: (env: vite.ConfigEnv) => vi
87
87
  * });
88
88
  */
89
89
  declare function addWxtPlugin(wxt: Wxt, plugin: string): void;
90
+ /**
91
+ * Add an Unimport preset ([built-in](https://github.com/unjs/unimport?tab=readme-ov-file#built-in-presets),
92
+ * [custom](https://github.com/unjs/unimport?tab=readme-ov-file#custom-presets),
93
+ * or [auto-scanned](https://github.com/unjs/unimport?tab=readme-ov-file#exports-auto-scan)),
94
+ * to the project's list of auto-imported utilities.
95
+ *
96
+ * Some things to note:
97
+ * - This function will only de-duplicate built-in preset names. It will not
98
+ * stop you adding duplicate custom or auto-scanned presets.
99
+ * - If the project has disabled imports, this function has no effect.
100
+ *
101
+ * @param wxt The wxt instance provided by the module's setup function.
102
+ * @param preset The preset to add to the project.
103
+ *
104
+ * @example
105
+ * export default defineWxtModule((wxt) => {
106
+ * // Built-in preset:
107
+ * addImportPreset(wxt, "vue");
108
+ * // Custom preset:
109
+ * addImportPreset(wxt, {
110
+ * from: "vue",
111
+ * imports: ["ref", "reactive", ...],
112
+ * });
113
+ * // Auto-scanned preset:
114
+ * addImportPreset(wxt, { package: "vue" });
115
+ * });
116
+ */
117
+ declare function addImportPreset(wxt: Wxt, preset: UnimportOptions['presets'][0]): void;
90
118
 
91
- export { addEntrypoint, addPublicAssets, addViteConfig, addWxtPlugin, defineWxtModule };
119
+ export { WxtModule, addEntrypoint, addImportPreset, addPublicAssets, addViteConfig, addWxtPlugin, defineWxtModule };
package/dist/modules.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { a6 as WxtModuleOptions, a8 as WxtModule, a7 as WxtModuleSetup, Y as Wxt, r as Entrypoint } from './index-q2ZwJBs6.js';
1
+ import { a6 as WxtModuleOptions, a8 as WxtModule, a7 as WxtModuleSetup, Y as Wxt, r as Entrypoint } from './index-D6lH9OkP.js';
2
2
  import * as vite from 'vite';
3
+ import { UnimportOptions } from 'unimport';
3
4
  import 'webextension-polyfill';
4
- import 'unimport';
5
5
  import 'consola';
6
6
  import '@aklinker1/rollup-plugin-visualizer';
7
7
  import 'chokidar';
@@ -87,5 +87,33 @@ declare function addViteConfig(wxt: Wxt, viteConfig: (env: vite.ConfigEnv) => vi
87
87
  * });
88
88
  */
89
89
  declare function addWxtPlugin(wxt: Wxt, plugin: string): void;
90
+ /**
91
+ * Add an Unimport preset ([built-in](https://github.com/unjs/unimport?tab=readme-ov-file#built-in-presets),
92
+ * [custom](https://github.com/unjs/unimport?tab=readme-ov-file#custom-presets),
93
+ * or [auto-scanned](https://github.com/unjs/unimport?tab=readme-ov-file#exports-auto-scan)),
94
+ * to the project's list of auto-imported utilities.
95
+ *
96
+ * Some things to note:
97
+ * - This function will only de-duplicate built-in preset names. It will not
98
+ * stop you adding duplicate custom or auto-scanned presets.
99
+ * - If the project has disabled imports, this function has no effect.
100
+ *
101
+ * @param wxt The wxt instance provided by the module's setup function.
102
+ * @param preset The preset to add to the project.
103
+ *
104
+ * @example
105
+ * export default defineWxtModule((wxt) => {
106
+ * // Built-in preset:
107
+ * addImportPreset(wxt, "vue");
108
+ * // Custom preset:
109
+ * addImportPreset(wxt, {
110
+ * from: "vue",
111
+ * imports: ["ref", "reactive", ...],
112
+ * });
113
+ * // Auto-scanned preset:
114
+ * addImportPreset(wxt, { package: "vue" });
115
+ * });
116
+ */
117
+ declare function addImportPreset(wxt: Wxt, preset: UnimportOptions['presets'][0]): void;
90
118
 
91
- export { addEntrypoint, addPublicAssets, addViteConfig, addWxtPlugin, defineWxtModule };
119
+ export { WxtModule, addEntrypoint, addImportPreset, addPublicAssets, addViteConfig, addWxtPlugin, defineWxtModule };
package/dist/modules.js CHANGED
@@ -1,12 +1,11 @@
1
- import "./chunk-VBXJIVYU.js";
1
+ import "./chunk-QGM4M3NI.js";
2
2
 
3
3
  // src/modules.ts
4
4
  import * as vite from "vite";
5
5
  import glob from "fast-glob";
6
6
  import { resolve } from "node:path";
7
7
  function defineWxtModule(module) {
8
- if (typeof module === "function")
9
- return { setup: module };
8
+ if (typeof module === "function") return { setup: module };
10
9
  return module;
11
10
  }
12
11
  function addEntrypoint(wxt, entrypoint) {
@@ -42,8 +41,17 @@ function addWxtPlugin(wxt, plugin) {
42
41
  wxt2.config.plugins.push(plugin);
43
42
  });
44
43
  }
44
+ function addImportPreset(wxt, preset) {
45
+ wxt.hooks.hook("ready", (wxt2) => {
46
+ if (!wxt2.config.imports) return;
47
+ wxt2.config.imports.presets ??= [];
48
+ if (wxt2.config.imports.presets.includes(preset)) return;
49
+ wxt2.config.imports.presets.push(preset);
50
+ });
51
+ }
45
52
  export {
46
53
  addEntrypoint,
54
+ addImportPreset,
47
55
  addPublicAssets,
48
56
  addViteConfig,
49
57
  addWxtPlugin,
@@ -3,8 +3,8 @@ import {
3
3
  colors,
4
4
  getDefaultExportFromCjs,
5
5
  isUnicodeSupported
6
- } from "./chunk-NAMV4VWQ.js";
7
- import "./chunk-73I7FAJU.js";
6
+ } from "./chunk-KPD5J7PZ.js";
7
+ import "./chunk-SGKCDMVR.js";
8
8
 
9
9
  // ../../node_modules/.pnpm/consola@3.2.3/node_modules/consola/dist/chunks/prompt.mjs
10
10
  import { stdin, stdout } from "node:process";
@@ -16,20 +16,15 @@ var CSI = `${ESC}[`;
16
16
  var beep = "\x07";
17
17
  var cursor = {
18
18
  to(x, y) {
19
- if (!y)
20
- return `${CSI}${x + 1}G`;
19
+ if (!y) return `${CSI}${x + 1}G`;
21
20
  return `${CSI}${y + 1};${x + 1}H`;
22
21
  },
23
22
  move(x, y) {
24
23
  let ret = "";
25
- if (x < 0)
26
- ret += `${CSI}${-x}D`;
27
- else if (x > 0)
28
- ret += `${CSI}${x}C`;
29
- if (y < 0)
30
- ret += `${CSI}${-y}A`;
31
- else if (y > 0)
32
- ret += `${CSI}${y}B`;
24
+ if (x < 0) ret += `${CSI}${-x}D`;
25
+ else if (x > 0) ret += `${CSI}${x}C`;
26
+ if (y < 0) ret += `${CSI}${-y}A`;
27
+ else if (y > 0) ret += `${CSI}${y}B`;
33
28
  return ret;
34
29
  },
35
30
  up: (count = 1) => `${CSI}${count}A`,
@@ -116,8 +111,7 @@ function z({ onlyFirst: t = false } = {}) {
116
111
  return new RegExp(u, t ? void 0 : "g");
117
112
  }
118
113
  function $(t) {
119
- if (typeof t != "string")
120
- throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
114
+ if (typeof t != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
121
115
  return t.replace(z(), "");
122
116
  }
123
117
  var m = {};
@@ -139,18 +133,14 @@ var G = { get exports() {
139
133
  return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
140
134
  }
141
135
  u.length = function(e) {
142
- for (var s2 = F(e), C = 0, D = 0; D < s2.length; D++)
143
- C = C + this.characterLength(s2[D]);
136
+ for (var s2 = F(e), C = 0, D = 0; D < s2.length; D++) C = C + this.characterLength(s2[D]);
144
137
  return C;
145
138
  }, u.slice = function(e, s2, C) {
146
139
  textLen = u.length(e), s2 = s2 || 0, C = C || 1, s2 < 0 && (s2 = textLen + s2), C < 0 && (C = textLen + C);
147
140
  for (var D = "", i = 0, o = F(e), E = 0; E < o.length; E++) {
148
141
  var a = o[E], n = u.length(a);
149
- if (i >= s2 - (n == 2 ? 1 : 0))
150
- if (i + n <= C)
151
- D += a;
152
- else
153
- break;
142
+ if (i >= s2 - (n == 2 ? 1 : 0)) if (i + n <= C) D += a;
143
+ else break;
154
144
  i += n;
155
145
  }
156
146
  return D;
@@ -161,15 +151,13 @@ var Y = function() {
161
151
  return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E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DCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\u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uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
162
152
  };
163
153
  function c(t, u = {}) {
164
- if (typeof t != "string" || t.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, t = $(t), t.length === 0))
165
- return 0;
154
+ if (typeof t != "string" || t.length === 0 || (u = { ambiguousIsNarrow: true, ...u }, t = $(t), t.length === 0)) return 0;
166
155
  t = t.replace(Y(), " ");
167
156
  const F = u.ambiguousIsNarrow ? 1 : 2;
168
157
  let e = 0;
169
158
  for (const s2 of t) {
170
159
  const C = s2.codePointAt(0);
171
- if (C <= 31 || C >= 127 && C <= 159 || C >= 768 && C <= 879)
172
- continue;
160
+ if (C <= 31 || C >= 127 && C <= 159 || C >= 768 && C <= 879) continue;
173
161
  switch (K.eastAsianWidth(s2)) {
174
162
  case "F":
175
163
  case "W":
@@ -196,34 +184,28 @@ var H = Object.keys(r.bgColor);
196
184
  function U() {
197
185
  const t = /* @__PURE__ */ new Map();
198
186
  for (const [u, F] of Object.entries(r)) {
199
- for (const [e, s2] of Object.entries(F))
200
- r[e] = { open: `\x1B[${s2[0]}m`, close: `\x1B[${s2[1]}m` }, F[e] = r[e], t.set(s2[0], s2[1]);
187
+ for (const [e, s2] of Object.entries(F)) r[e] = { open: `\x1B[${s2[0]}m`, close: `\x1B[${s2[1]}m` }, F[e] = r[e], t.set(s2[0], s2[1]);
201
188
  Object.defineProperty(r, u, { value: F, enumerable: false });
202
189
  }
203
190
  return Object.defineProperty(r, "codes", { value: t, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = L(), r.color.ansi256 = M(), r.color.ansi16m = T(), r.bgColor.ansi = L(v), r.bgColor.ansi256 = M(v), r.bgColor.ansi16m = T(v), Object.defineProperties(r, { rgbToAnsi256: { value: (u, F, e) => u === F && F === e ? u < 8 ? 16 : u > 248 ? 231 : Math.round((u - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u / 255 * 5) + 6 * Math.round(F / 255 * 5) + Math.round(e / 255 * 5), enumerable: false }, hexToRgb: { value: (u) => {
204
191
  const F = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));
205
- if (!F)
206
- return [0, 0, 0];
192
+ if (!F) return [0, 0, 0];
207
193
  let [e] = F;
208
194
  e.length === 3 && (e = [...e].map((C) => C + C).join(""));
209
195
  const s2 = Number.parseInt(e, 16);
210
196
  return [s2 >> 16 & 255, s2 >> 8 & 255, s2 & 255];
211
197
  }, enumerable: false }, hexToAnsi256: { value: (u) => r.rgbToAnsi256(...r.hexToRgb(u)), enumerable: false }, ansi256ToAnsi: { value: (u) => {
212
- if (u < 8)
213
- return 30 + u;
214
- if (u < 16)
215
- return 90 + (u - 8);
198
+ if (u < 8) return 30 + u;
199
+ if (u < 16) return 90 + (u - 8);
216
200
  let F, e, s2;
217
- if (u >= 232)
218
- F = ((u - 232) * 10 + 8) / 255, e = F, s2 = F;
201
+ if (u >= 232) F = ((u - 232) * 10 + 8) / 255, e = F, s2 = F;
219
202
  else {
220
203
  u -= 16;
221
204
  const i = u % 36;
222
205
  F = Math.floor(u / 36) / 5, e = Math.floor(i / 6) / 5, s2 = i % 6 / 5;
223
206
  }
224
207
  const C = Math.max(F, e, s2) * 2;
225
- if (C === 0)
226
- return 30;
208
+ if (C === 0) return 30;
227
209
  let D = 30 + (Math.round(s2) << 2 | Math.round(e) << 1 | Math.round(F));
228
210
  return C === 2 && (D += 60), D;
229
211
  }, enumerable: false }, rgbToAnsi: { value: (u, F, e) => r.ansi256ToAnsi(r.rgbToAnsi256(u, F, e)), enumerable: false }, hexToAnsi: { value: (u) => r.ansi256ToAnsi(r.hexToAnsi256(u)), enumerable: false } }), r;
@@ -255,13 +237,11 @@ var _ = (t, u, F) => {
255
237
  var DD = (t) => {
256
238
  const u = t.split(" ");
257
239
  let F = u.length;
258
- for (; F > 0 && !(c(u[F - 1]) > 0); )
259
- F--;
240
+ for (; F > 0 && !(c(u[F - 1]) > 0); ) F--;
260
241
  return F === u.length ? t : u.slice(0, F).join(" ") + u.slice(F).join("");
261
242
  };
262
243
  var uD = (t, u, F = {}) => {
263
- if (F.trim !== false && t.trim() === "")
264
- return "";
244
+ if (F.trim !== false && t.trim() === "") return "";
265
245
  let e = "", s2, C;
266
246
  const D = X(t);
267
247
  let i = [""];
@@ -295,8 +275,7 @@ var uD = (t, u, F = {}) => {
295
275
  if (B.code !== void 0) {
296
276
  const A = Number.parseFloat(B.code);
297
277
  s2 = A === J ? void 0 : A;
298
- } else
299
- B.uri !== void 0 && (C = B.uri.length === 0 ? void 0 : B.uri);
278
+ } else B.uri !== void 0 && (C = B.uri.length === 0 ? void 0 : B.uri);
300
279
  }
301
280
  const n = q.codes.get(Number(s2));
302
281
  o[E + 1] === `
@@ -312,13 +291,11 @@ function P(t, u, F) {
312
291
  `);
313
292
  }
314
293
  function FD(t, u) {
315
- if (t === u)
316
- return;
294
+ if (t === u) return;
317
295
  const F = t.split(`
318
296
  `), e = u.split(`
319
297
  `), s2 = [];
320
- for (let C = 0; C < Math.max(F.length, e.length); C++)
321
- F[C] !== e[C] && s2.push(C);
298
+ for (let C = 0; C < Math.max(F.length, e.length); C++) F[C] !== e[C] && s2.push(C);
322
299
  return s2;
323
300
  }
324
301
  var R = Symbol("clack:cancel");
@@ -353,10 +330,8 @@ var h = class {
353
330
  }
354
331
  emit(u, ...F) {
355
332
  const e = this.subscribers.get(u) ?? [], s2 = [];
356
- for (const C of e)
357
- C.cb(...F), C.once && s2.push(() => e.splice(e.indexOf(C), 1));
358
- for (const C of s2)
359
- C();
333
+ for (const C of e) C.cb(...F), C.once && s2.push(() => e.splice(e.indexOf(C), 1));
334
+ for (const C of s2) C();
360
335
  }
361
336
  unsubscribe() {
362
337
  this.subscribers.clear();
@@ -383,8 +358,7 @@ var h = class {
383
358
  render() {
384
359
  const u = P(this._render(this) ?? "", process.stdout.columns, { hard: true });
385
360
  if (u !== this._prevFrame) {
386
- if (this.state === "initial")
387
- this.output.write(src.cursor.hide);
361
+ if (this.state === "initial") this.output.write(src.cursor.hide);
388
362
  else {
389
363
  const F = FD(this._prevFrame, u);
390
364
  if (this.restoreCursor(), F && F?.length === 1) {
@@ -486,8 +460,7 @@ var oD = class extends h {
486
460
  super(u), this.valueWithCursor = "", this.on("finalize", () => {
487
461
  this.value || (this.value = u.defaultValue), this.valueWithCursor = this.value;
488
462
  }), this.on("value", () => {
489
- if (this.cursor >= this.value.length)
490
- this.valueWithCursor = `${this.value}${l.inverse(l.hidden("_"))}`;
463
+ if (this.cursor >= this.value.length) this.valueWithCursor = `${this.value}${l.inverse(l.hidden("_"))}`;
491
464
  else {
492
465
  const F = this.value.slice(0, this.cursor), e = this.value.slice(this.cursor);
493
466
  this.valueWithCursor = `${F}${l.inverse(e[0])}${e.slice(1)}`;