mirror of
https://github.com/CompeyDev/lune-luau-template.git
synced 2024-12-12 04:40:41 +00:00
Add library structure to template
This commit is contained in:
parent
b89b424608
commit
1397b6c289
6 changed files with 20 additions and 6 deletions
6
.luaurc
6
.luaurc
|
@ -7,5 +7,9 @@
|
|||
"lintErrors": true,
|
||||
"globals": [
|
||||
"warn"
|
||||
]
|
||||
],
|
||||
"aliases": {
|
||||
"lib": "./lib",
|
||||
"src": "./src"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ require("luau-lsp").config({
|
|||
mode = "relativeToFile",
|
||||
directoryAliases = {
|
||||
["@lune"] = "~/.lune/.typedefs/0.8.6/",
|
||||
["@lib"] = "./lib",
|
||||
["@src"] = "./src",
|
||||
},
|
||||
},
|
||||
completion = {
|
||||
|
|
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
|
@ -1,6 +1,8 @@
|
|||
{
|
||||
"luau-lsp.require.mode": "relativeToFile",
|
||||
"luau-lsp.require.directoryAliases": {
|
||||
"@lune/": "~/.lune/.typedefs/0.8.6/"
|
||||
"@lune/": "~/.lune/.typedefs/0.8.6/",
|
||||
"@lib": "./lib",
|
||||
"@src": "./src"
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ This is a template for initializing [Luau](https://luau-lang.org) projects with
|
|||
## What is included in this template?
|
||||
|
||||
- A barebones structure for an executable hello world Lune script (src/)
|
||||
- A barebones structure for a library (lib/) -- TODO
|
||||
- A barebones structure for a library (lib/)
|
||||
- Configuration files for various tooling:
|
||||
- aftman for toolchain management (aftman.toml)
|
||||
- stylua for code formatting (stylua.toml, lune.yml)
|
||||
|
|
5
lib/init.luau
Normal file
5
lib/init.luau
Normal file
|
@ -0,0 +1,5 @@
|
|||
local function makeHello(name: string): string
|
||||
return "Hello, " .. name .. "!"
|
||||
end
|
||||
|
||||
return makeHello
|
|
@ -1,7 +1,8 @@
|
|||
local makeHello = require("@lib/")
|
||||
local process = require("@lune/process")
|
||||
|
||||
function main(_args: { string }): number?
|
||||
print("Hello, world!")
|
||||
function main(args: { string }): number?
|
||||
print(makeHello(args[1] or "world"))
|
||||
return 0
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue