wxt 0.13.2 → 0.13.4

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.
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.13.2";
2
+ var version = "0.13.4";
3
3
 
4
4
  // src/core/utils/arrays.ts
5
5
  function every(array, predicate) {
@@ -1009,6 +1009,9 @@ async function craeteViteBuilder(inlineConfig, userConfig, wxtConfig) {
1009
1009
  config.build ??= {};
1010
1010
  config.build.outDir = wxtConfig.outDir;
1011
1011
  config.build.emptyOutDir = false;
1012
+ if (config.build.minify == null && wxtConfig.command === "serve") {
1013
+ config.build.minify = false;
1014
+ }
1012
1015
  config.plugins ??= [];
1013
1016
  config.plugins.push(
1014
1017
  download(wxtConfig),
@@ -1751,27 +1754,42 @@ async function writeManifest(manifest, output, config) {
1751
1754
  fileName: "manifest.json"
1752
1755
  });
1753
1756
  }
1754
- async function generateMainfest(entrypoints, buildOutput, config) {
1757
+ async function generateManifest(entrypoints, buildOutput, config) {
1755
1758
  const pkg = await getPackageJson(config);
1756
- const versionName = config.manifest.version_name ?? pkg?.version;
1757
- const version2 = config.manifest.version ?? simplifyVersion(pkg?.version);
1759
+ let versionName = config.manifest.version_name ?? config.manifest.version ?? pkg?.version;
1760
+ if (versionName == null) {
1761
+ versionName = "0.0.0";
1762
+ config.logger.warn(
1763
+ 'Extension version not found, defaulting to "0.0.0". Add a version to your `package.json` or `wxt.config.ts` file. For more details, see: https://wxt.dev/guide/manifest.html#version-and-version-name'
1764
+ );
1765
+ }
1766
+ const version2 = config.manifest.version ?? simplifyVersion(versionName);
1758
1767
  const baseManifest = {
1759
1768
  manifest_version: config.manifestVersion,
1760
1769
  name: pkg?.name,
1761
1770
  description: pkg?.description,
1762
1771
  version: version2,
1763
- version_name: (
1764
- // Firefox doesn't support version_name
1765
- config.browser === "firefox" || versionName === version2 ? void 0 : versionName
1766
- ),
1767
1772
  short_name: pkg?.shortName,
1768
1773
  icons: discoverIcons(buildOutput)
1769
1774
  };
1775
+ if (config.command === "serve") {
1776
+ baseManifest.commands = {
1777
+ "wxt:reload-extension": {
1778
+ description: "Reload the extension during development",
1779
+ suggested_key: {
1780
+ default: "Ctrl+E"
1781
+ }
1782
+ }
1783
+ };
1784
+ }
1770
1785
  const userManifest = config.manifest;
1771
1786
  const manifest = defu3(
1772
1787
  userManifest,
1773
1788
  baseManifest
1774
1789
  );
1790
+ manifest.version = version2;
1791
+ manifest.version_name = // Firefox doesn't support version_name
1792
+ config.browser === "firefox" || versionName === version2 ? void 0 : versionName;
1775
1793
  addEntrypoints(manifest, entrypoints, buildOutput, config);
1776
1794
  if (config.command === "serve")
1777
1795
  addDevModeCsp(manifest, config);
@@ -2139,7 +2157,7 @@ async function rebuild(config, entrypointGroups, existingOutput = {
2139
2157
  steps: [...existingOutput.steps, ...newOutput.steps],
2140
2158
  publicAssets: [...existingOutput.publicAssets, ...newOutput.publicAssets]
2141
2159
  };
2142
- const newManifest = await generateMainfest(
2160
+ const newManifest = await generateManifest(
2143
2161
  allEntrypoints,
2144
2162
  mergedOutput,
2145
2163
  config
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ import "./chunk-VBXJIVYU.js";
4
4
  import cac from "cac";
5
5
 
6
6
  // package.json
7
- var version = "0.13.2";
7
+ var version = "0.13.4";
8
8
 
9
9
  // src/core/utils/fs.ts
10
10
  import fs from "fs-extra";
@@ -1302,6 +1302,9 @@ async function craeteViteBuilder(inlineConfig, userConfig, wxtConfig) {
1302
1302
  config.build ??= {};
1303
1303
  config.build.outDir = wxtConfig.outDir;
1304
1304
  config.build.emptyOutDir = false;
1305
+ if (config.build.minify == null && wxtConfig.command === "serve") {
1306
+ config.build.minify = false;
1307
+ }
1305
1308
  config.plugins ??= [];
1306
1309
  config.plugins.push(
1307
1310
  download(wxtConfig),
@@ -2048,27 +2051,42 @@ async function writeManifest(manifest, output, config) {
2048
2051
  fileName: "manifest.json"
2049
2052
  });
2050
2053
  }
2051
- async function generateMainfest(entrypoints, buildOutput, config) {
2054
+ async function generateManifest(entrypoints, buildOutput, config) {
2052
2055
  const pkg = await getPackageJson(config);
2053
- const versionName = config.manifest.version_name ?? pkg?.version;
2054
- const version2 = config.manifest.version ?? simplifyVersion(pkg?.version);
2056
+ let versionName = config.manifest.version_name ?? config.manifest.version ?? pkg?.version;
2057
+ if (versionName == null) {
2058
+ versionName = "0.0.0";
2059
+ config.logger.warn(
2060
+ 'Extension version not found, defaulting to "0.0.0". Add a version to your `package.json` or `wxt.config.ts` file. For more details, see: https://wxt.dev/guide/manifest.html#version-and-version-name'
2061
+ );
2062
+ }
2063
+ const version2 = config.manifest.version ?? simplifyVersion(versionName);
2055
2064
  const baseManifest = {
2056
2065
  manifest_version: config.manifestVersion,
2057
2066
  name: pkg?.name,
2058
2067
  description: pkg?.description,
2059
2068
  version: version2,
2060
- version_name: (
2061
- // Firefox doesn't support version_name
2062
- config.browser === "firefox" || versionName === version2 ? void 0 : versionName
2063
- ),
2064
2069
  short_name: pkg?.shortName,
2065
2070
  icons: discoverIcons(buildOutput)
2066
2071
  };
2072
+ if (config.command === "serve") {
2073
+ baseManifest.commands = {
2074
+ "wxt:reload-extension": {
2075
+ description: "Reload the extension during development",
2076
+ suggested_key: {
2077
+ default: "Ctrl+E"
2078
+ }
2079
+ }
2080
+ };
2081
+ }
2067
2082
  const userManifest = config.manifest;
2068
2083
  const manifest = defu3(
2069
2084
  userManifest,
2070
2085
  baseManifest
2071
2086
  );
2087
+ manifest.version = version2;
2088
+ manifest.version_name = // Firefox doesn't support version_name
2089
+ config.browser === "firefox" || versionName === version2 ? void 0 : versionName;
2072
2090
  addEntrypoints(manifest, entrypoints, buildOutput, config);
2073
2091
  if (config.command === "serve")
2074
2092
  addDevModeCsp(manifest, config);
@@ -2436,7 +2454,7 @@ async function rebuild(config, entrypointGroups, existingOutput = {
2436
2454
  steps: [...existingOutput.steps, ...newOutput.steps],
2437
2455
  publicAssets: [...existingOutput.publicAssets, ...newOutput.publicAssets]
2438
2456
  };
2439
- const newManifest = await generateMainfest(
2457
+ const newManifest = await generateManifest(
2440
2458
  allEntrypoints,
2441
2459
  mergedOutput,
2442
2460
  config
package/dist/index.cjs CHANGED
@@ -3726,6 +3726,9 @@ async function craeteViteBuilder(inlineConfig, userConfig, wxtConfig) {
3726
3726
  config.build ??= {};
3727
3727
  config.build.outDir = wxtConfig.outDir;
3728
3728
  config.build.emptyOutDir = false;
3729
+ if (config.build.minify == null && wxtConfig.command === "serve") {
3730
+ config.build.minify = false;
3731
+ }
3729
3732
  config.plugins ??= [];
3730
3733
  config.plugins.push(
3731
3734
  download(wxtConfig),
@@ -4334,7 +4337,7 @@ function getChunkSortWeight(filename) {
4334
4337
  var import_picocolors3 = __toESM(require("picocolors"), 1);
4335
4338
 
4336
4339
  // package.json
4337
- var version = "0.13.2";
4340
+ var version = "0.13.4";
4338
4341
 
4339
4342
  // src/core/utils/log/printHeader.ts
4340
4343
  var import_consola2 = require("consola");
@@ -4474,27 +4477,42 @@ async function writeManifest(manifest, output, config) {
4474
4477
  fileName: "manifest.json"
4475
4478
  });
4476
4479
  }
4477
- async function generateMainfest(entrypoints, buildOutput, config) {
4480
+ async function generateManifest(entrypoints, buildOutput, config) {
4478
4481
  const pkg = await getPackageJson(config);
4479
- const versionName = config.manifest.version_name ?? pkg?.version;
4480
- const version2 = config.manifest.version ?? simplifyVersion(pkg?.version);
4482
+ let versionName = config.manifest.version_name ?? config.manifest.version ?? pkg?.version;
4483
+ if (versionName == null) {
4484
+ versionName = "0.0.0";
4485
+ config.logger.warn(
4486
+ 'Extension version not found, defaulting to "0.0.0". Add a version to your `package.json` or `wxt.config.ts` file. For more details, see: https://wxt.dev/guide/manifest.html#version-and-version-name'
4487
+ );
4488
+ }
4489
+ const version2 = config.manifest.version ?? simplifyVersion(versionName);
4481
4490
  const baseManifest = {
4482
4491
  manifest_version: config.manifestVersion,
4483
4492
  name: pkg?.name,
4484
4493
  description: pkg?.description,
4485
4494
  version: version2,
4486
- version_name: (
4487
- // Firefox doesn't support version_name
4488
- config.browser === "firefox" || versionName === version2 ? void 0 : versionName
4489
- ),
4490
4495
  short_name: pkg?.shortName,
4491
4496
  icons: discoverIcons(buildOutput)
4492
4497
  };
4498
+ if (config.command === "serve") {
4499
+ baseManifest.commands = {
4500
+ "wxt:reload-extension": {
4501
+ description: "Reload the extension during development",
4502
+ suggested_key: {
4503
+ default: "Ctrl+E"
4504
+ }
4505
+ }
4506
+ };
4507
+ }
4493
4508
  const userManifest = config.manifest;
4494
4509
  const manifest = (0, import_defu3.default)(
4495
4510
  userManifest,
4496
4511
  baseManifest
4497
4512
  );
4513
+ manifest.version = version2;
4514
+ manifest.version_name = // Firefox doesn't support version_name
4515
+ config.browser === "firefox" || versionName === version2 ? void 0 : versionName;
4498
4516
  addEntrypoints(manifest, entrypoints, buildOutput, config);
4499
4517
  if (config.command === "serve")
4500
4518
  addDevModeCsp(manifest, config);
@@ -4862,7 +4880,7 @@ async function rebuild(config, entrypointGroups, existingOutput = {
4862
4880
  steps: [...existingOutput.steps, ...newOutput.steps],
4863
4881
  publicAssets: [...existingOutput.publicAssets, ...newOutput.publicAssets]
4864
4882
  };
4865
- const newManifest = await generateMainfest(
4883
+ const newManifest = await generateManifest(
4866
4884
  allEntrypoints,
4867
4885
  mergedOutput,
4868
4886
  config
package/dist/index.d.cts CHANGED
@@ -62,6 +62,6 @@ declare function prepare(config: InlineConfig): Promise<void>;
62
62
  */
63
63
  declare function zip(config?: InlineConfig): Promise<string[]>;
64
64
 
65
- var version = "0.13.2";
65
+ var version = "0.13.4";
66
66
 
67
67
  export { BuildOutput, ExtensionRunnerConfig, InlineConfig, UserConfig, WxtDevServer, build, clean, createServer, defineConfig, defineRunnerConfig, initialize, prepare, version, zip };
package/dist/index.d.ts CHANGED
@@ -62,6 +62,6 @@ declare function prepare(config: InlineConfig): Promise<void>;
62
62
  */
63
63
  declare function zip(config?: InlineConfig): Promise<string[]>;
64
64
 
65
- var version = "0.13.2";
65
+ var version = "0.13.4";
66
66
 
67
67
  export { BuildOutput, ExtensionRunnerConfig, InlineConfig, UserConfig, WxtDevServer, build, clean, createServer, defineConfig, defineRunnerConfig, initialize, prepare, version, zip };
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  rebuild,
16
16
  resolvePerBrowserOption,
17
17
  version
18
- } from "./chunk-DCONVSW5.js";
18
+ } from "./chunk-DHQJ6WF5.js";
19
19
  import "./chunk-VBXJIVYU.js";
20
20
 
21
21
  // src/core/build.ts
package/dist/testing.cjs CHANGED
@@ -734,6 +734,9 @@ async function craeteViteBuilder(inlineConfig, userConfig, wxtConfig) {
734
734
  config.build ??= {};
735
735
  config.build.outDir = wxtConfig.outDir;
736
736
  config.build.emptyOutDir = false;
737
+ if (config.build.minify == null && wxtConfig.command === "serve") {
738
+ config.build.minify = false;
739
+ }
737
740
  config.plugins ??= [];
738
741
  config.plugins.push(
739
742
  download(wxtConfig),
package/dist/testing.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  tsconfigPaths,
6
6
  unimport,
7
7
  webextensionPolyfillMock
8
- } from "./chunk-DCONVSW5.js";
8
+ } from "./chunk-DHQJ6WF5.js";
9
9
  import "./chunk-VBXJIVYU.js";
10
10
 
11
11
  // src/testing/fake-browser.ts
@@ -116,6 +116,11 @@ if (__COMMAND__ === "serve") {
116
116
  } catch (err) {
117
117
  logger.error("Failed to setup web socket connection with dev server", err);
118
118
  }
119
+ browser3.commands.onCommand.addListener((command) => {
120
+ if (command === "wxt:reload-extension") {
121
+ browser3.runtime.reload();
122
+ }
123
+ });
119
124
  }
120
125
  try {
121
126
  const res = definition.main();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wxt",
3
3
  "type": "module",
4
- "version": "0.13.2",
4
+ "version": "0.13.4",
5
5
  "description": "Next gen framework for developing web extensions",
6
6
  "engines": {
7
7
  "node": ">=18",
@@ -139,7 +139,7 @@
139
139
  "typedoc-plugin-markdown": "4.0.0-next.23",
140
140
  "typedoc-vitepress-theme": "1.0.0-next.3",
141
141
  "typescript": "^5.3.2",
142
- "vitepress": "1.0.0-rc.31",
142
+ "vitepress": "1.0.0-rc.34",
143
143
  "vitest": "^1.1.0",
144
144
  "vitest-mock-extended": "^1.3.1",
145
145
  "vue": "^3.3.10"
package/dist/cli.d.ts DELETED
@@ -1,2 +0,0 @@
1
-
2
- export { }