Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
da311ce
chore: Migrate monorepo to use Bun instead of PNPM
aklinker1 Dec 18, 2025
2bc93bd
Add PNPM back to tests
aklinker1 Dec 18, 2025
c5b4591
Delete TODO
aklinker1 Dec 18, 2025
c3a88c0
Cleanup
aklinker1 Dec 18, 2025
72b1627
Removed wrong action arg, reverted
aklinker1 Dec 18, 2025
0608ecd
Use "bun install" over "bun i"
aklinker1 Dec 18, 2025
c486f61
Add `run` to all bun run commands
aklinker1 Dec 18, 2025
3c4d59e
Replace "i" with "install"
aklinker1 Dec 18, 2025
fbbd27f
add missing deps
aklinker1 Dec 18, 2025
a057083
Add coauthorin case I forget to on the PR merge...
aklinker1 Dec 18, 2025
939d161
Patch simple-git-hooks
aklinker1 Dec 18, 2025
9770b53
Fix type errors
aklinker1 Dec 18, 2025
9fbc17f
Attempt to fix bun setup
aklinker1 Dec 18, 2025
10781ab
Fix pnpm install
aklinker1 Dec 18, 2025
88c123a
Add missing coverage script
aklinker1 Dec 18, 2025
ca5b930
Add toolversions
aklinker1 Dec 18, 2025
80df813
Fix checks
aklinker1 Dec 18, 2025
68bfb1a
Add missing test coverage scripts
aklinker1 Dec 18, 2025
a86008b
fix checks
aklinker1 Dec 18, 2025
da13df4
Add more scripts
aklinker1 Dec 18, 2025
eb833e7
Fix netlify deploy
aklinker1 Dec 18, 2025
c7d882a
more scripts...
aklinker1 Dec 18, 2025
2093231
Cleanup
aklinker1 Dec 18, 2025
2d5ca12
Fix netlify error
aklinker1 Dec 18, 2025
a16eec2
all but 4 tests, very slowly...
aklinker1 Dec 18, 2025
9aa943e
Fix lockfile
aklinker1 Dec 18, 2025
a17ac48
Fix zip test
aklinker1 Dec 18, 2025
0ceedb0
Fix test
aklinker1 Dec 18, 2025
70c3ba7
Fix test
aklinker1 Dec 18, 2025
8b9dd7e
Fix netlify
aklinker1 Dec 18, 2025
ad87337
Upgrade `buildc` to resolve node deprecation
aklinker1 Dec 19, 2025
c640f53
optimize e2e tests
aklinker1 Dec 19, 2025
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
pnpm-lock.yaml linguist-generated
package-lock.json linguist-generated
bun.lockb linguist-generated
bun.lock linguist-generated
yarn.lock linguist-generated

# Exclude templates from language statistics
Expand Down
20 changes: 6 additions & 14 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
name: Basic Setup
description: Install PNPM, Node, and dependencies
description: Install Bun and dependencies

inputs:
install:
default: 'true'
description: Whether or not to run 'pnpm install'

installArgs:
default: ''
description: Additional args to append to "pnpm install"
description: Whether or not to run 'bun install'

runs:
using: composite

steps:
- name: 🛠️ Setup PNPM
uses: pnpm/action-setup@f2b2b233b538f500472c7274c7012f57857d8ce0 # v4.1.0

- name: 🛠️ Setup NodeJS
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
- name: 🛠️ Setup Bun
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
with:
node-version: 20
cache: pnpm
bun-version-file: '.tool-versions'

- name: 📦 Install Dependencies
if: ${{ inputs.install == 'true' }}
shell: bash
run: pnpm install ${{ inputs.installArgs }}
run: bun install --frozen-lockfile ${{ inputs.installArgs }}
4 changes: 2 additions & 2 deletions .github/workflows/pkg.pr.new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: ./.github/actions/setup

- name: Build All Packages
run: pnpm buildc all
run: bun run buildc all

