Expand description
mlua-pkg integration: a TealResolver that serves .tl modules through
mlua-pkg’s Registry, so Teal sources sit in the same resolution chain as
Rust-native modules, embedded Lua, vendored git deps and assets.
require("name")
Registry
├─ NativeResolver host_module userdata / Rust tables
├─ TealResolver name -> name.tl | name/init.tl (check + gen + load)
│ name -> name.d.tl (type-only: empty table)
├─ VendoredResolver mlua-pkg.toml git deps
└─ FsResolver plain .luaThe resolver must run on a Lua that an Htl was attached to
(Htl::new / Htl::from_lua); it finds the compiler through the Lua registry.
Type errors are returned as Some(Err) so, per mlua-pkg’s contract, a broken
.tl never silently falls through to a later resolver.
Re-exports§
pub use mlua_pkg;
Structs§
- AddDone
- What
Project::adddid: mlua-pkg’s own report, and what htl carried across it. - Patch
Status - Where a patched dependency stands after an install: whether the copy is what the dependency resolves from, and the two revisions the answer rests on.
- Patched
- A dependency the project took into its tree: the name the manifest declares it under,
and the directory
patch_dirpoints at, absolute. - Project
- An
mlua-pkg.tomlproject: where the manifest, lockfile and installed deps live. - Teal
Resolver - Resolves
require("a.b")toa/b.tl,a/b/init.tl, ora/b.d.tlunder a sandboxed root, type-checking and generating on the fly. - Types
Sync - What
Project::sync_typesandProject::add_typesdid: one entry per declaration they were offered.
Enums§
- Teal
Resolve Error - Error raised when a
.tlmodule fails the type check atrequiretime.
Constants§
- LOCKFILE_
NAME - MANIFEST_
NAME - PATCHES_
DIR - Where
Project::patchputs a dependency it takes into the tree:patches/<dep>, beside the project’s own sources rather than underpkgs_dir. One directory per dependency, named after it, so the path a diagnostic carries names the dependency it is in. - TEAL_
TYPES_ GIT - Where the Teal ecosystem collects declarations for libraries that ship none of their
own:
types/<library>/<module>.d.tl, published to LuaRocks one library at a time as<library>-tl-type.
Functions§
- contract_
resolvers - One
TealResolverper[[contract]]inhtl.toml, in declaration order, so the host andhtl checkenforce the same contracts from the same source.rootis the directory holdinghtl.toml(the pathHtlConfig::findreturns, minus the file name). Add them to aRegistrybefore the plain resolvers. - pkgs_
dir - Where a project’s installed deps go:
<root>/.htl/modules, always.