Strip frork-lua to a minimal skeleton
The crate had prototype code (hello, add, CLI parser, hardcoded
constants) that did not reflect the actual assertion engine. Replace
with a stub that exports only VERSION, with comments documenting the
crate's purpose and what needs to happen before it becomes useful.
Drop clap and frork-lib dependencies — neither is needed until the
assertion engine moves to frork-lib.
diff --git a/Cargo.lock b/Cargo.lock
index d50194a..8532086 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -334,8 +334,6 @@ dependencies = [
name = "frork"
version = "0.1.0"
dependencies = [
- "clap",
- "frork-lib",
"mlua",
]
diff --git a/frork-lua/Cargo.toml b/frork-lua/Cargo.toml
index 01bae2b..aa8f64e 100644
--- a/frork-lua/Cargo.toml
+++ b/frork-lua/Cargo.toml
@@ -7,6 +7,4 @@ edition = "2024"
crate-type = ["cdylib"]
[dependencies]
-frork-lib = { path = "../frork-lib" }
-clap = { version = "*", features = ["derive"] }
mlua = { version = "*", features = ["lua54", "module"] }
diff --git a/frork-lua/src/lib.rs b/frork-lua/src/lib.rs
index ee7fe27..00de764 100644
--- a/frork-lua/src/lib.rs
+++ b/frork-lua/src/lib.rs
@@ -1,68 +1,18 @@
-use clap::{Parser, Subcommand};
use mlua::prelude::*;
-fn hello(name: Option<String>) -> String {
- match name {
- Some(name) => format!("Hello, {}!", name),
- None => "Hello, World!".to_string(),
- }
-}
-
-fn add(x: i64, y: i64) -> i64 {
- x + y
-}
-
-#[derive(Parser)]
-#[command(name = "fennel-app")]
-struct Cli {
- #[command(subcommand)]
- command: Option<Commands>,
-}
-
-#[derive(Subcommand)]
-enum Commands {
- #[command(about = "Check status of resources")]
- Status,
- #[command(about = "Satisfy (install/fix) resources")]
- Satisfy,
-}
+// This crate builds a cdylib that can be loaded as a Lua module via
+// `require("frork")`. The goal is to expose frork's assertion engine
+// so Fennel's `--compile-binary` can produce standalone binaries
+// without the Rust toolchain at runtime.
+//
+// The assertion engine currently lives in frork-cli. Once it moves
+// to frork-lib, this module will re-export it to Lua.
#[mlua::lua_module]
fn frork(lua: &Lua) -> LuaResult<LuaTable> {
let exports = lua.create_table()?;
- // Simple hello function
- exports.set(
- "hello",
- lua.create_function(|_, name: Option<String>| Ok(hello(name)))?,
- )?;
-
- // Simple add function
- exports.set(
- "add",
- lua.create_function(|_, (x, y): (i64, i64)| Ok(add(x, y)))?,
- )?;
-
- // CLI parsing function
- exports.set(
- "parse_args",
- lua.create_function(|_, _: LuaMultiValue| {
- let cli = Cli::parse();
-
- let result = match cli.command.unwrap_or(Commands::Status) {
- Commands::Status => "status".to_string(),
- Commands::Satisfy => "satisfy".to_string(),
- };
-
- Ok(result)
- })?,
- )?;
-
- // A table with some constants
- let constants = lua.create_table()?;
- constants.set("VERSION", "1.0.0")?;
- constants.set("AUTHOR", "Frork Team")?;
- exports.set("constants", constants)?;
+ exports.set("VERSION", env!("CARGO_PKG_VERSION"))?;
Ok(exports)
}