From 25fd34afb6e7f9a4809739003e9b2e3a204e2088 Mon Sep 17 00:00:00 2001 From: James <119134081+2jammers@users.noreply.github.com> Date: Thu, 12 Sep 2024 22:21:13 -0500 Subject: [PATCH] rc8 --- docs/changelog.md | 5 +++++ src/Storage.luau | 2 +- src/Types.luau | 12 ++++++------ src/init.luau | 10 +++++----- wally.toml | 2 +- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index f962a2f2..fd37fa51 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Adds a fix for an incorrect type reference +- Simplifies controller type + ## [9.0.0-rc7] - 2024-09-02 ### Added diff --git a/src/Storage.luau b/src/Storage.luau index fad9e908..5087a47a 100644 --- a/src/Storage.luau +++ b/src/Storage.luau @@ -1,5 +1,5 @@ local Types = require(script.Parent.Types) return { - Controllers = {} :: {Types.UserController}, + Controllers = {} :: {Types.Controller}, Workers = {} :: {Types.Worker}, } diff --git a/src/Types.luau b/src/Types.luau index 00878545..0a8eaba7 100644 --- a/src/Types.luau +++ b/src/Types.luau @@ -1,10 +1,10 @@ -export type Controller = { +export type Controller = { Start: (() -> ())?, Init: (() -> ())?, - Uses: {Controller}?, -} - -export type DevController = T & Controller + Uses: { + any + }?, +} & T export type WorkerType = "PostSimulation" @@ -20,7 +20,7 @@ export type Worker = { } export type Storage = { - Controllers: {DevController}, + Controllers: {Controller}, Workers: {Worker}, } diff --git a/src/init.luau b/src/init.luau index 672c9973..e23852d2 100644 --- a/src/init.luau +++ b/src/init.luau @@ -36,7 +36,7 @@ local function LoadController(callback: () -> (), type: "Start" | "Init") end -- Starts/inits a list of controllers internally -local function LoadAllControllers(controllers: { Types.DevController }) +local function LoadAllControllers(controllers: { Types.Controller }) for _, controller in controllers do if controller["Uses"] and type(controller.Uses) == "table" then for _, usedController in controller.Uses :: any do @@ -69,7 +69,7 @@ end [Learn More](https://luminlabsdev.github.io/framework/api/#load) ]=] -local function Load(containers: { Instance }, filter: ((ModuleScript) -> boolean)?): { Types.DevController } +local function Load(containers: { Instance }, filter: ((ModuleScript) -> boolean)?): { Types.Controller } local Controllers = {} for _, container in containers do for _, module in container:GetChildren() do @@ -87,7 +87,7 @@ end [Learn More](https://luminlabsdev.github.io/framework/api/#start) ]=] -local function Start(loaded: { Types.DevController }) +local function Start(loaded: { Types.Controller }) Debugger.Assert(Started, "AlreadyStarted") LoadAllControllers(loaded) @@ -108,7 +108,7 @@ end [Learn More](https://luminlabsdev.github.io/framework/api/#new) ]=] -local function New(members: Types.DevController): T +local function New(members: Types.Controller): T Debugger.Assert(Started, "AlreadyStarted") table.insert(Storage.Controllers, members) return members @@ -157,7 +157,7 @@ Debugger.SetMetadata({ return table.freeze({ -- Version - version = { major = 9, minor = 0, patch = 0, rc = 7 }, + version = { major = 9, minor = 0, patch = 0, rc = 8 }, -- Loaders Start = Start, diff --git a/wally.toml b/wally.toml index a84f48bb..57a973bf 100644 --- a/wally.toml +++ b/wally.toml @@ -1,7 +1,7 @@ [package] name = "lumin/framework" description = "A lightning fast & amazing game framework for Roblox" -version = "9.0.0-rc7" +version = "9.0.0-rc8" license = "MIT" registry = "https://github.com/UpliftGames/wally-index" realm = "shared"