repo stringclasses 350
values | file_path stringlengths 29 200 | language stringclasses 2
values | file_type stringclasses 4
values | code stringlengths 2 1.01M | tokens int64 2 598k |
|---|---|---|---|---|---|
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/assets/data/services/ReplicatedStorage.luau | luau | .luau | const c, t, p = require("@scripts/classes").unpack()
return c({
name = "ReplicatedStorage",
description = "Provides a container for shared assets across the client and server.",
since = "0.1.0",
})
| 50 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/assets/data/services/RunService.luau | luau | .luau | const c, t, p = require("@scripts/classes").unpack()
return c({
name = "RunService",
description = "Provides access to the runtime.",
since = "0.1.0",
signals = {
PreSimulation = {
description = "Fired before simulating WorldRoots. Listeners receive the delta time",
args = { t.Float },
},
PostSimulati... | 155 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/assets/data/services/UserInputService.luau | luau | .luau | const c, t, p = require("@scripts/classes").unpack()
return c({
name = "UserInputService",
description = "Provides user input events, including keyboard, mouse, touch, and gamepads",
since = "0.1.0",
properties = {
MouseBehavior = {
description = "Behavior mode of the mouse cursor",
type = t.EnumItem("Mou... | 2,542 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/assets/data/services/Workspace.luau | luau | .luau | const c, t, p = require("@scripts/classes").unpack()
return c({
name = "Workspace",
description = "Provides a physical 3D workspace",
since = "0.1.0",
properties = {
CurrentCamera = {
description = "The current camera.",
type = t.Instance("Camera"),
unmodified = "nullptr",
writeLevel = "Never",
},... | 88 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/examples/baseplate.luau | luau | .luau | local Workspace = game:GetService("Workspace")
local baseplate = Instance.new("Part")
baseplate.Anchored = true
baseplate.Color = Color3.fromHSV(0, 0, 0.5)
baseplate.Position = Vector3.new(0, -8, 0)
baseplate.Size = Vector3.new(1000, 16, 1000)
baseplate.Parent = Workspace
| 85 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/examples/black-hole.luau | luau | .luau | local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
type Disk = {
part: BasePart,
angle: number,
radius: number,
height: number,
speed: number,
}
local center = Vector3.new(0, 10, 0)
local blackHole = Instance.new("Part")
blackHole.Size = Vector3.new(8, 8, 8)
blackHol... | 557 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/examples/blocks.luau | luau | .luau | local Workspace = game:GetService("Workspace")
const INTERVAL_SECONDS = 0.1
local baseplate = Instance.new("Part")
baseplate.Anchored = true
baseplate.Color = Color3.fromHSV(0, 0, 0.5)
baseplate.Position = Vector3.new(0, -8, 0)
baseplate.Size = Vector3.new(1000, 16, 1000)
baseplate.Parent = Workspace
Workspace.Curre... | 243 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/examples/constraints.luau | luau | .luau | local uis = game:GetService("UserInputService")
local w = game:GetService("Workspace")
local connection: RBXScriptConnection
local function makeBaseplate()
local baseplate = Instance.new("Part")
baseplate.Anchored = true
baseplate.Color = Color3.fromHSV(0, 0, 0.5)
baseplate.Position = Vector3.new(0, -8, 0)
basep... | 1,177 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/examples/orbital-spinner.luau | luau | .luau | local Workspace = game:GetService("Workspace")
const SPINNER_CENTER = Vector3.new(0, 128, 0)
local baseplate = Instance.new("Part")
baseplate.Anchored = true
baseplate.Color = Color3.fromHSV(0, 0, 0.5)
baseplate.Position = Vector3.new(0, -8, 0)
baseplate.Size = Vector3.new(1000, 16, 1000)
baseplate.Parent = Workspace... | 278 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/examples/player-controller.luau | luau | .luau | local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Workspace = game:GetService("Workspace")
local baseplate = Instance.new("Part")
baseplate.Name = "Baseplate"
baseplate.Anchored = true
baseplate.Color = Color3.fromHSV(0, 0, 0.5)
baseplate.Position = Vec... | 663 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/examples/process-service.luau | luau | .luau | --!nocheck
local ProcessService = game:GetService("ProcessService")
print("Process start")
task.wait(3)
print("Exiting")
ProcessService:ExitAsync(1)
print("This will not run")
| 45 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/examples/seven-flowers.luau | luau | .luau | local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local FLOWERS = {
Color3.new(0, 1, 1),
Color3.new(0, 1, 0),
Color3.new(1, 0.9, 0),
Color3.new(1, 0, 1),
Color3.new(1, 0.4, 0),
Color3.new(0, 0, 1),
}
local TOTAL_FLOWERS = #FLOWERS
local RADIUS = 10
local AMPLITUDE =... | 419 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/examples/temperature-waveform.luau | luau | .luau | local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
const GRID_SIZE = 20
const BLOCK_SIZE = 2
const SCROLL_SPEED = 0.5
const Y_OFFSET = 3
local COLOR_STOPS = {
Color3.fromRGB(180, 0, 0),
Color3.fromRGB(255, 70, 0),
Color3.fromRGB(255, 180, 0),
Color3.fromRGB(255, 230, 1... | 597 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/examples/ui.luau | luau | .luau | const CoreGui = game:GetService("CoreGui")
local Workspace = game:GetService("Workspace")
CoreGui.Name = "CoreGui"
const half = Instance.new("Frame")
half.BackgroundColor3 = Color3.new(1, 0, 0)
half.Size = UDim2.fromScale(0.5, 1)
half.Name = "Frame"
half.BackgroundTransparency = 0.5
const centered = Instance.new("Fr... | 246 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/examples/wireframe-sphere.luau | luau | .luau | -- Creates a rotating wireframe sphere with latitude and longitude rings.
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local CENTER = Vector3.new(0, 20, 0)
local COLOR = Color3.fromRGB(255, 255, 0)
local DEGREES_PER_SECOND = 20
local RADIUS = 15
local SEGMENTS = 16
l... | 916 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/scripts/build.luau | luau | .luau | local args = require("@std/args")
local configuration = require("@scripts/configuration")
local countCpus = require("@scripts/utils/countCpus")
local fs = require("@std/fs")
local process = require("@std/process")
const parsed = args.parse("build", "compiles the engine"):simple(
args.named("--jobs", "number of jobs p... | 338 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/scripts/clean.luau | luau | .luau | local args = require("@std/args")
local configuration = require("@scripts/configuration")
local fs = require("@std/fs")
const _parsed = args.parse("clean", "cleans up the build directory for a reconfiguration"):simple()
do
if fs.is(configuration.buildDirectory) == "Directory" then
fs.removetree(configuration.build... | 135 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/scripts/configure.luau | luau | .luau | const args = require("@std/args")
const process = require("@std/process")
local configuration = require("@scripts/configuration")
const parsed = args.parse("configure", "prepares the build directory"):simple(
args.named("--type", "build type to use, either 'Debug' or 'Release'"):default("Debug"),
args.named("--gener... | 355 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/scripts/libs/classes.luau | luau | .luau | const types = require("./types")
-- NOTE: Permission defaults to None, set to Never to disable reads/writes
export type Permission = "None" | "Plugin" | "LocalUser" | "EngineScript" | "Engine" | "Debug" | "Never"
export type ClassProperty = {
read type: types.Type,
read description: string,
read unmodified: string... | 357 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/scripts/libs/configuration.luau | luau | .luau | -- FIXME: blocked on Seal supporting .config.luau
return {
buildDirectory = "build",
binaryBasename = "gargantuan",
classgenTargets = {
classes = {
input = "assets/data/classes",
headerImport = "gargantuan/classes",
headerOutput = "include/gargantuan/classes/generated",
implOutput = "src/classes/gene... | 139 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/scripts/libs/utils/StringBuilder.luau | luau | .luau | const StringBuilder = {}
StringBuilder.__index = StringBuilder
-- NOTE: Indents are increments of 2 for `public:` accessor syntax
export type StringBuilder = setmetatable<{
inner: string,
halfTabs: number,
}, typeof(StringBuilder)>
function StringBuilder.new(): StringBuilder
return setmetatable({ inner = "", halfT... | 474 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/scripts/libs/utils/append.luau | luau | .luau | const function append<T>(src: { T }, dest: { T })
table.move(src, 1, #src, #dest + 1, dest)
end
return append
| 38 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/scripts/libs/utils/countCpus.luau | luau | .luau | local process = require("@std/process")
local vars = require("@std/env/vars")
const function countCpus(): number
-- Windows
const envNumProcessors = vars.get("NUMBER_OF_PROCESSORS")
if envNumProcessors then
const numProcessors = tonumber(envNumProcessors)
if numProcessors and numProcessors > 0 then
return nu... | 241 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/scripts/libs/utils/orderedPairs.luau | luau | .luau | const function orderedPairs<K, V>(tbl: { [K]: V }): () -> (K, V)
const keys: { K } = {}
local numKeys = 0
for key in tbl do
table.insert(keys, key)
numKeys += 1
end
table.sort(keys)
local currentIndex = 0
return function()
currentIndex += 1
if currentIndex > numKeys then
return nil, nil
end
cons... | 120 |
teamfireworks/gargantuan | teamfireworks-gargantuan-191e144/studio/src/Main.client.luau | luau | .luau | local Fluid = require("@roblox_packages/Fluid")
Fluid.create("Frame")({
BackgroundColor3 = Color3.new(1, 0, 0),
Size = UDim2.fromScale(0.5, 0.5),
})
| 51 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/.lute/build-rbxm.luau | luau | .luau | local process = require("@lute/process")
-- stylua: ignore
process.run(
"rojo",
{ "build", "--output", "fluid.rbxm" },
{ stdio = "forward" }
)
| 48 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/.lute/build-test-place.luau | luau | .luau | local process = require("@lute/process")
process.run("rojo", { "build", "roblox-tests.project.json", "--output", "test-file.rbxl" }, { stdio = "forward" })
| 45 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/.lute/dev.luau | luau | .luau | local process = require("@lute/process")
local task = require("@lute/task")
task.spawn(function()
process.run("rojo", {
"sourcemap",
"roblox-tests.project.json",
"--output",
"sourcemap.json",
"--watch",
"--include-non-scripts",
}, {
stdio = "forward",
})
end)
task.spawn(function()
-- stylua: ignore
... | 132 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/.lute/fuzz-test.luau | luau | .luau | require("@tests/").fuzz()
| 8 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/.lute/run-tests.luau | luau | .luau | local task = require("@lute/task")
local tests = require("@tests/").unit_tests
task.spawn(tests)
| 25 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/.lute/styling.luau | luau | .luau | local process = require("@lute/process")
local cmd = { "stylua", ".lute", "src", "tests" }
-- kinda cursed but, easiest way to do this.
table.insert(cmd, "--check")
local result = process.run(cmd, {
stdio = "inherit",
})
process.exit(result.exitcode)
| 67 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/anim/lerp.luau | luau | .luau | local graph = require("../reactive/graph")
local oklab = require("../utils/oklab")
local read = require("../utils/read")
local types = require("../reactive/types")
local active_animations = {}
local function vector_lerp(a: vector, b: vector, t: number): vector
return a + (b - a) * t
end
local function general_lerp(... | 637 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/anim/spring/coefficients.luau | luau | .luau | local function under_dampened(t: number, speed: number, damping: number): (number, number, number, number)
local alpha = speed * math.sqrt(1 - damping ^ 2)
local over_alpha = 1 / alpha
local exp = math.exp(-1 * t * speed * damping)
local exp_sin = exp * math.sin(alpha * t)
local exp_cos = exp * math.cos(alpha * t)... | 547 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/anim/spring/spring_file.luau | luau | .luau | local coefficients = require("./coefficients")
local graph = require("../../reactive/graph")
local oklab = require("../../utils/oklab")
local read = require("../../utils/read")
local types = require("../../reactive/types")
local SLEEP_VELOCITY = 1e-3
local SLEEP_DISTANCE = 1e-5
type AnimatableDataTypeEnum = "color" |... | 1,596 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/init.luau | luau | .luau | local action = require("@self/instances/action")
local async = require("@self/reactive/async")
local bind = require("@self/instances/bind")
local changed = require("@self/instances/changed")
local cleanup = require("@self/reactive/cleanup")
local create = require("@self/instances/create")
local deferred = require("@sel... | 679 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/instances/action.luau | luau | .luau | local action_metatable_symbol = table.freeze({})
export type Identity = {
callback: (inst: Instance) -> (),
__ACTION_SYMBOL: {},
}
local action = {
symbol = action_metatable_symbol,
}
function action.is_action(action): boolean
return type(action) == "table" and action.__ACTION_SYMBOL ~= nil
end
function action... | 111 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/instances/bind.luau | luau | .luau | local action = require("./action")
local graph = require("../reactive/graph")
local types = require("../reactive/types")
local function set_property(inst: Instance, property: string, value: any)
(inst :: any)[property] = value
end
local function get_property(inst: Instance, property: string): any
return (inst :: an... | 851 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/instances/changed.luau | luau | .luau | local action = require("./action")
local graph = require("../reactive/graph")
local function changed(property: string, fn: (any) -> ())
return action.create(function(instance: Instance)
fn((instance :: any)[property])
local con = instance:GetPropertyChangedSignal(property):Connect(function()
fn((instance :: a... | 97 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/instances/create.luau | luau | .luau | local action = require("./action")
local bind = require("./bind")
type Instances = {
PyramidHandleAdornment: PyramidHandleAdornment,
AudioChannelSplitter: AudioChannelSplitter,
AudioPitchShifter: AudioPitchShifter,
AudioDeviceOutput: AudioDeviceOutput,
AudioChannelMixer: AudioChannelMixer,
AudioTextToSpeech: Aud... | 1,509 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/instances/for_keys.luau | luau | .luau | local graph = require("../reactive/graph")
local read = require("../utils/read")
local scheduler = require("../scheduler")
local types = require("../reactive/types")
local function indexes<K, VI, VO>(
input: types.UsedAs<{ read [K]: VI }>,
transform: (() -> VI, K, active: types.Readable<boolean>) -> (VO, number?)
):... | 1,000 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/instances/for_values.luau | luau | .luau | local graph = require("../reactive/graph")
local read = require("../utils/read")
local scheduler = require("../scheduler")
local types = require("../reactive/types")
local function values<V, KI, KO>(
input: types.UsedAs<{ read [KI]: V }>,
transform: (
value: V,
key: () -> KI,
active: types.Readable<boolean>
)... | 1,078 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/instances/mount.luau | luau | .luau | local bind = require("./bind")
local root = require("../reactive/root")
local function mount(fn: () -> { [any]: any }, inst: Instance): () -> ()
return root(function()
bind(inst, {
fn(),
})
end)
end
return mount
| 59 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/logging.luau | luau | .luau | --!optimize 1
local dev_mode = true
local function format(text: string): string
return (string.format("[fluid]: %*", text))
end
local function warn_facade(text: string)
(warn or print)(text)
end
local logging = {
__warn_facade = warn_facade,
errors = {},
}
function logging.fmt(text: string): string
return for... | 656 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/reactive/async.luau | luau | .luau | local graph = require("./graph")
local logging = require("../logging")
local scheduler = require("../scheduler")
local task = task or require("@lute/task")
type State = "busy" | "ok"
--[[
async nodes creates a source node for the latest valid value and for the state.
it also creates a reactive node which spawns a new... | 417 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/reactive/cleanup.luau | luau | .luau | local graph = require("./graph")
local get_scope = graph.get_scope
local push_cleanup = graph.push_cleanup
local function helper(obj: any)
return if typeof(obj) == "RBXScriptConnection"
then function()
obj:Disconnect()
end
elseif type(obj) == "thread" then function()
task.cancel(obj)
end
elseif typeof... | 337 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/reactive/deferred.luau | luau | .luau | local graph = require("./graph")
local types = require("./types")
local function deferred<T>(callback: types.Effect<T>, initial_value: T)
local node = graph.create_reactive_node(graph.assert_stable_parent(), callback, "deferred", initial_value)
graph.evaluate_node(node)
end
-- cover effect(function() end) and effe... | 110 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/reactive/derive.luau | luau | .luau | local graph = require("./graph")
local types = require("./types")
local function derive<T>(source: types.Effect<T>): types.Readable<T>
local node = graph.create_reactive_node(graph.assert_stable_parent(), source, "lazy")
local function evaluate()
return graph.evaluate_node(node)
end
return evaluate
end
return... | 71 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/reactive/effect.luau | luau | .luau | local graph = require("./graph")
local types = require("./types")
local function effect<T>(callback: types.Effect<T>, initial_value: T)
local node = graph.create_reactive_node(graph.assert_stable_parent(), callback, "eager", initial_value)
graph.evaluate_node(node)
end
-- cover effect(function() end) and effect(fu... | 110 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/reactive/graph.luau | luau | .luau | local exception = require("../utils/exception")
local logging = require("../logging")
local reactive_fn_calls = require("../utils/reactive_fn_calls")
local scheduler = require("../scheduler")
local types = require("./types")
local dev_mode = true
local deferred_thread: thread? = nil
local pending_eval: { ReactiveNode<... | 3,062 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/reactive/root.luau | luau | .luau | local graph = require("./graph")
local types = require("./types")
local refs: { [graph.Node<any>]: true? } = {}
local function root<T...>(fn: (destroy: types.Cleanup) -> T...): (types.Cleanup, T...)
local node = graph.create_stable_node(graph.get_scope())
-- prevent gc of root node
refs[node] = true
local funct... | 188 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/reactive/source.luau | luau | .luau | local graph = require("./graph")
local types = require("./types")
local function get_argument_from<T>(...: T): (boolean, T)
if select("#", ...) == 0 then
return false, nil
end
local first_value = ...
return true, first_value
end
local function source<T>(initial_value: T): types.Source<T>
local node = graph.cr... | 209 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/reactive/types.luau | luau | .luau | export type Readable<T> = () -> T
export type Callable<T> = (value: T) -> ()
export type Effect<T> = (value: T) -> T
export type Source<T> = ((T) -> T) & Readable<T>
export type UsedAs<T> = T | Readable<T>
export type Cleanup = () -> ()
return nil
| 78 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/reactive/untrack.luau | luau | .luau | local graph = require("./graph")
local function untrack<T>(source: () -> T): T
local scope = graph.get_scope()
if (not scope) or (scope and not scope.effect) then
return source()
end
-- temporarily unbind effect
local effect = scope.effect
scope.effect = false :: any
local value = source()
scope.effect = ... | 88 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/scheduler.luau | luau | .luau | local task = (task or require("@lute/task")) :: typeof(task)
type RenderCallback = (delta_time: number) -> ()
local cancel = task.cancel or coroutine.close
local connections: { RenderCallback } = {}
local scheduler = {
connections = connections,
}
function scheduler.step(delta_time: number)
for _, callback in co... | 227 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/utils/exception.luau | luau | .luau | export type YieldException = {
kind: "yielded",
trace: string,
}
export type FluidException = {
kind: "fluid",
trace: string,
}
export type InvokedException = {
kind: "invoked",
err: string,
trace: string,
}
export type UncaughtException = {
kind: "uncaught",
err: string,
trace: string,
}
export type ... | 153 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/utils/interval.luau | luau | .luau | local exception = require("./exception")
local graph = require("../reactive/graph")
local logging = require("../logging")
local reactive_fn_calls = require("./reactive_fn_calls")
local scheduler = require("../scheduler")
local function interval_err_handler(err: unknown): exception.Identity
if exception.is(err) then
... | 727 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/utils/oklab.luau | luau | .luau | local X_CONST = vector.create(0.4122214708, 0.5363325363, 0.0514459929)
local Y_CONST = vector.create(0.2119034982, 0.6806995451, 0.1073969566)
local Z_CONST = vector.create(0.0883024619, 0.2817188376, 0.6299787005)
local oklab = {}
function oklab.from_srgb(color: vector): vector
local l = vector.dot(color, X_CONST)... | 506 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/utils/reactive_fn_calls.luau | luau | .luau | local exception = require("./exception")
local scheduler = require("../scheduler")
local reactive_fn_calls = {}
function reactive_fn_calls.no_yield_call<U..., T...>(
func: (T...) -> U...,
err_handler: (unknown) -> exception.Identity,
yield_handler: (thread) -> exception.Identity,
...: T...
): (boolean, U...)
loc... | 212 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/utils/read.luau | luau | .luau | export type function CastIntoValue(value: type)
local function get_return_for_fn(t: type)
local values = t:returns()
local head = values.head
local tail = values.tail
if head then
local first = head[1]
return first
elseif tail then
return tail
else
return types.singleton(nil)
end
end
if v... | 284 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/utils/show.luau | luau | .luau | local derive = require("../reactive/derive")
local read = require("./read")
local types = require("../reactive/types")
local untrack = require("../reactive/untrack")
local function show<T, U>(condition: () -> any, truthy: types.UsedAs<T>, falsy: types.UsedAs<U>?): () -> T | U
return derive(function()
if condition()... | 209 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/utils/show_delay.luau | luau | .luau | local reat = require("./read")
local switch_delay = require("./switch_delay")
local types = require("../reactive/types")
local function show<T, U>(
condition: () -> any,
truthy: (active: types.Readable<boolean>) -> (T, number?),
falsy: ((active: types.Readable<boolean>) -> (U, number?))?
): () -> { T | U }
return ... | 196 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/utils/switch.luau | luau | .luau | local derive = require("../reactive/derive")
local read = require("./read")
local types = require("../reactive/types")
local untrack = require("../reactive/untrack")
local function switch<T, U>(condition: () -> T)
return function(options: { [T]: types.UsedAs<U> }): () -> read.CastIntoValue<U>?
return derive(functio... | 129 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/utils/switch_delay.luau | luau | .luau | local derive = require("../reactive/derive")
local graph = require("../reactive/graph")
local scheduler = require("../scheduler")
local types = require("../reactive/types")
type Condition<T> = (types.Readable<boolean>) -> (T, number?)
type SwitchGraph<Result> = {
previous_effect: Condition<Result>?,
scopes: { [Cond... | 871 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/src/utils/tags.luau | luau | .luau | local action = require("../instances/action")
local cleanup = require("../reactive/cleanup")
local graph = require("../reactive/graph")
local function bind_tag(instance: Instance, tag: string)
instance:AddTag(tag)
cleanup(function()
instance:RemoveTag(tag)
end)
end
local function tags(tags: { string | () -> str... | 169 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/tests/fuzz_tests/colors.fuzz.luau | luau | .luau | local oklab = require("@src/utils/oklab")
local function within(epsilon: number)
return function(value1: vector, value2: vector): boolean
return vector.magnitude(value1 - value2) <= epsilon
end
end
local colors_within = within(0.01)
local function oklab_fuzz()
for r = 1, 256 do
for g = 1, 256 do
for b = 1,... | 151 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/tests/hooks/init.luau | luau | .luau | --[[
hooks to improve developer experience
]]
return {
scheduler = require("@self/scheduler"),
logging = require("@self/logging"),
}
| 29 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/tests/hooks/logging.luau | luau | .luau | --[[
hook onto when fluid warns
used if you wanna catch a logging.warn/logging.warn_supressed this will allow you to hook onto that
]]
local logging = require("@src/logging")
type OnWarn = (text: string) -> ()
-- user callback for when fluid warns to the stdio
-- if nothing is specified, fluid will output to the st... | 269 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/tests/hooks/scheduler.luau | luau | .luau | --[[
hooks wait/delay in fluid
this allows you to timeskip forward in tests
]]
local fluid = require("@src")
local logging = require("@src/logging")
local task = require("@lute/task")
local scheduler_interface = fluid.__SCHEDULER_INTERFACE
local step_fluid = fluid.provide_scheduler()
local step_tick = 0
local wait... | 501 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/tests/init.luau | luau | .luau | local _, _, _, FINISH = require("@vendor/testkit").test()
local function call_tests(fn: () -> ())
xpcall(fn, function(err)
print(debug.traceback(tostring(err)))
end)
end
local tests = {}
function tests.fuzz()
require("@self/fuzz_tests/colors.fuzz")()
end
function tests.unit_tests()
require("@self/unit_tests/l... | 166 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/tests/roblox_tests/client/creating_instances.client.luau | luau | .luau | local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TextService = game:GetService("TextService")
local fluid = require(ReplicatedStorage.fluid)
local random_words = fluid.source({ "hi", "bye", "meow", "mrrp" })
local function label()
return fluid.create("T... | 910 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/tests/roblox_tests/client/inbetween_state.client.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local fluid = require(ReplicatedStorage.fluid)
local create = fluid.create
local scale = UDim2.fromScale
local px = UDim2.fromOffset
fluid.mount(function()
local color = fluid.source(Color3.new())
local size = fluid.source(px(60, 60))
fluid.effect(fu... | 270 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/tests/roblox_tests/client/show.client.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local fluid = require(ReplicatedStorage.fluid)
local mount = fluid.mount
local source = fluid.source
local show = fluid.show
local show_delay = fluid.show_delay
local create = fluid.create
local scale = UDim2.fromScale
local px = UDim2.fromOffset
mount(f... | 589 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/tests/roblox_tests/client/show_delay.client.luau | luau | .luau | local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TextService = game:GetService("TextService")
local fluid = require(ReplicatedStorage.fluid)
local function main()
local active = fluid.source(false)
return fluid.create("ScreenGui" :: "ScreenGui")({
fl... | 251 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/tests/roblox_tests/client/springs.client.luau | luau | .luau | local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local fluid = require(ReplicatedStorage.fluid)
local create = fluid.create
local mount = fluid.mount
local parent_screen = create("ScreenGui")({
Name = "ParentScreen",
ResetOnSpawn = false,
Parent = Players.Lo... | 272 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/tests/roblox_tests/client/testing_delay.client.luau | luau | .luau | local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local fluid = require(ReplicatedStorage.fluid)
local create = fluid.create
local keys = fluid.for_keys
local mount = fluid.mount
local source = fluid.source
local parent_screen = create("ScreenGui")({
Name = "Pa... | 253 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/types/globals.d.luau | luau | .luau | declare _G: {
__DEV__: boolean?
} | 12 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/vendor/signal.luau | luau | .luau | --!optimize 2
--!native
local task = task or require("@lute/task")
local tspawn = task.spawn
local cyield = coroutine.yield
local freeThread: thread? = nil
local function deletedSignalError()
error("Cannot fire a deleted signal", 2)
end
local errorTable = {
fire = deletedSignalError,
connect = deletedSignalError... | 1,341 |
ffrostfall/fluid | ffrostfall-fluid-a93f33a/vendor/testkit.luau | luau | .luau | --!nocheck
--!nolint
-------------------------------------------------------------------------------
-- testkit.luau
-- v0.7.3
--------------------------------------------------------------------------------
local color = {
white_underline = function(s: string)
return `\27[1;4m{s}\27[0m`
end,
white = function(s... | 2,796 |
tacheometry/Rostar | tacheometry-Rostar-7b5d979/.lune/UnpackFiles.luau | luau | .luau | local remodel = require("./remodel")
local fs = require("@lune/fs")
local serde = require("@lune/serde")
local informationFile = serde.decode("json", fs.readFile("RostarData.json"))
local initialRojoProject
do
local success, exists = pcall(remodel.isFile, informationFile.rojoProjectPath)
if success and exists then
... | 2,970 |
latte-soft/maui | latte-soft-maui-99e1d35/src/Tarmac/Assets.lua | luau | .lua | -- This file was @generated by Tarmac. It is not intended for manual editing.
return {
["MauiLogo-DarkMode"] = "rbxassetid://12558365376",
["MauiLogo-LightMode"] = "rbxassetid://12558365512",
} | 63 |
latte-soft/maui | latte-soft-maui-99e1d35/tests/CustomFlags/init.server.lua | luau | .lua | print("Should be running on the server, but we removed context checks via the flag!") | 18 |
latte-soft/maui | latte-soft-maui-99e1d35/tests/CustomPath/UsingFunction/.maui.lua | luau | .lua | return {
FormatVersion = 1,
Output = {
Directory = function()
return script.Parent
end,
ScriptName = "MauiGeneratedOutput"
}
} | 39 |
latte-soft/maui | latte-soft-maui-99e1d35/tests/CustomPath/UsingInstance/.maui.lua | luau | .lua | return {
FormatVersion = 1,
Output = {
Directory = script.Parent,
ScriptName = "MauiGeneratedOutput"
}
} | 32 |
latte-soft/maui | latte-soft-maui-99e1d35/tests/MainModuleBehavior/MainModule/init.lua | luau | .lua | return "Hello, from a Maui module!" | 9 |
latte-soft/maui | latte-soft-maui-99e1d35/tests/MainModuleBehavior/init.server.lua | luau | .lua | print(require(script.MainModulePacked)) | 8 |
CodeBotsStudio/Dysymmetrical | CodeBotsStudio-Dysymmetrical-efeac6e/src/ReplicatedFirst/Loading.client.luau | luau | .luau | local LoadingGui = script:WaitForChild("LoadingGui")
local Main = LoadingGui:WaitForChild("LoadingScreen"):WaitForChild("Main")
local Percent = Main:WaitForChild("Percent")
local AmountTxt = Main:WaitForChild("Amount")
local CurrentlyInitting = Main:WaitForChild("CurrentlyInitting")
local Skip = Main:WaitForChild("Skip... | 1,103 |
CodeBotsStudio/Dysymmetrical | CodeBotsStudio-Dysymmetrical-efeac6e/src/ReplicatedStorage/Assets/Achievements.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Types = require(ReplicatedStorage.Classes.Types)
type AchievementGroup = {
Title: string,
LayoutOrder: number,
Achievements: {[string]: Types.Achievement}
}
return {
General = {
Title = "General",
LayoutOrder = 1,
... | 141 |
CodeBotsStudio/Dysymmetrical | CodeBotsStudio-Dysymmetrical-efeac6e/src/ReplicatedStorage/Assets/Emotes/TPose.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Emote = require(ReplicatedStorage.Classes.Emote)
return Emote.New({
Config = {
Name = "T-Pose",
Quote = "be not afraid.",
},
AnimationIds = "rbxassetid://87300475457340",
SoundIds = "rbxassetid://1839549655",
Speed... | 95 |
CodeBotsStudio/Dysymmetrical | CodeBotsStudio-Dysymmetrical-efeac6e/src/ReplicatedStorage/Assets/KillerIntros/KillerNameToast.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local Utils = require(ReplicatedStorage.Modules.Utils)
local G = script:FindFirstChild("KillerNameToast")
local PlayerLabelPrefab = script:FindFirstChild("PlayerName")
return function(Parent: ScreenGui... | 594 |
CodeBotsStudio/Dysymmetrical | CodeBotsStudio-Dysymmetrical-efeac6e/src/ReplicatedStorage/Assets/KillerIntros/NullexVoyd.luau | luau | .luau | return {
Behaviour = function(_, Intro)
local TweenService = game:GetService("TweenService")
local Group = script:FindFirstChildWhichIsA("Frame"):Clone()
Group.Parent = game:GetService("Players").LocalPlayer.PlayerGui:FindFirstChild("KillerIntros")
table.insert(Intro.Disposables, Group)
... | 346 |
CodeBotsStudio/Dysymmetrical | CodeBotsStudio-Dysymmetrical-efeac6e/src/ReplicatedStorage/Assets/PickableItems/Cola.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Cola = require(ReplicatedStorage.Assets.Items.Cola)
local PickableItem = require(ReplicatedStorage.Classes.Item.PickableItem)
local Utils = require(ReplicatedStorage.Modules.Utils)
return Utils.Type.CopyTable(PickableItem.New({
ItemEquivalent = ... | 95 |
CodeBotsStudio/Dysymmetrical | CodeBotsStudio-Dysymmetrical-efeac6e/src/ReplicatedStorage/Assets/PickableItems/Medkit.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Medkit = require(ReplicatedStorage.Assets.Items.Medkit)
local PickableItem = require(ReplicatedStorage.Classes.Item.PickableItem)
local Utils = require(ReplicatedStorage.Modules.Utils)
return Utils.Type.CopyTable(PickableItem.New({
ItemEquivalen... | 94 |
CodeBotsStudio/Dysymmetrical | CodeBotsStudio-Dysymmetrical-efeac6e/src/ReplicatedStorage/Characters/Skins/Survivors/Commander/CommanderYourself.luau | luau | .luau | local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Character = require(ReplicatedStorage.Classes.Character)
local Types = require(ReplicatedStorage.Classes.Types)
local function OnCommanderInit(self: Types.Su... | 174 |
CodeBotsStudio/Dysymmetrical | CodeBotsStudio-Dysymmetrical-efeac6e/src/ReplicatedStorage/Classes/Ability/AbilityGUI.luau | luau | .luau | --it was definitely not 3 am when writing this months ago (excusing the funny comments)
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Types = require(ReplicatedStorage.Classes.Types)
local Janitor = require(ReplicatedStorage.Packages.Janitor)
type Abil... | 1,667 |
CodeBotsStudio/Dysymmetrical | CodeBotsStudio-Dysymmetrical-efeac6e/src/ReplicatedStorage/Classes/Ability/Slash.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Hitbox = require(ReplicatedStorage.Classes.Hitbox)
local Sounds = require(ReplicatedStorage.Modules.Sounds)
local Ability = require(ReplicatedStorage.Classes.Ability)
local Types = require(ReplicatedSt... | 551 |
CodeBotsStudio/Dysymmetrical | CodeBotsStudio-Dysymmetrical-efeac6e/src/ReplicatedStorage/Classes/Effect.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Types = require(script.Parent.Types)
local Utils = require(ReplicatedStorage.Modules.Utils)
local EffectType = {}
EffectType.__index = EffectType
--- Effect preset for customization.
function EffectType.GetDefaultSettings(): Types.Effect
return ... | 424 |
CodeBotsStudio/Dysymmetrical | CodeBotsStudio-Dysymmetrical-efeac6e/src/ReplicatedStorage/Classes/Hitbox.luau | luau | .luau | local Debris = game:GetService("Debris")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local ServerScriptService = game:GetService("ServerScriptService")
local TimeManager = RunService:IsServer() and require(Se... | 5,243 |
CodeBotsStudio/Dysymmetrical | CodeBotsStudio-Dysymmetrical-efeac6e/src/ReplicatedStorage/Classes/Hitmarker/init.luau | luau | .luau | local HitmarkerCreator = {}
local Debris = game:GetService("Debris")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SoundService = game:GetService("SoundService")
local TweenService = game:GetService("TweenService")
local Utils = require(ReplicatedStora... | 465 |
CodeBotsStudio/Dysymmetrical | CodeBotsStudio-Dysymmetrical-efeac6e/src/ReplicatedStorage/Classes/Item/ItemGUI.luau | luau | .luau | local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local UserInputService = game:GetService("UserInputService")
local Network = require(ReplicatedStorage.Modules.Network)
local Utils = require(ReplicatedStorage.... | 1,462 |
CodeBotsStudio/Dysymmetrical | CodeBotsStudio-Dysymmetrical-efeac6e/src/ReplicatedStorage/Classes/Item/PickableItem.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Types = require(ReplicatedStorage.Classes.Types)
local Utils = require(ReplicatedStorage.Modules.Utils)
local Janitor = require(ReplicatedStorage.Packages.Janitor)
local CommonFunctions = RunService:Is... | 550 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.