wxt 0.14.4 → 0.14.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.
@@ -323,6 +323,24 @@ interface InlineConfig {
323
323
  */
324
324
  includeBrowserPolyfill?: boolean;
325
325
  };
326
+ /**
327
+ * Config effecting dev mode only.
328
+ */
329
+ dev?: {
330
+ /**
331
+ * Controls whether a custom keyboard shortcut command, `Alt+R`, is added during dev mode to
332
+ * quickly reload the extension.
333
+ *
334
+ * If false, the shortcut is not added during development.
335
+ *
336
+ * If set to a custom string, you can override the key combo used. See
337
+ * [Chrome's command docs](https://developer.chrome.com/docs/extensions/reference/api/commands)
338
+ * for available options.
339
+ *
340
+ * @default "Alt+R"
341
+ */
342
+ reloadCommand?: string | false;
343
+ };
326
344
  }
327
345
  interface InlineConfig {
328
346
  /**
@@ -370,15 +388,23 @@ interface BuildStepOutput {
370
388
  entrypoints: EntrypointGroup;
371
389
  chunks: OutputFile[];
372
390
  }
373
- interface WxtDevServer extends Omit<WxtBuilderServer, 'listen'>, ServerInfo {
391
+ interface WxtDevServer extends Omit<WxtBuilderServer, 'listen' | 'close'>, ServerInfo {
374
392
  /**
375
393
  * Stores the current build output of the server.
376
394
  */
377
- currentOutput: BuildOutput;
395
+ currentOutput: BuildOutput | undefined;
378
396
  /**
379
397
  * Start the server.
380
398
  */
381
399
  start(): Promise<void>;
400
+ /**
401
+ * Stop the server.
402
+ */
403
+ stop(): Promise<void>;
404
+ /**
405
+ * Close the browser, stop the server, rebuild the entire extension, and start the server again.
406
+ */
407
+ restart(): Promise<void>;
382
408
  /**
383
409
  * Transform the HTML for dev mode.
384
410
  */
@@ -405,6 +431,10 @@ interface WxtDevServer extends Omit<WxtBuilderServer, 'listen'>, ServerInfo {
405
431
  * @param contentScript The manifest definition for a content script
406
432
  */
407
433
  reloadContentScript: (contentScript: Omit<Scripting.RegisteredContentScript, 'id'>) => void;
434
+ /**
435
+ * Grab the latest runner config and restart the browser.
436
+ */
437
+ restartBrowser: () => void;
408
438
  }
409
439
  type TargetBrowser = string;
410
440
  type TargetManifestVersion = 2 | 3;
@@ -686,6 +716,10 @@ interface WxtBuilderServer {
686
716
  * Start the server.
687
717
  */
688
718
  listen(): Promise<void>;
719
+ /**
720
+ * Stop the server.
721
+ */
722
+ close(): Promise<void>;
689
723
  /**
690
724
  * Transform the HTML for dev mode.
691
725
  */
@@ -323,6 +323,24 @@ interface InlineConfig {
323
323
  */
324
324
  includeBrowserPolyfill?: boolean;
325
325
  };
326
+ /**
327
+ * Config effecting dev mode only.
328
+ */
329
+ dev?: {
330
+ /**
331
+ * Controls whether a custom keyboard shortcut command, `Alt+R`, is added during dev mode to
332
+ * quickly reload the extension.
333
+ *
334
+ * If false, the shortcut is not added during development.
335
+ *
336
+ * If set to a custom string, you can override the key combo used. See
337
+ * [Chrome's command docs](https://developer.chrome.com/docs/extensions/reference/api/commands)
338
+ * for available options.
339
+ *
340
+ * @default "Alt+R"
341
+ */
342
+ reloadCommand?: string | false;
343
+ };
326
344
  }
327
345
  interface InlineConfig {
328
346
  /**
@@ -370,15 +388,23 @@ interface BuildStepOutput {
370
388
  entrypoints: EntrypointGroup;
371
389
  chunks: OutputFile[];
372
390
  }
373
- interface WxtDevServer extends Omit<WxtBuilderServer, 'listen'>, ServerInfo {
391
+ interface WxtDevServer extends Omit<WxtBuilderServer, 'listen' | 'close'>, ServerInfo {
374
392
  /**
375
393
  * Stores the current build output of the server.
376
394
  */
377
- currentOutput: BuildOutput;
395
+ currentOutput: BuildOutput | undefined;
378
396
  /**
379
397
  * Start the server.
380
398
  */
381
399
  start(): Promise<void>;
400
+ /**
401
+ * Stop the server.
402
+ */
403
+ stop(): Promise<void>;
404
+ /**
405
+ * Close the browser, stop the server, rebuild the entire extension, and start the server again.
406
+ */
407
+ restart(): Promise<void>;
382
408
  /**
383
409
  * Transform the HTML for dev mode.
384
410
  */
@@ -405,6 +431,10 @@ interface WxtDevServer extends Omit<WxtBuilderServer, 'listen'>, ServerInfo {
405
431
  * @param contentScript The manifest definition for a content script
406
432
  */
407
433
  reloadContentScript: (contentScript: Omit<Scripting.RegisteredContentScript, 'id'>) => void;
434
+ /**
435
+ * Grab the latest runner config and restart the browser.
436
+ */
437
+ restartBrowser: () => void;
408
438
  }
409
439
  type TargetBrowser = string;
410
440
  type TargetManifestVersion = 2 | 3;
@@ -686,6 +716,10 @@ interface WxtBuilderServer {
686
716
  * Start the server.
687
717
  */
688
718
  listen(): Promise<void>;
719
+ /**
720
+ * Stop the server.
721
+ */
722
+ close(): Promise<void>;
689
723
  /**
690
724
  * Transform the HTML for dev mode.
691
725
  */