Advanced

Building from Source

Compile burl for your platform

Build burl from source for your platform or contribute to development.

Prerequisites

Install Bun

Clone and Build

# Clone the repository
git clone https://github.com/ZainW/burl
cd burl

# Install dependencies
bun install

# Build for current platform
bun run build

The compiled binary will be in packages/cli/dist/burl.

Development Mode

Run directly without building:

bun run dev https://example.com

Or run the source directly:

bun run packages/cli/src/index.ts https://example.com

Cross-Platform Builds

Build for all platforms:

bun run build:all

This creates binaries for:

PlatformArchitectureOutput
Linuxx64burl-linux-x64
LinuxARM64burl-linux-arm64
macOSx64 (Intel)burl-darwin-x64
macOSARM64 (Apple Silicon)burl-darwin-arm64
Windowsx64burl-windows-x64.exe

Build for Specific Platform

# Linux x64
bun run build:linux-x64

# macOS ARM64 (M1/M2/M3)
bun run build:darwin-arm64

# Windows x64
bun run build:windows-x64

Project Structure

burl/
├── packages/
│   ├── cli/                 # Main CLI package
│   │   ├── src/
│   │   │   ├── core/        # Engine, HTTP client, types
│   │   │   ├── output/      # Formatters (JSON, CSV, TUI)
│   │   │   ├── stats/       # Statistics collection
│   │   │   └── utils/       # Helpers
│   │   └── test/            # Tests
│   └── docs/                # Documentation site
├── package.json             # Monorepo root
└── tsconfig.json            # TypeScript config

Running Tests

# Run all tests
bun test

# Run with watch mode
bun test --watch

# Run specific test file
bun test packages/cli/test/core/auth.test.ts

Code Quality

# Type checking
bun run typecheck

# Linting
bun run lint

# Formatting
bun run format

# All checks
bun run check

CI Pipeline

The full CI check:

bun run ci

This runs:

  1. Type checking (bun run typecheck)
  2. Linting (bun run lint)
  3. Format checking (bun run format:check)
  4. Tests (bun test)

Contributing

1. Fork and Clone

git clone https://github.com/YOUR_USERNAME/burl
cd burl
bun install

2. Create a Branch

git checkout -b feat/your-feature

3. Make Changes

Follow the existing code style:

  • Use import type for type-only imports
  • No barrel exports (direct imports)
  • Bun-first APIs (Bun.file(), Bun.nanoseconds())

4. Test Your Changes

bun run ci

5. Submit a PR

Push your branch and open a pull request.

Binary Size

The compiled binaries are optimized for size:

PlatformApproximate Size
Linux x64~50 MB
macOS ARM64~45 MB
Windows x64~55 MB

The binaries are self-contained with no external dependencies.

Troubleshooting

Build Fails

  1. Ensure Bun is up to date:
    bun upgrade
    
  2. Clear node_modules and reinstall:
    rm -rf node_modules bun.lock
    bun install
    

Tests Fail

  1. Check Bun version:
    bun --version  # Should be 1.3.5+
    
  2. Run individual test for more details:
    bun test packages/cli/test/cli.test.ts --verbose
    

Cross-Compilation Issues

Cross-compilation requires the target architecture's dependencies. If building for a different platform fails:

  1. Build natively on the target platform
  2. Or use CI/CD (GitHub Actions) for cross-platform builds