export CARGO_TARGET_DIR := justfile_directory() / "target"

default:
    @just --list

# Create a new prototype or full game
# Usage: just new prototypes/new-experiment
#        just new foo
new target:
    scripts/new {{target}}

# Run a debug build
run target:
    scripts/run {{target}}

# Watch for changes and re-run
develop target:
    scripts/develop {{target}}

# Clippy check
check target:
    scripts/check {{target}}

# Run cargo test on a crate/prototype, or all prototypes if none given
test target="prototypes":
    scripts/test {{target}}

# Release build
build target:
    scripts/build {{target}}

# Format all projects
fmt:
    scripts/fmt

# Build a wasm32 release and optimize with wasm-opt; output goes to dist/<target>/
webbuild target:
    scripts/webbuild {{target}}

# Serve a built web target from dist/<target>/ via simple-http-server
serve target:
    scripts/serve {{target}}
