plugin_id := "fly-sprites-workers"
plugin_dir := justfile_directory()

default:
    @just --list

# Install dependencies, typecheck, and install or reload the plugin in Paseo
install:
    npm install
    npm run typecheck
    @if paseo plugin ls {{plugin_id}} >/dev/null 2>&1; then \
        paseo plugin reload {{plugin_id}} || paseo plugin enable {{plugin_id}}; \
    else \
        paseo plugin install "{{plugin_dir}}"; \
    fi

# Typecheck TypeScript sources
typecheck:
    npm run typecheck

# Reload the plugin in Paseo
reload:
    paseo plugin reload {{plugin_id}}

# Show recent plugin logs from Paseo
logs:
    paseo plugin logs {{plugin_id}}

# Remove the plugin from Paseo
uninstall:
    paseo plugin remove {{plugin_id}}
