Everyone is welcome to contribute to WXT!
If you are changing the docs or fixing a bug, feel free to fork and open a PR.
If you want to add a new feature, please create an issue or discussion first so we can decide if the feature is inline with the vision for WXT.
This project uses Conventional Commit format to automatically generate a changelog and better understand the changes in the project
Here are some examples of conventional commit messages:
feat: add new functionalityfix: correct typos in codeci: add GitHub Actions for automated testing
The title of your pull request should follow the conventional commit format. When a pull request is merged to the main branch, all changes are going to be squashed into a single commit. The message of this commit will be the title of the pull request. And for every release, the commit messages are used to generate the changelog.
WXT uses Bun for package management and development. Install it from: https://bun.com/
Then, simply run the install command:
bun iHere are some helpful commands:
# Build WXT package and workspace dependencies
bun run -F wxt build# Build workspace dependencies, then start the demo extension in dev mode
bun run -F wxt-demo dev# Run unit and E2E tests
bun run test# Start the docs website locally
bun run docs:devAbove, we used bun's
-Fflag to choose which package to run a command in, but there are other waysbun run -F @wxt-dev/i18n build # or bun run --cwd packages/i18n build # or cd packages/i18n bun run buildPick your piosin!
# Build the latest version
bun run -F wxt build
# CD to the demo directory
cd packages/wxt-demoThen there are a few different ways to profile WXT commands:
-
Generate a flamechart with 0x:
bunx 0x node_modules/wxt/bin/wxt.mjs build
-
Create a CPU profile:
bun --cpu-prof node_modules/wxt/bin/wxt.mjs build
-
Debug the process:
bun --inspect node_modules/wxt/bin/wxt.mjs build
Documentation is written with VitePress, and is located in the docs/ directory.
The API reference is generated from JSDoc comments in the source code. If there's a typo or change you want to make in there, you'll need to update the source code instead of a file in the docs/ directory.
WXT has unit and E2E tests. When making a change or adding a feature, make sure to update the tests or add new ones, if they exist.
If they don't exist, feel free to create them, but that's a lot for a one-time contributor. A maintainer might add them to your PR though.
To run tests for a specific file, add the filename at the end of the test command:
bun run -F wxt test manifest-contentsAll test (unit and E2E) for all packages are ran together via Vitest workspaces.
If you want to manually test a change, you can modify the demo project for your test, but please don't leave those changes committed once you open a PR.
Each directory inside templates/ is it's own standalone project. Simply cd into the directory you're updating, install dependencies with npm (NOT bun), and run the relevant commands
cd templates/vue
npm i
npm run dev
npm run buildNote that templates are hardcoded to a specific version of wxt from NPM, they do not use the local version. PR checks will test your PR's changes against the templates, but if you want to manually do it, update the package.json dependency:
"devDependencies": {
"typescript": "^5.3.2",
"vite-plugin-solid": "^2.7.0",
- "wxt": "^0.8.0"
+ "wxt": "../../packages/wxt"
}Then run npm i again.
To add a template, copy the vanilla template and give it a new name.
cp -r templates/vanilla templates/<new-template-name>That's it. Once your template is merged, it will be available inside wxt init immediately. You don't need to release a new version of WXT to release a new template.
All current templates are based on Vite's templates: https://github.com/vitejs/vite/tree/main/packages/create-vite
Releases are done with GitHub actions:
- Use the Release workflow to release a single package in the monorepo. This automatically detects the version change with conventional commits, builds and uploads the package to NPM, and creates a GitHub release.
- Use the Sync Releases workflow to sync the GitHub releases with changes to the changelog. To change a release, update the
CHANGELOG.mdfile and run the workflow. It will sync the releases of a single package in the monorepo.
WXT has custom rules around what dependencies can be upgraded. Use the scripts/upgrade-deps.ts script to upgrade dependencies and follow these rules.
bun run scripts/upgrade-deps.tsTo see all the options, run:
bun run scripts/upgrade-deps.ts --helpThis repo uses https://pkg.pr.new to publish versions of all it's packages for almost every commit. You can install them via:
npm i https://pkg.pr.new/[package-name]@[ref]Or use one of the shorthands:
# Install the latest build of `wxt` from a PR:
npm i https://pkg.pr.new/wxt@1283
# Install the latest build of `@wxt-dev/module-react` on the `main` branch
npm i https://pkg.pr.new/@wxt-dev/module-react@main
# Install `@wxt-dev/storage` from a specific commit:
npm i https://pkg.pr.new/@wxt-dev/module-react@426f907Anyone is welcome to submit a blog post on https://wxt.dev/blog!
Note
Before starting on a blog post, please message Aaron on Discord or start a discussion on GitHub to get permission to write about a topic, but most topics are welcome: Major version updates, tutorials, etc.
- English only: Blog posts should be written in English. Unfortunately, our maintainers don't have the bandwidth right now to translate our docs, let alone blog posts. Sorry 😓
- AI: Please only use AI to translate or proof-read your blog post. Don't generate the whole thing... We don't want to publish that.