Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit3bb1da2647

README.md

packages Module

Public Luau surface over the __packages Internal FFI namespace — list and look up registered packages.

Purpose

Wrap the raw __packages.* FFI namespace in a typed Luau table that gets auto-injected as _G.packages via the prelude. A package is a folder marked with a package.yaml; its assets are aliased under ~name.<tail> so callers can require / resolve them without knowing the folder's physical location.

package.yaml

A package's package.yaml states its name (the folder stem when absent), version, description, and dependencies: the packages it needs, each a name or { name, version }. Each dependency is a reference the package records, so a push refuses one that resolves to nothing, and an install of the package (and its zeromind.preview) brings every dependency along at the version the author's world holds. A stated version that differs from the one the dependency's own package.yaml states is refused by asset.validate and the push. guides { path = "types/package" } covers the whole shape.

Usage

for _, p in ipairs(packages.list()) do
    print(p.name, p.scope, p.root_path, p.identity_prefix)
end

local p = packages.lookup("audio")
local q = packages.lookup("@builtin", "audio")

Exports

  • packages.list() -> { PackageEntry }
  • packages.lookup(name) -> PackageEntry? — packages.lookup(scope, name) -> PackageEntry?.