wxt 0.3.2 → 0.4.1

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,6 +1,7 @@
1
1
  import * as vite from 'vite';
2
2
  import { Manifest, Scripting } from 'webextension-polyfill';
3
3
  import { UnimportOptions } from 'unimport';
4
+ import { LogLevel } from 'consola';
4
5
 
5
6
  interface InlineConfig {
6
7
  /**
@@ -28,11 +29,19 @@ interface InlineConfig {
28
29
  */
29
30
  entrypointsDir?: string;
30
31
  /**
32
+ * > Only available when using the JS API. Not available in `wxt.config.ts` files
33
+ *
31
34
  * Path to `"wxt.config.ts"` file or false to disable config file discovery.
32
35
  *
33
36
  * @default "wxt.config.ts"
34
37
  */
35
38
  configFile?: string | false;
39
+ /**
40
+ * Set to `true` to show debug logs. Overriden by the command line `--debug` option.
41
+ *
42
+ * @default false
43
+ */
44
+ debug?: boolean;
36
45
  /**
37
46
  * ID of the extension for each store. Used for publishing.
38
47
  */
@@ -207,6 +216,7 @@ interface Logger {
207
216
  error(...args: any[]): void;
208
217
  fatal(...args: any[]): void;
209
218
  success(...args: any[]): void;
219
+ level: LogLevel;
210
220
  }
211
221
  interface BaseEntrypoint {
212
222
  /**
@@ -326,7 +336,7 @@ interface BackgroundScriptDefintition {
326
336
  * Manifest customization available in the `wxt.config.ts` file. You cannot configure entrypoints
327
337
  * here, they are configured inline.
328
338
  */
329
- type UserManifest = Partial<Omit<Manifest.WebExtensionManifest, 'action' | 'background' | 'browser_action' | 'chrome_url_overrides' | 'content_scripts' | 'devtools_page' | 'manifest_version' | 'options_page' | 'options_ui' | 'sandbox' | 'page_action' | 'popup' | 'sidepanel' | 'sidebar_action'>>;
339
+ type UserManifest = Partial<Omit<Manifest.WebExtensionManifest, 'action' | 'background' | 'browser_action' | 'chrome_url_overrides' | 'devtools_page' | 'manifest_version' | 'options_page' | 'options_ui' | 'sandbox' | 'page_action' | 'popup' | 'sidepanel' | 'sidebar_action'>>;
330
340
  type UserManifestFn = (env: ConfigEnv) => UserManifest | Promise<UserManifest>;
331
341
  interface ConfigEnv {
332
342
  mode: string;
@@ -401,7 +411,14 @@ interface ExtensionRunnerConfig {
401
411
 
402
412
  type EntrypointGroup = Entrypoint | Entrypoint[];
403
413
 
404
- var version = "0.3.2";
414
+ /**
415
+ * Remove generated/temp files from the directory.
416
+ *
417
+ * @param root The directory to look for generated/temp files in. Defaults to `process.cwd()`. Can be relative to `process.cwd()` or absolute.
418
+ */
419
+ declare function clean(root?: string): Promise<void>;
420
+
421
+ var version = "0.4.1";
405
422
 
406
423
  declare function defineConfig(config: UserConfig): UserConfig;
407
424
 
@@ -417,4 +434,4 @@ declare function build(config: InlineConfig): Promise<BuildOutput>;
417
434
  */
418
435
  declare function createServer(config?: InlineConfig): Promise<WxtDevServer>;
419
436
 
420
- export { BackgroundEntrypoint, BackgroundScriptDefintition, BaseEntrypoint, BuildOutput, BuildStepOutput, ConfigEnv, ContentScriptDefinition, ContentScriptEntrypoint, Entrypoint, ExtensionRunnerConfig, GenericEntrypoint, InlineConfig, Logger, OnContentScriptStopped, OptionsEntrypoint, PopupEntrypoint, TargetBrowser, TargetManifestVersion, UserConfig, UserManifest, UserManifestFn, WxtDevServer, WxtInlineViteConfig, build, createServer, defineConfig, defineRunnerConfig, version };
437
+ export { BackgroundEntrypoint, BackgroundScriptDefintition, BaseEntrypoint, BuildOutput, BuildStepOutput, ConfigEnv, ContentScriptDefinition, ContentScriptEntrypoint, Entrypoint, ExtensionRunnerConfig, GenericEntrypoint, InlineConfig, Logger, OnContentScriptStopped, OptionsEntrypoint, PopupEntrypoint, TargetBrowser, TargetManifestVersion, UserConfig, UserManifest, UserManifestFn, WxtDevServer, WxtInlineViteConfig, build, clean, createServer, defineConfig, defineRunnerConfig, version };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as vite from 'vite';
2
2
  import { Manifest, Scripting } from 'webextension-polyfill';
3
3
  import { UnimportOptions } from 'unimport';
4
+ import { LogLevel } from 'consola';
4
5
 
5
6
  interface InlineConfig {
6
7
  /**
@@ -28,11 +29,19 @@ interface InlineConfig {
28
29
  */
29
30
  entrypointsDir?: string;
30
31
  /**
32
+ * > Only available when using the JS API. Not available in `wxt.config.ts` files
33
+ *
31
34
  * Path to `"wxt.config.ts"` file or false to disable config file discovery.
32
35
  *
33
36
  * @default "wxt.config.ts"
34
37
  */
35
38
  configFile?: string | false;
39
+ /**
40
+ * Set to `true` to show debug logs. Overriden by the command line `--debug` option.
41
+ *
42
+ * @default false
43
+ */
44
+ debug?: boolean;
36
45
  /**
37
46
  * ID of the extension for each store. Used for publishing.
38
47
  */
@@ -207,6 +216,7 @@ interface Logger {
207
216
  error(...args: any[]): void;
208
217
  fatal(...args: any[]): void;
209
218
  success(...args: any[]): void;
219
+ level: LogLevel;
210
220
  }
211
221
  interface BaseEntrypoint {
212
222
  /**
@@ -326,7 +336,7 @@ interface BackgroundScriptDefintition {
326
336
  * Manifest customization available in the `wxt.config.ts` file. You cannot configure entrypoints
327
337
  * here, they are configured inline.
328
338
  */
329
- type UserManifest = Partial<Omit<Manifest.WebExtensionManifest, 'action' | 'background' | 'browser_action' | 'chrome_url_overrides' | 'content_scripts' | 'devtools_page' | 'manifest_version' | 'options_page' | 'options_ui' | 'sandbox' | 'page_action' | 'popup' | 'sidepanel' | 'sidebar_action'>>;
339
+ type UserManifest = Partial<Omit<Manifest.WebExtensionManifest, 'action' | 'background' | 'browser_action' | 'chrome_url_overrides' | 'devtools_page' | 'manifest_version' | 'options_page' | 'options_ui' | 'sandbox' | 'page_action' | 'popup' | 'sidepanel' | 'sidebar_action'>>;
330
340
  type UserManifestFn = (env: ConfigEnv) => UserManifest | Promise<UserManifest>;
331
341
  interface ConfigEnv {
332
342
  mode: string;
@@ -401,7 +411,14 @@ interface ExtensionRunnerConfig {
401
411
 
402
412
  type EntrypointGroup = Entrypoint | Entrypoint[];
403
413
 
404
- var version = "0.3.2";
414
+ /**
415
+ * Remove generated/temp files from the directory.
416
+ *
417
+ * @param root The directory to look for generated/temp files in. Defaults to `process.cwd()`. Can be relative to `process.cwd()` or absolute.
418
+ */
419
+ declare function clean(root?: string): Promise<void>;
420
+
421
+ var version = "0.4.1";
405
422
 
406
423
  declare function defineConfig(config: UserConfig): UserConfig;
407
424
 
@@ -417,4 +434,4 @@ declare function build(config: InlineConfig): Promise<BuildOutput>;
417
434
  */
418
435
  declare function createServer(config?: InlineConfig): Promise<WxtDevServer>;
419
436
 
420
- export { BackgroundEntrypoint, BackgroundScriptDefintition, BaseEntrypoint, BuildOutput, BuildStepOutput, ConfigEnv, ContentScriptDefinition, ContentScriptEntrypoint, Entrypoint, ExtensionRunnerConfig, GenericEntrypoint, InlineConfig, Logger, OnContentScriptStopped, OptionsEntrypoint, PopupEntrypoint, TargetBrowser, TargetManifestVersion, UserConfig, UserManifest, UserManifestFn, WxtDevServer, WxtInlineViteConfig, build, createServer, defineConfig, defineRunnerConfig, version };
437
+ export { BackgroundEntrypoint, BackgroundScriptDefintition, BaseEntrypoint, BuildOutput, BuildStepOutput, ConfigEnv, ContentScriptDefinition, ContentScriptEntrypoint, Entrypoint, ExtensionRunnerConfig, GenericEntrypoint, InlineConfig, Logger, OnContentScriptStopped, OptionsEntrypoint, PopupEntrypoint, TargetBrowser, TargetManifestVersion, UserConfig, UserManifest, UserManifestFn, WxtDevServer, WxtInlineViteConfig, build, clean, createServer, defineConfig, defineRunnerConfig, version };