diff --git a/.gitignore b/.gitignore index 10f5886..ee14388 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ *.rbxlx *.rbxl.lock *.rbxlx.lock -globaltypes.d.lua +globaltypes.d.luau Packages DevPackages *sourcemap.json diff --git a/.luau-lsp.json b/.luau-lsp.json index a086e86..7cdcaf9 100644 --- a/.luau-lsp.json +++ b/.luau-lsp.json @@ -3,6 +3,10 @@ "luau-lsp.require.directoryAliases": { "@lune/": "~/.lune/.typedefs/0.8.8/" }, - "luau-lsp.ignoreGlobs": ["**/_Index/**", "globalTypes.d.lua", "*Packages/**"], + "luau-lsp.ignoreGlobs": [ + "**/_Index/**", + "globalTypes.d.luau", + "*Packages/**" + ], "luau-lsp.types.roblox": true } diff --git a/.vscode/settings.json.example b/.vscode/settings.json.example index 8eab2de..eab1771 100644 --- a/.vscode/settings.json.example +++ b/.vscode/settings.json.example @@ -6,7 +6,7 @@ "luau-lsp.sourcemap.rojoProjectFile": "test.project.json", "luau-lsp.ignoreGlobs": [ "**/_Index/**", - "**/*.d.lua", + "**/*.d.luau", "*Packages/**" ], "cSpell.words": ["aftman", "rbxl", "rojo"] diff --git a/README.md b/README.md index f0e92b7..55e812b 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ A simple state machine diagram for a light switch may look like this, where ![Screen Shot 2023-12-14 at 18 04 33](https://github.com/BusyCityGuy/finite-state-machine-luau/assets/55513323/3d5b2118-91ea-4427-ac2d-688fb0094d1f) -```lua +```luau local LightState = { On = "On", Off = "Off", diff --git a/lune/Context/DateTime.lua b/lune/Context/DateTime.luau similarity index 100% rename from lune/Context/DateTime.lua rename to lune/Context/DateTime.luau diff --git a/lune/Context/Debug.lua b/lune/Context/Debug.luau similarity index 86% rename from lune/Context/Debug.lua rename to lune/Context/Debug.luau index 4268a0a..4ad7b17 100644 --- a/lune/Context/Debug.lua +++ b/lune/Context/Debug.luau @@ -5,7 +5,7 @@ On Roblox, it's locked behind a feature flag FFlagDebugLoadModule, which is not enabled by default. In Lune, it doesn't exist at all, so this module creates the interface for it but is not implemented. The _loader function needs to be overridden to be usable. - In this project, the `lune/test.lua` script implements and sets the _loader function. + In this project, the `lune/test.luau` script implements and sets the _loader function. --]] local Debug diff --git a/lune/Utils/Path.lua b/lune/Utils/Path.luau similarity index 100% rename from lune/Utils/Path.lua rename to lune/Utils/Path.luau diff --git a/lune/Utils/ReducedInstance.lua b/lune/Utils/ReducedInstance.luau similarity index 100% rename from lune/Utils/ReducedInstance.lua rename to lune/Utils/ReducedInstance.luau diff --git a/lune/Utils/Runtime.lua b/lune/Utils/Runtime.luau similarity index 94% rename from lune/Utils/Runtime.lua rename to lune/Utils/Runtime.luau index 21b36f1..e149116 100644 --- a/lune/Utils/Runtime.lua +++ b/lune/Utils/Runtime.luau @@ -2,7 +2,7 @@ --[[ Provides a connection to a loop that runs every frame. This is used - in the custom Heartbeat implementation in lune/test.lua + in the custom Heartbeat implementation in lune/test.luau --]] local task = require("@lune/task") diff --git a/lune/Utils/runShellScript.lua b/lune/Utils/runShellScript.luau similarity index 100% rename from lune/Utils/runShellScript.lua rename to lune/Utils/runShellScript.luau diff --git a/lune/analyze.lua b/lune/analyze.luau similarity index 100% rename from lune/analyze.lua rename to lune/analyze.luau diff --git a/lune/ci.lua b/lune/ci.luau similarity index 100% rename from lune/ci.lua rename to lune/ci.luau diff --git a/lune/formatCheck.lua b/lune/formatCheck.luau similarity index 100% rename from lune/formatCheck.lua rename to lune/formatCheck.luau diff --git a/lune/formatFix.lua b/lune/formatFix.luau similarity index 100% rename from lune/formatFix.lua rename to lune/formatFix.luau diff --git a/lune/lint.lua b/lune/lint.luau similarity index 100% rename from lune/lint.lua rename to lune/lint.luau diff --git a/lune/test.lua b/lune/test.luau similarity index 97% rename from lune/test.lua rename to lune/test.luau index 36ca9c0..ab14cfa 100644 --- a/lune/test.lua +++ b/lune/test.luau @@ -22,10 +22,10 @@ local DateTime = require("Context/DateTime") local Debug = require("Context/Debug") local Runtime = require("Utils/Runtime") --- DEPENDENTS: [test.lua, Jest] +-- DEPENDENTS: [test.luau, Jest] local ReducedInstance = require("Utils/ReducedInstance") --- DEPENDENTS: [test.lua] +-- DEPENDENTS: [test.luau] local Path = require("Utils/Path") type RojoProject = { @@ -106,7 +106,7 @@ implementRobloxMethods() -- Declaring because it's needed by `loadScript`, but `loadScript` is also needed in `requireModule`. Defined later. local requireModule --- DEPENDENTS: [TestService/Source/run.server.lua] +-- DEPENDENTS: [TestService/Source/run.server.luau] -- ProcessService isn't implemented in Lune, so this creates a workable implementation of it by mapping it to process.exit local gameWithContext = setmetatable({ GetService = function(_self, serviceName: string) @@ -122,7 +122,7 @@ local gameWithContext = setmetatable({ end, }, { __index = game }) --- DEPENDENTS: [test.lua, Jest] +-- DEPENDENTS: [test.luau, Jest] local function loadScript(script: roblox.Instance): (((...any) -> ...any)?, string?) script = ReducedInstance.once(script) if not script:IsA("LuaSourceContainer") then diff --git a/scripts/analyze.sh b/scripts/analyze.sh index 859d6dc..3544da8 100755 --- a/scripts/analyze.sh +++ b/scripts/analyze.sh @@ -2,12 +2,12 @@ set -e -TYPES_FILE=globalTypes.d.lua +TYPES_FILE=globalTypes.d.luau SETTINGS_FILE=.luau-lsp.json if [ ! -f "$TYPES_FILE" ]; then echo "Fetching global types..." - curl https://raw.githubusercontent.com/JohnnyMorganz/luau-lsp/main/scripts/globalTypes.d.lua > $TYPES_FILE + curl https://raw.githubusercontent.com/JohnnyMorganz/luau-lsp/main/scripts/globalTypes.d.luau > $TYPES_FILE echo "Wrote global types to $TYPES_FILE" fi diff --git a/src/TestService/Source/Tests/StateMachine.spec.lua b/src/TestService/Source/Tests/StateMachine.spec.luau similarity index 100% rename from src/TestService/Source/Tests/StateMachine.spec.lua rename to src/TestService/Source/Tests/StateMachine.spec.luau diff --git a/src/TestService/Source/Tests/jest.config.lua b/src/TestService/Source/Tests/jest.config.luau similarity index 100% rename from src/TestService/Source/Tests/jest.config.lua rename to src/TestService/Source/Tests/jest.config.luau diff --git a/src/TestService/Source/run.server.lua b/src/TestService/Source/run.server.luau similarity index 100% rename from src/TestService/Source/run.server.lua rename to src/TestService/Source/run.server.luau