# dovenest developer tasks dev-root := '.dev/root' dev-db := '.dev/db.sqlite' dev-cache := '.dev/cache' # Show the available recipes (runs when you type `just` without arguments). default: @just --list # Create the dev root folder. dev-data: mkdir -p {{dev-root}} # Also run `just dev-web` for the HMR frontend dev server on :8080. # Start the dev backend on :8081 (creates the dev root folder first). dev: dev-data dev-server # Dev backend on :8081 — the API plus static files from web/dist (no HMR). dev-server: cargo run -p server -- --root {{dev-root}} --db {{dev-db}} --cache {{dev-cache}} --port 8081 # Frontend dev server on :8080 (Trunk with HMR; proxies /api to :8081). # Trunk strips the /api rewrite prefix, so the backend URL carries it back. dev-web: build-cm cd web && trunk serve --proxy-rewrite /api --proxy-backend http://127.0.0.1:8081/api # Build the frontend and stage it into server/dist for the embedded build. frontend: build-cm cd web && trunk build --release rm -rf server/dist cp -r web/dist server/dist # Production single binary (frontend embedded). build: frontend cargo build --locked --release -p server --features embedded # Production end-to-end: build the real frontend, embed it, and check the embedded assets. e2e: frontend cargo test -p server --features embedded --test api embedded # Requires bun (https://bun.sh); web/bun.lock pins the dependencies and # web/cm6.js is a gitignored build artifact. Runs automatically via `build`, # `dev-web` and `e2e`. # Build the vendored CodeMirror bundle (web/cm6.js) from web/cm/wrapper.js. build-cm: cd web && bun install --frozen-lockfile && bun run build # Run the production binary against the dev folders. run: dev-data build ./target/release/dovenest --root {{dev-root}} --db {{dev-db}} --cache {{dev-cache}} # All workspace test suites (unit + integration tests). test: cargo test --workspace # Lint: formatting check + clippy with warnings denied. lint: cargo fmt --check cargo clippy --workspace --all-targets -- -D warnings # Format the whole workspace. fmt: cargo fmt # Coverage report (requires `cargo install cargo-llvm-cov` + `rustup component add llvm-tools`). cov: cargo llvm-cov -p server # Remove the dev database (factory reset of users/shares/settings). reset-db: rm -f {{dev-db}} {{dev-db}}-wal {{dev-db}}-shm