Skip to main content

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.

This guide will help you set up your local development environment for contributing to xBlockOrigin.

Prerequisites

xBlockOrigin uses Bun as its JavaScript runtime and package manager. You’ll need to install it before getting started.
1

Install Bun

Bun is a fast all-in-one JavaScript runtime. Install it using the official installer:
curl -fsSL https://bun.sh/install | bash
Or on Windows:
powershell -c "irm bun.sh/install.ps1 | iex"
Verify your installation by running bun --version. You need Bun v1.0 or higher.
2

Clone the repository

Clone the xBlockOrigin repository to your local machine:
git clone <repository-url>
cd xblockorigin
3

Install dependencies

Install all project dependencies using Bun:
bun install
This will install:
  • Runtime dependencies: Preact, Valibot
  • Development tools: TypeScript, Biome, type definitions
The postinstall script automatically sets up Git hooks for version bumping.
4

Verify your setup

Run the type checker and linter to ensure everything is working:
bun run typecheck
bun run lint
If both commands complete without errors, your development environment is ready!

Development tools

The project includes several tools to maintain code quality:

TypeScript

Type checking is performed using the TypeScript compiler in no-emit mode:
bun run typecheck
This validates types without generating JavaScript output (Bun handles bundling).

Biome

Biome handles both linting and formatting with a single, fast tool:
bun run lint
Run bun run check before committing to catch all issues at once. This runs type checking, linting, and formatting in sequence.

Git hooks

The project uses a pre-commit hook that automatically increments the major version number. This is set up during bun install via the postinstall script:
bun run setup-hooks
If you skip the pre-commit hook (not recommended), CI builds will fail due to version mismatch.

Browser extension development

To test the extension during development, you’ll need to load it as an unpacked/temporary extension:

Chrome/Edge

  1. Build the Chrome version (see Building)
  2. Navigate to chrome://extensions/
  3. Enable “Developer mode” (toggle in top-right)
  4. Click “Load unpacked”
  5. Select the dist/chrome/ directory

Firefox

  1. Build the Firefox version (see Building)
  2. Navigate to about:debugging#/runtime/this-firefox
  3. Click “Load Temporary Add-on”
  4. Select any file in the dist/firefox/ directory (or select manifest.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:

Build docs developers (and LLMs) love