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 |
|---|---|---|---|---|---|
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/optimism/entryTypes.lua | luau | .lua | --[[
* Copyright (c) 2016 Ben Newman
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
-- ROBLOX no upstream
local srcWorkspace = script.Parent.Parent
local rootWorkspace = srcWorkspace.Parent
local depTypesModule = require(script.Pare... | 575 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/utilities/common/global.lua | luau | .lua | --[[
* Copyright (c) 2021 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.)
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
-- ROBLOX deviation: this was to support webpack logic, logic which is needed in luau
local exports ... | 187 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/utilities/common/maybe.lua | luau | .lua | --[[
* Copyright (c) 2021 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.)
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
-- ROBLOX deviation: this was to support webpack logic, logic which is needed in luau
local exports ... | 181 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/utilities/globals/null.lua | luau | .lua | --[[
* Copyright (c) 2021 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.)
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
local srcWorkspace = script.Parent.Parent.Parent
local rootWorkspace = srcWorkspace.Parent
local Lu... | 140 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/utilities/graphql/types.lua | luau | .lua | --[[
* Copyright (c) 2021 Apollo Graph, Inc. (Formerly Meteor Development Group, Inc.)
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
-- ROBLOX note: extracted from storeUtils to break circular dependencies
-- policies_types.lua:55:28... | 363 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/wry/context/init.lua | luau | .lua | --[[
* Copyright (c) 2019-2021 Ben Newman <ben@eloper.dev>
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
-- ROBLOX no upstream
local contextModule = require(script.context)
export type Slot<T> = contextModule.Slot<T>
return context... | 82 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/wry/trie/init.lua | luau | .lua | --[[
* Copyright (c) 2019-2021 Ben Newman <ben@eloper.dev>
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
-- ROBLOX no upstream
local trieModule = require(script.trie)
export type Trie<Data> = trieModule.Trie<Data>
return trieModul... | 83 |
LDGerrits/rogen | LDGerrits-rogen-de23f4a/src/config.ts | roblox-ts | .ts | import fs from "fs";
import path from "path";
import { Environment, Config, Mode, RojoTree, RojoNode } from "./types.js";
import { defaultConfig, defaultProject } from "./constants.js";
import { Logger } from "./logger.js";
type ConfigKeys = keyof {
[K in keyof Config as string extends K
? never
: number extends ... | 3,478 |
LDGerrits/rogen | LDGerrits-rogen-de23f4a/src/constants.ts | roblox-ts | .ts | import { RoutingMaps } from "./route.js";
import { Config, RojoTree } from "./types.js";
export const version = "1.4.1";
export const defaultProject: RojoTree = {
name: "roblox-game",
tree: { $className: "DataModel" },
};
export const defaultConfig: Config = {
source: ["src"],
tags: {},
verbatim: false,
casing... | 794 |
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 |
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/cmdr.client.ts | roblox-ts | .ts | import { CmdrClient as Cmdr } from "@rbxts/cmdr";
Cmdr.SetActivationKeys([Enum.KeyCode.F2]); | 28 |
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 |
R-unic/tether | R-unic-tether-0c861e7/.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 task = require("@lune/task")
local signal = require("./mock-signal")
local testPlacePath = process.args[1]
local game = roblox.deserializePlace(fs.readFile(testPlaceP... | 1,303 |
R-unic/tether | R-unic-tether-0c861e7/src/emitters/contextual-emitter.ts | roblox-ts | .ts | import type { MessageEmitter } from "./message-emitter";
import type { BaseMessage, MessageCallback, FunctionMessageCallback } from "../structs";
import { RunService } from "@rbxts/services";
import { Error } from "../logging";
type Cleanup = () => void;
export abstract class ContextualEmitter<MessageData> {
public... | 584 |
R-unic/tether | R-unic-tether-0c861e7/src/relayer.ts | roblox-ts | .ts | import { ReplicatedStorage, RunService } from "@rbxts/services";
import { getAllPacketsWhich, isReliable, isUnreliable, shouldBatch } from "\./utility";
import type { BaseMessage, MessageEvent, PacketInfo, SerializedPacket } from "./structs";
import type { MessageEmitter } from "./emitters/message-emitter";
export ty... | 1,439 |
R-unic/tether | R-unic-tether-0c861e7/src/serdes.ts | roblox-ts | .ts | import type { Modding } from "@flamework/core";
import type { Serializer, SerializerMetadata } from "@rbxts/serio";
import createSerializer from "@rbxts/serio";
import { createMessageBuffer } from "./utility";
import type { BaseMessage, SerializedPacket } from "./structs";
export class Serdes<MessageData> {
public ... | 486 |
R-unic/tether | R-unic-tether-0c861e7/src/structs.ts | roblox-ts | .ts | import type { Modding } from "@flamework/core";
import type { SerializerMetadata, SerializedData, StripMeta } from "@rbxts/serio";
export type MessageCallback<T = unknown> = ServerMessageCallback<T> | ClientMessageCallback<T>;
export type FunctionMessageCallback<T = unknown, R = unknown> = ServerFunctionMessageCallbac... | 321 |
R-unic/tether | R-unic-tether-0c861e7/tests/src/run-tests.server.ts | roblox-ts | .ts | import { TestRunner } from "@rbxts/runit";
const testRunner = new TestRunner(game.GetService("ReplicatedStorage").WaitForChild("Tests"));
testRunner.run({ colors: true }).await(); | 43 |
techs-sus/azalea | techs-sus-azalea-3cc54cb/encoding/__tests__/expectedValueHelper.luau | luau | .luau | local ServerScriptService = game:GetService("ServerScriptService")
local Decoder = require(ServerScriptService.Decoder.decoder)
return function(expect)
return function(payload: buffer, expectedClassName: string, expectedValue: any)
return function(_, done)
local root = Decoder(payload)
expect(root).toEqual(ex... | 127 |
techs-sus/azalea | techs-sus-azalea-3cc54cb/encoding/oldDecoder.luau | luau | .luau | --!native
--!optimize 2
-- TODO: Ensure decoded output is sane and correct
local TYPE_ID = table.freeze({
String = 0,
Attributes = 1,
Axes = 2,
Bool = 3,
BrickColor = 4,
CFrame = 5,
Color3 = 6,
Color3uint8 = 7,
ColorSequence = 8,
Enum = 9,
Faces = 10,
Float32 = 11,
Float64 = 12,
Int32 = 13,
MaterialCol... | 5,940 |
techs-sus/azalea | techs-sus-azalea-3cc54cb/scripts/runTests.luau | luau | .luau | local ServerScriptService = game:GetService("ServerScriptService")
local runCLI = require(ServerScriptService.DevPackages.Jest).runCLI
local processServiceExists, ProcessService = pcall(function()
return game:GetService("ProcessService")
end)
local status, result = runCLI(ServerScriptService.Decoder, {
verbose = tr... | 167 |
techs-sus/azalea | techs-sus-azalea-3cc54cb/src/luau/base122.luau | luau | .luau | --!native
--!optimize 2
--!strict
--[[
Base122 - A space efficent alternative to base-64.
>>> https://blog.kevinalbs.com/base122
]]
-- to create Base123, we comment out ampersand being illegal...
local kIllegals = {
0, -- null
10, -- newline
13, -- carriage return
34, -- double quote
-- 38, -- SKIP! ampersand,... | 1,230 |
techs-sus/azalea | techs-sus-azalea-3cc54cb/src/luau/mergedCombinator.luau | luau | .luau | --!native
--!optimize 2
--!strict
-- to create Base123, we comment out ampersand being illegal...
local kIllegals = table.freeze({
0, -- null
10, -- newline
13, -- carriage return
34, -- double quote
-- 38, -- SKIP! ampersand, without this being illegal we have base123
92, -- backslash
})
-- local kShortened = ... | 639 |
techs-sus/azalea | techs-sus-azalea-3cc54cb/src/luau/minifiedCombinator.luau | luau | .luau | local a,b=table.freeze({0,10,13,34,92}),bit32 local c,d,e=b.lshift,b.rshift,b.band local f=function(f)local g,h,i=0,0,0 for j,k in utf8.codes(f)do if k>127 then local l=e(d(k,8),7)i+=if l~=0b111 then 1 else 0 end i+=1 while i~=0 do h+=7 if h>=8 then g+=1 h-=8 end i-=1 end end local j=buffer.create(g)g,h,i=0,0,0 local k... | 235 |
R-unic/serio | R-unic-serio-1313e44/.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-1313e44/.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-1313e44/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,375 |
R-unic/serio | R-unic-serio-1313e44/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 |
R-unic/serio | R-unic-serio-1313e44/src/serializer.ts | roblox-ts | .ts |
import { sizeOfNumberType, sign, CF__index, fuzzyEq, isNumberType, assertNumberRange, isNaN } from "./utility";
import { f8 } from "./utility/f8";
import { f16 } from "./utility/f16";
import { f24 } from "./utility/f24";
import { u12 } from "./utility/u12";
import { u24 } from "./utility/u24";
import { AXIS_ALIGNED_OR... | 4,913 |
R-unic/serio | R-unic-serio-1313e44/src/utility/fastcalls.luau | luau | .luau | local info = debug.info
local identity = CFrame.identity
local lune = string.sub(_VERSION, 1, 4) == "Lune"
local _, CF__index = xpcall(function()
return identity[nil]
end, function()
return info(2, "f")
end)
local _, CF__add = xpcall(function()
return identity + nil
end, function()
return info(2, "f")
end)
if lu... | 216 |
R-unic/serio | R-unic-serio-1313e44/src/utility/index.ts | roblox-ts | .ts | import { IS_LUNE } from "../constants";
import type { NumberType, Primitive } from "../types";
const { sort } = table;
const { magnitude } = vector;
export * from "./fastcalls";
export function assertNumberRange(n: number, sizeInBytes: number, signed: boolean, note?: string): void {
const sizeInBits = 8 * sizeInBy... | 708 |
R-unic/serio | R-unic-serio-1313e44/tests/src/run-tests.server.ts | roblox-ts | .ts | import { TestRunner } from "@rbxts/runit";
import { instrument, istanbul } from "@rbxts/coverage";
const http = game.GetService("HttpService");
const replicated = game.GetService("ReplicatedStorage");
instrument([replicated.WaitForChild("Library")]);
const testRunner = new TestRunner(replicated.WaitForChild("Tests"))... | 170 |
R-unic/serio | R-unic-serio-1313e44/tests/src/utility.ts | roblox-ts | .ts | import type { Modding } from "@flamework/core";
import { Assert } from "@rbxts/runit";
import type { Serializer, SerializerMetadata, SerializedData, String, Vector, u8, i32, u16 } from "../src/index";
import createSerializer from "../src/index";
export type NullableLiteralUnion = TestLiteralUnion | undefined;
export ... | 991 |
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 |
roblox-aurora/rbxts-transform-debug | roblox-aurora-rbxts-transform-debug-9cc03b5/src/class/symbolProvider.ts | roblox-ts | .ts | import path from "path";
import ts from "typescript";
import { TransformState } from "./transformState";
import fs from "fs";
import { isPathDescendantOf } from "../util/isPathDescendantOf";
import assert from "assert";
export const moduleResolutionCache = new Map<string, string | false>();
class FileSymbol {
privat... | 885 |
daimond113/rbxts-transformer-jecs | daimond113-rbxts-transformer-jecs-e89f5c9/src/index.ts | roblox-ts | .ts | import ts from "typescript"
import { type Config, TransformState } from "./transforms/index.js"
import { transformFile } from "./transforms/file.js"
const transformer: (
program: ts.Program,
config?: Partial<Config> & { resolutionHost?: ts.ModuleResolutionHost },
) => ts.TransformerFactory<ts.SourceFile> = (program,... | 154 |
daimond113/rbxts-transformer-jecs | daimond113-rbxts-transformer-jecs-e89f5c9/test/index.ts | roblox-ts | .ts | /// <reference types="vite/client" />
import { VirtualProject } from "roblox-ts"
import transformer from "../src/index.js"
import { resolve } from "path/posix"
export const compile = async (source: string): Promise<string> => {
const project = new VirtualProject()
project.tsTransformers.push((program) =>
transform... | 458 |
Bura-Games/data-structures | Bura-Games-data-structures-00bb85a/.lune/Contexts/DateTime.luau | luau | .luau | --!native
--!optimize 2
--!strict
--[[
MIT License
Copyright (c) 2024 BusyCityGuy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to ... | 403 |
Bura-Games/data-structures | Bura-Games-data-structures-00bb85a/.lune/Contexts/Debug.luau | luau | .luau | --!native
--!optimize 2
--!strict
--[[
MIT License
Copyright (c) 2024 BusyCityGuy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to ... | 398 |
Bura-Games/data-structures | Bura-Games-data-structures-00bb85a/.lune/Contexts/Random.luau | luau | .luau | --!optimize 2
--!strict
-- TODO: Reimplement actual Random library
export type PolyfillRandom = {
NextInteger: (self: PolyfillRandom, minimum: number, maximum: number) -> number,
}
type Static = {
new: (seed: number?) -> PolyfillRandom,
}
local Random = {} :: PolyfillRandom & Static;
(Random :: any).__index = Rand... | 143 |
Bura-Games/data-structures | Bura-Games-data-structures-00bb85a/.lune/Contexts/Utf8.luau | luau | .luau | --!native
--!optimize 2
--!strict
local LunePolyfill = require("@packages/LunePolyfill")
local Utf8 = setmetatable({
graphemes = LunePolyfill.Utf8.Graphemes;
}, {__index = utf8})
return Utf8
| 60 |
Bura-Games/data-structures | Bura-Games-data-structures-00bb85a/.lune/Packages/Debug.luau | luau | .luau | --!optimize 2
--!nonstrict
local TypeOf = require("@packages/TypeOf")
local Debug = {}
local TAB = "\t"
type GenericDictionary = {[string]: any}
type GenericTable = {[any]: any}
local Debug_Inspect: (...any) -> string
local REPLACERS = {
["Index ?"] = "__index";
["Newindex ?"] = "__newindex";
}
local function G... | 2,642 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.