wxt 0.20.0-beta1 → 0.20.0-beta2

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/browser.d.ts +5 -3
  2. package/dist/browser.mjs +3 -7
  3. package/dist/builtin-modules/unimport.d.ts +0 -3
  4. package/dist/builtin-modules/unimport.mjs +2 -29
  5. package/dist/core/builders/vite/index.mjs +2 -0
  6. package/dist/core/create-server.mjs +27 -2
  7. package/dist/core/generate-wxt-dir.mjs +1 -2
  8. package/dist/core/resolve-config.d.ts +1 -1
  9. package/dist/core/resolve-config.mjs +12 -13
  10. package/dist/core/utils/building/detect-dev-changes.mjs +18 -7
  11. package/dist/core/utils/building/rebuild.d.ts +2 -1
  12. package/dist/core/utils/content-scripts.d.ts +2 -1
  13. package/dist/core/utils/env.d.ts +1 -1
  14. package/dist/core/utils/env.mjs +16 -13
  15. package/dist/core/utils/eslint.mjs +5 -3
  16. package/dist/core/utils/manifest.d.ts +4 -3
  17. package/dist/core/utils/manifest.mjs +7 -6
  18. package/dist/core/utils/syntax-errors.d.ts +11 -0
  19. package/dist/core/utils/syntax-errors.mjs +20 -0
  20. package/dist/core/utils/testing/fake-objects.d.ts +79 -78
  21. package/dist/core/utils/types.d.ts +3 -2
  22. package/dist/core/wxt.mjs +1 -1
  23. package/dist/testing/wxt-vitest-plugin.mjs +2 -5
  24. package/dist/types.d.ts +12 -12
  25. package/dist/utils/content-script-context.d.ts +2 -0
  26. package/dist/utils/content-script-context.mjs +11 -2
  27. package/dist/utils/content-script-ui/shared.mjs +3 -0
  28. package/dist/utils/content-script-ui/types.d.ts +1 -0
  29. package/dist/version.mjs +1 -1
  30. package/dist/virtual/background-entrypoint.mjs +2 -4
  31. package/dist/virtual/content-script-isolated-world-entrypoint.mjs +1 -2
  32. package/dist/virtual/content-script-main-world-entrypoint.mjs +1 -2
  33. package/dist/virtual/reload-html.mjs +2 -4
  34. package/dist/virtual/unlisted-script-entrypoint.mjs +1 -2
  35. package/package.json +19 -21
@@ -4,8 +4,7 @@ import { browser } from 'wxt/browser';
4
4
  import { MatchPattern } from 'wxt/utils/match-patterns';
5
5
 
