Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,17 @@ jobs:
cat -n package.json

- name: "Build"
run: npm run build:all
run: npm run package

- name: "Upload to Actions"
uses: actions/upload-artifact@v6
with:
name: artifacts
path: web-ext-artifacts
path: .output
include-hidden-files: true

- name: "Upload to Release"
if: ${{ github.event_name == 'release' }}
uses: cssnr/upload-release-action@v1
with:
globs: web-ext-artifacts/*
globs: .output/*.zip
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: "Build"
if: ${{ !cancelled() }}
run: npm run build:all
run: npm run package

#- name: "eslint"
# if: ${{ !cancelled() }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: ./.github/workflows/build.yaml
secrets: inherit
with:
version: ${{ github.ref_name }}
version: ${{ github.event.release.tag_name }} # github.ref_name can be empty
permissions:
contents: write

Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Generic
.idea/
*.iml
.vscode/
Expand All @@ -6,3 +7,9 @@ build/
node_modules/
web-ext-artifacts/
*.tsbuildinfo
# WXT
.output
stats.html
stats-*.json
.wxt
web-ext.config.ts
64 changes: 35 additions & 29 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- [Development](#development)
- [Building](#building)
- [References](#references)
- [WXT](#wxt)

> [!WARNING]
> This guide is not complete and just the bare minimum.
Expand All @@ -22,9 +22,7 @@ npm run dev
```

Open Chrome and navigate to `chrome://extensions/`, enable "Developer mode",
and load the unpacked extension from the `dist` directory.

This uses HMR including extension reloads.
and load the unpacked extension from the `.output` directory.

### Firefox

Expand All @@ -33,21 +31,19 @@ npm run dev:ff
```

Open Firefox and navigate to `about:debugging#/runtime/this-firefox`, then click "Load Temporary Add-on..."
and load the unpacked extension from the `dist` directory.

This requires refreshing the page and reloading the extension when required.
and load the unpacked extension from the `.output` directory.

### Android

This requires the [Android Debug Bridge (adb)](https://developer.android.com/tools/adb).

In another terminal (or without the watcher run `npm build:firefox`).
In another terminal (or without the watcher run `npm build:ff`).

```shell
npm run dev:ff
npm run watch:ff
```

Enable USB or Wireless Debugging and get your device `name`.
Enable USB or Wireless Debugging, connect, and get your device `name`.

```shell
adb devices
Expand All @@ -59,50 +55,60 @@ Then run using your device `name`.
npm run android -- name
```

Or run directly w/o the --firefox-apk flag from the script.

```shell
web-ext run -t firefox-android -s dist --adb-device name
```
# Building

## Building
## Package All

To create all archives in the `web-ext-artifacts` directory.
This type checks the project, builds and zips to the `.output` directory.

```shell
npm run build:all
npm run package
```

### Chrome

To build the `dist` directory.
To build the `.output` directory.

```shell
npm run build
```

To build and create an archive in the `web-ext-artifacts` directory.
To build and create an archive in the `.output` directory.

```shell
npm run build:chrome
npm run zip:chrome
```

### Firefox

To build the `dist` directory.
To build the `.output` directory.

```shell
npm run build -- --mode firefox
npm build:ff
```

To build and create an archive in the `web-ext-artifacts` directory.
To build and create an archive in the `.output` directory.

```shell
npm run build:firefox
npm run zip:ff
```

## References
## WXT

- [Vue 3 Documentation](https://vuejs.org/)
- [Vite Documentation](https://vitejs.dev/)
- [CRXJS Documentation](https://crxjs.dev/vite-plugin)
This project uses the WXT framework.

- <https://wxt.dev/>

To customize the config for development add a `web-ext.config.ts` to the project root.

```ts
// web-ext.config.ts
import { defineWebExtConfig } from 'wxt'

export default defineWebExtConfig({
binaries: {
firefox: 'C:/Program Files/Firefox Developer Edition/firefox.exe',
},
disabled: false,
})
```
100 changes: 0 additions & 100 deletions manifest.config.ts

This file was deleted.

Loading
Loading