Creating Packages
You can create your own packages and publish them to the registry.
Package Structure
Section titled “Package Structure”A minimal package looks like this:
my-package/├── lune-pkg.json # Package metadata (optional)├── README.md├── lib/│ └── init.luau # Entry pointOr with a flat structure:
my-package/├── init.luau # Entry point└── README.mdEntry Points
Section titled “Entry Points”The installer looks for entry points in this order:
init.luau- Root init filemain.luau- Root main filelib/init.luau- Library patternsrc/init.luau- Source pattern
Versioning
Section titled “Versioning”Version is determined by git tags, not by any JSON file.
Use semantic versioning for your tags:
git tag v1.0.0git push --tagsThe installer will always fetch the highest semver-compatible version.
Valid tag formats:
v1.0.0(with v prefix)1.0.0(without v prefix)
Example Package
Section titled “Example Package”-- lib/init.luaulocal Colors = {}
Colors.RED = "\x1b[31m"Colors.GREEN = "\x1b[32m"Colors.RESET = "\x1b[0m"
function Colors.print(color: string, text: string) print(color .. text .. Colors.RESET)end
return ColorsPublishing
Section titled “Publishing”- Create a Git repository for your package
- Tag a release with semver (
git tag v1.0.0) - Push tags (
git push --tags) - Add entry to the registry (see Registry)