repo stringclasses 302
values | file_path stringlengths 18 241 | language stringclasses 2
values | file_type stringclasses 4
values | code stringlengths 76 697k | tokens int64 10 271k |
|---|---|---|---|---|---|
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/otter/createSignal.luau | luau | .luau | --[[
Copyright (c) 2023 Roblox Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, d... | 618 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/otter/createSingleMotor.luau | luau | .luau | --[[
Copyright (c) 2018-2023 Roblox Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publi... | 979 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/otter/ease.luau | luau | .luau | --[[
Copyright (c) 2018-2023 Roblox Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publi... | 2,037 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/otter/types.luau | luau | .luau | --[[
Copyright (c) 2018-2023 Roblox Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publi... | 467 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/tween.luau | luau | .luau | local bench = require("./bench")
local ITERATIONS = 10000
do
local tween = require("../packages/ripple/src/tween")
local createTween = tween.createTween
local scheduler = tween.scheduler
bench("ripple", function()
createTween(0, { start = true }):setGoal(1)
for _ = 1, ITERATIONS do
scheduler.step(1 / ITE... | 199 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/vide/effect.luau | luau | .luau | --[[
MIT License
Copyright (c) 2022 centau
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish,... | 339 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/vide/flags.luau | luau | .luau | --[[
MIT License
Copyright (c) 2022 centau
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish,... | 287 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/vide/graph.luau | luau | .luau | --[[
MIT License
Copyright (c) 2022 centau
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish,... | 2,173 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/vide/root.luau | luau | .luau | --[[
MIT License
Copyright (c) 2022 centau
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish,... | 495 |
littensy/ripple | littensy-ripple-c33bb8b/benchmarks/vide/source.luau | luau | .luau | --[[
MIT License
Copyright (c) 2022 centau
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish,... | 448 |
littensy/ripple | littensy-ripple-c33bb8b/packages/react-ripple/React.luau | luau | .luau | type CoreReactBinding<T> = {
getValue: (self: CoreReactBinding<T>) -> T,
_source: string?,
}
type ReactBindingMap = {
map: <T, U>(self: CoreReactBinding<T> & ReactBindingMap, (T) -> U) -> ReactBindingMap & CoreReactBinding<U>,
}
export type Binding<T> = CoreReactBinding<T> & ReactBindingMap
return require(script.... | 104 |
littensy/ripple | littensy-ripple-c33bb8b/packages/react-ripple/Ripple.luau | luau | .luau | local Ripple = require(script.Parent.Parent.ripple.src)
export type Animatable = Ripple.Animatable
export type Easing = Ripple.Easing
export type Motion<T = any> = Ripple.Motion<T>
export type MotionOptions<T = any> = Ripple.MotionOptions<T>
export type Spring<T = any> = Ripple.Spring<T>
export type SpringOptions<T = ... | 113 |
littensy/ripple | littensy-ripple-c33bb8b/packages/react-ripple/src/__tests__/helpers.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ReactGlobals = require(ReplicatedStorage["@rbxts-js"].ReactGlobals)
ReactGlobals.__ROACT_17_MOCK_SCHEDULER__ = true
local ReactRoblox = require(ReplicatedStorage["@rbxts-js"].ReactRoblox)
local mountedContainers = {}
local function render(element... | 206 |
littensy/ripple | littensy-ripple-c33bb8b/packages/react-ripple/src/__tests__/useMotion.test.luau | luau | .luau | local React = require("../../React")
local Ripple = require("../../Ripple")
local helpers = require("./helpers")
local test = require("../../../../tests/test")
local useMotion = require("../useMotion")
local render = helpers.render
local cleanup = helpers.cleanup
test.afterEach(function()
cleanup()
end)
test("shoul... | 172 |
littensy/ripple | littensy-ripple-c33bb8b/packages/react-ripple/src/__tests__/useTween.test.luau | luau | .luau | local React = require("../../React")
local Ripple = require("../../Ripple")
local helpers = require("./helpers")
local test = require("../../../../tests/test")
local useTween = require("../useTween")
local render = helpers.render
local cleanup = helpers.cleanup
test.afterEach(function()
cleanup()
end)
test("should ... | 169 |
littensy/ripple | littensy-ripple-c33bb8b/packages/react-ripple/src/useMotion.luau | luau | .luau | local React = require(script.Parent.Parent.React)
local Ripple = require(script.Parent.Parent.Ripple)
type Binding<T> = React.Binding<T>
type Animatable = Ripple.Animatable
type Motion<T> = Ripple.Motion<T>
type MotionOptions<T> = Ripple.MotionOptions<T>
local function useMotion<T>(initialValue: T, initialOptions: Mo... | 218 |
littensy/ripple | littensy-ripple-c33bb8b/packages/react-ripple/src/useTween.luau | luau | .luau | local React = require(script.Parent.Parent.React)
local Ripple = require(script.Parent.Parent.Ripple)
type Binding<T> = React.Binding<T>
type Animatable = Ripple.Animatable
type Tween<T> = Ripple.Tween<T>
type TweenOptions<T> = Ripple.TweenOptions<T>
local function useTween<T>(initialValue: T, initialOptions: TweenOp... | 216 |
littensy/ripple | littensy-ripple-c33bb8b/packages/ripple/src/__tests__/easing.test.luau | luau | .luau | local easing = require("../easing")
local test = require("../../../../tests/test")
test("should have correct start and end", function()
for name, easingFunction in pairs(easing) do
local x0 = easingFunction(0)
local x1 = easingFunction(1)
assert(math.abs(x0) < 1e-4, `{name}(0) should be near 0, got {x0}`)
ass... | 237 |
littensy/ripple | littensy-ripple-c33bb8b/packages/ripple/src/__tests__/init.luau | luau | .luau | local test = require("../../../tests/test")
test.describe("spring", function()
require("@self/spring.test")
end)
test.describe("tween", function()
require("@self/tween.test")
end)
test.describe("motion", function()
require("@self/motion.test")
end)
test.describe("easing", function()
require("@self/easing.test")... | 126 |
littensy/ripple | littensy-ripple-c33bb8b/packages/ripple/src/__tests__/motion.test.luau | luau | .luau | local easing = require("../easing")
local motion = require("../motion")
local test = require("../../../../tests/test")
local createMotion = motion.createMotion
local scheduler = motion.scheduler
test("should have expected api", function()
local motion = createMotion(0)
assert(type(motion.setPosition) == "function"... | 4,046 |
littensy/ripple | littensy-ripple-c33bb8b/packages/ripple/src/__tests__/tween.test.luau | luau | .luau | local easing = require("../easing")
local test = require("../../../../tests/test")
local tween = require("../tween")
local createTween = tween.createTween
local scheduler = tween.scheduler
test("should have expected api", function()
local tween = createTween(0)
assert(type(tween.setPosition) == "function", "missin... | 2,171 |
littensy/ripple | littensy-ripple-c33bb8b/packages/ripple/src/__tests__/utils/interpolate.test.luau | luau | .luau | local interpolate = require("../../utils/interpolate")
local test = require("../../../../../tests/test")
local cases: { { any } } = {
{ 0, 1, 0.5 },
{ vector.zero, vector.one, vector.create(0.5, 0.5, 0.5) },
{ { 0, 0, 0 }, { 1, 1, 1 }, { 0.5, 0.5, 0.5 } },
}
if game then
table.insert(cases, { Color3.new(), Color3... | 588 |
littensy/ripple | littensy-ripple-c33bb8b/packages/ripple/src/__tests__/utils/oklab.test.luau | luau | .luau | local oklab = require("../../utils/oklab")
local test = require("../../../../../tests/test")
local function testColors(callback: (vector) -> ())
for r = 0, 4 do
for g = 0, 4 do
for b = 0, 4 do
callback(vector.create(r, g, b) / 4)
end
end
end
end
local function fuzzyEqual(a: vector, b: vector): boolean... | 301 |
littensy/ripple | littensy-ripple-c33bb8b/packages/ripple/src/config.luau | luau | .luau | local spring = require("./spring")
type SpringOptions = spring.SpringOptions
return {
default = { tension = 170, friction = 26 } :: SpringOptions,
gentle = { tension = 120, friction = 14 } :: SpringOptions,
wobbly = { tension = 180, friction = 12 } :: SpringOptions,
stiff = { tension = 210, friction = 20 } :: Spr... | 211 |
littensy/ripple | littensy-ripple-c33bb8b/packages/ripple/src/tween.luau | luau | .luau | local easing = require("./easing")
local interpolate = require("./utils/interpolate")
local merge = require("./utils/merge")
local scheduler = require("./utils/scheduler")
local signal = require("./utils/signal")
local types = require("./types")
type Animatable = types.Animatable
type Easing = easing.Easing
export ty... | 1,432 |
littensy/ripple | littensy-ripple-c33bb8b/packages/ripple/src/types.luau | luau | .luau | export type AnimatablePrimitive = number | vector | Vector3
export type AnimatableType = AnimatablePrimitive | Vector2 | CFrame | Color3 | UDim | UDim2 | Rect
export type Animatable = AnimatableType | { [any]: AnimatablePrimitive }
return {}
| 60 |
littensy/ripple | littensy-ripple-c33bb8b/packages/ripple/src/utils/intermediate.luau | luau | .luau | local merge = require("./merge")
local oklab = require("./oklab")
export type Components = { number | vector | Vector3 }
export type Intermediate<T = any> = {
components: Components,
value: T,
dirty: boolean?,
encode: (components: Components, value: T) -> (),
decode: (components: Components) -> T,
}
local encod... | 1,338 |
littensy/ripple | littensy-ripple-c33bb8b/packages/ripple/src/utils/interpolate.luau | luau | .luau | local oklab = require("./oklab")
local types = require("../types")
type Animatable = types.Animatable
local function interpolate<T>(from: any, to: any, alpha: number): any
local kind = typeof(from)
if kind == "number" or kind == "vector" or kind == "Vector3" or kind == "Vector2" then
return from + (to - from) * ... | 458 |
littensy/ripple | littensy-ripple-c33bb8b/packages/ripple/src/utils/merge.luau | luau | .luau | local function merge<T>(target: any, source: any): T
local result = target
for key, value in source do
if target[key] == value then
continue
end
if result == target then
result = table.clone(target)
end
result[key] = value
end
return result
end
return merge
| 77 |
littensy/ripple | littensy-ripple-c33bb8b/packages/ripple/src/utils/scheduler.luau | luau | .luau | export type Scheduler<State> = {
states: { State },
update: (state: State, time: number) -> any,
step: (deltaTime: number) -> (),
add: (state: State) -> (),
remove: (state: State) -> (),
clear: () -> (),
}
local function scheduler<State>(
label: string,
updater: (state: State, time: number, remove: (State) -> ... | 399 |
littensy/ripple | littensy-ripple-c33bb8b/packages/ripple/src/utils/signal.luau | luau | .luau | local spawn = require("./spawn")
export type FireSignal<T...> = (T...) -> ()
export type SubscribeSignal<T...> = (callback: FireSignal<T...>) -> () -> ()
local function signal<T...>(): (SubscribeSignal<T...>, FireSignal<T...>)
local listeners: { (...any) -> () } = {}
local count = 0
local function subscribe(callb... | 198 |
littensy/ripple | littensy-ripple-c33bb8b/packages/ripple/src/utils/spawn.luau | luau | .luau | local freeThread: thread?
local function run<T...>(thread: thread, fn: (T...) -> (), ...: T...)
freeThread = nil
fn(...)
freeThread = thread
end
local function runner()
while true do
run(coroutine.yield())
end
end
local function spawn<T...>(callback: (T...) -> (), ...: T...)
local thread = freeThread or task... | 134 |
littensy/ripple | littensy-ripple-c33bb8b/packages/vide-ripple/src/__tests__/useMotion.test.luau | luau | .luau | local Ripple = require("../../Ripple")
local Vide = require("../../Vide")
local test = require("../../../../tests/test")
local useMotion = require("../useMotion")
test("should update binding when goal is set", function()
local src, motion
Vide.root(function()
src, motion = useMotion(0)
motion:setGoal(1, { tween... | 117 |
littensy/ripple | littensy-ripple-c33bb8b/packages/vide-ripple/src/__tests__/useTween.test.luau | luau | .luau | local Ripple = require("../../Ripple")
local Vide = require("../../Vide")
local test = require("../../../../tests/test")
local useTween = require("../useTween")
test("should update binding when goal is set", function()
local src, tween
Vide.root(function()
src, tween = useTween(0)
tween:setGoal(1, { tween = { d... | 118 |
littensy/ripple | littensy-ripple-c33bb8b/packages/vide-ripple/src/useMotion.luau | luau | .luau | local Ripple = require(script.Parent.Parent.Ripple)
local Vide = require(script.Parent.Parent.Vide)
type Animatable = Ripple.Animatable
type Motion<T> = Ripple.Motion<T>
type MotionOptions<T> = Ripple.MotionOptions<T>
local function useMotion<T>(initialValue: T, initialOptions: MotionOptions<T>?): (() -> T, Motion<T>... | 154 |
littensy/ripple | littensy-ripple-c33bb8b/packages/vide-ripple/src/useTween.luau | luau | .luau | local Ripple = require(script.Parent.Parent.Ripple)
local Vide = require(script.Parent.Parent.Vide)
type Animatable = Ripple.Animatable
type Tween<T> = Ripple.Tween<T>
type TweenOptions<T> = Ripple.TweenOptions<T>
local function useTween<T>(initialValue: T, initialOptions: TweenOptions<T>?): (() -> T, Tween<T>)
loca... | 152 |
littensy/ripple | littensy-ripple-c33bb8b/storybook/components/Graph.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local React = require(ReplicatedStorage["@rbxts-js"].React)
type GraphProps = {
name: string,
precision: number,
step: (dt: number) -> number,
idle: () -> boolean,
showRuntime: boolean?,
}
local MAX_POINTS = 50
local function Graph(props: GraphProp... | 814 |
littensy/ripple | littensy-ripple-c33bb8b/storybook/stories/EasingFunctions.story.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Graph = require(script.Parent.Parent.components.Graph)
local React = require(ReplicatedStorage["@rbxts-js"].React)
local ReactRoblox = require(ReplicatedStorage["@rbxts-js"].ReactRoblox)
local Ripple = require(ReplicatedStorage.packages.ripple.src)
... | 434 |
littensy/ripple | littensy-ripple-c33bb8b/storybook/stories/SpringColor.story.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local React = require(ReplicatedStorage["@rbxts-js"].React)
local ReactRipple = require(ReplicatedStorage.packages["react-ripple"].src)
local ReactRoblox = require(ReplicatedStorage["@rbxts-js"].ReactRoblox)
local function Story()
local _, tween = ReactR... | 354 |
littensy/ripple | littensy-ripple-c33bb8b/tests/run.server.luau | luau | .luau | local test = require("./test")
local describeInRoblox = test.describeIf(function()
return game :: any ~= nil
end)
test.describe("ripple", function()
require("../packages/ripple/src/__tests__")
end)
describeInRoblox("react-ripple", function()
require("../packages/react-ripple/src/__tests__")
end)
describeInRoblox... | 104 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/.lune/fs.luau | luau | .luau | local DateTime = require("./datetime")
type DateTime = DateTime.DateTime
export type MetadataKind = "file" | "dir" | "symlink"
--[=[
@interface MetadataPermissions
@within FS
Permissions for the given file or directory.
This is a dictionary that will contain the following values:
* `readOnly` - If the target ... | 1,803 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/.lune/regex.luau | luau | .luau | --[=[
@class RegexMatch
A match from a regular expression.
Contains the following values:
- `start` -- The start index of the match in the original string.
- `finish` -- The end index of the match in the original string.
- `text` -- The text that was matched.
- `len` -- The length of the text that was matched... | 1,219 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/.lune/task.luau | luau | .luau | --[=[
@class Task
Built-in task scheduler & thread spawning
### Example usage
```lua
local task = require("@lune/task")
-- Waiting for a certain amount of time
task.wait(1)
print("Waited for one second")
-- Running a task after a given amount of time
task.delay(2, function()
print("Ran after two second... | 541 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Build/Lib/BundleModel.luau | luau | .luau | -- MIT License | Copyright (c) 2023-2024 Latte Softworks <https://latte.to>
local luau = require("@lune/luau")
local roblox = require("@lune/roblox")
local LuneUtils = require("Libraries/LuneUtils")
local Log = LuneUtils.Log
local StringUtils = LuneUtils.StringUtils
local LuaEncode = require("Libraries/LuaEncode")
... | 2,041 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Build/Lib/Data/DefaultDarkluaConfig.luau | luau | .luau | local serde = require("@lune/serde")
local Config = {
generator = {
name = "dense",
column_span = 120,
},
rules = {
"convert_index_to_field",
"compute_expression",
"group_local_assignment",
"filter_after_early_return",
"remove_comments",
"rem... | 143 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Build/Lib/Data/Template.luau | luau | .luau | -- This codegen template *must* be 100% compatible with Lua 5.1x+, NOT just Luau
-- With that being said, this explains the weird cflow in some parts
return [[
-- ++++++++ WAX BUNDLED DATA BELOW ++++++++ --
-- Will be used later for getting flattened globals
local ImportGlobals
-- Holds direct closure data (defining... | 3,682 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Build/Lib/Libraries/LuneUtils/CommandUtils.luau | luau | .luau | -- MIT License | Copyright (c) 2023-2024 Latte Softworks <https://latte.to>
local process = require("@lune/process")
local CommandUtils = {}
function CommandUtils.CommandExists(binary: string): boolean
if process.os ~= "windows" then
-- Unix-compliance is simple!
return process.spawn("type", {bin... | 173 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Build/Lib/Libraries/LuneUtils/EnsureFileTree.luau | luau | .luau | -- MIT License | Copyright (c) 2023-2024 Latte Softworks <https://latte.to>
local fs = require("@lune/fs")
--[[
This kinda looks like a strange function, because of the format a "FileTree" accepts:
```lua
EnsureFileTree({
["test"] = {
["test.txt"] = "hi",
["test.json"] = "... | 302 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Build/Lib/Libraries/LuneUtils/ParseArgs.luau | luau | .luau | -- MIT License | Copyright (c) 2023-2024 Latte Softworks <https://latte.to>
type OptionsInput = {[string]: {string | number | boolean | nil}}
type OptionsOutput = {[string]: string | number | boolean | nil}
local process = require("@lune/process")
local Log = require("Log")
local function ParseArgs(args: {string}, ... | 488 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Build/Lib/Libraries/LuneUtils/RecursiveReadDir.luau | luau | .luau | -- MIT License | Copyright (c) 2023-2024 Latte Softworks <https://latte.to>
local fs = require("@lune/fs")
local function RecursiveReadDir(directory: string, _existingFileList: {string}?): {string}
if not string.match(directory, "[/\\]$") then
directory ..= "/"
end
local FileList = _existingFileL... | 159 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Build/Lib/Libraries/LuneUtils/Run.luau | luau | .luau | -- MIT License | Copyright (c) 2023-2024 Latte Softworks <https://latte.to>
local process = require("@lune/process")
local Log = require("Log")
local function Run(command: string, args: {string}?, directRun: boolean?, errorHandler: (string?) -> ()?): process.SpawnResult
local Args = args or {}
local DirectRu... | 222 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Build/Lib/Libraries/LuneUtils/init.luau | luau | .luau | -- MIT License | Copyright (c) 2023-2024 Latte Softworks <https://latte.to>
return {
Log = require("Log"),
StringUtils = require("StringUtils"),
CommandUtils = require("CommandUtils"),
WebhookQueue = require("WebhookQueue"),
Run = require("Run"),
ParseArgs = require("ParseArgs"),
EnsureFil... | 100 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Src/Utils/Connect.luau | luau | .luau | wax.shared.Connections = {}
wax.shared.Connect = function(Connection)
table.insert(wax.shared.Connections, Connection)
return Connection
end
wax.shared.Disconnect = function(Connection)
Connection:Disconnect()
local Index = table.find(wax.shared.Connections, Connection)
if Index then
table.remove(wax.shared.C... | 80 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Src/Utils/FileHelper.luau | luau | .luau | local FileHelper = {}
FileHelper.__index = FileHelper
function FileHelper.new(basePath: string)
local self = setmetatable({
BasePath = FileHelper.NormalizePath(basePath),
}, FileHelper)
self:EnsureDirectory()
return self
end
function FileHelper:EnsureDirectory()
local paths = {}
local... | 768 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Src/Utils/FileLog.luau | luau | .luau | -- Logger
-- ActualMasterOogway
-- December 8, 2024
--[=[
A simple logging utility that writes messages to a file. Supports different log levels
and can be configured to overwrite or append to the log file.
Log Format: 2024-12-04T15:28:31.131Z,0.131060,MyThread,Warning [FLog::RobloxStarter] Roblox stage ... | 1,148 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Src/Utils/Pagination.luau | luau | .luau | --[[
Pagination Module
made by deivid and turned into module by upio
]]
local Pagination = {}
Pagination.__index = Pagination
function Pagination.new(Options: {
TotalItems: number,
ItemsPerPage: number,
CurrentPage: number?,
SiblingCount: number?,
})
return setmetatable({
TotalItems = Options.TotalItems,
I... | 997 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Src/Utils/SaveManager.luau | luau | .luau | local FileHelperUtil = require(script.Parent.FileHelper)
local SaveManager = {
State = {},
}
local FileHelper = FileHelperUtil.new("Cobalt")
FileHelper:EnsureFile("Settings.json", "{}")
local Success, Error = pcall(function()
SaveManager.State = wax.shared.HttpService:JSONDecode(FileHelper:ReadFile("Settings.json"... | 183 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Src/Utils/Signal.luau | luau | .luau | local SignalHandler = {
Signals = {},
}
function SignalHandler.New(self)
local Signal = {
Connections = {},
Disconnect = nil,
}
function Signal:Connect(callback)
local connection = {
Connected = true,
Enabled = true,
Callback = callback,
}
function connection:Disconnect()
connection.Connect... | 363 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Src/Utils/UI/Animations.luau | luau | .luau | local Animations = {
TweenInfo = TweenInfo.new(0.25, Enum.EasingStyle.Exponential),
Exclusions = {},
Expectations = { In = {}, Out = {} },
}
local function GetTransparencyProperty(object)
if table.find(Animations.Exclusions, object) then
return nil
end
if object:IsA("TextButton") or object:IsA("TextLabel") or... | 745 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Src/Utils/UI/Drag.luau | luau | .luau | local Drag = {
Dragging = false,
Frame = nil,
FramePosition = nil,
FrameSize = nil, -- Added to store initial frame size
StartPosition = nil,
ChangedConnection = nil,
Callback = nil,
}
local Helper = require(script.Parent.Helper)
local function DefaultCallback(_, Input: InputObject)
local Delta = Input.Positi... | 433 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Src/Utils/UI/Helper.luau | luau | .luau | local UIHelper = {}
local CodeGen = require(script.Parent.Parent.CodeGen.Generator)
function UIHelper.IsMouseOverFrame(Frame: GuiObject, Position: Vector3): boolean
local AbsPos, AbsSize = Frame.AbsolutePosition, Frame.AbsoluteSize
return Position.X >= AbsPos.X
and Position.X <= AbsPos.X + AbsSize.X
and Positio... | 593 |
notpoiu/cobalt | notpoiu-cobalt-8e31afb/Src/Utils/UI/Resize.luau | luau | .luau | local Resize = {}
Resize.__index = Resize
local Interface = require(script.Parent.Interface)
local Drag = require(script.Parent.Drag)
local HANDLE_SIZE = 6
local CORNER_HANDLE_SIZE = 20
function Resize.new(Options: {
MainFrame: Frame,
MinimumSize: Vector2? | UDim2?,
MaximumSize: UDim2?,
HandleSize: number?,
Cor... | 3,168 |
nezuo/lapis | nezuo-lapis-e217a22/examples/developer-product-handling/src/server/init.server.luau | luau | .luau | local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Lapis = require(ReplicatedStorage.Packages.Lapis)
local Sift = require(ReplicatedStorage.Packages.Sift)
local t = require(ReplicatedStorage.Pa... | 811 |
nezuo/lapis | nezuo-lapis-e217a22/examples/player-data/src/server/init.server.luau | luau | .luau | local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Lapis = require(ReplicatedStorage.Packages.Lapis)
local t = require(ReplicatedStorage.Packages.t)
local DEFAULT_DATA = { coins = 100 }
local collection = Lapis.createCollection("PlayerData", {
defaultData... | 394 |
nezuo/lapis | nezuo-lapis-e217a22/src/AutoSave.luau | luau | .luau | local RunService = game:GetService("RunService")
local Promise = require(script.Parent.Parent.Promise)
local UPDATE_INTERVAL = 5 * 60
local AutoSave = {}
AutoSave.__index = AutoSave
function AutoSave.new(data)
return setmetatable({
documents = {},
data = data,
gameClosed = false,
ongoingLoads = 0,
ongoin... | 399 |
nezuo/lapis | nezuo-lapis-e217a22/src/Collection.luau | luau | .luau | local HttpService = game:GetService("HttpService")
local Document = require(script.Parent.Document)
local Error = require(script.Parent.Error)
local freezeDeep = require(script.Parent.freezeDeep)
local Migration = require(script.Parent.Migration)
local Promise = require(script.Parent.Parent.Promise)
local copyDeep = r... | 1,539 |
nezuo/lapis | nezuo-lapis-e217a22/src/Config.luau | luau | .luau | local DataStoreService = game:GetService("DataStoreService")
local Config = {}
Config.__index = Config
function Config.new()
return setmetatable({
config = {
saveAttempts = 5,
loadAttempts = 20,
loadRetryDelay = 1,
showRetryWarnings = true,
dataStoreService = DataStoreService,
},
}, Config)
end
... | 148 |
nezuo/lapis | nezuo-lapis-e217a22/src/Data/Throttle.luau | luau | .luau | local RunService = game:GetService("RunService")
local Error = require(script.Parent.Parent.Error)
local Promise = require(script.Parent.Parent.Parent.Promise)
local GET_ASYNC_RETRY_ATTEMPTS = 5
local GET_ASYNC_RETRY_DELAY = 1
local REMOVE_ASYNC_RETRY_ATTEMPTS = 5
local REMOVE_ASYNC_RETRY_DELAY = 1
local getAsyncOp... | 1,598 |
nezuo/lapis | nezuo-lapis-e217a22/src/Data/init.luau | luau | .luau | local Error = require(script.Parent.Error)
local Promise = require(script.Parent.Parent.Promise)
local Throttle = require(script.Throttle)
local Data = {}
Data.__index = Data
function Data.new(config)
local throttle = Throttle.new(config)
throttle:start()
return setmetatable({
config = config,
throttle = thr... | 842 |
nezuo/lapis | nezuo-lapis-e217a22/src/Document.luau | luau | .luau | local Error = require(script.Parent.Error)
local freezeDeep = require(script.Parent.freezeDeep)
local Promise = require(script.Parent.Parent.Promise)
local noYield = require(script.Parent.noYield)
local function runCallback(document, name, callback)
if callback == nil then
return Promise.resolve()
end
document.c... | 1,928 |
nezuo/lapis | nezuo-lapis-e217a22/src/Document.test.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Promise = require(ReplicatedStorage.Packages.Promise)
local function defaultOptions()
return {
validate = function(data)
return typeof(data.foo) == "string", "foo must be a string"
end,
defaultData = { foo = "bar" },
}
end
return functio... | 3,181 |
nezuo/lapis | nezuo-lapis-e217a22/src/Error.luau | luau | .luau | type ErrorKind =
"RobloxApiError"
| "DefaultDataThrew"
| "SessionLocked"
| "MigrationError"
| "BeforeSaveCloseCallbackThrew"
| "DocumentRemoved"
| "SessionLockStolen"
| "ValidateThrew"
| "ValidateFailed"
local Error = {}
function Error.new(kind: ErrorKind, message: string)
return {
kind = kind,
message ... | 104 |
nezuo/lapis | nezuo-lapis-e217a22/src/Internal.luau | luau | .luau | local AutoSave = require(script.Parent.AutoSave)
local Collection = require(script.Parent.Collection)
local Config = require(script.Parent.Config)
local Data = require(script.Parent.Data)
local Internal = {}
function Internal.new(enableAutoSave)
local config = Config.new()
local data = Data.new(config)
local autoS... | 193 |
nezuo/lapis | nezuo-lapis-e217a22/src/Migration.luau | luau | .luau | local Migration = {}
function Migration.getLastCompatibleVersion(migrations)
local serverVersion = #migrations
for version = serverVersion, 1, -1 do
local migration = migrations[version]
if migration.backwardsCompatible ~= true then
return version
end
end
return 0
end
function Migration.migrate(migrat... | 321 |
nezuo/lapis | nezuo-lapis-e217a22/src/PromiseTypes.luau | luau | .luau | export type Status = "Started" | "Resolved" | "Rejected" | "Cancelled"
export type Promise = {
andThen: (
self: Promise,
successHandler: (...any) -> ...any,
failureHandler: ((...any) -> ...any)?
) -> Promise,
andThenCall: <T...>(self: Promise, callback: (T...) -> ...any, T...) -> any,
andThenReturn: (self: P... | 583 |
nezuo/lapis | nezuo-lapis-e217a22/src/copyDeep.luau | luau | .luau | local function copyDeep(value)
if typeof(value) ~= "table" then
return value
end
local new = table.clone(value)
for k, v in value do
if type(v) == "table" then
new[k] = copyDeep(v)
end
end
return new
end
return copyDeep
| 71 |
nezuo/lapis | nezuo-lapis-e217a22/src/freezeDeep.luau | luau | .luau | local function freezeDeep(value)
if typeof(value) ~= "table" then
return
end
if not table.isfrozen(value) then
table.freeze(value)
end
for _, innerValue in value do
freezeDeep(innerValue)
end
end
return freezeDeep
| 61 |
nezuo/lapis | nezuo-lapis-e217a22/src/init.test.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local DataStoreServiceMock = require(ReplicatedStorage.DevPackages.DataStoreServiceMock)
local Internal = require(script.Parent.Internal)
local Promise = require(script.Parent.Parent.Promise)
local function... | 7,547 |
nezuo/lapis | nezuo-lapis-e217a22/src/noYield.luau | luau | .luau | local function noYield(callback)
for _ in
function()
callback()
end
do
break
end
end
return noYield
| 34 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/.lune/build-rbxm.luau | luau | .luau | local process = require("@lune/process")
process.exec("rojo", { "build", "--output", "crunchyroll.rbxm" }, { stdio = "forward" })
| 40 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/.lune/clone-mirrors.luau | luau | .luau | local fs = require("@lune/fs")
local process = require("@lune/process")
local serde = require("@lune/serde")
local mirror_configs = fs.readDir("./benches/mirror_list")
-- thank you nick from lute
local function get_git_version(): { major: number, minor: number, path: number }
local git_ver_string = process.exec("git... | 557 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/.lune/dev.luau | luau | .luau | local process = require("@lune/process")
local task = require("@lune/task")
task.spawn(function()
process.exec("rojo", {
"sourcemap",
"roblox-tests.project.json",
"--output",
"sourcemap.json",
"--watch",
"--include-non-scripts",
}, {
stdio = "forward",
})
end)
task.spawn(function()
process.exec("roj... | 116 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/.lune/styling.luau | luau | .luau | local process = require("@lune/process")
local directories = { ".lune", "src", "tests" }
-- kinda cursed but, easiest way to do this.
table.insert(directories, "--check")
local result = process.exec("stylua", directories, {
stdio = "forward",
})
process.exit(result.code)
| 68 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/benches/create_bench.luau | luau | .luau | export type Profiler = { Begin: (label: string) -> (), stop: () -> () }
local function create_bench<T...>(
parameter_generator: () -> T...,
bench_table: {
[string]: (profiler: Profiler, T...) -> (),
}
): any
return {
Functions = bench_table,
ParameterGenerator = parameter_generator,
}
end
return create_ben... | 89 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/benches/create_entry.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local create_bench = require(ReplicatedStorage.benches.create_bench)
local rig_template = require(ReplicatedStorage.client.rig) :: any
local SAMPLES = 500
local ANIMATION_TEMPLATE = ReplicatedStorage.benches.assets.orange_justice
type Rig = { __symbol: "... | 363 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/benches/solver.bench.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local create_bench = require(ReplicatedStorage.benches.create_bench)
local create_entry = require(ReplicatedStorage.benches.create_entry)
type Crunchyroll = create_entry.Crunchyroll
local entries = {
latest = create_entry(require(ReplicatedStorage.crunc... | 176 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/src/animation_solver.luau | luau | .luau | local animation_asset = require("./roblox/animation_asset")
local create_rig = require("./rig")
export type AnimationTrack = {
-- 0-1
alpha: number,
-- 0-1
start_fade_time: number,
stop_fade_time: number,
weight: number,
-- arbitrary number
priority: number,
}
local function quat_dot(a_vector: vector, a_sca... | 1,439 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/src/easings.luau | luau | .luau | --!native
local function linear(value: number): number
return value
end
local function cubic_in(alpha: number): number
return alpha ^ 3
end
local function cubic_out(alpha: number): number
return 1 - ((1 - alpha) ^ 3)
end
local function cubic_in_out(alpha: number): number
if alpha < 0.5 then
return 4 * (alpha ^... | 1,286 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/src/init.luau | luau | .luau | local animation_asset = require("@self/roblox/animation_asset")
local animation_solver = require("@self/animation_solver")
local rig = require("@self/rig")
--[=[
@class Crunchyroll
The root module.
]=]
--[=[
@function load_keyframe_sequence
@within Crunchyroll
Load a keyframe sequence from Roblox. This will ... | 579 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/src/rig.luau | luau | .luau | export type LimbInfo = {
c0: CFrame,
c1: CFrame,
name: string,
children: { LimbInfo }?,
}
export type Limb = {
name: string,
c0: CFrame,
c1: CFrame,
depends_on: string,
}
export type LimbTransform = {
priority: number,
position: vector,
quat_vector: vector,
quat_scalar: number,
}
export type Identity = {... | 462 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/src/roblox/animation_asset.luau | luau | .luau | local easing = require("../easings")
local easing_enum_map = require("./easing_enum_map")
local rig = require("../rig")
export type PoseNode = {
position: vector,
quat_vector: vector,
quat_scalar: number,
easing_function: (alpha: number) -> number,
}
--- [1] = previous keyframe index
--- [2] = (next keyframe inde... | 1,274 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/src/roblox/easing_enum_map.luau | luau | .luau | local Enum = Enum or (require("@lune/roblox").Enum :: any) :: typeof(Enum)
local easings = require("../easings")
local EASING_IN = Enum.PoseEasingDirection.In
local EASING_OUT = Enum.PoseEasingDirection.Out
local EASING_IN_OUT = Enum.PoseEasingDirection.InOut
local LINEAR = Enum.PoseEasingStyle.Linear
local CUBIC = ... | 396 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/tests/init.luau | luau | .luau | local tests = {}
function tests.unit_tests()
require("@self/unit_tests/fade_time.spec")
end
return tests
| 24 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/tests/roblox/client/rig.luau | luau | .luau | return {
name = "HumanoidRootPart",
c0 = CFrame.identity,
c1 = CFrame.identity,
children = {
{
name = "Torso",
c0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),
c1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),
children = {
{
name = "Head",
c0 = CFrame.new(0, 1, 0, -1, 0, 0, ... | 685 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/tests/roblox/client/runner.client.luau | luau | .luau | local KeyframeSequenceProvider = game:GetService("KeyframeSequenceProvider")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local crunchyroll = require(ReplicatedStorage.crunchyroll)
local rig_template = require("./rig") :: any
local TEST_TRANSFORM = CF... | 1,278 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/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 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/CommonProps.luau | luau | .luau | --[=[
@class CommonProps
@private
The props listed here are accepted by every component except where explicitly noted.
These props are accepted in addition to the props specified by components on their API pages.
:::info
This file is not exported and serves only to host an internal type and documentation.
:::
... | 172 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/Background.luau | luau | .luau | --[=[
@class Background
A borderless frame matching the default background color of Studio widgets.
| Dark | Light |
| - | - |
|  |  |
Any children passed will be parented to the frame, which ma... | 317 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/Button.luau | luau | .luau | --[=[
@class Button
A basic button that supports text, an icon, or both. This should be used as a standalone button
or as a secondary button alongside a [MainButton] for the primary action in a group of options.
| Dark | Light |
| - | - |
|  |  | ![Light](/StudioComponents/components/colorpicker/ligh... | 3,822 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.