chore: Make jecs a dependency, bump jecs to v0.3.0

+ Make jecs a wally dependency instead of a file in lib. This wasn't done earlier due to wally packages not being able to be used outside of Roblox without dynamically requiring them. Now, a script is used to download the latest source of jecsfrom Github associated with the version in the manifest.

+ Bump jecs-utils to v0.1.3 and release
This commit is contained in:
Mark Marks 2024-09-24 15:35:21 +02:00
parent ae3042a1ab
commit cab13e4213
23 changed files with 117 additions and 1916 deletions

View file

@ -2,18 +2,20 @@
local fs = require("@lune/fs")
local task = require("@lune/task")
local function watch(path: string, on_change: (path: string, contents: string) -> ())
local function watch(path: string, on_change: (path: string, contents: string) -> (), run_initially: boolean?)
local initial_metadata = fs.metadata(path)
if not initial_metadata.exists then
return
end
local initial_contents = fs.readFile(path)
if run_initially then
local initial_contents = fs.readFile(path)
local initial_success, why = pcall(on_change :: any, path, initial_contents) -- :: any because otherwise it shits itself and the type doesn't give (boolean, string)??
if not initial_success then
warn(`There was an error while trying to start the watcher thread:\n{why}`)
return
local initial_success, why = pcall(on_change :: any, path, initial_contents) -- :: any because otherwise it shits itself and the type doesn't give (boolean, string)??
if not initial_success then
warn(`There was an error while trying to start the watcher thread:\n{why}`)
return
end
end
local last_modification = initial_metadata.modifiedAt