repo stringclasses 254
values | file_path stringlengths 29 241 | code stringlengths 100 233k | tokens int64 14 69.4k |
|---|---|---|---|
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LunePolyfill/Utf8.luau | --!optimize 2
--!strict
local Utf8 = {}
function Utf8.Graphemes(value: string, start: number?, finish: number?): () -> (number, number)
local trueStart = start or 1
local trueFinish = finish or #value
local codePoints = {}
local length = 0
for point in utf8.codes(value) do
if point >= trueStart and point <= t... | 200 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LunePolyfill/init.luau | --!optimize 2
--!strict
local Utf8 = require("@self/Utf8")
local LunePolyfill = table.freeze({
Utf8 = Utf8;
})
return LunePolyfill
| 44 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/Option.luau | --!nonstrict
--!optimize 2
-- Option
-- Stephen Leitnick
-- August 28, 2020
--[[
MatchTable {
Some: (value: any) -> any
None: () -> any
}
CONSTRUCTORS:
Option.Some(anyNonNilValue): Option<any>
Option.Wrap(anyValue): Option<any>
STATIC FIELDS:
Option.None: Option<None>
STATIC METHODS:
Option.Is(obj... | 3,628 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/PathFileSystem.luau | --!optimize 2
--!strict
local LuauPath = require("@packages/LuauPath")
local LuauPolyfill = require("@packages/LuauPolyfill")
local fs = require("@lune/fs")
local process = require("@lune/process")
local PathFileSystem = {}
local Path = LuauPath.Path
local console = LuauPolyfill.console
export type AsPath = LuauPat... | 2,027 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/PromiseUtilities/AsyncMulti.luau | --!optimize 2
--!strict
local Promise = require("@packages/Promise")
local function PackRest<S, T...>(statusOrSuccess: S, ...: T...)
-- table.pack cringes with typed varargs, so we do this instead.
-- selene: allow(mixed_table)
return statusOrSuccess, {
n = select("#", ...);
select(1, ...);
}
end
--[=[
A fu... | 420 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/PromiseUtilities/Await.luau | --!optimize 2
--!strict
local Promise = require("@packages/Promise")
--[=[
The functionality of this is meant to be the same as the `await` keyword in
ECMAScript.
```ts
async function promiseGet(url: string) {
return HttpService.GetAsync(url);
}
const result = await promiseGet("https://example.com");
```
... | 349 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/PromiseUtilities/AwaitMulti.luau | --!optimize 2
--!strict
local Promise = require("@packages/Promise")
local function PackRest<S, T...>(statusOrSuccess: S, ...: T...)
-- table.pack cringes with typed varargs, so we do this instead.
-- selene: allow(mixed_table)
return statusOrSuccess, {
n = select("#", ...);
select(1, ...);
}
end
--[=[
The ... | 431 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/PromiseUtilities/FastAsync.luau | --!optimize 2
--!strict
local Promise = require("@packages/Promise")
local ThreadUtilities = require("@packages/ThreadUtilities")
--[=[
A function that turns another function into the same as an async function
in ECMAScript. This uses a thread recycling "fast spawn" function instead
of `coroutine.wrap`.
```ts
a... | 369 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/PromiseUtilities/FastAsyncMulti.luau | --!optimize 2
--!strict
local Promise = require("@packages/Promise")
local ThreadUtilities = require("@packages/ThreadUtilities")
local function PackRest<S, T...>(statusOrSuccess: S, ...: T...)
-- table.pack cringes with typed varargs, so we do this instead.
-- selene: allow(mixed_table)
return statusOrSuccess, {
... | 395 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/PromiseUtilities/init.luau | --!optimize 2
--!strict
local Promise = require("@packages/Promise")
local Async = require("@self/Async")
local AsyncMulti = require("@self/AsyncMulti")
local Await = require("@self/Await")
local AwaitMulti = require("@self/AwaitMulti")
local FastAsync = require("@self/FastAsync")
local FastAsyncMulti = require("@sel... | 255 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/SemanticVersion.luau | --!optimize 2
--!strict
local GreenTea = require("@packages/GreenTea")
local LuauPolyfill = require("@packages/LuauPolyfill")
local PathFileSystem = require("@packages/PathFileSystem")
local serde = require("@lune/serde")
local console = LuauPolyfill.console
local isWallyPackage = GreenTea.build({
dependencies = Gr... | 2,397 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/SortedArray.luau | --!optimize 2
--!strict
local Error = require("@packages/Error")
local GreenTea = require("@packages/GreenTea")
local GreenTeaUtilities = require("@packages/GreenTeaUtilities")
local TableUtilities = require("@packages/TableUtilities")
type ComparisonFunction<T> = (a: T, b: T) -> boolean
export type SortedArray<T> =... | 6,107 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/CopyDeep.luau | --!optimize 2
--!strict
-- types are wonky here, but it's cause i can assure
-- that i am right
local function FastCopyDeep<T>(object: T): T
local newObject = table.clone(object :: never)
for key, value in pairs(object :: never) do
if type(value) == "table" then
newObject[key] = FastCopyDeep(value)
end
end
... | 316 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/EqualObjects.luau | --!optimize 2
--!strict
--[=[
Compares two or more tables to see if they are equal.
```lua
local a = {hello = "world"}
local b = {hello = "world"}
local equal = EqualObjects(a, b) -- false
```
```lua
local a, b = table.unpack(table.create(2, {}), 1, 2)
local equal = EqualObjects(a, b) -- true
```
@funct... | 203 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/Equals.luau | --!optimize 2
--!strict
local EqualObjects = require("./EqualObjects")
--@native
local function Compare(a: unknown, b: unknown): boolean
if type(a) ~= "table" or type(b) ~= "table" then
return a == b
end
local castA = a :: {[unknown]: unknown}
local castB = b :: {[unknown]: unknown}
-- can't use generalized ... | 378 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/EqualsDeep.luau | --!optimize 2
--!strict
local EqualObjects = require("./EqualObjects")
--@native
local function CompareDeep(a: unknown, b: unknown): boolean
if type(a) ~= "table" or type(b) ~= "table" then
return a == b
end
local castA = a :: {[unknown]: unknown}
local castB = b :: {[unknown]: unknown}
-- can't use generali... | 400 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/FastMerge.luau | --!optimize 2
--!strict
--[=[
A fast merge function that doesn't support a `None` value. Uses if branches
to avoid iteration. Does NOT do any type validation, be aware of what you
pass to it.
@function FastMerge
@within TableUtilities
@param ... ...{[unknown]: unknown} -- The tables to merge.
@return T -- The... | 540 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/FastMergeDeep.luau | --!optimize 2
--!strict
local CopyDeep = require("./CopyDeep")
--[=[
Merges the given dictionaries into a single dictionary. This is recursive.
The parameters may be any number of dictionaries or `nil`. Non-dictionaries
will be ignored. Uses if branches to avoid iteration as much as possible.
@function FastMerge... | 717 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/GetLength.luau | --!optimize 2
--!strict
--[=[
Gets the length of any table. This has a really bad time complexity of O(n)
so I would just not use this unless you absolutely have to. And if you
absolutely do have to, I'd just suggest inlining.
This uses `pairs` to avoid weird `__call` issues with generalized
iteration.
```lua
... | 224 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/IsArray.luau | --!optimize 2
--!strict
--[=[
Checks if the given value as an array.
@function IsArray
@within TableUtilities
@param value unknown -- The value to check.
@return boolean -- Whether the value is an array.
]=]
local function IsArray(value: any): boolean
if type(value) ~= "table" then
return false
end
if nex... | 212 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/LockDeep.luau | --!optimize 2
--!strict
local function FastLockDeep<T>(object: T): T
local newObject = table.clone(object :: never)
for key, value in pairs(object :: never) do
if type(value) == "table" then
newObject[key] = FastLockDeep(value)
end
end
return table.freeze(newObject) :: never
end
--[=[
Does a deep copy and... | 285 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/Repr.luau | --!optimize 2
--!strict
local DateTime = require("@lune/datetime")
local FastMergeDeep = require("./FastMergeDeep")
local IsArray = require("./IsArray")
local roblox = require("@lune/roblox")
type DateTime = DateTime.DateTime
export type Locale = DateTime.Locale
--[=[
Indicates that [DateTime]s should be formatted ... | 3,150 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/SortedArrays/FindInsertIndex.luau | --!optimize 2
--!strict
export type Comparison<T> = (a: T, b: T) -> boolean
--[=[
Used to find where to insert an element into a sorted array. You will
need to provide a compare function to use and possible an equality check.
If you are using numbers or strings, you can get away with
[TableUtilities.FindInsertInd... | 647 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/SortedArrays/FindInsertIndexSimple.luau | --!optimize 2
--!strict
--[=[
Used to find where to insert an element into a sorted array. This requires
the elements to be either a number or a string.
:::danger Warning
Your array *MUST* be already sorted because this uses a binary search. This
function will not sort for you.
:::
```lua
local array: {numbe... | 472 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/SortedArrays/SortedInsert.luau | --!optimize 2
--!strict
local FindInsertIndex = require("./FindInsertIndex")
type Comparison<T> = FindInsertIndex.Comparison<T>
--[=[
Inserts a value into a sorted array using a binary search. This requires
the elements to be either a number or a string.
Inserts a value into a sorted array using a binary search. ... | 503 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/SortedArrays/SortedInsertSimple.luau | --!native
--!optimize 2
--!strict
local FindInsertIndexSimple = require("./FindInsertIndexSimple")
--[=[
Inserts a value into a sorted array using a binary search. This requires
the elements to be either a number or a string.
:::danger Warning
Your array *MUST* be already sorted because this uses a binary search... | 322 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TableUtilities/init.luau | --!optimize 2
--!strict
local CopyDeep = require("@self/CopyDeep")
local EqualObjects = require("@self/EqualObjects")
local Equals = require("@self/Equals")
local EqualsDeep = require("@self/EqualsDeep")
local FastMerge = require("@self/FastMerge")
local FastMergeDeep = require("@self/FastMergeDeep")
local GetLength =... | 389 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/ThreadUtilities/FastDefer.luau | --!optimize 2
--!strict
local task = require("@lune/task")
local FreeThreads: {thread} = table.create(500)
local function RunFunction<Arguments...>(callback: (Arguments...) -> (), thread: thread, ...: Arguments...)
callback(...)
table.insert(FreeThreads, thread)
end
local function Yield()
while true do
RunFunct... | 260 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/ThreadUtilities/FastDeferSafe.luau | --!optimize 2
--!strict
local task = require("@lune/task")
local FreeThreads: {thread} = table.create(500)
local function RunFunction<Arguments...>(callback: (Arguments...) -> (), thread: thread, ...: Arguments...)
callback(...)
table.insert(FreeThreads, thread)
end
local function Yield()
while true do
RunFunct... | 337 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/ThreadUtilities/FastDelay.luau | --!optimize 2
--!strict
local task = require("@lune/task")
local FreeThreads: {thread} = table.create(500)
local function RunFunction<Arguments...>(callback: (Arguments...) -> (), thread: thread, ...: Arguments...)
callback(...)
table.insert(FreeThreads, thread)
end
local function Yield()
while true do
RunFunct... | 315 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/ThreadUtilities/FastSpawn.luau | --!optimize 2
--!strict
local task = require("@lune/task")
local FreeThreads: {thread} = table.create(500)
local function RunFunction<Arguments...>(callback: (Arguments...) -> (), thread: thread, ...: Arguments...)
callback(...)
table.insert(FreeThreads, thread)
end
local function Yield()
while true do
RunFunct... | 256 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/ThreadUtilities/NoYield.luau | --!optimize 2
--!strict
--@native
local function ThreadHandler(thread: thread, success: boolean, ...)
if not success then
local exception = (...)
if type(exception) == "string" then
error(debug.traceback(thread, exception), 2)
else
error(tostring(exception), 2)
end
end
if coroutine.status(thread) ~= ... | 351 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/ThreadUtilities/SafeThreadCancel.luau | --!optimize 2
--!strict
local task = require("@lune/task")
--[=[
Cancelling threads can sometimes cause weird issues that throw errors. This
function is a workaround for that to make sure your threads are always
cancelled in a safe manner.
@function SafeThreadCancel
@within ThreadUtilities
@param thread threa... | 178 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/ThreadUtilities/init.luau | --!optimize 2
--!strict
local FastDefer = require("@self/FastDefer")
local FastDeferSafe = require("@self/FastDeferSafe")
local FastDelay = require("@self/FastDelay")
local FastSpawn = require("@self/FastSpawn")
local NoYield = require("@self/NoYield")
local SafeThreadCancel = require("@self/SafeThreadCancel")
--[=[
... | 167 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/TypeOf.luau | --!optimize 2
--!strict
local STRING_CASES: {[string]: string} = {
["[Enum] Requested metatable is locked"] = "Enum";
}
local function TypeOf(value: any): string
local typeOf = typeof(value)
if typeOf == "userdata" or typeOf == "table" then
local metatable = getmetatable(value)
if metatable then
if type(met... | 172 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Types/MissingTypes.luau | --!optimize 2
--!strict
local GreenTeaUtilities = require("@packages/GreenTeaUtilities")
export type PrimitiveTypes =
| "nil"
| "boolean"
| "string"
| "number"
| "table"
| "userdata"
| "function"
| "thread"
| "vector"
| "buffer"
export type CheckableTypes =
| "nil"
| "boolean"
| "string"
| "number"
| ... | 757 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Types/UtilityTypes.luau | --!optimize 2
--!strict
export type Result<O, E> = {
Success: true,
Value: O,
} | {
Success: false,
Error: E,
}
return false
| 44 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/BenchmarkCreators.luau | --!optimize 2
--!strict
local FileSystemUtilities = require("@utilities/FileSystemUtilities")
local GenerateGuid = require("@utilities/GenerateGuid")
local PathFileSystem = require("@packages/PathFileSystem")
local BenchmarkCreators = {}
local BENCHMARKS_FOLDER = PathFileSystem.CWD:join("src"):join("server"):join("b... | 1,030 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/ChalkUtilities.luau | --!optimize 2
--!strict
local Chalk = require("@packages/Chalk")
local GreenTea = require("@packages/GreenTea")
local GreenTeaAssert = require("@functions/GreenTeaAssert")
local MissingTypes = require("@types/MissingTypes")
local TypeError = require("@errors/TypeError")
local ChalkUtilities = {}
local IsUnknownRaw =... | 755 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/CodeTransformers.luau | --!optimize 2
--!strict
local LuauLexer = require("@packages/LuauLexer")
local LuauPolyfill = require("@packages/LuauPolyfill")
local String = LuauPolyfill.String
local console = LuauPolyfill.console
local CodeTransformers = {}
type ResultingValue = {
NewFileSource: string,
WasChanged: true,
} | {
WasChanged: fa... | 1,266 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/ExecuteUtilities.luau | --!optimize 2
--!strict
local Chalk = require("@packages/Chalk")
local ChalkUtilities = require("@utilities/ChalkUtilities")
local Debug = require("@packages/Debug")
local GreenTea = require("@packages/GreenTea")
local GreenTeaAssert = require("@functions/GreenTeaAssert")
local GreenTeaUtilities = require("@packages/G... | 1,527 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/FileSystemUtilities.luau | --!optimize 2
--!strict
local Debug = require("@packages/Debug")
local PathFileSystem = require("@packages/PathFileSystem")
local Path = PathFileSystem.Path
export type AsPath = PathFileSystem.AsPath
export type Contents = PathFileSystem.Contents
export type Metadata = PathFileSystem.Metadata
export type MetadataKin... | 1,112 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/FormatUtilities.luau | --!optimize 2
--!strict
local ExecuteUtilities = require("@utilities/ExecuteUtilities")
local GreenTea = require("@packages/GreenTea")
local GreenTeaAssert = require("@functions/GreenTeaAssert")
local GreenTeaUtilities = require("@packages/GreenTeaUtilities")
local LuauPolyfill = require("@packages/LuauPolyfill")
loca... | 1,258 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/GenerateGuid.luau | --!optimize 2
--!strict
local function GenerateGuid(): string
return string.format(
"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
math.random(0, 255),
math.random(0, 255),
math.random(0, 255),
math.random(0, 255),
math.random(0, 255),
math.random(0, 255),
bit32.bor(bit32.band... | 274 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/GetAverageWaitTime.luau | --!optimize 2
--!strict
local task = require("@lune/task")
local function GetAverageWaitTime(runs: number, duration: number?): number
local total = 0
for _ = 1, runs do
total += task.wait(duration)
end
return total / runs
end
return GetAverageWaitTime
| 73 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/GetProjectFile.luau | --!optimize 2
--!strict
local FileSystemUtilities = require("@utilities/FileSystemUtilities")
local Option = require("@packages/Option")
local PathFileSystem = require("@packages/PathFileSystem")
local serde = require("@lune/serde")
local Path = PathFileSystem.Path
type VsCodeSettings = {["luau-lsp.sourcemap.rojoPro... | 566 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/GetRojoLocation.luau | --!optimize 2
--!strict
local LuauPolyfill = require("@packages/LuauPolyfill")
local Option = require("@packages/Option")
local PathFileSystem = require("@packages/PathFileSystem")
local process = require("@lune/process")
local Path = PathFileSystem.Path
local String = LuauPolyfill.String
local console = LuauPolyfill... | 383 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/LuauConfigurationUtilities.luau | --!optimize 2
--!strict
local Error = require("@packages/Error")
local GreenTea = require("@packages/GreenTea")
local GreenTeaUtilities = require("@packages/GreenTeaUtilities")
local HttpPromise = require("@promises/HttpPromise")
local MissingError = require("@errors/MissingError")
local PathFileSystem = require("@pac... | 423 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/OperatingSystemUtilities.luau | --!optimize 2
--!strict
local DotEnv = require("@packages/DotEnv")
local ExecuteUtilities = require("@utilities/ExecuteUtilities")
local LuauPolyfill = require("@packages/LuauPolyfill")
local PathFileSystem = require("@packages/PathFileSystem")
local process = require("@lune/process")
DotEnv.Load()
local Boolean = Lu... | 546 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/PathUtilities.luau | --!optimize 2
--!strict
local process = require("@lune/process")
local PathUtilities = {}
local SEPARATOR = if process.os == "windows" then "\\" else "/"
PathUtilities.Separator = SEPARATOR
--- Fixes the path so that it's properly formatted to the local operating system
--- @param path The path to format
--- @return... | 542 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/ProgressBar.luau | --!optimize 2
--!strict
type ProgressOptions = {
Fill: string?,
Length: number?,
PrintEnd: string?,
PrintStart: string?,
Surrounding: string?,
}
local BAR = utf8.char(9608)
local function ProgressBar(iteration: number, total: number, options: ProgressOptions?): string
local trueOptions: ProgressOptions = if opt... | 178 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/PromptFor.luau | --!optimize 2
--!strict
local Debug = require("@packages/Debug")
local StringUtilities = require("@utilities/StringUtilities")
local stdio = require("@lune/stdio")
export type CanPromptFor = boolean | number | string
type Types = "boolean" | "number" | "string"
local CAN_PROMPT_FOR = {
boolean = true;
number = true... | 389 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/ReducedInstance.luau | --!optimize 2
--!strict
--[[
MIT License
Copyright (c) 2024 BusyCityGuy
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,... | 683 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/RobloxEnumUtilities.luau | --!optimize 2
--!strict
local GreenTea = require("@packages/GreenTea")
local GreenTeaAssert = require("@functions/GreenTeaAssert")
local GreenTeaUtilities = require("@packages/GreenTeaUtilities")
local LuauPolyfill = require("@packages/LuauPolyfill")
local TypeError = require("@errors/TypeError")
local roblox = requir... | 1,016 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/Runtime.luau | --!native
--!optimize 2
--!strict
--[[
MIT License
Copyright (c) 2024 BusyCityGuy
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 ... | 556 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/SpeedTester.luau | --!optimize 2
--!strict
local Chalk = require("@packages/Chalk")
local ProgressBar = require("@utilities/ProgressBar")
local boldGreen = Chalk.Bold .. Chalk.GreenBright
local boldRed = Chalk.Bold .. Chalk.RedBright
local boldYellow = Chalk.Ansi(33)
local blue = Chalk.Ansi256(39)
local boldBlue = Chalk.Bold .. blue
-... | 912 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/StringUtilities.luau | --!optimize 2
--!strict
local GreenTea = require("@packages/GreenTea")
local GreenTeaAssert = require("@functions/GreenTeaAssert")
local StrictTypeError = require("@errors/StrictTypeError")
local StringUtilities = {}
local IS_DEVELOPER_MODE = _G.__DEV__
local IsNumberRaw = GreenTea.number({})
local IsStringRaw = Gre... | 908 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Utilities/UniqueIdUtilities.luau | --!optimize 2
--!strict
local GreenTea = require("@packages/GreenTea")
local GreenTeaAssert = require("@functions/GreenTeaAssert")
local TypeError = require("@errors/TypeError")
local UniqueIdUtilities = {}
-- Int64 implementation for maximum speed (library slow)
local ONE = vector.create(0, 0, 1)
local ZERO = vecto... | 5,814 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/benchmarks/BenchmarkArrayIteration.luau | --!optimize 2
--!strict
local PromptFor = require("@utilities/PromptFor")
local SpeedTester = require("@utilities/SpeedTester")
local Benchmark = {}
Benchmark.ArraySize = 1E5
Benchmark.BarGraphMultiplier = 70
Benchmark.TimeThreshold = 1
Benchmark.Configure = PromptFor
function Benchmark.Run(): number
local benchma... | 268 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/benchmarks/BenchmarkRegExFind.luau | --!optimize 2
--!strict
local HttpPromise = require("@promises/HttpPromise")
local PromiseUtilities = require("@packages/PromiseUtilities")
local PromptFor = require("@utilities/PromptFor")
local RegEx = require("@lune/regex")
local SpeedTester = require("@utilities/SpeedTester")
local Benchmark = {}
Benchmark.BarGra... | 617 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/benchmarks/init.luau | --!optimize 2
--!strict
--[=[ lunar
about = "Allows you to create and run benchmarks for Lune specific code."
]=]
local GreenTea = require("@packages/GreenTea")
local LuauPolyfill = require("@packages/LuauPolyfill")
local PathFileSystem = require("@packages/PathFileSystem")
local process = require("@lune/process")
lo... | 701 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/change-file-extensions.luau | --!optimize 2
--!strict
--[=[ lunar
about = "Changes the file extensions of files in a directory."
args = "<from-extension> <to-extension> <targets...>"
]=]
local LuauPolyfill = require("@packages/LuauPolyfill")
local PathFileSystem = require("@packages/PathFileSystem")
local process = require("@lune/process")
loca... | 477 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/cleanup-gitkeep.luau | --!optimize 2
--!strict
--[=[ lunar
about = "Cleans up any .gitkeeps that we don't need anymore."
]=]
local LuauPolyfill = require("@packages/LuauPolyfill")
local PathFileSystem = require("@packages/PathFileSystem")
local Path = PathFileSystem.Path
local console = LuauPolyfill.console
local allGitKeeps: {PathFileSy... | 404 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/create-benchmark.luau | --!optimize 2
--!strict
--[=[ lunar
about = "Creates a benchmark file."
args = "[-h] [--luau] [--interp] [--init] <name>"
]=]
local ArgParse = require("@packages/ArgParse")
local BenchmarkCreators = require("@utilities/BenchmarkCreators")
local parser = ArgParse("create-benchmark", "Creates a benchmark file.")
par... | 214 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/enable-loadmodule.luau | --!optimize 2
--!strict
--[=[ lunar
about = "Enables FFlagEnableLoadModule in ClientAppSettings.json for Jest testing."
]=]
local DotEnv = require("@packages/DotEnv")
local ExecuteUtilities = require("@utilities/ExecuteUtilities")
local LuauPolyfill = require("@packages/LuauPolyfill")
local PathFileSystem = require("... | 738 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/jest-prepare.luau | --!optimize 2
--!strict
local fs = require("@lune/fs")
local process = require("@lune/process")
local serde = require("@lune/serde")
if process.env.windir ~= nil then
-- Windows
local appDataPath = process.env.LOCALAPPDATA
local robloxVersionsPath = `{appDataPath}\\Roblox\\Versions`
if not fs.isDir(robloxVersion... | 529 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/make-lune-error.luau | --!optimize 2
--!strict
local ArgParse = require("@packages/ArgParse")
local LuauPolyfill = require("@packages/LuauPolyfill")
local PathFileSystem = require("@packages/PathFileSystem")
local process = require("@lune/process")
local console = LuauPolyfill.console
local parser = ArgParse("make-lune-error", "Makes Lune... | 498 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/regenerate-enums-offline.luau | --!optimize 2
--!strict
--[=[ lunar
about = "Regenerates the Enums for our unit testing."
]=]
local FormatUtilities = require("@utilities/FormatUtilities")
local LuauPolyfill = require("@packages/LuauPolyfill")
local PathFileSystem = require("@packages/PathFileSystem")
local PromiseUtilities = require("@packages/Prom... | 1,618 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/regenerate-enums.luau | --!optimize 2
--!strict
--[=[ lunar
about = "Regenerates the Enums for our unit testing."
]=]
local ApiDumpUtilities = require("@utilities/ApiDumpUtilities")
local FormatUtilities = require("@utilities/FormatUtilities")
local GetGlobalTypesAsync = require("@promises/GetGlobalTypesAsync")
local LuauPolyfill = require(... | 1,744 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/remove-identifier.luau | --!optimize 2
--!strict
--[=[ lunar
about = "Removes zone identifier files."
args = "<targets...>"
]=]
local ArgParse = require("@packages/ArgParse")
local LuauPolyfill = require("@packages/LuauPolyfill")
local PathFileSystem = require("@packages/PathFileSystem")
local Path = PathFileSystem.Path
local console = Lua... | 265 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/run-unit-tests-local.luau | --!optimize 2
--!strict
--[=[ lunar
about = "Builds and runs the unit tests place file."
args = "[--dev] [<project>]"
]=]
local ArgParse = require("@packages/ArgParse")
local Chalk = require("@packages/Chalk")
local Enum = require("@packages/Enum")
local LuauPolyfill = require("@packages/LuauPolyfill")
local PathFil... | 2,385 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/transform-functions.luau | --!optimize 2
--!strict
--[=[ lunar
about = "Transforms the bad function declaration to the good one."
args = "[--verbose]"
]=]
local ArgParse = require("@packages/ArgParse")
local FormatUtilities = require("@utilities/FormatUtilities")
local LuauLexer = require("@packages/LuauLexer")
local LuauPolyfill = require("@... | 902 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/upload-to-roblox.luau | --!optimize 2
--!strict
local process = require("@lune/process")
local roblox = require("@lune/roblox")
local robloxCookie = roblox.getAuthCookie(true)
if not robloxCookie then
warn("Failed to get Roblox auth cookie!")
process.exit(1)
error("unreachable")
end
local result = process.exec("tarmac", {
"--auth";
st... | 141 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/luau/run-package-tests.luau | --!optimize 2
--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local StarterPlayer = game:GetService("StarterPlayer")
local TestService = game:GetService("TestService")
local Jest = (require :: any)(ReplicatedStorage.rbxts_inclu... | 369 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/packages/react-error-boundary/is-valid-element.luau | --!optimize 2
--!strict
return function(object: any)
return type(object) == "table" and object["$$typeof"] == 0xeac7
end
| 39 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/promises/catch-factory.luau | --!optimize 2
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TS = require(ReplicatedStorage:WaitForChild("rbxts_include"):WaitForChild("RuntimeLib"))
local Log = TS.import(
script,
ReplicatedStorage,
"rbxts_include",
"node_modules",
"@rbxts",
"rbxts-sleitnick-log",
"out"
).default
local l... | 312 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/promises/promise-plus/promise-all.luau | --!nonstrict
--!optimize 2
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TS = require(ReplicatedStorage:WaitForChild("rbxts_include"):WaitForChild("RuntimeLib"))
return TS.Promise.all
| 54 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/promises/promise-plus/promise-from-event.luau | --!nonstrict
--!optimize 2
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TS = require(ReplicatedStorage:WaitForChild("rbxts_include"):WaitForChild("RuntimeLib"))
local Promise = TS.Promise
local function Pack(...)
return {...}
end
local function disconnectIt(connection)
if type(connection) =... | 506 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/promises/promise-plus/tap-with-catch.luau | --!nonstrict
--!optimize 2
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TS = require(ReplicatedStorage:WaitForChild("rbxts_include"):WaitForChild("RuntimeLib"))
local Promise = TS.Promise
local ERROR_NON_FUNCTION = "Please pass a handler function to %*!"
local function isCallable(value)
if t... | 415 |
thegalaxydev/Aloha | thegalaxydev-Aloha-51c1eac/Aloha/Classes/Color3.luau | -- thegalaxydev
--[=[
@class Color3
The Color3 data type describes a color using red, green, and blue components in the range of 0 to 1.
]=]
local Color3 = {}
Color3.__index = Color3
export type Color3 = typeof(Color3) & {
R: number,
G: number,
B: number,
}
--[=[
Creates a new Color3.
@param r number
@param... | 1,134 |
thegalaxydev/Aloha | thegalaxydev-Aloha-51c1eac/Aloha/Classes/DiscordWebSocket.luau | --[=[
@class DiscordWebSocket
Class to spawn sharded websockets for Discord.
]=]
local DiscordWebSocket = {}
DiscordWebSocket.__index = DiscordWebSocket
local Event = require("./Event")
local Bot = require("../Lib/Bot")
local Task = require("../Util/Task")
local Client = require("../Lib/Client")
local Misc = require(... | 1,707 |
thegalaxydev/Aloha | thegalaxydev-Aloha-51c1eac/Aloha/Classes/Embed.luau | --[=[
@class Embed
Class to create Discord embeds.
]=]
local Embed = {}
local Color3 = require("Color3")
type Color3 = Color3.Color3
local DiscordTypes = require("../Lib/DiscordTypes")
export type Embed = {
setTitle: (title: string) -> Embed,
setDescription: (description: string) -> Embed,
setUrl: (url: string) ... | 1,598 |
thegalaxydev/Aloha | thegalaxydev-Aloha-51c1eac/Aloha/Classes/Event.luau | --[=[
@class Event
Class to create events.
]=]
local Event = {}
Event.__index = Event
Event.__class = "Event"
export type Event<T...> = {
Callbacks : {[(T...)->any]: any};
Waiting : {thread};
Connect : (Event<T...>, func : (T...)->any) -> Connection,
Fire : (Event<T...>, T...) -> nil,
Wait : (Event<T...>, numb... | 507 |
thegalaxydev/Aloha | thegalaxydev-Aloha-51c1eac/Aloha/Classes/LinkedList.luau | --[=[
@class LinkedList
A linked list implementation.
]=]
local LinkedList = {}
LinkedList.__index = function(self, key)
if type(key) == "number" then
local current = self.Head
for _ = 1, key - 1 do
if not current then return nil end
current = current.Next
end
return current
end
return LinkedList[key]
... | 1,514 |
thegalaxydev/Aloha | thegalaxydev-Aloha-51c1eac/Aloha/Classes/Snowflake.luau | --[=[
@class Snowflake
A utility class for decoding and encoding Discord snowflakes.
]=]
local Snowflake = {}
export type Snowflake = {
id: string,
timestamp: string,
workerId: string,
processId: string,
increment: string,
}
local bit64 = require('Bit64')
--[=[
@private
@param id string -- The snowflake ID... | 429 |
thegalaxydev/Aloha | thegalaxydev-Aloha-51c1eac/Aloha/Classes/Sweeper.luau | --[=[
@class Sweeper
A utility class for managing cleanup of objects and resources. Fork of Janitor by howmanysmall.
]=]
local Bot = require("../Lib/Bot")
local Task = require("../Util/Task")
local Sweeper = {}
Sweeper.__index = Sweeper
export type Sweeper = typeof(Sweeper) & {
RemoveNoClean: (index: any) -... | 683 |
thegalaxydev/Aloha | thegalaxydev-Aloha-51c1eac/Aloha/Classes/Timer.luau | --[=[
@class Timer
A utility class for managing timed callbacks.
]=]
local Timer = {}
Timer.__index = Timer
export type Timer = typeof(Timer)
--[=[
@param time number -- The total time to run in seconds
@param interval number -- The interval between callbacks in seconds
@param interval_callback ((... | 472 |
thegalaxydev/Aloha | thegalaxydev-Aloha-51c1eac/Aloha/Classes/Vector3.luau | local Vector3 = {}
Vector3.__index = Vector3
export type Vector3 = {
X: number,
Y: number,
Z: number,
Zero: () -> Vector3,
One: () -> Vector3,
}
function Vector3.new(x: number, y: number, z: number) : Vector3
local self = setmetatable({}, {
__index = Vector3,
__tostring = function(self)
return string.for... | 397 |
thegalaxydev/Aloha | thegalaxydev-Aloha-51c1eac/Aloha/Lib/Bot.luau | --[=[
@class Bot
The main Bot class that handles Discord gateway connections and core functionality.
]=]
local Bot = {}
local process = require("@lune/process")
local DiscordTypes = require("./DiscordTypes")
type WebSocket = {
Close: () -> (),
Next: () -> (any),
Send: (data: string) -> ()
}
--[=[
@prop DISCORD... | 1,481 |
thegalaxydev/Aloha | thegalaxydev-Aloha-51c1eac/Aloha/Lib/Components.luau | --[=[
@class Components
Module for handling Discord components.
]=]
local Components = {}
local DiscordTypes = require("./DiscordTypes")
local Objects = require("../Classes/Objects")
local Event = require("../Classes/Event")
local Enum = require("./Enum")
local Network = require("./Network")
type InteractionEvent = Ev... | 274 |
thegalaxydev/Aloha | thegalaxydev-Aloha-51c1eac/Aloha/Lib/Debug.luau | --[=[
@class Debug
Handles debug functionality and user permissions for debugging
]=]
local Debug = {}
local Objects = require("../Classes/Objects")
--[=[
@prop AllowedUsers {string}
@within Debug
List of user IDs that are allowed to use debug functionality
]=]
Debug.AllowedUsers = {}
--[=[
@f... | 176 |
thegalaxydev/Aloha | thegalaxydev-Aloha-51c1eac/Aloha/Util/Cache.luau | local LinkedList = require("../Classes/LinkedList")
local Cache = {
Channels = {},
Guilds = {},
Users = LinkedList.new(),
Members = LinkedList.new(),
Messages = LinkedList.new()
}
return Cache | 44 |
thegalaxydev/Aloha | thegalaxydev-Aloha-51c1eac/Aloha/Util/Mutex.luau | --[=[
@class Mutex
A mutex (mutual exclusion) implementation for coroutine synchronization. Based on SinisterRectus's implementation in Discordia.
]=]
local Task = require("../Util/Task")
local Mutex = {}
Mutex.__index = Mutex
Mutex.__len = function(self)
return self.Length
end
local LinkedList = require(".... | 468 |
thegalaxydev/Aloha | thegalaxydev-Aloha-51c1eac/Aloha/Util/Task.luau | local Task = {}
local Event = require("../Classes/Event")
local task = require("@lune/task")
function Task.Cancel(thread: thread)
task.cancel(thread)
end
function Task.Delay<T...>(duration: number, functionOrThread: ((T...) -> ...any) | thread, ...: T...) : thread
print("[Task] Delaying for ", duration, " seconds")... | 186 |
weenachuangkud/FastCast2 | weenachuangkud-FastCast2-fa722b1/src/FastCast2/BaseCast.luau | --[[
- Author : Mawin CK
- Date : 2025
-- Verison : 0.0.9
]]
-- Services
--local HTTPS = game:GetService("HttpService")
local RS = game:GetService("RunService")
-- Requires
local FastCast2 = script.Parent
local FastCastM = require(FastCast2)
local FastCastEnums = require(FastCast2:WaitForChild("FastCastEnums"))
l... | 2,440 |
weenachuangkud/FastCast2 | weenachuangkud-FastCast2-fa722b1/src/FastCast2/Configs.luau | --[[
- Author : Mawin CK
- Date : 2025
-- Verison : 0.0.3
]]
-- Haha, noob
local Configs = {}
Configs.DebugLogging = {
Casting = false,
Segment = false,
Hit = false,
RayPierce = false,
Calculation = false,
}
Configs.VisualizeCasts = true
return Configs
| 90 |
weenachuangkud/FastCast2 | weenachuangkud-FastCast2-fa722b1/src/FastCast2/DefaultConfigs.luau | --[[
- Author : Mawin_CK
- Date : 2025
-- Verison : 0.0.6
]]
--!strict
-- Requires
local TypeDefinitions = require(script.Parent.TypeDefinitions)
local FastCastEnums = require(script.Parent:WaitForChild("FastCastEnums"))
-- Defaults
local Defaults = {}
Defaults.VisualizationFolderName = "FastCastVisualizationO... | 537 |
weenachuangkud/FastCast2 | weenachuangkud-FastCast2-fa722b1/src/FastCast2/FastCastEnums.luau | --[[
- Author : Mawin CK
- Date : 2025
-- Verison : 0.0.9
]]
--!strict
--[=[
@class FastCastEnums
Enums for FastCast2.
]=]
local Enums = {}
--[=[
How High-Fidelity the cast simulation should be.
@type HighFidelityBehavior {Default, Automatic, Always}
@within FastCastEnums
]=]
Enums.HighFidelityBehavior = {
... | 143 |
weenachuangkud/FastCast2 | weenachuangkud-FastCast2-fa722b1/src/FastCast2/FastCastVMs/ClientVM.client.luau | --[[
- Author : Mawin CK
- Date : 11/03/2025
]]
-- Modules
-- REPLACE WITH ACTUAL PATH (Just use ObjectValue lol)
--local Rep = game:GetService("ReplicatedStorage")
--local FastCast2Module = Rep:WaitForChild("FastCast2")
local FastCast2Module: ModuleScript = script:WaitForChild("FastCast2").Value :: ModuleScript
... | 632 |
weenachuangkud/FastCast2 | weenachuangkud-FastCast2-fa722b1/src/FastCast2/FastCastVMs/ServerVM.server.luau | --[[
- Author : Mawin CK
- Date : 11/03/2025
]]
-- Modules
-- REPLACE WITH ACTUAL PATH (Just use ObjectValue lol)
--local Rep = game:GetService("ReplicatedStorage")
--local FastCast2Module = Rep:WaitForChild("FastCast2")
local FastCast2Module: ModuleScript = script:WaitForChild("FastCast2").Value :: ModuleScript
... | 679 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.