repo stringclasses 341
values | file_path stringlengths 29 173 | language stringclasses 2
values | file_type stringclasses 4
values | code stringlengths 2 1.66M | tokens int64 2 598k |
|---|---|---|---|---|---|
featherfall-org/quill | featherfall-org-quill-468a0ee/crates/logger/init.luau | luau | .luau | local lib = require("@self/lib")
export type Level = lib.Level
export type Event = lib.Event
export type Logger = lib.Logger
return lib
| 32 |
featherfall-org/quill | featherfall-org-quill-468a0ee/crates/logger/lib/init.luau | luau | .luau | local pretty_print = require("@self/pretty_print")
export type Level = "trace" | "debug" | "info" | "warn" | "error" | "fatal"
export type Event = {
timestamp: number,
level: Level,
message: string,
logger: string,
context: { [string]: any }?,
}
export type Logger = {
--- The logger's identifie... | 1,619 |
featherfall-org/quill | featherfall-org-quill-468a0ee/crates/rblx_components/crate.luau | luau | .luau | local CrateConfig = require("@mgr/specifiers/CrateConfig")
return CrateConfig {
name = "rblx_components",
description = "A simple components system for Quill",
version = "0.1.0-alpha.2",
lib = "lib",
targets = {
roblox = true,
},
workspace_dependencies = {
core = true,
... | 82 |
featherfall-org/quill | featherfall-org-quill-468a0ee/crates/rblx_components/init.luau | luau | .luau | local lib = require("@self/lib")
export type ComponentInfo<T> = lib.ComponentInfo<T>
export type CreationData<T> = lib.CreationData<T>
return lib
| 36 |
featherfall-org/quill | featherfall-org-quill-468a0ee/crates/rblx_components/lib/constructors.luau | luau | .luau | --# selene: allow(undefined_variable)
local rblx_types = require("./rblx_types")
type luau_vector = vector
type rbx_vector2 = Vector2
type rbx_vector3 = Vector3
type rbx_udim = UDim
type rbx_udim2 = UDim2
type rbx_brickcolor = BrickColor
type rbx_color3 = Color3
type rbx_cframe = CFrame
type rbx_numbersequence = Numbe... | 2,103 |
featherfall-org/quill | featherfall-org-quill-468a0ee/crates/rblx_components/lib/init.luau | luau | .luau | --# selene: allow(undefined_variable)
local CollectionService = game:GetService("CollectionService")
local constructors = require("@self/constructors")
local core = require("@crates/core")
local rblx_types = require("@self/rblx_types")
export type ComponentInfo<T> = constructors.ComponentInfo<T>
type TypeOfKind<Kind> ... | 1,712 |
featherfall-org/quill | featherfall-org-quill-468a0ee/crates/rblx_lifecycles/crate.luau | luau | .luau | local CrateConfig = require("@mgr/specifiers/CrateConfig")
return CrateConfig {
name = "rblx_lifecycles",
description = "A collection of Quill lifecycles for Roblox",
version = "0.1.0-alpha.1",
lib = "lib",
targets = {
roblox = true,
},
workspace_dependencies = {
core = tr... | 89 |
featherfall-org/quill | featherfall-org-quill-468a0ee/crates/rblx_lifecycles/init.luau | luau | .luau | local lib = require("@self/lib")
return lib
| 11 |
featherfall-org/quill | featherfall-org-quill-468a0ee/crates/rblx_lifecycles/lib/init.luau | luau | .luau | local RunService = game:GetService("RunService")
local core = require("@crates/core")
local CLIENT_LIFECYCLES = {
on_heartbeat = RunService.Heartbeat,
on_post_simulation = RunService.PostSimulation,
on_pre_animation = RunService.PreAnimation,
on_pre_render = RunService.PreRender,
on_pre_simulation ... | 653 |
featherfall-org/quill | featherfall-org-quill-468a0ee/mgr/build/alias_resolver.luau | luau | .luau | local fs = zune.fs
local stdpath = fs.path
export type FsFileNode = {
name: string,
kind: "file",
parent: FsDirNode?,
}
export type FsDirNode = {
name: string,
kind: "dir",
parent: FsDirNode?,
children: { [string]: FsNode },
}
export type FsNode = FsFileNode | FsDirNode
local function bu... | 1,774 |
featherfall-org/quill | featherfall-org-quill-468a0ee/mgr/build/builders/pesde.luau | luau | .luau | local fs = zune.fs
local stdpath = fs.path
local toml = zune.serde.toml
local CrateConfig = require("@mgr/specifiers/CrateConfig")
local RootConfig = require("@mgr/specifiers/RootConfig")
local alias_resolver = require("@mgr/build/alias_resolver")
local ansi = require("@mgr/util/ansi")
local dynrequire = require("@mgr/... | 1,580 |
featherfall-org/quill | featherfall-org-quill-468a0ee/mgr/build/init.luau | luau | .luau | local RootConfig = require("@mgr/specifiers/RootConfig")
local build_pesde = require("@self/builders/pesde")
local build_wally = require("@self/builders/wally")
local function build(options: {
dir: string,
crates: { string },
package_managers: { string },
targets: { string },
output: string,
ro... | 203 |
featherfall-org/quill | featherfall-org-quill-468a0ee/mgr/dynrequire.luau | luau | .luau | local luau = zune.luau
local fs = zune.fs
local cache = {}
local function dynrequire<T>(path: string): T
local hit = cache[path]
if hit then
return hit :: T
end
local contents = fs.readFile(path)
local bytecode = luau.compile(contents, { optimization_level = 2 })
local result = luau.lo... | 110 |
featherfall-org/quill | featherfall-org-quill-468a0ee/mgr/init.luau | luau | .luau | local CrateConfig = require("@mgr/specifiers/CrateConfig")
local RootConfig = require("@mgr/specifiers/RootConfig")
local dynrequire = require("@self/dynrequire")
local frkcli = require("@self/vendor/frkcli")
local process = zune.process
local fs = zune.fs
local fs_util = require("@self/util/fs")
local root_config = r... | 1,647 |
featherfall-org/quill | featherfall-org-quill-468a0ee/mgr/publish.luau | luau | .luau | local fs = zune.fs
local stdpath = fs.path
local CrateConfig = require("@mgr/specifiers/CrateConfig")
local Process = require("./util/Process")
local ansi = require("./util/ansi")
local dynrequire = require("./dynrequire")
type Array<T> = { T }
type Map<K, V> = { [K]: V }
type Graph<T> = Map<T, Array<T>>
-- Based on K... | 1,036 |
featherfall-org/quill | featherfall-org-quill-468a0ee/mgr/specifiers/CrateConfig.luau | luau | .luau | export type WorkspaceCrate =
| "core"
| "dependencies"
| "logger"
| "rblx_components"
| "rblx_lifecycles"
export type PesdePackageVariant = {
name: string,
version: string,
}
export type WallyPackageVariant = {
name: string,
version: string,
}
export type DependencySpecifier = {
... | 198 |
featherfall-org/quill | featherfall-org-quill-468a0ee/mgr/specifiers/RootConfig.luau | luau | .luau | export type PackageManagerConfig = {
scope: string,
--- `{scope}/{root_name}_{crate_name}`, defaults to `RootConfig.name`
root_name: string?,
registry: string,
}
export type RootConfig = {
name: string,
crates: string,
repository: string,
homepage: string,
authors: { string },
... | 121 |
featherfall-org/quill | featherfall-org-quill-468a0ee/mgr/util/Process.luau | luau | .luau | local process = zune.process
local task = zune.task
local Process = {}
local mt = { __index = Process }
type Properties = {
command: string,
args: { string },
options: ProcessOptions,
}
export type Identity = setmetatable<Properties, typeof(mt)>
local function constructor(command: string): Identity
l... | 341 |
featherfall-org/quill | featherfall-org-quill-468a0ee/mgr/util/fs.luau | luau | .luau | local fs = zune.fs
local stdpath = fs.path
local task = zune.task
local process = zune.process
local function exists(path: string): boolean
return fs.stat(path).kind ~= "none"
end
local function is_dir(path: string): boolean
return fs.stat(path).kind == "directory"
end
local function ensure_dirs(dirs: { stri... | 770 |
featherfall-org/quill | featherfall-org-quill-468a0ee/mgr/util/syntax/parser.luau | luau | .luau | local luau = zune.luau
local ast_types = require("./types")
local function parseBlock(source: string | buffer): ast_types.AstStatBlock
return (luau.parse(source) :: any).root
end
local function parseExpr(source: string | buffer): ast_types.AstExpr
return luau.parseExpr(source)
end
local function parse(source... | 130 |
featherfall-org/quill | featherfall-org-quill-468a0ee/mgr/util/syntax/typeforge.luau | luau | .luau | export type function extend(base: type, superset: type): type
assert(base:is("table") and superset:is("table"))
local extended = types.newtable()
for key, value in base:properties() do
if value.read and value.write then
extended:setproperty(key, value.read)
continue
... | 196 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Classes/Errors/MissingError.luau | luau | .luau | --!optimize 2
--!strict
local Error = require("@packages/Error")
export type MissingError = {
name: "MissingError",
message: string,
stack: string?,
}
type Static = typeof(Error) & {
new: (message: string) -> MissingError,
}
local MissingError: MissingError & Static = setmetatable({}, {__index = Error}) :: any
(... | 214 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Classes/Errors/StrictTypeError.luau | luau | .luau | --!optimize 2
--!strict
local Error = require("@packages/Error")
export type StrictTypeError = {
name: "StrictTypeError",
message: string,
stack: string?,
}
type Static = typeof(Error) & {
new: (message: string) -> StrictTypeError,
}
local StrictTypeError: StrictTypeError & Static = setmetatable({}, {__index = E... | 214 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Classes/Errors/TypeError.luau | luau | .luau | --!optimize 2
--!strict
local Error = require("@packages/Error")
export type TypeError = {
name: "TypeError",
message: string,
stack: string?,
}
type Static = typeof(Error) & {
new: (message: string) -> TypeError,
}
local TypeError: TypeError & Static = setmetatable({}, {__index = Error}) :: any;
(TypeError :: a... | 197 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Classes/FileInstance.luau | luau | .luau | --!optimize 2
--!strict
local PathFileSystem = require("@packages/PathFileSystem")
local PathUtilities = require("@utilities/PathUtilities")
local process = require("@lune/process")
export type FileInstance = {
FilePath: string,
IsDirectory: boolean,
Name: string,
Parent: FileInstance?,
GetChildren: (self: File... | 1,272 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Classes/LRUCache.luau | luau | .luau | --!optimize 2
--!strict
local GreenTea = require("@packages/GreenTea")
local LuauPolyfill = require("@packages/LuauPolyfill")
local Error = LuauPolyfill.Error
type Node<K, V> = {
Key: K,
Next: Node<K, V>?,
Previous: Node<K, V>?,
Value: V,
}
export type LRUCache<K, V> = typeof(setmetatable(
{} :: {
Capacity: ... | 2,934 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/BrickColor/Colors.luau | luau | .luau | --!optimize 2
--!strict
local Color3 = require("@contexts/Color3")
local SortedArray = require("@packages/SortedArray")
export type Color3 = Color3.PolyfillColor3
export type ColorData = {
Color3: Color3,
Name: string,
Number: number,
}
local function DeepCopy<T>(object: T): T
local new = table.clone(object :: n... | 7,698 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/BrickColor/init.luau | luau | .luau | --!optimize 2
--!strict
local Color3 = require("@contexts/Color3")
local LuauPolyfill = require("@packages/LuauPolyfill")
local TypeOf = require("@packages/TypeOf")
local Colors = require("@self/Colors")
local Error = LuauPolyfill.Error
local ColorData = Colors.ColorData
local SortedByName = Colors.SortedByName
loc... | 1,499 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/Color3.luau | luau | .luau | --!optimize 2
--!strict
export type PolyfillColor3 = {
R: number,
G: number,
B: number,
Lerp: (self: PolyfillColor3, color: PolyfillColor3, alpha: number) -> PolyfillColor3,
ToHSV: (self: PolyfillColor3) -> (number, number, number),
ToHex: (self: PolyfillColor3) -> string,
r: number,
g: number,
b: number,
}... | 1,540 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/DateTime.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,... | 399 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/Debug.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,... | 434 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/Instance/Signal/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... | 184 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/Instance/Signal/IsDeferred.luau | luau | .luau | --!optimize 2
--!strict
local cached: boolean = nil
local function IsDeferred(): boolean
if cached ~= nil then
return cached
end
local success, value = pcall(function()
return game:GetService("Workspace").SignalBehavior.Name == "Deferred"
end)
if not success then
cached = false
return cached
end
cac... | 95 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/Instance/init.luau | luau | .luau | --!optimize 2
--!strict
local Signal = require("@self/Signal")
local roblox = require("@lune/roblox")
local roblox_Instance_new = roblox.Instance.new
local Instance = setmetatable({
new = function(className: string, parent: roblox.Instance?)
if className == "BindableEvent" then
return Signal.new()
end
ret... | 103 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/NumberRange.luau | luau | .luau | --!optimize 2
--!strict
type Metatable = {
__eq: (self: PolyfillNumberRange, other: PolyfillNumberRange) -> boolean,
__tostring: (self: PolyfillNumberRange) -> string,
__type: "NumberRange",
}
export type PolyfillNumberRange = typeof(setmetatable({} :: {Max: number, Min: number}, {} :: Metatable))
type Static = {ne... | 429 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/Random.luau | luau | .luau | --!optimize 2
--!strict
export type PolyfillRandom = {
NextInteger: (self: PolyfillRandom, minimum: number, maximum: number) -> number,
NextNumber: ((self: PolyfillRandom, minimum: number, maximum: number) -> number)
& ((self: PolyfillRandom) -> number),
Shuffle: (self: PolyfillRandom, array: {any}) -> (),
}
type... | 334 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/RaycastParams.luau | luau | .luau | --!optimize 2
--!strict
local RaycastParams = {}
RaycastParams.__index = RaycastParams
RaycastParams.__type = "RaycastParams"
function RaycastParams.new()
return setmetatable({}, RaycastParams)
end
return table.freeze(RaycastParams)
| 60 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/Unimplemented/Axes.luau | luau | .luau | --!optimize 2
--!strict
type Metatable = {
__eq: (self: PolyfillAxes, other: PolyfillAxes) -> boolean,
__tostring: (self: PolyfillAxes) -> string,
__type: "Axes",
}
export type PolyfillAxes = typeof(setmetatable({} :: {}, {} :: Metatable))
type Static = {new: ((value: number) -> PolyfillAxes) & ((...any) -> Polyfil... | 200 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/Unimplemented/CatalogSearchParams.luau | luau | .luau | --!optimize 2
--!strict
type Metatable = {
__eq: (self: PolyfillCatalogSearchParams, other: PolyfillCatalogSearchParams) -> boolean,
__tostring: (self: PolyfillCatalogSearchParams) -> string,
__type: "CatalogSearchParams",
}
export type PolyfillCatalogSearchParams = typeof(setmetatable({} :: {}, {} :: Metatable))
t... | 213 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/Unimplemented/ColorSequence.luau | luau | .luau | --!optimize 2
--!strict
type Metatable = {
__eq: (self: PolyfillColorSequence, other: PolyfillColorSequence) -> boolean,
__tostring: (self: PolyfillColorSequence) -> string,
__type: "ColorSequence",
}
export type PolyfillColorSequence = typeof(setmetatable({} :: {}, {} :: Metatable))
type Static = {new: ((value: nu... | 212 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/Unimplemented/Faces.luau | luau | .luau | --!optimize 2
--!strict
type Metatable = {
__eq: (self: PolyfillFaces, other: PolyfillFaces) -> boolean,
__tostring: (self: PolyfillFaces) -> string,
__type: "Faces",
}
export type PolyfillFaces = typeof(setmetatable({} :: {}, {} :: Metatable))
type Static = {new: ((value: number) -> PolyfillFaces) & ((...any) -> P... | 200 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/Unimplemented/NumberSequence.luau | luau | .luau | --!optimize 2
--!strict
type Metatable = {
__eq: (self: PolyfillNumberSequence, other: PolyfillNumberSequence) -> boolean,
__tostring: (self: PolyfillNumberSequence) -> string,
__type: "NumberSequence",
}
export type PolyfillNumberSequence = typeof(setmetatable({} :: {}, {} :: Metatable))
type Static = {new: ((valu... | 212 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/Unimplemented/OverlapParams.luau | luau | .luau | --!optimize 2
--!strict
type Metatable = {
__eq: (self: PolyfillOverlapParams, other: PolyfillOverlapParams) -> boolean,
__tostring: (self: PolyfillOverlapParams) -> string,
__type: "OverlapParams",
}
export type PolyfillOverlapParams = typeof(setmetatable({} :: {}, {} :: Metatable))
type Static = {new: ((value: nu... | 215 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/Unimplemented/Path2DControlPoint.luau | luau | .luau | --!optimize 2
--!strict
type Metatable = {
__eq: (self: PolyfillPath2DControlPoint, other: PolyfillPath2DControlPoint) -> boolean,
__tostring: (self: PolyfillPath2DControlPoint) -> string,
__type: "Path2DControlPoint",
}
export type PolyfillPath2DControlPoint = typeof(setmetatable({} :: {}, {} :: Metatable))
type S... | 254 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/Unimplemented/PhysicalProperties.luau | luau | .luau | --!optimize 2
--!strict
type Metatable = {
__eq: (self: PolyfillPhysicalProperties, other: PolyfillPhysicalProperties) -> boolean,
__tostring: (self: PolyfillPhysicalProperties) -> string,
__type: "PhysicalProperties",
}
export type PolyfillPhysicalProperties = typeof(setmetatable({} :: {}, {} :: Metatable))
type S... | 213 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/Utf8.luau | luau | .luau | --!optimize 2
--!strict
local LunePolyfill = require("@packages/LunePolyfill")
local Utf8 = setmetatable({
graphemes = LunePolyfill.Utf8.Graphemes;
}, {__index = utf8})
return Utf8
| 56 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Contexts/Vector3.luau | luau | .luau | --!optimize 2
--!strict
local Enum = require("@packages/Enum")
export type PolyfillVector3 = typeof(setmetatable(
{} :: {
X: number,
Y: number,
Z: number,
Magnitude: number,
Unit: PolyfillVector3,
Dot: (self: PolyfillVector3, other: PolyfillVector3) -> number,
Cross: (self: PolyfillVector3, other: Po... | 2,369 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Functions/GetArguments.luau | luau | .luau | --!optimize 2
--!strict
local process = require("@lune/process")
local function GetArguments(): {string}
local arguments = process.args
local fixedArguments = table.create(#arguments - 1)
local length = 0
for index, value in arguments do
if index == 0 then
continue
end
length += 1
fixedArguments[len... | 100 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Functions/GetAuthenticationCookie.luau | luau | .luau | --!optimize 2
--!strict
local DotEnv = require("@packages/DotEnv")
local ExecuteUtilities = require("@utilities/ExecuteUtilities")
local process = require("@lune/process")
local roblox = require("@lune/roblox")
DotEnv.Load()
local function GetAuthenticationCookie(raw: boolean?): string?
if raw then
local fromApi =... | 248 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Functions/GreenTeaAssert.luau | luau | .luau | --!optimize 2
--!strict
local Error = require("@packages/Error")
local GreenTea = require("@packages/GreenTea")
export type Type = GreenTea.Type
export type ErrorLike = {
name: string,
message: string,
stack: string?,
[any]: any,
}
export type ErrorClassLike = typeof(setmetatable(
{} :: {
new: (message: string... | 227 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Functions/RefreshVsCodeTasks.luau | luau | .luau | --!optimize 2
--!strict
local Error = require("@packages/Error")
local ExecuteUtilities = require("@utilities/ExecuteUtilities")
local GreenTea = require("@packages/GreenTea")
local GreenTeaAssert = require("@functions/GreenTeaAssert")
local GreenTeaUtilities = require("@packages/GreenTeaUtilities")
local LuauPolyfill... | 1,820 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/Debug.luau | luau | .luau | --!optimize 2
--!strict
local TypeOf = require("@packages/TypeOf")
local Debug = {}
local TAB = "\t"
type GenericDictionary = {[string]: any}
type GenericTable = {[any]: any}
local Inspect: (...unknown) -> string
local REPLACERS = {
["Index ?"] = "__index";
["Newindex ?"] = "__newindex";
}
local function GetErr... | 2,331 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/DotEnv.luau | luau | .luau | --!optimize 2
--!strict
local LuauPolyfill = require("@packages/LuauPolyfill")
local PathFileSystem = require("@packages/PathFileSystem")
local RegEx = require("@lune/regex")
local process = require("@lune/process")
local Array = LuauPolyfill.Array
local Boolean = LuauPolyfill.Boolean.toJSBoolean
local String = LuauP... | 673 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/ES7Types.luau | luau | .luau | --!optimize 2
--!strict
export type Object = {[string]: any}
export type Array<T> = {[number]: T}
export type Function = (...any) -> ...any
export type Table<T, V> = {[T]: V}
export type Tuple<T, V> = Array<T | V>
export type mapCallbackFn<K, V> = (element: V, key: K, map: Map<K, V>) -> ()
export type mapCallbackFnWit... | 833 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/Enum/CreateInRoblox.luau | luau | .luau | --!native
--!optimize 2
--!strict
local ScriptEditorService = game:GetService("ScriptEditorService")
local Workspace = game:GetService("Workspace")
local function CreateItemType(enumName: string, enumNames: {string}): string
local stringBuilder = table.create(#enumNames)
for index, enumValue in enumNames do
strin... | 1,458 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/Enum/Enum.luau | luau | .luau | --!nonstrict
--!optimize 2
local Debug = require("@packages/Debug")
local GreenTea = require("@packages/GreenTea")
local SortedArray = require("@packages/SortedArray")
local ErrorIndex = {}
function ErrorIndex:__index(index)
Debug.Error(`{index} is not a valid EnumItem`)
end
local ErrorIndex2 = {}
function ErrorInd... | 1,001 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/Enumeration/Enumeration.luau | luau | .luau | --!nonstrict
--!optimize 2
local Debug = require("@packages/Debug")
local GreenTea = require("@packages/GreenTea")
local SortedArray = require("@packages/SortedArray")
local ErrorIndex = {}
function ErrorIndex:__index(index)
Debug.Error(`{index} is not a valid EnumerationItem`)
end
local ErrorIndex2 = {}
function E... | 1,028 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/Enumeration/init.luau | luau | .luau | --!nonstrict
--!optimize 2
local Enumeration = require("@self/Enumeration")
type SimpleResult<T, E> = {
Success: true,
Value: T,
} | {
Success: false,
Error: E,
}
type EnumerationItem<Value, Type, Name = string> = {
EnumerationType: Type,
Name: Name,
Value: Value,
}
type EnumerationObject<Values, ArrayValues>... | 333 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/Error.luau | luau | .luau | --!optimize 2
--!strict
type Function = (...any) -> ...any
--[=[
A JavaScript-style error object.
```lua
local function UsingConstructor()
-- You can use `Error.new`.
error(Error.new("Something went wrong!"))
end
local function UsingCall()
-- It supports `__call`.
error(Error("Something went wrong!"))
... | 1,224 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/Fmt/CreateFormatter.luau | luau | .luau | --!optimize 2
--!strict
local Types = require("./Types")
local WriteFmt = require("./WriteFmt")
local INDENTATION = " "
local repeatCache: {[string]: {[number]: string}} = {}
local function StringRep(value: string, count: number)
local cache = repeatCache[value]
if not cache then
cache = {}
repeatCache[value... | 745 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/Fmt/Types.luau | luau | .luau | --!optimize 2
--!strict
export type Formatter =
& ((method: "AsString") -> string)
& ((method: "AsTuple") -> ...unknown)
& ((method: "AddTable", object: unknown) -> ())
& ((method: "Lock") -> ())
& ((method: "Unlock") -> ())
& ((method: "AddToBuffer", value: unknown) -> ())
& ((method: "Indent") -> ())
& ((met... | 194 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/Fmt/WriteFmt.luau | luau | .luau | --!optimize 2
--!strict
local LuauPolyfill = require("@packages/LuauPolyfill")
local Types = require("./Types")
local Error = LuauPolyfill.Error
type Formatter = Types.Formatter
local repeatCache: {[string]: {[number]: string}} = {}
local function StringRep(value: string, count: number)
local cache = repeatCache[v... | 2,442 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/Fmt/__tests__/Fmt.spek.luau | luau | .luau | --!optimize 2
--!strict
local Fmt = require("@packages/Fmt")
local Spek = require("@packages/Spek")
return function(t: Spek.T)
local describe = t.describe
local expect = t.expect
local expectError = t.expectError
local it = t.it
local measure = t.measure
local operation = t.operation
describe("Fmt")(function(... | 2,255 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/Fmt/init.luau | luau | .luau | --!optimize 2
--!strict
local CreateFormatter = require("@self/CreateFormatter")
type Static = typeof(setmetatable(
{} :: {
CreateFormatter: typeof(CreateFormatter),
Debugify: <T>(object: T, fmtFunction: (object: T, ...unknown) -> unknown) -> {[any]: any},
Fmt: (templateString: string, ...unknown) -> string,
... | 800 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/GreenTea/init.luau | luau | .luau | --!optimize 2
--!strict
local GreenTea = require("@self/GreenTea")
local tCompat = require("@self/tCompat")
export type Cause = GreenTea.Cause
export type Type = GreenTea.Type
export type TuplePacked<T...> = GreenTea.TuplePacked<T...>
local export = {}
export.t = tCompat
export.isGreenTeaType = GreenTea.isGreenTea... | 789 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/GreenTea/tCompat.luau | luau | .luau | --!optimize 2
--!strict
local GreenTea = require("./GreenTea")
local t = {}
type Typechecker = (...any) -> (boolean, any?)
type TypecheckerConstr<T... = ()> = (T...) -> Typechecker
local function asPlainFn(fn: (...any) -> ...any): Typechecker
return function()
return fn()
end
end
local function asGreenTeaType... | 1,879 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/GreenTeaUtilities.luau | luau | .luau | --!optimize 2
--!strict
local DateTime = require("@lune/DateTime")
local Debug = require("@packages/Debug")
local Error = require("@packages/Error")
local GreenTea = require("@packages/GreenTea")
local LuauPolyfill = require("@packages/LuauPolyfill")
local TypeError = require("@errors/TypeError")
local instanceof = L... | 4,398 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/InstanceOf.luau | luau | .luau | --!optimize 2
--!strict
-- polyfill for https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof
local __DEV__ = _G.__DEV__
-- FIXME Luau: typing class as Object gives: Type '{ @metatable {| __call: <a>(a, ...any) -> Error, __tostring: <b, c>({+ message: b, name: c +}) -> string |}, Erro... | 360 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/Int64.luau | luau | .luau | --!optimize 2
--!strict
-- stylua: ignore
local HEX_TO_BINARY = {
["0"] = "0000", ["1"] = "0001", ["2"] = "0010", ["3"] = "0011",
["4"] = "0100", ["5"] = "0101", ["6"] = "0110", ["7"] = "0111",
["8"] = "1000", ["9"] = "1001", ["a"] = "1010", ["b"] = "1011",
["c"] = "1100", ["d"] = "1101", ["e"] = "1110... | 7,084 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/None.luau | luau | .luau | local None = table.freeze(setmetatable({}, {
__index = function()
error("attempt to index on None symbol")
end;
__tostring = function()
return "<None>"
end;
}))
return None
| 45 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/WeakMap.luau | luau | .luau | local WEAK_KEYS_METATABLE = {__mode = "k"}
local function WeakMap<K, V>(default: {[K]: V}?): {[K]: V}
local value = default or {}
return setmetatable(value :: any, WEAK_KEYS_METATABLE) :: any
end
return WeakMap
| 65 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/all.luau | luau | .luau | local function all<T>(array: {T}, predicate: (element: T, index: number) -> boolean): boolean
for index, element in array do
if not predicate(element, index) then
return false
end
end
return true
end
return all
| 61 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/alternate.luau | luau | .luau | local reduce = require("./reduce")
local function alternate<T, U>(array: {T}, ...: {U}): {any}
local alternateWith = {...}
if #alternateWith == 0 then
return array
end
local minimumLength = reduce(alternateWith, function(minimum: number, value)
return math.min(minimum, #value)
end, #array)
if minimumLengt... | 247 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/any.luau | luau | .luau | local function any<T>(array: {T}, predicate: (element: T, index: number) -> boolean): boolean
for index, element in array do
if predicate(element, index) then
return true
end
end
return false
end
return any
| 60 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/average.luau | luau | .luau | local function average(array: {number}): number?
local length = #array
if length == 0 then
return nil
end
local result = 0
for _, element in array do
result += element
end
return result / length
end
return average
| 59 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/averageBy.luau | luau | .luau | local function averageBy<T>(array: {T}, map: (T) -> number): number?
local length = #array
if length == 0 then
return nil
end
local result = 0
for _, element in array do
result += map(element)
end
return result / length
end
return averageBy
| 72 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/concat.luau | luau | .luau | local function concat<T>(array: {T}, ...: {T}?): {T}
local result = nil
for i = 1, select("#", ...) do
local concatWith = select(i, ...)
if concatWith ~= nil and #concatWith > 0 then
result = result or table.clone(array)
for _, element in concatWith do
table.insert(result, element)
end
end
end
... | 104 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/contains.luau | luau | .luau | local function contains<T>(array: {T}, element: T): boolean
for _, value in array do
if value == element then
return true
end
end
return false
end
return contains
| 47 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/copy.luau | luau | .luau | return table.clone
| 4 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/deduplicate.luau | luau | .luau | local function deduplicate<T>(array: {T}): {T}
if #array == 0 then
return array
end
local removeIndexes = {}
local seenSet = {}
for index, element in array do
if seenSet[element] == nil then
seenSet[element] = true
else
table.insert(removeIndexes, index)
end
end
local totalIndexes = #removeInde... | 149 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/deduplicateByKey.luau | luau | .luau | local function deduplicateByKey<T, Comparable>(array: {T}, key: (T) -> Comparable): {T}
local removeIndexes = {}
local seenSet = {}
for index, element in array do
local elementKey = key(element)
if seenSet[elementKey] == nil then
seenSet[elementKey] = true
else
table.insert(removeIndexes, index)
end
... | 157 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/filter.luau | luau | .luau | local function filter<T>(array: {T}, predicate: (T, number) -> boolean): {T}
local new = {}
for i, element in array do
if predicate(element, i) then
table.insert(new, element)
end
end
return new
end
return filter
| 64 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/find.luau | luau | .luau | local function find<T>(array: {T}, predicate: (element: T, index: number) -> boolean, start: number?): T?
if start == nil or start == 1 then
for index, element in array do
if predicate(element, index) then
return element
end
end
else
local length = #array
for i = start, length do
local element = ... | 123 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/findIndex.luau | luau | .luau | local function findIndex<T>(array: {T}, predicate: (element: T, index: number) -> boolean, start: number?): number?
if start == nil or start == 1 then
for index, element in array do
if predicate(element, index) then
return index
end
end
else
local length = #array
for i = start, length do
local el... | 125 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/findIndexByValue.luau | luau | .luau | local function findIndexByValue<T>(array: {T}, element: T, start: number?): number?
return table.find(array, element, start)
end
return findIndexByValue
| 40 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/findMap.luau | luau | .luau | local function findMap<T, U>(array: {T}, mapFn: (element: T, index: number) -> U?, start: number?): U?
if start == nil or start == 1 then
for index, element in array do
local result = mapFn(element, index)
if result ~= nil then
return result
end
end
else
local length = #array
for i = start, lengt... | 144 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/flatMap.luau | luau | .luau | local isArray = require("./isArray")
local function flatMap<T, U>(array: {T}, mapFn: (T, number) -> nil | U | {U}): {U}
local new = {}
for i, element in array do
local value = mapFn(element, i)
if value ~= nil then
if isArray(value) then
for _, innerElement in value :: {U} do
table.insert(new, innerE... | 128 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/flatten.luau | luau | .luau | local isArray = require("./isArray")
local function flatten<T>(array: {T | {T}}, depth: number?): {T}
local actualDepth = if depth == nil then math.huge else depth
if actualDepth == 0 then
return array :: {T}
end
local new = {}
for _, element in array do
if isArray(element) then
local iter: {T} = if actu... | 149 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/fromFn.luau | luau | .luau | local function fromFn<T>(generator: (number) -> T?): {T}
local array = {}
local i = 1
while true do
local element = generator(i)
if element == nil then
break
else
i += 1
table.insert(array, element)
end
end
return array
end
return fromFn
| 78 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/fromTryFn.luau | luau | .luau | local function fromTryFn<T>(generator: (number) -> T?): {T}
local array = {}
local i = 1
while true do
local success, element = pcall(generator, i)
if success == false or element == nil then
break
else
i += 1
table.insert(array, element)
end
end
return array
end
return fromTryFn
| 89 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/isArray.luau | luau | .luau | local function isArray(value: unknown): boolean
if type(value) ~= "table" then
return false
end
local tableValue: {[any]: any} = value :: any
if next(tableValue) == nil then
-- an empty table is an empty array
return true
end
local length = #tableValue
if length == 0 then
return false
end
local ex... | 142 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/isEmpty.luau | luau | .luau | local function isEmpty(value: {[any]: any}): boolean
return next(value) == nil
end
return isEmpty
| 24 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/map.luau | luau | .luau | local function map<T, U>(array: {T}, mapFn: (T, number) -> U?): {U}
local new = {}
for i, element in array do
local value = mapFn(element, i)
if value ~= nil then
table.insert(new, value)
end
end
return new
end
return map
| 75 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/maximum.luau | luau | .luau | local function maximum(array: {number}, initialValue: number?): number
if initialValue == nil then
if #array == 0 then
error("initial value must be provided to Array.maximum when the array is empty")
end
initialValue = array[1]
end
local accumulator = initialValue :: number
for _, element in array do
ac... | 94 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/maximumBy.luau | luau | .luau | local function maximumBy<T>(array: {T}, map: (T) -> number, initialValue: number?): number
if initialValue == nil then
if #array == 0 then
error("initial value must be provided to Array.maximumBy when the array is empty")
end
initialValue = map(array[1])
end
local accumulator: number = initialValue :: numb... | 111 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/minimum.luau | luau | .luau | local function minimum(array: {number}, initialValue: number?): number
if initialValue == nil then
if #array == 0 then
error("initial value must be provided to Array.minimum when the array is empty")
end
initialValue = array[1]
end
local accumulator = initialValue :: number
for _, element in array do
ac... | 94 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/minimumBy.luau | luau | .luau | local function minimumBy<T>(array: {T}, map: (T) -> number, initialValue: number?): number
if initialValue == nil then
if #array == 0 then
error("initial value must be provided to Array.minimumBy when the array is empty")
end
initialValue = map(array[1])
end
local accumulator: number = initialValue :: numb... | 111 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/partition.luau | luau | .luau | local function partition<T>(array: {T}, predicate: (T, number) -> boolean): ({T}, {T})
local trueValues = {}
local falseValues = {}
for i, element in array do
if predicate(element, i) then
table.insert(trueValues, element)
else
table.insert(falseValues, element)
end
end
return trueValues, falseValues
e... | 89 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/pop.luau | luau | .luau | local function pop<T>(array: {T}, count: number?): {T}
local actualCount = count or 1
if actualCount == 1 then
local new = table.clone(array)
table.remove(new)
return new
elseif actualCount == 0 then
return array
else
local length = #array
local remaining = length - actualCount
if remaining <= 0 th... | 174 |
howmanysmall/modern-roblox-ts-template | howmanysmall-modern-roblox-ts-template-8515fd5/.lune/Packages/LuauDisk/array/popFirst.luau | luau | .luau | local function popFirst<T>(array: {T}, count: number?): {T}
local actualCount = count or 1
if actualCount == 1 then
local new = table.clone(array)
table.remove(new, 1)
return new
elseif actualCount == 0 then
return array
else
local length = #array
local remaining = length - actualCount
if remaining... | 185 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.