mirror of
https://github.com/lune-org/lune.git
synced 2025-05-04 10:43:57 +01:00
Update tooling and fix analyze
This commit is contained in:
parent
18f58692e3
commit
e79ffc11a5
14 changed files with 35 additions and 14 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -21,7 +21,12 @@ lune.yml
|
|||
luneDocs.json
|
||||
luneTypes.d.luau
|
||||
|
||||
# Dirs generated by runtime or build scripts
|
||||
|
||||
/types
|
||||
|
||||
# Files generated by runtime or build scripts
|
||||
|
||||
scripts/brick_color.rs
|
||||
scripts/font_enum_map.rs
|
||||
scripts/physical_properties_enum_map.rs
|
||||
|
|
|
@ -65,6 +65,7 @@ fmt-check:
|
|||
analyze:
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
lune run scripts/analyze_copy_typedefs
|
||||
luau-lsp analyze \
|
||||
--settings=".vscode/settings.json" \
|
||||
--ignore="tests/roblox/rbx-test-files/**" \
|
||||
|
|
|
@ -32,6 +32,6 @@ print(`Listening on port {PORT} 🚀`)
|
|||
task.delay(10, function()
|
||||
print("Shutting down...")
|
||||
task.wait(1)
|
||||
handle:stop()
|
||||
handle.stop()
|
||||
task.wait(1)
|
||||
end)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
[tools]
|
||||
luau-lsp = "JohnnyMorganz/luau-lsp@1.33.1"
|
||||
stylua = "JohnnyMorganz/StyLua@0.20.0"
|
||||
just = "casey/just@1.36.0"
|
||||
luau-lsp = "JohnnyMorganz/luau-lsp@1.44.1"
|
||||
lune = "lune-org/lune@0.9.0"
|
||||
stylua = "JohnnyMorganz/StyLua@2.1.0"
|
||||
just = "casey/just@1.40.0"
|
||||
|
|
14
scripts/analyze_copy_typedefs.luau
Normal file
14
scripts/analyze_copy_typedefs.luau
Normal file
|
@ -0,0 +1,14 @@
|
|||
local fs = require("@lune/fs")
|
||||
|
||||
fs.writeDir("./types")
|
||||
|
||||
for _, dir in fs.readDir("./crates") do
|
||||
local std = string.match(dir, "^lune%-std%-(%w+)$")
|
||||
if std ~= nil then
|
||||
local from = `./crates/{dir}/types.d.luau`
|
||||
if fs.isFile(from) then
|
||||
local to = `./types/{std}.luau`
|
||||
fs.copy(from, to, true)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -28,7 +28,7 @@ local handle = net.serve(PORT, function()
|
|||
end)
|
||||
|
||||
task.delay(0.25, function()
|
||||
handle:stop()
|
||||
handle.stop()
|
||||
end)
|
||||
|
||||
test(net.serve, PORT, function() end)
|
||||
|
|
|
@ -19,7 +19,7 @@ local handle = net.serve(PORT, {
|
|||
local response = net.request(`{LOCALHOST}:{PORT}`).body
|
||||
assert(response ~= nil, "Invalid response from server")
|
||||
|
||||
handle:stop()
|
||||
handle.stop()
|
||||
|
||||
-- Attempting to serve with a malformed IP address should throw an error
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ end)
|
|||
-- Stopping is not guaranteed to happen instantly since it is async, but
|
||||
-- it should happen on the next yield, so we wait the minimum amount here
|
||||
|
||||
handle:stop()
|
||||
handle.stop()
|
||||
task.wait()
|
||||
|
||||
-- Sending a request to the stopped server should now error
|
||||
|
|
|
@ -21,4 +21,4 @@ end)
|
|||
|
||||
task.cancel(thread)
|
||||
|
||||
handle:stop()
|
||||
handle.stop()
|
||||
|
|
|
@ -42,4 +42,4 @@ end
|
|||
|
||||
task.cancel(thread)
|
||||
|
||||
handle:stop()
|
||||
handle.stop()
|
||||
|
|
|
@ -64,4 +64,4 @@ assert(
|
|||
)
|
||||
|
||||
-- Stop the server to end the test
|
||||
handle:stop()
|
||||
handle.stop()
|
||||
|
|
|
@ -10,7 +10,7 @@ local echoResult = process.exec("echo", {
|
|||
}, {
|
||||
env = { TEST_VAR = echoMessage },
|
||||
shell = if IS_WINDOWS then "powershell" else "bash",
|
||||
stdio = "inherit" :: process.SpawnOptionsStdioKind, -- FIXME: This should just work without a cast?
|
||||
stdio = "inherit",
|
||||
})
|
||||
|
||||
-- Windows uses \r\n (CRLF) and unix uses \n (LF)
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
local inner = require("@self/module")
|
||||
local inner = require("@self/module") :: any -- FIXME: luau-lsp does not yet support self alias
|
||||
local outer = require("./module")
|
||||
|
||||
assert(type(outer) == "table", "Outer module is not a table")
|
||||
assert(type(inner) == "table", "Inner module is not a table")
|
||||
|
||||
assert(outer.Foo == inner.Foo, "Outer and inner modules have different Foo values")
|
||||
assert(inner.Bar == outer.Bar, "Outer and inner modules have different Bar values")
|
||||
assert(inner.Hello == outer.Hello, "Outer and inner modules have different Hello values")
|
||||
|
||||
return inner
|
||||
|
|
|
@ -7,7 +7,7 @@ local objValue1 = Instance.new("ObjectValue")
|
|||
local objValue2 = Instance.new("ObjectValue")
|
||||
|
||||
objValue1.Name = "ObjectValue1"
|
||||
objValue2.Name = "ObjectValue2";
|
||||
objValue2.Name = "ObjectValue2"
|
||||
(objValue1 :: any).Value = root;
|
||||
(objValue2 :: any).Value = child
|
||||
objValue1.Parent = child
|
||||
|
|
Loading…
Add table
Reference in a new issue