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 |
|---|---|---|---|---|---|
BusyCityGuy/finite-state-machine-luau | BusyCityGuy-finite-state-machine-luau-156db58/src/StateQ/Modules/ThreadQueue.luau | luau | .luau | --!strict
--[[
ThreadQueue is a task scheduler and rate limiter that allows callbacks to be queued to be executed, yielding the requesting thread
until the callback has returned.
Provides similar functionality to the NodeJS module Bottleneck (https://www.npmjs.com/package/bottleneck) however, it exposes
its sched... | 781 |
BusyCityGuy/finite-state-machine-luau | BusyCityGuy-finite-state-machine-luau-156db58/src/TestService/Source/run.server.luau | luau | .luau | local TestService = game:GetService("TestService")
local Jest = require(TestService.Source.DevPackages.Jest)
local runCLI = Jest.runCLI
-- Jest.TestBootstrap:run({ TestService.Source.Tests })
print("Checking for ProcessService...")
local processServiceExists, ProcessService = pcall(function()
-- selene: allow(incor... | 237 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/config.luau | luau | .luau | local config = {
-- entry_path = "./src/main.luau",
test_path = "./tests/run.luau",
}
export type SealConfig = {
--- Script that `seal run` runs; usually the entrypoint to your codebase.
--- Defaults to `./src/main.luau`.
entry_path: string?,
--- Script that `seal test` runs; usually a test run... | 97 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/extra/csv/column.luau | luau | .luau | local column = {}
local str = require("@std/str")
local row = require("./row.luau")
type ColumnStruct = {
column_name: string,
values: { string },
}
type ColumnImpl = {
row: (self: CsvColumn, index: number) -> row.CsvRow,
display: (self: CsvColumn) -> string,
}
export type CsvColumn = setmetatable<C... | 367 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/extra/csv/init.luau | luau | .luau | local fs = require("@std/fs")
local str = require("@std/str")
local output = require("@std/io/output")
local types = require("@self/types")
export type Csv = types.Csv
local row = require("@self/row")
type CsvRow = row.CsvRow
local column = require("@self/column")
type CsvColumn = column.CsvColumn
--[=[
A simple, u... | 2,414 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/extra/csv/row.luau | luau | .luau | local str = require("@std/str")
type CsvRowStruct = { { [string]: string } }
type CsvRowImpl = {
values: (self: CsvRow) -> { string },
display: (self: CsvRow) -> string,
}
export type CsvRow = setmetatable<CsvRowStruct, {
__index: CsvRowImpl,
}>
local row = {}
local impl = {}
function impl.values(self: CsvRow):... | 505 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/extra/csv/select.luau | luau | .luau | local types = require("./types")
type Csv = types.Csv
type column_name = string
export type SelectQuery = {
with_columns: { column_name },
where: {
[column_name]: (value: string) -> boolean,
},
}
--[=[
Selects rows and columns of `c` that match the `SelectQuery`, returning a new `Csv`.
```luau
export type S... | 485 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/extra/csv/types.luau | luau | .luau | -- need a separate file to non-recursively share types
type column_name = string
export type Csv = {
column_names: { string },
column_map: {
[column_name]: number,
},
columns: {
[number]: {
column_name: string,
values: { string },
},
},
rows: {
[number]: { string },
},
}
return nil | 83 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/extra/tt.luau | luau | .luau | --[=[
A `table` extension library written in pure Luau!
Features common functions like `map`, `filter`, etc.
]=]
local tt = {}
--- check if you can iterate through table `t` normally (does it support __iter without blowing up?)
function tt.caniteratenormally(t: any): boolean
local tmeta = getmetatable(t)
-- stylu... | 2,383 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/guided_tour.luau | luau | .luau | --!nolint ImportUnused
--!nolint LocalUnused
--!nolint LocalShadow
-- hi!! welcome to sealey runtime ᶘ ᵔᴥᵔᶅ, here's some basics to get you set up
-- Table of Contents (in vscode, ctrl c on a type to teleport there)
type TableOfContents = {
setup: SealSetupAndRun,
fs: Filesystem,
env: EnvAndCliArgs,
http: HttpReq... | 1,310 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/interop/init.luau | luau | .luau | return {
mlua = require("@self/mlua"),
} | 13 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/interop/mlua.luau | luau | .luau | --[=[
Interop with seal's underlying mlua layer
]=]
local mlua = {}
--- Returns `true` if `n` is an mlua Integer, or `false` if it's an `mlua` Number
---
--- Note, this is important (and therefore annoying) because large integer numbers,
--- such as `1231231231234445` are internally represented as mlua `LuaNumber`s a... | 186 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/interop/standalone.luau | luau | .luau | --[=[
Load code from standalone versions of *seal*.
]=]
export type standalone = {
--[=[
Extracts, loads, and executes luau bytecode from the standalone seal executable at `path`.
This can be used to 'require' compiled standalone modules, except with no regular safety and no type safety...
... | 254 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/archive/_types.luau | luau | .luau | --[=[
Overrides for path safety and archive bomb limits.
The default limits are kinda low, be sure to increase them if you know
you're going to be extracting large files.
- **Max total size:** 4 GB
- **Max individual file size:** 500 MB
- **allow_unsafe_path_traversals:** false, obviously
... | 353 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/archive/ar.luau | luau | .luau | local _types = require("@self/_types")
export type ArchiveOptions = _types.ArchiveOptions
export type ArchiveFormat = _types.ArchiveFormat
--[=[
Read, write, and extract the Unix `ar` format used for static libraries and as the outer container for `.deb` packages.
ar is a single flat layer of entries with no ... | 498 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/archive/deb.luau | luau | .luau | local _types = require("@self/_types")
export type ArchiveOptions = _types.ArchiveOptions
export type ArchiveFormat = _types.ArchiveFormat
--[=[
Read, write, and extract Debian packages.
Internally, debs are just an `ar` archive wrapping `control` and `data` tarballs.
Like `ar`, the outer deb layer i... | 489 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/archive/entry.luau | luau | .luau | --[=[
Constructors of `ArchiveEntry` instances for `@std/archive` functions and `Archive` methods.
]=]
export type entry = {
--[=[
Create new entries (file/directory/symlink)
]=]
create: {
--[=[
Create a new file `ArchiveEntry` with default unix permissions and no modified ti... | 527 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/archive/sevenz.luau | luau | .luau | local _types = require("@self/_types")
export type ArchiveOptions = _types.ArchiveOptions
export type ArchiveFormat = _types.ArchiveFormat
--[=[
Read, write, and extract the 7z format.
7z (LZMA2) usually beats zip and tar.xz on compression ratio, at the cost of being slower
to compress and less universall... | 599 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/archive/tar.luau | luau | .luau | local _types = require("./_types")
--[=[
Read, write, and extract tar ("Tape Archive") archives, affectionally known as
tarballs, split by the compression codec applied to the tarball
("uncompressed" for none).
]=]
export type tar = {
--[=[
Unzip/Unball(is that a word?) gzip-compressed tarball... | 3,257 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/archive/zip.luau | luau | .luau | local _types = require("@self/_types")
--[=[
Read, write, and extract the most common archive type I know of,
the DEFLATE-based zip format.
## Usage
Example: extract new album to Music folder, fixing song paths.
```luau
const zip = require("@std/archive/zip")
const fs = require("@std/fs"... | 852 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/colors.luau | luau | .luau | return require("./io/colors") | 6 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/crypt/aes.luau | luau | .luau | export type aes = {
--- Generate an AES-256 key.
generatekey: () -> string,
--- Encrypt plaintext with an AES-256 key
encrypt: (plaintext: string, key: string) -> string,
--- Decrypt ciphertext with an AES-256 key.
decrypt: (ciphertext: string, key: string) -> string,
}
return {} :: aes | 81 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/crypt/hash.luau | luau | .luau | --[=[
Contains function sha2, which can be used to create an **unsalted** hash, returned as a buffer.
### Please use the `@std/crypt/password` library if you want to hash passwords (salted)
]=]
export type hash = {
--[=[
Hashes plaintext with the SHA2-256 algorithm, returns a buffer (of length 32) containing t... | 126 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/crypt/init.luau | luau | .luau | local crypt = {}
crypt.aes = require("@std/crypt/aes")
crypt.rsa = require("@std/crypt/rsa")
crypt.hash = require("@std/crypt/hash")
crypt.password = require("@std/crypt/password")
return crypt | 50 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/crypt/password.luau | luau | .luau |
--[=[
## This is the password handling lib.
Please use with caution.
]=]
export type password = {
--[=[
Hash a password with the `PBKDF2_HMAC_SHA256` algorithm, returns a `HashedPassword`
which you can later use to verify the password against a future
passwording attempt.
## Example:
```luau
... | 614 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/crypt/rsa.luau | luau | .luau | export type rsa = {
generatekeys: () -> RsaKeys,
encrypt: (plaintext: string, public_key: string) -> string,
decrypt: (ciphertext: string, private_key: string) -> string,
}
type RsaKeys = {
public: string,
private: string
}
return {} :: rsa | 70 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/datetime.luau | luau | .luau | return require("./time/datetime") | 7 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/env/init.luau | luau | .luau | --[=[
A stdlib to interact with the script's running environment.
]=]
export type env = {
--- a list of arguments passed to the program
args: { string },
--- your operating system
os: "Windows" | "Linux" | "Android" | "MacOS" | string,
--- your system architecture, most likely `"x86_64"`
arch: A... | 647 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/err.luau | luau | .luau | --- Simple library for managing `error` types from seal.
export type err = {
--[=[
Create an `error` with a custom error message. This allows you to return result-like unions that can be `typeof` checked.
## Usage
```luau
local err = require("@std/err")
local function canfa... | 426 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/fs/_types.luau | luau | .luau | -- common types that we don't want cyclic require errors on
export type TreeBuilder = {
--- The `DirectoryTree` being constructed by the `TreeBuilder`.
inner: DirectoryTree,
--- Add a file to the DirectoryTree by `name` with `content`
with_file: (self: TreeBuilder, name: string, content: string) -> Tre... | 2,781 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/fs/file.luau | luau | .luau | local common_types = require("./_types")
export type FileEntry = common_types.FileEntry
export type FileBuilder = common_types.FileBuilder
export type FileLib = setmetatable<{
--[=[
Create a `FileEntry` from `path`; errors if unable to create the `FileEntry` if a file is not found or permission was denied... | 1,019 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/fs/filesize.luau | luau | .luau | --[=[
Construct `FileSize` values from human-readable units rather than raw byte counts.
Fractional unit counts are accepted for all units larger than bytes — e.g. `filesize.gigabytes(1.2)` gives you 1.2 GB expressed as bytes.
`FileSize`s may be compared with all comparison operators, added, subtracted, m... | 290 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/fs/path.luau | luau | .luau | export type PathLib = {
--[=[
Joins path components together in a cross-platform-safe manner.
The default separator is `/`, except when dealing with absolute paths on Windows.
On Windows, pass `.\` as the first component to `path.join` to use `\` in relative paths.
## Usage
... | 1,015 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/init.luau | luau | .luau | --[=[
Of course *you'd* require the whole standard library at once...
]=]
local std = {
fs = require("@std/fs"),
str = require("@std/str"),
semver = require("@std/semver"),
env = require("@std/env"),
io = require("@std/io"),
colors = require("@std/colors"),
format = require("@std/io/format")... | 156 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/io/format.luau | luau | .luau | --[=[
Format objects for pretty printing to stdout/stderr.
]=]
export type format = setmetatable<{
--[=[
Formats `item` in the same way as `print` or `pp`.
Pass `options` to change the behavior of the formatter.
If you want to change ALL print/format.pretty/etc. formatting
throu... | 540 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/io/init.luau | luau | .luau | --[=[
Standard library for handling **terminal** input/output.
You can require the whole `@std/io` lib at once but it's recommended you require individual
libraries as you need them instead.
- To read input from the terminal, use `@std/io/prompt` or if you need lower-level control, `@std/io/input`.
... | 208 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/io/output.luau | luau | .luau | --[=[
Write to the terminal's stdout/stderr.
]=]
export type output = {
--[=[
Writes `contents` to stdout without any intermediate utf-8 validation.
The stream is flushed immediately after each write. Manual control over when flushing occurs is not available.
If you need explicit contro... | 651 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/json.luau | luau | .luau | --[=[
Easily manipulate JSON (JavaScript Object Notation) data.
## Usage
```luau
local json = require("@std/json")
local data = json.readfile("./animals.json") :: { cats: number, dogs: number }
data.cats += 1
json.writefile("./animals.json", data)
```
]=]
export type json = {
--- encodes a table as json; by defaul... | 366 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/net/init.luau | luau | .luau | --[=[
By default, the http and websocket libaries trust system certs, and have
differing behavior if zero system certs are found.
- The http library will throw errors due to ureq internals not allowing me
to write a happier fallback path, to handle this
- The websocket library will fall back to Mozi... | 197 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/net/request.luau | luau | .luau | return require("@std/net/http").request | 8 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/net/websocket.luau | luau | .luau | --[=[
By default, the websocket library trusts only system certs
and will fallback to Mozilla's CAs only if no certs are found.
To provide custom SSL certs, set `SSL_CERT_FILE` to a `.pem` certificate file,
and to disable system certs set `SEAL_SYSTEM_CERTS=false`.
- If `SEAL_SYSTEM_CERTS=false` ... | 280 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/serde/base64.luau | luau | .luau | --[=[
good for serving binary stuff in a digestable form for serving things on the internet
]=]
export type base64 = {
encode: (data: string | buffer) -> string,
decode: (data: string) -> buffer,
urlsafe: {
encode: (data: string | buffer) -> string,
decode: (data: string) -> buffer
}
}
... | 88 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/serde/bz2.luau | luau | .luau | export type bz2 = {
--[=[
Compresses bzip2-encoded (.bz2) data at compression `level`.
bzip2 levels range from 1 (fastest) to 9 (most compressed); defaults to 6.
]=]
compress: (content: string | buffer, level: number?) -> buffer,
--[=[
Decompress bzip2-encoded (.bz2) data up to ... | 131 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/serde/gzip.luau | luau | .luau | export type gzip = {
--[=[
Compresses gzip-encoded (.gz) data at compression `level`.
gzip levels range from 0 (fastest) to 9 (most compressed); defaults to 6.
]=]
compress: (content: string | buffer, level: number?) -> buffer,
--[=[
Decompress gzip-encoded (.gz) data up to `max... | 121 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/serde/hex.luau | luau | .luau | --[=[
Deal with hex data.
]=]
export type hex = {
encode: (data: buffer | string) -> string,
decode: (encoded: string) -> buffer,
}
return {} :: hex | 43 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/serde/init.luau | luau | .luau | --[=[
Lib for serializing/deserializing/encoding/decoding different things.
]=]
local serde = {}
serde.json = require("@std/json")
serde.base64 = require("@std/serde/base64")
serde.toml = require("@std/serde/toml")
serde.yaml = require("@std/serde/yaml")
serde.lz4 = require("@std/serde/lz4")
serde.zstd = require(... | 106 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/serde/json.luau | luau | .luau | --[=[
Easily manipulate JSON (JavaScript Object Notation) data.
## Usage
```luau
local json = require("@std/json")
local data = json.readfile("./animals.json") :: { cats: number, dogs: number }
data.cats += 1
json.writefile("./animals.json", data)
```
]=]
export type json = {
--- encodes a table as json; by defaul... | 366 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/serde/lz4.luau | luau | .luau | --[=[
lz4 bindings
]=]
export type lz4 = {
compress: (input: string | buffer) -> buffer,
decompress: (compressed: string | buffer, expected_size: number) -> buffer,
}
return {} :: lz4 | 53 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/serde/toml.luau | luau | .luau | --[=[
Serialize TOML files.
]=]
export type toml = {
encode: (t: TomlValue) -> string,
decode: (toml_data: string) -> TomlValue,
readfile: (path: string) -> TomlValue,
writefile: (path: string, content: TomlValue) -> (),
}
export type TomlValue = { [any]: any }
return {} :: toml | 92 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/serde/url.luau | luau | .luau | export type url = {
--- Encodes `text` in urlsafe/percent encoding for use in urls.
encode: (text: string) -> string,
--- Decodes the url/percent-encoded string.
decode: (encoded: string) -> string,
binary: {
encode: (data: string | buffer) -> string,
decode: (encoded: string) -> buf... | 91 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/serde/xz.luau | luau | .luau | export type xz = {
--[=[
Compresses xz-encoded (.xz) data at compression `level`.
xz levels range from 0 (fastest) to 9 (most compressed); defaults to 6.
]=]
compress: (content: string | buffer, level: number?) -> buffer,
--[=[
Decompress xz-encoded (.xz) data up to `max_size` (... | 126 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/serde/yaml.luau | luau | .luau | --[=[
Serialize YAML files.
]=]
export type yaml = {
encode: (t: YamlValue) -> string,
decode: (toml_data: string) -> YamlValue,
readfile: (path: string) -> YamlValue,
writefile: (path: string, content: YamlValue) -> (),
}
type YamlValue = { [any]: any }
return {} :: yaml | 88 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/serde/zlib.luau | luau | .luau | --[=[
Encode/decode with the zlib compression algorithm provided by the flake2 crate.
]=]
export type zlib = {
--[=[
Encodes (or compresses) the input data with zlib; "Fast" optimizes for compression speed
whereas "Best" optimizes for compressed size.
]=]
compress: (data: string | buffer... | 112 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/serde/zstd.luau | luau | .luau | export type ZstdOptions = {
checksum: boolean?,
content_size: boolean?,
dictid: boolean?,
window_log: number?,
}
--[=[
Use `Zstd` compression.
]=]
export type zstd = {
--[=[
By default, `zstd.compress` tries to match the Python implementation for wider compatibility, setting the options... | 207 |
seal-runtime/seal | seal-runtime-seal-e337169/.seal/typedefs/std/terminal/cursor.luau | luau | .luau | export type cursor = {
--[=[
Returns the current cursor position as a vector of `<column, row, 0>`.
]=]
position: () -> vector,
--[=[
Creates a <kbd>ShowCursor</kbd> `TerminalAction`.
Once invoked, shows the terminal cursor if hidden.
`TerminalActions` do nothing until ... | 1,700 |
seal-runtime/seal | seal-runtime-seal-e337169/docs/docscripts/autorun.luau | luau | .luau | -- Watches ./.seal/typedefs/std for changes and runs reference.luau
local fs = require("@std/fs")
local env = require("@std/env")
local str = require("@std/str")
local time = require("@std/time")
local process = require("@std/process")
local defs_path = fs.dir.project():join(".seal", "typedefs", "std")
--- minimum t... | 526 |
seal-runtime/seal | seal-runtime-seal-e337169/docs/docscripts/fix_stragglers.luau | luau | .luau | local fs = require("@std/fs")
--- semver is very cursed so we reparse the outputted md
local function fix_semver()
local path = "./docs/reference/std/semver.md"
local lines: { string } = {}
local skipping = false
for _, line in fs.readlines(path) do
if line == "## `export type` ... | 306 |
seal-runtime/seal | seal-runtime-seal-e337169/examples/older_than_a_week.luau | luau | .luau | -- script that removes files older than n weeks (from provided user input)
local fs = require("@std/fs")
local err = require("@std/err")
local args = require("@std/args")
local datetime = require("@std/datetime")
-- Usage: seal ./path/to/script <path> <weeks>
local parsed = args.parse("rmbald", "removes files at <pat... | 434 |
seal-runtime/seal | seal-runtime-seal-e337169/examples/show_keycodes.luau | luau | .luau | -- show all pressed keys on linux
local env = require("@std/env")
local process = require("@std/process")
if env.os ~= "Linux" then
error("not supported")
end
local child = process.spawn {
program = "libinput debug-events --show-keycodes",
shell = "sh",
} :: process.PipedChild
-- ensure seal's running i... | 144 |
seal-runtime/seal | seal-runtime-seal-e337169/examples/task_runner.luau | luau | .luau | -- A simple interactive task runner: pick a task from a menu and run it.
-- Copy and adapt the `tasks` table for your own project.
local process = require("@std/process")
local prompt = require("@std/io/prompt")
local colors = require("@std/io/colors")
type Task = {
label: string,
cmd: string,
}
local tasks:... | 233 |
seal-runtime/seal | seal-runtime-seal-e337169/src/scripts/documentation/comments.luau | luau | .luau | --!nolint FunctionUnused
local fs = require("@std/fs")
local parser = require("@libraries/LuauParser/Parser")
local path = ""
const function update_path(p: string)
path = string.gsub(p, fs.path.cwd(), ".")
end
export class BlockComment
public start: vector
public finish: vector
function new(begin_col... | 701 |
seal-runtime/seal | seal-runtime-seal-e337169/src/scripts/documentation/fix.luau | luau | .luau | local fs = require("@std/fs")
local str = require("@std/str")
const path = fs.path.join(script:parent(), "components.luau")
const lines = {}
for _, line in fs.readlines(path) do
if str.startswith(line, "class") then
print(line)
line = "export " .. line
end
table.insert(lines, line)
end
fs.w... | 94 |
seal-runtime/seal | seal-runtime-seal-e337169/src/scripts/documentation/parse.luau | luau | .luau | --!optimize 2
local parser = require("@libraries/LuauParser/Parser")
local fs = require("@std/fs")
local format = require("@std/io/format")
local str = require("@std/str")
const syntax = require("@libraries/LuauParser/Parser/Syntax")
const components = require("./components")
const Documentation = components.Document... | 1,484 |
seal-runtime/seal | seal-runtime-seal-e337169/src/scripts/libraries/LuauParser/Parser/Confusables.luau | luau | .luau | --!optimize 2
--!strict
return {
[34] = '"',
[48] = "O",
[49] = "l",
[73] = "l",
[96] = "'",
[109] = "rn",
[124] = "l",
[160] = " ",
[180] = "'",
[184] = ",",
[198] = "AE",
[215] = "x",
[230] = "ae",
[305] = "i",
[306] = "lJ",
[307] = "ij",
[329] = "'n",
[338] = "OE",
[339] = "oe",
[383] = "f",
[3... | 16,167 |
seal-runtime/seal | seal-runtime-seal-e337169/src/scripts/newest_seal.luau | luau | .luau | -- finds whichever seal build is newest for precommit hook
const fs = require("@std/fs")
const env = require("@std/env")
const datetime = require("@std/time/datetime")
const base_seal = env.executable_path
const seal_options = {
"./target/release/seal",
"./target/debug/seal"
}
const function get_modified_tim... | 217 |
seal-runtime/seal | seal-runtime-seal-e337169/src/scripts/precommit.luau | luau | .luau | -- This script is run by seal's git pre-commit hook to keep README.md up to date.
-- It updates version badges and the handcrafted error message count in-place,
-- and installs the hook itself on first run.
local fs = require("@std/fs")
local env = require("@std/env")
local process = require("@std/process")
local str ... | 1,125 |
seal-runtime/seal | seal-runtime-seal-e337169/src/scripts/signature_generation/apply.luau | luau | .luau | -- Replaces c"..." signature literals in Rust source with signatures::STD_* constants.
-- Run after generate.luau whenever typedefs change.
local fs = require("@std/fs")
local colors = require("@std/io/colors")
local REPO_ROOT = fs.path.project()
assert(REPO_ROOT)
local SRC_DIR = REPO_ROOT .. "/src"
local SIGNATURES_... | 1,199 |
seal-runtime/seal | seal-runtime-seal-e337169/src/scripts/signature_generation/discovery.luau | luau | .luau | -- Shared typedef auto-discovery for generate.luau and validate.luau.
-- Scans .seal/typedefs/std/** and produces typed entries describing each
-- extractable prefix (module functions and class methods).
local parser = require("@libraries/LuauParser/Parser")
local fs = require("@std/fs")
local REPO_ROOT = fs.path.pro... | 5,185 |
seal-runtime/seal | seal-runtime-seal-e337169/src/scripts/signature_generation/generate.luau | luau | .luau | -- Auto-generates src/signatures.rs from typedef files.
-- Run with: seal src/scripts/signature_generation/generate.luau
local discovery = require("./discovery")
local fs = require("@std/fs")
local colors = require("@std/io/colors")
local OUTPUT_PATH = discovery.REPO_ROOT .. "/src/signatures.rs"
-- ── Constant name ... | 625 |
seal-runtime/seal | seal-runtime-seal-e337169/src/scripts/signature_generation/validate.luau | luau | .luau | -- Validates that Rust with_function_and_signature calls match the typedef files.
-- Run with: seal src/scripts/signature_generation/validate.luau
local discovery = require("./discovery")
local fs = require("@std/fs")
local colors = require("@std/io/colors")
local SRC_DIR = discovery.REPO_ROOT .. "/src"
-- ── Build ... | 1,601 |
seal-runtime/seal | seal-runtime-seal-e337169/src/scripts/tabsbad.luau | luau | .luau | local fs = require("@std/fs")
local typedefs = fs.dir.project():join(".seal", "typedefs")
local files_with_tabs: { string } = {}
local path_sub_out = fs.path.join(fs.path.cwd(), ".seal", "typedefs")
for _, file in fs.listdir(typedefs, true) do
for _, line in fs.readlines(file) do
if string.match(line, "... | 126 |
seal-runtime/seal | seal-runtime-seal-e337169/src/setup/default_config.luau | luau | .luau | local config = {
entry_path = "./src/main.luau",
test_path = "./tests/run.luau",
seal_version = "<SEAL_VERSION_REPLACE>"
}
export type SealConfig = {
--- Script that `seal run` runs; usually the entrypoint to your codebase.
--- Defaults to `./src/main.luau`.
entry_path: string?,
--- Script ... | 129 |
seal-runtime/seal | seal-runtime-seal-e337169/src/setup/regen.luau | luau | .luau | local colors = require("@std/colors")
local env = require("@std/env")
local fs = require("@std/fs")
local prompt = require("@std/io/prompt")
local luau = require("@std/luau")
local process = require("@std/process")
local semver = require("@std/semver")
local seal_setup = (require :: any)("@internal/setup") :: {
ex... | 1,392 |
seal-runtime/seal | seal-runtime-seal-e337169/src/std_fs/read_tree.luau | luau | .luau | -- doesn't make sense to write in Rust
local fs = require("@std/fs")
type TreeResult = {
tree: fs.DirectoryTree
} | {
err: string
}
local function readtree(path: string): TreeResult
local directory_tree = {}
for p, entry in fs.entries(path) do
if entry.type == "File" then
(table.insert :: any)(directory_tre... | 220 |
seal-runtime/seal | seal-runtime-seal-e337169/src/std_io/formatter.luau | luau | .luau | --!optimize 2
--!nolint LocalShadow
--[[
doing highly recursive operations + lots of table iteration is faster directly in luau
rather than through mlua's interop layer, which, among other things, has additional safety costs
associated with iterating through tables
]]
const mlua = require("@interop/mlua")
... | 7,917 |
seal-runtime/seal | seal-runtime-seal-e337169/src/std_terminal/events/interrupt_check.luau | luau | .luau | local err = require("@std/err")
export type KeyModifiers = {
ctrl: boolean,
shift: boolean,
alt: boolean,
}
export type KeyEvent = {
type: "Key",
key: string,
kind: string,
modifiers: KeyModifiers,
}
export type MouseEvent = {
type: "Mouse",
kind: string,
position: vector,
m... | 369 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/cheese.luau | luau | .luau | local err = require("@std/err")
local cheese = {}
function cheese.retry(f: () -> (any), tries: number?)
tries = tries or 3
local current = 0
local last_err: error
while current < tries do
local success, err = pcall(f)
if success then
return
else
last_err ... | 130 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/data/bundle_projects/basic/dep.luau | luau | .luau | return { message = "hello from dep" }
| 10 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/data/bundle_projects/basic/main.luau | luau | .luau | local dep = require("./dep")
return dep.message
| 11 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/data/bundle_projects/inlineable/check.luau | luau | .luau | local str = require("@std/str")
local function check_url(location: string): string
local url = location
if not str.startswith(location, "https://") then
url = "https://" .. url
end
return url
end
local function check_compat(url: string)
return true
end
return {
url = check_url,
com... | 85 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/data/bundle_projects/long_string/main.luau | luau | .luau | -- simulates what a file looks like after being bundled once with thread.spawn path inlining:
-- the require inside the long string is inlined source code and must not be replaced when bundled again
local inlined_src = [=====[
local some_module = require("./some_module")
return some_module.value
]=====]
return inlined_... | 70 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/data/bundle_projects/lsl/src/get_size_of_directory.luau | luau | .luau | local fs = require("@std/fs")
--- recursively gets size of `dir` in bytes
--- returns (partial size, error) if any subdirectories were inaccessible, otherwise (full size, nil)
local function get_size_of_directory(dir: string): (number, string?)
local ok, paths = pcall(fs.listdir, dir)
if not ok then
re... | 296 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/data/bundle_projects/lsl/src/main.luau | luau | .luau | --!optimize 2
local fs = require("@std/fs")
local args = require("@std/args")
local colors = require("@std/io/colors")
local env = require("@std/env")
local base64 = require("@std/serde/base64")
local json = require("@std/json")
local str = require("@std/str")
local thread = require("@std/thread")
local datetime = req... | 2,662 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/data/bundle_projects/lsl/src/sizer.luau | luau | .luau | local fs = require("@std/fs")
--- recursively gets size of `dir` in bytes
--- returns (partial size, error) if any subdirectories were inaccessible, otherwise (full size, nil)
local function get_size_of_directory(dir: string): (number, string?)
local ok, paths = pcall(fs.listdir, dir)
if not ok then
re... | 339 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/data/bundle_projects/quoted_string/main.luau | luau | .luau | -- these require() calls are inside regular quoted strings and must not be bundled
local double_quoted = "local db = require('./database')"
local single_quoted = 'local fs = require("@std/fs")'
return { double_quoted = double_quoted, single_quoted = single_quoted }
| 62 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/data/bundle_projects/repeated_dependencies/core.luau | luau | .luau | local core = {}
core.version = _SEAL_VERSION
core.environment = require("@std")
function core.dependencies()
return {
"luau",
"seal",
"python",
"uv"
}
end
return core | 50 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/data/bundle_projects/repeated_dependencies/helper.luau | luau | .luau | local core = require("./core")
local dependencies = core.dependencies()
print(`dependencies: {table.concat(dependencies, ", ")}`)
return {
got_dependencies = dependencies
} | 36 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/data/bundle_projects/repeated_dependencies/main.luau | luau | .luau | local helper = require("./helper")
local core = require("./core")
print(helper.got_dependencies)
print(core.version) | 24 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/luau/errors/another_module.luau | luau | .luau | local fs = require("@std/fs")
local module = {}
function module.execute()
error("hi")
-- print(debug.traceback())
end
function module.readimpossiblefile()
return fs.readfile("./hmm")
end
return module | 48 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/luau/errors/errors.luau | luau | .luau | -- TODO: properly test errors without making tests too brittle
-- local mlua = require("@interop/mlua")
local module = require("./another_module")
local function main()
script.context = "rfing"
module.readimpossiblefile()
return module.execute()
end
local success, result = pcall(main :: any)
-- assert(mlua.iserror... | 81 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/luau/extra/test_csv.luau | luau | .luau | -- TODO, actually fill out the unit tests
local str = require("@std/str")
local path = require("@std/fs/path")
local csv = require("@extra/csv")
local csv_data_path = path.join(".", "tests", "data", "csv_data")
-- just being able to read and parse these files means it handles utf8 and emojis correctly
local courses =... | 473 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/luau/globals/globals.luau | luau | .luau | --!nocheck
local env = require("@std/env")
-- does _G exist and can we do things to it
assert(_G ~= nil, "why doesn't _G exist??")
_G.hmm = "_hmm"
assert(_G.hmm == "_hmm", "can't assign simple variable to _G")
-- do regular globals work?
meow = 2
assert(meow == 2, "assignment to globals borked")
local reserved = (re... | 233 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/luau/globals/output.luau | luau | .luau | local meow = {
fed = false,
data = {
["/opt/idk/2"] = "safe",
},
cats = {
Taz = 1,
Nan = 2,
},
doer = function()
end,
[{ "i am a key" }] = true,
[1.25] = 1,
[vector.create(1, 2, 2312311.23)] = 12,
}
meow.a = meow
meow.cats.newcat = meow.cats
meow.... | 976 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/luau/globals/require/basic-requires/basic_requires.luau | luau | .luau | --!nolint ImportUnused
local fs = require("@std/fs")
local env = require("@std/env")
local process = require("@std/process")
local basic_requires_dir = fs.dir.from(script:parent())
local function dirwithinit()
local canweinitdir = fs.dir.ensure(basic_requires_dir:join("canweinit"))
:add_file("init.luau", 'return "... | 972 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/luau/globals/require/basic-requires/relative_data.luau | luau | .luau | local data = {
relative = "yes very",
callme = function()
return "maybe"
end
}
return data | 26 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/luau/globals/require/cached-requires/helper.luau | luau | .luau | local colors = require("@std/colors")
local state = require("./state")
local helper = {}
function helper.formatname(): string
if state.data.name then
return `@{colors.blue(state.data.name :: any)}`
else
error("state.data.name doesn't exist")
end
end
function helper.changename(new_name: string)
state.data.nam... | 83 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/luau/globals/require/cached-requires/main.luau | luau | .luau | local colors = require("@std/colors")
local state = require("./state")
state.data.name = "seal"
local helper = require("./helper")
assert(helper.formatname() == `@{colors.blue("seal")}`, "state change 1 didnt work")
helper.changename("meow")
assert(helper.formatname() == `@{colors.blue("meow")}`, "state change 2 did... | 86 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/luau/globals/require/cached-requires/state.luau | luau | .luau | local state = {}
state.enabled = false
state.data = {} :: {[any]: any}
return state | 21 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/luau/globals/require/nopanic.luau | luau | .luau | local s, r = pcall(function()
return (require :: any)("./meow!/./*")
end)
if typeof(r) == "error" then
if tostring(r):match("PANIC") then
error(`we panicked but managed to catch the panic (crazy): {r}`)
else
-- we good
end
else
error(`wtf this was supposed to error but actually got:... | 98 |
seal-runtime/seal | seal-runtime-seal-e337169/tests/luau/globals/require/resolver_tests.luau | luau | .luau | local fs = require("@std/fs")
local resolver_src: string = "" do
local resolver_dot_luau_path = fs.path.join(".", "src", "require", "resolver.luau")
resolver_src = fs.readfile(resolver_dot_luau_path)
end
-- hope for/assume this works; if not well test should fail lol
local resolver = require("./../../../../src/requ... | 1,211 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.