diff --git a/dist/lua/README.md b/dist/lua/README.md index a7ebfbc..c7342a7 100644 --- a/dist/lua/README.md +++ b/dist/lua/README.md @@ -8,20 +8,12 @@ This is important because Lua looks up the constructor symbol based on filename. Type hints are provided in `annotations.lua`, just include them in your language server: `---@module 'annotations'`. -## Example loader -A simple loader is provided here: +## LuaRocks +`codemp` is available as a rock on [LuaRocks](https://luarocks.org/modules/alemi/codemp) -```lua ----@module 'annotations' +## Manual bundling +LuaRocks compiles from source, which only works if have the rust toolchain available. To provide a reasonable NeoVim experience, we provide pre-built binaries. ----@return Codemp -local function load() - local native, _ = require("codemp.native") - return native -end - -return { - load = load, -} -``` +> Download latest build and annotations from [here](https://codemp.dev/releases/lua/) +You will need a loader file to provide annotations: you can use provided `codemp.lua` diff --git a/dist/lua/build.sh b/dist/lua/build.sh deleted file mode 100755 index e14b71b..0000000 --- a/dist/lua/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -cd ../.. -cargo build --release --features=lua -mv ./target/release/libcodemp.so ./dist/lua/codemp_native.so diff --git a/dist/lua/codemp-0.0.1-1.rockspec b/dist/lua/codemp-0.0.1-1.rockspec new file mode 100644 index 0000000..150701f --- /dev/null +++ b/dist/lua/codemp-0.0.1-1.rockspec @@ -0,0 +1,40 @@ +package = "codemp" +version = "0.0.1-1" + +source = { + -- url = "git+https://github.com/hexedtech/codemp", + url = "git+file:///home/alemi/source/work/codemp/lib", + branch = "ci", +} + +dependencies = { + "Lua >= 5.1", + "luarocks-build-rust-mlua", +} + +description = { + summary = "code multiplexer -- lua bindings", + detailed = [[ + codemp is a cooperative live editing framework by hexed.technology + + it provides a batteries-included CRDT-powered client capable of keeping + in sync local buffers and sharing cursor event to all workspace members. + this is a native lua library, completely written in Rust + ]], + homepage = "https://code.mp", + license = "GPL-3.0", + -- labels = { "codemp", "cooperative", "ffi", "editor", "rust" }, + maintainer = "alemi ", +} + +build = { + type = "rust-mlua", + modules = { + ["codemp_native"] = "codemp", + }, + target_path = "../..", + include = { + "codemp.lua", + "annotations.lua", + } +} diff --git a/dist/lua/codemp.lua b/dist/lua/codemp.lua new file mode 100644 index 0000000..25a7af4 --- /dev/null +++ b/dist/lua/codemp.lua @@ -0,0 +1,5 @@ +---@module 'annotations' +---@type Codemp +local native = require('codemp.native') + +return native