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
|
luneDocs.json
|
||||||
luneTypes.d.luau
|
luneTypes.d.luau
|
||||||
|
|
||||||
|
# Dirs generated by runtime or build scripts
|
||||||
|
|
||||||
|
/types
|
||||||
|
|
||||||
# Files generated by runtime or build scripts
|
# Files generated by runtime or build scripts
|
||||||
|
|
||||||
scripts/brick_color.rs
|
scripts/brick_color.rs
|
||||||
scripts/font_enum_map.rs
|
scripts/font_enum_map.rs
|
||||||
scripts/physical_properties_enum_map.rs
|
scripts/physical_properties_enum_map.rs
|
||||||
|
|
|
@ -65,6 +65,7 @@ fmt-check:
|
||||||
analyze:
|
analyze:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
lune run scripts/analyze_copy_typedefs
|
||||||
luau-lsp analyze \
|
luau-lsp analyze \
|
||||||
--settings=".vscode/settings.json" \
|
--settings=".vscode/settings.json" \
|
||||||
--ignore="tests/roblox/rbx-test-files/**" \
|
--ignore="tests/roblox/rbx-test-files/**" \
|
||||||
|
|
|
@ -32,6 +32,6 @@ print(`Listening on port {PORT} 🚀`)
|
||||||
task.delay(10, function()
|
task.delay(10, function()
|
||||||
print("Shutting down...")
|
print("Shutting down...")
|
||||||
task.wait(1)
|
task.wait(1)
|
||||||
handle:stop()
|
handle.stop()
|
||||||
task.wait(1)
|
task.wait(1)
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
[tools]
|
[tools]
|
||||||
luau-lsp = "JohnnyMorganz/luau-lsp@1.33.1"
|
luau-lsp = "JohnnyMorganz/luau-lsp@1.44.1"
|
||||||
stylua = "JohnnyMorganz/StyLua@0.20.0"
|
lune = "lune-org/lune@0.9.0"
|
||||||
just = "casey/just@1.36.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)
|
end)
|
||||||
|
|
||||||
task.delay(0.25, function()
|
task.delay(0.25, function()
|
||||||
handle:stop()
|
handle.stop()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
test(net.serve, PORT, function() end)
|
test(net.serve, PORT, function() end)
|
||||||
|
|
|
@ -19,7 +19,7 @@ local handle = net.serve(PORT, {
|
||||||
local response = net.request(`{LOCALHOST}:{PORT}`).body
|
local response = net.request(`{LOCALHOST}:{PORT}`).body
|
||||||
assert(response ~= nil, "Invalid response from server")
|
assert(response ~= nil, "Invalid response from server")
|
||||||
|
|
||||||
handle:stop()
|
handle.stop()
|
||||||
|
|
||||||
-- Attempting to serve with a malformed IP address should throw an error
|
-- 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
|
-- 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
|
-- it should happen on the next yield, so we wait the minimum amount here
|
||||||
|
|
||||||
handle:stop()
|
handle.stop()
|
||||||
task.wait()
|
task.wait()
|
||||||
|
|
||||||
-- Sending a request to the stopped server should now error
|
-- Sending a request to the stopped server should now error
|
||||||
|
|
|
@ -21,4 +21,4 @@ end)
|
||||||
|
|
||||||
task.cancel(thread)
|
task.cancel(thread)
|
||||||
|
|
||||||
handle:stop()
|
handle.stop()
|
||||||
|
|
|
@ -42,4 +42,4 @@ end
|
||||||
|
|
||||||
task.cancel(thread)
|
task.cancel(thread)
|
||||||
|
|
||||||
handle:stop()
|
handle.stop()
|
||||||
|
|
|
@ -64,4 +64,4 @@ assert(
|
||||||
)
|
)
|
||||||
|
|
||||||
-- Stop the server to end the test
|
-- Stop the server to end the test
|
||||||
handle:stop()
|
handle.stop()
|
||||||
|
|
|
@ -10,7 +10,7 @@ local echoResult = process.exec("echo", {
|
||||||
}, {
|
}, {
|
||||||
env = { TEST_VAR = echoMessage },
|
env = { TEST_VAR = echoMessage },
|
||||||
shell = if IS_WINDOWS then "powershell" else "bash",
|
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)
|
-- 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")
|
local outer = require("./module")
|
||||||
|
|
||||||
assert(type(outer) == "table", "Outer module is not a table")
|
assert(type(outer) == "table", "Outer module is not a table")
|
||||||
assert(type(inner) == "table", "Inner 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(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
|
return inner
|
||||||
|
|
|
@ -7,7 +7,7 @@ local objValue1 = Instance.new("ObjectValue")
|
||||||
local objValue2 = Instance.new("ObjectValue")
|
local objValue2 = Instance.new("ObjectValue")
|
||||||
|
|
||||||
objValue1.Name = "ObjectValue1"
|
objValue1.Name = "ObjectValue1"
|
||||||
objValue2.Name = "ObjectValue2";
|
objValue2.Name = "ObjectValue2"
|
||||||
(objValue1 :: any).Value = root;
|
(objValue1 :: any).Value = root;
|
||||||
(objValue2 :: any).Value = child
|
(objValue2 :: any).Value = child
|
||||||
objValue1.Parent = child
|
objValue1.Parent = child
|
||||||
|
|
Loading…
Add table
Reference in a new issue