mlua-lshape
mlua wrapper for
lshape — Pure Lua Schema-as-Data
validator + LuaCATS codegen. The lshape/*.lua sources are vendored
into this crate (under lua/lshape/) and embedded via include_str!
at compile time.
Quick start
use Lua;
use install;
let lua = new;
install?;
lua.load.exec?;
Why vendored?
The upstream lshape is Pure Lua with no package manager dependency.
Shipping the sources inside this crate keeps downstream builds
hermetic — no LuaRocks, no filesystem probing, no version drift. The
same pattern is used by
mlua-probe-mcp /
mlua-lspec.
Vendored sources
lua/lshape/*.lua is a verbatim copy of the upstream
ynishi/lshape repository, pinned to
v0.1.0. See CHANGELOG.md for the embedded
surface. Refresh via:
The LSHAPE_SOURCES public constant exposes the embedded sources
(&[(name, src)]) for downstream consumers that want to inject them
into another Lua VM or hash them for drift checks.
Lua version
This crate pins mlua to lua54 + vendored, matching the sibling
mlua-* crates (mlua-probe, mlua-lspec, mlua-check). Other Lua
versions are not currently supported.
License
MIT OR Apache-2.0. The vendored lua/lshape/ files are dual-licensed
under the same terms, copyright Yutaka Nishimura.