# ArchScript — justfile
# Run recipes with: just <recipe>
# List all recipes: just --list
# Default recipe: build and test
default: build test
# ── Build ─────────────────────────────────────────────────────────────────────
# Build in debug mode
build:
cargo build
# Build in release mode
release:
cargo build --release
# Clean build artifacts
clean:
cargo clean
# ── Test ──────────────────────────────────────────────────────────────────────
# Run all tests (unit + integration)
test:
cargo test
# Run tests with output shown
test-verbose:
cargo test -- --nocapture
# Run only unit tests (parser + interpreter + stdlib)
test-unit:
cargo test --lib
# Run only integration tests
test-integration:
cargo test --test integration
# Run only stdlib tests
test-stdlib:
cargo test stdlib
# Run only REPL tests
test-repl:
cargo test repl
# Run a specific test by name
test-one name:
cargo test {{name}} -- --nocapture
# ── Lint & Format ─────────────────────────────────────────────────────────────
# Run clippy linter
lint:
cargo clippy -- -D warnings
# Check formatting
fmt-check:
cargo fmt -- --check
# Auto-format code
fmt:
cargo fmt
# Full quality check: format, lint, test
check: fmt-check lint test
# ── Run ───────────────────────────────────────────────────────────────────────
# Run an ArchScript source file
run file:
cargo run -- run {{file}}
# Evaluate an expression inline
eval expr:
cargo run -- eval "{{expr}}"
# Parse a file and print AST (for debugging)
parse file:
cargo run -- parse {{file}}
# Start the interactive REPL
repl:
cargo run -- repl
# Run the hello world example
hello:
cargo run -- run examples/hello.as
# Run the functions example
functions:
cargo run -- run examples/functions.as
# Run the Arch Linux stdlib demo
archlinux:
cargo run -- run examples/archlinux.as
# Run the Docker demo
docker:
cargo run -- run examples/docker.as
# Run only docker/compose/swarm tests
test-docker:
cargo test docker
cargo test compose
cargo test swarm
# Run all examples
examples: hello functions archlinux docker
# ── Development ───────────────────────────────────────────────────────────────
# Install git hooks (run once after clone)
setup-hooks:
cp hooks/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
@echo "Git hooks installed."
# Watch for changes and run tests (requires cargo-watch)
watch:
cargo watch -x test
# Watch and run a specific file on changes
watch-run file:
cargo watch -x "run -- run {{file}}"
# Build docs
doc:
cargo doc --no-deps --open
# Show project stats (lines of code)
loc:
@echo "=== Source files ==="
@wc -l src/*.rs src/*.pest src/stdlib/*.rs
@echo ""
@echo "=== Test files ==="
@wc -l tests/*.rs
@echo ""
@echo "=== Total ==="
@wc -l src/*.rs src/*.pest src/stdlib/*.rs tests/*.rs
# Show the pest grammar
grammar:
@cat src/archscript.pest
# ── CI ────────────────────────────────────────────────────────────────────────
# Full CI pipeline: format check, lint, build, test
ci: fmt-check lint build test
@echo "CI passed."
# ── Release & Install ────────────────────────────────────────────────────────
# Install locally
install:
cargo install --path .
# Uninstall
uninstall:
cargo uninstall archscript
# ── Deploy ───────────────────────────────────────────────────────────────────
# Check deployment prerequisites
deploy-check:
./deploy.sh check
# Show current version
version:
@grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/'
# Create a release tag (triggers CI/CD): just deploy-tag 0.2.0
deploy-tag version:
./deploy.sh tag {{version}}
# Publish to crates.io (manual)
deploy-cargo:
./deploy.sh cargo
# Build and publish Python wheel to PyPI (manual)
deploy-pypi:
./deploy.sh pypi
# Full release — tag + publish to crates.io + PyPI: just deploy-all 0.2.0
deploy-all version:
./deploy.sh all {{version}}
# Build Python wheel locally (for testing)
build-wheel:
pip install maturin 2>/dev/null || true
maturin build --release --out dist/
# Dry-run publish to crates.io (verify packaging)
publish-dry-run:
cargo publish --dry-run
# ── AUR Deployment ─────────────────────────────────────────────────────────
# Check AUR deployment prerequisites
deploy-aur-check:
./aur/deploy-aur.sh --check
# Update PKGBUILD and .SRCINFO without pushing to AUR
deploy-aur-update:
./aur/deploy-aur.sh --update-only
# Dry-run AUR deployment (no push, shows generated PKGBUILD)
deploy-aur-dry-run:
./aur/deploy-aur.sh --dry-run
# Build from local source and install as pacman package (test before AUR push)
install-pacman:
./aur/deploy-aur.sh --install
# Remove the archscript pacman package
uninstall-pacman:
./aur/deploy-aur.sh --uninstall
# Publish current version to AUR
deploy-aur:
./aur/deploy-aur.sh
# Publish specific version to AUR: just deploy-aur-version 0.3.0
deploy-aur-version version:
./aur/deploy-aur.sh {{version}}