luarocks stuff

This commit is contained in:
Michael Freno
2025-12-06 16:21:03 -05:00
parent da69d8bd4f
commit f532837cf3
6 changed files with 37 additions and 13 deletions

2
.gitignore vendored
View File

@@ -15,3 +15,5 @@ releases/
*.log*
memory_scan*
*_report*
*.key
*.src.rock

View File

@@ -1,4 +1,10 @@
local modulePath = (...):match("(.-)[^%.]+$") -- Get the module path prefix (e.g., "libs." or "")
local packageName = ... or "FlexLove"
local modulePath = packageName:match("(.-)[^%.]+$") -- Get the module path prefix (e.g., "libs." or "")
-- If modulePath is empty (e.g., require("FlexLove")), use the package name
if modulePath == "" then
modulePath = packageName .. "."
end
local function req(name)
return require(modulePath .. "modules." .. name)
end

View File

@@ -31,16 +31,30 @@ This library is under rapid, active development. While many features are functio
## Quick Start
Add the `modules` directory and `FlexLove.lua` into your project. I recommend going to the
RELEASES page, but you can clone the repo if you want the latest features, but bugs are more
likely.
[Recommended] Go to the [releases](https://github.com/mikefreno/FlexLove/releases) page and download the latest release,
there are a few different options for different build profiles, I recommend the "default" build. Then add the `modules` directory and `FlexLove.lua` into your project.
Or, if you can also try will luarocks:
```bash
luarocks install flexlove
```
Going this route, you will need to link the luarocks path to your project:
(for mac/linux)
```lua
package.path = package.path .. ";/Users/<your_username>/.luarocks/share/lua/5.1/?.lua"
package.path = package.path .. ";/Users/<your_username>/.luarocks/share/lua/5.1/?/init.lua"
package.cpath = package.cpath .. ";/Users/<your_username>/.luarocks/lib/lua/5.1/?.so"
```
```lua
local FlexLove = require("FlexLove")
-- (Optional) Initialize with a theme and immediate mode
FlexLove.init({
theme = "space"
theme = "space",
immediateMode = true
})

View File

@@ -172,10 +172,12 @@ Each profile package includes:
| Profile | Modules | Approximate Size |
|---------|---------|------------------|
| **Minimal** | 16 core modules | ~60% of full |
| **Slim** | 21 modules | ~80% of full |
| **Default** | 23 modules + themes | ~95% of full |
| **Full** | 24 modules + themes | 100% |
| **Minimal** | 19 core modules | ~70% of full |
| **Slim** | 24 modules | ~80% of full |
| **Default** | 27 modules + themes | ~95% of full |
| **Full** | 29 modules + themes | 100% |
**Note:** All profiles now include UTF8.lua for Lua 5.1+ compatibility.
Users who want examples, documentation source, or development tools should clone the full repository.

View File

@@ -241,7 +241,7 @@
-- (Optional) Initialize with a theme and immediate mode
FlexLove.init({
theme = "space"
theme = "space",
immediateMode = true
})

View File

@@ -31,8 +31,8 @@ description = {
}
dependencies = {
"lua >= 5.1",
"luautf8 >= 0.1.3"
"lua >= 5.1",
"luautf8 >= 0.1.3",
}
build = {
@@ -67,7 +67,7 @@ build = {
["FlexLove.modules.types"] = "modules/types.lua",
["FlexLove.modules.Units"] = "modules/Units.lua",
["FlexLove.modules.UTF8"] = "modules/UTF8.lua",
["FlexLove.modules.utils"] = "modules/utils.lua"
["FlexLove.modules.utils"] = "modules/utils.lua",
},
copy_directories = {
"docs",