Skip to content

Environment Setup

Tool Version Notes
Node.js v20.19+ or v22.12+ (v22 recommended) nodejs.org
Bun v1.4.2 Version-pinned install below
Rust stable (1.77+) rustup.rs

macOS only: Xcode Command Line Tools are required:

Terminal window
xcode-select --install
Terminal window
brew install node@22
curl -fsSL https://bun.com/install | bash -s "bun-v1.4.2"
bun --version

Make sure Bun is available on your PATH. Node.js and Rust are still required for the Vite/Tauri toolchain, and each platform also needs the build tools listed in the Tauri prerequisites.

Terminal window
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Restart your shell, then verify:
rustc --version
Terminal window
git clone https://github.com/tukuyomil032/mc-vector.git
cd mc-vector
bun install
Terminal window
bun run dev

Opens the Vite dev server at https://mc-vector.localhost via portless. Use this for UI-only work that doesn’t require Rust backend functionality.

For a plain HTTP server without portless:

Terminal window
bun run dev:plain
# → http://localhost:5173
Terminal window
bun run tauri:dev

Starts both the Vite dev server and the Tauri desktop window. Required for any work involving Rust commands (server management, file operations, etc.). The development app is named MC-Vector Debug and uses bundle identifier com.tukuyomi032.mcvector.debug, keeping its application data and OS permissions separate from the release app.

Terminal window
bun run lint # Oxlint
bun run fmt # Oxfmt
bun run check # Oxlint + Oxfmt check
bun run check:fix # Format and auto-fix lint issues
bun run rustfmt:check

Lefthook runs Oxfmt and Oxlint with staged JavaScript/TypeScript files and runs a check-only Rustfmt gate for staged Rust changes. Use bun run rustfmt to apply Rust formatting explicitly.

Terminal window
bun run tauri:build

Artifacts are written to src-tauri/target/release/bundle/.

Terminal window
bun run tauri:build:debug

This creates an unsigned debug build with the same isolated debug product name and bundle identifier as bun run tauri:dev.

Command Description
bun install Install all dependencies
bun run dev Frontend dev server (HTTPS via portless)
bun run dev:plain Raw Vite dev server at localhost:5173
bun run tauri:dev Full desktop app in isolated debug mode
bun run build Build frontend for production
bun run tauri:build Build production Tauri binary
bun run tauri:build:debug Build unsigned isolated debug Tauri binary
bun run check Run Oxlint + Oxfmt checks
bun run check:fix Format and auto-fix lint issues
bun run lint Run Oxlint
bun run lint:fix Run Oxlint with auto-fix
bun run fmt Format code with Oxfmt
bun run fmt:check Check Oxfmt output without changes
bun run format Compatibility alias for bun run fmt
bun run rustfmt Format Rust code (cargo fmt)
bun run rustfmt:check Check Rust formatting without changes
bun run clean:artifacts Delete dist/, build output, node_modules/.vite
  1. No any — use unknown for external input and narrow with type guards in src/lib/guards/.
  2. All API payloads from external services must pass a runtime type guard before use.
  3. Components call wrappers in src/lib/ — never raw invoke() directly.
  4. Explicit prop interfaces for all components.
  1. Return Result<T, String> from Tauri commands — the string becomes the JS-side error message.
  2. File operations must go through resolve_managed_path — never accept a raw user-supplied path.
  3. Follow standard Rust style enforced by cargo fmt.

Before opening a PR:

Terminal window
# Frontend: lint + format check + build
bun run check && bun run build
# Rust: format check + compile check + unit tests
cd src-tauri && cargo check -q && cargo test -q

https://mc-vector.localhost not accessible:

Terminal window
bunx --no-install portless trust
bunx --no-install portless hosts sync # requires sudo

Or use the plain dev server: bun run dev:plain

Tauri build fails on macOS:

Terminal window
xcode-select --install

Build errors after pulling:

Terminal window
bun run clean:artifacts
bun install

Lefthook not running:

Terminal window
bunx --no-install lefthook install