6
6
  function print(method, ...args) {
7
- if (import.meta.env.MODE === "production")
8
- return;
7
+ if (import.meta.env.MODE === "production") return;
9
8
  if (typeof args[0] === "string") {
10
9
  const message = args.shift();
11
10
  method(`[wxt] ${message}`, ...args);
@@ -122,8 +121,7 @@ async function reloadTabsForContentScript(contentScript) {
122
121
  );
123
122
  const matchingTabs = allTabs.filter((tab) => {
124
123
  const url = tab.url;
125
- if (!url)
126
- return false;
124
+ if (!url) return false;
127
125
  return !!matchPatterns.find((pattern) => pattern.includes(url));
128
126
  });
129
127
  await Promise.all(
@@ -3,8 +3,7 @@ import { ContentScriptContext } from 'wxt/utils/content-script-context';
3
3
  import { initPlugins } from 'virtual:wxt-plugins';
4
4
 
5
5
  function print(method, ...args) {
6
- if (import.meta.env.MODE === "production")
7
- return;
6
+ if (import.meta.env.MODE === "production") return;
8
7
  if (typeof args[0] === "string") {
9
8
  const message = args.shift();
10
9
  method(`[wxt] ${message}`, ...args);
@@ -2,8 +2,7 @@ import definition from 'virtual:user-content-script-main-world-entrypoint';
2
2
  import { initPlugins } from 'virtual:wxt-plugins';
3
3
 
4
4
  function print(method, ...args) {
5
- if (import.meta.env.MODE === "production")
6
- return;
5
+ if (import.meta.env.MODE === "production") return;
7
6
  if (typeof args[0] === "string") {
8
7
  const message = args.shift();
9
8
  method(`[wxt] ${message}`, ...args);
@@ -1,6 +1,5 @@
1
1
  function print(method, ...args) {
2
- if (import.meta.env.MODE === "production")
3
- return;
2
+ if (import.meta.env.MODE === "production") return;
4
3
  if (typeof args[0] === "string") {
5
4
  const message = args.shift();
6
5
  method(`[wxt] ${message}`, ...args);
@@ -56,8 +55,7 @@ if (import.meta.env.COMMAND === "serve") {
56
55
  try {
57
56
  const ws = getDevServerWebSocket();
58
57
  ws.addWxtEventListener("wxt:reload-page", (event) => {
59
- if (event.detail === location.pathname.substring(1))
60
- location.reload();
58
+ if (event.detail === location.pathname.substring(1)) location.reload();
61
59
  });
62
60
  } catch (err) {
63
61
  logger.error("Failed to setup web socket connection with dev server", err);
@@ -2,8 +2,7 @@ import definition from 'virtual:user-unlisted-script-entrypoint';
2
2
  import { initPlugins } from 'virtual:wxt-plugins';
3
3
 
4
4
  function print(method, ...args) {
5
- if (import.meta.env.MODE === "production")
6
- return;
5
+ if (import.meta.env.MODE === "production") return;
7
6
  if (typeof args[0] === "string") {
8
7
  const message = args.shift();
9
8
  method(`[wxt] ${message}`, ...args);
package/package.json CHANGED
@@ -1,32 +1,33 @@
1
1
  {
2
2
  "name": "wxt",
3
3
  "type": "module",
4
- "version": "0.20.0-beta1",
5
- "description": "Next gen framework for developing web extensions",
4
+ "version": "0.20.0-beta2",
5
+ "description": "Next-gen Web Extension Framework",
6
6
  "license": "MIT",
7
7
  "dependencies": {
8
8
  "@1natsu/wait-element": "^4.1.2",
9
9
  "@aklinker1/rollup-plugin-visualizer": "5.12.0",
10
- "@types/chrome": "^0.0.280",
11
10
  "@webext-core/fake-browser": "^1.3.1",
12
11
  "@webext-core/isolated-element": "^1.1.2",
13
12
  "@webext-core/match-patterns": "^1.0.3",
14
13
  "@wxt-dev/storage": "^1.0.0",
15
14
  "async-mutex": "^0.5.0",
16
- "c12": "^2.0.1",
15
+ "c12": "^3.0.2",
17
16
  "cac": "^6.7.14",
18
- "chokidar": "^3.6.0",
17
+ "chokidar": "^4.0.3",
19
18
  "ci-info": "^4.1.0",
20
19
  "consola": "^3.2.3",
21
20
  "defu": "^6.1.4",
22
21
  "dotenv": "^16.4.5",
23
- "esbuild": "^0.21.5",
22
+ "dotenv-expand": "^12.0.1",
23
+ "esbuild": "^0.25.0",
24
24
  "fast-glob": "^3.3.2",
25
25
  "filesize": "^10.1.6",
26
26
  "fs-extra": "^11.2.0",
27
27
  "get-port-please": "^3.1.2",
28
- "giget": "^1.2.3",
28
+ "giget": "^1.2.3 || ^2.0.0",
29
29
  "hookable": "^5.5.3",
30
+ "import-meta-resolve": "^4.1.0",
30
31
  "is-wsl": "^3.1.0",
31
32
  "json5": "^2.2.3",
32
33
  "jszip": "^3.10.1",
@@ -42,12 +43,13 @@
42
43
  "perfect-debounce": "^1.0.0",
43
44
  "picocolors": "^1.1.1",
44
45
  "prompts": "^2.4.2",
45
- "publish-browser-extension": "^2.2.2",
46
+ "publish-browser-extension": "^2.3.0 || ^3.0.0",
46
47
  "scule": "^1.3.0",
47
- "unimport": "^3.13.1",
48
+ "unimport": "^3.13.1 || ^4.0.0",
48
49
  "vite": "^5.0.0 || ^6.0.0",
49
- "vite-node": "^2.1.4",
50
- "web-ext-run": "^0.2.1"
50
+ "vite-node": "^2.1.4 || ^3.0.0",
51
+ "web-ext-run": "^0.2.1",
52
+ "@wxt-dev/browser": "0.0.310"
51
53
  },
52
54
  "devDependencies": {
53
55
  "@aklinker1/check": "^1.4.5",
@@ -58,21 +60,16 @@
58
60
  "@types/normalize-path": "^3.0.2",
59
61
  "@types/prompts": "^2.4.9",
60
62
  "extract-zip": "^2.0.1",
61
- "happy-dom": "^15.11.4",
63
+ "happy-dom": "^17.1.8",
62
64
  "lodash.merge": "^4.6.2",
63
65
  "oxlint": "^0.11.1",
64
66
  "publint": "^0.2.12",
65
- "tsx": "4.15.7",
66
67
  "typescript": "^5.6.3",
67
- "unbuild": "^2.0.0",
68
- "vitest": "^2.1.4",
69
- "vitest-plugin-random-seed": "^1.1.0"
70
- },
71
- "peerDependenciesMeta": {
72
- "@types/chrome": {
73
- "optional": true
74
- }
68
+ "unbuild": "^3.5.0",
69
+ "vitest": "^3.0.7",
70
+ "vitest-plugin-random-seed": "^1.1.1"
75
71
  },
72
+ "peerDependenciesMeta": {},
76
73
  "repository": {
77
74
  "type": "git",
78
75
  "url": "git+https://github.com/wxt-dev/wxt.git"
@@ -91,6 +88,7 @@
91
88
  "name": "Aaron Klinker",
92
89
  "email": "aaronklinker1+wxt@gmail.com"
93
90
  },
91
+ "funding": "https://github.com/sponsors/wxt-dev",
94
92
  "files": [
95
93
  "bin",
96
94
  "dist"