rvpm 3.34.0

Fast Neovim plugin manager with pre-compiled loader and merge optimization
[tasks.default]
alias = "check"

[tasks.check]
description = "Run fmt + clippy + test (same as CI)"
dependencies = ["fmt-check", "clippy", "test"]

[tasks.fmt-check]
description = "Check formatting"
command = "cargo"
args = ["fmt", "--all", "--", "--check"]

[tasks.fmt]
description = "Apply formatting"
command = "cargo"
args = ["fmt", "--all"]

[tasks.clippy]
description = "Run clippy with warnings as errors"
command = "cargo"
args = ["clippy", "--all-targets", "--", "-D", "warnings"]

[tasks.test]
description = "Run all tests"
command = "cargo"
args = ["test"]

[tasks.install]
description = "Install rvpm from local source (respects Cargo.lock via --locked)"
command = "cargo"
args = ["install", "--path", ".", "--locked"]

[tasks.publish-dry]
description = "Dry-run crates.io publish"
command = "cargo"
args = ["publish", "--dry-run", "--allow-dirty"]

[tasks.hook-install]
description = "Install git pre-push hook that runs 'cargo make check'"
script_runner = "@duckscript"
script = '''
hook_dir = set ".git/hooks"
hook_file = set "${hook_dir}/pre-push"
mkdir ${hook_dir}
hook_content = set "#!/bin/sh\n# Installed by: cargo make hook-install\ncargo make check"
writefile ${hook_file} ${hook_content}
echo "Installed pre-push hook -> ${hook_file}"
'''

[tasks.apm-install]
description = "Compile the renri skill into .claude/skills/ + .gemini/skills/ + .github/skills/ via APM"
command = "apm"
args = ["install", "-t", "copilot,claude,gemini"]

[tasks.apm-install-update]
description = "Refresh APM dependencies to upstream latest (used by on-add hook)"
command = "apm"
args = ["install", "--update", "-t", "copilot,claude,gemini"]

[tasks.vcs-fetch]
description = "Fetch latest refs (jj when in a jj workspace, otherwise git)"
# Best-effort: a missing `jj`/`git` binary, an unreachable remote, etc.
# should log but not fail `cargo make on-add` and break `renri add`.
ignore_errors = true
script_runner = "@duckscript"
script = '''
# A non-colocated jj workspace has `.jj/` but no `.git/`, and `git fetch`
# fails there with "not a git repository". Prefer `jj git fetch`, which
# works in pure-jj and colocated repos. Fall back to `git fetch` for
# pure-git (no `.jj/`) worktrees.
#
# Best-effort: don't `--fail-on-error` because a transient network
# failure during `renri add` shouldn't break the worktree; the user
# can always `cargo make vcs-fetch` later.
if is_path_exists .jj
    exec jj git fetch
else
    exec git fetch
end
'''

[tasks.on-add]
description = "Wired to renri's [[hooks.post_create]] — runs in a freshly created worktree"
dependencies = ["apm-install-update", "vcs-fetch"]

[tasks.setup]
description = "One-time setup for new contributors: pre-push hook + APM install (requires `apm` CLI on PATH — see https://github.com/microsoft/apm)"
dependencies = ["hook-install", "apm-install"]

# ─── vhs / demo GIF regeneration ───────────────────────────────────────
# Native vhs on Windows hangs on `Set Theme`, so we ship a Docker image
# (vhs + rvpm + claude/gemini/codex CLIs) and drive it from cargo-make.
#
# Windows prerequisites: Docker Engine inside WSL2 (Docker Desktop is not
# required); these tasks shell out via `wsl -- docker ...`. To forward the
# AI API key from PowerShell into WSL, add this to your $PROFILE once:
#   $env:WSLENV += ":GEMINI_API_KEY/u:ANTHROPIC_API_KEY/u:OPENAI_API_KEY/u"
# Linux / macOS: a real `docker` on PATH is enough.

[tasks.vhs-build]
description = "Build the rvpm-vhs Docker image (~5 min first time, cached after)"
cwd = "vhs"
command = "docker"
args = ["build", "-t", "rvpm-vhs", "."]

[tasks.vhs-build.windows]
command = "wsl"
args = ["--", "docker", "build", "-t", "rvpm-vhs", "."]

[tasks.vhs-regen]
description = "Regenerate vhs/demo.gif (or another tape via `cargo make vhs-regen <tape>`)"
dependencies = ["vhs-build"]
cwd = "vhs"
command = "bash"
args = ["regen.sh", "${@}"]

[tasks.vhs-regen.windows]
command = "wsl"
args = ["--", "bash", "regen.sh", "${@}"]