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
+14 -12
View File
@@ -1,5 +1,5 @@
" scripts/download_bin.vim — install `nuwiki-ls` from a release tarball,
" falling back to `cargo build --release` on failure.
" falling back to `cargo build --release` from the nuwiki-rs repo.
"
" Invoked by Dein / vim-plug build hooks:
" vim -e -s -c "source scripts/download_bin.vim" -c "q"
@@ -16,6 +16,7 @@ let s:plugin_dir = fnamemodify(resolve(expand('<sfile>:p')), ':h:h')
let s:bin_dir = s:plugin_dir . '/bin'
let s:suffix = has('win32') ? '.exe' : ''
let s:bin = s:bin_dir . '/nuwiki-ls' . s:suffix
let s:rs_repo = fnamemodify(s:plugin_dir, ':h:h') . '/nuwiki-rs'
call mkdir(s:bin_dir, 'p')
@@ -44,13 +45,21 @@ function! s:build_from_source() abort
echohl ErrorMsg | echom 'nuwiki: cargo not found, cannot build from source' | echohl None
return 0
endif
echom 'nuwiki: cloning nuwiki-rs …'
if !filereadable(s:rs_repo . '/Cargo.toml')
call system('git clone --depth 1 https://code.gfran.co/gffranco/nuwiki-rs.git ' . shellescape(s:rs_repo))
if v:shell_error != 0
echohl ErrorMsg | echom 'nuwiki: failed to clone nuwiki-rs' | echohl None
return 0
endif
endif
echom 'nuwiki: cargo build --release …'
call system('cargo build --release -p nuwiki-ls --manifest-path ' . shellescape(s:plugin_dir . '/Cargo.toml'))
call system('cargo build --release -p nuwiki-ls --manifest-path ' . shellescape(s:rs_repo . '/Cargo.toml'))
if v:shell_error != 0
echohl ErrorMsg | echom 'nuwiki: cargo build failed' | echohl None
return 0
endif
let l:built = s:plugin_dir . '/target/release/nuwiki-ls' . s:suffix
let l:built = s:rs_repo . '/target/release/nuwiki-ls' . s:suffix
call system('cp ' . shellescape(l:built) . ' ' . shellescape(s:bin))
call system('chmod +x ' . shellescape(s:bin))
return executable(s:bin)
@@ -64,10 +73,7 @@ function! s:download_release() abort
if !executable('curl') || !executable('tar')
return 0
endif
" Gitea serves the most recent release under the `latest` tag segment
" (/releases/download/latest/<asset>). NOT GitHub's
" /releases/latest/download/<asset> shape, which Gitea 404s.
let l:url = 'https://code.gfran.co/gffranco/nuwiki/releases/download/latest/nuwiki-ls-'
let l:url = 'https://code.gfran.co/gffranco/nuwiki-rs/releases/download/latest/nuwiki-ls-'
\ . l:target . '.tar.gz'
let l:archive = tempname() . '.tar.gz'
call system('curl -fsSL -o ' . shellescape(l:archive) . ' ' . shellescape(l:url))
@@ -85,11 +91,7 @@ function! s:download_release() abort
return executable(s:bin)
endfunction
if get(g:, 'nuwiki_build_from_source', 0)
if !s:build_from_source()
echohl ErrorMsg | echom 'nuwiki: source build failed' | echohl None
endif
elseif s:download_release()
if s:download_release()
echom 'nuwiki: installed ' . s:bin
else
echohl WarningMsg | echom 'nuwiki: download failed, falling back to source build' | echohl None