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 |
|---|---|---|---|---|---|
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-pkg/rodeo/src/stream.luau | luau | .luau | -- Stream read/write/close primitives for handles returned by `fs.open`,
-- `io` stdio handles, and `process.create` stdio.
-- Bundled require: `local stream = require("@rodeo/stream")`.
--
-- NOTE: typedef-only. The runtime lives in rodeo-pkg/rodeo/shims/stream.luau.
local singleton = require("./_internal/singleton")... | 362 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/build.luau | luau | .luau | -- Build the rodeo plugin (.rbxm).
-- Runs rojo sourcemap → darklua process → assemble bundle → rojo build.
-- Invoked from repo root (cwd = repo root) by the top-level build script:
-- lune run rodeo-plugin/build
-- Also self-runnable for plugin-only rebuilds.
local fs = require("@lune/fs")
local process = require(... | 694 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/app/context/AppContext.luau | luau | .luau | --[[
AppContext - Central state management for the Rodeo plugin
This module provides:
- Context creation and types
- AppProvider component with all state logic
- useAppContext hook for consuming the context
All state flows through React context to child components.
]]
local React = require("@pkg/react")
local ... | 2,078 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/app/widget/Button.luau | luau | .luau | local React = require("@pkg/react")
local e = React.createElement
export type Props = {
text: string,
color: Color3,
strokeColor: Color3,
size: UDim2,
cornerRadius: number?,
layoutOrder: number?,
onClick: () -> (),
}
local function Button(props: Props)
local cornerRadius = props.cornerRadius or 8
local isPr... | 484 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/app/widget/Checkbox.luau | luau | .luau | local React = require("@pkg/react")
local constants = require(script.Parent.Parent.Parent.library.constants)
local Button = require(script.Parent.Button)
local e = React.createElement
local COLORS = constants.COLORS
export type Props = {
checked: boolean,
strokeColor: Color3,
onToggle: () -> (),
}
local function ... | 165 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/app/widget/Container.luau | luau | .luau | local React = require("@pkg/react")
local e = React.createElement
export type Props = {
children: { [string]: any },
}
local function Container(props: Props)
return e("Frame", {
BackgroundTransparency = 1,
AutomaticSize = Enum.AutomaticSize.Y,
Size = UDim2.fromScale(1, 0),
BorderSizePixel = 0,
}, {
Padd... | 245 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/app/widget/Label.luau | luau | .luau | local React = require("@pkg/react")
local e = React.createElement
export type Props = {
text: string,
textColor: Color3?,
}
local function Label(props: Props)
return e("TextLabel", {
BackgroundTransparency = 1,
AutomaticSize = Enum.AutomaticSize.XY,
Text = props.text,
TextColor3 = props.textColor or Color... | 215 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/app/widget/RodeoLabel.luau | luau | .luau | local React = require("@pkg/react")
local TweenService = game:GetService("TweenService")
local assets = require(script.Parent.Parent.Parent.library.assets)
local constants = require(script.Parent.Parent.Parent.library.constants)
local e = React.createElement
local TILE_SIZE_X = 140
local TILE_SIZE_Y = 40
local funct... | 574 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/app/widget/Row.luau | luau | .luau | local React = require("@pkg/react")
local e = React.createElement
export type Props = {
height: number?,
layoutOrder: number?,
children: any,
}
local function Row(props: Props)
local height = props.height or 24
return e("Frame", {
BackgroundTransparency = 1,
Size = UDim2.new(1, 0, 0, height),
LayoutOrder... | 172 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/app/widget/StatusIndicator.luau | luau | .luau | local React = require("@pkg/react")
local useAppContext = require(script.Parent.Parent.context.AppContext).useAppContext
local Row = require(script.Parent.Row)
local constants = require(script.Parent.Parent.Parent.library.constants)
local e = React.createElement
local COLORS = constants.COLORS
-- Count number of entr... | 968 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/app/widget/TextInput.luau | luau | .luau | local React = require("@pkg/react")
local e = React.createElement
export type Props = {
value: string,
placeholder: string?,
textColor: Color3,
placeholderColor: Color3?,
textXAlignment: Enum.TextXAlignment?,
onValueChange: (value: string) -> (),
}
local function TextInput(props: Props)
local function handleF... | 355 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/app/widget/init.luau | luau | .luau | local React = require("@pkg/react")
local AppContext = require(script.Parent.context.AppContext)
local Checkbox = require(script.Checkbox)
local Container = require(script.Container)
local Label = require(script.Label)
local RodeoLabel = require(script.RodeoLabel)
local Row = require(script.Row)
local StatusIndicator ... | 929 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/init.server.luau | luau | .luau | --[[
Rodeo Plugin Entry Point
Bootstraps the React UI. All connection and execution logic lives in
AppProvider, which auto-connects on load (no manual host/port/autoConnect —
the port comes from the launch's rodeoPort attribute, else the default).
The app is always mounted (the widget is the mount point) so the ... | 500 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/library/assets.luau | luau | .luau | -- This file is automatically @generated by Asphalt.
-- It is not intended for manual editing.
local assets = {
logo = "rbxassetid://106212962928799",
rodeo = "rbxassetid://128142019588385",
}
return assets | 57 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/library/constants.luau | luau | .luau | return {
-- Suffix used to rename modules during uncacheable require traversal
IGNORE_SUFFIX = ".rodeo.ignore.",
-- Rodeo version, injected at build time by darklua (inject_global_value).
VERSION = RODEO_VERSION,
-- Default connection settings. The static plugin auto-connects to the
-- studio backend's WebSocke... | 598 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/library/log.luau | luau | .luau | -- Logger factory — creates a per-execution logger that writes to CLI stderr via RPC.
-- Usage: local log = createLogger(rpc, "debug")
local runtime = require(script.Parent.Parent.Parent.shared.proto.runtime)
local LEVELS = { debug = 0, info = 1, warn = 2, error = 3 }
local RESET = "\27[0m"
local COLORS = {
[0] = "... | 322 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/library/mode_driver.luau | luau | .luau | --!strict
--[[
mode_driver.luau — plugin-side convergence loop. Backend broadcasts
target_mode to every DOM in a studio; each plugin retries its role-
appropriate action in a loop until its own mode satisfies the target
(or a new target arrives and supersedes this one).
Role dispatch:
- Edit DOM (IsEdit) enters ... | 1,544 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/library/runner/roblox.luau | luau | .luau | -- @rodeo/roblox API: import / export model files via SerializationService,
-- plus bake (Luau-source data files).
-- Returns a factory: (rpc, fs, stream, normalize, serializeToLuau) -> roblox module.
return function(rpc, fs, stream, normalize, serializeToLuau)
local roblox = {}
local SerializationService = game:Get... | 460 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/library/studio.luau | luau | .luau | --[[
How this works:
Plugins will spawn for every VM
We use studio MCP to execute luau to fire bindables + remotes to disperse the studio ID
]]
--!strict
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService... | 2,777 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/library/terminal.luau | luau | .luau | --!strict
local terminal = {}
export type TableConfig = {
justify_left: { number }?,
justify_right: { number }?,
justify_center: { number }?,
margin_left: { number }?,
margin_right: { number }?,
}
export type FormatTree = {
text: string,
children: { FormatTree }?,
}
------------------------------------------... | 2,545 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-plugin/src/library/utils.luau | luau | .luau | -- Shared utilities for rodeo plugins
local ScriptEditorService = game:GetService("ScriptEditorService")
local constants = require(script.Parent.constants)
-- LuaSourceContainer.Source rejects strings at 200,000 bytes, even though
-- Studio's script editor and compiler support substantially larger sources.
-- Update... | 1,746 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-shared/build.luau | luau | .luau | -- Generate Luau proto bindings from rodeo-proto/proto/ into rodeo-shared/proto/.
-- Invoked from repo root (cwd = repo root):
-- lune run rodeo-shared/build
-- Also self-runnable for Luau-proto-only regen.
local fs = require("@lune/fs")
local process = require("@lune/process")
-- rodeo-shared/proto/ is 100% genera... | 216 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-shared/limits.luau | luau | .luau | -- Transport size limits shared by the plugin runner and (eventually) the
-- live-vluau runtime host.
--
-- The done message carrying `ExecutionDone.return_value` is a single
-- unchunkable message on every hop, and the binding transport constraint is
-- connectrpc's 4,194,304-byte per-envelope cap (backend→master and
... | 158 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-shared/logging.luau | luau | .luau | -- ANSI log capture: connects to LogService, writes colored output to streams
-- Returns a factory: (LogService, fs, stream, io, logFilter, outputFile) -> logConnection, outputFileStreamHandle?
return function(LogService, fs, stream, io, logFilter, outputFile)
local ANSI = {
[Enum.MessageType.MessageOutput] = "",
... | 369 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-shared/normalize.luau | luau | .luau | -- Type converters: Roblox types → JSON-compatible tagged structs
-- Returns the normalize function
local TYPE_CONVERTERS = {
Vector3 = function(v)
return { type = "Vector3", value = { v.X, v.Y, v.Z } }
end,
Vector2 = function(v)
return { type = "Vector2", value = { v.X, v.Y } }
end,
CFrame = function(v)
re... | 494 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-shared/output.luau | luau | .luau | -- Done message factory for rodeo execution results.
-- Returns a typed PluginMessage (done variant) that callers forward to their
-- transport (BindableEvent → MessageHandler in the plugin).
local rodeoProto = require("./proto/rodeo")
local function createDoneMessage(executionId: string, success: boolean, err: strin... | 136 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-shared/proto/proto/init.luau | luau | .luau | local base64 = require("@self/base64")
local message = require("@self/message")
local typeRegistry = require("@self/typeRegistry")
export type Descriptor = message.Descriptor
export type Message<T, Fields> = message.Message<T, Fields>
export type CustomJson<T, Json> = message.CustomJson<T, Json>
export type TypeRegist... | 3,361 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-shared/run.luau | luau | .luau | -- Shared execution core for the rodeo plugin runner.
-- Handles the full execution lifecycle: APIs, logging, execution, return values, cleanup
--
-- Usage:
-- local run = require("rodeo-shared/run")
-- local success, result = run(rpc, params, function(apis)
-- return xpcall(function() return <execute user co... | 890 |
revvy02/rodeo | revvy02-rodeo-1e37c02/rodeo-shared/serialize.luau | luau | .luau | -- Luau table serializer: converts normalized values to Luau source code
-- Returns the serializeToLuau function
local function escapeString(str)
local r = str
r = r:gsub("\\", "\\\\")
r = r:gsub("\n", "\\n")
r = r:gsub("\t", "\\t")
r = r:gsub("\r", "\\r")
r = r:gsub('"', '\\"')
return r
end
local function get... | 1,130 |
revvy02/rodeo | revvy02-rodeo-1e37c02/studio-skills/extract.luau | luau | .luau | --!strict
-- Extracts the Roblox Studio Assistant's built-in skills out of the shipped
-- Assistant plugin (Assistant.rbxm) into raw/ as a tree of plain .md files.
-- raw/ is the pristine reference; curated skills are hand-edited copies (see README).
--
-- The skills are stored as StringValues under
-- Assistant/Pack... | 811 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/datetime/formatUniversalTime.luau | luau | .luau | local DateTime = require("@lune/datetime")
assert(
DateTime.fromUnixTimestamp(1693068988):formatUniversalTime("%Y-%m-%dT%H:%M:%SZ", "en")
== "2023-08-26T16:56:28Z",
"invalid ISO 8601 formatting for DateTime.formatTime() (UTC)"
)
local expectedTimeString = os.date("%Y-%m-%dT%H:%M:%SZ", 1694078954)
assert(
DateTi... | 151 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/datetime/fromLocalTime.luau | luau | .luau | local DateTime = require("@lune/datetime")
local timeValues1 = os.date("*t", 1693049188)
assert(
DateTime.fromLocalTime({
year = timeValues1.year,
month = timeValues1.month,
day = timeValues1.day,
hour = timeValues1.hour,
minute = timeValues1.min,
second = timeValues1.sec,
millisecond = 0,
}).unixTime... | 303 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/datetime/fromRfc2822.luau | luau | .luau | local DateTime = require("@lune/datetime")
assert(
DateTime.fromRfc2822("Fri, 21 Nov 1997 09:55:06 -0600") ~= nil,
"expected DateTime.fromRfcDate() to return DateTime, got nil"
)
assert(
DateTime.fromRfc2822("Tue, 1 Jul 2003 10:52:37 +0200") ~= nil,
"expected DateTime.fromRfcDate() to return DateTime, got nil"
)
| 106 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/datetime/fromRfc3339.luau | luau | .luau | local DateTime = require("@lune/datetime")
assert(
DateTime.fromRfc3339("2023-08-26T16:56:28Z") ~= nil,
"expected DateTime.fromRfc3339() to return DateTime, got nil"
)
assert(
DateTime.fromRfc3339("1929-12-05T23:18:23Z") ~= nil,
"expected DateTime.fromRfc3339() to return DateTime, got nil"
)
| 100 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/datetime/fromUniversalTime.luau | luau | .luau | local DateTime = require("@lune/datetime")
assert(
DateTime.fromUniversalTime({
year = 2023,
month = 8,
day = 26,
hour = 16,
minute = 56,
second = 28,
millisecond = 0,
}).unixTimestamp == 1693068988,
"expected DateTime.fromUniversalTime() with DateTimeValues arg to return 1693068988s"
)
assert(
Date... | 195 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/datetime/fromUnixTimestamp.luau | luau | .luau | local DateTime = require("@lune/datetime")
-- Bug in rust side implementation for fromUnixTimestamp, calculation for conversion there is wonky,
-- a difference of few millis causes differences as whole seconds for some reason
assert(
DateTime.fromUnixTimestamp(0000.892).unixTimestampMillis == (0 * 1000) + 892,
"exp... | 166 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/datetime/now.luau | luau | .luau | local DateTime = require("@lune/datetime")
local TYPE = "DateTime"
local now = DateTime.now()
assert(typeof(now) == TYPE, `dateTime.now() should return a {TYPE}, returned {typeof(now)}`)
| 45 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/datetime/toLocalTime.luau | luau | .luau | local DateTime = require("@lune/datetime")
local values = DateTime.fromRfc3339("2023-08-27T05:54:19Z"):toLocalTime()
local expectedDateTimeValues = os.date("*t", 1693115659)
assert(
values.year == expectedDateTimeValues.year,
`expected {values.year} == {expectedDateTimeValues.year}`
)
assert(
values.month == expe... | 204 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/datetime/toRfc2822.luau | luau | .luau | local DateTime = require("@lune/datetime")
local now = DateTime.now()
local nowRfc = now:toRfc2822()
assert(type(nowRfc) == "string", "toRfcDate should return a string")
assert(
string.match(nowRfc, "^%a%a%a, %d%d? %a%a%a %d%d%d%d %d%d:%d%d:%d%d [+-]%d%d%d%d$"),
"RFC 2822 date string does not match expected format"... | 658 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/fs/copy.luau | luau | .luau | local TEMP_DIR_PATH = "bin/"
local TEMP_ROOT_PATH = TEMP_DIR_PATH .. "fs_copy_test"
local TEMP_ROOT_PATH_2 = TEMP_DIR_PATH .. "fs_copy_test_2"
local fs = require("@lune/fs")
local utils = require("./utils")
-- Make sure our bin dir exists
fs.writeDir(TEMP_DIR_PATH)
if fs.isDir(TEMP_ROOT_PATH) then
fs.removeDir(TEMP... | 569 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/fs/dirs.luau | luau | .luau | local TEMP_DIR_PATH = "bin/"
local TEMP_ROOT_PATH = TEMP_DIR_PATH .. "fs_dirs_test"
local fs = require("@lune/fs")
-- Write two inner dirs in the bin dir, a parent and a child
fs.writeDir(TEMP_ROOT_PATH .. "/test_inner")
-- Make sure dir checks succeed but file
-- checks fail for all levels of dirs
assert(fs.isDir... | 251 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/fs/files.luau | luau | .luau | local TEMP_DIR_PATH = "bin/"
local TEMP_ROOT_PATH = TEMP_DIR_PATH .. "fs_files_test"
local fs = require("@lune/fs")
local utils = require("./utils")
-- Make sure our bin dir exists
fs.writeDir(TEMP_DIR_PATH)
fs.writeDir(TEMP_ROOT_PATH)
-- Write both of our files
-- binaryBlob is of type buffer to make sure fs.writ... | 454 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/fs/metadata.luau | luau | .luau | --!nolint UnknownType
local TEMP_DIR_PATH = "bin/"
local TEMP_FILE_PATH = TEMP_DIR_PATH .. "metadata_test"
local fs = require("@lune/fs")
local task = require("@lune/task")
local utils = require("./utils")
-- Make sure our bin dir exists
fs.writeDir(TEMP_DIR_PATH)
if fs.isFile(TEMP_FILE_PATH) then
fs.removeFile(TE... | 511 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/fs/move.luau | luau | .luau | local fs = require("@lune/fs")
local utils = require("./utils")
-- Make sure our bin dir exists
fs.writeDir("bin")
-- Write both of our files
fs.writeFile("bin/move_test_binary", utils.binaryBlob)
fs.writeFile("bin/move_test_json.json", utils.jsonBlob)
-- Move / rename them to something else, to test we
-- change ... | 428 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/fs/utils.luau | luau | .luau | local serde = require("@lune/serde")
-- Generate testing data
local binaryBlob = ""
for _ = 1, 1024 do
binaryBlob ..= string.char(math.random(1, 127))
end
local jsonBlob = serde.encode("json", {
Foo = "Bar",
Hello = "World",
Inner = { Array = { 1, 2, 3 } },
}, true)
-- Return testing data and utils
return {
b... | 116 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/globals/_G.luau | luau | .luau | assert(_G ~= nil, "Missing _G")
assert(type(_G) == "table", "Invalid type for _G")
assert(_G.require == nil, "Built-in global value was found in _G")
assert(_G.print == nil, "Built-in global value was found in _G")
assert(_G.warn == nil, "Built-in global value was found in _G")
assert(_G.error == nil, "Built-in globa... | 224 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/globals/_VERSION.luau | luau | .luau | -- _VERSION global should follow the following format:
--[[
_VERSION global must have the following format:
Lune LUNE_MAJOR.LUNE_MINOR.LUNE_PATCH+LUAU_VERSION
Examples:
Lune 0.0.0+0
Lune 1.0.0+500
Lune 0.11.22+9999
]]
assert(_VERSION ~= nil, "_VERSION global is missing")
assert(type(_VERSION) == "string", "_V... | 488 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/globals/coroutine.luau | luau | .luau | -- Coroutines should return true, ret values OR false, error
local function pass()
coroutine.yield(1, 2, 3)
coroutine.yield(4, 5, 6)
end
local function fail()
error("Error message")
end
local thread1 = coroutine.create(pass)
local t10, t11, t12, t13 = coroutine.resume(thread1)
assert(t10 == true, "Coroutine resum... | 722 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/globals/error.luau | luau | .luau | local errValue = newproxy(false)
local success, result = pcall(function()
error({
Inner = errValue,
})
end)
assert(not success, "Pcall succeeded when erorred")
assert(result ~= nil, "Pcall did not return error")
assert(type(result) == "table", "Pcall error value should have been a table")
assert(result.Inner ~=... | 109 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/globals/pcall.luau | luau | .luau | local net = require("@lune/net")
local task = require("@lune/task")
local PORT = 9090 -- NOTE: This must be different from
-- net tests to let them run in parallel with this file
local function test(f, ...)
local success, message = pcall(f, ...)
assert(not success, "Function did not throw an error")
assert(
type... | 217 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/globals/type.luau | luau | .luau | local task = require("@lune/task")
local function f() end
local thread1 = coroutine.create(f)
local thread2 = task.spawn(f)
local thread3 = task.defer(f)
local thread4 = task.delay(0, f)
assert(type(thread1) == "thread", "Calling type() did not return 'thread' after coroutine.create")
assert(type(thread2) == "thread... | 141 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/globals/typeof.luau | luau | .luau | -- NOTE: luau-lsp warns without this for the roblox types below
--!nolint UnknownType
local task = require("@lune/task")
local function f() end
local thread1 = coroutine.create(f)
local thread2 = task.spawn(f)
local thread3 = task.defer(f)
local thread4 = task.delay(0, f)
assert(
typeof(thread1) == "thread",
"Cal... | 302 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/globals/warn.luau | luau | .luau | assert(warn ~= nil, "Missing 'warn' global")
assert(
type(warn) == "function",
string.format("Global 'warn' should be a function, got '%s'", tostring(type(warn)))
)
| 45 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/luau/compile.luau | luau | .luau | local luau = require("@lune/luau")
local EMPTY_LUAU_CODE_BLOCK = "do end"
local BROKEN_LUAU_CODE_BLOCK = "do"
assert(type(luau.compile) == "function", "expected `luau.compile` to be a function")
assert(
type(luau.compile(EMPTY_LUAU_CODE_BLOCK)) == "string",
"expected `luau.compile` to return bytecode string"
)
lo... | 138 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/luau/load.luau | luau | .luau | local luau = require("@lune/luau")
local RETURN_VALUE = 1
local EMPTY_LUAU_CODE_BLOCK = "do end"
local RETURN_LUAU_CODE_BLOCK = "return " .. tostring(RETURN_VALUE)
local CUSTOM_SOURCE_BLOCK_NAME = "test"
assert(type(luau.load) == "function", "expected `luau.compile` to be a function")
assert(
type(luau.load(EMPTY... | 990 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/luau/options.luau | luau | .luau | local luau = require("@lune/luau")
local EMPTY_LUAU_CODE_BLOCK = "do end"
local MIN_OPTION_VALUE = 0
local MAX_OPTION_VALUE = 2
local OPTION_NAMES = {
"optimizationLevel",
"coverageLevel",
"debugLevel",
}
for _, optionName in OPTION_NAMES do
-- In range should work
for optionValue = MIN_OPTION_VALUE, MAX_OPTION... | 344 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/luau/safeenv.luau | luau | .luau | local luau = require("@lune/luau")
local TEST_SCRIPT = [[
local start = os.clock()
local x
for i = 1, 1e6 do
x = math.sqrt(i)
end
local finish = os.clock()
return finish - start
]]
local TEST_BYTECODE = luau.compile(TEST_SCRIPT, {
optimizationLevel = 2,
coverageLevel = 0,
debugLeve... | 486 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/net/request/codes.luau | luau | .luau | local util = require("./util")
local pass, fail = util.pass, util.fail
pass("GET", "https://httpbingo.org/status/200", "Request status code - 200")
fail("GET", "https://httpbingo.org/status/400", "Request status code - 400")
fail("GET", "https://httpbingo.org/status/500", "Request status code - 500")
| 87 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/net/request/https.luau | luau | .luau | local task = require("@lune/task")
local util = require("./util")
local pass = util.pass
-- These are some public APIs that have, or most likely have, different
-- certificate authorities (CAs), plus are both free to use and stable.
-- This should be enough to ensure that rustls is configured correctly.
local servers... | 186 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/net/request/methods.luau | luau | .luau | local util = require("./util")
local pass = util.pass
-- stylua: ignore start
pass("GET", "https://httpbingo.org/get", "Request method - GET")
pass("POST", "https://httpbingo.org/post", "Request method - POST")
pass("PATCH", "https://httpbingo.org/patch", "Request method - PATCH")
pass("PUT", "https://h... | 125 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/net/request/redirect.luau | luau | .luau | local util = require("./util")
local pass = util.pass
pass("GET", "https://httpbingo.org/absolute-redirect/3", "Redirect 3 times")
| 37 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/net/request/user_agent.luau | luau | .luau | local net = require("@lune/net")
local serde = require("@lune/serde")
local runtime, version = table.unpack(_VERSION:split(" "))
local expectedUserAgent = runtime:lower() .. "/" .. version
local userAgent: string =
serde.decode("json", net.request("https://www.whatsmyua.info/api/v1/ua").body)[1].ua.rawUa
assert(use... | 103 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/net/socket/basic.luau | luau | .luau | local net = require("@lune/net")
-- We're going to use Discord's WebSocket gateway server for testing
local socket = net.socket("wss://gateway.discord.gg/?v=10&encoding=json")
assert(type(socket.next) == "function", "next must be a function")
assert(type(socket.send) == "function", "send must be a function")
assert(t... | 295 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/net/socket/wss.luau | luau | .luau | local net = require("@lune/net")
local task = require("@lune/task")
-- We're going to use Discord's WebSocket gateway server
-- for testing wss - it does not require auth, and this test
-- only exists to ensure wss (WebSockets with TLS) works correctly
local socket = net.socket("wss://gateway.discord.gg/?v=10&encoding... | 209 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/net/socket/wss_rw.luau | luau | .luau | local net = require("@lune/net")
local process = require("@lune/process")
local stdio = require("@lune/stdio")
local task = require("@lune/task")
-- We're going to use Discord's WebSocket gateway server
-- for testing that we can both read from a stream,
-- as well as write to the same stream concurrently
local socket... | 270 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/net/tcp/info.luau | luau | .luau | local net = require("@lune/net")
local stream = net.tcp.connect("httpbingo.org", 80)
assert(type(stream.localIp) == "string", "localIp should be a string")
assert(type(stream.localPort) == "number", "localPort should be a number")
assert(type(stream.remoteIp) == "string", "remoteIp should be a string")
assert(stream.... | 226 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/net/url/decode.luau | luau | .luau | local net = require("@lune/net")
local decoded = net.urlDecode("%F0%9F%9A%80%20This%20string%20will%20be%20decoded.")
assert(decoded == "🚀 This string will be decoded.")
| 55 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/net/url/encode.luau | luau | .luau | local net = require("@lune/net")
local encoded = net.urlEncode("🚀 This string will be encoded.")
assert(encoded == "%F0%9F%9A%80%20This%20string%20will%20be%20encoded.")
| 55 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/process/args.luau | luau | .luau | local process = require("@lune/process")
assert(type(process.args) == "table", "Process args should be a plain table")
assert(#process.args > 0, "No process arguments found")
assert(process.args[1] == "Foo", "Invalid first argument to process")
assert(process.args[2] == "Bar", "Invalid second argument to process")
... | 200 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/process/create/kill.luau | luau | .luau | local process = require("@lune/process")
local expected = "Hello, world!"
local catChild = process.create("cat")
catChild.stdin:write(expected)
catChild:kill()
local catStatus = catChild:status()
local catStdout = catChild.stdout:readToEnd()
assert(catStatus.code == 9, "Child process should have an exit code of 9 (S... | 140 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/process/create/non_blocking.luau | luau | .luau | local process = require("@lune/process")
local childThread = coroutine.create(process.create)
local ok, err = coroutine.resume(childThread, "echo", { "hello, world" })
assert(ok, err)
assert(
coroutine.status(childThread) == "dead",
"Child process should not yield the thread it is created on"
)
| 71 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/process/create/status.luau | luau | .luau | local process = require("@lune/process")
local testCode = math.random(0, 255)
local testOk = testCode == 0
local exitChild = process.create("exit", { tostring(testCode) }, { shell = true })
local exitStatus = exitChild:status()
assert(type(exitStatus) == "table", "Child status should be a table")
assert(type(exitSta... | 216 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/process/create/stream.luau | luau | .luau | local process = require("@lune/process")
local expected = "hello, world"
-- Stdout test
local catChild = process.create("cat")
catChild.stdin:write(expected)
catChild.stdin:close()
local catOutput = catChild.stdout:read(#expected)
-- Make sure the child exits
catChild:status()
assert(
expected == catOutput,
"Fai... | 257 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/process/cwd.luau | luau | .luau | local process = require("@lune/process")
assert(process.cwd ~= nil, "Process cwd is missing")
assert(type(process.cwd) == "string", "Process cwd is not a string")
assert(#process.cwd > 0, "Process cwd is an empty string")
if process.os == "windows" then
assert(string.sub(process.cwd, -1) == "\\", "Process cwd does... | 108 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/process/env.luau | luau | .luau | local process = require("@lune/process")
assert(type(process.env) == "table", "Process env should be a plain table")
local randomKey = string.format("LUNE_TEST_%d", math.random(1, 999_999))
assert(process.env[randomKey] == nil, "Unset variable returned a non-nil value")
process.env[randomKey] = "abc"
assert(process... | 119 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/process/exec/async.luau | luau | .luau | local process = require("@lune/process")
local stdio = require("@lune/stdio")
local task = require("@lune/task")
local IS_WINDOWS = process.os == "windows"
-- Executing a command should not block any lua thread(s)
local SLEEP_DURATION = 1 / 4
local SLEEP_SAMPLES = 2
local thread2 = task.delay(
if IS_WINDOWS then 3... | 341 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/process/exec/basic.luau | luau | .luau | local process = require("@lune/process")
local stdio = require("@lune/stdio")
local task = require("@lune/task")
-- Executing a command should work, with options
local thread = task.delay(1, function()
stdio.ewrite("Spawning a process should take a reasonable amount of time\n")
task.wait(1)
process.exit(1)
end)
l... | 208 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/process/exec/cwd.luau | luau | .luau | local process = require("@lune/process")
local IS_WINDOWS = process.os == "windows"
local pwdCommand = if IS_WINDOWS then "cmd" else "pwd"
local pwdArgs = if IS_WINDOWS then { "/c", "cd" } else {}
-- Make sure the cwd option actually uses the directory we want
local rootPwd = process.exec(pwdCommand, pwdArgs, {
cwd... | 461 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/process/exec/no_panic.luau | luau | .luau | local process = require("@lune/process")
-- Executing a non existent command as a child process
-- should not panic, but should error
local success = pcall(process.exec, "someProgramThatDoesNotExist")
assert(not success, "Spawned a non-existent program")
| 58 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/process/exec/shell.luau | luau | .luau | local process = require("@lune/process")
local IS_WINDOWS = process.os == "windows"
-- Default shell should be /bin/sh on unix and powershell on Windows,
-- note that powershell needs slightly different command flags for ls
local shellResult = process.exec("ls", {
if IS_WINDOWS then "-Force" else "-a",
}, {
shell ... | 169 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/process/exec/stdio.luau | luau | .luau | local process = require("@lune/process")
local IS_WINDOWS = process.os == "windows"
-- Inheriting stdio & environment variables should work
local echoMessage = "Hello from child process!"
local echoResult = process.exec("echo", {
if IS_WINDOWS then '"$Env:TEST_VAR"' else '"$TEST_VAR"',
}, {
env = { TEST_VAR = echo... | 161 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/process/exit.luau | luau | .luau | local fs = require("@lune/fs")
local process = require("@lune/process")
local task = require("@lune/task")
local function assert(condition, err)
if not condition then
task.spawn(error, err)
process.exit(0)
end
end
local path = process.cwd .. "asdfghjkl"
assert(fs.isDir(path), "Process should exit with success"... | 116 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/regex/general.luau | luau | .luau | --!nocheck
local regex = require("@lune/regex")
local re = regex.new("[0-9]+")
assert(re:isMatch("look, a number: 1241425") == true)
local mtch = re:find("1337 wow")
assert(mtch ~= nil)
assert(mtch.start == 1)
assert(mtch.finish == 4)
assert(mtch.len == 4)
assert(mtch.text == "1337")
assert(#mtch == mtch.len)
re =... | 416 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/regex/metamethods.luau | luau | .luau | --!nolint
local regex = require("@lune/regex")
local re = regex.new("[0-9]+")
assert(tostring(re) == "[0-9]+")
assert(typeof(re) == "Regex")
local mtch = re:find("1337 wow")
assert(tostring(mtch) == "1337")
assert(typeof(mtch) == "RegexMatch")
local re2 = regex.new("([0-9]+) ([0-9]+) wow! ([0-9]+) ([0-9]+)")
local ... | 157 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/regex/replace.luau | luau | .luau | local regex = require("@lune/regex")
-- Tests taken from the Regex crate
local function replace(
name: string,
pattern: string,
find: string,
replace: string,
expected: string
)
local re = regex.new(pattern)
local replaced = re:replace(find, replace)
if replaced ~= expected then
error(`test '{name}' did not... | 555 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/require/modules/init.luau | luau | .luau | return {
Foo = "Bar",
Hello = "World",
}
| 15 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/require/tests/aliases.luau | luau | .luau | local module = require("@tests/require/tests/module")
assert(type(module) == "table", "Required module did not return a table")
assert(module.Foo == "Bar", "Required module did not contain correct values")
assert(module.Hello == "World", "Required module did not contain correct values")
local module2 = require("@requ... | 145 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/require/tests/async.luau | luau | .luau | local module = require("./modules/async")
assert(type(module) == "table", "Required module did not return a table")
assert(module.Foo == "Bar", "Required module did not contain correct values")
assert(module.Hello == "World", "Required module did not contain correct values")
module = require("./modules/async")
assert... | 102 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/require/tests/async_concurrent.luau | luau | .luau | local task = require("@lune/task")
local module1
local module2
task.defer(function()
module2 = require("./modules/async")
end)
task.spawn(function()
module1 = require("./modules/async")
end)
task.wait(1)
assert(type(module1) == "table", "Required module1 did not return a table")
assert(module1.Foo == "Bar", "Req... | 184 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/require/tests/async_sequential.luau | luau | .luau | local task = require("@lune/task")
local module1 = require("./modules/async")
local module2 = require("./modules/async")
task.wait(1)
assert(type(module1) == "table", "Required module1 did not return a table")
assert(module1.Foo == "Bar", "Required module1 did not contain correct values")
assert(module1.Hello == "Wo... | 166 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/require/tests/builtins.luau | luau | .luau | local fs = require("@lune/fs")
local net = require("@lune/net")
local process = require("@lune/process")
local stdio = require("@lune/stdio")
local task = require("@lune/task")
assert(type(fs.move) == "function")
assert(type(net.request) == "function")
assert(type(process.cwd) == "string")
assert(type(stdio.format("")... | 161 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/require/tests/children.luau | luau | .luau | local module = require("./modules/module")
assert(type(module) == "table", "Required module did not return a table")
assert(module.Foo == "Bar", "Required module did not contain correct values")
assert(module.Hello == "World", "Required module did not contain correct values")
module = require("./modules/module")
asse... | 103 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/require/tests/init_files.luau | luau | .luau | local module = require("./modules")
assert(type(module) == "table", "Required module did not return a table")
assert(module.Foo == "Bar", "Required module did not contain correct values")
assert(module.Hello == "World", "Required module did not contain correct values")
module = require("./modules/modules")
assert(typ... | 178 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/require/tests/invalid.luau | luau | .luau | local function test(path: string)
local success, message = pcall(function()
local _ = require("./" .. path) :: any
end)
if success then
error(string.format("Invalid require at path '%s' succeeded", path))
else
message = tostring(message)
if string.find(message, string.format("%s", path)) == nil then
erro... | 167 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/require/tests/modules/async.luau | luau | .luau | local task = require("@lune/task")
task.wait(0.25)
return {
Foo = "Bar",
Hello = "World",
}
| 31 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/require/tests/modules/nested.luau | luau | .luau | return require("./modules/module")
| 6 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/require/tests/modules/self_alias/init.luau | luau | .luau | local inner = require("@self/module")
local outer = require("./module")
assert(type(outer) == "table", "Outer module is not a table")
assert(type(inner) == "table", "Inner module is not a table")
assert(outer.Foo == inner.Foo, "Outer and inner modules have different Foo values")
assert(inner.Hello == outer.Hello, "Ou... | 90 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/require/tests/multi_ext.luau | luau | .luau | require("./multi.ext.file")
| 6 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/require/tests/nested.luau | luau | .luau | local module = require("./modules/nested")
assert(type(module) == "table", "Required module did not return a table")
assert(module.Foo == "Bar", "Required module did not contain correct values")
assert(module.Hello == "World", "Required module did not contain correct values")
module = require("./modules/nested")
asse... | 102 |
revvy02/rodeo | revvy02-rodeo-1e37c02/tests-new/adapters/lune/require/tests/parents.luau | luau | .luau | local module = require("../modules/module")
assert(type(module) == "table", "Required module did not return a table")
assert(module.Foo == "Bar", "Required module did not contain correct values")
assert(module.Hello == "World", "Required module did not contain correct values")
return true
| 62 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.