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
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/extends.luau
luau
.luau
--!optimize 2 --!strict --[[ deviation: Our constructors currently have no notion of 'super' so any such behavior in upstream JS must be implemented manually by setting fields A constructor passed to this class would typically look along the lines of: function(self, arg, otherArg) self.arg = arg self.otherArg...
294
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauPolyfill/init.luau
luau
.luau
--!optimize 2 --!strict local AssertionError = require("@self/AssertionError") local Boolean = require("@self/Boolean") local Collections = require("@self/Collections") local Console = require("@self/Console") local Error = require("@self/Error") local Math = require("@self/Math") local Number = require("@self/Number"...
428
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LunePolyfill/Utf8.luau
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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
luau
.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/client/client-stories.storybook.ts
roblox-ts
.ts
//!optimize 2 import type { Storybook } from "@rbxts/ui-labs"; const ClientStorybook: Storybook = { groupRoots: true, name: "Client", storyRoots: [script.Parent!.FindFirstChild("__stories__")!], }; export = ClientStorybook;
64
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/client/jest.config.ts
roblox-ts
.ts
import type { Config } from "@rbxts/jest"; export = { displayName: "🔵 CLIENT", testMatch: ["**/__tests__/*.test"], } satisfies Config;
40
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/server/jest.config.ts
roblox-ts
.ts
import type { Config } from "@rbxts/jest"; export = { displayName: "🟢 SERVER", testMatch: ["**/__tests__/*.test"], } satisfies Config;
40
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/server/server-stories.storybook.ts
roblox-ts
.ts
//!optimize 2 import type { Storybook } from "@rbxts/ui-labs"; const ServerStorybook: Storybook = { groupRoots: true, name: "Server", storyRoots: [script.Parent!.FindFirstChild("__stories__")!], }; export = ServerStorybook;
64
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/jest.config.ts
roblox-ts
.ts
import type { Config } from "@rbxts/jest"; export = { displayName: "⚪️ SHARED", testMatch: ["**/__tests__/*.test"], } satisfies Config;
42
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/components/apps/base-app.tsx
roblox-ts
.tsx
//!optimize 2 import ForcedPlatformProvider from "../providers/forced-platform-provider"; import ContextStack from "@rbxts/context-stack"; import React, { StrictMode, useMemo } from "@rbxts/react"; import { RunService } from "@rbxts/services"; import type DevicePlatform from "shared/modules/meta/device-platform"; impo...
369
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/components/fallback-reset-boundary.tsx
roblox-ts
.tsx
//!optimize 2 import { useErrorBoundary } from "../packages/react-error-boundary"; import React, { useEffect } from "@rbxts/react"; export function FallbackResetBoundaryNoMemo(): React.Element { const { resetBoundary } = useErrorBoundary(); function resetEffect() { resetBoundary(); } useEffect(resetEffect, [re...
113
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/components/providers/forced-platform-provider.tsx
roblox-ts
.tsx
//!optimize 2 import React from "@rbxts/react"; import ForcedPlatformContext from "shared/modules/contexts/forced-platform-context"; import type DevicePlatform from "shared/modules/meta/device-platform"; export interface ForcedPlatformProviderProperties extends React.PropsWithChildren { readonly forcedPlatform?: Dev...
162
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/components/utilities/portal.tsx
roblox-ts
.tsx
//!optimize 2 import React from "@rbxts/react"; import { createPortal } from "@rbxts/react-roblox"; export interface PortalProperties extends React.PropsWithChildren { readonly target: Instance; } export function PortalNoMemo({ children, target }: PortalProperties): React.Element { return createPortal(children, ta...
92
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/contexts/forced-platform-context.ts
roblox-ts
.ts
//!optimize 2 import type DevicePlatform from "../meta/device-platform"; import { createContext } from "@rbxts/react"; export const ForcedPlatformContext = createContext<DevicePlatform | undefined>(undefined); ForcedPlatformContext.displayName = "ForcedPlatformContext"; export default ForcedPlatformContext;
59
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/hooks/contexts/use-forced-platform.ts
roblox-ts
.ts
//!optimize 2 import { useContext } from "@rbxts/react"; import ForcedPlatformContext from "shared/modules/contexts/forced-platform-context"; import type DevicePlatform from "shared/modules/meta/device-platform"; export default function useForcedPlatform(): DevicePlatform | undefined { return useContext(ForcedPlatfo...
65
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/hooks/utilities/use-device-platform.ts
roblox-ts
.ts
//!optimize 2 import useForcedPlatform from "../contexts/use-forced-platform"; import { type Binding, useBinding } from "@rbxts/react"; import { useEventConnection } from "@rbxts/react-hooks"; import { UserInputService } from "@rbxts/services"; import type DevicePlatform from "shared/modules/meta/device-platform"; imp...
262
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/hooks/utilities/use-scale-platform.ts
roblox-ts
.ts
//!optimize 2 import useDevicePlatform from "./use-device-platform"; import { type Binding, joinBindings } from "@rbxts/react"; import { useViewportSize } from "@rbxts/react-hooks"; import { GuiService } from "@rbxts/services"; import DevicePlatform from "shared/modules/meta/device-platform"; const [TOP_LEFT, BOTTOM_...
244
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/hooks/utilities/use-standard-scale.ts
roblox-ts
.ts
//!optimize 2 import useScalePlatform from "./use-scale-platform"; import type { Binding } from "@rbxts/react"; import DevicePlatform from "shared/modules/meta/device-platform"; export type ModifyWith = { readonly [devicePlatform in DevicePlatform]?: number }; export default function useStandardScale(modifyWith?: Mo...
145
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/log-config.ts
roblox-ts
.ts
import type { LogConfig } from "@rbxts/rbxts-sleitnick-log"; const logConfiguration: LogConfig = { Default: "Warning", Development: { Client: "Warning", PlaceIds: [], Server: "Warning", }, Studio: "Debug", }; export = logConfiguration;
70
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/packages/react-error-boundary/assert-error-boundary-context.ts
roblox-ts
.ts
//!optimize 2 import type { ErrorBoundaryContextType } from "./error-boundary-context"; import { t } from "@rbxts/t"; const isErrorBoundaryContext = t.interface({ didCatch: t.boolean, resetErrorBoundary: t.callback, }) as t.check<ErrorBoundaryContextType>; export function assertErrorBoundaryContext(value: unknown)...
103
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/packages/react-error-boundary/error-boundary-context.ts
roblox-ts
.ts
//!optimize 2 import React from "@rbxts/react"; export interface ErrorBoundaryContextType { readonly didCatch: boolean; readonly error: unknown; readonly resetErrorBoundary: Callback; } export const ErrorBoundaryContext = React.createContext<ErrorBoundaryContextType | undefined>(undefined); export default ErrorBo...
68
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/packages/react-error-boundary/is-valid-element.luau
luau
.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/packages/react-error-boundary/packages.ts
roblox-ts
.ts
//!optimize 2 /* eslint-disable unicorn/prefer-export-from */ import LuauPolyfill from "@rbxts/luau-polyfill"; import ReactPackage from "@rbxts/react"; export const React = ReactPackage; export { LuauPolyfill };
55
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/promises/catch-factory.luau
luau
.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
luau
.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
luau
.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
luau
.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
howmanysmall/modern-roblox-ts-template
howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/utilities/device-utilities.ts
roblox-ts
.ts
//!optimize 2 import DevicePlatform from "../meta/device-platform"; import { GuiService, UserInputService, Workspace } from "@rbxts/services"; const [TOP_LEFT, BOTTOM_RIGHT] = GuiService.GetGuiInset(); export function getViewportSize(): Vector2 { const currentCamera = Workspace.CurrentCamera; return currentCamera?...
232