Skip to content

Commit

Permalink
temp commit
Browse files Browse the repository at this point in the history
  • Loading branch information
2jammers committed Oct 12, 2024
1 parent 46e61ee commit a3fd927
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dev.project.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"legacyScripts": true,
"emitLegacyScripts": true,
"name": "framework",
"tree": {
"$className": "DataModel",
Expand Down
4 changes: 2 additions & 2 deletions rokit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[tools]
wally = "UpliftGames/[email protected]"
argon = "argon-rbx/[email protected]"
wally-package-types = "johnnymorganz/[email protected]"
stylua = "johnnymorganz/[email protected]"
lune = "lune-org/[email protected]"
lune = "lune-org/[email protected]"
rojo = "rojo-rbx/[email protected]"
7 changes: 4 additions & 3 deletions src/Library/Data.luau
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
-- Variables

local Packages = script.Parent.Parent.Parent
local plugin: Plugin = script:FindFirstAncestorWhichIsA("Plugin")
local Debugger = require(Packages.debugger)
local Cache = {}

-- Functions
Expand All @@ -15,7 +17,7 @@ local function Get(key: string, useCache: boolean?): any
return plugin:GetSetting(key)
end
local Result = Cache[key]
assert(Result, "No such key found in cache")
Debugger.Assert(Result, "KeyNotFound", key)
return Result
end

Expand All @@ -24,8 +26,7 @@ end
[Learn More](https://luminlabsdev.github.io/plugin-framework/api/data#set)
]=]
local function Set(key: string, value: any, ignoreCacheIndex: boolean?)
assert(ignoreCacheIndex == false and Cache[key], "No such key found in cache")
local function Set(key: string, value: any)
Cache[key] = value
end

Expand Down
4 changes: 4 additions & 0 deletions src/Logs.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
return {
KeyNotFound = "The key '%s' could not be found in the cache",
UpdateNotResolved = "Update callbacks must resolve at least one value"
}
6 changes: 2 additions & 4 deletions src/init.luau
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ local Interface = require(Library.Interface)
return {
-- Framework
Start = Lumin.Start,
OnStart = Lumin.OnStart,
New = Lumin.New,
Worker = Lumin.Worker,
Load = Lumin.Load,
version = "0.3.0", -- Uses plugin framework version
Lifecycle = Lumin.Lifecycle,
version = "0.6", -- Uses plugin framework version

-- Unloading
Unloading = plugin.Unloading,
Expand Down
5 changes: 3 additions & 2 deletions wally.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "lumin/plugin-framework"
version = "0.5.0"
version = "0.6.0"
registry = "https://github.com/UpliftGames/wally-index"
realm = "shared"

[dependencies]
framework = "lumin/[email protected]"
framework = "lumin/[email protected]"
debugger = "lumin/[email protected]"

0 comments on commit a3fd927

Please sign in to comment.