Commit Graph

54 Commits

Author SHA1 Message Date
Aaron bb90029c54 fix: Resolve absolute paths from the public directory properly (#583) 2024-03-31 08:19:06 -05:00
Aaron c9ddc3d0f2 fix: Don't override wxt.config.ts options when CLI flags are not passed (#567) 2024-03-25 00:24:56 -05:00
Aaron 9ff90d0acf feat: Download and override private packages for Firefox code review (#507) 2024-03-01 10:17:45 -06:00
Aaron 3459de0375 perf: Upgrade Vite to 5.1 (#452) 2024-02-15 10:31:20 -06:00
Aaron 66bd957ee0 fix: Don't crash background service worker when using import.meta.url (#402) 2024-02-03 14:57:34 -06:00
Aaron eca30296a7 feat!: ESM background support (#398)
BREAKING CHANGE: The build output has changed slightly. This isn't a huge deal, and no steps are required for users unless you're doing something weird with the output files after a build.

Before:

```
.output/
  <target>/
    chunks/
      popup-<hash>.js
    popup.html
```

After:

```
.output/
  <target>/
    popup.html
    popup.js
```

This applies for all HTML files, not just the popup.
2024-02-02 10:17:43 -06:00
Aaron 927aca612e fix!: Move browser constants to import.meta.env (#380)
BREAKING CHANGE: Renamed undocumented constants:

- `__BROWSER__` &rarr; `import.meta.env.BROWSER`
- `__COMMAND__` &rarr; `import.meta.env.COMMAND`
- `__MANIFEST_VERSION__` &rarr; `import.meta.env.MANIFEST_VERSION`
- `__IS_CHROME__` &rarr; `import.meta.env.CHROME`
- `__IS_FIREFOX__` &rarr; `import.meta.env.FIREFOX`
- `__IS_SAFARI__` &rarr; `import.meta.env.SAFARI`
- `__IS_EDGE__` &rarr; `import.meta.env.EDGE`
- `__IS_OPERA__` &rarr; `import.meta.env.OPERA`
2024-01-29 11:14:18 -06:00
Aaron 971daf2784 fix: Allow browser.runtime.getURL to include hashes and query params for HTML paths (#350) 2024-01-16 12:59:38 -06:00
Aaron 5343430c0f feat!: Refactor content script UI functions and add helper for "integrated" UIs (#333)
BREAKING CHANGES: Several APIs/options have been renamed:

- `type: "inline" | "overlay" | "modal"` has been changed to `position: "inline" | "overlay" | "modal"`
- `createContentScriptUi({ ... })` &rarr; `createShadowRootUi({ ... })`
- `createContentScriptIframe({ ... })` &rarr; `createIframeUi({ ... })`
- `onRemove` is now called ***before*** the UI is removed from the DOM, previously it was called after the UI was removed
2024-01-10 20:48:17 -06:00
Aaron ad0e8e4144 fix: Correctly mock webextension-polyfill for Vitest (#294) 2023-12-22 22:21:09 -06:00
Aaron fde488ac82 feat!: Add support for "main world" content scripts (#284)
BREAKING CHANGE: `defineContentScript` and `defineBackground` are now exported from `wxt/sandbox` instead of `wxt/client`. If you use auto-imports, no changes are required. If you have disabled auto-imports, you'll need to manually update your import statements.
2023-12-13 15:41:39 -06:00
Aaron 8786aa91b3 feat: Add util for detecting URL changes in content scripts (#264) 2023-12-07 13:29:33 -06:00
Aaron 77eeacaf0f docs: Update sidepanel availability (#250) 2023-11-29 17:12:37 -06:00
Aaron Klinker 4b24bee1fb Update demo app logs 2023-11-20 13:47:31 -06:00
Aaron d2cb8f9416 feat: Add wxt/storage API (#234) 2023-11-14 23:07:45 -06:00
Aaron 66e5079b84 feat: Add alias config for customizing path aliases (#216) 2023-11-07 11:38:48 -06:00
Aaron fcdf0dcbe9 feat: createContentScriptIframe utility (#206) 2023-11-03 09:31:16 -05:00
Aaron 21c35ee593 ci: Separate validation into multiple jobs (#203) 2023-11-02 11:08:19 -05:00
Aaron Klinker 183bb02e29 chore(deps-dev): Update sass to 1.69.5 2023-11-02 10:26:14 -05:00
Aaron Klinker cd4d00e23e chore(deps-dev): Update @type/* packages for demo 2023-11-02 10:16:52 -05:00
Aaron 874a531a62 feat: Add testing utils under wxt/testing (#178) 2023-10-18 16:28:26 -05:00
Aaron 44464f914f feat!: Use defineUnlistedScript to define unlisted scripts (#167)
BREAKING CHANGE: Unlisted scripts must now `export default defineUnlistedScript(...)`
2023-10-14 10:06:52 -05:00
Aaron 4150e42c05 feat: createContentScriptUi helper (#143) 2023-09-30 21:57:57 -05:00
Aaron e97071b7d7 fix: Support loading tsx entrypoints (#134) 2023-09-29 22:08:20 -05:00
Aaron Klinker b48cee9715 fix: Don't crash when <all_urls> matches is used in dev mode 2023-09-29 08:18:56 -05:00
Aaron Klinker 1f6a931b02 fix: Use the same mode for each build step 2023-09-22 11:57:36 -05:00
Aaron 16cebc538f feat: Add ContentScriptContext util for stopping invalidated content scripts (#120) 2023-09-21 18:48:07 -05:00
Aaron 8e3169eb1e chore: Refactor how config is resolved (#118) 2023-09-19 16:36:00 -05:00
Aaron Klinker 5f15f9ccec fix!: Change default publicDir to <srcDir>/public
This reverts 19c0948
2023-09-07 17:32:30 -05:00
Aaron a8285fff78 feat: Generate types for browser.i18n.getMessage (#103) 2023-09-05 09:55:55 -05:00
Aaron f234c85357 fix!: Use relative path aliases inside .wxt/tsconfig.json (#102)
BREAKING CHANGE: Moved .wxt directory from inside srcDir to root to match Nuxt.
2023-09-04 21:48:07 -05:00
Aaron Klinker b58a15e783 chore: Fix failing demo build 2023-08-29 16:06:43 -05:00
Aaron d629acf518 chore: Upgrade to prettier 3 (#77) 2023-08-13 14:39:53 -05:00
Aaron 044a24fd6a feat: CSS entrypoints (#61) 2023-07-21 12:57:09 -05:00
Aaron 7d55faff20 chore: Branding and logo (#60) 2023-07-21 01:51:04 -05:00
Aaron Klinker 19c0948d95 feat!: Change default publicDir to <rootDir>/public
BREAKING CHANGE: `config.publicDir`'s default changed from `<srcDir>/public` to `rootDir/<public>` to align with other frameworks and standards
2023-07-20 15:47:38 -05:00
Aaron Klinker 9cc464f48b ci: Improve checks against demo/ extension 2023-07-20 13:56:22 -05:00
Aaron Klinker 58a84ec253 feat!: Add type safety to browser.runtime.getURL
Entrypoint outputs and files in the public directory are typed properly.
Chunks and other generated files are not typed since they aren't often accessed at runtime.

BREAKING CHANGE: `browser` is now imported from `wxt/browser` instead of `webextension-polyfill`
2023-07-20 13:55:35 -05:00
Aaron dca43efe0d feat: Add wxt zip command (#47) 2023-07-16 14:38:56 -05:00
Aaron Klinker 5b48ae99f4 feat!: Rename defineBackgroundScript to defineBackground
BREAKING CHANGE: Rename `defineBackgroundScript` to `defineBackground`. Update your background entrypoints
2023-07-14 20:03:12 -05:00
Aaron Klinker c1ea9ba4a3 chore: Run wxt prepare on postinstall 2023-07-14 15:50:50 -05:00
Aaron 3307fc42a0 feat: Reload extension when source code is changed (#17) 2023-07-02 16:04:13 -05:00
Aaron Klinker 1ecfedd32c chore: Fix demo global usage 2023-06-25 20:50:09 -05:00
Aaron 9ef451be2e feat: Support more CLI flags for build and dev (#9) 2023-06-25 12:23:04 -05:00
Aaron Klinker 51a10725cf chore: Rename package to wxt 2023-06-25 10:53:35 -05:00
Aaron Klinker 739d19f3e3 fix: Support srcDir config 2023-06-25 10:53:35 -05:00
Aaron Klinker 1a25f2b532 feat: Copy public directory to outputs 2023-06-25 10:53:35 -05:00
Aaron Klinker 8c59a1c001 feat: Provide custom, typed globals defined by Vite 2023-06-25 10:53:35 -05:00
Aaron Klinker 505e41951c feat: Dev server working and a valid extension is built 2023-06-25 10:53:35 -05:00
Aaron Klinker 21debadcce feat: Generate type declarations and config for project types and auto-imports 2023-06-25 10:53:35 -05:00