repo stringclasses 302
values | file_path stringlengths 18 241 | language stringclasses 2
values | file_type stringclasses 4
values | code stringlengths 76 697k | tokens int64 10 271k |
|---|---|---|---|---|---|
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 |
littensy/rbxts-react-example | littensy-rbxts-react-example-9cf7b2b/src/client/components/app.tsx | roblox-ts | .tsx | import React from "@rbxts/react";
import { Counter } from "./counter";
import { Layer } from "./layer";
export function App() {
return (
<Layer>
<Counter />
</Layer>
);
}
| 50 |
littensy/rbxts-react-example | littensy-rbxts-react-example-9cf7b2b/src/client/components/counter.tsx | roblox-ts | .tsx | import React, { useState } from "@rbxts/react";
import { usePx } from "client/hooks/use-px";
import { fonts } from "client/utils/fonts";
import { palette } from "client/utils/palette";
import { Button } from "./button";
const COLORS = [palette.purple, palette.blue, palette.green, palette.yellow, palette.red];
export... | 260 |
littensy/rbxts-react-example | littensy-rbxts-react-example-9cf7b2b/src/client/components/layer.tsx | roblox-ts | .tsx | import React from "@rbxts/react";
import { IS_PLUGIN } from "shared/constants";
interface LayerProps {
displayOrder?: number;
children?: React.ReactNode;
}
export function Layer({ displayOrder, children }: LayerProps) {
return IS_PLUGIN ? (
<frame
BackgroundTransparency={1}
Size={new UDim2(1, 0, 1, 0)}
... | 188 |
littensy/rbxts-react-example | littensy-rbxts-react-example-9cf7b2b/src/client/dev.ts | roblox-ts | .ts | import { RunService } from "@rbxts/services";
declare const _G: Record<string, unknown>;
if (RunService.IsStudio()) {
_G.__DEV__ = true;
}
| 39 |
littensy/rbxts-react-example | littensy-rbxts-react-example-9cf7b2b/src/client/hooks/use-motion.ts | roblox-ts | .ts | import { useEventListener } from "@rbxts/pretty-react-hooks";
import { createMotion, Motion, MotionGoal } from "@rbxts/ripple";
import { Binding, useBinding, useMemo } from "@rbxts/react";
import { RunService } from "@rbxts/services";
export function useMotion(initialValue: number): LuaTuple<[Binding<number>, Motion]>... | 196 |
littensy/rbxts-react-example | littensy-rbxts-react-example-9cf7b2b/src/client/hooks/use-px.ts | roblox-ts | .ts | import { useCamera, useDebounceState, useEventListener } from "@rbxts/pretty-react-hooks";
import { useMemo } from "@rbxts/react";
interface ScaleFunction {
/**
* Scales `pixels` based on the current viewport size and rounds the result.
*/
(pixels: number): number;
/**
* Scales `pixels` and rounds the result ... | 525 |
littensy/rbxts-react-example | littensy-rbxts-react-example-9cf7b2b/src/client/main.client.tsx | roblox-ts | .tsx | import "./dev";
import React, { StrictMode } from "@rbxts/react";
import { createPortal, createRoot } from "@rbxts/react-roblox";
import { Players } from "@rbxts/services";
import { App } from "./components/app";
const root = createRoot(new Instance("Folder"));
const target = Players.LocalPlayer.WaitForChild("Player... | 94 |
littensy/rbxts-react-example | littensy-rbxts-react-example-9cf7b2b/src/client/stories/app.story.tsx | roblox-ts | .tsx | import "../dev";
import { hoarcekat } from "@rbxts/pretty-react-hooks";
import React from "@rbxts/react";
import { App } from "client/components/app";
export = hoarcekat(() => {
return <App />;
});
| 54 |
littensy/rbxts-react-example | littensy-rbxts-react-example-9cf7b2b/src/shared/constants.ts | roblox-ts | .ts | import { RunService } from "@rbxts/services";
export const IS_PLUGIN = RunService.IsStudio() && !RunService.IsRunning();
| 29 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/.config.luau | luau | .luau | return {
luau = {
languagemode = "strict",
lint = { ["*"] = true },
linterrors = true,
aliases = {
batteries = "./Packages/lute/batteries",
src = "./src",
std = "~/.lute/typedefs/0.1.0/std",
},
},
}
| 82 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/.lute/generate.luau | luau | .luau | -- Run with: lute run generate
-- Unicode data files live in unicode-data/ and are refreshed with: lute run fetch-data
local fs = require("@std/fs")
local path = require("@std/path")
local config = require("./lib/config")
local emitModule = require("./lib/emit-module")
local parseProperties = require("./lib/parse-pro... | 3,030 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/.lute/lib/config.luau | luau | .luau | local UNICODE_VERSION = "17.0.0"
return {
UNICODE_VERSION = UNICODE_VERSION,
UNICODE_BASE_URL = "https://www.unicode.org/Public/" .. UNICODE_VERSION .. "/ucd/",
UNICODE_DATA_DIR = "unicode-data",
UNICODE_FILES = {
"auxiliary/GraphemeBreakProperty.txt",
"auxiliary/WordBreakProperty.txt",
"auxiliary/SentenceBr... | 156 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/.lute/lib/emit-module.luau | luau | .luau | local fs = require("@std/fs")
local base64 = require("@src/base64")
type EmitOptions = {
categories: { string },
rangeBuffer: buffer,
asciiBuffer: buffer,
}
local function encodeBuffer(data: buffer): string
return buffer.tostring(base64.encode(data))
end
local function renderDataModule(options: EmitOptions): st... | 374 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/.lute/lib/fuzz-word.luau | luau | .luau | local base64 = require("@src/base64")
local fs = require("@std/fs")
local segmenter = require("@src")
local wordData = require("@src/generated/word-data")
local BYTES_PER_RANGE = 8
local CODEPOINT_MASK = 0x1FFFFF
local CATEGORY_SHIFT = 21
local MAX_CODEPOINT = 0x10FFFF
local SURROGATE_START = 0xD800
local SURROGATE_E... | 2,277 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/.lute/lib/parse-properties.luau | luau | .luau | local function trim(value: string): string
return (value:gsub("^%s+", ""):gsub("%s+$", ""))
end
local function parseRangeToken(token: string): (number | nil, number | nil)
local rangeStart, rangeEnd = token:match("^(%x+)%.%.(%x+)$")
if rangeStart == nil then
rangeStart = token:match("^(%x+)$")
rangeEnd = rangeS... | 694 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/.lute/lib/parse-tests.luau | luau | .luau | local function isSurrogate(codepoint: number): boolean
return codepoint >= 0xD800 and codepoint <= 0xDFFF
end
local function codepointsToString(codepoints: { number }): string
local parts = table.create(#codepoints)
for index, codepoint in codepoints do
parts[index] = utf8.char(codepoint)
end
return table.conc... | 460 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/src/base64.luau | luau | .luau | --!native
--!optimize 2
local lookupValueToCharacter = buffer.create(64)
local lookupCharacterToValue = buffer.create(256)
local alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
local padding = string.byte("=")
for index = 1, 64 do
local value = index - 1
local character = string.byte(... | 1,875 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/src/core.luau | luau | .luau | --!native
--!optimize 2
local alphabeticData = require("./generated/alphabetic-data")
local graphemeData = require("./generated/grapheme-data")
local incbData = require("./generated/incb-data")
local numericData = require("./generated/numeric-data")
local sentenceData = require("./generated/sentence-data")
local types... | 1,771 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/src/generated/alphabetic-data.luau | luau | .luau | -- This file was @generated by .lute/generate.luau. Do not edit.
local base64 = require("../base64")
local rangeData = base64.decode(
buffer.fromstring(
"QQAAAFoAIABhAAAAegAgAKoAAACqACAAtQAAALUAIAC6AAAAugAgAMAAAADWACAA2AAAAPYAIAD4AAAAwQIgAMYCAADRAiAA4AIAAOQCIADsAgAA7AIgAO4CAADuAiAARQMAAEUDIABjAwAAdAMgAHYDAAB3AyAAegM... | 5,230 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/src/generated/emoji-data.luau | luau | .luau | -- This file was @generated by .lute/generate.luau. Do not edit.
local base64 = require("../base64")
local rangeData = base64.decode(
buffer.fromstring(
"qQAAAKkAIACuAAAArgAgADwgAAA8ICAASSAAAEkgIAAiIQAAIiEgADkhAAA5ISAAlCEAAJkhIACpIQAAqiEgABojAAAbIyAAKCMAACgjIADPIwAAzyMgAOkjAADzIyAA+CMAAPojIADCJAAAwiQgAKolAACrJSAAtiU... | 1,201 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/src/generated/incb-data.luau | luau | .luau | -- This file was @generated by .lute/generate.luau. Do not edit.
local base64 = require("../base64")
local rangeData = base64.decode(
buffer.fromstring(
"FQkAADkJIABNCQAATQlAAFgJAABfCSAAeAkAAH8JIACVCQAAqAkgAKoJAACwCSAAsgkAALIJIAC2CQAAuQkgAM0JAADNCUAA3AkAAN0JIADfCQAA3wkgAPAJAADxCSAAlQoAAKgKIACqCgAAsAogALIKAACzCiAAtQo... | 767 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/src/generated/numeric-data.luau | luau | .luau | -- This file was @generated by .lute/generate.luau. Do not edit.
local base64 = require("../base64")
local rangeData = base64.decode(
buffer.fromstring(
"MAAAADkAIACyAAAAswAgALkAAAC5ACAAvAAAAL4AIABgBgAAaQYgAPAGAAD5BiAAwAcAAMkHIABmCQAAbwkgAOYJAADvCSAA9AkAAPkJIABmCgAAbwogAOYKAADvCiAAZgsAAG8LIAByCwAAdwsgAOYLAADyCyAAZgw... | 1,118 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/src/generated/word-data.luau | luau | .luau | -- This file was @generated by .lute/generate.luau. Do not edit.
local base64 = require("../base64")
local rangeData = base64.decode(
buffer.fromstring(
"CgAAAAoAIAELAAAADACgAQ0AAAANAEAAIAAAACAAIAIiAAAAIgBgACcAAAAnAAACLAAAACwAYAEuAAAALgCAATAAAAA5AMABOgAAADoAQAE7AAAAOwBgAUEAAABaACAAXwAAAF8AoABhAAAAegAgAIUAAACFAKABqgA... | 7,698 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/src/grapheme.luau | luau | .luau | --!native
--!optimize 2
local core = require("./core")
local graphemeData = require("./generated/grapheme-data")
local types = require("./types")
type Segment = types.GraphemeSegment
local categories = graphemeData.categories
local GC_ANY = categories.Any
local GC_CR = categories.CR
local GC_CONTROL = categories.Con... | 1,304 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/src/init.luau | luau | .luau | local core = require("@self/core")
local grapheme = require("@self/grapheme")
local graphemeData = require("@self/generated/grapheme-data")
local sentence = require("@self/sentence")
local sentenceData = require("@self/generated/sentence-data")
local types = require("@self/types")
local word = require("@self/word")
loc... | 536 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/src/sentence.luau | luau | .luau | --!native
--!optimize 2
local core = require("./core")
local sentenceData = require("./generated/sentence-data")
local types = require("./types")
type Segment = types.SentenceSegment
local categories = sentenceData.categories
local SC_ATERM = categories.ATerm
local SC_CR = categories.CR
local SC_CLOSE = categories.... | 1,999 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/src/types.luau | luau | .luau | export type Range = {
from: number,
to: number,
category: number,
}
export type Segment = {
segment: string,
index: number,
}
export type WordSegment = {
segment: string,
index: number,
isWordLike: boolean,
}
export type SentenceSegment = Segment
export type GraphemeSegment = Segment
return nil
| 73 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/src/word.luau | luau | .luau | --!native
--!optimize 2
local core = require("./core")
local emojiData = require("./generated/emoji-data")
local types = require("./types")
local wordData = require("./generated/word-data")
type WordSegment = types.WordSegment
local categories = wordData.categories
local WC_ANY = categories.Any
local WC_ALETTER = ca... | 3,323 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/tests/codegen.test.luau | luau | .luau | local fs = require("@std/fs")
local test = require("@std/test")
local base64 = require("@src/base64")
local core = require("@src/core")
local parseProperties = require("../.lute/lib/parse-properties").parseProperties
local parseTests = require("../.lute/lib/parse-tests").parseTestData
local emitModule = require("../.... | 675 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/tests/grapheme.test.luau | luau | .luau | local test = require("@std/test")
local segmenter = require("@src")
local testData = require("./test-data")
test.suite("GraphemeBreakTest", function(suite)
for index, entry in testData.grapheme do
suite:case(`case_{index}`, function(assert)
local result = segmenter.splitGraphemes(entry.input)
assert.eq(entry... | 815 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/tests/sentence.test.luau | luau | .luau | local test = require("@std/test")
local segmenter = require("@src")
local testData = require("./test-data")
test.suite("SentenceBreakTest", function(suite)
for index, entry in testData.sentence do
suite:case(`case_{index}`, function(assert)
local result = segmenter.splitSentences(entry.input)
assert.eq(entry... | 368 |
grilme99/unicode-segmentation | grilme99-unicode-segmentation-5087607/tests/word.test.luau | luau | .luau | local test = require("@std/test")
local segmenter = require("@src")
local testData = require("./test-data")
local types = require("@src/types")
local wordRuntime = require("@src/word")
local function collectWordLike(input: string): { string }
local segments = segmenter.words(input)
local output = {}
for _, entry i... | 2,298 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/.lune/mock-signal.luau | luau | .luau | --[[
Copyright © 2024 Stephen Leitnick
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, modify, merge, publish, distribute... | 2,902 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/.lune/tests.luau | luau | .luau | local roblox = require("@lune/roblox")
local fs = require("@lune/fs")
local luau = require("@lune/luau")
local process = require("@lune/process")
local stdio = require("@lune/stdio")
local task = require("@lune/task")
local signal = require("mock-signal")
local testPlacePath = process.args[1]
local game = roblox.dese... | 636 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/base-components/base-button-animation.ts | roblox-ts | .ts | import type { OnStart } from "@flamework/core";
import { BaseComponent } from "@flamework/components";
import { Janitor } from "@rbxts/janitor";
export default abstract class BaseButtonAnimation<A extends {} = {}, I extends GuiButton = GuiButton> extends BaseComponent<A, I> implements OnStart {
protected readonly in... | 247 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/base-components/button-tween-animation.ts | roblox-ts | .ts | import type { OnStart } from "@flamework/core";
import type { TweenInfoBuilder } from "@rbxts/builders";
import BaseButtonAnimation from "./base-button-animation";
export default abstract class ButtonTweenAnimation<A extends {} = {}, I extends GuiButton = GuiButton> extends BaseButtonAnimation<A, I> implements OnStar... | 112 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/base-components/camera.ts | roblox-ts | .ts | import { BaseComponent } from "@flamework/components";
import { Workspace as World } from "@rbxts/services";
const { rad } = math;
export class CameraComponent<A extends {} = {}> extends BaseComponent<A, Camera> {
protected readonly offsets: CFrame[] = [];
public toggle(on: boolean): void {
World.CurrentCame... | 204 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/classes/procedural-animation-host.ts | roblox-ts | .ts | import { getChildrenOfType } from "@rbxts/instance-utility";
import { processDependency } from "@rbxts/flamework-meta-utils";
import Object from "@rbxts/object-utils";
import { createMappingDecorator, getInstanceAtPath } from "shared/utility/meta";
const { min } = math;
type ProceduralAnimationDecoratorArgs = [targe... | 532 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/classes/procedural-animations/mouse-sway.ts | roblox-ts | .ts | import Iris from "@rbxts/iris";
import { Singleton } from "shared/decorators";
import { Spring } from "shared/classes/spring";
import { doubleSidedLimit } from "shared/utility/numbers";
import { ProceduralAnimation, BaseProceduralAnimation, ProceduralAnimationTarget } from "../procedural-animation-host";
import type {... | 519 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/classes/procedural-animations/walk-cycle.ts | roblox-ts | .ts | import Wave from "@rbxts/wave";
import { Singleton } from "shared/decorators";
import { Spring } from "shared/classes/spring";
import { ProceduralAnimation, BaseProceduralAnimation, ProceduralAnimationTarget } from "../procedural-animation-host";
import type { CharacterController } from "client/controllers/character"... | 507 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/components/cameras/aerial.ts | roblox-ts | .ts | import { Dependency, type OnRender } from "@flamework/core";
import { Component, type Components } from "@flamework/components";
import { Workspace as World } from "@rbxts/services";
import { $nameof } from "rbxts-transform-debug";
import { Player } from "client/utility";
import { CameraComponent } from "client/base-... | 358 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/components/cameras/default.ts | roblox-ts | .ts | import { Dependency } from "@flamework/core";
import { Component, type Components } from "@flamework/components";
import { Workspace as World } from "@rbxts/services";
import { $nameof } from "rbxts-transform-debug";
import { Player } from "client/utility";
import { CameraComponent } from "client/base-components/came... | 204 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/components/cameras/first-person-animated.ts | roblox-ts | .ts | import { Dependency, type OnRender } from "@flamework/core";
import { Component, type Components } from "@flamework/components";
import { Workspace as World } from "@rbxts/services";
import { $nameof } from "rbxts-transform-debug";
import { ProceduralAnimationHost } from "client/classes/procedural-animation-host";
im... | 318 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/components/cameras/first-person.ts | roblox-ts | .ts | import { Dependency } from "@flamework/core";
import { Component, type Components } from "@flamework/components";
import { Workspace as World } from "@rbxts/services";
import { $nameof } from "rbxts-transform-debug";
import { Player } from "client/utility";
import { CameraComponent } from "client/base-components/came... | 334 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/components/cameras/fixed.ts | roblox-ts | .ts | import { Dependency } from "@flamework/core";
import { Component, type Components } from "@flamework/components";
import { Workspace as World } from "@rbxts/services";
import { $nameof } from "rbxts-transform-debug";
import { Player } from "client/utility";
import { CameraComponent } from "client/base-components/camer... | 216 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/components/cameras/fly-on-the-wall.ts | roblox-ts | .ts | import { Dependency, type OnRender } from "@flamework/core";
import { Component, type Components } from "@flamework/components";
import { Workspace as World } from "@rbxts/services";
import { $nameof } from "rbxts-transform-debug";
import { Player } from "client/utility";
import { CameraComponent } from "client/base-... | 291 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/components/ui/animations/gradient.ts | roblox-ts | .ts | import { OnStart } from "@flamework/core";
import { Component } from "@flamework/components";
import { TweenInfoBuilder } from "@rbxts/builders";
import { tween } from "@rbxts/instance-utility";
import { $nameof } from "rbxts-transform-debug";
import ButtonTweenAnimation from "client/base-components/button-tween-anima... | 279 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/components/ui/animations/rotation.ts | roblox-ts | .ts | import { OnStart } from "@flamework/core";
import { Component } from "@flamework/components";
import { TweenInfoBuilder } from "@rbxts/builders";
import { tween } from "@rbxts/instance-utility";
import { $nameof } from "rbxts-transform-debug";
import ButtonTweenAnimation from "client/base-components/button-tween-anima... | 271 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/components/ui/animations/scale.ts | roblox-ts | .ts | import { OnStart } from "@flamework/core";
import { Component } from "@flamework/components";
import { TweenInfoBuilder } from "@rbxts/builders";
import { tween } from "@rbxts/instance-utility";
import { $nameof } from "rbxts-transform-debug";
import ButtonTweenAnimation from "client/base-components/button-tween-anima... | 300 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/components/ui/animations/spring-scale.ts | roblox-ts | .ts | import { OnRender, OnStart } from "@flamework/core";
import { Component } from "@flamework/components";
import { $nameof } from "rbxts-transform-debug";
import { Spring } from "shared/classes/spring";
import BaseButtonAnimation from "client/base-components/base-button-animation";
interface Attributes {
readonly Sp... | 372 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/components/ui/animations/transparency.ts | roblox-ts | .ts | import { OnStart } from "@flamework/core";
import { Component } from "@flamework/components";
import { TweenInfoBuilder } from "@rbxts/builders";
import { tween } from "@rbxts/instance-utility";
import { $nameof } from "rbxts-transform-debug";
import ButtonTweenAnimation from "client/base-components/button-tween-anima... | 280 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/components/ui/page-route.ts | roblox-ts | .ts | import type { OnStart } from "@flamework/core";
import { Component } from "@flamework/components";
import { getChildrenOfType } from "@rbxts/instance-utility";
import { $nameof } from "rbxts-transform-debug";
import { PlayerGui } from "client/utility";
import DestroyableComponent from "shared/base-components/destroya... | 276 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/components/ui/smooth-list-layout.ts | roblox-ts | .ts | import type { OnStart } from "@flamework/core";
import { Component } from "@flamework/components";
import { TweenInfoBuilder } from "@rbxts/builders";
import { getChildrenOfType, tween } from "@rbxts/instance-utility";
import { endsWith } from "@rbxts/string-utils";
import { $nameof } from "rbxts-transform-debug";
imp... | 475 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/components/ui/version-label.ts | roblox-ts | .ts | import type { OnStart } from "@flamework/core";
import { Component, BaseComponent } from "@flamework/components";
import { $git, $nameof } from "rbxts-transform-debug";
import type { LogStart } from "shared/hooks";
import { PlayerGui } from "client/utility";
@Component({
tag: $nameof<VersionLabel>(),
ancestorWhit... | 137 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/controllers/audio.ts | roblox-ts | .ts | import { Controller } from "@flamework/core";
import { Workspace as World, SoundService as Sound } from "@rbxts/services";
import { Events } from "client/network";
import { ReplicationOptions, SerializedReplicable } from "shared/classes/replicable";
import { Serializers } from "shared/network";
import { PlaySoundOptio... | 386 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/controllers/camera.ts | roblox-ts | .ts | import { Controller, OnRender, type OnInit } from "@flamework/core";
import { Workspace as World } from "@rbxts/services";
import { Lazy } from "@rbxts/lazy";
import Object from "@rbxts/object-utils";
import Iris from "@rbxts/iris";
import type { LogStart } from "shared/hooks";
import { DefaultCamera } from "client/co... | 767 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/controllers/control-panel.ts | roblox-ts | .ts | import { Controller, type OnStart } from "@flamework/core";
import { StandardActionBuilder } from "@rbxts/mechanism";
import { processDependency } from "@rbxts/flamework-meta-utils";
import Iris from "@rbxts/iris";
import type { LogStart } from "shared/hooks";
import { OnInput } from "client/decorators";
import { Play... | 613 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/controllers/input.ts | roblox-ts | .ts | import { Controller } from "@flamework/core";
import { StandardActionBuilder } from "@rbxts/mechanism";
import type { LogStart } from "shared/hooks";
import { OnInput, OnInputRelease } from "client/decorators";
export const enum ActionID {
LMB,
RMB,
MMB,
LeftTrigger,
RightTrigger,
Crouch
}
/** Handles al... | 177 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/controllers/mouse.ts | roblox-ts | .ts | import { Controller, type OnInit, type OnRender } from "@flamework/core";
import { UserInputService as UserInput, Workspace as World } from "@rbxts/services";
import { AxisAction, AxisActionBuilder, StandardActionBuilder } from "@rbxts/mechanism";
import { RaycastParamsBuilder } from "@rbxts/builders";
import Charm, { ... | 1,535 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/controllers/performance-stats.ts | roblox-ts | .ts | import { Controller } from "@flamework/core";
import { Workspace as World, Stats } from "@rbxts/services";
import { eMath } from "@rbxts/atlas";
import Iris from "@rbxts/iris";
import { roundDecimal } from "shared/utility/numbers";
import type { ControlPanelDropdownRenderer } from "shared/structs/control-panel";
impo... | 743 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/controllers/ui-effects.ts | roblox-ts | .ts | import { Controller } from "@flamework/core";
import { TweenInfoBuilder } from "@rbxts/builders";
import { Lazy } from "@rbxts/lazy";
import { tween } from "@rbxts/instance-utility";
import type { LogStart } from "shared/hooks";
import { PlayerGui } from "client/utility";
@Controller()
export class UIEffectsControlle... | 407 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/decorators.ts | roblox-ts | .ts | import { Modding } from "@flamework/core";
import { InputManager, StandardAction, AxisAction } from "@rbxts/mechanism";
import { callMethodOnDependency } from "@rbxts/flamework-meta-utils";
import type { ClientReceiver as ClientEventReceiver } from "@flamework/networking/out/events/types";
import type { ClientReceiver ... | 861 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/client/utility.ts | roblox-ts | .ts | import { Players } from "@rbxts/services";
export const Player = Players.LocalPlayer;
export const PlayerGui = Player.WaitForChild<PlayerGui>("PlayerGui"); | 33 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/scripts/run-tests.server.ts | roblox-ts | .ts | import { TestRunner } from "@rbxts/runit";
import { ServerScriptService } from "@rbxts/services";
const testRunner = new TestRunner(
ServerScriptService.WaitForChild("Tests")
);
testRunner.run({ colors: true }); | 52 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/server/cmdr/commands/set-data.ts | roblox-ts | .ts | import type { CommandDefinition } from "@rbxts/cmdr";
export = identity<CommandDefinition>({
Name: "set-data",
Aliases: ["data-set"],
Description: "Set the data at the given directory to the given value",
Group: "Dev",
Args: [
{
Type: "string",
Name: "Directory",
Description: "Directory... | 124 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/server/cmdr/commands/set-dataServer.ts | roblox-ts | .ts | import { Firebase } from "@rbxts/firebase";
import type { CommandContext } from "@rbxts/cmdr";
import { getFirebaseInfo } from "server/services/third-party/data";
export = async function (context: CommandContext, directory: string, value: unknown): Promise<void> {
try {
const firebase = new Firebase(...await ge... | 148 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/server/cmdr/start.server.ts | roblox-ts | .ts | import { Cmdr } from "@rbxts/cmdr";
const parent = script.Parent as Folder;
Cmdr.RegisterDefaultCommands();
Cmdr.RegisterCommandsIn(parent.WaitForChild<Folder>("commands"));
Cmdr.RegisterTypesIn(parent.WaitForChild<Folder>("types"));
Cmdr.RegisterHooksIn(parent.WaitForChild<Folder>("hooks")) | 66 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/server/cmdr/types/any.ts | roblox-ts | .ts | import type { Registry } from "@rbxts/cmdr";
import { isNaN } from "shared/utility/numbers";
export = function (registry: Registry): void {
registry.RegisterType("any", {
Parse: value => {
if (tonumber(value) !== undefined && !isNaN(tonumber(value)!))
return tonumber(value)!;
else if (value ... | 132 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/server/decorators.ts | roblox-ts | .ts | import { callMethodOnDependency } from "@rbxts/flamework-meta-utils";
import type { Serializer } from "@rbxts/flamework-binary-serializer";
import type { ServerReceiver as ServerEventReceiver } from "@flamework/networking/out/events/types";
import type { ServerReceiver as ServerFunctionReceiver } from "@flamework/netwo... | 441 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/server/hook-managers/players.ts | roblox-ts | .ts | import { Service, Modding, type OnStart } from "@flamework/core";
import { Players } from "@rbxts/services";
import type { OnPlayerJoin, OnPlayerLeave } from "server/hooks";
@Service({ loadOrder: 1 })
export class PlayersService implements OnStart {
public onStart(): void {
const joinListeners = new Set<OnPlaye... | 255 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/server/services/third-party/data.ts | roblox-ts | .ts | import { Service, type OnInit } from "@flamework/core";
import { DataStoreService as Data } from "@rbxts/services";
import { Firebase } from "@rbxts/firebase";
import Signal from "@rbxts/signal";
import type { LogStart } from "shared/hooks";
import type { OnPlayerJoin, OnPlayerLeave } from "server/hooks";
import { Eve... | 1,027 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/server/services/transactions.ts | roblox-ts | .ts | import { OnInit, Service } from "@flamework/core";
import { MarketplaceService as Market, Players } from "@rbxts/services";
import { DataService } from "./third-party/data";
import Log from "shared/log";
type RewardHandler = (player: Player) => void;
const enum ProductIDs {
// Gold5000 = 1620635951,
}
@Service()
e... | 367 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/shared/base-components/destroyable.ts | roblox-ts | .ts | import { BaseComponent } from "@flamework/components";
import { Janitor } from "@rbxts/janitor";
export default class DestroyableComponent<A extends {} = {}, I extends Instance = Instance> extends BaseComponent<A, I> {
protected readonly janitor = new Janitor;
public destroy(): void {
if (!("Destroy" in this.... | 90 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/shared/classes/replicable.ts | roblox-ts | .ts | import type {
ClientReceiver as ClientEventReceiver,
ClientSender as ClientEventSender,
ServerSender as ServerEventSender,
ServerReceiver as ServerEventReceiver
} from "@flamework/networking/out/events/types";
import type { Serializer } from "@rbxts/flamework-binary-serializer";
import { Players, ServerScriptSe... | 807 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/shared/classes/spring.ts | roblox-ts | .ts | import Iris from "@rbxts/iris";
import { isNaN } from "shared/utility/numbers";
import type { ControlPanelDropdownRenderer } from "shared/structs/control-panel";
const { ceil, min, huge: INF } = math;
/*
If delta time in the spring class is lower than this value,
it will split up the update into multiple smaller... | 875 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/shared/constants.ts | roblox-ts | .ts | import { ReplicatedFirst, RunService as Runtime } from "@rbxts/services";
import Object from "@rbxts/object-utils";
import Signal from "@rbxts/signal";
enum DevID {
Runic = 44966864
}
const DEVELOPERS = new Set(Object.values(DevID)); // add extra developer user IDs here
export function isDeveloper(player: Player):... | 118 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/shared/data-models/player-data.ts | roblox-ts | .ts | import type { DataType } from "@rbxts/flamework-binary-serializer";
export const INITIAL_GLOBAL_DATA: GlobalData = {
};
export interface GlobalData {
}
export const INITIAL_DATA: PlayerData = {
coins: 0,
purchaseHistory: []
};
export interface PlayerData {
readonly coins: DataType.u32;
readonly purchaseHi... | 75 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/shared/decorators.ts | roblox-ts | .ts | import { Modding, Reflect } from "@flamework/core";
import { RunService as Runtime } from "@rbxts/services";
import { roundDecimal } from "./utility/numbers";
import Log from "./log";
/**
* Request the required metadata for lifecycle events and dependency resolution.
* @metadata flamework:implements flamework:param... | 1,320 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/shared/iris-utility.ts | roblox-ts | .ts | import Wave from "@rbxts/wave";
import Iris from "@rbxts/iris";
export function createWaveTree(wave: Wave, name = "Wave"): Wave {
let resultWave = wave;
Iris.Tree([name]);
{
const useSin = Iris.Checkbox(["Is Sine Wave?"], { isChecked: Iris.State(wave.waveFunction === math.sin) });
const amplitude = Iris... | 504 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/shared/log.ts | roblox-ts | .ts | import { BaseComponent } from "@flamework/components";
import { RunService as Runtime, Players } from "@rbxts/services";
import { Logger, OutputStream } from "@rbxts/ez-log";
import { getName } from "@rbxts/flamework-meta-utils";
function getInstancePath(instance: Instance): string {
let path = instance.GetFullName(... | 351 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/shared/network.ts | roblox-ts | .ts | import { Networking } from "@flamework/networking";
import { createBinarySerializer } from "@rbxts/flamework-binary-serializer";
import type { PlayerData } from "./data-models/player-data";
import type { AudioPacket } from "./structs/packets";
import type { ReplicationOptions } from "./classes/replicable";
type Seria... | 260 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/shared/utility/meta.ts | roblox-ts | .ts | import { Modding } from "@flamework/core";
import { t } from "@rbxts/t";
/** @hidden */
function _getInstanceAtPath([paths]: string[][]): Maybe<Instance> {
let instance: Maybe<Instance> = game;
for (const path of paths) {
if (instance === undefined) break;
instance = instance.FindFirstChild(path);
}
... | 366 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/tests/meta-utility/safe-cast-test.ts | roblox-ts | .ts | import { Modding } from "@flamework/core";
import { Fact, Assert } from "@rbxts/runit";
import { t } from "@rbxts/t";
import { safeCast } from "shared/utility/meta";
interface Foo {
readonly foo: number;
}
class SafeCastTest {
@Fact
public generatesTypeGuard(): void {
this.checkFoo();
}
@Fact
public... | 226 |
R-unic/flamework-template | R-unic-flamework-template-ce0854c/src/tests/number-utility-test.ts | roblox-ts | .ts | import { Theory, InlineData, Assert } from "@rbxts/runit";
import { doubleSidedLimit, roundDecimal, toNearestFiveOrTen, zeroIfClose } from "shared/utility/numbers";
class NumberUtilityTest {
@Theory
@InlineData(69, 10)
@InlineData(-69, -10)
public limitsNumberOnBothSigns(input: number, expected: number): void... | 335 |
Dionysusnu/rbxts-rust-classes | Dionysusnu-rbxts-rust-classes-341fcc3/tests/src/main.server.ts | roblox-ts | .ts | import type TestEZType from "@rbxts/testez";
const TestEZ = require(game.GetService("ReplicatedStorage").include.node_modules["@rbxts"].testez.src) as TestEZType;
const results = TestEZ.TestBootstrap.run([game.GetService("ServerScriptService").tests]);
if (results.errors.size() > 0 || results.failureCount > 0) {
error... | 84 |
osyrisrblx/rbxts-build | osyrisrblx-rbxts-build-629f578/scripts/model_export.luau | luau | .luau | local fs = require("@lune/fs")
local roblox = require("@lune/roblox")
local process = require("@lune/process")
local placePath = process.args[1]
local game = roblox.deserializePlace(fs.readFile(placePath))
local Workspace = game:GetService("Workspace")
for _, folder in Workspace:GetChildren() do
if folder.ClassN... | 158 |
osyrisrblx/rbxts-build | osyrisrblx-rbxts-build-629f578/scripts/model_import.luau | luau | .luau | -- luacheck: globals Instance
local fs = require("@lune/fs")
local roblox = require("@lune/roblox")
local process = require("@lune/process")
local Instance = roblox.Instance
local game = Instance.new("DataModel")
local Workspace = game:GetService("Workspace")
local args = table.clone(process.args)
local placePath =... | 150 |
osyrisrblx/rbxts-build | osyrisrblx-rbxts-build-629f578/scripts/sync.luau | luau | .luau | local fs = require("@lune/fs")
local roblox = require("@lune/roblox")
local process = require("@lune/process")
local placeFilePath = process.args[1]
local outPath = process.args[2]
local game = roblox.deserializePlace(fs.readFile(placeFilePath))
local SERVICE_BLACKLIST = {
StarterPlayer = true,
}
local output = ""... | 485 |
bytexenon/luau-rng-cracker | bytexenon-luau-rng-cracker-39872fc/main.luau | luau | .luau | --[[
uint64_t seed = uintptr_t(L);
seed ^= time(NULL);
seed ^= clock();
pcg32_seed(&L->global->rngstate, seed);
The only unknown variable we have is the (curtime - startup time) offset in the seeding.
But it has a relatively small range, so we can brute-force it.
--]]
local expected = math.random(2 ^ 28)... | 1,717 |
R-unic/serio | R-unic-serio-e1997cd/.lune/fix-lcov-paths.luau | luau | .luau | local fs = require("@lune/fs") :: fs
local path = "coverage/lcov.info"
local lcov = fs.readFile(path)
lcov = lcov:gsub("\\", "/")
fs.writeFile(path, lcov)
| 47 |
R-unic/serio | R-unic-serio-e1997cd/.lune/mock-signal.luau | luau | .luau | --[[
Copyright © 2024 Stephen Leitnick
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, modify, merge, publish, distribute... | 2,910 |
R-unic/serio | R-unic-serio-e1997cd/.lune/tests.luau | luau | .luau | local roblox = require("@lune/roblox") :: roblox
local fs = require("@lune/fs") :: fs
local luau = require("@lune/luau") :: luau
local process = require("@lune/process") :: process
local serde = require("@lune/serde") :: serde
local task = require("@lune/task") :: task
local signal = require("./mock-signal")
local te... | 1,140 |
R-unic/serio | R-unic-serio-e1997cd/src/deserializer.ts | roblox-ts | .ts | import { sizeOfNumberType, sign, CF__add } from "./utility";
import { f24 } from "./utility/f24";
import { f16 } from "./utility/f16";
import { u24 } from "./utility/u24";
import { u12 } from "./utility/u12";
import { i24 } from "./utility/i24";
import { i12 } from "./utility/i12";
import { AXIS_ALIGNED_ORIENTATIONS, C... | 3,369 |
R-unic/serio | R-unic-serio-e1997cd/src/info-processing.ts | roblox-ts | .ts | import { SerializerSchema } from "./types";
import { getSortedEnumItems } from "./utility";
const { max, ceil } = math;
const enum IterationFlags {
Default = 0,
SizeUnknown = 1 << 0,
Packed = 1 << 1
}
export interface ProcessedInfo {
readonly flags: IterationFlags;
readonly schema: SerializerSchema;
read... | 1,558 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.