lune
lune copied to clipboard
Lune Package Manager
A feature to install lune packages within lune cli, similar to npm or aftman. This feature should allow users install lune based packages from github repo or a dedicated Lune package host, if available. The goal is to make it easy to use modules available in a lune project via require("@module/...") which could reference anything that was installed from the lune package manager, globally, or relatively in a folder like lune-modules.
The overall workflow of a lune project could benefit a lot from this.
Benefits
- Enhances the usability of the Lune ecosystem.
- Simplifies maintaining a module in a project via
update/remove/install.
Alternatives
wallynpmaftmangit
This has been long discussed in the Roblox OSS Discord, but there hasn't been much consensus. Some say wally should support lune, some say we should use npm instead, and some say lune should have a native package manager.
Sadly, I am not in the OSS Discord.
One way to look at this is a temporary computer with just lune installed, installing npm, git, wally or aftman could be more less convenient. This feature request is more like having bun install.
Is there a way to look at for lune specific packages/modules, because right now it seems extremely hard to find one?
I think it's a good idea to have a public discussion about this that people can refer to here on GitHub. Conversations on other platforms tend to get lost or mixed in with other things that aren't relevant to the issue.
Here are some of my thoughts on a package manager:
- There have been some ideas floating around about a generic Luau package manager that would support different targets/runtimes - Luau (CLI), Luau in Roblox, and Luau in Lune. I think this would be the "optimal" outcome, all the different environments sharing the same package manager and standards.
- If the above doesn't happen I'm personally partial to integrating Wally into Lune and proxying the functionality that already exists there. So Lune would get
lune installand other commands, a Lune project manifest, and a Lune-specific wally registry. To a user this would (hopefully) be just as ergonomic as a custom package manager, but we would leverage work already done in Wally and try to share as much code as possible.
I'd like to see how / if the plan for a new shared package manager moves forward before making any decisions here.
I might try working on a luau package manager that supports lune and native luau 🤷
I think the overlap between Luau libraries targeting Roblox and Luau libraries targeting Lune is probably insufficient to justify sharing a package manager that in which most libraries would be useless/broken from a Lune perspective.
I don't know if Lune would benefit from trying to shoehorn itself into an existing Roblox ecosystem, but I'm interested in hearing other opinions.
Sorry, this is going to be a bit of a word vomit of stuff relating to this issue that's been on my mind. I'm currently working on a few libraries that target lune and would love to see a package manager. Some of my libraries depend on each other and it would be really nice to have a better solution than using git submodules. One of my libraries targets native luau, lune and roblox luau, so a shared pm would be really nice. I think one of the biggest problems with making cross-target libraries is that each target has it's own way of doing requires and it's own set of standard libraries, so it's pretty annoying to have to figure out how to retarget to 2 other platforms. Right now I use darklua for this but if we could have some kind of retargeting tool that would be amazing and would make runtime-agnostic libraries much easier to make and might encourage more developers to do so (I might actually try to implement this myself if I have time). Also, it would be really nice if the package manager had a useful and informative search (wally's search is abysmally bare-bones).
I totally feel you @mxruben, I had to practically cancel some projects altogether since they need a package manager to function.
@filiptibell What's stopping us from creating our own package manager (possibly a wally fork)?
What's stopping us from creating our own package manager (possibly a wally fork)?
I don't think there's anything stopping us, and there is a wally fork with lune support already, maybe others too. But any official package manager will need some extra thought put into it since we're going to be stuck with it for a long time. It seems like the Luau team has making a package manager on their radar, but if you need something right now, I'd personally vendor dependencies, or maybe use the above wally fork.
Someone has made a fully working package manager for Lune: https://github.com/jonasarensmann/Farmer
Someone has made a fully working package manager for Lune: jonasarensmann/Farmer
I would not recommend farmer. It's really primitive and hacky. It just sends over all your code and a manifest in a JSON request body and downloads that later on. Not typically how package registries are intended to be designed.
I think the wally fork is our best option right now.
I found another package manager that looks promising:Package Manager
Pesde is the package manager I would personally endorse. It was built from the ground up for multi-target support (Roblox, Lune, pure Luau) and many more useful features you would find in most package managers like scripts, patch systems, self-installation, self-hostable registry, workspaces, binary packages, git dependencies, etc. and is actively maintained. It also backwards compatible with Wally, so in case of Roblox packages, you can directly depend on existing Wally packages.
For more information, read the docs.