diff --git a/justfile b/justfile new file mode 100644 index 0000000..563e545 --- /dev/null +++ b/justfile @@ -0,0 +1,40 @@ +# Default recipe to show help +@default: + just --list + +# Build all crates +build-all: build-server build-tui build-ui + +# Build the server crate +build-server: + cargo build -p pinakes-server + +# Build the TUI crate +build-tui: + cargo build -p pinakes-tui + +# Build the UI using Dioxus CLI. The UI *has* to be built with `dx`, because CSS +# is not correctly embedded otherwise. +build-ui: + dx build -p pinakes-ui + +# Generate REST API documentation using cargo xtask +@docs: + cargo xtask docs + +# Run all tests +@test: + cargo nextest run --workspace + +# Format code +@fmt: + cargo fmt + +# Run clippy linting +@lint: + cargo clippy --workspace + +# Clean build artifacts +@clean: + cargo clean + rm -rf target/dx/ diff --git a/nix/shell.nix b/nix/shell.nix index dcff21d..6e706fc 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -26,21 +26,22 @@ in name = "pinakes-dev"; packages = [ - # Build tools # We use the rust-overlay to get the stable Rust toolchain for various targets. # This is not exactly necessary, but it allows for compiling for various targets - # with the least amount of friction. + # with the least amount of friction. The extensions are to make sure all tooling + # uses the same Rust version and the general surrounding tooling. (rust-bin.nightly.latest.default.override { extensions = ["rustfmt" "rust-src" "rust-analyzer" "clippy" "rust-analyzer"]; targets = ["wasm32-unknown-unknown" "wasm32-wasip1"]; # web + plugins }) - # Modern, LLVM based linking pipeline + # Modern, LLVM based linking pipeline. Kind of sucks on Windows, though. llvmPackages.lld llvmPackages.clang - # Handy CLI for packaging Dioxus apps and such - pkgs.dioxus-cli + # CLI helpers + pkgs.dioxus-cli # for packaging Dioxus apps and such + pkgs.just # general command runner for everything # Additional Cargo Tooling pkgs.cargo-nextest