This file provides guidance when working with code in this repository.
runpumpkin is a native CLI tool that automates local Pumpkin plugin development. It downloads the latest Pumpkin server binary, builds the current workspace as a wasm32-wasip2 plugin, copies it into the server's plugins/ directory, and launches the server.
# Build the tool
cargo build --release
# Run the tool (from a plugin workspace)
./target/release/runpumpkinsrc/main.rs — orchestration only:
- Creates
.server/plugins/in the current directory. - Calls
download::Downloader::new()?.get_pumpkin()to obtain a cached or freshly downloaded Pumpkin binary. - Calls
build::Builder::build()to compile the plugin and locate the built.wasm. - Copies the
.wasminto.server/plugins/. - Launches the Pumpkin server from
.server/.
src/download.rs — Pumpkin binary management (Downloader):
- Queries the GitHub Releases API for the latest Pumpkin release.
- Caches the binary in the OS cache directory (
<cache>/runpumpkin/pumpkin-<version>[.exe]). - Selects the correct asset by matching OS and architecture against the release asset names.
- Sets executable permissions on Unix after download.
src/build.rs — plugin compilation and artifact location (Builder):
- Runs
cargo build --release --target wasm32-wasip2on the current workspace. - Uses
cargo metadatato derive the package name and locate the built.wasmfile.
| Path | Contents |
|---|---|
src/main.rs |
CLI entry point, orchestration |
src/download.rs |
Pumpkin binary download and caching |
src/build.rs |
Plugin compilation and .wasm location |
- All Clippy warnings are enabled (
[lints.clippy] all = "warn"). unsafe_codeis forbidden project-wide ([lints.rust] unsafe_code = "forbid").- The tool uses
reqwest::blockingfor HTTP; no async runtime. - The Pumpkin binary cache is keyed by release tag, so updates are picked up automatically on the next run when a new release is published.