Remove Rust code, delegate server to nuwiki-rs repo
CI / cargo clippy (pull_request) Failing after 42s
CI / cargo fmt --check (pull_request) Failing after 45s
CI / cargo test (pull_request) Failing after 49s
CI / editor keymaps (pull_request) Has been skipped

Delete all Rust crates (crates/) and Cargo files. The nuwiki-ls binary
is now built in the separate nuwiki-rs repository and downloaded at
install time from the Gitea release assets, with a cargo build fallback
that clones nuwiki-rs.

Update all documentation to reflect the split repo layout.
This commit is contained in:
gffranco
2026-06-24 12:57:15 +00:00
parent 0df72e52ea
commit cb11889e72
81 changed files with 234 additions and 26425 deletions
+29 -8
View File
@@ -10,8 +10,8 @@
# * opting out with use_calendar = false.
#
# A stub calendar-vim on the runtimepath provides :Calendar and seeds the
# default hook names. The LSP binary is built (setup() registers the client);
# the calendar paths themselves don't need the server.
# default hook names. The LSP binary is downloaded (setup() registers the
# client); the calendar paths themselves don't need the server.
#
# Exit: 0 when both runs are green, 1 otherwise. Skips (0) without nvim.
@@ -28,13 +28,34 @@ if ! command -v nvim >/dev/null 2>&1; then
exit 0
fi
# setup() registers the LSP client, so build the binary like the other
# Neovim harnesses do (incremental, fast).
# Download the LSP binary from nuwiki-rs releases (falls back to cargo build).
BIN="$REPO_ROOT/bin/nuwiki-ls"
log 'building nuwiki-ls (release, incremental)…'
cargo build --release -p nuwiki-ls --manifest-path "$REPO_ROOT/Cargo.toml" >/dev/null
mkdir -p "$REPO_ROOT/bin"
ln -sf "$REPO_ROOT/target/release/nuwiki-ls" "$BIN"
log 'downloading nuwiki-ls…'
if [[ ! -x "$BIN" ]]; then
vim -e -s -c "source $REPO_ROOT/scripts/download_bin.vim" -c "q" >/dev/null 2>&1 || true
fi
# If download failed, fall back to cargo build from nuwiki-rs.
if [[ ! -x "$BIN" ]]; then
log "download failed, falling back to cargo build from nuwiki-rs…"
rs_repo="$REPO_ROOT/nuwiki-rs"
if [[ ! -f "$rs_repo/Cargo.toml" ]]; then
log "cloning nuwiki-rs …"
git clone --depth 1 https://code.gfran.co/gffranco/nuwiki-rs.git "$rs_repo"
fi
cargo build --release -p nuwiki-ls --manifest-path "$rs_repo/Cargo.toml" >/dev/null
if [[ ! -f "$rs_repo/target/release/nuwiki-ls" ]]; then
echo 'FAIL: could not build nuwiki-ls binary' >&2
exit 1
fi
mkdir -p "$REPO_ROOT/bin"
ln -sf "$rs_repo/target/release/nuwiki-ls" "$BIN"
fi
if [[ ! -x "$BIN" ]]; then
echo 'FAIL: could not obtain nuwiki-ls binary' >&2
exit 1
fi
# --- Scratch wiki with one seeded diary entry (2026-05-30) ----------------
WIKI="$TMP/wiki"
+28 -9
View File
@@ -5,7 +5,7 @@
#
# The Lua harness needs a real LSP attachment (most keymaps dispatch
# `workspace/executeCommand`), so we:
# 1. ensure `bin/nuwiki-ls` is built (release),
# 1. download `bin/nuwiki-ls` from the nuwiki-rs releases,
# 2. spin up a scratch wiki under a temp dir,
# 3. invoke `nvim --headless` with a minimal init that loads the
# plugin + calls `setup()`, then sources the harness Lua.
@@ -20,15 +20,34 @@ trap 'rm -rf "$TMP"' EXIT
log() { printf '\033[1;34m[keymap-test]\033[0m %s\n' "$*"; }
# Always rebuild the LSP binary so harness runs against current sources.
# A previous version only built when the symlink was missing, which let
# stale binaries pass tests against unrelated code — incremental cargo
# build is fast, so just always run it.
# Download the LSP binary from nuwiki-rs releases (falls back to cargo build).
BIN="$REPO_ROOT/bin/nuwiki-ls"
log 'building nuwiki-ls (release, incremental)…'
cargo build --release -p nuwiki-ls --manifest-path "$REPO_ROOT/Cargo.toml" >/dev/null
mkdir -p "$REPO_ROOT/bin"
ln -sf "$REPO_ROOT/target/release/nuwiki-ls" "$BIN"
log 'downloading nuwiki-ls…'
if [[ ! -x "$BIN" ]]; then
vim -e -s -c "source $REPO_ROOT/scripts/download_bin.vim" -c "q" >/dev/null 2>&1 || true
fi
# If download failed, fall back to cargo build from nuwiki-rs.
if [[ ! -x "$BIN" ]]; then
log "download failed, falling back to cargo build from nuwiki-rs…"
rs_repo="$REPO_ROOT/nuwiki-rs"
if [[ ! -f "$rs_repo/Cargo.toml" ]]; then
log "cloning nuwiki-rs …"
git clone --depth 1 https://code.gfran.co/gffranco/nuwiki-rs.git "$rs_repo"
fi
cargo build --release -p nuwiki-ls --manifest-path "$rs_repo/Cargo.toml" >/dev/null
if [[ ! -f "$rs_repo/target/release/nuwiki-ls" ]]; then
echo 'FAIL: could not build nuwiki-ls binary' >&2
exit 1
fi
mkdir -p "$REPO_ROOT/bin"
ln -sf "$rs_repo/target/release/nuwiki-ls" "$BIN"
fi
if [[ ! -x "$BIN" ]]; then
echo 'FAIL: could not obtain nuwiki-ls binary' >&2
exit 1
fi
mkdir -p "$TMP/wiki"
echo "= seed =" > "$TMP/wiki/index.wiki"