Skip to content

Commit 39d766d

Browse files
committed
Migrate to WXT
This reverts commit 006763e.
1 parent 006763e commit 39d766d

32 files changed

+329
-443
lines changed

.github/workflows/submit.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Submit for Review
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
dryRun:
6+
default: false
7+
type: boolean
8+
description: Skip submission and perform a dry run
9+
10+
jobs:
11+
validate:
12+
name: Validate
13+
uses: ./.github/workflows/validate.yml
14+
secrets: inherit
15+
16+
submit:
17+
name: Submit
18+
runs-on: ubuntu-22.04
19+
needs: [validate]
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- uses: oven-sh/setup-bun@v2
26+
27+
- name: Configure Git
28+
run: |
29+
git config user.email "[email protected]"
30+
git config user.name "GitHub Actions"
31+
32+
- name: Install dependencies
33+
run: bun install --frozen-lockfile
34+
35+
- name: Bump Version
36+
id: version
37+
run: |
38+
bunx changelogen@latest --bump
39+
NEW_VERSION=$(bun --print 'require("./package.json").version')
40+
echo "newVersion=$NEW_VERSION" >> "$GITHUB_OUTPUT"
41+
42+
- name: Build and Zip
43+
run: |
44+
bun run zip
45+
bun run zip:firefox
46+
47+
- name: Upload Artifacts
48+
uses: actions/upload-artifact@v4
49+
with:
50+
path: .output/*.zip
51+
if-no-files-found: error
52+
include-hidden-files: true
53+
54+
- name: Submit
55+
run: |
56+
bun wxt submit \
57+
--chrome-zip .output/*-chrome.zip \
58+
--firefox-zip .output/*-firefox.zip --firefox-sources-zip .output/*-sources.zip
59+
env:
60+
DRY_RUN: ${{ inputs.dryRun }}
61+
CHROME_EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
62+
CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
63+
CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
64+
CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
65+
FIREFOX_EXTENSION_ID: ${{ secrets.FIREFOX_EXTENSION_ID }}
66+
FIREFOX_JWT_ISSUER: ${{ secrets.FIREFOX_JWT_ISSUER }}
67+
FIREFOX_JWT_SECRET: ${{ secrets.FIREFOX_JWT_SECRET }}
68+
EDGE_PRODUCT_ID: ${{ secrets.EDGE_PRODUCT_ID }}
69+
EDGE_CLIENT_ID: ${{ secrets.EDGE_CLIENT_ID }}
70+
EDGE_CLIENT_SECRET: ${{ secrets.EDGE_CLIENT_SECRET }}
71+
EDGE_ACCESS_TOKEN_URL: ${{ secrets.EDGE_ACCESS_TOKEN_URL }}
72+
73+
- name: Commit and Push
74+
if: ${{ !inputs.dryRun }}
75+
run: |
76+
git add package.json CHANGELOG.md
77+
git commit -am "chore(release): v$NEW_VERSION"
78+
git tag v$NEW_VERSION
79+
git push
80+
git push --tags
81+
env:
82+
NEW_VERSION: ${{ steps.version.outputs.newVersion }}
83+
84+
- name: Release
85+
if: ${{ !inputs.dryRun }}
86+
run: pnpx changelogen@latest gh release ${{ steps.version.outputs.newVersion }} --token ${{ github.token }}
87+
88+
# Don't upload sources zip - it can contain .env files, which may include secrets
89+
- name: Upload ZIPs
90+
if: ${{ !inputs.dryRun }}
91+
run: gh release upload ${{ steps.version.outputs.newVersion }} .output/*-chrome.zip .output/*-firefox.zip

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pnpm-debug.log*
88
lerna-debug.log*
99

1010
node_modules
11-
dist
11+
.output
1212
artifacts
1313
*.local
1414
coverage

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ dist-*
33
artifacts
44
coverage
55
.wxt
6-
dist
6+
.output
77
coverage
88
*.lock

bun.lock

Lines changed: 127 additions & 286 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

manifest.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

package.json

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,38 @@
66
"type": "module",
77
"scripts": {
88
"check": "check",
9-
"dev": "vite",
10-
"build": "vite build",
9+
"dev": "wxt",
10+
"dev:firefox": "wxt --browser firefox",
11+
"build": "wxt build",
12+
"build:firefox": "wxt build --browser firefox",
1113
"test": "vitest",
1214
"test:coverage": "vitest run --coverage",
13-
"prepare": "simple-git-hooks"
15+
"zip": "wxt zip",
16+
"zip:firefox": "wxt zip -b firefox",
17+
"prepare": "simple-git-hooks",
18+
"postinstall": "wxt prepare"
1419
},
1520
"dependencies": {
1621
"@aklinker1/check": "^1.4.5",
1722
"@tanstack/vue-query": "^5.59.13",
1823
"@webext-core/messaging": "^2.0.2",
1924
"@webext-core/proxy-service": "^1.2.0",
20-
"@wxt-dev/storage": "^1.1.0",
2125
"async-mutex": "^0.5.0",
2226
"fast-deep-equal": "^3.1.3",
2327
"minimatch": "^10.0.1",
2428
"ofetch": "^1.4.1"
2529
},
2630
"devDependencies": {
2731
"@aklinker1/generate-changelog": "^1.1.2",
28-
"@crxjs/vite-plugin": "^2.0.0-beta.31",
2932
"@iconify/json": "^2.2.261",
3033
"@tailwindcss/vite": "^4.0.6",
3134
"@types/bun": "^1.1.11",
32-
"@types/chrome": "^0.0.304",
35+
"@types/chrome": "^0.0.278",
3336
"@types/jsdom": "^21.1.7",
34-
"@vitejs/plugin-vue": "^5.2.1",
3537
"@vitest/coverage-v8": "^2.1.3",
38+
"@wxt-dev/auto-icons": "^1.0.2",
3639
"@wxt-dev/i18n": "^0.2.1",
40+
"@wxt-dev/module-vue": "^1.0.1",
3741
"daisyui": "^5.0.0-beta.7",
3842
"env-cmd": "^10.1.0",
3943
"fast-glob": "^3.3.2",
@@ -45,10 +49,10 @@
4549
"tailwindcss": "^4.0.6",
4650
"typescript": "^5.6.3",
4751
"unplugin-icons": "^0.19.3",
48-
"vite": "6.0.8",
4952
"vitest": "^2.1.3",
5053
"vue": "^3.5.12",
51-
"vue-tsc": "^2.1.6"
54+
"vue-tsc": "^2.1.6",
55+
"wxt": "^0.19.11"
5256
},
5357
"simple-git-hooks": {
5458
"pre-commit": "bun lint-staged"

src/background.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/components/CommitDiff.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import { i18n } from "@/utils/i18n";
2-
import { createDiffComponent } from "./createDiffComponent";
3-
41
export const CommitDiff = createDiffComponent({
52
getAdditionsElement: () =>
63
document.querySelector<HTMLElement>("#toc>*>strong:nth-child(2)"),

src/components/CompareDiff.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import { i18n } from "@/utils/i18n";
2-
import { createDiffComponent } from "./createDiffComponent";
3-
41
export const CompareDiff = createDiffComponent({
52
getAdditionsElement: () =>
63
document.querySelectorAll<HTMLElement>(".toc-diff-stats>strong")[0],

src/components/CustomListItem.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<script lang="ts" setup>
2-
import { i18n } from "@/utils/i18n";
3-
42
defineProps<{
53
value: string;
64
}>();

0 commit comments

Comments
 (0)