- name: Publish
run: pnpx pkg-pr-new publish --compact --pnpm './packages/*'
run: bunx pkg-pr-new publish --compact --bun './packages/*'
2 changes: 1 addition & 1 deletion .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- name: Build docs
run: |
pnpm docs:build
bun run docs:build
docker build docs/.vitepress -t ${{ secrets.DOCKER_REGISTRY_HOSTNAME }}/wxt/docs:${{ github.event.inputs.tag || 'latest' }}
- name: Push Image
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ jobs:
- name: Bump and Tag
run: |
pnpm tsx scripts/bump-package-version.ts ${{ inputs.package }}
bun run scripts/bump-package-version.ts ${{ inputs.package }}
git push
git push --tags
- name: Publish to NPM
working-directory: packages/${{ inputs.package }}
run: |
pnpm pack
bun pm pack
sudo npm i -g npm@latest
/usr/local/bin/npm publish *.tgz
npm publish *.tgz
- name: Create GitHub release
run: pnpm tsx scripts/create-github-release.ts ${{ inputs.package }}
run: bun run scripts/create-github-release.ts ${{ inputs.package }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/sync-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ jobs:
installArgs: --ignore-scripts

- name: Sync Releases
run: pnpm tsx scripts/sync-releases.ts ${{ inputs.package }}
run: bun run scripts/sync-releases.ts ${{ inputs.package }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/update-browser-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ jobs:

- name: Generate Latest Code
working-directory: packages/browser
run: pnpm gen
run: bun run gen

- name: Run Checks
working-directory: packages/browser
run: pnpm check
run: bun run check

- name: Commit Changes
id: commit
Expand All @@ -46,6 +46,6 @@ jobs:
if: steps.commit.outputs.changes_detected == 'true'
working-directory: packages/browser
run: |
pnpm pack
bun pm pack
sudo npm i -g npm@latest
/usr/local/bin/npm publish *.tgz
npm publish *.tgz
26 changes: 14 additions & 12 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: ./.github/actions/setup

- name: Basic Checks
run: pnpm check
run: bun run check

builds:
name: Builds
Expand All @@ -34,7 +34,7 @@ jobs:
uses: ./.github/actions/setup

- name: Build All Packages
run: pnpm buildc all
run: bun run buildc all

build-demo:
name: Build Demo
Expand All @@ -47,11 +47,11 @@ jobs:
uses: ./.github/actions/setup

- name: Build
run: pnpm build:all
run: bun run build:all
working-directory: packages/wxt-demo

- name: ZIP
run: pnpm wxt zip
run: bun run wxt zip
working-directory: packages/wxt-demo

tests:
Expand All @@ -73,16 +73,18 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Setup Bun
uses: oven-sh/setup-bun@22457c87c1b161cf7dde222c3e82b2b5f8d2bed2 # v2.0.2
- name: Setup PNPM
uses: pnpm/action-setup@f2b2b233b538f500472c7274c7012f57857d8ce0 # v4.1.0
with:
version: latest

- name: Run Tests
if: ${{ ! matrix.coverage }}
run: pnpm test
run: bun run test

- name: Run Tests (Coverage)
if: matrix.coverage
run: pnpm test:coverage --reporter=default --reporter=hanging-process
run: bun run test:coverage --reporter=default --reporter=hanging-process

- name: Upload Coverage
if: matrix.coverage
Expand Down Expand Up @@ -110,7 +112,7 @@ jobs:
uses: ./.github/actions/setup

- name: Pack WXT package
run: pnpm pack
run: bun pm pack
working-directory: packages/wxt

- name: Install Dependencies
Expand All @@ -122,15 +124,15 @@ jobs:
working-directory: templates/${{ matrix.template }}

- name: Type Check Template
run: pnpm compile
run: bun run compile
if: matrix.template != 'svelte'
working-directory: templates/${{ matrix.template }}

- name: Type Check Template
run: pnpm check
run: bun run check
if: matrix.template == 'svelte'
working-directory: templates/${{ matrix.template }}

- name: Build Template
run: pnpm build
run: bun run build
working-directory: templates/${{ matrix.template }}
10 changes: 5 additions & 5 deletions .github/workflows/vhs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
- name: Setup PNPM
uses: pnpm/action-setup@f2b2b233b538f500472c7274c7012f57857d8ce0 # v4.1.0

- name: Setup
uses: ./.github/actions/setup
- name: Setup NodeJS
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
install: false
cache: pnpm

# This prevents pnpm dlx from downloading WXT in the video
- name: Pre-install WXT
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
.wxt
.wxt-runner
*.log
*.tgz
/docs/.vitepress/cache
docs/.vitepress/.temp
coverage
Expand All @@ -20,6 +21,5 @@ templates/*/yarn.lock
templates/*/package-lock.json
docs/api/reference
stats.html
.tool-versions
.cache
*-stats.txt
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bun 1.3.5
82 changes: 50 additions & 32 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,65 +22,81 @@ The title of your pull request should follow the [conventional commit format](#c

## Setup

WXT uses `pnpm`, so make sure you have it installed.

```sh
corepack enable
```
WXT uses Bun for package management and development. Install it from: <https://bun.com/>

Then, simply run the install command:

```sh
pnpm i
bun install
```

## Development

Here are some helpful commands:

```sh
# Build WXT package
cd packages/wxt
pnpm build
# Build WXT package and workspace dependencies
bun run -F wxt build
```

```sh
# Build WXT package, then build demo extension
cd packages/wxt-demo
pnpm build
```

```sh
# Build WXT package, then start the demo extension in dev mode
cd packages/wxt-demo
pnpm dev
# Build workspace dependencies, then start the demo extension in dev mode
bun run -F wxt-demo dev
```

```sh
# Run unit and E2E tests
pnpm test
bun run test
```

```sh
# Start the docs website locally
pnpm docs:dev
```
bun run docs:dev
```

> Above, we used bun's `-F` flag to choose which package to run a command in, but there are other ways
>
> ```sh
> bun run -F @wxt-dev/i18n build
> # or
> bun run --cwd packages/i18n build
> # or
> cd packages/i18n
> bun run build
> ```
>
> Pick your poison!

## Profiling

```sh
# Build the latest version
pnpm --filter wxt build
bun run -F wxt build

# CD to the demo directory
cd packages/wxt-demo

# 1. Generate a flamechart with 0x
pnpm dlx 0x node_modules/wxt/bin/wxt.mjs build
# 2. Inspect the process with chrome @ chrome://inspect
pnpm node --inspect node_modules/wxt/bin/wxt.mjs build
```

Then there are a few different ways to profile WXT commands:

- Generate a flamechart with 0x:

```sh
bunx 0x node_modules/wxt/bin/wxt.mjs build
```

- Create a CPU profile:

```sh
bun run --cpu-prof node_modules/wxt/bin/wxt.mjs build
```

- Debug the process:

```sh
bun run --inspect node_modules/wxt/bin/wxt.mjs build
```

## Updating Docs

Documentation is written with VitePress, and is located in the `docs/` directory.
Expand All @@ -96,7 +112,7 @@ WXT has unit and E2E tests. When making a change or adding a feature, make sure
To run tests for a specific file, add the filename at the end of the test command:

```sh
pnpm test manifest-contents
bun run -F wxt test manifest-contents
```

All test (unit and E2E) for all packages are ran together via [Vitest workspaces](https://vitest.dev/guide/#workspaces-support).
Expand All @@ -105,7 +121,7 @@ If you want to manually test a change, you can modify the demo project for your

## Templates

Each directory inside `templates/` is it's own standalone project. Simply `cd` into the directory you're updating, install dependencies with `npm` (NOT `pnpm`), and run the relevant commands
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

```sh
cd templates/vue
Expand All @@ -121,7 +137,7 @@ Note that templates are hardcoded to a specific version of `wxt` from NPM, they
"typescript": "^5.3.2",
"vite-plugin-solid": "^2.7.0",
- "wxt": "^0.8.0"
+ "wxt": "../.."
+ "wxt": "../../packages/wxt"
}
```

Expand All @@ -137,6 +153,8 @@ 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>

## Releasing Updates

Releases are done with GitHub actions:
Expand All @@ -149,13 +167,13 @@ Releases are done with GitHub actions:
WXT has custom rules around what dependencies can be upgraded. Use the `scripts/upgrade-deps.ts` script to upgrade dependencies and follow these rules.

```sh
pnpm tsx scripts/upgrade-deps.ts
bun run scripts/upgrade-deps.ts
```

To see all the options, run:

```sh
pnpm tsx scripts/upgrade-deps.ts --help
bun run scripts/upgrade-deps.ts --help
```

## Install Unreleased Versions
Expand Down
Loading
Loading