Lux is a next-generation package manager with ease of use and security in mind. It removes all the troubles
of building, managing and deploying Lua packages and brings joy back into the Lua development cycle.
:package: Create and Manage Lua Projects
Easily manage your entire project in a single, unified lux.toml file.
Supports everything a modern ecosystem needs - build scripts, dependencies, testing and more.
Full support for the rockspec file format.
:gear: Modern, Comfortable Tooling
Integrated code formatting, type checking and powerful code linting.
Good DX - automatically adds project dependencies to .luarc.json for rich LSP diagnostics.
Distribute projects (including dependencies) as install tree archives
or as static binaries that just work on target machines.
:tada: Automatic Rockspec Generation
Lux handles versioning and rockspec generation for you.
Say goodbye to managing 10 different rockspec files in your source code!
Lux takes care of installing the right versions of Lua headers automatically.
Forget about users complaining they have the wrong Lua installed on their system.
:lock: Advanced Lockfile Support
Fully reproducible developer environments.
Makes Lux easy to integrate with Nix.
:globe_with_meridians: Fully Ecosystem Compatible
Works with existing Luarocks packages.
Have a complex rockspec that you don't want to rewrite to TOML?
Lux allows the creation of an extra.rockspec file for just that purpose.
Have a very complex build script? Lux can utilise luarocks as a library if it detects it has
to preserve maximum compatibility.
:gear: How To Use
Feel free to consult the documentation on how to get started with Lux!
It features a tutorial and several guides to make you good at managing Lua projects.
[!NOTE]
Lux, while fully functional, is a work in progress
and does not have a 1.0 release yet.
:bar_chart: Comparison with Luarocks
As this project is still a work in progress, some Luarocks features
have not been fully implemented yet.
On the other hand, Lux has some features that are not present in Luarocks.
The following table provides a brief comparison:
| | Lux | Luarocks v3.13.0 |
| --- | --- | --- |
| Project format | TOML / Lua | Lua |
| Add/remove dependencies | :white_check_mark: | :x: |
| Parallel builds/installs | :white_check_mark: | :x: |
| Proper lockfile support with integrity checks | :white_check_mark: | :x: (basic, dependency versions only) |
| Run tests with busted | :white_check_mark: | :white_check_mark: |
| Linting with luacheck | :white_check_mark: | :x: |
| Code formatting with stylua, luafmt, or emmylua_codestyle | :white_check_mark: | :x: |
| Automatic lua detection/installation | :white_check_mark: | :x: |
| Default build specs | :white_check_mark: | :white_check_mark: |
| Custom build backends | :white_check_mark:[^1] | :white_check_mark: |
| rust-mlua build spec | :white_check_mark: (builtin) | :white_check_mark: (external build backend) |
| treesitter-parser build spec | :white_check_mark: (builtin) | :white_check_mark: (external build backend) |
| Install prebuilt binary rocks | :white_check_mark: | :white_check_mark: |
| Install multiple packages with a single command | :white_check_mark: | :x: |
| Install packages using version constraints | :white_check_mark: | :x: |
| Auto-detect external dependencies and Lua headers with pkg-config | :white_check_mark: | :x: |
| Resolve multiple versions of the same dependency at runtime | :white_check_mark: | :white_check_mark: |
| Pack and upload prebuilt binary rocks | :white_check_mark: | :white_check_mark: |
| Luarocks.org manifest namespaces | :white_check_mark: | :white_check_mark: |
| Luarocks.org dev packages | :white_check_mark: | :white_check_mark: |
| Versioning | SemVer[^2] | arbitrary |
| Rockspecs with CVS/Mercurial/SVN/SSCM sources | :x: (YAGNI[^3]) | :white_check_mark: |
| Load installed packages from multiple install trees | :x: (#1493) | :white_check_mark: |
| Static type checking | :white_check_mark: | :x: |
| Generate a .luarc file with dependencies | :white_check_mark: | :x: |
| Git dependencies in local projects | :white_check_mark: | :x: |
| Local dependencies in local projects | :white_check_mark: | :x: |
| Multiple projects in a single workspace | :white_check_mark: | :x: |
| Vendor sources for offline use | :white_check_mark: | :x: |
| Distribute install tree archives | :white_check_mark: | :x: |
| Distribute static binaries | :white_check_mark: | :x: |
| Load RockSpecs and Luarocks manifests with full sandboxing | :white_check_mark: | :x: |
| Sandbox build execution | :white_check_mark: [^4] | :x: |
[^1]: Supported via a compatibility layer that uses Luarocks as a backend.
[^2]: Aims to be compatible with the Luarocks version parser,
which allows an arbitrary number of version components.
We treat anything after the third version component
(except for the specrev) as a prerelease/build version,
but allow comparing versions with/without prerelease components.
[^3]: You Aren't Gonna Need It.
[^4]: Opt-in via a build.runner config.
:package: Packages
Lux includes the following packages and libraries:
lux-cli: The main CLI for interacting with projects and installing Lua packages
from the command line.
lux-lua: The Lux Lua API, which provides:
lux.loader for resolving dependencies on require at runtime.
A work-in-progress API for embedding Lux into Lua applications.
We provide builds of lux-lua for Lua 5.1, 5.2, 5.3, 5.4, 5.5 and LuaJIT.
lux-cli uses lux-lua for commands like lx lua, lx run and lx path.
lux-lib: The Lux library for Rust. A dependency of lux-cli and lux-lua.
rocks.nvim - A Neovim plugin manager that uses luarocks under the hood, and will soon be undergoing a rewrite to use Lux instead.
:purple_heart: Credits
Credits go to the Luarocks team for maintaining Luarocks and luarocks.org for as long as they have.
Without their prior work Lux would not be possible.
:green_heart: Contributing
Contributions are more than welcome!
See CONTRIBUTING.md for a guide.