repo stringclasses 350
values | file_path stringlengths 29 200 | language stringclasses 2
values | file_type stringclasses 4
values | code stringlengths 2 1.01M | tokens int64 2 598k |
|---|---|---|---|---|---|
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 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/utilities/is-truly-studio.ts | roblox-ts | .ts | /// <reference types="@rbxts/types/plugin" />
//!optimize 2
import { RunService } from "@rbxts/services";
function getNetworkClient(): NetworkClient | undefined {
return game.FindService("NetworkClient") as NetworkClient | undefined;
}
function getClientReplicator(networkClient: NetworkClient): ClientReplicator | un... | 212 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/utilities/memoize.ts | roblox-ts | .ts | //!native
//!optimize 2
import { LFUCache, LRUCache } from "@rbxts/data-structures";
export function memoize<T, U>(memoizeFunction: (index: T) => U): (index: T) => U {
const cache = new Map<T, U>();
function memoized(index: T): U {
const cached = cache.get(index);
if (cached !== undefined) return cached;
co... | 337 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/modules/utilities/react/bindings.ts | roblox-ts | .ts | //!optimize 2
import { stableLerp } from "../primitives/number-utilities";
import { type Binding, createBinding, joinBindings } from "@rbxts/react";
import type { BindingOrValue } from "types/react-types";
export interface BindingApi<T> {
readonly getValue: () => T;
readonly subscribe: (callback: (newValue: T) => v... | 1,290 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/src/shared/shared-stories.storybook.ts | roblox-ts | .ts | //!optimize 2
import type { Storybook } from "@rbxts/ui-labs";
const SharedStorybook: Storybook = {
groupRoots: true,
name: "Shared",
storyRoots: [script.Parent!.FindFirstChild("__stories__")!],
};
export = SharedStorybook;
| 64 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/AndOrChains.luau | luau | .luau |
local function allTrue(p0, p1, p2, p3) --[[ line: 1 ]]
return p0 and (p1 and (p2 and p3))
end
local function anyTrue(p4, p5, p6) --[[ line: 5 ]]
return p4 or (p5 or p6)
end
local function mixed(p7, p8, p9) --[[ line: 9 ]]
return p7 > 0 and p8 < 10 and p9 ~= nil
end
local function fallback(p10, p11, p12) --[[ lin... | 212 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/BinaryOperationCF.luau | luau | .luau |
print(if IsAdmin then if HasKeycard then "ACCESS_GRANTED" elseif IsGuest then "LIMITED_ACCESS" else "NO_KEYCARD" elseif IsBanned then "BANNED" elseif 1000 <= Coins then if OwnsVIP then "VIP_PLAYER" else "RICH_PLAYER" elseif 50 <= Level then if HasBadge then "PRO_PLAYER" else "EXPERIENCED_PLAYER" else "NEW_PLAYER") | 89 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/BinaryOperationSimple.luau | luau | .luau |
local _ = x * (y + z)
local _ = (x - w) * (y + z) | 25 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/ChainedComparisons.luau | luau | .luau |
local function inRange(p0, p1, p2) --[[ line: 1 ]]
return p1 <= p0 and p0 <= p2
end
local function clamp(value, minValue, maxValue) --[[ line: 1 ]]
return if value < minValue then minValue elseif maxValue < value then maxValue else value
end
local function sign(value) --[[ line: 1 ]]
return if value > 0 then 1 el... | 146 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/ClassMethods.luau | luau | .luau |
local t = {}
t.__index = t
function t.new(p0, p1) --[[ line: 4 ]]
-- upvalues: t (ref)
local t_1 = setmetatable({}, t)
t_1.name = p0
t_1.health = p1
return t_1
end
function t:takeDamage(p2) --[[ line: 11 ]]
self.health = self.health - p2
if self.health <= 0 then
self:die()
end
end
function t:die() --[... | 240 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/Compoundops.luau | luau | .luau |
print(((10 + 5 - 3) * 2 / 4 % 3) ^ 2 .. "!") | 27 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/DeadDiscards.luau | luau | .luau |
local runService = game:GetService("RunService")
local _ = runService:IsClient()
local _ = runService:IsServer()
local v1 = runService:IsStudio()
if runService:IsServer() then
local _ = require(game:GetService("ServerScriptService"))
end
print(v1) | 63 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/FunctionMultiReturn.luau | luau | .luau |
local v0, v1 = (function(a, b, p0) --[[ line: 1 | named "minmax" ]]
return math.min(a, b, p0), math.max(a, b, p0)
end)(7, 2, 5)
print(v0, v1) | 66 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/GenericForLoop.luau | luau | .luau |
print("Hello World!")
for i, v in pairs({}) do
print(...)
break
end
print("Goodbye World!") | 28 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/GuardClauses.luau | luau | .luau |
local function damage(p0) --[[ line: 14 ]]
if p0 and p0.Health <= 0 and not p0.Dead then
p0.Dead = os.clock()
end
return p0
end
print((function(p1, p2) --[[ line: 1 | named "cached" ]]
if not p1 then
return nil
end
if p2[p1] and os.clock() < p2[p1] then
return p2[p1]
end
p2[p1] = os.clock() + 1
retur... | 142 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/LoopScopedLocals.luau | luau | .luau |
return function(p0, p1) --[[ line: 1 | named "accumulate" ]]
local v0 = 0
repeat
if not p0 then
break
end
v0 = v0 + p1.Heartbeat:Wait()
until v0 > 10
repeat
v0 = v0 + math.random()
until v0 > 20
for i = 1, 5 do
v0 = v0 + i * 2
end
return v0
end | 117 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/MethodDefinitions.luau | luau | .luau |
local t = {
setup = function(value, p0) --[[ line: 3 ]]
value.ready = p0 ~= nil
value.config = p0
end,
run = function(p1, p2) --[[ line: 8 ]]
return p1.ready and p1:transform(p2)
end,
transform = function(_, p3) --[[ line: 12 ]]
return p3 * 2
end,
static = function(p4, p5) --[[ line: 16 ]]
return p4 +... | 147 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/NestedConditions.luau | luau | .luau |
return function(p0, p1) --[[ line: 1 | named "scan" ]]
local v0 = nil
while true do
task.wait()
if not (p0 and p0:IsDescendantOf(p1)) then
break
end
local position = p0.Position
if position.Y > 0.8 then
v0 = position
else
p0.Anchored = false
end
return v0
end
end | 107 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/NestedLoops.luau | luau | .luau |
for i_1 = 1, 3 do
for i = 1, 3 do
if i == 2 then
break
end
print(i_1, i)
end
end | 48 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/NumericForLoop.luau | luau | .luau |
print("Hello World!")
for i = 1, 20 do
print(i)
if i % 2 ~= 0 then
print("i % 2 ~= 0")
print("Intermediate statement")
print("Goodbye World!")
end
end | 57 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/RecursiveFunction.luau | luau | .luau |
local function factorial(p0) --[[ line: 1 ]]
-- upvalues: factorial (ref)
return if p0 <= 1 then 1 else p0 * factorial(p0 - 1)
end
local function fibonacci(p1) --[[ line: 1 ]]
-- upvalues: fibonacci (ref)
return if p1 <= 1 then p1 else fibonacci(p1 - 1) + fibonacci(p1 - 2)
end
print(factorial(6))
print(fibonacci... | 109 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/Repeat.luau | luau | .luau |
print("Before")
repeat
x()
until condition
print("After") | 16 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/RepeatBreakContinue.luau | luau | .luau |
return function(p0, _) --[[ line: 1 | named "poll" ]]
local result, positions
local _ = nil
local _ = nil
repeat
task.wait(1)
result = workspace:FindFirstChild("Result")
positions = result and result:FindFirstChild("Positions")
until positions and positions:FindFirstChildOfClass("CFrameValue") or not (p0 an... | 96 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/TernaryChains.luau | luau | .luau |
local function grade(p0) --[[ line: 1 ]]
return if p0 >= 90 then "A" elseif p0 >= 80 then "B" elseif p0 >= 70 then "C" else "F"
end
local function pick(p1, p2, p3) --[[ line: 5 ]]
return if p3 then p1 else p2
end
local function clampScale(value) --[[ line: 10 ]]
local v3 = 47 - value
return if v3 > 0 then 0.6 ... | 155 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/WhileCondition.luau | luau | .luau |
print("Before")
while condition do
print("Body")
end
print("After") | 19 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Decompile/WhileTrue.luau | luau | .luau |
while true do
print("Body")
end | 10 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Disassembly/AndOrChains.luau | luau | .luau |
# Luau version: 9 (0x0000009)
# Types version: 3 (0x0000003)
# Magic key: 1 (0x0000001)
# Main function id: 4 (0x0000004)
# Total functions: 5 (0x0000004)
# Constants [9] (0x0000009)
[0x0000000] : goto allTrue on line 1 : type 6 [0x0000006]
[0x0000001] : goto anyTrue on line 5 : type 6 [0x0000006]
... | 3,822 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Disassembly/BinaryOperationCF.luau | luau | .luau |
# Luau version: 11 (0x000000B)
# Types version: 3 (0x0000003)
# Magic key: 1 (0x0000001)
# Main function id: 0 (0x0000000)
# Total functions: 1 (0x0000000)
# Constants [27] (0x000001B)
[0x0000000] : "IsAdmin" : type 3 [0x0000003]
[0x0000001] : IsAdmin : type 4 [0x0000004]... | 2,562 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Disassembly/BinaryOperationSimple.luau | luau | .luau |
# Luau version: 11 (0x000000B)
# Types version: 3 (0x0000003)
# Magic key: 1 (0x0000001)
# Main function id: 0 (0x0000000)
# Total functions: 1 (0x0000000)
# Constants [8] (0x0000008)
[0x0000000] : "x" : type 3 [0x0000003]
[0x0000001] : x : type 4 [0x0000004]
... | 833 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Disassembly/ChainedComparisons.luau | luau | .luau |
# Luau version: 11 (0x000000B)
# Types version: 3 (0x0000003)
# Magic key: 1 (0x0000001)
# Main function id: 3 (0x0000003)
# Total functions: 4 (0x0000003)
# Constants [5] (0x0000005)
[0x0000000] : goto inRange on line 1 : type 6 [0x0000006]
[0x0000001] : goto clamp on line 1 : type 6 [0x0000006]
... | 2,571 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Disassembly/ClassMethods.luau | luau | .luau |
# Luau version: 9 (0x0000009)
# Types version: 3 (0x0000003)
# Magic key: 1 (0x0000001)
# Main function id: 5 (0x0000005)
# Total functions: 6 (0x0000005)
# Constants [14] (0x000000E)
[0x0000000] : "__index" : type 3 [0x0000003]
[0x0000001] : goto new on line 4 : type 6 [0x0000006]
... | 4,286 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Disassembly/Compoundops.luau | luau | .luau |
# Luau version: 11 (0x000000B)
# Types version: 3 (0x0000003)
# Magic key: 1 (0x0000001)
# Main function id: 0 (0x0000000)
# Total functions: 1 (0x0000000)
# Constants [7] (0x0000007)
[0x0000000] : 5 : type 2 [0x0000002]
[0x0000001] : 3 : type 2 [0x0000002]
... | 823 |
boydev-1444/lunaux-decompiler | boydev-1444-lunaux-decompiler-ca01444/Tests/Disassembly/DeadDiscards.luau | luau | .luau |
# Luau version: 9 (0x0000009)
# Types version: 3 (0x0000003)
# Magic key: 1 (0x0000001)
# Main function id: 0 (0x0000000)
# Total functions: 1 (0x0000000)
# Constants [12] (0x000000C)
[0x0000000] : "game" : type 3 [0x0000003]
[0x0000001] : game : type 4 [0x0000004]
... | 1,513 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.