Build upon amazing wxt framework.
dev:
- eslint-config: See eslint
- bumpp: use
bun bump
optional:
- trpc-chrome: See trpc
- update
name
inpackage.json
, it will be zip file name - update
title
anddescription
insrc/locales
, these will appear in the Chrome Web Store - update
default_locale
inwxt.config.js
if noten
- replace
icon.png
insrc/assets
- run
bun bump minor
- mvp
- run
bun bump major
- publish
optional:
- update
README.md
- add extension url to
README.md
- setup cli submit
Find more at wxt.dev/examples
Move the predefined entry points from the entrypoints.inactive
folder to directly in the entrypoints
folder to enable them.
Popup is enabled by default.
*: For sidepanel
, wxt does not automatically add the sidePanel
permission. You must manually add it to the manifest
field in wxt.config.js
. Related: wxt#544
*: For onboarding
, to retrieve the URL of the onboarding page, use browser.runtime.getURL('/onboarding.html')
.
If you are using vscode, autofix should already be enabled. You can run bun lint
to check for errors and bun lint:fix
to fix most of them.
Thanks for antfu's elegant design philosophy in eslint configuration.
To use it, refer to the documentation
tldr: To add components using
npx shadcn@latest add
, select them by pressingspace
and submit withenter
. If adding a code file, simply type the component name for autocompletion in vscode.
- Replace the
background
andpopup
entrypoints with the ones in theentrypoints.inactive/trpc
folder. - Install the needed packages:
# trpc with react-query, see https://trpc.io/docs/v10/client/react/setup
bun i @trpc/client @trpc/server @trpc/react-query @tanstack/react-query@4
# trpc-chrome
bun i trpc-chrome
# zod
bun i zod
# mitt, event emitter, for trpc subscription
bun i mitt
-
You need to manually upload the extension to the Chrome Web Store the first time. After that, you can get the
CHROME_EXTENSION_ID
. -
Rename the file
.env.submit.example
to.env.submit
and fill in theCHROME_EXTENSION_ID
. -
Add the following settings to your shell config file. Keep them safe. See https://github.com/fregante/chrome-webstore-upload-keys for how to get the keys.
export CHROME_CLIENT_ID="<your client id>" export CHROME_REFRESH_TOKEN="<your refresh token>" export CHROME_CLIENT_SECRET="<your client secret>"
-
Now you can run
bun submit:latest
for faster submission.
bun submit:latest
is an alias forrimraf .output; wxt zip && wxt submit --chrome-zip .output/*.zip
rimraf
is a cross-platformrm -rf
command