| 1 | [package] |
| 2 | name = "feel-lua" |
| 3 | description = "Lua (mlua) wrapper around feel-core." |
| 4 | edition.workspace = true |
| 5 | version.workspace = true |
| 6 | license.workspace = true |
| 7 | |
| 8 | [lib] |
| 9 | # The loadable module is `feel` (Lua `require("feel")` -> `luaopen_feel`); the |
| 10 | # cdylib is `libfeel.so`, loaded via a `lib?.so` cpath template. `rlib` so the |
| 11 | # boundary helpers and `build_module` are reachable from the Rust integration |
| 12 | # tests (which embed a vendored Lua and call `build_module` directly). |
| 13 | name = "feel" |
| 14 | crate-type = ["cdylib", "rlib"] |
| 15 | |
| 16 | [dependencies] |
| 17 | # Lua 5.1–5.5 / LuaJIT / Luau bindings. Since 0.10 `Table`/`Function`/`Value` are |
| 18 | # owned and `'static`, so they drop straight into feel-core's |
| 19 | # `Arc<dyn ForeignObject + 'static>` seam (ADR-21/ADR-22). The Lua version and |
| 20 | # build mode are selected through this crate's own features (see `[features]`), |
| 21 | # not here, so a downstream can pick LuaJIT/Luau or the loadable-module mode. |
| 22 | mlua = { version = "0.11", default-features = false } |
| 23 | # Build the EvalEnv instant (now()/today()) from the system clock; no tzdb needed |
| 24 | # here (temporal value logic lives in feel-core). |
| 25 | jiff = { workspace = true, features = ["std"] } |
| 26 | # Default-features ON: RustRegex is the regex dialect (RD-7 — no Lua-pattern |
| 27 | # provider) and the system tzdb resolves named zones. |
| 28 | feel-core = { path = "../feel-core" } |
| 29 | |
| 30 | [dev-dependencies] |
| 31 | # Integration tests embed a real (vendored) Lua VM and drive the module from Lua |
| 32 | # scripts. They reuse this crate's mlua via `pub use mlua`, so no separate Lua is |
| 33 | # linked; this entry only documents the version for clarity. |
| 34 | mlua = { version = "0.11", default-features = false, features = ["lua54", "vendored"] } |
| 35 | |
| 36 | [features] |
| 37 | # Test/embed default: Lua 5.4 compiled in (vendored), so `cargo test -p feel-lua` |
| 38 | # is self-contained and `Lua::new()` works. |
| 39 | default = ["lua54", "vendored"] |
| 40 | lua54 = ["mlua/lua54"] |
| 41 | luajit = ["mlua/luajit"] |
| 42 | luau = ["mlua/luau"] |
| 43 | # Statically compile Lua into the build (no system Lua needed). Used for tests and |
| 44 | # for embedding feel-lua in a Rust host. |
| 45 | vendored = ["mlua/vendored"] |
| 46 | # Build a Lua-loadable C module (`luaopen_feel`), linking against the host's Lua at |
| 47 | # load time instead of embedding one. Mutually exclusive with `vendored` in |
| 48 | # practice: `cargo build -p feel-lua --no-default-features --features lua54,module`. |
| 49 | module = ["mlua/module"] |