This guide will help you set up your local development environment for contributing to xBlockOrigin.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/chefnaphtha/xBlockOrigin/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
xBlockOrigin uses Bun as its JavaScript runtime and package manager. You’ll need to install it before getting started.Install Bun
Bun is a fast all-in-one JavaScript runtime. Install it using the official installer:Or on Windows:
Install dependencies
Install all project dependencies using Bun:This will install:
- Runtime dependencies: Preact, Valibot
- Development tools: TypeScript, Biome, type definitions
The
postinstall script automatically sets up Git hooks for version bumping.Development tools
The project includes several tools to maintain code quality:TypeScript
Type checking is performed using the TypeScript compiler in no-emit mode:Biome
Biome handles both linting and formatting with a single, fast tool:Git hooks
The project uses a pre-commit hook that automatically increments the major version number. This is set up duringbun install via the postinstall script:
Browser extension development
To test the extension during development, you’ll need to load it as an unpacked/temporary extension:Chrome/Edge
- Build the Chrome version (see Building)
- Navigate to
chrome://extensions/ - Enable “Developer mode” (toggle in top-right)
- Click “Load unpacked”
- Select the
dist/chrome/directory
Firefox
- Build the Firefox version (see Building)
- Navigate to
about:debugging#/runtime/this-firefox - Click “Load Temporary Add-on”
- Select any file in the
dist/firefox/directory (or selectmanifest.json)
In Firefox, temporary extensions are removed when the browser closes. You’ll need to reload them after each restart.
Next steps
Now that your environment is set up, you can:- Learn how to build the extension for Chrome and Firefox
- Explore the project structure to understand the codebase
- Read the contributing guidelines before making changes