UpliftGames / wally

Wally is a modern package manager for Roblox projects inspired by Cargo
https://wally.run
Mozilla Public License 2.0
317 stars 102 forks source link

Support string requires in linker codegen #170

Open grilme99 opened 1 year ago

grilme99 commented 1 year ago

I'm currently working on getting Roblox's Jest port working in Lua via Lune. One barrier to use currently is that Lune has no usable package manager because Wally does not support codegen with string requires. Resolving this would allow Lune scripts to have dependencies managed by Wally.

This feature would also benefit game projects that adopt string requires and use Darklua to transform them as a build step.

Open questions:

magnalite commented 1 year ago

Definitely something we should support! Unfortunately I think it may take some time for us to get there on the main branch. For now I think Lune specific changes like these should be on a lune fork, however I am happy to try merge changes which are small in scope.

For both questions I believe it can all be handled by what I am currently referring to as "enrichment" steps. Some explanation of my thought process around this can be found in https://github.com/UpliftGames/wally/issues/142#issuecomment-1591259112.

The gist of it is we would be able to define workflow steps as "enrichments" which transform certain parts of wally's functionality. In this case if a package supports the "lune" workflow then a lune specific enrichment could modify the linker files generated to use string requires. These enrichments will be carefully made to work correctly even when multiple workflows are supported, such as a conventional project using rojo for a game and additionally lune for added functionality. There could even be a darklua workflow/enrichment mixed in too. These workflows/enrichments can be thought of as plugins/extensions allowing wally to dynamically support multiple environments in a modular way.

Unfortunately all of this is however theoretical and will take a long time to get implemented. 😕 I'd like to get moving on this asap but I don't have time at the moment and I can't make any guarantees on when I will have time other than not soon.