lune-org / lune

A standalone Luau runtime
https://lune-org.github.io/docs
Mozilla Public License 2.0
360 stars 84 forks source link

Lune Package Manager #187

Open SnorlaxAssist opened 5 months ago

SnorlaxAssist commented 5 months ago

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

CompeyDev commented 5 months ago

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.

SnorlaxAssist commented 5 months ago

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?

filiptibell commented 5 months ago

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:

I'd like to see how / if the plan for a new shared package manager moves forward before making any decisions here.

AsynchronousAI commented 5 months ago

I might try working on a luau package manager that supports lune and native luau 🤷

bjcscat commented 5 months ago

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.

mxruben commented 4 months ago

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).

CompeyDev commented 4 months ago

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)?

filiptibell commented 4 months ago

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.

amol234545 commented 1 month ago

Someone has made a fully working package manager for Lune: https://github.com/jonasarensmann/Farmer

CompeyDev commented 1 month ago

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.

amol234545 commented 1 month ago

I think the wally fork is our best option right now.