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
Bura-Games/data-structures
Bura-Games-data-structures-00bb85a/src/Queues/MaxPriorityQueue.luau
luau
.luau
--!native --!optimize 2 --!strict local Error = require(script.Parent.Parent.Parent.Error) local GreenTea = require(script.Parent.Parent.Parent.GreenTea) local Types = require(script.Parent.Parent.Types) type ComparisonFunction<T> = Types.ComparisonFunction<T> type HeapEntry<T> = Types.HeapEntry<T> export type MaxP...
3,659
Bura-Games/data-structures
Bura-Games-data-structures-00bb85a/src/Queues/MinPriorityQueue.luau
luau
.luau
--!native --!optimize 2 --!strict local Error = require(script.Parent.Parent.Parent.Error) local GreenTea = require(script.Parent.Parent.Parent.GreenTea) local Types = require(script.Parent.Parent.Types) type ComparisonFunction<T> = Types.ComparisonFunction<T> type HeapEntry<T> = Types.HeapEntry<T> export type MinP...
3,665
Bura-Games/data-structures
Bura-Games-data-structures-00bb85a/src/Queues/__tests__/MaxPriorityQueue.test.luau
luau
.luau
--!optimize 2 --!strict local TestService = game:GetService("TestService") local JestGlobals = require(TestService.UnitTesting.DevPackages.JestGlobals) local MaxPriorityQueue = require(script.Parent.Parent.MaxPriorityQueue) local describe = JestGlobals.describe local expect = JestGlobals.expect local it = JestGlobal...
643
Bura-Games/data-structures
Bura-Games-data-structures-00bb85a/src/Queues/__tests__/MinPriorityQueue.test.luau
luau
.luau
--!optimize 2 --!strict local TestService = game:GetService("TestService") local JestGlobals = require(TestService.UnitTesting.DevPackages.JestGlobals) local MinPriorityQueue = require(script.Parent.Parent.MinPriorityQueue) local describe = JestGlobals.describe local expect = JestGlobals.expect local it = JestGlobal...
647
Bura-Games/data-structures
Bura-Games-data-structures-00bb85a/src/Random/LiveRandom.luau
luau
.luau
--!native --!optimize 2 --!strict local Error = require(script.Parent.Parent.Parent.Error) local GreenTea = require(script.Parent.Parent.Parent.GreenTea) export type LiveRandom = { Get: (self: LiveRandom) -> number, Peek: (self: LiveRandom) -> number, Rig: (self: LiveRandom, value: number) -> LiveRandom, } type Pr...
1,714
Bura-Games/data-structures
Bura-Games-data-structures-00bb85a/src/Random/__tests__/LiveRandom.test.luau
luau
.luau
--!optimize 2 --!strict local TestService = game:GetService("TestService") local JestGlobals = require(TestService.UnitTesting.DevPackages.JestGlobals) local LiveRandom = require(script.Parent.Parent.LiveRandom) local describe = JestGlobals.describe local expect = JestGlobals.expect local it = JestGlobals.it local ...
602
Bura-Games/data-structures
Bura-Games-data-structures-00bb85a/src/Tries/SimpleTrie.luau
luau
.luau
--!native --!optimize 2 --!strict local Error = require(script.Parent.Parent.Parent.Error) local GreenTea = require(script.Parent.Parent.Parent.GreenTea) local Types = require(script.Parent.Types) export type SimpleTrie = Types.BasicTrie type Static = { ClassName: "SimpleTrie", new: () -> SimpleTrie, Is: (value:...
2,116
Bura-Games/data-structures
Bura-Games-data-structures-00bb85a/src/Tries/Types.luau
luau
.luau
--!optimize 2 --!strict export type BasicTrie = { Root: Node, Insert: (self: BasicTrie, word: string) -> (), Search: (self: BasicTrie, word: string) -> boolean, StartsWith: (self: BasicTrie, prefix: string) -> boolean, } export type Node = { Children: {[number]: Node}, IsEnding: boolean, } return false
96
Bura-Games/data-structures
Bura-Games-data-structures-00bb85a/src/Tries/Utf8Trie.luau
luau
.luau
--!native --!optimize 2 --!strict local Error = require(script.Parent.Parent.Parent.Error) local GreenTea = require(script.Parent.Parent.Parent.GreenTea) local Types = require(script.Parent.Types) export type Utf8Trie = Types.BasicTrie type Static = { ClassName: "Utf8Trie", new: () -> Utf8Trie, Is: (value: any) ...
2,201
Bura-Games/data-structures
Bura-Games-data-structures-00bb85a/src/Tries/__tests__/SimpleTrie.test.luau
luau
.luau
--!optimize 2 --!strict local TestService = game:GetService("TestService") local JestGlobals = require(TestService.UnitTesting.DevPackages.JestGlobals) local SimpleTrie = require(script.Parent.Parent.SimpleTrie) local beforeEach = JestGlobals.beforeEach local describe = JestGlobals.describe local expect = JestGlobal...
496
Bura-Games/data-structures
Bura-Games-data-structures-00bb85a/src/Tries/__tests__/Utf8Trie.test.luau
luau
.luau
--!optimize 2 --!strict local TestService = game:GetService("TestService") local JestGlobals = require(TestService.UnitTesting.DevPackages.JestGlobals) local Utf8Trie = require(script.Parent.Parent.Utf8Trie) local beforeEach = JestGlobals.beforeEach local describe = JestGlobals.describe local expect = JestGlobals.ex...
723
Bura-Games/data-structures
Bura-Games-data-structures-00bb85a/src/Types.luau
luau
.luau
--!strict --[=[ All the types related to this library. @class Types ]=] local Types = {} -- Luau really, really, really needs strict arrays. export type Tuple<K, V> = {K | V} --[=[ The data structure that represents an element in a [MaxPriorityQueue] or [MinPriorityQueue]. @interface HeapEntry @field Priority...
188
Bura-Games/data-structures
Bura-Games-data-structures-00bb85a/src/init.luau
luau
.luau
--!optimize 2 --!strict local LRUCache = require(script.Caches.LRUCache) local LiveRandom = require(script.Random.LiveRandom) local MaxPriorityQueue = require(script.Queues.MaxPriorityQueue) local MinPriorityQueue = require(script.Queues.MinPriorityQueue) local SimpleTrie = require(script.Tries.SimpleTrie) local Sorte...
316
Bura-Games/data-structures
Bura-Games-data-structures-00bb85a/src/jest.config.luau
luau
.luau
type Serialize = ( value: unknown, config: unknown, indentation: number, depth: number, references: unknown, printer: Serialize ) -> string type Serializer = { serialize: Serialize, test: (value: unknown) -> boolean, } type JestConfiguration = { clearmocks: boolean?, displayName: { color: string, name: st...
301
Bura-Games/data-structures
Bura-Games-data-structures-00bb85a/tests/Execute.server.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,...
474
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/theme/context/ThemeProducer.tsx
roblox-ts
.tsx
import { createProducer } from "@rbxts/reflex"; import { DEFAULT_THEME } from "theme/constants"; import { Theme } from "../interfaces/theme"; export const themeProducer = createProducer(DEFAULT_THEME, { setTheme: (_state, theme: Theme) => theme }); export type ThemeProducer = typeof themeProducer;
66
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/theme/context/ThemeProvider.tsx
roblox-ts
.tsx
import React, { StrictMode, useEffect } from "@rbxts/react"; import { ReflexProvider } from "@rbxts/react-reflex"; import { DEFAULT_THEME } from "theme/constants"; import { Theme } from "theme/interfaces"; import { CustomizedProps } from "theme/types"; import { themeProducer } from "./ThemeProducer"; export interface...
175
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/theme/hooks/useTheme.ts
roblox-ts
.ts
import { useEffect, useMemo, useState } from "@rbxts/react"; import { themeProducer } from "../context/ThemeProducer"; import { Theme } from "theme/interfaces"; const useTheme = (): { theme: Theme; setTheme: (theme: Theme) => void; } => { const [theme, setTheme] = useState<Theme>(themeProducer.getState()); useEff...
169
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/theme/types/types.ts
roblox-ts
.ts
/* eslint-disable @typescript-eslint/no-explicit-any */ import React, { PropsWithChildren } from "@rbxts/react"; import { WriteableStyle } from "theme/interfaces"; export interface CommonProps<T extends Instance> extends PropsWithChildren { className?: WriteableStyle<T>; component?: T; id?: React.Key; ref?: React....
244
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/ui/packages/button/components/Button.tsx
roblox-ts
.tsx
import React, { useEffect, useRef, useState } from "@rbxts/react"; import { TweenService } from "@rbxts/services"; import { CustomizedProps, WriteableStyle } from "theme"; import { ButtonSize, ButtonColor, ButtonVariant } from "../types"; import useButtonStyles from "./Button.styles"; import { LoadingStroke } from "ui/...
891
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/ui/packages/divider/components/Divider.tsx
roblox-ts
.tsx
import React from "@rbxts/react"; import { CustomizedProps } from "theme"; import { Orientations } from "ui/enums"; import useDividerStyles from "./Divider.styles"; type DefaultDividerComponent = Frame; export interface DividerProps { position?: UDim2; orientation?: Orientations; padding?: number; color?: Color3;...
167
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/ui/packages/errorBoundary/components/ErrorBoundary.tsx
roblox-ts
.tsx
import React, { Component, ErrorInfo, ReactComponent } from "@rbxts/react"; export interface ErrorBoundaryProps { fallback?: (error: unknown) => React.Element; } export interface ErrorBoundaryState { hasError: boolean; message?: unknown; } @ReactComponent export class ErrorBoundary extends Component<ErrorBoundary...
187
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/ui/packages/icon/components/Icon.tsx
roblox-ts
.tsx
import React from "@rbxts/react"; import { Icons } from "ui/enums"; import { CustomizedProps, WriteableStyle } from "theme"; import useIconStyles from "./Icon.styles"; export interface IconProps { icon: Icons; size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl"; tint?: Color3; } type DefaultIconComponent = ImageLabel;...
205
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/ui/packages/iconButton/components/IconButton.tsx
roblox-ts
.tsx
import React, { useState } from "@rbxts/react"; import { Icons } from "ui/enums"; import { CustomizedProps, WriteableStyle } from "theme"; import useIconButtonStyles from "./IconButton.styles"; export interface IconButtonProps { icon: Icons; size?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl"; tint: Color3; selected?:...
318
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/ui/packages/input/components/Input.tsx
roblox-ts
.tsx
import React, { useState } from "@rbxts/react"; import { classNames, CustomizedProps, WriteableStyle } from "theme"; import { Divider } from "../../divider"; import { Orientations } from "ui/enums"; import { InputColor, InputMargin, InputVariant } from "../types"; import useInputStyles from "./Input.styles"; export ty...
747
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/ui/packages/loadingStroke/components/LoadingStroke.tsx
roblox-ts
.tsx
import React, { useEffect, useRef } from "@rbxts/react"; import { CustomizedProps } from "theme"; import { TweenService } from "@rbxts/services"; export interface LoadingStrokeProps { animating?: boolean; } function LoadingStroke(props: CustomizedProps<UIStroke, LoadingStrokeProps>) { const { animating = false, ...
456
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/ui/packages/preloader/components/Preloader.tsx
roblox-ts
.tsx
import React, { useState, useMemo, ComponentType, useEffect } from "@rbxts/react"; import { useAsyncEffect, useDeferState } from "@rbxts/pretty-react-hooks"; import { ContentProvider } from "@rbxts/services"; import { ProgressBar } from "ui/packages/progressBar"; import { CustomizedProps } from "theme"; import usePrelo...
817
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/ui/packages/progressBar/components/ProgressBar.tsx
roblox-ts
.tsx
import React from "@rbxts/react"; import { CustomizedProps, WriteableStyle } from "theme"; import useProgressBarStyles from "./ProgressBar.styles"; export interface ProgressBarProps { progress: number; } function ProgressBar(props: CustomizedProps<Frame, ProgressBarProps>) { const { progress, className, id, ref } =...
234
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/ui/packages/shadow/components/Shadow.tsx
roblox-ts
.tsx
import React, { useEffect, useState } from "@rbxts/react"; import { WriteableStyle } from "theme"; import useShadowStyles from "./Shadow.styles"; function Shadow() { const { container } = useShadowStyles(); const [parent, setParent] = useState<GuiObject | undefined>(undefined); const [cornerRadius, setCornerRadius]...
324
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/ui/packages/sidebar/components/Sidebar.tsx
roblox-ts
.tsx
import React from "@rbxts/react"; import { CustomizedProps } from "theme"; import useSidebarStyles from "./Sidebar.styles"; export type DefaultSidebarComponent = Frame; export interface SidebarProps { size: "compact" | "large"; ignoreInset?: boolean; } function Sidebar<T extends DefaultSidebarComponent>(props: Cus...
162
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/ui/packages/toast/components/Toast.tsx
roblox-ts
.tsx
import { BoatTween } from "@rbxts/boat-tween"; import React, { useEffect, useRef } from "@rbxts/react"; import { CustomizedProps, DEFAULT_THEME, WriteableStyle } from "theme"; import { Directions } from "ui/enums"; import { Shadow } from "ui/packages/shadow"; import ToastVariants from "../enums/ToastVariants"; import u...
540
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/ui/packages/treeView/components/TreeView.tsx
roblox-ts
.tsx
import React, { useCallback, useEffect, useState } from "@rbxts/react"; import { CustomizedProps, DEFAULT_THEME, WriteableStyle } from "theme"; import { Icon } from "ui/packages/icon"; import { Typography } from "ui/packages/typography"; import { Icons } from "../../../enums"; import Branch from "../interfaces/Branch";...
1,570
bjlarouche/uiblox-rbxts
bjlarouche-uiblox-rbxts-7ef4ed6/src/ui/packages/typography/components/Typography.tsx
roblox-ts
.tsx
import React from "@rbxts/react"; import { CustomizedProps } from "theme"; import { FontFamilyVariant, FontSizeVariant } from "theme/interfaces/typography"; import { TypographyAlignment } from "../types/TypographyAlignment"; import { TypographyColor } from "../types/TypographyColor"; import { TypographyDisplay } from "...
240
littensy/charmed-icons
littensy-charmed-icons-a422031/src/main.ts
roblox-ts
.ts
import type { ExtensionContext } from "vscode"; import { workspace } from "vscode"; import { CONFIG_ROOT } from "~/constants"; import { updateThemes } from "./update"; import { isDefaultConfig } from "./utils/config"; import { isFreshInstall, promptReload } from "./utils/interactions"; export async function activate(c...
150
littensy/charmed-icons
littensy-charmed-icons-a422031/src/utils/config.ts
roblox-ts
.ts
import type { Config } from "~/types"; import { defu } from "defu"; import { workspace } from "vscode"; import { CONFIG_ROOT, ConfigKey } from "~/constants"; import { defaultConfig } from "~/defaults"; export function getConfig(): Partial<Config> { const config = workspace.getConfiguration(CONFIG_ROOT); return { ...
199
littensy/charmed-icons
littensy-charmed-icons-a422031/src/utils/definitions.ts
roblox-ts
.ts
import type { ExtensionContext } from "vscode"; import type { IconVariant } from "~/constants"; import type { IconDefinitions } from "~/types"; import { Uri, workspace } from "vscode"; export async function getIconDefinitions(context: ExtensionContext, variant: IconVariant) { const path = Uri.joinPath(context.extensi...
108
littensy/charmed-icons
littensy-charmed-icons-a422031/src/utils/interactions.ts
roblox-ts
.ts
import type { ExtensionContext } from "vscode"; import { Buffer } from "node:buffer"; import { commands, Uri, window, workspace } from "vscode"; export async function promptReload() { const message = `Charmed Icons: Theme changed - Reload required.`; const action = "Reload window"; return window.showInformationMess...
264
rbxts-flamework/core
rbxts-flamework-core-454537d/src/prelude.ts
roblox-ts
.ts
/** * This file contains preludes for the transformer. * * This is primarily necessary due to a bug with the `@rbxts/t` package. */ import { t } from "@rbxts/t"; export { t };
49
roblox-aurora/rbx-net
roblox-aurora-rbx-net-2bf4525/lune/ci.luau
luau
.luau
--!strict --[[ Automatic deployment and artefact builder for Net ]] local process = require("@lune/process") local path = require("modules/path") local node = require("modules/node") local fs = require("@lune/fs") local luauDir = path.join(process.cwd, "luau") local luauDistDir = path.join(luauDir, "dist") local...
628
roblox-aurora/rbx-net
roblox-aurora-rbx-net-2bf4525/lune/modules/node.luau
luau
.luau
local process = require("@lune/process") local node = {} function node.publish() local params = { "publish" } if process.os == "windows" then return process.spawn("npm.cmd", params) else return process.spawn("npm", params) end end return node
62
roblox-aurora/rbx-net
roblox-aurora-rbx-net-2bf4525/lune/modules/path.luau
luau
.luau
--!strict local process = require("@lune/process") local path = {} local SEP = if process.os == "windows" then "\\" else "/" --- Join multiple path parts into a combined path --- @return A joined path function path.join(...: string): string return path.ospath(table.concat({ ... }, SEP)) end --- Gets the extension of...
425
roblox-aurora/rbx-net
roblox-aurora-rbx-net-2bf4525/src/internal/tables.lua
luau
.lua
local function isMixed(t) assert(type(t) == "table") local mixed = false local _idxType for index, value in next, t do if _idxType and _idxType ~= type(index) then return true end _idxType = type(index) if type(value) == "table" then mixed = mixed and isMixed(value) and not (not getmetatable(value))...
112
roblox-aurora/rbx-net
roblox-aurora-rbx-net-2bf4525/src/internal/validator.ts
roblox-ts
.ts
import { isMixed } from "./tables"; export interface ValidatorLike { readonly errorMessage: string; readonly check: (value: unknown) => boolean; } export interface Validator<T> extends ValidatorLike { readonly check: (value: unknown) => value is T; } type NetworkValue = string | number | boolean | Instance | CFra...
558
roblox-aurora/rbx-net
roblox-aurora-rbx-net-2bf4525/src/messaging/MessagingService.lua
luau
.lua
local RunService = game:GetService("RunService") local MessagingService = game:GetService("MessagingService") local MockMessagingService = {} local topics = {} function MockMessagingService:PublishAsync(topicName, message) local topic = topics[topicName] if topic then topic:Fire( { Sent = tick(), Data ...
187
roblox-aurora/rbx-net
roblox-aurora-rbx-net-2bf4525/src/middleware/LoggerMiddleware/init.lua
luau
.lua
local RunService = game:GetService("RunService") local HttpService = game:GetService("HttpService") local IS_STUDIO = RunService:IsStudio() local function defaultLogger(name, args) if IS_STUDIO then local str = {}; for _, arg in ipairs(args) do table.insert(str, HttpService:JSONEncode(a...
176
roblox-aurora/rbx-net
roblox-aurora-rbx-net-2bf4525/src/middleware/RateLimitMiddleware/throttle.lua
luau
.lua
local Throttle = { counters = {} } local RequestCounter = {} RequestCounter.__index = RequestCounter function RequestCounter.new() local self = { counter = {} } return setmetatable(self, RequestCounter) end function RequestCounter:Get(player) local counter = self.counter local playerQueue = counter[player.Us...
246
roblox-aurora/rbx-net
roblox-aurora-rbx-net-2bf4525/src/middleware/TypeCheckMiddleware/init.lua
luau
.lua
local RunService = game:GetService("RunService") local HttpService = game:GetService("HttpService") local IS_STUDIO = RunService:IsStudio(); local function defaultErrorHandler(event, args, index) local name = event:GetInstance().Name if IS_STUDIO then warn("[TypeCheckMiddleware] Call to " .. nam...
393
roblox-aurora/rbx-net
roblox-aurora-rbx-net-2bf4525/src/server/MiddlewareEvent.ts
roblox-ts
.ts
import { $ifEnv } from "rbxts-transform-env"; import { NetGlobalMiddleware, NetMiddleware, NextCaller } from "../middleware"; /** @internal */ export type MutableMiddlewareList = Array<NetMiddleware<Array<unknown>>>; export type MiddlewareList = ReadonlyArray<NetMiddleware<ReadonlyArray<unknown>>>; abstract class Midd...
320
roblox-aurora/rbx-net
roblox-aurora-rbx-net-2bf4525/src/server/ServerEvent.ts
roblox-ts
.ts
import { NetMiddleware, NextCaller } from "../middleware"; import { findOrCreateRemote, IS_CLIENT, IS_RUNNING, NetManagedInstance } from "../internal"; import MiddlewareEvent, { MiddlewareList } from "./MiddlewareEvent"; import { MiddlewareOverload } from "../middleware"; import { NetServerScriptSignal, NetServerSignal...
1,155
roblox-aurora/rbx-net
roblox-aurora-rbx-net-2bf4525/src/server/ServerMessagingEvent.ts
roblox-ts
.ts
import ExperienceBroadcastEvent, { isSubscriptionMessage, ISubscriptionMessage, } from "../messaging/ExperienceBroadcastEvent"; import { getGlobalRemote, IS_CLIENT, isLuaTable } from "../internal"; import ServerEvent from "./ServerEvent"; import { DefinitionConfiguration } from "../definitions"; const Players = game....
1,087
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/scripts/run-tests.server.lua
luau
.lua
local ReplicatedStorage = game:GetService("ReplicatedStorage") local ServerScriptService = game:GetService("ServerScriptService") local TestEZ = require(ReplicatedStorage.rbxts_include.node_modules["@rbxts"].testez.src) TestEZ.TestBootstrap:run({ ServerScriptService.TS.test, -- ReplicatedStorage.TS.test, }, TestEZ....
81
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/cmdr.client.ts
roblox-ts
.ts
import { CmdrClient } from "@rbxts/cmdr"; CmdrClient.SetActivationKeys([Enum.KeyCode.F2]);
26
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/controllers/GuiController.tsx
roblox-ts
.tsx
import { Controller, OnStart } from "@flamework/core"; import React from "@rbxts/react"; import { ReflexProvider } from "@rbxts/react-reflex"; import { createPortal, createRoot } from "@rbxts/react-roblox"; import { Players } from "@rbxts/services"; import { store } from "client/store"; import HolderApp from "client/ui...
193
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/store/index.ts
roblox-ts
.ts
import { InferState, combineProducers } from "@rbxts/reflex"; import { slices } from "shared/store"; import { receiverMiddleware } from "./middleware/receiver"; export type RootStore = typeof store; export type RootState = InferState<RootStore>; export function createStore() { const store = combineProducers({ ......
91
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/store/middleware/receiver.ts
roblox-ts
.ts
import { ProducerMiddleware, createBroadcastReceiver } from "@rbxts/reflex"; import { Events } from "client/network"; export function receiverMiddleware(): ProducerMiddleware { const receiver = createBroadcastReceiver({ start: () => { Events.reflex.start.fire(); }, }); Events.reflex.dispatch.connect((action...
79
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/apps/buttons/buttons-app.tsx
roblox-ts
.tsx
import { HolderPage, ImageName } from "shared/configs/Gui"; import React from "@rbxts/react"; import Frame from "client/ui/components/frame"; import Object from "@rbxts/object-utils"; import Button from "./components/button"; import { store } from "client/store"; import { selectHolderPage } from "shared/store/selectors...
327
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/apps/buttons/components/button.tsx
roblox-ts
.tsx
import React from "@rbxts/react" import ImageLabel from "client/ui/components/imageLabel" import TextButton from "client/ui/components/textButton" import TextLabel from "client/ui/components/textLabel" import { COLORS, ImageName } from "shared/configs/Gui" interface Props { button: string, image: ImageName, ...
307
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/apps/currency/components/currency-frame.tsx
roblox-ts
.tsx
import { useSelectorCreator } from "@rbxts/react-reflex"; import React from "@rbxts/react"; import { Players } from "@rbxts/services"; import Frame from "client/ui/components/frame"; import ImageLabel from "client/ui/components/imageLabel"; import TextLabel from "client/ui/components/textLabel"; import { TextLabelButto...
628
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/apps/currency/currency-app.tsx
roblox-ts
.tsx
import ScreenGui from "client/ui/components/scaledGui"; import CurrencyFrame from "./components/currency-frame"; import { CURRENCIES } from "shared/configs/Currency"; import { store } from "client/store"; import React from "@rbxts/react"; import { ReflexProvider } from "@rbxts/react-reflex"; import Frame from "client/u...
192
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/apps/holder/holder-app.tsx
roblox-ts
.tsx
import React, { useEffect, useState } from "@rbxts/react"; import Frame from "client/ui/components/frame"; import SettingsApp from "../settings/settings-app"; import { useSelector } from "@rbxts/react-reflex"; import CurrencyApp from "../currency/currency-app"; import { HOLDER_PAGES } from "shared/configs/Gui"; import ...
881
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/apps/settings/components/setting-button.tsx
roblox-ts
.tsx
import { useSelector } from "@rbxts/react-reflex"; import React from "@rbxts/react"; import { Events } from "client/network"; import TextLabel from "client/ui/components/textLabel"; import { Setting } from "shared/configs/Settings"; import { Players, RunService } from "@rbxts/services"; import { selectPlayerSetting } f...
564
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/apps/settings/settings-app.tsx
roblox-ts
.tsx
import React from "@rbxts/react"; import ContainerFrame from "client/ui/components/containerFrame"; import Exit from "client/ui/components/exit"; import Frame from "client/ui/components/frame"; import Title from "client/ui/components/title"; import { SETTINGS } from "shared/configs/Settings"; import SettingButton from ...
477
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/components/containerFrame.tsx
roblox-ts
.tsx
import React from "@rbxts/react"; interface Props extends React.PropsWithChildren { anchorPoint?: Vector2; position?: UDim2; size: UDim2; scrollBarImageColor3?: Color3; scrollBarThickness?: number; automaticCanvasSize?: Enum.AutomaticSize; backgroundColor3?: Color3; backgroundTransparen...
518
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/components/exit.tsx
roblox-ts
.tsx
import React from "@rbxts/react"; import { store } from "client/store"; import { COLORS } from "shared/configs/Gui"; interface Props extends React.PropsWithChildren { uiStrokeSize?: number; position?: UDim2; anchorPoint?: Vector2; size: UDim2; } export default function Exit ( props: Props ) { return ( <textbut...
358
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/components/frame.tsx
roblox-ts
.tsx
import React, { useEffect, useState } from "@rbxts/react"; import { TweenService } from "@rbxts/services"; interface Props extends React.PropsWithChildren { position?: UDim2 | React.Binding<UDim2>; anchorPoint?: Vector2; size?: UDim2; backgroundTransparency?: number; backgroundColor3?: Color3; ...
364
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/components/imageLabel.tsx
roblox-ts
.tsx
import React, { useEffect, useState } from "@rbxts/react"; import { IMAGES, ImageName } from "shared/configs/Gui"; interface Props extends React.PropsWithChildren { image?: ImageName; position?: UDim2 | React.Binding<UDim2>; anchorPoint?: Vector2; size?: UDim2; backgroundTransparency?: number; ...
255
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/components/scaledGui.tsx
roblox-ts
.tsx
import React, { createRef, useEffect } from "@rbxts/react"; import { CollectionService } from "@rbxts/services"; interface Props extends React.PropsWithChildren { } export default function ScreenGui(props: Props) { const uiScaleRef = createRef<UIScale>() useEffect(() => { const uiScale = uiScaleRef.current if ...
176
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/components/textButton.tsx
roblox-ts
.tsx
import React, { useEffect, useState } from "@rbxts/react"; import { COLORS } from "shared/configs/Gui"; interface Props extends React.PropsWithChildren { key?: string; text?: string; textSize?: number; size?: UDim2; position?: UDim2; anchorPoint?: Vector2; automaticSize?: Enum.AutomaticSize...
496
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/components/textLabel.tsx
roblox-ts
.tsx
import React from "@rbxts/react"; interface Props extends React.PropsWithChildren { key?: string; text: string; textSize: number; textScaled?: boolean; size?: UDim2; position?: UDim2; anchorPoint?: Vector2; automaticSize?: Enum.AutomaticSize; textColor3?: Color3; textXAlignment?: Enum.TextXAlignment; textYA...
384
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/components/textLabelButton.tsx
roblox-ts
.tsx
import React from "@rbxts/react"; import TextButton from "./textButton"; import TextLabel from "./textLabel"; interface Props extends React.PropsWithChildren { key?: string; text?: string; textSize?: number; size?: UDim2; position?: UDim2; textPosition?: UDim2; textAnchorPoint?: Vector2; ...
432
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/components/title.tsx
roblox-ts
.tsx
import React from "@rbxts/react"; import Frame from "./frame"; import TextLabel from "./textLabel"; interface Props extends React.PropsWithChildren { text: string; textSize?: number; key?: string; uiStrokeSize?: number; position?: UDim2; anchorPoint?: Vector2; size?: UDim2; uiCornerSize?: UDim; backgroundColo...
382
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/holder.story.tsx
roblox-ts
.tsx
import React from "@rbxts/react"; import ReactRoblox from "@rbxts/react-roblox"; import { store } from "client/store"; import { ReflexProvider } from "@rbxts/react-reflex"; import HolderApp from "./apps/holder/holder-app"; import { HOLDER_PAGES } from "shared/configs/Gui"; import { defaultPlayerData } from "shared/stor...
236
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/client/ui/utils/GetStatePlayerId.ts
roblox-ts
.ts
import { Players } from "@rbxts/services"; export function GetStatePlayerId () { const player = Players.LocalPlayer; return player ? tostring( player.UserId ) : "0"; }
41
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/server/cmdr/commands/giveCurrency.ts
roblox-ts
.ts
import { CommandDefinition } from "@rbxts/cmdr"; export = identity<CommandDefinition>({ Name: "giveCurrency", Aliases: ["gC"], Description: "Increase the Players Currency", Group: "Admin", Args: [ { Type: "player", Name: "player", Description: "Player", }, { Type: "currency", Name: "Currency"...
126
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/server/cmdr/commands/giveCurrencyServer.ts
roblox-ts
.ts
import { CommandContext } from "@rbxts/cmdr"; import { store } from "server/store"; import { Currency } from "shared/configs/Currency"; export = function (context: CommandContext, player: Player, currency: Currency, amount: number) { store.changeBalance(tostring(player.UserId), currency, amount); };
69
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/server/cmdr/startup.server.ts
roblox-ts
.ts
import { Cmdr } from "@rbxts/cmdr"; const parent = <Folder>script.Parent Cmdr.RegisterDefaultCommands() Cmdr.RegisterCommandsIn( <Folder>parent.FindFirstChild( "commands" ) ) Cmdr.RegisterTypesIn( <Folder>parent.FindFirstChild( "types" ) )
64
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/server/cmdr/types/currency.ts
roblox-ts
.ts
import { Registry } from "@rbxts/cmdr"; import { CURRENCIES } from "shared/configs/Currency"; export = function (registry: Registry) { registry.RegisterType("currency", registry.Cmdr.Util.MakeEnumType("currency", [...CURRENCIES])); };
59
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/server/services/PlayerDataService.ts
roblox-ts
.ts
/* eslint-disable roblox-ts/no-private-identifier */ import { OnInit, Service } from "@flamework/core"; import ProfileService from "@rbxts/profileservice"; import { Profile } from "@rbxts/profileservice/globals"; import { Players, RunService } from "@rbxts/services"; import { store } from "server/store"; import { selec...
663
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/server/store/index.ts
roblox-ts
.ts
import { InferState, combineProducers } from "@rbxts/reflex"; import { slices } from "shared/store"; import { broadcasterMiddleware } from "./middleware/broadcaster"; export type RootState = InferState<typeof store>; export function createStore() { const store = combineProducers({ ...slices, }); // Apply middle...
90
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/server/store/middleware/broadcaster.ts
roblox-ts
.ts
import { ProducerMiddleware, createBroadcaster } from "@rbxts/reflex"; import { Events } from "server/network"; import { slices } from "shared/store"; export function broadcasterMiddleware(): ProducerMiddleware { const broadcaster = createBroadcaster({ producers: slices, dispatch: (player, actions) => { Events...
101
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/shared/network.ts
roblox-ts
.ts
/* eslint-disable no-unused-vars */ import { Networking } from "@flamework/networking"; import { BroadcastAction } from "@rbxts/reflex"; import { PlayerData } from "./store/slices/players/types"; import { Setting } from "./configs/Settings"; interface ServerEvents { reflex: { start: () => void; } toggleSetting: ...
168
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/shared/store/index.ts
roblox-ts
.ts
import { CombineStates } from "@rbxts/reflex"; import { playersSlice } from "./slices/players"; import { clientSlice } from "./slices/client"; export type SharedState = CombineStates<typeof slices>; export const slices = { players: playersSlice, client: clientSlice, };
64
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/shared/store/selectors/players.ts
roblox-ts
.ts
import { Currency } from "shared/configs/Currency"; import { SharedState } from ".."; import { createSelector } from "@rbxts/reflex"; import { defaultPlayerData } from "../slices/players/utils"; import { PlayerData } from "../slices/players/types"; import { Setting } from "shared/configs/Settings"; export const select...
309
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/shared/store/slices/client/gui.ts
roblox-ts
.ts
import { createProducer } from "@rbxts/reflex"; import { HolderPage } from "shared/configs/Gui"; export interface GuiState { holderPage?: HolderPage } const initalState: GuiState = { }; export const guiSlice = createProducer( initalState, { setHolderPage: ( state, page?: HolderPage ) => ( { ...stat...
91
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/shared/store/slices/client/index.ts
roblox-ts
.ts
import { combineProducers } from "@rbxts/reflex"; import { guiSlice } from "./gui"; export const clientSlice = combineProducers( { gui: guiSlice })
40
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/shared/store/slices/players/balance.ts
roblox-ts
.ts
import { createProducer } from "@rbxts/reflex"; import { PlayerBalance, PlayerData } from "./types"; import { Currency } from "shared/configs/Currency"; export interface BalanceState { readonly [player: string]: PlayerBalance | undefined; } const initialState: BalanceState = {}; export const balanceSlice = creat...
204
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/shared/store/slices/players/index.ts
roblox-ts
.ts
import { combineProducers } from "@rbxts/reflex"; import { balanceSlice } from "./balance"; import { settingsSlice } from "./settings"; export const playersSlice = combineProducers( { balance: balanceSlice, settings: settingsSlice })
55
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/shared/store/slices/players/settings.ts
roblox-ts
.ts
import { createProducer } from "@rbxts/reflex"; import { PlayerData, PlayerSettings } from "./types"; export interface SettingsState { readonly [player: string]: PlayerSettings | undefined; } const initialState: SettingsState = {}; export const settingsSlice = createProducer( initialState, { loadPlayerData: ...
176
MonzterDev/Roblox-TS-Template
MonzterDev-Roblox-TS-Template-c80afcb/src/shared/utils/functions/forEveryPlayer.ts
roblox-ts
.ts
import { Players } from "@rbxts/services"; type PlayerReceivingFunction = (player: Player) => unknown; export function forEveryPlayer( joinFunc: PlayerReceivingFunction, leaveFunc?: PlayerReceivingFunction, ): Array<RBXScriptConnection> { const events: Array<RBXScriptConnection> = []; Players.GetPlayers().forEac...
107
christopher-buss/roblox-ts-project-template
christopher-buss-roblox-ts-project-template-d9624aa/src/client/audio/sound-controller.ts
roblox-ts
.ts
import type { OnInit, OnStart } from "@flamework/core"; import { Controller } from "@flamework/core"; import type { Logger } from "@rbxts/log"; import { Inspect } from "@rbxts/rbx-debug"; import { SoundService, TweenService } from "@rbxts/services"; import { USER_ID } from "client/constants"; import { store } from "cl...
934
christopher-buss/roblox-ts-project-template
christopher-buss-roblox-ts-project-template-d9624aa/src/client/constants.ts
roblox-ts
.ts
import { Players } from "@rbxts/services"; export const { LocalPlayer } = Players; export const USER_ID = tostring(LocalPlayer.UserId); export const USER_NAME = LocalPlayer.Name; // eslint-disable-next-line ts/no-non-null-assertion, flawless/naming-convention -- Should always be present during usage. export const Pl...
82
christopher-buss/roblox-ts-project-template
christopher-buss-roblox-ts-project-template-d9624aa/src/client/player/character/character-controller.ts
roblox-ts
.ts
import type { OnStart } from "@flamework/core"; import { Controller } from "@flamework/core"; import type { Logger } from "@rbxts/log"; import { Error } from "@rbxts/luau-polyfill"; import Signal from "@rbxts/rbx-better-signal"; import { promiseTree } from "@rbxts/validate-tree"; import { LocalPlayer } from "client/co...
821
christopher-buss/roblox-ts-project-template
christopher-buss-roblox-ts-project-template-d9624aa/src/client/runtime.client.ts
roblox-ts
.ts
import { Flamework, Modding } from "@flamework/core"; import type { Logger } from "@rbxts/log"; import Log from "@rbxts/log"; import { GAME_NAME } from "shared/constants"; import { setupLogger } from "shared/functions/setup-logger"; import { createApp, reactConfig } from "./ui/react-config"; function start(): void {...
159
christopher-buss/roblox-ts-project-template
christopher-buss-roblox-ts-project-template-d9624aa/src/client/store/middleware/receiver.ts
roblox-ts
.ts
import type { ProducerMiddleware } from "@rbxts/reflex"; import { createBroadcastReceiver } from "@rbxts/reflex"; import { events } from "client/network"; import { $NODE_ENV } from "rbxts-transform-env"; import { IS_EDIT } from "shared/constants"; import { stateSerDes } from "shared/store"; /** * A middleware that l...
219
christopher-buss/roblox-ts-project-template
christopher-buss-roblox-ts-project-template-d9624aa/src/client/ui/app.tsx
roblox-ts
.tsx
import React from "@rbxts/react"; import { Layer } from "./components/primitive"; export function App(): React.ReactNode { return ( <> <Layer key="example-layer" /> <Layer key="example-layer1" /> </> ); }
59
christopher-buss/roblox-ts-project-template
christopher-buss-roblox-ts-project-template-d9624aa/src/client/ui/components/background-blur.tsx
roblox-ts
.tsx
import { useBindingListener, useCamera } from "@rbxts/pretty-react-hooks"; import React, { useState } from "@rbxts/react"; import { createPortal } from "@rbxts/react-roblox"; import type { BindingValue } from "types/util/react"; interface BackgroundBlurProps { /** The size of the blur effect. */ BlurSize?: BindingV...
205
christopher-buss/roblox-ts-project-template
christopher-buss-roblox-ts-project-template-d9624aa/src/client/ui/components/delay-render.tsx
roblox-ts
.tsx
import React, { useEffect, useState } from "@rbxts/react"; import { setTimeout } from "@rbxts/set-timeout"; interface DelayRenderProps extends React.PropsWithChildren { /** The delay (in seconds) before rendering the children component. */ MountDelay?: number; /** * Indicates whether the children component should...
386
christopher-buss/roblox-ts-project-template
christopher-buss-roblox-ts-project-template-d9624aa/src/client/ui/components/error-handler/error-boundary.tsx
roblox-ts
.tsx
import Log from "@rbxts/log"; import type { ErrorInfo } from "@rbxts/react"; import React, { ReactComponent } from "@rbxts/react"; interface ErrorBoundaryProps extends React.PropsWithChildren { onFallback: (error: unknown) => React.ReactNode; } interface ErrorBoundaryState { hasError: boolean; message?: unknown; }...
306
christopher-buss/roblox-ts-project-template
christopher-buss-roblox-ts-project-template-d9624aa/src/client/ui/components/error-handler/error-handler.tsx
roblox-ts
.tsx
import React from "@rbxts/react"; import { ErrorBoundary } from "./error-boundary"; import { ErrorPage } from "./error-page"; type ErrorHandlerProps = React.PropsWithChildren; export function ErrorHandler({ children }: Readonly<ErrorHandlerProps>): React.ReactNode { return ( <ErrorBoundary onFallback={(err) =>...
102
christopher-buss/roblox-ts-project-template
christopher-buss-roblox-ts-project-template-d9624aa/src/client/ui/components/error-handler/error-page.tsx
roblox-ts
.tsx
import type React from "@rbxts/react"; interface ErrorPageProps { Message: string; } export function ErrorPage({ Message }: Readonly<ErrorPageProps>): React.ReactNode { warn(Message); return undefined; }
44