I've made a simple tool to save myself some time during development.
It's a local directory git-based package manager written in python.
It's called Stanley.
You can find it here: https://github.com/Wolf2789/Stanley
Currently I've only tested it on Linux and WSL.
How to use it?
I've put everything important inside README so I suggest you check it first.
How it works?
Basically, you put Stanley inside root directory of your project and tell him what libraries to download from different git repositories.
It then creates an "autoload.lua" file under "lib" directory, which can be loaded inside "main.lua" file.
##wlf2789 wrote:Contents of "autoload.lua" file should remain untouched, as it's always being overwritten when "./stanley dump" command is issued.
One of the main features is that it tries to keep general order of individual packages.
Let's say you've recently added a package that depends on another package you've added earlier.
That's no problem, since Stanley automatically puts dependencies at the top of the list.
There's only one situation that I've not resolved yet:
If a package depends on another package, which in turns depends on the first one, then Stanley might break and fall into infinity loop, because first package depends on the second one, but the second one depends on the first one, but again first one depends on the second and that goes forever.
If that happens to you, then you're probably doing something wrong, because for me there's no logic in this.
Another nice feature is that you can easily create package from already existing source code, even if it's not prepared for work with Stanley.
You've found lua code that suits your needs, but it's not compatible with Stanley.
What can you do in this situation?
- You create new catalog under "lib" directory and call it somewhat like the source code you're trying to use.
- You create "package.yaml" file under this new directory and in the "require" section, you add repository of this source code you're trying to use.
- In "entry" section you define how to handle this code. Basically you can create your own "init_or_any_other_file_name.lua" or use built-in global variable registration.
- You add your custom path to "require" section inside your "project.yaml" file and issue "./stanley update".
- .....? Profit! Newly generated autoload file should contain everything you've specified.
Look under "lib" directory
I suggest you download everything and issue "./stanley update" and see what happens.
If anybody have any questions, feel free to contact with me.
I suggest you write me an e-mail ([email protected]) or catch me on Discord (wlf#4649)