Environment Setup
Prerequisites
Section titled “Prerequisites”| 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:
xcode-select --installInstallation
Section titled “Installation”1. Install Node.js and Bun
Section titled “1. Install Node.js and Bun”brew install node@22curl -fsSL https://bun.com/install | bash -s "bun-v1.4.2"bun --versioncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bashnvm install 22curl -fsSL https://bun.com/install | bash -s "bun-v1.4.2"bun --versionDownload Node.js from nodejs.org, then run this in PowerShell:
iex "& {$(irm https://bun.com/install.ps1)} -Version 1.4.2"bun --versionMake 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.
2. Install Rust
Section titled “2. Install Rust”curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh# Restart your shell, then verify:rustc --version3. Clone and Install Dependencies
Section titled “3. Clone and Install Dependencies”git clone https://github.com/tukuyomil032/mc-vector.gitcd mc-vectorbun installDevelopment Workflow
Section titled “Development Workflow”Frontend Only (browser)
Section titled “Frontend Only (browser)”bun run devOpens 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:
bun run dev:plain# → http://localhost:5173Full Desktop App
Section titled “Full Desktop App”bun run tauri:devStarts 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.
Before Committing
Section titled “Before Committing”bun run lint # Oxlintbun run fmt # Oxfmtbun run check # Oxlint + Oxfmt checkbun run check:fix # Format and auto-fix lint issuesbun run rustfmt:checkLefthook 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.
Production Build
Section titled “Production Build”bun run tauri:buildArtifacts are written to src-tauri/target/release/bundle/.
Packaged Debug Build
Section titled “Packaged Debug Build”bun run tauri:build:debugThis creates an unsigned debug build with the same isolated debug product name and bundle identifier as bun run tauri:dev.
Commands Reference
Section titled “Commands Reference”| 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 |
Coding Conventions
Section titled “Coding Conventions”TypeScript / React
Section titled “TypeScript / React”- No
any— useunknownfor external input and narrow with type guards insrc/lib/guards/. - All API payloads from external services must pass a runtime type guard before use.
- Components call wrappers in
src/lib/— never rawinvoke()directly. - Explicit prop interfaces for all components.
- Return
Result<T, String>from Tauri commands — the string becomes the JS-side error message. - File operations must go through
resolve_managed_path— never accept a raw user-supplied path. - Follow standard Rust style enforced by
cargo fmt.
Testing
Section titled “Testing”Before opening a PR:
# Frontend: lint + format check + buildbun run check && bun run build
# Rust: format check + compile check + unit testscd src-tauri && cargo check -q && cargo test -qTroubleshooting
Section titled “Troubleshooting”https://mc-vector.localhost not accessible:
bunx --no-install portless trustbunx --no-install portless hosts sync # requires sudoOr use the plain dev server: bun run dev:plain
Tauri build fails on macOS:
xcode-select --installBuild errors after pulling:
bun run clean:artifactsbun installLefthook not running:
bunx --no-install lefthook install