diff --git a/.luaurc b/.luaurc deleted file mode 100644 index c87318e6..00000000 --- a/.luaurc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "languageMode": "strict", - "lint": { - "*": true - }, - "aliases": { - "lune-lib": "./.lune/lib", - "lune": "~/.lune/.typedefs/0.10.4/", - "sitegen": "./sitegen", - "zcore": "~/.zune/typedefs/core" - } -} diff --git a/.lune/build.luau b/.lune/build.luau deleted file mode 100644 index dcc71110..00000000 --- a/.lune/build.luau +++ /dev/null @@ -1,425 +0,0 @@ -local collectPackages = require("@lune-lib/utils/collect-packages") -local fs = require("@lune/fs") -local path = require("@lune-lib/utils/path") -local process = require("@lune/process") -local roblox = require("@lune/roblox") -local rootConfig = require("@lune-lib/root-config") -local selectPackages = require("@lune-lib/utils/select-packages") -local serde = require("@lune/serde") -local types = require("@lune-lib/types") - -local packages = selectPackages(collectPackages(process.cwd, rootConfig.packageDir)) -local _, nameToPackage, toBuild = packages.names, packages.nameToPackage, packages.selected - -local distPath = path(process.cwd, "dist") -local distPesdePath = path(distPath, "pesde") -local distWallyPath = path(distPath, "wally") -local distNpmPath = path(distPath, "npm") -local distModelPath = path(distPath, "models") -local distTempPath = path(distPath, "temp") -local distBundlePath = path(distPath, "bundle.rbxm") -local distBundlePlacePath = path(distPath, "bundle.rbxl") - -if fs.isDir(distPath) then - fs.removeDir(distPath) -end - -fs.writeDir(distPath) -fs.writeDir(distPesdePath) -fs.writeDir(distWallyPath) -fs.writeDir(distNpmPath) -fs.writeDir(distModelPath) -fs.writeDir(distTempPath) - -local function copyPackageDir(package: types.Package, destinationDir: string) - for _, file in fs.readDir(package.absolutePath) do - if fs.isFile(file) then - if not file:match("%.luau$") or file == "prvd.config.luau" then - continue - end - end - fs.copy(path(package.absolutePath, file), path(destinationDir, file)) - end -end - -local function generateLinkerFile(package: types.Package, requirePath: string) - local linkerSource = { `local DEPENDENCY = require("{requirePath}")` } - - local packageTypes = package.config.types - if packageTypes then - for type, value in packageTypes do - table.insert(linkerSource, `export type {type} = DEPENDENCY.{if value == true then type else value}`) - end - end - - table.insert(linkerSource, "return DEPENDENCY\n") - - return table.concat(linkerSource, "\n") -end - -local function packageLicensePath(package: types.Package) - return if package.config.license then path(package.absolutePath, "LICENSE.md") else path(process.cwd, "LICENSE.md") -end - --- Pesde - -local packageForPesde -do - type PesdeEnvironment = "roblox" | "roblox_server" | "luau" | "lune" - - type PesdeTarget = { - environment: PesdeEnvironment, - lib: string, - build_files: { string }, - } - - type PesdeIndices = { - default: string, - } - - type PesdeDependency = { - name: string, - version: string, - index: string?, - target: PesdeEnvironment?, - } - - type PesdeManifest = { - name: string, - version: string, - description: string, - license: string, - authors: { string }, - repository: string, - - indices: { - default: string, - }, - - includes: { string }, - - target: PesdeTarget, - - dependencies: { [string]: PesdeDependency }?, - } - - local DEFAULT_TARGETS: { [PesdeEnvironment]: true } = { - roblox = true, - luau = true, - lune = true, - } - - local SYBAU_PESDE = '\ - [scripts]\ - roblox_sync_config_generator = ".pesde/scripts/roblox_sync_config_generator.luau"\ - sourcemap_generator = ".pesde/scripts/sourcemap_generator.luau"\ - \ - [dev_dependencies]\ - scripts = { name = "pesde/scripts_rojo", version = "^0.1.0", target = "lune" }\ - rojo = { name = "pesde/rojo", version = "^7.4.4", target = "lune" }\ - ' - - local function pesdeify(name: string) - return (string.gsub(name, "%-", "_")) - end - - function packageForPesde(package: types.Package) - local targets: { [PesdeEnvironment]: true } = package.config.pesdeTargets or DEFAULT_TARGETS - - local baseManifest: PesdeManifest = { - name = pesdeify(`{rootConfig.publishers.pesde.scope}/{package.config.name}`), - version = package.config.version or rootConfig.defaults.version, - description = package.config.description, - license = package.config.license or rootConfig.defaults.license, - authors = package.config.authors or rootConfig.defaults.authors, - repository = rootConfig.repository, - - indices = { - default = rootConfig.publishers.pesde.registry, - }, - - includes = { - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - }, - - target = { - environment = nil :: any, - lib = "src/init.luau", - build_files = { - "src", - }, - }, - } - - -- NOTE: serde is ass, we serializing this by hand - local dependencies = { "[dependencies]" } - local linkerFiles: { [string]: string } = {} - if package.config.dependencies then - for dependency in package.config.dependencies do - local dependentPackage = nameToPackage[dependency] - - -- I love stylua - table.insert( - dependencies, - `{dependency} = \{ workspace = "{pesdeify( - `{rootConfig.publishers.pesde.scope}/{dependentPackage.config.name}` - )}", ` - .. `version = "{dependentPackage.config.version or rootConfig.defaults.version}" }` - ) - - linkerFiles[dependency] = generateLinkerFile(dependentPackage, `./$TARGET_PACKAGES/{dependency}`) - end - end - - local dependenciesFooter = table.concat(dependencies, "\n") - - local licenseToCopy = packageLicensePath(package) - - for subtarget in targets do - local distPackagePath = path(distPesdePath, subtarget, package.config.name) - fs.writeDir(distPackagePath) - - local src = path(distPackagePath, "src") - fs.writeDir(src) - copyPackageDir(package, src) - - baseManifest = table.clone(baseManifest) - baseManifest.target.environment = subtarget :: any - - for fileName, source in linkerFiles do - local linkerFile = `{fileName}.luau` - table.insert(baseManifest.includes, linkerFile) - table.insert(baseManifest.target.build_files, linkerFile) - fs.writeFile( - path(distPackagePath, linkerFile), - (string.gsub(source, "$TARGET_PACKAGES", `{subtarget}_packages`)) - ) - end - - local manifest = serde.encode("toml", baseManifest, true) - manifest ..= dependenciesFooter - manifest ..= "\n" - - if subtarget == "roblox" then - -- why is pesde so overcomplicated - manifest ..= SYBAU_PESDE - fs.copy(path(process.cwd, ".lune", "pesde-scripts"), path(distPackagePath, ".pesde", "scripts")) - end - - fs.writeFile(path(distPackagePath, "pesde.toml"), manifest) - - fs.copy(licenseToCopy, path(distPackagePath, "LICENSE.md")) - end - end -end - --- Wally - -local packageForWally -do - type WallyManifest = { - package: { - name: string, - description: string, - version: string, - license: string, - authors: { string }, - realm: "shared" | "server", - registry: string, - homepage: string, - repository: string, - private: boolean, - dependencies: { [string]: string }, - }, - } - - function packageForWally(package: types.Package) - local distPackagePath = path(distWallyPath, package.config.name) - fs.writeDir(distPackagePath) - - local manifest: WallyManifest = { - package = { - name = `{rootConfig.publishers.wally.scope}/{package.config.name}`, - description = package.config.description, - version = package.config.version or rootConfig.defaults.version, - license = package.config.license or rootConfig.defaults.license, - authors = package.config.authors or rootConfig.defaults.authors, - realm = "shared", - registry = rootConfig.publishers.wally.registry, - homepage = rootConfig.homepage, - repository = rootConfig.repository, - private = false, - dependencies = {}, - }, - } - - if package.config.dependencies then - for dependency in package.config.dependencies do - local dependentPackage = nameToPackage[dependency] - - -- I love stylua - manifest.package.dependencies[dependency] = - `{rootConfig.publishers.wally.scope}/{dependentPackage.config.name}@{dependentPackage.config.version or rootConfig.defaults.version}` - - fs.writeFile( - path(distPackagePath, `{dependency}.luau`), - generateLinkerFile(dependentPackage, `./Packages/{dependency}`) - ) - end - end - - local src = path(distPackagePath, "src") - fs.writeDir(src) - copyPackageDir(package, src) - - fs.copy(packageLicensePath(package), path(distPackagePath, "LICENSE.md")) - fs.writeFile(path(distPackagePath, "Wally.toml"), serde.encode("toml", manifest, true)) - end -end - --- NPM - -local packageForNpm -do - type NpmManifest = { - name: string, - version: string, - description: string, - main: string, - types: string, - files: { string }, - author: string, - repository: { - type: "git", - url: string, - }, - bugs: { - url: string, - }, - dependencies: { [string]: string }, - } - - local function copyPackageDir(package: types.Package, destinationDir: string) - for _, file in fs.readDir(package.absolutePath) do - if file:match("%.luau$") and file ~= "prvd.config.luau" then - fs.copy(path(package.absolutePath, file), path(destinationDir, file)) - elseif file:match("%.ts$") then - -- fixing import paths - local contents = fs.readFile(path(package.absolutePath, file)) - contents = string.gsub(contents, 'from "%.%./%w+"', function(importPath) - return string.gsub(importPath, "%.%./", `@{rootConfig.publishers.npm.scope}/`) - end) - fs.writeFile(path(destinationDir, file), contents) - end - end - end - - function packageForNpm(package: types.Package) - local distPackagePath = path(distNpmPath, package.config.name) - fs.writeDir(distPackagePath) - - local manifest: NpmManifest = { - name = `@{rootConfig.publishers.npm.scope}/{package.config.name}`, - version = package.config.version or rootConfig.defaults.version, - description = package.config.description, - main = "src/init.luau", - types = "src/init.luau", - files = { - "src", - "LICENSE.md", - "package.json", - }, - author = (package.config.authors or rootConfig.defaults.authors)[1], - repository = { - type = "git", - url = `git+{rootConfig.repository}.git`, - }, - bugs = { - url = `{rootConfig.repository}/issues`, - }, - dependencies = {}, - } - - if package.config.dependencies then - for dependency in package.config.dependencies do - local dependentPackage = nameToPackage[dependency] - - -- I love stylua - manifest.dependencies[`@{rootConfig.publishers.npm.scope}/{dependentPackage.config.name}`] = dependentPackage.config.version - or rootConfig.defaults.version - - fs.writeFile( - path(distPackagePath, `{dependency}.luau`), - generateLinkerFile(dependentPackage, `./Packages/{dependency}`) - ) - end - end - - local src = path(distPackagePath, "src") - fs.writeDir(src) - copyPackageDir(package, src) - - fs.copy(packageLicensePath(package), path(distPackagePath, "LICENSE.md")) - fs.writeFile(path(distPackagePath, "package.json"), serde.encode("json", manifest, true)) - end -end - -local models: { [types.Package]: string } = {} - -local function buildModel(package: types.Package) - local distTempModelPath = path(distTempPath, "models", package.config.name) - fs.writeDir(distTempModelPath) - local src = path(distTempModelPath, "src") - fs.writeDir(src) - copyPackageDir(package, src) - fs.writeFile( - path(distTempModelPath, "default.project.json"), - serde.encode("json", { - name = package.config.name, - tree = { - ["$path"] = "src", - }, - }, true) - ) - local result = process.exec("rojo", { "build", "-o", "model.rbxm", "default.project.json" }, { - cwd = distTempModelPath, - }) - assert(result.ok, result.stderr) - local modelPath = path(distModelPath, `{package.config.name}.rbxm`) - fs.move(path(distTempModelPath, "model.rbxm"), modelPath) - models[package] = modelPath - fs.removeDir(distTempModelPath) -end - -for _, name in toBuild do - print("Building package", name) - local package = nameToPackage[name] - - packageForPesde(package) - packageForWally(package) - packageForNpm(package) - - buildModel(package) -end - -fs.removeDir(distTempPath) -print("Building bundle") - -local bundle = roblox.Instance.new("Folder") -bundle.Name = "prvdmwrong" - -for _, modelPath in models do - for _, instance in roblox.deserializeModel(fs.readFile(modelPath)) do - instance.Parent = bundle - end -end - -fs.writeFile(distBundlePath, roblox.serializeModel({ bundle })) - -local game = roblox.Instance.new("DataModel") -bundle.Parent = game:GetService("ReplicatedStorage") - -fs.writeFile(distBundlePlacePath, roblox.serializePlace(game)) diff --git a/.lune/lib/configure.luau b/.lune/lib/configure.luau deleted file mode 100644 index 7d84c8ff..00000000 --- a/.lune/lib/configure.luau +++ /dev/null @@ -1,81 +0,0 @@ --- Repository - -export type RootPublisher = { - scope: string, - registry: string, -} - -local function publisher(x: RootPublisher) - return table.freeze(x) -end - -export type RepoConfig = { - repository: string, - homepage: string, - packageDir: string, - defaults: { - authors: { string }, - license: string, - version: string, - }, - publishers: { - pesde: RootPublisher, - wally: RootPublisher, - npm: RootPublisher, - } -} - -local function root(x: RepoConfig) - return table.freeze(x) -end - --- Packages - -export type PackageName = - | "prvdmwrong" - | "runtime" - | "logger" - | "dependencies" - | "providers" - | "lifecycles" - | "roots" - | "rbx-components" - | "rbx-lifecycles" - -export type PackageTarget = "roblox" - -export type PackageDependencies = { [PackageName]: true? } - -local function dependencies(x: PackageDependencies) - return table.freeze(x) -end - -export type PackageConfig = { - name: string, - description: string, - - authors: { string }?, - license: string?, - version: string?, - - pesdeTargets: { [PesdeEnvironment]: true }?, - - dependencies: PackageDependencies?, - - types: { [string]: boolean | string }?, - - unreleased: boolean? -} - -local function package(x: PackageConfig) - return table.freeze(x) -end - -export type PesdeEnvironment = "roblox" | "roblox_server" | "luau" | "lune" - -return table.freeze({ - root = root, - publisher = publisher, - package = package, - dependencies = dependencies, -}) diff --git a/.lune/lib/root-config.luau b/.lune/lib/root-config.luau deleted file mode 100644 index 8315f3d4..00000000 --- a/.lune/lib/root-config.luau +++ /dev/null @@ -1,2 +0,0 @@ -local rootConfig = require("../../prvd.config") -return rootConfig diff --git a/.lune/lib/tiniest/tiniest.luau b/.lune/lib/tiniest/tiniest.luau deleted file mode 100644 index d509a9f5..00000000 --- a/.lune/lib/tiniest/tiniest.luau +++ /dev/null @@ -1,219 +0,0 @@ --- From dphfox/tiniest, licenced under BSD ---!strict - -local tiniest_plugin = require("./tiniest_plugin") - -type Context = DescribeContext | RunContext - -type DescribeContext = { - type: "describe", - labels: { string }, - add_test: (Test) -> (), -} - -type RunContext = { - type: "run", -} - -export type ErrorReport = { - type: "tiniest.ErrorReport", - message: string, - trace: string, - code: { - snippet: string, - line: string, - }?, -} - -export type Test = { - labels: { string }, - run: () -> (), -} - -export type RunResult = { - tests: { Test }, - status_tally: { - pass: number, - fail: number, - }, - individual: { [Test]: TestRunResult }, -} - -export type TestRunResult = PassTestRunResult | FailTestRunResult - -export type PassTestRunResult = { - status: "pass", -} - -export type FailTestRunResult = { - status: "fail", - error: ErrorReport, -} - -export type Options = { - plugins: nil | { tiniest_plugin.Plugin }, -} - -export type RunOptions = {} - -local function catch_errors(func: any, ...) - local outer_trace - local function handler(message) - local report: ErrorReport - if typeof(message) == "table" and message.type == "tiniest.ErrorReport" then - report = message :: ErrorReport - else - report = { - type = "tiniest.ErrorReport", - message = tostring(message), - trace = debug.traceback(nil, 2), - } - end - local from, to = string.find(report.trace, outer_trace, 1, true) - if from ~= nil and to ~= nil then - report.trace = report.trace:sub(1, from - 1) .. report.trace:sub(to + 1) - end - return report - end - outer_trace = debug.traceback() - return xpcall(func, handler, ...) -end - -local tiniest = {} - -function tiniest.configure(options: Options) - local plugins = tiniest_plugin.configure(options.plugins) - - local get_context, with_root_context, with_inner_context - do - local current_context: Context? = nil - - function get_context(): Context - assert(current_context ~= nil, "This function can only be called from inside of a test suite") - return current_context - end - - function with_root_context(root_context: Context, inner: (Context) -> ()): () - assert(current_context == nil, "This function can't be called from inside of a test suite") - current_context = root_context - local ok, err = catch_errors(inner :: any, root_context) - current_context = nil - if not ok then - -- bro - -- error(err.message, 0) - error(err, 0) - end - end - - function with_inner_context(make_context: (Context) -> Context, inner: (Context) -> ()): () - local outer_context = get_context() - local inner_context = make_context(outer_context) - current_context = inner_context - local ok, err = catch_errors(inner :: any, inner_context) - current_context = outer_context - if not ok then - error(err.message, 0) - end - end - end - - local self = {} - - function self.describe(label: string, inner: () -> ()): () - with_inner_context(function(outer_context: Context): Context - assert(outer_context.type == "describe", "This function can only be called outside of tests") - local context = table.clone(outer_context) - context.labels = table.clone(context.labels) - table.insert(context.labels, label) - return context - end, inner) - end - - function self.test(label: string, run: () -> ()): () - local context = get_context() - assert(context.type == "describe", "This function can only be called outside of tests") - local labels = table.clone(context.labels) - table.insert(labels, label) - local test: Test = { - labels = labels, - run = run, - } - context.add_test(test) - end - - function self.collect_tests(inner: () -> ()): { Test } - local tests = {} - local context: Context = { - type = "describe", - labels = {}, - add_test = function(test) - table.insert(tests, test) - end, - } - with_root_context(context, inner) - return tests - end - - function self.run_tests(tests: { Test }, run_options: RunOptions): RunResult - plugins.notify("before_run", tests, run_options) - - local context: Context = { - type = "run", - } - - local individual = {} - for _, test in tests do - plugins.notify("before_test", test, run_options) - local _, test_run_result = xpcall(function() - with_root_context(context, test.run) - local pass: TestRunResult = { - status = "pass", - } - return pass - end, function(message) - if typeof(message) == "table" and message.type == "tiniest.ErrorReport" then - local fail: TestRunResult = { - status = "fail", - error = message :: ErrorReport, - } - return fail - else - local error: ErrorReport = { - type = "tiniest.ErrorReport", - message = tostring(message), - trace = debug.traceback(), - } - local fail: TestRunResult = { - status = "fail", - error = error, - } - return fail - end - end) - plugins.notify("after_test", test, test_run_result, run_options) - individual[test] = test_run_result - end - - local status_tally = { - pass = 0, - fail = 0, - } - - for _, result in individual do - status_tally[result.status] += 1 - end - - local result: RunResult = { - tests = tests, - status_tally = status_tally, - individual = individual, - } - plugins.notify("after_run", result, run_options) - - return result - end - - return self -end - -return tiniest diff --git a/.lune/lib/tiniest/tiniest_expect.luau b/.lune/lib/tiniest/tiniest_expect.luau deleted file mode 100644 index 623feecb..00000000 --- a/.lune/lib/tiniest/tiniest_expect.luau +++ /dev/null @@ -1,147 +0,0 @@ --- From dphfox/tiniest, licenced under BSD ---!strict - -local tiniest_quote = require("./tiniest_quote") - -local tiniest_expect = {} - -type Context = { - target: unknown, - test: string, - params: { unknown }, -} - -local context: Context = { - target = nil, - test = "", - params = {}, -} - -local function fail(message: string?): never - local quoted = {} - for index, param in context.params do - quoted[index] = tiniest_quote(param) - end - local param_list = table.concat(quoted, ",") - error({ - type = "tiniest.ErrorReport", - message = "Expectation not met" .. if message == nil then "" else `, because:\n{message}`, - trace = debug.traceback(nil, 4), - code = { - snippet = `expect({tiniest_quote(context.target)}).{context.test}({param_list})`, - line = debug.info(4, "l"), - }, - }, 0) -end - -local function check(condition: boolean, cause: string): () - if not condition then - error(`Bad usage of expect().{context.test}()\nCause: {cause}`, 0) - end -end - -local function is_indexable(x: unknown): boolean - return type(x) == "table" or type(x) == "userdata" -end - -function tiniest_expect.expect(a: any) - local tests = {} - - function tests.exists() - return if a ~= nil then tests else fail() - end - - function tests.never_exists() - return if a == nil then tests else fail() - end - - function tests.is(b: any) - return if a == b then tests else fail() - end - - function tests.never_is(b: any) - return if a ~= b then tests else fail() - end - - function tests.is_true() - check(typeof(a) == "boolean", "expect() value must be boolean") - return if a then tests else fail() - end - - function tests.never_is_true() - check(typeof(a) == "boolean", "expect() value must be boolean") - return if not a then tests else fail() - end - - function tests.is_a(b: string) - return if typeof(a) == b then tests else fail() - end - - function tests.never_is_a(b: string) - return if typeof(a) ~= b then tests else fail() - end - - function tests.has_key(b: any) - check(is_indexable(a), "expect() value must be indexable") - check(b ~= nil, "key cannot be nil") - return if a[b] then tests else fail() - end - - function tests.never_has_key(b: any) - check(is_indexable(a), "expect() value must be indexable") - check(b ~= nil, "key cannot be nil") - return if not a[b] then tests else fail(`[{tiniest_quote(b)}] = {tiniest_quote(a[b])}`) - end - - function tests.has_value(b: any) - check(typeof(a) == "table", "expect() value must be table") - check(b ~= nil, "value cannot be nil") - return if table.find(a, b) then tests else fail() - end - - function tests.never_has_value(b: any) - check(typeof(a) == "table", "expect() value must be table") - check(b ~= nil, "value cannot be nil") - local index = table.find(a, b) - return if index == nil then tests else fail(`Found at index {index}`) - end - - function tests.fails() - check(typeof(a) == "function", "expect() value must be function") - local ok = pcall(a) - return if not ok then tests else fail() - end - - function tests.never_fails() - check(typeof(a) == "function", "expect() value must be function") - local ok, err = pcall(a) - return if ok then tests else fail(`Failed with {tiniest_quote(err)}`) - end - - function tests.fails_with(b: string) - check(typeof(a) == "function", "expect() value must be function") - local ok, err = pcall(a) - return if not ok and err:lower():match(b:lower()) - then tests - else if ok then fail("Did not fail") else fail(`Failed with {tiniest_quote(err)}`) - end - - function tests.never_fails_with(b: string) - check(typeof(a) == "function", "expect() value must be function") - local ok, err = pcall(a) - return if ok or not err:lower():match(b:lower()) then tests else fail() - end - - for name: any, body: any in tests do - tests[name] = function(...) - context.target = a - context.test = name - context.params = { ... } - return body(...) - end - end - - return tests -end - -return tiniest_expect diff --git a/.lune/lib/tiniest/tiniest_for_lune.luau b/.lune/lib/tiniest/tiniest_for_lune.luau deleted file mode 100644 index 89dc2838..00000000 --- a/.lune/lib/tiniest/tiniest_for_lune.luau +++ /dev/null @@ -1,114 +0,0 @@ --- From dphfox/tiniest, licensed under BSD3 ---!strict - -local tiniest = require("./tiniest") -local tiniest_expect = require("./tiniest_expect") -local tiniest_pretty = require("./tiniest_pretty") -local tiniest_snapshot = require("./tiniest_snapshot") -local tiniest_time = require("./tiniest_time") - -local fs = require("@lune/fs") -local luau = require("@lune/luau") - -export type Options = { - snapshot_path: string?, - save_snapshots: boolean?, - pretty: nil | { - disable_colour: boolean?, - disable_emoji: boolean?, - disable_unicode: boolean?, - disable_output: nil | { - after_run: boolean?, - }, - }, -} - -local tiniest_for_lune = {} - -function tiniest_for_lune.configure(options: Options) - local self = {} - - local function get_path_to_snapshot(key: string): string - assert(options.snapshot_path ~= nil) - return `{options.snapshot_path}/{key}.snap.luau` - end - - local function load_snapshots(key: string): { string }? - local path = get_path_to_snapshot(key) - if not fs.isFile(path) then - return nil - else - local ok, result = pcall(function() - local source = fs.readFile(path) - local bytecode = luau.compile(source) - local loaded = luau.load(bytecode, { - injectGlobals = false, - }) - return loaded() - end) - if ok then - return result - else - error("[tiniest_for_lune] Failed to load snapshots from disk: " .. tostring(result), 0) - end - end - end - - local function save_snapshots(key: string, snapshots: { string }): () - local ok, result = pcall(function() - snapshots = table.clone(snapshots) - for index, snapshot in snapshots do - snapshots[index] = `[====[{snapshot}]====]` - end - fs.writeFile( - get_path_to_snapshot(key), - "-- Auto-generated by dphfox/tiniest. Do not modify!\n" - .. "--!nocheck\n" - .. "return {" - .. table.concat(snapshots, ", ") - .. "}" - ) - end) - if not ok then - error("[tiniest_for_lune] Failed to save snapshots to disk: " .. tostring(result), 0) - end - end - - self.expect = tiniest_expect.expect - - local tiniest_time = tiniest_time.configure({ - get_timestamp = os.clock, - }) - - local tiniest_snapshot = tiniest_snapshot.configure({ - load_snapshots = if options.snapshot_path then load_snapshots else nil, - save_snapshots = if options.save_snapshots then save_snapshots else nil, - }) - self.snapshot = tiniest_snapshot.snapshot - - local tiniest_pretty = tiniest_pretty.configure({ - disable_colour = options.pretty and options.pretty.disable_colour, - disable_emoji = options.pretty and options.pretty.disable_emoji, - disable_unicode = options.pretty and options.pretty.disable_unicode, - disable_output = options.pretty and options.pretty.disable_output, - plugins = { tiniest_time :: any, tiniest_snapshot }, - }) - self.format_run = tiniest_pretty.format_run - - local tiniest = tiniest.configure({ - plugins = { tiniest_time :: any, tiniest_snapshot, tiniest_pretty }, - }) - self.describe = tiniest.describe - self.test = tiniest.test - self.collect_tests = tiniest.collect_tests - self.run_tests = tiniest.run_tests - - return self -end - --- bro -export type Configured = typeof(tiniest.configure({})) & { - expect: typeof(tiniest_expect.expect), -} - -return tiniest_for_lune diff --git a/.lune/lib/tiniest/tiniest_plugin.luau b/.lune/lib/tiniest/tiniest_plugin.luau deleted file mode 100644 index f4c6ebe9..00000000 --- a/.lune/lib/tiniest/tiniest_plugin.luau +++ /dev/null @@ -1,36 +0,0 @@ --- From dphfox/tiniest, licenced under BSD ---!strict - -export type Plugin = { - is_tiniest_plugin: true, -} - -local tiniest_plugin = {} - -function tiniest_plugin.configure(plugins: { any }?) - if plugins ~= nil then - for index, plugin in plugins do - if not plugin.is_tiniest_plugin then - error(`sanity check: plugin #{index} is not a valid plugin`) - end - end - end - - local self = {} - - function self.notify(method_name: string, ...): () - if plugins == nil then - return - end - for _, plugin in plugins do - local method = plugin[method_name] - if typeof(method) == "function" then - method(...) - end - end - end - - return self -end - -return tiniest_plugin diff --git a/.lune/lib/tiniest/tiniest_pretty.luau b/.lune/lib/tiniest/tiniest_pretty.luau deleted file mode 100644 index 2654e979..00000000 --- a/.lune/lib/tiniest/tiniest_pretty.luau +++ /dev/null @@ -1,228 +0,0 @@ --- From dphfox/tiniest, licenced under BSD ---!strict - -local tiniest = require("./tiniest") -local tiniest_plugin = require("./tiniest_plugin") -type Test = tiniest.Test -type TestRunResult = tiniest.TestRunResult -type RunResult = tiniest.RunResult - -export type Options = { - plugins: nil | { tiniest_plugin.Plugin }, - disable_emoji: boolean?, - disable_unicode: boolean?, - disable_colour: boolean?, - disable_output: nil | { - after_run: boolean?, - }, -} - -local tiniest_pretty = {} - -function tiniest_pretty.configure(options: Options) - if options.disable_unicode then - options.disable_emoji = true - end - - local plugins = tiniest_plugin.configure(options.plugins) - - local function string_len(text: string) - if options.disable_unicode then - return string.len(text) - else - return utf8.len(text) or string.len(text) - end - end - local status_icons = { - pass = if options.disable_emoji then "[PASS]" else "✅", - fail = if options.disable_emoji then "[FAIL]" else "❌", - } - local crumb_trail = if options.disable_unicode then " > " else " ▸ " - local divider = if options.disable_unicode then "=" else "═" - local margin_line = if options.disable_unicode then "|" else "│" - - local paint = {} - do - local function ansi_mode(...) - if options.disable_colour then - return "" - else - return `{string.char(27)}[{table.concat({ ... }, ";")}m` - end - end - local DIM = ansi_mode("2") - local PASS = ansi_mode("1", "32") - local PASS_DIM = ansi_mode("2", "32") - local FAIL = ansi_mode("1", "31") - local FAIL_DIM = ansi_mode("2", "31") - local TRACE = ansi_mode("1", "34") - local TRACE_DIM = ansi_mode("2", "34") - local NUMBER = ansi_mode("1", "36") - local STRING = ansi_mode("1", "33") - local KEYWORD = ansi_mode("1", "35") - local RESET = ansi_mode("0") - - function paint.dim(text: string): string - return DIM .. text .. RESET - end - - function paint.pass(text: string): string - return PASS .. text .. RESET - end - - function paint.pass_dim(text: string): string - return PASS_DIM .. text .. RESET - end - - function paint.fail(text: string): string - return FAIL .. text .. RESET - end - - function paint.fail_dim(text: string): string - return FAIL_DIM .. text .. RESET - end - - function paint.trace(text: string): string - return TRACE .. text .. RESET - end - - function paint.trace_dim(text: string): string - return TRACE_DIM .. text .. RESET - end - - function paint.number(text: string): string - return NUMBER .. text .. RESET - end - - function paint.string(text: string): string - return STRING .. text .. RESET - end - - function paint.keyword(text: string): string - return KEYWORD .. text .. RESET - end - end - - local LINE_LENGTH = 80 - local full_width_divider = paint.dim(string.rep(divider, LINE_LENGTH)) - local function title(text: string): string - local no_ansi = text:gsub(`{string.char(27)}.-m`, "") - local divider_count = (LINE_LENGTH - string_len(no_ansi) - 2) / 2 - local divider_lhs = string.rep(divider, math.ceil(divider_count)) - local divider_rhs = string.rep(divider, math.floor(divider_count)) - return paint.dim(divider_lhs) .. " " .. text .. " " .. paint.dim(divider_rhs) - end - local function syntax(snippet: string): string - return snippet - :gsub("0?[xXbB]?%d*%.?%d*[eE]?%-?%d+", paint.number) - :gsub('".-"', paint.string) - :gsub("'.-'", paint.string) - :gsub("function", paint.keyword) - :gsub("end", paint.keyword) - :gsub("true", paint.keyword) - :gsub("false", paint.keyword) - :gsub("nil", paint.keyword) - :gsub("%-%-.-\n", paint.dim) - end - local function indent(passage: string, indentation: string): string - return passage:gsub("\n", "\n" .. indentation) - end - - local self = {} - self.is_tiniest_plugin = true - - function self.format_run(run_result: RunResult): string - local lines = {} - - local pretty_results = {} - for _, test in run_result.tests do - local result = run_result.individual[test] - local painted_labels = table.clone(test.labels) - for index, label in painted_labels do - local style = result.status .. if index < #painted_labels then "_dim" else "" - painted_labels[index] = paint[style](label) - end - local annotations = "" - local function add_annotation(annotation: string): () - annotations ..= ` - {annotation}` - end - plugins.notify("add_annotations", result, options, add_annotation) - local pretty = { - test = test, - result = result, - crumbs = table.concat(painted_labels, paint[result.status .. "_dim"](crumb_trail)), - icon = status_icons[result.status], - annotations = paint.dim(annotations), - } - table.insert(pretty_results, pretty) - end - - if run_result.status_tally.fail > 0 then - table.insert(lines, title(`Errors from {run_result.status_tally.fail} test(s)`)) - table.insert(lines, "") - for _, pretty in pretty_results do - if pretty.result.status == "pass" then - continue - end - table.insert(lines, `{pretty.icon} {pretty.crumbs}`) - table.insert(lines, paint.trace(pretty.result.error.message)) - local code = pretty.result.error.code - if code ~= nil then - local num_length = string_len(code.line) - local empty_margin = string.rep(" ", num_length + 1) .. paint.dim(margin_line) .. " " - table.insert(lines, empty_margin) - table.insert( - lines, - `{paint.dim(`{code.line} {margin_line}`)} {indent(syntax(code.snippet), empty_margin)}` - ) - table.insert(lines, empty_margin) - end - local trace = pretty.result.error.trace:gsub("\n+$", "") - table.insert(lines, paint.trace_dim(trace)) - table.insert(lines, "") - end - end - - local line_items = {} - local function add_line_items(key: string, value: string): () - table.insert(line_items, `{paint.dim(key .. ":")} {value}`) - end - plugins.notify("add_line_items", run_result, options, add_line_items) - - table.insert(lines, title(`Status of {#pretty_results} test(s)`)) - table.insert(lines, "") - for _, pretty in pretty_results do - table.insert(lines, `{pretty.icon} {pretty.crumbs}{pretty.annotations}`) - end - table.insert(lines, "") - table.insert( - lines, - title( - `{paint.pass(`{run_result.status_tally.pass} passed`)}, {paint.fail( - `{run_result.status_tally.fail} failed` - )}` - ) - ) - if #line_items > 0 then - table.insert(lines, "") - for _, line_item in line_items do - table.insert(lines, line_item) - end - table.insert(lines, "") - table.insert(lines, full_width_divider) - end - - return table.concat(lines, "\n") - end - - function self.after_run(run_result: RunResult, _): () - if options.disable_output and options.disable_output.after_run then - return - end - print(self.format_run(run_result)) - end - - return self -end - -return tiniest_pretty diff --git a/.lune/lib/tiniest/tiniest_quote.luau b/.lune/lib/tiniest/tiniest_quote.luau deleted file mode 100644 index c2310337..00000000 --- a/.lune/lib/tiniest/tiniest_quote.luau +++ /dev/null @@ -1,40 +0,0 @@ --- From dphfox/tiniest, licenced under BSD ---!strict - -local function tiniest_quote(x: unknown, given_indent_amount: number?): string - if type(x) == "nil" or type(x) == "number" or type(x) == "boolean" or type(x) == "userdata" then - return tostring(x) - elseif type(x) == "string" then - return string.format("%q", x) - elseif type(x) == "function" then - return "function() ... end" - elseif type(x) == "table" then - local outer_indent_amount = given_indent_amount or 0 - local inner_indent_amount = outer_indent_amount + 1 - local outer_indent = string.rep(" ", outer_indent_amount) - local inner_indent = string.rep(" ", inner_indent_amount) - - local tbl: {} = x :: any - local sorted_pairs = {} - for key, value in tbl do - table.insert(sorted_pairs, { - key = tiniest_quote(key, inner_indent_amount), - value = tiniest_quote(value, inner_indent_amount), - }) - end - table.sort(sorted_pairs, function(a, b) - return a.key < b.key - end) - local frozen = table.isfrozen(tbl) - local lines = { if frozen then "table.freeze {" else "{" } - for _, pair in sorted_pairs do - table.insert(lines, `{inner_indent}[{pair.key}] = {pair.value};`) - end - table.insert(lines, outer_indent .. "}") - return table.concat(lines, "\n") - else - return `{type(x)}({tostring(x)})` - end -end - -return tiniest_quote :: (unknown) -> string diff --git a/.lune/lib/tiniest/tiniest_snapshot.luau b/.lune/lib/tiniest/tiniest_snapshot.luau deleted file mode 100644 index eba9de3e..00000000 --- a/.lune/lib/tiniest/tiniest_snapshot.luau +++ /dev/null @@ -1,159 +0,0 @@ --- From dphfox/tiniest, licensed under BSD3 ---!strict - -local tiniest = require("./tiniest") -local tiniest_quote = require("./tiniest_quote") -type Test = tiniest.Test - -export type TestRunResult = tiniest.TestRunResult & { - num_snapshots_updated: number, - num_snapshots_obsolete: number, -} -export type RunResult = tiniest.RunResult & { - num_snapshots_updated: number, - num_snapshots_obsolete: number, -} - -export type Options = { - save_snapshots: nil | (key: string, values: { string }) -> (), - load_snapshots: nil | (key: string) -> { string }?, -} - -type TestContext = { - key: string, - snapshots: { string }, - next_snapshot_index: number, - num_updated: number, -} - -type RunContext = { - num_updated: number, - num_obsolete: number, -} - -local tiniest_snapshot = {} - -function tiniest_snapshot.configure(options: Options) - local self = {} - self.is_tiniest_plugin = true - - local function get_test_key(test: Test) - local labels = {} - for _, label in test.labels do - label = label:lower():gsub("[^%w%s]", ""):gsub(" ", "_") - table.insert(labels, label) - end - return table.concat(labels, ".") - end - - local run_context: RunContext? - local test_context: TestContext? - - function self.snapshot(x: unknown): () - if options.load_snapshots == nil then - error("snapshot() is unavailable - snapshots have not been configured", 0) - elseif run_context == nil or test_context == nil then - error("snapshot() can only be used while a test is running with tiniest_snapshot", 0) - end - - local snapshot_index = test_context.next_snapshot_index - test_context.next_snapshot_index += 1 - - local fresh_snapshot = tiniest_quote(x) - local snapshot_on_disk = test_context.snapshots[snapshot_index] - test_context.snapshots[snapshot_index] = fresh_snapshot - - if fresh_snapshot == snapshot_on_disk then - return - end - - if options.save_snapshots then - run_context.num_updated += 1 - test_context.num_updated += 1 - test_context.snapshots[snapshot_index] = fresh_snapshot - elseif snapshot_on_disk == nil then - error({ - type = "tiniest.ErrorReport", - message = "New snapshot() call needs to be saved.\nRun while saving snapshots to save it to disk.", - trace = debug.traceback(nil, 2), - code = { - snippet = `snapshot({fresh_snapshot})`, - line = debug.info(2, "l"), - }, - }, 0) - else - error({ - type = "tiniest.ErrorReport", - message = "Snapshot does not match", - trace = debug.traceback(nil, 2), - code = { - snippet = `snapshot({fresh_snapshot})\n\n-- snapshot on disk:\nsnapshot({snapshot_on_disk})`, - line = debug.info(2, "l"), - }, - }, 0) - end - end - - function self.before_run(_, _): () - run_context = { - num_updated = 0, - num_obsolete = 0, - } - end - - function self.after_run(original_run_result: tiniest.RunResult, _): () - assert(run_context ~= nil) - local run_result = original_run_result :: RunResult - run_result.num_snapshots_updated = run_context.num_updated - run_result.num_snapshots_obsolete = run_context.num_obsolete - run_context = nil - end - - function self.before_test(test: Test, _): () - assert(run_context ~= nil) - local key = get_test_key(test) - test_context = { - key = key, - snapshots = options.load_snapshots and options.load_snapshots(key) or {}, - next_snapshot_index = 1, - num_updated = 0, - } - end - - function self.after_test(_, original_run_result: tiniest.TestRunResult, _): () - assert(run_context ~= nil) - assert(test_context ~= nil) - local run_result = original_run_result :: TestRunResult - run_result.num_snapshots_updated = test_context.num_updated - run_result.num_snapshots_obsolete = test_context.next_snapshot_index - #test_context.snapshots - 1 - run_context.num_obsolete += run_result.num_snapshots_obsolete - if test_context.num_updated > 0 and options.save_snapshots ~= nil then - options.save_snapshots(test_context.key, test_context.snapshots) - end - test_context = nil - end - - function self.add_annotations(original_run_result: tiniest.TestRunResult, _, add_annotation: (string) -> ()) - local run_result = original_run_result :: TestRunResult - if run_result.num_snapshots_updated > 0 then - add_annotation(`{run_result.num_snapshots_updated} snapshot(s) updated`) - end - if run_result.num_snapshots_obsolete > 0 then - add_annotation(`{run_result.num_snapshots_obsolete} snapshot(s) obsolete`) - end - end - - function self.add_line_items(original_run_result: tiniest.RunResult, _, add_line_item: (string, string) -> ()) - local run_result = original_run_result :: RunResult - if run_result.num_snapshots_updated > 0 then - add_line_item("Updated snapshots", tostring(run_result.num_snapshots_updated)) - end - if run_result.num_snapshots_obsolete > 0 then - add_line_item("Obsolete snapshots", tostring(run_result.num_snapshots_obsolete)) - end - end - - return self -end - -return tiniest_snapshot diff --git a/.lune/lib/tiniest/tiniest_time.luau b/.lune/lib/tiniest/tiniest_time.luau deleted file mode 100644 index 48adf1c4..00000000 --- a/.lune/lib/tiniest/tiniest_time.luau +++ /dev/null @@ -1,86 +0,0 @@ --- From dphfox/tiniest, licenced under BSD ---!strict - -local tiniest = require("./tiniest") -local tiniest_pretty = require("./tiniest_pretty") -type Test = tiniest.Test - -export type TestRunResult = tiniest.TestRunResult & { - duration: number, -} -export type RunResult = tiniest.RunResult & { - duration: number, -} - -export type Options = { - get_timestamp: () -> number, -} - -local tiniest_time = {} - -local function format_duration(seconds: number, options: tiniest_pretty.Options): string - local SECOND = 1 - local MILLISECOND = SECOND / 1000 - local MICROSECOND = MILLISECOND / 1000 - local suffix = { - micro = if options.disable_unicode then "u" else "µ", - milli = "m", - } - - if seconds < 100 * MICROSECOND then - return `{math.ceil(seconds / MICROSECOND * 100) / 100}{suffix.micro}s` - elseif seconds < 100 * MILLISECOND then - return `{math.ceil(seconds / MILLISECOND * 100) / 100}{suffix.milli}s` - else - return `{math.ceil(seconds * 100) / 100}s` - end -end - -function tiniest_time.configure(options: Options) - local self = {} - self.is_tiniest_plugin = true - - local start_times = {} - - function self.before_run(tests: { Test }, _): () - start_times[tests] = options.get_timestamp() - end - - function self.after_run(original_run_result: tiniest.RunResult, _): () - local run_result = original_run_result :: RunResult - run_result.duration = options.get_timestamp() - start_times[run_result.tests] - start_times[run_result.tests] = nil - end - - function self.before_test(test: Test, _): () - start_times[test] = options.get_timestamp() - end - - function self.after_test(test: Test, original_run_result: tiniest.TestRunResult, _): () - local run_result = original_run_result :: TestRunResult - run_result.duration = options.get_timestamp() - start_times[test] - start_times[test] = nil - end - - function self.add_annotations( - original_run_result: tiniest.TestRunResult, - options: tiniest_pretty.Options, - add_annotation: (string) -> () - ) - local run_result = original_run_result :: TestRunResult - add_annotation(format_duration(run_result.duration, options)) - end - - function self.add_line_items( - original_run_result: tiniest.RunResult, - options: tiniest_pretty.Options, - add_line_item: (string, string) -> () - ) - local run_result = original_run_result :: RunResult - add_line_item("Time to run", format_duration(run_result.duration, options)) - end - - return self -end - -return tiniest_time diff --git a/.lune/lib/types.luau b/.lune/lib/types.luau deleted file mode 100644 index ade017aa..00000000 --- a/.lune/lib/types.luau +++ /dev/null @@ -1,17 +0,0 @@ -local configure = require("@lune-lib/configure") - -export type PackageContext = { - rootDir: string, - outDir: string, - outWorkDir: string, - packagesDir: string, - packages: { [string]: Package }, -} - -export type Package = { - absolutePath: string, - relativePath: string, - config: configure.PackageConfig, -} - -return nil diff --git a/.lune/lib/utils/collect-packages.luau b/.lune/lib/utils/collect-packages.luau deleted file mode 100644 index dd9931f4..00000000 --- a/.lune/lib/utils/collect-packages.luau +++ /dev/null @@ -1,37 +0,0 @@ -local configure = require("@lune-lib/configure") -local fs = require("@lune/fs") -local path = require("@lune-lib/utils/path") -local types = require("@lune-lib/types") - -local function collectPackages(rootPath: string, packageDir: string) - local packages: { types.Package } = {} - local packageDirPath = path(rootPath, packageDir) - local knownNames = {} - - for _, package in fs.readDir(packageDirPath) do - local packagePath = path(packageDirPath, package) - if fs.isDir(packagePath) then - local packageRelativePath = path(packageDir, package) - local configRequirePath = path(packageRelativePath, "prvd.config") - local configPath = path(packagePath, "prvd.config.luau") - - if fs.isFile(configPath) then - -- HACK: lune i beg you to have a cwd parameter for requires - local config: configure.PackageConfig = (require)(`@lune-lib/../../{configRequirePath}`) - - assert(not knownNames[config.name], `Duplicate package name found: {config.name}`) - knownNames[config.name] = true - - table.insert(packages, { - absolutePath = packagePath, - relativePath = packageRelativePath, - config = config, - }) - end - end - end - - return packages -end - -return collectPackages diff --git a/.lune/lib/utils/path.luau b/.lune/lib/utils/path.luau deleted file mode 100644 index 34b1fed4..00000000 --- a/.lune/lib/utils/path.luau +++ /dev/null @@ -1,9 +0,0 @@ -local process = require("@lune/process") - -local delimiter = if process.os == "windows" then "\\" else "/" - -local function path(...: string) - return table.concat({ ... }, delimiter) -end - -return path diff --git a/.lune/lib/utils/print-divider.luau b/.lune/lib/utils/print-divider.luau deleted file mode 100644 index ffc3f8c8..00000000 --- a/.lune/lib/utils/print-divider.luau +++ /dev/null @@ -1,14 +0,0 @@ -local styles = require("./styles") - -local LINE_COUNT = 80 - -local bold = styles.bold -local dim = styles.dim - -local function printDivider(str: string, lineCount: number?) - local dashRepeats = ((lineCount or LINE_COUNT) - str:len()) * 0.5 - local extraIfUneven = if str:len() % 2 ~= 0 then 1 else 0 - return print(bold(`{dim(string.rep("=", dashRepeats))} {str} {dim(string.rep("=", dashRepeats + extraIfUneven))}`)) -end - -return printDivider diff --git a/.lune/lib/utils/select-packages.luau b/.lune/lib/utils/select-packages.luau deleted file mode 100644 index 98c14574..00000000 --- a/.lune/lib/utils/select-packages.luau +++ /dev/null @@ -1,42 +0,0 @@ -local process = require("@lune/process") -local stdio = require("@lune/stdio") -local types = require("@lune-lib/types") - -local function selectPackages(packages: { types.Package }): { - names: { string }, - nameToPackage: { [string]: types.Package }, - selected: { string }, -} - local packageNames = {} - local nameToPackage = {} - - local selected: { string } = {} - - table.sort(packages, function(lhs, rhs) - return lhs.config.name < rhs.config.name - end) - - for _, package in packages do - local name = package.config.name - table.insert(packageNames, name) - nameToPackage[name] = package - end - - if #process.args == 0 then - for _, index in stdio.prompt("multiselect", "Which packages to build?", packageNames) do - table.insert(selected, packageNames[index]) - end - elseif table.find(process.args, "all") then - selected = table.clone(packageNames) - else - table.move(process.args, 1, #process.args, 1, selected) - end - - return { - names = packageNames, - nameToPackage = nameToPackage, - selected = selected, - } -end - -return selectPackages diff --git a/.lune/lib/utils/styles.luau b/.lune/lib/utils/styles.luau deleted file mode 100644 index 7a30dfa9..00000000 --- a/.lune/lib/utils/styles.luau +++ /dev/null @@ -1,40 +0,0 @@ -local stdio = require("@lune/stdio") - -local RESET_STYLE = stdio.style("reset") -local RESET_COLOR = stdio.color("reset") - -local function wrapStyle(style: stdio.Style) - local code = stdio.style(style) - return function(str: string) - return code .. str .. RESET_STYLE - end -end - -local function wrapColor(color: stdio.Color) - local code = stdio.color(color) - return function(str: string) - return code .. str .. RESET_COLOR - end -end - -local function wrapCode(code: string) - return function() - stdio.write(code) - end -end - -return table.freeze({ - dim = wrapStyle("dim"), - bold = wrapStyle("bold"), - - red = wrapColor("red"), - yellow = wrapColor("yellow"), - green = wrapColor("green"), - cyan = wrapColor("cyan"), - blue = wrapColor("blue"), - purple = wrapColor("purple"), - black = wrapColor("black"), - white = wrapColor("white"), - - clearLine = wrapCode("\x1b[2K\x1b[2A"), -}) diff --git a/.lune/pesde-scripts/roblox_sync_config_generator.luau b/.lune/pesde-scripts/roblox_sync_config_generator.luau deleted file mode 100644 index 8aa75020..00000000 --- a/.lune/pesde-scripts/roblox_sync_config_generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/roblox_sync_config_generator") diff --git a/.lune/pesde-scripts/sourcemap-generator.luau b/.lune/pesde-scripts/sourcemap-generator.luau deleted file mode 100644 index ba9144a3..00000000 --- a/.lune/pesde-scripts/sourcemap-generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/sourcemap_generator") diff --git a/.lune/publish.luau b/.lune/publish.luau deleted file mode 100644 index e69de29b..00000000 diff --git a/.lune/tiniest.luau b/.lune/tiniest.luau deleted file mode 100644 index 9213bcae..00000000 --- a/.lune/tiniest.luau +++ /dev/null @@ -1,25 +0,0 @@ -local fs = require("@lune/fs") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune").configure({}) - -local tests = tiniest.collect_tests(function() - local function visitDir(path: string, luauPath: string) - for _, entry in fs.readDir(path) do - local fullPath = path .. "/" .. entry - local fullLuauPath = luauPath .. "/" .. entry - if fs.isDir(fullPath) then - visitDir(fullPath, fullLuauPath) - elseif fs.isFile(fullPath) and fullPath:match("%.spec.luau$") ~= nil then - (require)(fullLuauPath)(tiniest) - end - end - end - - for _, package in fs.readDir("packages") do - tiniest.describe(package, function() - visitDir("packages/" .. package, "../packages/" .. package) - end) - end -end) - -tiniest.run_tests(tests, {}) --- print(tiniest.format_run()) diff --git a/.lute/.config.luau b/.lute/.config.luau new file mode 100644 index 00000000..ba0f53a7 --- /dev/null +++ b/.lute/.config.luau @@ -0,0 +1,15 @@ +return { + luau = { + aliases = { + -- Lute + std = "~/.lute/typedefs/1.0.0/std", + lute = "~/.lute/typedefs/1.0.0/lute", + lint = "~/.lute/typedefs/1.0.0/lint", + -- Lute @batteries + batteries = "./batteries", + -- Welcome To Hell + libs = "../libs", + scripts = ".", + }, + }, +} diff --git a/.lute/aliases.luau b/.lute/aliases.luau new file mode 100644 index 00000000..8084451d --- /dev/null +++ b/.lute/aliases.luau @@ -0,0 +1,24 @@ +local findCommentRegion = require "@scripts/libs/findCommentRegion" +local fs = require "@std/fs" +local json = require "@std/json" +local path = require "@std/path" +local pp = require "@batteries/pp" +local run = require "@scripts/libs/run" +local useMonorepo = require "@scripts/libs/monorepo/useMonorepo" + +local monorepo = useMonorepo() + +local luauAliases = {} +for _, member in ipairs(monorepo) do + luauAliases[member.dirName] = path.format(member.dirPath) +end + +local configLuau = fs.readFileToString ".config.luau" +local aliasesStart, aliasesEnd = findCommentRegion(configLuau, "aliases") + +configLuau = string.sub(configLuau, 1, assert(aliasesStart) - 1) + .. `-- #region aliases\nlocal aliases = {pp(luauAliases)}\n-- #endregion` + .. string.sub(configLuau, assert(aliasesEnd) + 1) + +fs.writeStringToFile(".config.luau", configLuau) +run("stylua", { ".config.luau" }) diff --git a/.lute/batteries/base64.luau b/.lute/batteries/base64.luau new file mode 100644 index 00000000..61c5cd88 --- /dev/null +++ b/.lute/batteries/base64.luau @@ -0,0 +1,142 @@ +--!optimize 2 +--!strict + +local BASE64_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" +local BASE64_ENCODING_LUT = table.create(4096) :: { number } +local BASE64_DECODING_LUT = buffer.create(256) + +do + for i = 0, 4095 do + local hi = bit32.rshift(i, 6) + 1 + local lo = bit32.band(i, 0x3F) + 1 + BASE64_ENCODING_LUT[i + 1] = + bit32.bor(string.byte(BASE64_ALPHABET, hi), bit32.lshift(string.byte(BASE64_ALPHABET, lo), 8)) + end + + -- prefill lookup table with invalid base64 value (0xFF) + buffer.fill(BASE64_DECODING_LUT, 0, 0xFF) + for i = 1, #BASE64_ALPHABET do + buffer.writeu8(BASE64_DECODING_LUT, string.byte(BASE64_ALPHABET, i), i - 1) + end +end + +@native +local function encode(input_buffer: buffer): buffer + assert(typeof(input_buffer) == "buffer", "Expected input to be a buffer") + + local input_length = buffer.len(input_buffer) + + if input_length == 0 then + return buffer.create(0) + end + + local output = buffer.create(((input_length + 2) // 3) * 4) + local output_idx = 0 + local i = 0 + + while i + 3 <= input_length do + local triple = bit32.bor( + bit32.lshift(buffer.readu8(input_buffer, i), 16), + bit32.lshift(buffer.readu8(input_buffer, i + 1), 8), + buffer.readu8(input_buffer, i + 2) + ) + + local high = bit32.band(bit32.rshift(triple, 12), 0xFFF) + 1 + local low = bit32.band(triple, 0xFFF) + 1 + + local pair0 = BASE64_ENCODING_LUT[high] + local pair1 = BASE64_ENCODING_LUT[low] + + buffer.writeu32(output, output_idx, bit32.bor(pair0, bit32.lshift(pair1, 16))) + + i += 3 + output_idx += 4 + end + + local rem = input_length - i + + if rem == 1 then + local high = bit32.band(bit32.lshift(buffer.readu8(input_buffer, i), 4), 0xFF0) + + local TWO_EQUALS = 0x3D3D + buffer.writeu32(output, output_idx, bit32.bor(BASE64_ENCODING_LUT[high + 1], bit32.lshift(TWO_EQUALS, 16))) + elseif rem == 2 then + local first = buffer.readu8(input_buffer, i) + local second = buffer.readu8(input_buffer, i + 1) + local high = bit32.bor(bit32.lshift(first, 4), bit32.rshift(second, 4)) + local low_idx = bit32.lshift(bit32.band(second, 0x0F), 2) + local low_equals = bit32.bor(string.byte(BASE64_ALPHABET, low_idx + 1), bit32.lshift(0x3D, 8)) + + buffer.writeu32(output, output_idx, bit32.bor(BASE64_ENCODING_LUT[high + 1], bit32.lshift(low_equals, 16))) + end + + return output +end + +@native +local function decode(input_buffer: buffer): buffer + assert(typeof(input_buffer) == "buffer", "Expected input to be a buffer") + + local input_length = buffer.len(input_buffer) + + if input_length == 0 then + return buffer.create(0) + end + + -- strip padding (rfc-4648 section 3.3: the excess pad characters MAY also be ignored) + while input_length > 0 and buffer.readu8(input_buffer, input_length - 1) == 0x3D do + input_length -= 1 + end + + -- rfc-4648 section 3.3 forbids padding that isn't preceded by at least one Base64 digit + if input_length == 0 then + error("Invalid base64 input", 2) + end + + -- get correct output size + local output_length = (3 * input_length) // 4 + local output = buffer.create(output_length) + + local read_offset = 0 + local write_offset = 0 + -- loop invariant: at least 4 bytes to write + while write_offset + 4 <= output_length do + local b4 = buffer.readu8(BASE64_DECODING_LUT, buffer.readu8(input_buffer, read_offset + 3)) + local b3 = buffer.readu8(BASE64_DECODING_LUT, buffer.readu8(input_buffer, read_offset + 2)) + local b2 = buffer.readu8(BASE64_DECODING_LUT, buffer.readu8(input_buffer, read_offset + 1)) + local b1 = buffer.readu8(BASE64_DECODING_LUT, buffer.readu8(input_buffer, read_offset)) + if bit32.bor(b1, b2, b3, b4) >= 64 then + error("Invalid base64 input", 2) + end + read_offset += 4 + -- u32 BE: [B1, B2, B3, 0] = b1<<26|b2<<20|b3<<14|b4<<8, trailing 0 will be overwritten next iteration + buffer.writeu32(output, write_offset, bit32.byteswap(b1 * 0x4000000 + b2 * 0x100000 + b3 * 0x4000 + b4 * 0x100)) + write_offset += 3 + end + + local u24be, nbits = 0, 0 + while read_offset < input_length do + local b = buffer.readu8(BASE64_DECODING_LUT, buffer.readu8(input_buffer, read_offset)) + read_offset += 1 + if b >= 64 then + error("Invalid base64 input", 2) + end + u24be = u24be * 0x40 + b + nbits += 6 + end + while nbits >= 8 do + buffer.writeu8(output, write_offset, bit32.rshift(u24be, nbits - 8)) + nbits -= 8 + write_offset += 1 + end + -- 2 or 4 leftover bits must be zero + if nbits == 6 or (nbits == 2 and bit32.btest(u24be, 0x03)) or (nbits == 4 and bit32.btest(u24be, 0x0F)) then + error("Invalid base64 input", 2) + end + return output +end + +return table.freeze { + encode = encode, + decode = decode, +} diff --git a/.lute/batteries/cli.luau b/.lute/batteries/cli.luau new file mode 100644 index 00000000..b06af7d3 --- /dev/null +++ b/.lute/batteries/cli.luau @@ -0,0 +1,233 @@ +local cli = {} +cli.__index = cli + +type ArgKind = "positional" | "flag" | "option" | "variadic" +type ArgOptions = { + help: string?, + aliases: { string }?, + default: string?, + required: boolean?, + hidden: boolean?, +} + +type ArgData = { + name: string, + kind: ArgKind, + options: ArgOptions, +} + +type ParseResult = { + values: { [string]: string? }, + flags: { [string]: boolean }, + variadics: { string }, + fwdArgs: { string }, +} + +type ParserData = { + arguments: { [number]: ArgData }, + positional: { [number]: ArgData }, + variadicArg: ArgData?, + parsed: ParseResult, +} + +type ParserInterface = typeof(cli) +export type Parser = setmetatable + +function cli.parser(): Parser + local self = { + arguments = {}, + positional = {}, + variadicArg = nil :: ArgData?, + parsed = { values = {}, flags = {}, variadics = {}, fwdArgs = {} }, + } + + return setmetatable(self, cli) +end + +function cli.add(self: Parser, name: string, kind: ArgKind, options: ArgOptions): () + local argument: ArgData = { + name = name, + kind = kind, + options = options or { aliases = {}, required = false }, + } + + table.insert(self.arguments, argument) + if kind == "positional" then + table.insert(self.positional, argument) + elseif kind == "variadic" then + self.variadicArg = argument + end +end + +function cli.parse(self: Parser, args: { string }): () + local i = 0 + local pos_index = 1 + + while i < #args do + i += 1 + + local arg = args[i] + + -- if the argument is exactly "--", we pass everything along + if arg == "--" then + table.move(args, i + 1, #args, #self.parsed.fwdArgs + 1, self.parsed.fwdArgs) + break + end + + -- if the argument starts with two dashes, we're parsing either a flag or an option + if string.sub(arg, 1, 2) == "--" then + local name = string.sub(arg, 3) + local found = false + + for _, argument in self.arguments do + local aliases = argument.options.aliases or {} + + if argument.name == name or table.find(aliases, name) then + found = true + + if argument.kind == "option" then + -- advance past the argument + i += 1 + + assert(i <= #args, "Missing value for argument: " .. argument.name) + self.parsed.values[argument.name] = args[i] + + break + end + + self.parsed.flags[argument.name] = true + break + end + end + + assert(found, "Unknown argument: " .. name) + continue + end + + -- if the argument starts with a single dash, we're parsing a flag + if string.sub(arg, 1, 1) == "-" then + local flags = string.sub(arg, 2) + + for j = 1, #flags do + local name = string.sub(flags, j, j) + local found = false + for _, argument in self.arguments do + local aliases = argument.options.aliases or {} + if argument.name == name or table.find(aliases, name) then + found = true + if argument.kind == "option" then + i += 1 + assert(i <= #args, "Missing value for argument: " .. argument.name) + self.parsed.values[argument.name] = args[i] + else + self.parsed.flags[argument.name] = true + end + break + end + end + + assert(found, "Unknown argument: " .. name) + end + + continue + end + + -- if we have positional arguments left, we can take this argument as one + if pos_index <= #self.positional then + self.parsed.values[self.positional[pos_index].name] = arg + pos_index += 1 + continue + end + + -- if we have a variadic argument, we can take this argument as part of it + if self.variadicArg then + table.insert(self.parsed.variadics, arg) + continue + end + + -- otherwise, the argument is forwarded on + table.insert(self.parsed.fwdArgs, arg) + end + + -- check that all required arguments are present, and set any default values as needed + for _, argument in self.arguments do + if argument.options.required then + if argument.kind == "variadic" then + assert(#self.parsed.variadics > 0, "Missing required variadic argument: " .. argument.name) + else + assert(self.parsed.values[argument.name], "Missing required argument: " .. argument.name) + end + end + + if self.parsed.values[argument.name] == nil and argument.options.default then + self.parsed.values[argument.name] = argument.options.default + end + end +end + +function cli.get(self: Parser, name: string): string? + return self.parsed.values[name] +end + +function cli.has(self: Parser, name: string): boolean + return self.parsed.flags[name] ~= nil +end + +function cli.variadics(self: Parser): { string } + return self.parsed.variadics +end + +function cli.forwarded(self: Parser): { string }? + return self.parsed.fwdArgs +end + +function cli.usage(self: Parser, name: string): string + local parts = { name } + + for _, arg in self.positional do + if not arg.options.hidden then + if arg.options.required then + table.insert(parts, `<{arg.name}>`) + else + table.insert(parts, `[{arg.name}]`) + end + end + end + + for _, arg in self.arguments do + if not arg.options.hidden and arg.kind ~= "positional" and arg.kind ~= "variadic" then + table.insert(parts, "[options]") + break + end + end + + if self.variadicArg and not self.variadicArg.options.hidden then + local v = self.variadicArg + if v.options.required then + table.insert(parts, `<{v.name}...>`) + else + table.insert(parts, `[{v.name}...]`) + end + end + + return table.concat(parts, " ") +end + +function cli.help(self: Parser, formatter: ((s: string) -> string)?): () + local fmt = formatter or function(s) + return s + end + + print(fmt "Usage:") + for _, argument in self.arguments do + if argument.options.hidden then + continue + end + + local aliasStr = table.concat(argument.options.aliases or {}, ", ") + local reqStr = if argument.options.required then "(required) " else "" + print(fmt(string.format(" --%s (-%s) - %s%s", argument.name, aliasStr, reqStr, argument.options.help or ""))) + end +end + +return table.freeze(cli) diff --git a/.lute/batteries/collections/deque.luau b/.lute/batteries/collections/deque.luau new file mode 100644 index 00000000..997b956a --- /dev/null +++ b/.lute/batteries/collections/deque.luau @@ -0,0 +1,67 @@ +type DequeData = { + _head: number, + _tail: number, + _values: { [number]: T }, +} + +local deque = {} + +export type Deque = setmetatable, typeof(deque)> + +deque.__index = deque +deque.__len = function(self: Deque) + return self._tail - self._head + 1 +end + +local dequeLib = {} + +function dequeLib.new(initValue: T?): Deque + local self = {} :: Deque + self._values = {} + self._head, self._tail = 0, if initValue then 0 else -1 + if initValue then + self._values[self._head] = initValue + end + + return setmetatable(self, deque) +end + +function deque.pushfront(self: Deque, value: T) + self._head -= 1 + self._values[self._head] = value +end + +function deque.pushback(self: Deque, value: T) + self._tail += 1 + self._values[self._tail] = value +end + +function deque.popfront(self: Deque): T + if self._tail < self._head then + error "Popping from empty deque" + end + local toReturn = self._values[self._head] + self._values[self._head] = nil + self._head += 1 + return toReturn +end + +function deque.popback(self: Deque): T + if self._tail < self._head then + error "Popping from empty deque" + end + local toReturn = self._values[self._tail] + self._values[self._tail] = nil + self._tail -= 1 + return toReturn +end + +function deque.peekfront(self: Deque) + return self._values[self._head] +end + +function deque.peekback(self: Deque) + return self._values[self._tail] +end + +return table.freeze(dequeLib) diff --git a/.lute/batteries/difftext/init.luau b/.lute/batteries/difftext/init.luau new file mode 100644 index 00000000..75bef212 --- /dev/null +++ b/.lute/batteries/difftext/init.luau @@ -0,0 +1,19 @@ +local myersdiff = require "@self/myersdiff" +local printdiff = require "@self/printdiff" +local types = require "@self/types" + +export type diff = types.diff +export type diffoptions = types.diffoptions + +local function diff(a: string, b: string, options: diffoptions): diff + if options and options.byChar then + return myersdiff.myersdiffbychar(a, b) + else + return myersdiff.myersdiffbyline(a, b) + end +end + +return { + diff = diff, + prettydiff = printdiff, +} diff --git a/.lute/batteries/difftext/myersdiff.luau b/.lute/batteries/difftext/myersdiff.luau new file mode 100644 index 00000000..48d0a946 --- /dev/null +++ b/.lute/batteries/difftext/myersdiff.luau @@ -0,0 +1,143 @@ +local deque = require "@batteries/collections/deque" +local tableext = require "@std/tableext" +local types = require "./types" + +type diffoperation = types.diffoperation +type diff = types.diff + +type EditGraphNode = { + x: number, + y: number, + prev: EditGraphNode?, +} + +local function editGraphNode(x: number, y: number, prev: EditGraphNode?): EditGraphNode + return { + x = x, + y = y, + prev = prev, + } +end + +-- true if a[x+1] == b[y+1]; indicates an EQUAL operation (no diff) is valid +local function hasDiagonalEdge(node: EditGraphNode, a: string | { string }, b: string | { string }): boolean + local x, y = node.x, node.y + if typeof(a) == "table" then + if typeof(b) == "table" then + return x < #a and y < #b and a[x + 1] == b[y + 1] + else + error "hasDiagonalEdge inputs should have the same type." + end + elseif typeof(b) == "table" then + error "hasDiagonalEdge inputs should have the same type." + end + + return x < #a and y < #b and a:sub(x + 1, x + 1) == b:sub(y + 1, y + 1) +end + +local function edgeTodiff(curNode: EditGraphNode, a: string | { string }, b: string | { string }): diffoperation? + -- maps stepping from curNode.prev -> curNode to a diff operation + -- (n-1, n) -> (n, n) == DELETION of a[n] + -- (n, n-1) -> (n, n) == ADDITION of b[n] + -- (n-1, n-1) -> (n, n) == EQUAL (a[n] == b[n]) + if not curNode.prev then + return nil + end + + local prev = curNode.prev + local xdiff = curNode.x - prev.x + local ydiff = curNode.y - prev.y + if xdiff == 1 and ydiff == 1 then + return { + key = "EQUAL", + text = if typeof(a) == "table" then a[curNode.x] else a:sub(curNode.x, curNode.x), + } + elseif xdiff == 1 then + return { + key = "DELETE", + text = if typeof(a) == "table" then a[curNode.x] else a:sub(curNode.x, curNode.x), + } + else + return { + key = "ADD", + text = if typeof(b) == "table" then b[curNode.y] else b:sub(curNode.y, curNode.y), + } + end +end + +local function myersdiff(a: string | { string }, b: string | { string }): diff + local start = editGraphNode(0, 0) + local editGraphDeque = deque.new(start) + + local diff = {} :: diff + local seen = {} :: { [string]: true } + seen["0,0"] = true + + while #editGraphDeque do + local curNode = editGraphDeque:popfront() + + -- we've reached bottom right vertex; indicates full edit from a -> b + if curNode.x == #a and curNode.y == #b then + -- reconstruct diff operations by tracing path from termination node to start + local edgeOp = edgeTodiff(curNode, a, b) + while edgeOp do + table.insert(diff, edgeOp) + curNode = curNode.prev + edgeOp = if curNode then edgeTodiff(curNode, a, b) else nil + end + break + end + + -- add neighbors (diag prioritzed, then deletion, then insertion) + if hasDiagonalEdge(curNode, a, b) then + -- algorithm optimizes for diagonal edges since they represent no diff. We want the shortest-edit-sequence (least # of diff operations) + -- so diagonal edges representing equality in a[n+1] & b[n+1] is always preferred + local edgePositionStr = `{curNode.x + 1},{curNode.y + 1}` + if not seen[edgePositionStr] then + seen[edgePositionStr] = true + editGraphDeque:pushfront(editGraphNode(curNode.x + 1, curNode.y + 1, curNode)) + end + continue + end + + if curNode.x < #a then + local edgePositionStr = `{curNode.x + 1},{curNode.y}` + if not seen[edgePositionStr] then + seen[edgePositionStr] = true + editGraphDeque:pushback(editGraphNode(curNode.x + 1, curNode.y, curNode)) + end + end + + if curNode.y < #b then + local edgePositionStr = `{curNode.x},{curNode.y + 1}` + if not seen[edgePositionStr] then + seen[edgePositionStr] = true + editGraphDeque:pushback(editGraphNode(curNode.x, curNode.y + 1, curNode)) + end + end + end + + tableext.reverse(diff, true) + return diff +end + +local function myersdiffbyline(a: string | { string }, b: string | { string }): diff + local src = a + local dest = b + if typeof(a) == "string" then + src = a:split "\n" + end + if typeof(b) == "string" then + dest = b:split "\n" + end + return myersdiff(src, dest) +end + +local function myersdiffbychar(a: string, b: string): diff + return myersdiff(a, b) +end + +return table.freeze { + myersdiffbyline = myersdiffbyline, + myersdiffbychar = myersdiffbychar, +} diff --git a/.lute/batteries/difftext/printdiff.luau b/.lute/batteries/difftext/printdiff.luau new file mode 100644 index 00000000..01889959 --- /dev/null +++ b/.lute/batteries/difftext/printdiff.luau @@ -0,0 +1,218 @@ +local myersdiff = require "./myersdiff" +local richterm = require "@batteries/richterm" +local myersdiffbychar = myersdiff.myersdiffbychar +local myersdiffbyline = myersdiff.myersdiffbyline +local types = require "./types" +local brightGreen = richterm.brightGreen +local brightRed = richterm.brightRed +local bgGreen = richterm.bgGreen +local bgRed = richterm.bgRed + +type diff = types.diff + +-- Collects consecutive DELETEs and/or ADDs starting at index i +-- Returns: deletes array, adds array, new index position +local function collectConsecutiveChanges(diff: diff, startIndex: number): ({ string }, { string }, number) + local i = startIndex + local deletes = {} + while i <= #diff and diff[i].key == "DELETE" do + table.insert(deletes, diff[i].text) + i += 1 + end + + local adds = {} + while i <= #diff and diff[i].key == "ADD" do + table.insert(adds, diff[i].text) + i += 1 + end + + return deletes, adds, i +end + +local function visualizeCharDiff(a: string, b: string): (string, string) + local charOps = myersdiffbychar(a, b) + -- diffs two strings by char and returns colored visual for src and destination text + local srcVisual = {} + local destVisual = {} + + for _, op in charOps do + if op.key == "EQUAL" then + table.insert(srcVisual, brightRed(op.text)) + table.insert(destVisual, brightGreen(op.text)) + elseif op.key == "DELETE" then + table.insert(srcVisual, bgRed(op.text)) + elseif op.key == "ADD" then + table.insert(destVisual, bgGreen(op.text)) + end + end + + return table.concat(srcVisual, ""), table.concat(destVisual, "") +end + +local function formatLineSideHeader( + operation: types.diffoperationkey, + maxNumWidth: number, + lineNumbers: { + oldLine: number?, + newLine: number?, + } +): string + -- side header structure: + -- if line numbers included: + -- ALWAYS has length maxNumWidth*2 + 4 + -- the padded structure is essentialy: + -- {operation} {oldLine# padded to len of maxNumWidth} {newLine# padded to len = maxNumWidth}| + + local oldStr = tostring(if lineNumbers then lineNumbers.oldLine else "") + local newStr = tostring(if lineNumbers then lineNumbers.newLine else "") + maxNumWidth = maxNumWidth or 1 + if operation == "EQUAL" then + return string.format(` %{maxNumWidth}s %{maxNumWidth}s| ` :: any, oldStr, newStr) + elseif operation == "ADD" then + return string.format(`+ %{maxNumWidth}s %{maxNumWidth}s| ` :: any, "", newStr) + elseif operation == "DELETE" then + return string.format(`- %{maxNumWidth}s %{maxNumWidth}s| ` :: any, oldStr, "") + end + + error(`formatLineSideHeader called with invalid diff operation key: {operation}`) +end + +local function printDiffByLineDetailed(a: string, b: string, includeLineNumbers: boolean?): string + local src, dest = a:split "\n", b:split "\n" + local maxNumLines = math.max(#src, #dest) + local maxLineNumberLen = math.floor(math.log10(maxNumLines)) + 1 + local diff = myersdiffbyline(src, dest) + + local i = 1 + local result: { string } = {} + local oldLine, newLine = 1, 1 + + -- Helper to format line numbers + local function lineNums(old: number?, new: number?) + return { oldLine = old, newLine = new } + end + + while i <= #diff do + local op = diff[i] + + if op.key == "DELETE" or op.key == "ADD" then + local deletes, adds + deletes, adds, i = collectConsecutiveChanges(diff, i) + local pair = #deletes == 1 and #adds == 1 + if pair then + local srcLine, destLine = visualizeCharDiff(deletes[1], adds[1]) + if includeLineNumbers then + table.insert( + result, + brightRed(formatLineSideHeader("DELETE", maxLineNumberLen, lineNums(oldLine, nil))) .. srcLine + ) + table.insert( + result, + brightGreen(formatLineSideHeader("ADD", maxLineNumberLen, lineNums(nil, newLine))) .. destLine + ) + oldLine, newLine = oldLine + 1, newLine + 1 + else + table.insert(result, brightRed "- " .. srcLine) + table.insert(result, brightGreen "+ " .. destLine) + end + else + for _, deleted in deletes do + if includeLineNumbers then + table.insert( + result, + brightRed( + formatLineSideHeader("DELETE", maxLineNumberLen, lineNums(oldLine, nil)) .. deleted + ) + ) + oldLine += 1 + else + table.insert(result, brightRed("- " .. deleted)) + end + end + for _, added in adds do + if includeLineNumbers then + table.insert( + result, + brightGreen(formatLineSideHeader("ADD", maxLineNumberLen, lineNums(nil, newLine)) .. added) + ) + newLine += 1 + else + table.insert(result, brightGreen("+ " .. added)) + end + end + end + else -- EQUAL + table.insert( + result, + if includeLineNumbers + then formatLineSideHeader("EQUAL", maxLineNumberLen, lineNums(oldLine, newLine)) .. op.text + else " " .. op.text + ) + oldLine, newLine = oldLine + 1, newLine + 1 + i += 1 + end + end + return table.concat(result, "\n") +end + +local function prettydiff( + a: string, + b: string, + options: { + detailed: boolean?, + includeLineNumbers: boolean?, + }? +): string + if options and options.detailed then + return printDiffByLineDetailed(a, b, options.includeLineNumbers) + end + + local result = {} :: { string } + local src, dest = a:split "\n", b:split "\n" + local diff = myersdiffbyline(src, dest) + if options and options.includeLineNumbers then + -- Helper to format line number tables so we don't get too verbose + local function lineNums(old: number?, new: number?) + return { oldLine = old, newLine = new } + end + + local maxNumLines = math.max(#src, #dest) + local maxLineNumberLen = math.floor(math.log10(maxNumLines)) + 1 + local oldLine, newLine = 1, 1 + + for _, op in diff do + if op.key == "ADD" then + table.insert( + result, + brightGreen(formatLineSideHeader(op.key, maxLineNumberLen, lineNums(nil, newLine)) .. op.text) + ) + newLine += 1 + elseif op.key == "DELETE" then + table.insert( + result, + brightRed(formatLineSideHeader(op.key, maxLineNumberLen, lineNums(oldLine, nil)) .. op.text) + ) + oldLine += 1 + else -- EQUAL + table.insert( + result, + formatLineSideHeader(op.key, maxLineNumberLen, lineNums(oldLine, newLine)) .. op.text + ) + oldLine, newLine = oldLine + 1, newLine + 1 + end + end + else + for _, op in diff do + if op.key == "ADD" then + table.insert(result, brightGreen("+ " .. op.text)) + elseif op.key == "DELETE" then + table.insert(result, brightRed("- " .. op.text)) + else -- EQUAL + table.insert(result, " " .. op.text) + end + end + end + return table.concat(result, "\n") +end + +return prettydiff diff --git a/.lute/batteries/difftext/types.luau b/.lute/batteries/difftext/types.luau new file mode 100644 index 00000000..19784a44 --- /dev/null +++ b/.lute/batteries/difftext/types.luau @@ -0,0 +1,14 @@ +export type diffoperationkey = "EQUAL" | "ADD" | "DELETE" + +export type diffoperation = { + key: diffoperationkey, + text: string, +} + +export type diff = { diffoperation } + +export type diffoptions = { + byChar: boolean?, +}? + +return table.freeze {} diff --git a/.lute/batteries/glob.luau b/.lute/batteries/glob.luau new file mode 100644 index 00000000..de005e6e --- /dev/null +++ b/.lute/batteries/glob.luau @@ -0,0 +1,221 @@ +--[[ + Glob pattern matching and filesystem discovery. + + `glob.match(pattern, input)` tests whether a path matches a glob pattern. + `glob.discover(pattern)` walks the filesystem returning all matching `Path`s. + + The implementation follows the Rust glob crate. The rules are: + + - `?` matches any single character (not `/`) + - `*` matches any (possibly empty) sequence of characters (not `/`) + - `**` matches the current directory and arbitrary subdirectories; it must + form an entire path component on its own (e.g. `a/**/b` is valid, but + `a**b` is not) + - `[...]` matches any character inside the brackets; ranges like `[a-z]` + are supported, ordered by Unicode code point + - `[!...]` matches any character NOT inside the brackets + - Metacharacters can be matched literally by wrapping them in brackets, + e.g. `[?]` matches a literal `?`, `[*]` matches a literal `*` +]] +local fs = require "@std/fs" +local path = require "@std/path" + +local function matchesSegment(pattern: string, name: string, patternStart: number?, nameStart: number?): boolean + local patternIndex = patternStart or 1 + local nameIndex = nameStart or 1 + while patternIndex <= #pattern do + local patternChar = string.sub(pattern, patternIndex, patternIndex) + if patternChar == "*" then + patternIndex += 1 + for candidateIndex = nameIndex, #name + 1 do + if matchesSegment(pattern, name, patternIndex, candidateIndex) then + return true + end + end + return false + elseif patternChar == "?" then + if nameIndex > #name then + return false + end + patternIndex += 1 + nameIndex += 1 + elseif patternChar == "[" then + if nameIndex > #name then + return false + end + local nameChar = string.sub(name, nameIndex, nameIndex) + patternIndex += 1 + local negate = string.sub(pattern, patternIndex, patternIndex) == "!" + if negate then + patternIndex += 1 + end + local found = false + while patternIndex <= #pattern and string.sub(pattern, patternIndex, patternIndex) ~= "]" do + local rangeLow = string.sub(pattern, patternIndex, patternIndex) + patternIndex += 1 + if + string.sub(pattern, patternIndex, patternIndex) == "-" + and patternIndex + 1 <= #pattern + and string.sub(pattern, patternIndex + 1, patternIndex + 1) ~= "]" + then + patternIndex += 1 + local rangeHigh = string.sub(pattern, patternIndex, patternIndex) + patternIndex += 1 + if nameChar >= rangeLow and nameChar <= rangeHigh then + found = true + end + else + if nameChar == rangeLow then + found = true + end + end + end + patternIndex += 1 + if negate then + found = not found + end + if not found then + return false + end + nameIndex += 1 + else + if nameIndex > #name or string.sub(name, nameIndex, nameIndex) ~= patternChar then + return false + end + patternIndex += 1 + nameIndex += 1 + end + end + return nameIndex > #name +end + +type MatchResult = "match" | "no_match" | "partial" + +-- Matches input path segments against pattern segments, returning: +-- "match" — full match (all pattern and input segments consumed) +-- "partial" — input consumed but pattern segments remain (worth descending) +-- "no_match" — input diverges from pattern (prune) +local function matchStep( + patternSegments: { string }, + inputSegments: { string }, + patternIndex: number, + inputIndex: number +): MatchResult + while patternIndex <= #patternSegments do + local segment = patternSegments[patternIndex] + if segment == "**" then + local best: MatchResult = "no_match" + for candidateIndex = inputIndex, #inputSegments + 1 do + local result = matchStep(patternSegments, inputSegments, patternIndex + 1, candidateIndex) + if result == "match" then + return "match" + elseif result == "partial" then + best = "partial" + end + end + return best + else + if inputIndex > #inputSegments then + return "partial" + end + if not matchesSegment(segment, inputSegments[inputIndex]) then + return "no_match" + end + patternIndex += 1 + inputIndex += 1 + end + end + if inputIndex > #inputSegments then + return "match" + end + return "no_match" +end + +local function walk(directory: path.Pathlike, segments: { string }, segmentIndex: number, results: { path.Path }) + if segmentIndex > #segments then + return + end + local success, entries = pcall(fs.listDirectory, directory) + if not success then + return + end + local segment = segments[segmentIndex] + local isLast = segmentIndex == #segments + if segment == "**" then + if not isLast then + walk(directory, segments, segmentIndex + 1, results) + end + for _, entry in entries do + local entryPath = path.join(directory, entry.name) + if isLast then + table.insert(results, entryPath) + end + if entry.type == "dir" then + walk(entryPath, segments, segmentIndex, results) + end + end + else + for _, entry in entries do + if matchesSegment(segment, entry.name) then + local entryPath = path.join(directory, entry.name) + if isLast then + table.insert(results, entryPath) + elseif entry.type == "dir" then + walk(entryPath, segments, segmentIndex + 1, results) + end + end + end + end +end + +local glob = {} + +-- Returns true if the given path matches the glob pattern, without touching the filesystem. +function glob.match(pattern: path.Pathlike, input: path.Pathlike): boolean + local patternParts = path.parse(pattern).parts + local inputParts = path.parse(input).parts + return matchStep(patternParts, inputParts, 1, 1) == "match" +end + +-- Walks the filesystem and returns all paths matching the glob pattern. +function glob.discover(input: path.Pathlike): { path.Path } + local parsed = path.parse(input) + local parts: { string } = parsed.parts + + local firstGlobIndex = #parts + 1 + for index, part in parts do + if string.find(part, "[%*%?%[]") then + firstGlobIndex = index + break + end + end + + if firstGlobIndex > #parts then + if fs.exists(parsed) then + return { parsed } + end + return {} + end + + local prefixPath = table.clone(parsed) + prefixPath.parts = { table.unpack(parts, 1, firstGlobIndex - 1) } + local segments = { table.unpack(parts, firstGlobIndex) } + + local results: { path.Path } = {} + walk(prefixPath, segments, 1, results) + -- To ensure a consistent sort order across POSIX and Windows, we sort by + -- parts rather than sorting based on string representation, which ensures + -- that code implicitly dependent on the ordering (e.g. snapshot tests) do + -- not break when running on different platforms. + table.sort(results, function(a: path.Path, b: path.Path) + for i = 1, math.min(#a.parts, #b.parts) do + if a.parts[i] ~= b.parts[i] then + return a.parts[i] < b.parts[i] + end + end + return #a.parts < #b.parts + end) + return results +end + +return glob diff --git a/.lute/batteries/pp.luau b/.lute/batteries/pp.luau new file mode 100644 index 00000000..e002e198 --- /dev/null +++ b/.lute/batteries/pp.luau @@ -0,0 +1,187 @@ +type ExistingOptions = { + rawStrings: boolean?, +} + +local isPrimitiveType = { string = true, number = true, boolean = true } + +local typeSortOrder: { [string]: number } = { + ["boolean"] = 1, + ["number"] = 2, + ["string"] = 3, + ["function"] = 4, + ["vector"] = 5, + ["buffer"] = 6, + ["thread"] = 7, + ["table"] = 8, + ["userdata"] = 9, + ["nil"] = 10, +} + +local function isPrimitiveArray(array: { [unknown]: unknown }): boolean + local max, len = 0, #array + + for key, value in array do + if type(key) ~= "number" then + return false + elseif key <= 0 then + return false + -- userdatas arent primitives + elseif not isPrimitiveType[type(value)] then + return false + end + + max = math.max(key, max) + end + + return len == max +end + +local function getFormattedAdress(t: {}): string + return `table<({t})>` +end + +local function formatValue(value: unknown, options: ExistingOptions?): string + if type(value) == "table" then + return getFormattedAdress(value) -- simple representation for table values + elseif type(value) ~= "string" then + return tostring(value) + end + + if options and options.rawStrings then + return `"{value}"` + end + return string.format("%q", value) +end + +local function formatKey(key: unknown, seq: boolean): string + if seq then + return "" + end + + if type(key) == "table" then + return `[{getFormattedAdress(key)}] = ` -- TODO: handling for table keys + end + if type(key) ~= "string" then + return `[{tostring(key)}] =` + end + + -- key is a simple identifier + if string.match(key, "^[%a_][%w_]-$") == key then + return `{key} = ` + end + + return `[{string.format("%q", key)}] = ` +end + +local function isEmpty(t: { [unknown]: unknown }): boolean + for _ in t do + return false + end + return true +end + +-- FIXME(luau): mark `dataTable` indexer as read-only +local function traverseTable( + dataTable: { [unknown]: unknown }, + seen: { [unknown]: boolean }, + indent: number, + options: ExistingOptions? +): string + local output = "" + local indentStr = string.rep(" ", indent) + + -- FIXME(Luau): We shouldn't need this annotation. + local keys: { unknown } = {} + + -- Collect all keys, not just primitives + for key in dataTable do + table.insert(keys, key) + end + + table.sort(keys, function(a, b): boolean + local typeofTableA, typeofTableB = typeof(dataTable[a]), typeof(dataTable[b]) + + if typeofTableA ~= typeofTableB then + return typeSortOrder[typeofTableA] < typeSortOrder[typeofTableB] + end + + if type(a) == "number" and type(b) == "number" then + return a < b + end + + return tostring(a) < tostring(b) + end) + + local inSequence = false + local previousKey = 0 + + for _, key in keys do + if type(key) == "number" and key > 0 and key - 1 == previousKey then + previousKey = key + inSequence = true + else + inSequence = false + end + + local value = dataTable[key] + + if type(value) ~= "table" then + output = `{output}{indentStr}{formatKey(key, inSequence)}{formatValue(value, options)},\n` + continue + end + + -- prevents self-referential tables from looping infinitely + if seen[value] then + output = `{output}{indentStr}{formatKey(key, inSequence)}[Circular Reference <({value})>],\n` + continue + else + seen[value] = true + end + + if isEmpty(value :: { [unknown]: unknown }) then + output = string.format("%s%s%s{},\n", output, indentStr, formatKey(key, inSequence)) + continue + end + + if isPrimitiveArray(value :: { [unknown]: unknown }) then -- collapse primitive arrays + local outputConcatTbl = table.create(#value) :: { string } + + for valueIndex, valueInArray in value :: { unknown } do + outputConcatTbl[valueIndex] = formatValue(valueInArray) + end + + output = string.format( + "%s%s%s{%*},\n", + output, + indentStr, + formatKey(key, inSequence), + table.concat(outputConcatTbl, ", ") + ) + continue + end + + output = string.format( + "%s%s%s{\n%s%s},\n", + output, + indentStr, + formatKey(key, inSequence), + traverseTable(value :: any, seen, indent + 1, options), + indentStr + ) + + seen[value] = nil + end + + return output +end + +return function(data: unknown, options: ExistingOptions?): string + options = options or {} :: ExistingOptions + + -- if it's not a primitive, we'll pretty print it as a value + if type(data) ~= "table" then + return formatValue(data, options) + end + + return `\{\n{traverseTable(data :: { [unknown]: unknown }, { [data] = true }, 1, options)}\}` +end diff --git a/.lute/batteries/result.luau b/.lute/batteries/result.luau new file mode 100644 index 00000000..9b4a1382 --- /dev/null +++ b/.lute/batteries/result.luau @@ -0,0 +1,36 @@ +type T = | { success: true, value: Value } | { success: false, traceback: string, err: string } + +local result = {} + +function result.ok(value: Value): T + return { + success = true, + value = value, + } +end + +function result.fail(err: string): T + -- Ignore the current call to debug.traceback, and the call to fail. + local traceback = debug.traceback(nil, 2) + + return { + success = false, + + traceback = traceback, + err = err, + } +end + +function result.pcall(f: (T...) -> R, ...: T...): T + local success, value = pcall(f, ...) + + if success then + return result.ok(value) + else + local err = value :: any + + return result.fail(err) + end +end + +return result diff --git a/.lute/batteries/richterm.luau b/.lute/batteries/richterm.luau new file mode 100644 index 00000000..ae066768 --- /dev/null +++ b/.lute/batteries/richterm.luau @@ -0,0 +1,100 @@ +--[[ + richterm + terminal ansi formatter +]] + +export type Formatter = (s: string, nocolor: boolean?) -> string + +-- @noinline (if it ever exists) +local function format(s: string, open: string, close: string, replace: string): string + local index = string.find(s, close, #open + 1, true) + local middle = s + + if index then + local closeLen = #close + local middleTbl = {} + local cursor = 1 + + while index do + table.insert(middleTbl, string.sub(s, cursor, index - 1)) + cursor = index + closeLen + index = string.find(s, close, cursor, true) + end + + middle = table.concat(middleTbl, replace) + end + + return open .. middle .. close +end + +local function formatter(open: string, close: string, replace: string?): Formatter + replace = replace or open + + return function(s, nocolor) + return if nocolor then s else format(s, open, close, replace :: string) + end +end + +local richterm = { + reset = formatter("\x1b[0m", "\x1b[0m"), + bold = formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"), + dim = formatter("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"), + italic = formatter("\x1b[3m", "\x1b[23m"), + underline = formatter("\x1b[4m", "\x1b[24m"), + inverse = formatter("\x1b[7m", "\x1b[27m"), + hidden = formatter("\x1b[8m", "\x1b[28m"), + strikethrough = formatter("\x1b[9m", "\x1b[29m"), + + black = formatter("\x1b[30m", "\x1b[39m"), + red = formatter("\x1b[31m", "\x1b[39m"), + green = formatter("\x1b[32m", "\x1b[39m"), + yellow = formatter("\x1b[33m", "\x1b[39m"), + blue = formatter("\x1b[34m", "\x1b[39m"), + magenta = formatter("\x1b[35m", "\x1b[39m"), + cyan = formatter("\x1b[36m", "\x1b[39m"), + white = formatter("\x1b[37m", "\x1b[39m"), + gray = formatter("\x1b[90m", "\x1b[39m"), + + bgBlack = formatter("\x1b[40m", "\x1b[49m"), + bgRed = formatter("\x1b[41m", "\x1b[49m"), + bgGreen = formatter("\x1b[42m", "\x1b[49m"), + bgYellow = formatter("\x1b[43m", "\x1b[49m"), + bgBlue = formatter("\x1b[44m", "\x1b[49m"), + bgMagenta = formatter("\x1b[45m", "\x1b[49m"), + bgCyan = formatter("\x1b[46m", "\x1b[49m"), + bgWhite = formatter("\x1b[47m", "\x1b[49m"), + + brightBlack = formatter("\x1b[90m", "\x1b[39m"), + brightRed = formatter("\x1b[91m", "\x1b[39m"), + brightGreen = formatter("\x1b[92m", "\x1b[39m"), + brightYellow = formatter("\x1b[93m", "\x1b[39m"), + brightBlue = formatter("\x1b[94m", "\x1b[39m"), + brightMagenta = formatter("\x1b[95m", "\x1b[39m"), + brightCyan = formatter("\x1b[96m", "\x1b[39m"), + brightWhite = formatter("\x1b[97m", "\x1b[39m"), + + bgBrightBlack = formatter("\x1b[100m", "\x1b[49m"), + bgBrightRed = formatter("\x1b[101m", "\x1b[49m"), + bgBrightGreen = formatter("\x1b[102m", "\x1b[49m"), + bgBrightYellow = formatter("\x1b[103m", "\x1b[49m"), + bgBrightBlue = formatter("\x1b[104m", "\x1b[49m"), + bgBrightMagenta = formatter("\x1b[105m", "\x1b[49m"), + bgBrightCyan = formatter("\x1b[106m", "\x1b[49m"), + bgBrightWhite = formatter("\x1b[107m", "\x1b[49m"), +} + +function richterm.combine(...: Formatter): Formatter + local formatters = { ... } + + return function(s, nocolor) + if not nocolor then + for _, formatter in formatters do + s = formatter(s) + end + end + + return s + end +end + +return table.freeze(richterm) diff --git a/.lute/batteries/toml.luau b/.lute/batteries/toml.luau new file mode 100644 index 00000000..0df5be0d --- /dev/null +++ b/.lute/batteries/toml.luau @@ -0,0 +1,1511 @@ +local toml = {} + +-- serialization + +local function serializeValue(value: string | number): string + if typeof(value) == "string" then + value = string.gsub(value, "\\", "\\\\") + value = string.gsub(value, "\n", "\\n") + value = string.gsub(value, "\t", "\\t") + return '"' .. value .. '"' + end + + if value == math.huge then + return "inf" + end + + if value == -math.huge then + return "-inf" + end + + if value ~= value then + return "nan" + end + + return tostring(value) +end + +local function quoteKey(key: string): string + if not string.match(key, "^[%w_-]+$") then + return `"{key}"` + end + + return key +end + +local function hasNestedTables(tbl: { [unknown]: unknown }): boolean + for _, v in tbl do + if typeof(v) == "table" and next(v) ~= nil then + return true + end + end + + return false +end + +local function tableToToml(tbl: { [any]: any }, parent: string?): string + local result = "" + local subTables = {} + local hasDirectValues = false + + for k, v in tbl do + if typeof(v) == "table" and next(v) ~= nil then + if #v > 0 then + for _, entry in v do + result ..= "\n[[" .. (parent and parent .. "." or "") .. quoteKey(k) .. "]]\n" + result ..= tableToToml(entry, nil) + end + else + subTables[k] = v + end + else + hasDirectValues = true + result ..= quoteKey(k) .. " = " .. serializeValue(v) .. "\n" + end + end + + for k, v in subTables do + local key = parent and (parent .. "." .. quoteKey(k)) or quoteKey(k) + + if hasNestedTables(v) == true then + result ..= tableToToml(v, key) + continue + end + + if hasDirectValues or parent then + result ..= "\n[" .. key .. "]\n" + end + + result ..= tableToToml(v, key) + end + + return result +end + +local function serialize(tbl: { [any]: any }): string + return tableToToml(tbl, nil) +end + +-- deserialization + +export type TomlValue = string | number | boolean | { TomlValue } | { [string]: TomlValue } + +local function deserialize(input: string): { [string]: TomlValue } + -- convert CRLF to LF + if input:find("\r\n", 1, true) then + input = input:gsub("\r\n", "\n") + end + + -- Reject bare CR (only CRLF → LF is allowed) + if input:find("\r", 1, true) then + error "TOML parse error: bare carriage return (\\r) not allowed" + end + + -- Validate UTF-8 encoding + do + local i = 1 + local n = #input + while i <= n do + local b = string.byte(input, i) + local seqLen: number + + if b < 0x80 then + seqLen = 1 + elseif b < 0xC2 then + error("TOML parse error: invalid UTF-8 byte at position " .. i) + elseif b < 0xE0 then + seqLen = 2 + elseif b < 0xF0 then + seqLen = 3 + elseif b <= 0xF4 then + seqLen = 4 + else + error("TOML parse error: invalid UTF-8 byte at position " .. i) + end + + if i + seqLen - 1 > n then + error("TOML parse error: truncated UTF-8 sequence at position " .. i) + end + + -- Validate continuation bytes and overlong/surrogate checks + if seqLen == 2 then + local b2 = string.byte(input, i + 1) + if b2 < 0x80 or b2 > 0xBF then + error("TOML parse error: invalid UTF-8 continuation at position " .. (i + 1)) + end + elseif seqLen == 3 then + local b2 = string.byte(input, i + 1) + local b3 = string.byte(input, i + 2) + if b == 0xE0 then + if b2 < 0xA0 or b2 > 0xBF then + error("TOML parse error: overlong UTF-8 sequence at position " .. i) + end + elseif b == 0xED then + if b2 < 0x80 or b2 > 0x9F then + error("TOML parse error: UTF-8 surrogate codepoint at position " .. i) + end + else + if b2 < 0x80 or b2 > 0xBF then + error("TOML parse error: invalid UTF-8 continuation at position " .. (i + 1)) + end + end + if b3 < 0x80 or b3 > 0xBF then + error("TOML parse error: invalid UTF-8 continuation at position " .. (i + 2)) + end + elseif seqLen == 4 then + local b2 = string.byte(input, i + 1) + local b3 = string.byte(input, i + 2) + local b4 = string.byte(input, i + 3) + + if b == 0xF0 then + if b2 < 0x90 or b2 > 0xBF then + error("TOML parse error: overlong UTF-8 sequence at position " .. i) + end + elseif b == 0xF4 then + if b2 < 0x80 or b2 > 0x8F then + error("TOML parse error: UTF-8 codepoint > U+10FFFF at position " .. i) + end + else + if b2 < 0x80 or b2 > 0xBF then + error("TOML parse error: invalid UTF-8 continuation at position " .. (i + 1)) + end + end + + if b3 < 0x80 or b3 > 0xBF then + error("TOML parse error: invalid UTF-8 continuation at position " .. (i + 2)) + end + + if b4 < 0x80 or b4 > 0xBF then + error("TOML parse error: invalid UTF-8 continuation at position " .. (i + 3)) + end + end + i += seqLen + end + end + + local src = input + local pos = 1 + local len = #src + local srcBuf = buffer.fromstring(src) + + -- Table metadata: maps table reference -> { kind, keys } + type TableKind = + | "root" -- the document root + | "defined" -- created by an explicit [header] + | "implicit-header" -- implicitly created while navigating a [a.b.c] path + | "implicit-dotted" -- implicitly created by a dotted key assignment (a.b = v) + | "inline" -- an inline table; immutable after creation + | "array-element" -- an element of an [[array-of-tables]] + | "array-value" -- a static array literal (cannot be navigated into) + type TableMeta = { kind: TableKind, keys: { [string]: boolean } } + local tableMeta: { [any]: TableMeta } = {} + + -- tracks which Luau arrays are array-of-tables (vs regular array values) + local arrayTableSets: { [any]: boolean } = {} + + local function getMeta(tbl: any): TableMeta + if not tableMeta[tbl] then + tableMeta[tbl] = { kind = "implicit-header", keys = {} } + end + + return tableMeta[tbl] + end + + local function tomlParseError(msg: string): never + error(`TOML parse error at position {pos}: {msg}`) + end + + -- character helpers (all operate on the shared pos/src/len upvalues) + + local function byteAt(offset: number?): number? -- byte at pos+offset + local p = pos + (offset or 0) + return if p <= len then buffer.readu8(srcBuf, p - 1) else nil + end + + local function isDigit(c: number?): boolean + return c ~= nil and c >= 48 and c <= 57 + end + + local function isHexDigit(c: number?): boolean + return c ~= nil and ((c >= 48 and c <= 57) or (c >= 65 and c <= 70) or (c >= 97 and c <= 102)) + end + + local function isOctDigit(c: number?): boolean + return c ~= nil and c >= 48 and c <= 55 + end + + local function isBinDigit(c: number?): boolean + return c ~= nil and (c == 48 or c == 49) + end + + -- bare key chars: A-Z a-z 0-9 _ - + local function isBareKey(c: number?): boolean + if c == nil then + return false + end + + return (c >= 97 and c <= 122) or (c >= 65 and c <= 90) or (c >= 48 and c <= 57) or c == 95 or c == 45 + end + + -- control characters that are forbidden unescaped (everything < 0x20 except tab, + -- plus DEL 0x7F; LF 0x0A is handled separately per context) + local function isControlCharacter(c: number?): boolean + if c == nil then + return false + end + + return c <= 8 or c == 11 or c == 12 or (c >= 14 and c <= 31) or c == 127 + end + + -- whitespace skipping + + local function skipWhitespace() + while pos <= len do + local c = buffer.readu8(srcBuf, pos - 1) + + if c ~= 32 and c ~= 9 then + break + end + + pos += 1 + end + end + + -- skip a # comment up to (but not including) the newline + local function skipComment() + if byteAt() ~= 35 then + return + end -- '#' + + pos += 1 + + while pos <= len do + local c = buffer.readu8(srcBuf, pos - 1) + + if c == 10 then + break + end + + if isControlCharacter(c) then + tomlParseError "control character in comment" + end + + pos += 1 + end + end + + -- skip horizontal whitespace, newlines, and comments + local function skipWhitespaceNewlinesAndComments() + while pos <= len do + local c = buffer.readu8(srcBuf, pos - 1) + + if c == 32 or c == 9 or c == 10 then + pos += 1 + elseif c == 35 then + skipComment() + else + break + end + end + end + + -- after a value: consume trailing whitespace + optional comment, then require newline or EOF + local function expectLineEnd() + skipWhitespace() + skipComment() + + if pos > len then + return + end + + local c = byteAt() + if c == 10 then + pos += 1 + else + tomlParseError(`expected newline or EOF, got '${string.char(c :: number)}'`) + end + end + + -- string escape helpers + + local function parseUnicodeEscape(long: boolean): string + local n = if long then 8 else 4 + local hexStr = string.sub(src, pos, pos + n - 1) + + if #hexStr < n then + tomlParseError "incomplete unicode escape" + end + + for i = 1, n do + if not isHexDigit(string.byte(hexStr, i)) then + tomlParseError "invalid hex digit in unicode escape" + end + end + + pos += n + + local cp = tonumber(hexStr, 16) :: number + + if cp >= 0xD800 and cp <= 0xDFFF then + tomlParseError "surrogate codepoint in unicode escape" + end + + if cp > 0x10FFFF then + tomlParseError "unicode codepoint out of range" + end + + return utf8.char(cp) + end + + -- \xXX escape (TOML 1.1): unicode codepoint U+0000..U+00FF + local function parseHexEscape(): string + local hexStr = string.sub(src, pos, pos + 1) + + if #hexStr < 2 or not isHexDigit(string.byte(hexStr, 1)) or not isHexDigit(string.byte(hexStr, 2)) then + tomlParseError "invalid \\x escape" + end + + pos += 2 + + return utf8.char(tonumber(hexStr, 16) :: number) + end + + local function parseEscape(): string + if pos > len then + tomlParseError "incomplete escape sequence" + end + + local c = byteAt() :: number + pos += 1 + + if c == 98 then + return "\b" + end + + if c == 116 then + return "\t" + end + + if c == 110 then + return "\n" + end + + if c == 102 then + return "\f" + end + + if c == 114 then + return "\r" + end + + if c == 34 then + return '"' + end + + if c == 92 then + return "\\" + end + + if c == 101 then + return "\x1B" + end -- \e (TOML 1.1) + + if c == 117 then + return parseUnicodeEscape(false) + end -- \uXXXX + + if c == 85 then + return parseUnicodeEscape(true) + end -- \UXXXXXXXX + + if c == 120 then + return parseHexEscape() + end -- \xXX (TOML 1.1) + + tomlParseError(`invalid escape sequence \\${string.char(c)}`) + -- FIXME(Luau): `tomlParseError` paths are not currently treated as not returning + error "unreachable" + end + + -- string parsers (pos is always past the opening delimiter on entry) + + local function parseBasicString(): string + local parts = {} + + while pos <= len do + -- Fast path: scan forward over plain characters in one go + local runStart = pos + + while pos <= len do + local c2 = buffer.readu8(srcBuf, pos - 1) + + -- break on: " (34), \ (92), DEL (127), ctrl chars except tab (9) + if c2 == 34 or c2 == 92 or c2 == 127 or (c2 < 32 and c2 ~= 9) then + break + end + + pos += 1 + end + + if pos > runStart then + table.insert(parts, string.sub(src, runStart, pos - 1)) + end + + if pos > len then + break + end + + local c = buffer.readu8(srcBuf, pos - 1) + + if c == 34 then -- closing " + pos += 1 + return table.concat(parts) + end + + if c == 92 then -- backslash + pos += 1 + table.insert(parts, parseEscape()) + continue + end + + if c == 10 then + tomlParseError "unescaped newline in basic string" + end + + tomlParseError "unescaped control character in basic string" + end + + tomlParseError "unterminated basic string" + + -- FIXME(Luau): `tomlParseError` paths are not currently treated as not returning + error "unreachable" + end + + local function parseMultilineBasicString(): string + -- trim a single leading newline + if byteAt() == 10 then + pos += 1 + end + + local parts = {} + + while pos <= len do + -- Fast path: scan over plain chars (LF and tab are literal content too) + local runStart = pos + + while pos <= len do + local c2 = buffer.readu8(srcBuf, pos - 1) + + -- break on: " (34), \ (92), DEL (127), ctrl except tab (9) and LF (10) + if c2 == 34 or c2 == 92 or c2 == 127 or (c2 < 32 and c2 ~= 9 and c2 ~= 10) then + break + end + + pos += 1 + end + + if pos > runStart then + table.insert(parts, string.sub(src, runStart, pos - 1)) + end + + if pos > len then + break + end + + local c = buffer.readu8(srcBuf, pos - 1) + + if c == 34 then + if string.sub(src, pos, pos + 2) == '"""' then + pos += 3 + local extra = 0 + + while pos <= len and buffer.readu8(srcBuf, pos - 1) == 34 and extra < 2 do + table.insert(parts, '"') + pos += 1 + extra += 1 + end + + return table.concat(parts) + end + + -- lone " is valid content in a multiline basic string + table.insert(parts, '"') + pos += 1 + + continue + end + + if c == 92 then -- backslash + pos += 1 + + -- peek past trailing horizontal whitespace to detect line-ending backslash + local peek = pos + + while peek <= len do + local pc = buffer.readu8(srcBuf, peek - 1) + + if pc ~= 32 and pc ~= 9 then + break + end + + peek += 1 + end + + if peek <= len and buffer.readu8(srcBuf, peek - 1) == 10 then + -- line-ending backslash: skip newline and all following whitespace and newlines + pos = peek + 1 + while pos <= len do + local c3 = buffer.readu8(srcBuf, pos - 1) + if c3 ~= 32 and c3 ~= 9 and c3 ~= 10 then + break + end + pos += 1 + end + elseif peek > len then + tomlParseError "incomplete escape at end of file" + else + table.insert(parts, parseEscape()) + end + + continue + end + + -- ctrl char or DEL + tomlParseError "unescaped control character in multiline basic string" + end + + tomlParseError "unterminated multiline basic string" + + -- FIXME(Luau): `tomlParseError` paths are not currently treated as not returning + error "unreachable" + end + + local function parseLiteralString(): string + local start = pos + + while pos <= len do + local c = buffer.readu8(srcBuf, pos - 1) + if c == 39 then -- closing ' + local result = string.sub(src, start, pos - 1) + pos += 1 + return result + end + + if c == 9 or (c >= 32 and c ~= 127) or c >= 128 then + pos += 1 -- plain char (tab, printable ASCII, or multibyte UTF-8) + continue + end + + if c == 10 then + tomlParseError "unescaped newline in literal string" + end + + tomlParseError "unescaped control character in literal string" + end + + tomlParseError "unterminated literal string" + + -- FIXME(Luau): `tomlParseError` paths are not currently treated as not returning + error "unreachable" + end + + local function parseMultilineLiteralString(): string + if byteAt() == 10 then + pos += 1 + end -- trim leading newline + + local parts = {} + + while pos <= len do + -- Fast path: scan over plain chars (LF and tab are literal content) + local runStart = pos + while pos <= len do + local c2 = buffer.readu8(srcBuf, pos - 1) + -- break on: ' (39), DEL (127), ctrl except tab (9) and LF (10) + if c2 == 39 or c2 == 127 or (c2 < 32 and c2 ~= 9 and c2 ~= 10) then + break + end + pos += 1 + end + + if pos > runStart then + table.insert(parts, string.sub(src, runStart, pos - 1)) + end + + if pos > len then + break + end + + local c = buffer.readu8(srcBuf, pos - 1) + if c == 39 then + if string.sub(src, pos, pos + 2) == "'''" then + pos += 3 + local extra = 0 + while pos <= len and buffer.readu8(srcBuf, pos - 1) == 39 and extra < 2 do + table.insert(parts, "'") + pos += 1 + extra += 1 + end + return table.concat(parts) + end + -- lone ' is valid content in a multiline literal string + table.insert(parts, "'") + pos += 1 + continue + end + + -- ctrl char or DEL + tomlParseError "unescaped control character in multiline literal string" + end + + tomlParseError "unterminated multiline literal string" + + -- FIXME(Luau): `tomlParseError` paths are not currently treated as not returning + error "unreachable" + end + + -- number / datetime helpers + + -- parse a run of digits (with internal underscores allowed), return digits-only string + local function parseDigits(digitCheck: (number?) -> boolean): string + if not digitCheck(byteAt()) then + tomlParseError "expected digit" + end + + local result = "" + local runStart = pos + + while pos <= len do + local c = buffer.readu8(srcBuf, pos - 1) + + if digitCheck(c) then + pos += 1 + elseif c == 95 then -- underscore + result ..= string.sub(src, runStart, pos - 1) + pos += 1 + + if pos > len then + tomlParseError "trailing underscore in number" + end + + local nc = buffer.readu8(srcBuf, pos - 1) + if nc == 95 then + tomlParseError "consecutive underscores in number" + end + + if not digitCheck(nc) then + tomlParseError "trailing underscore in number" + end + + runStart = pos + else + break + end + end + + result ..= string.sub(src, runStart, pos - 1) + return result + end + + local function looksLikeDate(): boolean + -- YYYY- : 4 decimal digits followed by '-' + if pos + 4 > len then + return false + end + + for i = 0, 3 do + if not isDigit(buffer.readu8(srcBuf, pos + i - 1)) then + return false + end + end + + return buffer.readu8(srcBuf, pos + 3) == 45 + end + + local function looksLikeTime(): boolean + -- HH: : exactly 2 decimal digits followed by ':' + return isDigit(byteAt(0)) and isDigit(byteAt(1)) and byteAt(2) == 58 + end + + -- Returns days in month for given year and month (1-12) + local function daysInMonth(year: number, month: number): number + if month == 2 then + local isLeap = (year % 4 == 0 and year % 100 ~= 0) or (year % 400 == 0) + return if isLeap then 29 else 28 + end + + if month == 4 or month == 6 or month == 9 or month == 11 then + return 30 + end + + return 31 + end + + local function parseDatetime(): string + local hasDate = looksLikeDate() + local result = "" + + if hasDate then + -- Parse YYYY-MM-DD + local yearStr = string.sub(src, pos, pos + 3) + pos += 4 + + if byteAt() ~= 45 then + tomlParseError "expected '-' in date" + end + + pos += 1 + + if not (isDigit(byteAt(0)) and isDigit(byteAt(1))) then + tomlParseError "expected 2-digit month" + end + + local monthStr = string.sub(src, pos, pos + 1) + pos += 2 + local month = tonumber(monthStr) :: number + + if month < 1 or month > 12 then + tomlParseError(`invalid month: {month}`) + end + + if byteAt() ~= 45 then + tomlParseError "expected '-' in date" + end + + pos += 1 + + if not (isDigit(byteAt(0)) and isDigit(byteAt(1))) then + tomlParseError "expected 2-digit day" + end + + local dayStr = string.sub(src, pos, pos + 1) + pos += 2 + + local day = tonumber(dayStr) :: number + local year = tonumber(yearStr) :: number + if day < 1 or day > daysInMonth(year, month) then + tomlParseError(`invalid day {day} for month {month}`) + end + + result = `{yearStr}-{monthStr}-{dayStr}` + + -- Optional datetime separator: T, t, or space followed by digit + local sep = byteAt() + if sep == 84 or sep == 116 then + pos += 1 + elseif sep == 32 and isDigit(byteAt(1)) then + pos += 1 + else + return result -- date-local + end + + result ..= "T" + end + + -- Parse HH:MM[:SS[.frac]] + if not (isDigit(byteAt(0)) and isDigit(byteAt(1))) then + tomlParseError "expected 2-digit hour" + end + + local hourStr = string.sub(src, pos, pos + 1) + pos += 2 + local hour = tonumber(hourStr) :: number + if hour > 23 then + tomlParseError(`invalid hour: {hour}`) + end + + if byteAt() ~= 58 then + tomlParseError "expected ':' in time" + end + + pos += 1 + if not (isDigit(byteAt(0)) and isDigit(byteAt(1))) then + tomlParseError "expected 2-digit minute" + end + + local minStr = string.sub(src, pos, pos + 1) + pos += 2 + local minute = tonumber(minStr) :: number + if minute > 59 then + tomlParseError(`invalid minute: {minute}`) + end + + result ..= `{hourStr}:{minStr}` + + -- Optional seconds (TOML 1.1) + local secStr = "00" + if byteAt() == 58 then + pos += 1 + + if not (isDigit(byteAt(0)) and isDigit(byteAt(1))) then + tomlParseError "expected 2-digit second" + end + + secStr = string.sub(src, pos, pos + 1) + pos += 2 + local sec = tonumber(secStr) :: number + if sec > 59 then + tomlParseError(`invalid second: {sec}`) + end + end + result ..= `:{secStr}` + + -- Optional fractional seconds + if byteAt() == 46 then + pos += 1 + + if not isDigit(byteAt()) then + tomlParseError "expected digit after '.' in time" + end + + local fracStart = pos + while isDigit(byteAt()) do + pos += 1 + end + + local fracPart = string.sub(src, fracStart, pos - 1) + result ..= `.{fracPart}` + end + + -- Optional offset: Z, +HH:MM, -HH:MM + local oc = byteAt() + if oc == 90 or oc == 122 then + if not hasDate then + tomlParseError "offset not allowed in time-local" + end + + pos += 1 + result ..= "Z" + elseif oc == 43 or oc == 45 then + if not hasDate then + tomlParseError "offset not allowed in time-local" + end + + local sign = string.char(oc :: number) + + pos += 1 + + if not (isDigit(byteAt(0)) and isDigit(byteAt(1))) then + tomlParseError "expected 2-digit offset hour" + end + + local ohStr = string.sub(src, pos, pos + 1) + pos += 2 + local oh = tonumber(ohStr) :: number + if oh > 23 then + tomlParseError(`invalid offset hour: {oh}`) + end + + if byteAt() ~= 58 then + tomlParseError "expected ':' in offset" + end + + pos += 1 + + if not (isDigit(byteAt(0)) and isDigit(byteAt(1))) then + tomlParseError "expected 2-digit offset minute" + end + + local omStr = string.sub(src, pos, pos + 1) + pos += 2 + local om = tonumber(omStr) :: number + if om > 59 then + tomlParseError(`invalid offset minute: {om}`) + end + + result ..= `{sign}{ohStr}:{omStr}` + end + + return result + end + + local parseValue: () -> TomlValue + + local function parseNumOrDatetime(sign: string?): string | number + local signStr = sign or "" + local c = byteAt() + + -- bare inf / nan + if string.sub(src, pos, pos + 2) == "inf" then + pos += 3 + return if signStr == "-" then -math.huge else math.huge + end + + if string.sub(src, pos, pos + 2) == "nan" then + pos += 3 + return math.nan + end + + if not isDigit(c) then + tomlParseError(`expected digit, got '${string.char(c :: number)}'`) + end + + -- prefixed integer bases (no sign allowed) + if sign == nil and c == 48 then + local nc = byteAt(1) + if nc == 120 then + pos += 2 + return tonumber(parseDigits(isHexDigit), 16) :: number + end -- 0x + + if nc == 111 then + pos += 2 + return tonumber(parseDigits(isOctDigit), 8) :: number + end -- 0o + + if nc == 98 then + pos += 2 + return tonumber(parseDigits(isBinDigit), 2) :: number + end -- 0b + end + + -- datetime / time detection (no sign) + if sign == nil then + if looksLikeDate() then + return parseDatetime() + end + + if looksLikeTime() then + return parseDatetime() + end + end + + -- decimal integer or float + local isZero = c == 48 + local intDigits: string + if isZero then + pos += 1 + + if isDigit(byteAt()) then + tomlParseError "leading zero in integer" + end + + intDigits = "0" + else + intDigits = parseDigits(isDigit) + end + + local nc = byteAt() + local isFloat = false + local result = signStr .. intDigits + + if nc == 46 then -- '.' + isFloat = true + pos += 1 + if not isDigit(byteAt()) then + tomlParseError "expected digit after decimal point" + end + result ..= "." .. parseDigits(isDigit) + nc = byteAt() + end + + if nc == 101 or nc == 69 then -- e / E + isFloat = true + pos += 1 + local expSign = "" + local ec = byteAt() + if ec == 43 or ec == 45 then + expSign = string.char(ec :: number) + pos += 1 + end + if not isDigit(byteAt()) then + tomlParseError "expected digit in exponent" + end + result ..= "e" .. expSign .. parseDigits(isDigit) + end + + return if isFloat then tonumber(result) :: number else tonumber(signStr .. intDigits) :: number + end + + -- array and inline-table parsers (forward declared for mutual recursion) + local parseArray: () -> { TomlValue } + local parseInlineTable: () -> { [string]: TomlValue } + local parseKey: () -> { string } + local setNestedKey: (tbl: { [string]: TomlValue }, parts: { string }, value: TomlValue, fromDottedKey: boolean) -> () + + parseValue = function(): TomlValue + skipWhitespace() + if pos > len then + tomlParseError "expected value" + end + local c = byteAt() :: number + + if c == 34 then -- " + pos += 1 + if string.sub(src, pos, pos + 1) == '""' then + pos += 2 + return parseMultilineBasicString() + end + return parseBasicString() + end + + if c == 39 then -- ' + pos += 1 + if string.sub(src, pos, pos + 1) == "''" then + pos += 2 + return parseMultilineLiteralString() + end + return parseLiteralString() + end + + if c == 91 then -- [ + pos += 1 + return parseArray() + end + + if c == 123 then -- { + pos += 1 + return parseInlineTable() + end + + if c == 116 then -- t + if string.sub(src, pos, pos + 3) == "true" then + pos += 4 + if isBareKey(byteAt()) then + tomlParseError "invalid value" + end + return true + end + + tomlParseError "invalid value starting with 't'" + end + + if c == 102 then -- f + if string.sub(src, pos, pos + 4) == "false" then + pos += 5 + if isBareKey(byteAt()) then + tomlParseError "invalid value" + end + return false + end + + tomlParseError "invalid value starting with 'f'" + end + + if c == 105 then -- i + if string.sub(src, pos, pos + 2) == "inf" then + pos += 3 + return math.huge + end + + tomlParseError "invalid value starting with 'i'" + end + + if c == 110 then -- n + if string.sub(src, pos, pos + 2) == "nan" then + pos += 3 + return math.nan + end + + tomlParseError "invalid value starting with 'n'" + end + + if c == 43 then -- + + pos += 1 + return parseNumOrDatetime "+" + end + + if c == 45 then -- - + pos += 1 + return parseNumOrDatetime "-" + end + + if isDigit(c) then + return parseNumOrDatetime(nil) + end + + tomlParseError(`unexpected character '${string.char(c)}' in value`) + -- FIXME(Luau): `tomlParseError` paths are not currently treated as not returning + error "unreachable" + end + + parseArray = function(): { TomlValue } + local result: { TomlValue } = {} + tableMeta[result] = { kind = "array-value", keys = {} } -- mark as static array + + skipWhitespaceNewlinesAndComments() + if byteAt() == 93 then + pos += 1 + return result + end -- empty [] + + while true do + skipWhitespaceNewlinesAndComments() + if pos > len then + tomlParseError "unterminated array" + end + + if byteAt() == 93 then + pos += 1 + break + end -- trailing comma case + + table.insert(result, parseValue()) + + skipWhitespaceNewlinesAndComments() + + if pos > len then + tomlParseError "unterminated array" + end + + local c = byteAt() + if c == 44 then -- ',' + pos += 1 + continue + end + + if c == 93 then -- ']' + pos += 1 + break + end + + tomlParseError(`expected ',' or ']' in array, got '${string.char(c :: number)}'`) + end + + return result + end + + parseKey = function(): { string } + skipWhitespace() + local parts: { string } = {} + + while true do + local c = byteAt() + local part: string + + if c == 34 then -- " + pos += 1 + part = parseBasicString() + elseif c == 39 then -- ' + pos += 1 + part = parseLiteralString() + elseif isBareKey(c) then + local start = pos + + while pos <= len do + local c2 = buffer.readu8(srcBuf, pos - 1) + if not isBareKey(c2) then + break + end + pos += 1 + end + + part = string.sub(src, start, pos - 1) + else + if #parts == 0 then + tomlParseError(`expected key, got '${string.char(c :: number or 0)}'`) + else + tomlParseError "expected key segment after '.'" + end + end + + table.insert(parts, part) + + skipWhitespace() + if byteAt() == 46 then -- '.' + pos += 1 + skipWhitespace() + else + break + end + end + + return parts + end + + -- navigate through dotted intermediate keys, creating tables as needed; + -- returns (leaf_table, leaf_key_string) + local function navigateDotted( + tbl: { [string]: TomlValue }, + parts: { string }, + newKind: TableKind + ): ({ [string]: TomlValue }, string) + local current: { [string]: TomlValue } = tbl + + for i = 1, #parts - 1 do + local k = parts[i] + local child = current[k] + + if child == nil then + local newTbl: { [string]: TomlValue } = {} + tableMeta[newTbl] = { kind = newKind, keys = {} } + current[k] = newTbl + getMeta(current).keys[k] = true + current = newTbl + elseif typeof(child) == "table" then + if arrayTableSets[child] then + tomlParseError(`cannot extend array-of-tables '${k}' via dotted key`) + end + + local m = getMeta(child) + + if m.kind == "array-value" then + tomlParseError(`cannot navigate through static array value '${k}'`) + end + + if m.kind == "inline" then + tomlParseError(`cannot extend inline table via key '${k}'`) + end + + if m.kind == "defined" or m.kind == "array-element" then + tomlParseError(`cannot extend explicitly-defined table '${k}' via dotted key`) + end + + current = child :: { [string]: TomlValue } + else + tomlParseError(`key '${k}' is not a table`) + end + end + return current, parts[#parts] + end + + setNestedKey = function(tbl: { [string]: TomlValue }, parts: { string }, value: TomlValue, fromDottedKey: boolean) + local newKind = if fromDottedKey then "implicit-dotted" else "implicit-header" + local leafTbl, leafKey = navigateDotted(tbl, parts, newKind) + + local m = getMeta(leafTbl) + + if m.keys[leafKey] then + tomlParseError(`duplicate key '${leafKey}'`) + end + + m.keys[leafKey] = true + leafTbl[leafKey] = value + + -- tag any freshly assigned table value + if typeof(value) == "table" and not tableMeta[value] then + tableMeta[value] = { kind = newKind, keys = {} } + end + end + + parseInlineTable = function(): { [string]: TomlValue } + local result: { [string]: TomlValue } = {} + tableMeta[result] = { kind = "inline", keys = {} } + skipWhitespaceNewlinesAndComments() -- TOML 1.1: newlines allowed inside inline tables + + if byteAt() == 125 then + pos += 1 + return result + end -- empty {} + + while true do + skipWhitespaceNewlinesAndComments() + if pos > len then + tomlParseError "unterminated inline table" + end + + if byteAt() == 125 then + pos += 1 + break + end -- '}' (trailing comma support) + + local keys = parseKey() + skipWhitespace() + + if byteAt() ~= 61 then + tomlParseError "expected '=' in inline table" + end -- '=' + + pos += 1 + + local value = parseValue() + setNestedKey(result, keys, value, false) + skipWhitespaceNewlinesAndComments() + + if pos > len then + tomlParseError "unterminated inline table" + end + + local c = byteAt() + if c == 44 then -- ',' + pos += 1 + continue + end + + if c == 125 then -- '}' + pos += 1 + break + end + + tomlParseError(`expected ',' or '}}' in inline table, got '${string.char(c :: number)}'`) + end + + return result + end + + -- navigate to the table referenced by a [key] or [[key]] header + local function navigateToHeader( + root: { [string]: TomlValue }, + parts: { string }, + isArrayTable: boolean + ): { [string]: TomlValue } + local current: { [string]: TomlValue } = root + for i = 1, #parts - 1 do + local k = parts[i] + local child = current[k] + + if child == nil then + local newTbl: { [string]: TomlValue } = {} + tableMeta[newTbl] = { kind = "implicit-header", keys = {} } + current[k] = newTbl + getMeta(current).keys[k] = true + current = newTbl + elseif typeof(child) == "table" then + if arrayTableSets[child] then + current = (child :: { TomlValue })[#(child :: { TomlValue })] :: { [string]: TomlValue } + else + local m = getMeta(child) + + if m.kind == "array-value" then + tomlParseError(`key '${k}' is a static array, cannot navigate through it`) + end + + if m.kind == "inline" then + tomlParseError "cannot extend inline table" + end + + current = child :: { [string]: TomlValue } + end + else + tomlParseError(`key '${k}' is not a table`) + end + end + + local leafKey = parts[#parts] + local existing = current[leafKey] + + if isArrayTable then + if existing == nil then + local arr: { { [string]: TomlValue } } = {} + + arrayTableSets[arr] = true + current[leafKey] = arr :: { TomlValue } + getMeta(current).keys[leafKey] = true + + local entry: { [string]: TomlValue } = {} + tableMeta[entry] = { kind = "array-element", keys = {} } + table.insert(arr, entry) + + return entry + end + + if typeof(existing) == "table" and arrayTableSets[existing] then + local entry: { [string]: TomlValue } = {} + tableMeta[entry] = { kind = "array-element", keys = {} } + table.insert(existing :: { { [string]: TomlValue } }, entry) + + return entry + end + + tomlParseError(`cannot define [[${leafKey}]]: key already exists as a different type`) + end + + if existing == nil then + local newTbl: { [string]: TomlValue } = {} + tableMeta[newTbl] = { kind = "defined", keys = {} } + current[leafKey] = newTbl + getMeta(current).keys[leafKey] = true + return newTbl + end + + if typeof(existing) == "table" then + -- Check arrayTableSets BEFORE getMeta to avoid creating spurious meta + if arrayTableSets[existing] then + tomlParseError(`cannot define [${leafKey}]: already an array-of-tables`) + end + + local m = getMeta(existing) + + if m.kind == "array-value" then + tomlParseError(`cannot define [${leafKey}]: key is a static array value`) + end + + if m.kind == "implicit-header" then + m.kind = "defined" + return existing :: { [string]: TomlValue } + end + + if m.kind == "defined" then + tomlParseError(`duplicate table header [${leafKey}]`) + end + + if m.kind == "inline" then + tomlParseError "cannot extend inline table with a table header" + end + + if m.kind == "implicit-dotted" then + tomlParseError(`table [${leafKey}] was already defined via a dotted key`) + end + + if m.kind == "array-element" then + tomlParseError(`cannot define [${leafKey}]: already an array-of-tables element`) + end + + tomlParseError(`cannot redefine [${leafKey}]`) + end + + tomlParseError(`key '${leafKey}' is not a table`) + + -- FIXME(Luau): `tomlParseError` paths are not currently treated as not returning + error "unreachable" + end + + -- main parse loop + + local root: { [string]: TomlValue } = {} + tableMeta[root] = { kind = "root", keys = {} } + local currentTable: { [string]: TomlValue } = root + + while pos <= len do + skipWhitespaceNewlinesAndComments() + if pos > len then + break + end + + local c = byteAt() :: number + + if c == 91 then -- '[' + if byteAt(1) == 91 then -- '[[' + pos += 2 + skipWhitespace() + local parts = parseKey() + skipWhitespace() + if string.sub(src, pos, pos + 1) ~= "]]" then + tomlParseError "expected ']]'" + end + pos += 2 + expectLineEnd() + currentTable = navigateToHeader(root, parts, true) + else + pos += 1 + skipWhitespace() + local parts = parseKey() + skipWhitespace() + if byteAt() ~= 93 then + tomlParseError "expected ']'" + end -- ']' + pos += 1 + expectLineEnd() + currentTable = navigateToHeader(root, parts, false) + end + else + local parts = parseKey() + skipWhitespace() + if byteAt() ~= 61 then + tomlParseError "expected '='" + end -- '=' + pos += 1 + local value = parseValue() + setNestedKey(currentTable, parts, value, true) + expectLineEnd() + end + end + + return root +end + +-- user-facing +toml.serialize = serialize +toml.deserialize = deserialize + +return table.freeze(toml) diff --git a/.lute/dev.luau b/.lute/dev.luau new file mode 100644 index 00000000..77da48f9 --- /dev/null +++ b/.lute/dev.luau @@ -0,0 +1,162 @@ +local cli = require "@scripts/libs/cli" +local divider = require "@scripts/libs/ui/divider" +local fs = require "@std/fs" +local initializeOutput = require "@scripts/libs/build/initializeOutput" +local initializeRojo = require "@scripts/libs/build/initializeRojo" +local io = require "@lute/io" +local path = require "@std/path" +local process = require "@std/process" +local richterm = require "@batteries/richterm" +local run = require "@scripts/libs/run" +local shouldFileBeTranspiled = require "@scripts/libs/build/shouldFileBeTranspiled" +local task = require "@std/task" +local transpile = require "@scripts/libs/build/transpile" +local types = require "./libs/types" +local useMonorepo = require "@scripts/libs/monorepo/useMonorepo" +local usePlaceDependencies = require "@scripts/libs/monorepo/usePlaceDependencies" +local useRepositoryConfig = require "@scripts/libs/monorepo/useRepositoryConfig" +local useSourcemapIndices = require "@scripts/libs/sourcemap/useSourcemapIndices" +local useSourcemapWatcher = require "@scripts/libs/sourcemap/useSourcemapWatcher" + +local args = cli.parser { description = "Launches and observes the given place for development" } +args:add("place", "positional", { help = "Name of place to build", required = true }) +args:parse { ... } + +local cwd = process.cwd() + +local repository = useRepositoryConfig() +local outputPath = repository.wth.paths.output +local outputProjectPath = repository.wth.paths.outputProject +local sourcemapPath = repository.wth.paths.sourcemap +local sourcemapProjectPath = repository.wth.paths.sourcemapProject + +local monorepo = useMonorepo() +local member = monorepo[args:get "place"] or error(`Unknown place named {args:get "place"}`) +local memberPlace = member.place or error(`Member {member.dirName} is not a place (does it have a place field?)`) +local placeId = memberPlace.placeId or error(`{memberPlace.title} is an abstract place (does it have a placeId?)`) + +local memberDependencies = usePlaceDependencies(monorepo, member) +local rojoMembers = table.clone(memberDependencies) +table.insert(rojoMembers, 1, member) + +local ctx: types.BuildContext = { + monorepo = monorepo, + repository = repository, + + member = member, + memberPlace = memberPlace, + memberDependencies = memberDependencies, + rojoMembers = rojoMembers, + + outputPath = outputPath, + outputProjectPath = outputProjectPath, + sourcemapPath = sourcemapPath, + sourcemapProjectPath = sourcemapProjectPath, + + sourcemapIndices = {}, + + globals = { + __DEV__ = true, + WTH_DIR_NAME = member.dirName, + WTH_PLACE_FOLDER = memberPlace.folderName, + WTH_PLACE_TITLE = memberPlace.title, + WTH_PLACE_SUBTITLE = memberPlace.subtitle, + }, +} + +print(divider "Initializing output...") +initializeOutput(ctx) + +print(divider "Initializing assets...") +run("asphalt", { "sync", "studio" }) + +print(divider "Initializing .blink files...") +for _, member in rojoMembers do + local blinkFilepath = path.join(member.dirPath, ".blink") + if fs.exists(blinkFilepath) then + print(richterm.dim(richterm.bold(`Compiling {blinkFilepath}`))) + run("blink", { blinkFilepath }) + task.spawn(run, "blink", { blinkFilepath }, { quiet = true } :: run.Options) + end +end + +print(divider "Initializing Rojo projects...") +initializeRojo(ctx) + +local sourcemapWatcher = useSourcemapWatcher(sourcemapPath) +local sourcemapFileWatcher = fs.watch(sourcemapPath) + +local sourcemapArgs = { + "sourcemap", + "--absolute", + "--include-non-scripts", + "--output", + sourcemapPath, + sourcemapProjectPath, +} + +run("rojo", sourcemapArgs) +table.insert(sourcemapArgs, 2, "--watch") +task.spawn(run, "rojo", sourcemapArgs, { quiet = true } :: run.Options) + +local function processChanges() + for absolutePath, fileWatcher in sourcemapWatcher.watchers do + local event = fileWatcher:next() + if event then + if event.change then + sourcemapWatcher.changes[absolutePath] = "changed" + end + end + end + + local event = sourcemapFileWatcher:next() + if event and event.change then + ctx.sourcemapIndices = useSourcemapIndices(sourcemapPath) + sourcemapWatcher.onChanged(ctx.sourcemapIndices) + end + + for filepath, action in sourcemapWatcher.changes do + if (action == "removed" or fs.exists(filepath)) and shouldFileBeTranspiled(monorepo, filepath) then + local relativePath = path.relative(cwd, filepath) + local outputFilepath = path.join(outputPath, relativePath) + + local formatter: richterm.Formatter, marker: string + if action == "added" then + formatter, marker = richterm.green, "+" + local outputDir = path.dirname(outputFilepath) + if not fs.exists(outputDir) then + fs.createDirectory(outputDir, { makeParents = true }) + end + fs.writeStringToFile(outputFilepath, transpile(ctx, filepath, fs.readFileToString(filepath))) + elseif action == "changed" then + formatter, marker = richterm.cyan, "↻" + fs.writeStringToFile(outputFilepath, transpile(ctx, filepath, fs.readFileToString(filepath))) + elseif action == "removed" then + formatter, marker = richterm.red, "-" + fs.remove(outputFilepath) + end + + print(formatter(`{marker} {relativePath}`)) + end + end + + table.clear(sourcemapWatcher.changes) +end + +print(divider "Running initial transpilation...") +processChanges() + +print(divider()) +task.spawn(run, "rojo", { "serve" }) + +task.delay(0.1, function() + print(richterm.blue(`Press {richterm.bold "Enter"} to open {memberPlace.title} in Roblox Studio.`)) + print(divider "Polling for changes...") + while task.wait(0.05) do + processChanges() + end +end) + +while io.read() do + run("lute", { "ropen", placeId }) +end diff --git a/.lute/libs/build/buildRojoProject.luau b/.lute/libs/build/buildRojoProject.luau new file mode 100644 index 00000000..3e0e502f --- /dev/null +++ b/.lute/libs/build/buildRojoProject.luau @@ -0,0 +1,73 @@ +local json = require "@std/json" +local log = require "@scripts/libs/log" +local path = require "@std/path" +local types = require "@scripts/libs/types" +local useRepositoryConfig = require "@scripts/libs/monorepo/useRepositoryConfig" + +local function insertMapping( + tree: types.RojoNode, + segments: { types.RojoMappingSegment }, + sourceName: string?, + sourcePath: path.Pathlike? +) + local current = tree + + for _, segment in segments do + if not current[segment.name] then + current[segment.name] = {} + end + + current = current[segment.name] + + if segment.className then + current["$className"] = segment.className + end + end + + if sourceName and sourcePath then + if not current[sourceName] then + current[sourceName] = {} + end + + current = current[sourceName] + + current["$path"] = { + optional = path.format(sourcePath), + } + end +end + +local function buildRojoProject(kind: "source" | "output", members: { types.MonorepoMember }): json.Object + local firstMember = members[1] or log.throw "Must specify atleast 1 member to build Rojo" + local place = firstMember.place or log.throw "First Rojo member must be a place" + + local repository = useRepositoryConfig() + local mappings = repository.wth.rojo.mappings :: types.RojoMappings + local tree: types.RojoNode = { ["$className"] = "DataModel" } + + for _, member in members do + if member.place then + for dir, segments in mappings do + insertMapping(tree, segments, member.folderName, member.rojoMappings[kind][dir]) + end + elseif member.placeMixin then + insertMapping( + tree, + member.placeMixin.rojo, + member.folderName, + if kind == "output" and member.placeMixin.transpile then member.outputDirPath else member.dirPath + ) + end + end + + return { + name = `Welcome To Hell: {place.title}`, + emitLegacyScripts = false, + servePlaceIds = { tonumber(place.placeId) }, + placeId = tonumber(place.placeId), + globIgnorePaths = { "**/.config.luau" }, + tree = tree, + } +end + +return buildRojoProject diff --git a/.lute/libs/build/initializeOutput.luau b/.lute/libs/build/initializeOutput.luau new file mode 100644 index 00000000..61bc5e5f --- /dev/null +++ b/.lute/libs/build/initializeOutput.luau @@ -0,0 +1,16 @@ +local copyInto = require "@scripts/libs/copyInto" +local emptyDir = require "@scripts/libs/emptyDir" +local richterm = require "@batteries/richterm" +local types = require "@scripts/libs/types" + +local function initializeOutput(ctx: types.BuildContext) + pcall(emptyDir, ctx.outputPath) + for _, member in ctx.rojoMembers do + if member.place or (member.placeMixin and member.placeMixin.transpile) then + print(richterm.cyan(`Copying {member.dirName} to output`)) + copyInto(member.dirPath, member.outputDirPath) + end + end +end + +return initializeOutput diff --git a/.lute/libs/build/initializeRojo.luau b/.lute/libs/build/initializeRojo.luau new file mode 100644 index 00000000..54931431 --- /dev/null +++ b/.lute/libs/build/initializeRojo.luau @@ -0,0 +1,11 @@ +local buildRojoProject = require "./buildRojoProject" +local fs = require "@std/fs" +local json = require "@std/json" +local types = require "@scripts/libs/types" + +local function initializeRojo(ctx: types.BuildContext) + fs.writeStringToFile(ctx.outputProjectPath, json.serialize(buildRojoProject("output", ctx.rojoMembers), true)) + fs.writeStringToFile(ctx.sourcemapProjectPath, json.serialize(buildRojoProject("source", ctx.rojoMembers), true)) +end + +return initializeRojo diff --git a/.lute/libs/build/shouldFileBeTranspiled.luau b/.lute/libs/build/shouldFileBeTranspiled.luau new file mode 100644 index 00000000..507929a2 --- /dev/null +++ b/.lute/libs/build/shouldFileBeTranspiled.luau @@ -0,0 +1,13 @@ +local getMemberFromPath = require "@scripts/libs/monorepo/getMemberFromPath" +local path = require "@std/path" +local process = require "@std/process" +local types = require "@scripts/libs/types" + +local function shouldFileBeTranspiled(monorepo: types.Monorepo, absolutePath: path.Pathlike) + local filepath = path.relative(process.cwd(), absolutePath) + local member = getMemberFromPath(monorepo, filepath) + + return not member.placeMixin or member.placeMixin.transpile +end + +return shouldFileBeTranspiled diff --git a/.lute/libs/build/transformers/resolveGlobals.luau b/.lute/libs/build/transformers/resolveGlobals.luau new file mode 100644 index 00000000..ef0f477f --- /dev/null +++ b/.lute/libs/build/transformers/resolveGlobals.luau @@ -0,0 +1,20 @@ +local pp = require "@batteries/pp" +local query = require "@std/syntax/query" +local syntax = require "@std/syntax" +local types = require "@scripts/libs/types" +local utils = require "@std/syntax/utils" + +local function resolveGlobals(ctx: types.TransfomerContext) + return query + .findAllFromRoot(ctx.tree, utils.isExprIndexName) + :filter(function(expr: syntax.AstExprIndexName): boolean + return expr.expression.tag == "global" and expr.expression.name.text == "_G" + end) + :replace(function(expr: syntax.AstExprIndexName) + local globalKey = expr.index.text + local global = ctx.build.globals[globalKey] + return if global == nil then nil else pp(global) + end) +end + +return resolveGlobals diff --git a/.lute/libs/build/transformers/resolveRequires.luau b/.lute/libs/build/transformers/resolveRequires.luau new file mode 100644 index 00000000..07cc5ae7 --- /dev/null +++ b/.lute/libs/build/transformers/resolveRequires.luau @@ -0,0 +1,36 @@ +local luau = require "@std/luau" +local path = require "@std/path" +local query = require "@std/syntax/query" +local richterm = require "@batteries/richterm" +local syntax = require "@std/syntax" +local types = require "@scripts/libs/types" +local utils = require "@std/syntax/utils" + +local function resolveRequires(ctx: types.TransfomerContext) + return query + .findAllFromRoot(ctx.tree, utils.isExprCall) + :filter(function(call: syntax.AstExprCall): boolean + return call.func.tag == "global" and call.func.name.text == "require" + end) + :replace(function(call: syntax.AstExprCall) + local pathArgument = call.arguments[1] + if not pathArgument or pathArgument.node.tag ~= "string" then + return nil + end + + local resolveSuccess, resolvedOrError = + pcall(luau.resolveModule, pathArgument.node.token.text, ctx.filepath) + + if not resolveSuccess then + print(richterm.yellow(`! Failed to resolve require {pathArgument.node.token.text}:`)) + print(richterm.yellow(` {resolvedOrError}`)) + print(richterm.yellow(` in {path.format(ctx.filepath)}`)) + return nil + end + + local requirePath = ctx.build.sourcemapIndices[path.format(resolvedOrError)] + return if requirePath then `require {string.format("%q", requirePath)}` else nil + end) +end + +return resolveRequires diff --git a/.lute/libs/build/transpile.luau b/.lute/libs/build/transpile.luau new file mode 100644 index 00000000..5edfbf9b --- /dev/null +++ b/.lute/libs/build/transpile.luau @@ -0,0 +1,35 @@ +local path = require "@std/path" +local printer = require "@std/syntax/printer" +local richterm = require "@batteries/richterm" +local syntax = require "@std/syntax" +local types = require "@scripts/libs/types" + +local transformers: { types.Transformer } = { + require "@scripts/libs/build/transformers/resolveGlobals", + require "@scripts/libs/build/transformers/resolveRequires", +} + +local function transpile(ctx: types.BuildContext, filepath: path.Pathlike, source: string) + for _, transformer in transformers do + local parseSuccess, treeOrError = pcall(syntax.parse, source) + if not parseSuccess then + print(richterm.yellow(`! Failed to parse {filepath}:`)) + print(richterm.yellow(` {treeOrError}`)) + return source + end + + source = printer.printFile( + treeOrError, + transformer { + build = ctx, + filepath = filepath, + source = source, + tree = treeOrError, + } + ) + end + + return source +end + +return transpile diff --git a/.lute/libs/cli.luau b/.lute/libs/cli.luau new file mode 100644 index 00000000..d12b6d45 --- /dev/null +++ b/.lute/libs/cli.luau @@ -0,0 +1,247 @@ +-- Forked for use in Welcome To Hell + +local process = require "@std/process" + +local cli = {} +cli.__index = cli + +type ArgKind = "positional" | "flag" | "option" | "variadic" +type ArgOptions = { + help: string?, + aliases: { string }?, + default: string?, + required: boolean?, + hidden: boolean?, +} + +type ArgData = { + name: string, + kind: ArgKind, + options: ArgOptions, +} + +type ParseResult = { + values: { [string]: string? }, + flags: { [string]: boolean }, + variadics: { string }, + fwdArgs: { string }, +} + +type ParserData = { + arguments: { [number]: ArgData }, + positional: { [number]: ArgData }, + variadicArg: ArgData?, + parsed: ParseResult, + description: string, +} + +type ParserInterface = typeof(cli) +export type Parser = setmetatable + +function cli.parser(props: { description: string }): Parser + local self: Parser = setmetatable({ + arguments = {}, + positional = {}, + variadicArg = nil :: ArgData?, + parsed = { values = {}, flags = {}, variadics = {}, fwdArgs = {} }, + description = props.description, + }, cli) + + self:add("script", "positional", { help = "This script", required = true, hidden = true }) + self:add("help", "flag", { help = "Shows this message", aliases = { "h" } }) + + return self +end + +function cli.add(self: Parser, name: string, kind: ArgKind, options: ArgOptions): () + local argument: ArgData = { + name = name, + kind = kind, + options = options or { aliases = {}, required = false }, + } + + table.insert(self.arguments, argument) + if kind == "positional" then + table.insert(self.positional, argument) + elseif kind == "variadic" then + self.variadicArg = argument + end +end + +function cli.parse(self: Parser, args: { string }): () + if table.find(args, "-h") or table.find(args, "--help") then + self:help() + process.exit(0) + end + + local i = 0 + local pos_index = 1 + + while i < #args do + i += 1 + + local arg = args[i] + + -- if the argument is exactly "--", we pass everything along + if arg == "--" then + table.move(args, i + 1, #args, #self.parsed.fwdArgs + 1, self.parsed.fwdArgs) + break + end + + -- if the argument starts with two dashes, we're parsing either a flag or an option + if string.sub(arg, 1, 2) == "--" then + local name = string.sub(arg, 3) + local found = false + + for _, argument in self.arguments do + local aliases = argument.options.aliases or {} + + if argument.name == name or table.find(aliases, name) then + found = true + + if argument.kind == "option" then + -- advance past the argument + i += 1 + + assert(i <= #args, "Missing value for argument: " .. argument.name) + self.parsed.values[argument.name] = args[i] + + break + end + + self.parsed.flags[argument.name] = true + break + end + end + + assert(found, "Unknown argument: " .. name) + continue + end + + -- if the argument starts with a single dash, we're parsing a flag + if string.sub(arg, 1, 1) == "-" then + local flags = string.sub(arg, 2) + + for j = 1, #flags do + local name = string.sub(flags, j, j) + local found = false + for _, argument in self.arguments do + local aliases = argument.options.aliases or {} + if argument.name == name or table.find(aliases, name) then + found = true + if argument.kind == "option" then + i += 1 + assert(i <= #args, "Missing value for argument: " .. argument.name) + self.parsed.values[argument.name] = args[i] + else + self.parsed.flags[argument.name] = true + end + break + end + end + + assert(found, "Unknown argument: " .. name) + end + + continue + end + + -- if we have positional arguments left, we can take this argument as one + if pos_index <= #self.positional then + self.parsed.values[self.positional[pos_index].name] = arg + pos_index += 1 + continue + end + + -- if we have a variadic argument, we can take this argument as part of it + if self.variadicArg then + table.insert(self.parsed.variadics, arg) + continue + end + + -- otherwise, the argument is forwarded on + table.insert(self.parsed.fwdArgs, arg) + end + + -- check that all required arguments are present, and set any default values as needed + for _, argument in self.arguments do + if argument.options.required then + if argument.kind == "variadic" then + assert(#self.parsed.variadics > 0, "Missing required variadic argument: " .. argument.name) + else + assert(self.parsed.values[argument.name], "Missing required argument: " .. argument.name) + end + end + + if self.parsed.values[argument.name] == nil and argument.options.default then + self.parsed.values[argument.name] = argument.options.default + end + end +end + +function cli.get(self: Parser, name: string): string? + return self.parsed.values[name] +end + +function cli.has(self: Parser, name: string): boolean + return self.parsed.flags[name] ~= nil +end + +function cli.variadics(self: Parser): { string } + return self.parsed.variadics +end + +function cli.forwarded(self: Parser): { string }? + return self.parsed.fwdArgs +end + +function cli.usage(self: Parser, name: string): string + local parts = { name } + + for _, arg in self.positional do + if not arg.options.hidden then + if arg.options.required then + table.insert(parts, `<{arg.name}>`) + else + table.insert(parts, `[{arg.name}]`) + end + end + end + + for _, arg in self.arguments do + if not arg.options.hidden and arg.kind ~= "positional" and arg.kind ~= "variadic" then + table.insert(parts, "[options]") + break + end + end + + if self.variadicArg and not self.variadicArg.options.hidden then + local v = self.variadicArg + if v.options.required then + table.insert(parts, `<{v.name}...>`) + else + table.insert(parts, `[{v.name}...]`) + end + end + + return table.concat(parts, " ") +end + +function cli.help(self: Parser, formatter: ((s: string) -> string)?): () + local fmt = formatter or function(s) + return s + end + + print(fmt "Usage:") + for _, argument in self.arguments do + if argument.options.hidden then + continue + end + + local aliasStr = table.concat(argument.options.aliases or {}, ", ") + local reqStr = if argument.options.required then "(required) " else "" + print(fmt(string.format(" --%s (-%s) - %s%s", argument.name, aliasStr, reqStr, argument.options.help or ""))) + end +end + +return table.freeze(cli) diff --git a/.lute/libs/copyInto.luau b/.lute/libs/copyInto.luau new file mode 100644 index 00000000..c842e11e --- /dev/null +++ b/.lute/libs/copyInto.luau @@ -0,0 +1,25 @@ +local fs = require "@std/fs" +local path = require "@std/path" + +local function copyInto(from: path.Pathlike, to: path.Pathlike) + if fs.type(from) == "dir" then + if not fs.exists(to) then + fs.createDirectory(to) + end + + for _, entry in fs.listDirectory(from) do + local entryPath = path.join(from, entry.name) + local entryDestination = path.join(to, entry.name) + + if entry.type == "dir" then + copyInto(entryPath, entryDestination) + else + fs.copy(entryPath, entryDestination) + end + end + else + fs.copy(from, to) + end +end + +return copyInto diff --git a/.lute/libs/emptyDir.luau b/.lute/libs/emptyDir.luau new file mode 100644 index 00000000..d8499551 --- /dev/null +++ b/.lute/libs/emptyDir.luau @@ -0,0 +1,15 @@ +local fs = require "@std/fs" +local path = require "@std/path" + +local function emptyDir(dir: path.Pathlike) + for _, file in fs.listDirectory(dir) do + local filepath = path.join(dir, file.name) + if fs.type(filepath) == "dir" then + fs.removeDirectory(filepath, { recursive = true }) + else + fs.remove(filepath) + end + end +end + +return emptyDir diff --git a/.lute/libs/findCommentRegion.luau b/.lute/libs/findCommentRegion.luau new file mode 100644 index 00000000..483565f8 --- /dev/null +++ b/.lute/libs/findCommentRegion.luau @@ -0,0 +1,5 @@ +local function findCommentRegion(source: string, name: string) + return string.find(source, `%-%- #region {name}%s.-%-%- #endregion`) +end + +return findCommentRegion diff --git a/.lute/libs/log.luau b/.lute/libs/log.luau new file mode 100644 index 00000000..7a4db0d1 --- /dev/null +++ b/.lute/libs/log.luau @@ -0,0 +1,36 @@ +local pp = require "@batteries/pp" +local process = require "@std/process" +local richterm = require "@batteries/richterm" + +local function stringify(formatter: richterm.Formatter, ...: unknown) + local len = select("#", ...) + local prettified = table.create(len) + for index = 1, len do + local value = select(index, ...) + prettified[index] = formatter(if type(value) == "string" then value else pp(value)) + end + return table.concat(prettified, " ") +end + +local function createLogger(formatter: richterm.Formatter) + return function(...: unknown) + print(stringify(formatter, ...)) + end +end + +local function throw(...: unknown): never + print(stringify(richterm.red, ...)) + return process.exit(1) +end + +return table.freeze { + bare = createLogger(function(s: string, nocolor: boolean?): string + return s + end), + + verbose = createLogger(richterm.dim), + info = createLogger(richterm.cyan), + warn = createLogger(richterm.yellow), + error = createLogger(richterm.red), + throw = throw, +} diff --git a/.lute/libs/monorepo/getMemberFromPath.luau b/.lute/libs/monorepo/getMemberFromPath.luau new file mode 100644 index 00000000..850be947 --- /dev/null +++ b/.lute/libs/monorepo/getMemberFromPath.luau @@ -0,0 +1,14 @@ +local path = require "@std/path" +local types = require "@scripts/libs/types" + +local function getMemberFromPath(monorepo: types.Monorepo, filepath: path.Pathlike): types.MonorepoMember + local firstPart = path.parse(filepath).parts[1] + for _, member in ipairs(monorepo) do + if member.dirName == firstPart then + return member + end + end + return error "unreachable" +end + +return getMemberFromPath diff --git a/.lute/libs/monorepo/useMonorepo.luau b/.lute/libs/monorepo/useMonorepo.luau new file mode 100644 index 00000000..0616fb85 --- /dev/null +++ b/.lute/libs/monorepo/useMonorepo.luau @@ -0,0 +1,73 @@ +local fs = require "@std/fs" +local log = require "@scripts/libs/log" +local luau = require "@std/luau" +local path = require "@std/path" +local types = require "@scripts/libs/types" +local useRepositoryConfig = require "./useRepositoryConfig" + +local function useMonorepo(): types.Monorepo + local repository = useRepositoryConfig() + local monorepo: types.Monorepo = {} + + for _, entry in fs.listDirectory "." do + if entry.type ~= "dir" then + continue + end + + local configPath = path.join(entry.name, ".config.luau") + if not fs.exists(configPath) or fs.type(configPath) ~= "file" then + continue + end + + local config: types.LuauConfig = luau.loadModule(configPath) + local wthConfig = config.wth + if not wthConfig then + continue + end + + local placeConfig, placeMixinConfig = wthConfig.place, wthConfig.placeMixin + if placeConfig and placeMixinConfig then + log.warn(entry.name, "config specifies place AND placeMixin, which is mutually exclusive") + continue + elseif not (placeConfig or placeMixinConfig) then + continue + end + + local folderName = if placeConfig + then placeConfig.folderName + elseif placeMixinConfig then placeMixinConfig.folderName + else log.throw(`Missing folderName for {entry.name}`) + + local member: types.MonorepoMember = { + place = placeConfig, + placeMixin = placeMixinConfig, + + folderName = folderName, + dirName = entry.name, + dirPath = entry.name, + configPath = configPath, + outputDirPath = path.join(repository.wth.paths.output, entry.name), + + rojoMappings = { + source = {}, + output = {}, + }, + } + + for key in repository.wth.rojo.mappings :: any do + member.rojoMappings.source[key] = path.join(member.dirPath, key) + member.rojoMappings.output[key] = path.join(repository.wth.paths.output, member.dirPath, key) + end + + table.insert(monorepo, member) + monorepo[entry.name] = member + end + + table.sort(monorepo, function(lhs: types.MonorepoMember, rhs: types.MonorepoMember) + return lhs.dirName < rhs.dirName + end) + + return monorepo +end + +return useMonorepo diff --git a/.lute/libs/monorepo/usePlaceDependencies.luau b/.lute/libs/monorepo/usePlaceDependencies.luau new file mode 100644 index 00000000..aebc0f9e --- /dev/null +++ b/.lute/libs/monorepo/usePlaceDependencies.luau @@ -0,0 +1,49 @@ +local types = require "@scripts/libs/types" + +local function usePlaceDependencies(monorepo: types.Monorepo, member: types.MonorepoMember) + local resolved = {} + local resolvedSet = {} + local visiting = {} + + local function visit(current: types.MonorepoMember, stack: { string }) + local place = current.place + if not place then + return + end + + if visiting[current.dirName] then + local cycleStart = table.find(stack, current.dirName) or 1 + local cycle = table.move(stack, cycleStart, #stack, 1, {}) + table.insert(cycle, current.dirName) + + error(`Place has cyclic dependency: {table.concat(cycle, " -> ")}`) + end + + if resolvedSet[current.dirName] then + return + end + + visiting[current.dirName] = true + table.insert(stack, current.dirName) + + for _, dependencyName in place.dependencies or {} do + local dependency = monorepo[dependencyName] + or error(`Place {current.dirName} has unknown dependency named {dependencyName}`) + visit(dependency, stack) + + if not resolvedSet[dependency.dirName] then + resolvedSet[dependency.dirName] = true + table.insert(resolved, dependency) + end + end + + visiting[current.dirName] = nil + table.remove(stack) + end + + visit(member, {}) + + return resolved +end + +return usePlaceDependencies diff --git a/.lute/libs/monorepo/useRepositoryConfig.luau b/.lute/libs/monorepo/useRepositoryConfig.luau new file mode 100644 index 00000000..5c7114c7 --- /dev/null +++ b/.lute/libs/monorepo/useRepositoryConfig.luau @@ -0,0 +1,11 @@ +local luau = require "@std/luau" +local types = require "@scripts/libs/types" + +local cache: any + +local function useRepositoryConfig(): types.RepositoryConfig + cache = cache or luau.loadModule ".config.luau" + return cache +end + +return useRepositoryConfig diff --git a/.lute/libs/run.luau b/.lute/libs/run.luau new file mode 100644 index 00000000..ec2bdb23 --- /dev/null +++ b/.lute/libs/run.luau @@ -0,0 +1,42 @@ +local io = require "@std/io" +local path = require "@std/path" +local process = require "@std/process" +-- local richterm = require "@batteries/richterm" + +export type Options = { + cwd: path.Pathlike?, + env: { [string]: string }?, + quiet: boolean?, + ignoreFailure: boolean?, + captureOutput: boolean?, +} + +local function run(program: string, args: { any }, options: Options?) + options = options or {} :: Options + + local stringifiedArgs = table.create(#args + 1) :: { string } + for index, arg in args do + stringifiedArgs[index] = tostring(arg) + end + table.insert(stringifiedArgs, 1, program) + + -- if not options.quiet then + -- print(richterm.dim(`$ {table.concat(stringifiedArgs, " ")}`)) + -- end + + local result = process.run(stringifiedArgs, { + cwd = options.cwd and tostring(options.cwd), + env = options.env, + stdio = if options.captureOutput or options.quiet then "default" else "inherit", + }) + + -- lute doesn't stream output when using `default` stdio; so we print it + -- here for ergonomics + if options.captureOutput and not options.quiet then + io.write(result.stdout, result.stderr) + end + + return if result.ok or options.ignoreFailure then result else error(result.stderr) +end + +return run diff --git a/.lute/libs/sourcemap/sanitizeQuotes.luau b/.lute/libs/sourcemap/sanitizeQuotes.luau new file mode 100644 index 00000000..b12236d8 --- /dev/null +++ b/.lute/libs/sourcemap/sanitizeQuotes.luau @@ -0,0 +1,7 @@ +local function sanitizeQuotes(str: string): string + str = string.gsub(str, '"', '\\"') + str = string.gsub(str, "\\", "\\\\") + return str +end + +return sanitizeQuotes diff --git a/.lute/libs/sourcemap/useSourcemapIndices.luau b/.lute/libs/sourcemap/useSourcemapIndices.luau new file mode 100644 index 00000000..06dc856e --- /dev/null +++ b/.lute/libs/sourcemap/useSourcemapIndices.luau @@ -0,0 +1,55 @@ +-- From https://github.com/checkraisefold/warmluau/blob/8299341613adfef565a19b8ee7da25c1c66ccb10/src/ingredients/resolve_require/init.luau + +local fs = require "@std/fs" +local json = require "@std/json" +local path = require "@std/path" +local sanitizeQuotes = require "@scripts/libs/sourcemap/sanitizeQuotes" +local types = require "@scripts/libs/types" + +local function sourcemapIndices(sourcemapPath: path.Pathlike): types.SourcemapIndices + local sourcemap = json.deserialize(fs.readFileToString(sourcemapPath)) :: types.SourcemapNode + local indices: { [string]: string } = {} + + local nodes = sourcemap.children + if not nodes then + return {} + end + + local lenNodes = #nodes + for index = 1, lenNodes do + local service = nodes[index] + service.name = `@game/{service.name}` + end + + local index = 0 + while index < lenNodes do + index += 1 + local node = nodes[index] + local nodeName = node.name + + local filePaths = node.filePaths + if filePaths then + local lenFilePaths = #filePaths + for filePathsIndex = 1, lenFilePaths do + local filePath = filePaths[filePathsIndex] + local absolutePath = path.format(filePath) + indices[absolutePath] = nodeName + end + end + + local children = node.children + if children then + local children_count = #children + for children_index = 1, children_count do + local child = children[children_index] + child.name = `{nodeName}/{child.name}` + end + table.move(children, 1, children_count, lenNodes + 1, nodes) + lenNodes += children_count + end + end + + return indices +end + +return sourcemapIndices diff --git a/.lute/libs/sourcemap/useSourcemapWatcher.luau b/.lute/libs/sourcemap/useSourcemapWatcher.luau new file mode 100644 index 00000000..d90198e5 --- /dev/null +++ b/.lute/libs/sourcemap/useSourcemapWatcher.luau @@ -0,0 +1,48 @@ +local fs = require "@std/fs" +local types = require "@scripts/libs/types" + +--[=[ + Watches the project's sourcemap.json for files added and removed. Also + watches all listed files in the sourcemap for file changes. + + Although limited, this is significantly more reliable than Lute's `fs.watch` + and more performant than long polling. +]=] +local function useSourcemapWatcher() + local oldIndices: types.SourcemapIndices = {} + local changes: { [string]: "added" | "changed" | "removed" } = {} + local watchers: { [string]: types.Watcher } = {} + + local function onChanged(newIndices: types.SourcemapIndices) + for absolutePath in newIndices do + if not oldIndices[absolutePath] and not changes[absolutePath] then + changes[absolutePath] = "added" + + local watcher = fs.watch(absolutePath) + watchers[absolutePath] = watcher + end + end + + for absolutePath, hash in oldIndices do + if not newIndices[absolutePath] and not changes[absolutePath] then + changes[absolutePath] = "removed" + + local watcher = watchers[absolutePath] + if watcher then + watcher:close() + watchers[absolutePath] = nil + end + end + end + + oldIndices = newIndices + end + + return { + changes = changes, + watchers = watchers, + onChanged = onChanged, + } +end + +return useSourcemapWatcher diff --git a/.lute/libs/types.luau b/.lute/libs/types.luau new file mode 100644 index 00000000..e160ced4 --- /dev/null +++ b/.lute/libs/types.luau @@ -0,0 +1,115 @@ +local fs = require "@std/fs" +local path = require "@std/path" +local syntax = require "@std/syntax" +local syntaxTypes = require "@std/syntax/types" + +-- Rojo + +export type RojoMappings = { [string]: { RojoMappingSegment } } + +export type RojoMappingSegment = { + name: string, + className: string?, +} + +export type RojoPath = string | { optional: string } + +export type RojoNode = { + ["$className"]: string?, + ["$path"]: RojoPath?, + [string]: RojoNode, +} + +export type RojoProjectTarget = "source" | "output" + +-- Rojo Sourcemap + +export type SourcemapNode = { + name: string, + filePaths: { string }?, + children: { SourcemapNode }?, +} + +export type SourcemapIndices = { [string]: string } + +-- Monorepo + +export type Place = { + title: string, + subtitle: string?, + folderName: string, + placeId: string?, + dependencies: { string }?, +} + +export type PlaceMixin = { + transpile: boolean, + folderName: string, + rojo: { + { + name: string, + className: string?, + } + }, +} + +export type LuauConfig = { + wth: { + place: Place?, + placeMixin: PlaceMixin?, + }, +} + +export type MonorepoMember = { + place: Place?, + placeMixin: PlaceMixin?, + + folderName: string, + dirName: string, + dirPath: path.Pathlike, + configPath: path.Pathlike, + outputDirPath: path.Pathlike, + + rojoMappings: { + [RojoProjectTarget]: { [keyof]: path.Pathlike? }, + }, +} + +export type Monorepo = { [any]: MonorepoMember } + +export type RepositoryConfig = typeof(require "@scripts/libs/../../.config") + +-- Build + +export type BuildContext = { + monorepo: Monorepo, + repository: RepositoryConfig, + + member: MonorepoMember, + memberPlace: Place, + memberDependencies: { MonorepoMember }, + rojoMembers: { MonorepoMember }, + + outputPath: path.Pathlike, + outputProjectPath: path.Pathlike, + sourcemapPath: path.Pathlike, + sourcemapProjectPath: path.Pathlike, + + sourcemapIndices: SourcemapIndices, + globals: { [string]: string | boolean | nil }, +} + +export type TransfomerContext = { + tree: syntax.ParseResult, + filepath: path.Pathlike, + source: string, + build: BuildContext, +} + +export type Transformer = (ctx: TransfomerContext) -> syntaxTypes.Replacements + +-- Lute + +export type Watcher = typeof(fs.watch "") + +return nil diff --git a/.lute/libs/ui/banner.luau b/.lute/libs/ui/banner.luau new file mode 100644 index 00000000..9cc3375c --- /dev/null +++ b/.lute/libs/ui/banner.luau @@ -0,0 +1,17 @@ +local richterm = require "@batteries/richterm" + +local PRIMARY = richterm.red +local SECONDARY = richterm.yellow + +return table.freeze { + PRIMARY = PRIMARY, + SECONDARY = SECONDARY, + + BASE_TOP = "▄ █ ▀█▀ █ ▄", + BASE_BOT = " █▀█ █ █▀█ ", + + RICH_TOP = `{PRIMARY "▄ █ "}{SECONDARY "▀█▀"}{PRIMARY " █ ▄"}`, + RICH_BOT = `{PRIMARY " █▀█"}{SECONDARY " █ "}{PRIMARY "█▀█ "}`, + + INDENT = " ", +} diff --git a/.lute/libs/ui/divider.luau b/.lute/libs/ui/divider.luau new file mode 100644 index 00000000..0724c3a5 --- /dev/null +++ b/.lute/libs/ui/divider.luau @@ -0,0 +1,21 @@ +local richterm = require "@batteries/richterm" + +const LINE = "―" + +local function divider(label: string?, length: number?) + length = length or 60 + + if label then + local labelLength = string.len(label) + local lineLength = (length - labelLength) * 0.5 + + -- we add an extra line at the end if the label is uneven + local endPadding = labelLength % 2 + + return richterm.dim(`{string.rep(LINE, lineLength)} {label} {string.rep(LINE, lineLength + endPadding)}`) + end + + return string.rep(richterm.dim(LINE), length) +end + +return divider diff --git a/.lute/ripple.luau b/.lute/ripple.luau new file mode 100644 index 00000000..71fa903c --- /dev/null +++ b/.lute/ripple.luau @@ -0,0 +1,19 @@ +local cli = require "@batteries/cli" +local log = require "@scripts/libs/log" +local run = require "@scripts/libs/run" +local task = require "@std/task" +local useMonorepo = require "@scripts/libs/monorepo/useMonorepo" + +local args = cli.parser { description = "Runs a command across all monorepo members" } +args:parse { ... } + +local monorepo = useMonorepo() +local forwarded = args:forwarded() or {} :: { string } +table.remove(forwarded, 1) +local program = forwarded[1] +table.remove(forwarded, 1) + +for _, member in monorepo do + log.verbose(member.dirName) + task.spawn(run, program, forwarded, { cwd = member.dirPath, ignoreFailure = true } :: run.Options) +end diff --git a/.lute/ropen.luau b/.lute/ropen.luau new file mode 100644 index 00000000..8d28ad9f --- /dev/null +++ b/.lute/ropen.luau @@ -0,0 +1,24 @@ +local cli = require "@scripts/libs/cli" +local run = require "@scripts/libs/run" +local system = require "@lute/system" +local useMonorepo = require "@scripts/libs/monorepo/useMonorepo" + +local args = cli.parser { description = "Opens a given place ID in Roblox Studio" } +args:add("place", "positional", { help = "Place name or ID to open", required = true }) +args:parse { ... } + +local function open(url) + run(if system.os == "windows" then "explorer" elseif system.os == "Darwin" then "open" else "xdg-open", { url }) +end + +local place = args:get "place" +local placeId = tonumber(place) +if placeId == nil then + -- monorepo alias + local monorepo = useMonorepo() + local member = monorepo[place] or error(`Unknown place ID or monorepo member named {place}`) + local place = member.place or error(`Monorepo member must be a place`) + placeId = place.placeId or error(`Monorepo member must be a real place (is placeId missing?)`) +end + +open(`roblox-studio:1+task:EditPlace+placeId:{placeId}+universeId:0`) diff --git a/.zed/settings.json b/.zed/settings.json deleted file mode 100644 index 89f14320..00000000 --- a/.zed/settings.json +++ /dev/null @@ -1,18 +0,0 @@ -// Folder-specific settings -// -// For a full list of overridable settings, and general information on folder-specific settings, -// see the documentation: https://zed.dev/docs/configuring-zed#settings-files -{ - "lsp": { - "luau-lsp": { - "settings": { - "roblox": { - "enabled": true, - "security_level": "none", - "download_api_documentation": true, - "download_definitions": true - } - } - } - } -} diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 4be745a1..00000000 --- a/README.md +++ /dev/null @@ -1,162 +0,0 @@ -
- - - - Prvd 'M Wrong Logo - -
-
- -## 💥 Luau's Unstoppable Force - -> [!WARNING] -> **Prvd 'M Wrong is unfinished.** Do not use Prvd 'M Wrong for production. - - -Luau has often meant navigating sprawling mazes of dependencies, grappling with -incomplete frameworks, and a challenging development experience. - -No longer. Prvd 'M Wrong is the Luau provider framework, freeing you from -logistical nightmares so you can focus just on your project's logic. - -Use Prvd 'M Wrong to structure your project with providers. Prvd 'M Wrong -delivers type-safe APIs, method lifecycles, and dependency injection. - -Whether you prefer batteries to be included, or want to use your favorite -packages and patterns, Prvd 'M Wrong adapts to your needs. - -Built with fantastic user extensibility, modular composability and runtime -integration, Prvd 'M Wrong can be dropped in for both new projects and existing -frameworks. In particular, Prvd 'M Wrong gleams anywhere Luau runs, from Roblox -to Lune. - -All free from logistical nightmares and without sprawling mazes of bloaty -dependencies. - -Want to prove them wrong? -[Get going with the Prvd 'M Wrong on rails tutorial,][Tutorial] -or [read through the library of example projects.][Examples] - -[Tutorial]: https://prvdmwrong.luau.page/latest/tutorials -[Examples]: https://prvdmwrong.luau.page/latest/examples - -## 🚀 Crash Course - -Assuming a Roblox project, create a "Providers" folder in ServerScriptService. - -Create a new server Script inside ServerScriptService, this is where we will -bootstrap Prvd 'M Wrong. - -First, create and start a root. Roots are starting points for Prvd 'M Wrong: - -```luau --- replace with path to Prvd 'M Wrong! -local prvd = require(...) - -local root = prvd.root() - -- use all descendant module scripts inside our Providers folder - :useModules(script.Parent:WaitForChild("Providers"):GetDescendants()) - -- start! - :start() - --- when the server closes, the root should be finished. -game:BindToClose(function() - root:finish() -end) -``` - -Now, let's create your first provider! Inside your "Providers" folder, create a -ModuleScript called "TimeProvider": - -```luau --- replace with path to Prvd 'M Wrong! -local prvd = require(...) - --- Providers are just defined as tables. -local TimeProvider = {} - --- When starting the root, Prvd 'M Wrong will construct each provider one by --- one. -function TimeProvider.constructor(self: TimeProvider) - self.time = 0 -end - --- `start` will be called after all providers have constructed. `start` also --- runs in it's own thread! -function TimeProvider.start(self: TimeProvider) - while true do - self.time += task.wait() - end -end - --- Prvd 'M Wrong takes advantage of the Luau type solver, so your providers --- enjoy type safety! -export type TimeProvider = typeof(TimeProvider) - --- Export the provider. -return prvd(TimeProvider) -``` - -Prvd 'M Wrong can also resolve your provider's dependencies as so the -dependencies it needs are constructed before the dependent. Create a new -"ServerTimeProvider" ModuleScript: - -```luau --- replace with path to Prvd 'M Wrong! -local prvd = require(...) - -local ServerTimeProvider = {} - --- `dependencies` is a special table that Prvd 'M Wrong will read and collect --- dependencies. -ServerTimeProvider.dependencies = { - -- `depend` tells Prvd 'M Wrong this is a dependency that it should track. - -- It also refines the type to the actual constructed provider! - TimeProvider = prvd.depend(require("./TimeProvider")) -} - --- To use the dependencies, get it as the second argument of the constructor: -function ServerTimeProvider.constructor( - self: ServerTimeProvider, - dependencies: typeof(self.dependencies) -) - -- Need to hold on dependencies for later? Just set it! - self.timeProvider = dependencies.TimeProvider -end - --- Now you can access `TimeProvider` in other methods! -function ServerTimeProvider.start(self: ServerTimeProvider) - while true do - print( - "The server has been alive for", - math.round(self.timeProvider.time), - "seconds!" - ) - end -end - -export type ServerTimeProvider = typeof(ServerTimeProvider) -return prvd(ServerTimeProvider) -``` - -With that, you've written your first Prvd 'M Wrong project, touching on all of -the major Prvd 'M Wrong concepts! - -[In the tutorials][Tutorial], we'll dig deeper into what exactly all of this code -is doing. Feel free to review these code snippets as many times as you need. - -## 🌏 Cultural Impact - -Prvd 'M Wrong has a significant cultural impact following the archival of the -Knit framework. Many packages inspired by Prvd 'M Wrong, which you can use if -you're unsastified, as listed below: - -- [Artwork](https://ratplier.github.io/artwork) -- [Saphhire (archived)](https://github.com/Mark-Marks/sapphire) - -## 📝 License - -Prvd 'M Wrong 0.2 is licensed under the Mozilla Public License 2.0. - -Note that historical versions of Prvd 'M Wrong were licensed under the MIT -License and sometimes the Apache License 2.0. diff --git a/dist/pesde/luau/dependencies/src/depend.luau b/dependencies/depend.luau similarity index 72% rename from dist/pesde/luau/dependencies/src/depend.luau rename to dependencies/depend.luau index 55230b4e..beb8b3c3 100644 --- a/dist/pesde/luau/dependencies/src/depend.luau +++ b/dependencies/depend.luau @@ -1,8 +1,8 @@ -local logger = require("./logger") -local types = require("./types") +local logger = require "./logger" +local types = require "./types" local function useBeforeConstructed(unresolved: types.UnresolvedDependency) - logger:fatalError({ template = logger.useBeforeConstructed, unresolved.dependency.name or "subdependency" }) + logger:fatalError { template = logger.useBeforeConstructed, unresolved.dependency.name or "subdependency" } end local unresolvedMt = { @@ -11,9 +11,7 @@ local unresolvedMt = { __newindex = useBeforeConstructed, } -function unresolvedMt:__tostring() - return "UnresolvedDependency" -end +function unresolvedMt:__tostring() return "UnresolvedDependency" end -- Wtf luau local function depend(dependency: types.Dependency): typeof(({} :: types.Dependency).new( diff --git a/dependencies/init.luau b/dependencies/init.luau new file mode 100644 index 00000000..bcac886a --- /dev/null +++ b/dependencies/init.luau @@ -0,0 +1,12 @@ +local depend = require "@self/depend" +local processDependencies = require "@self/process-dependencies" +local sortByPriority = require "@self/sort-by-priority" +local types = require "@self/types" + +export type Dependency = types.Dependency + +return table.freeze { + depend = depend, + processDependencies = processDependencies, + sortByPriority = sortByPriority, +} diff --git a/dist/pesde/luau/dependencies/src/logger.luau b/dependencies/logger.luau similarity index 81% rename from dist/pesde/luau/dependencies/src/logger.luau rename to dependencies/logger.luau index 22f3b307..bf5652b6 100644 --- a/dist/pesde/luau/dependencies/src/logger.luau +++ b/dependencies/logger.luau @@ -1,6 +1,6 @@ -local logger = require("../logger") +local logger = require "../logger" -return logger.create("@prvdmwrong/dependencies", logger.standardErrorInfoUrl("dependencies"), { +return logger.create("@prvdmwrong/dependencies", logger.standardErrorInfoUrl "dependencies", { useBeforeConstructed = "Cannot use %s before it is constructed. Are you using the dependency outside a class method?", alreadyDestroyed = "Cannot destroy an already destroyed Root.", alreadyFinished = "Root has already finished.", diff --git a/dist/npm/dependencies/src/process-dependencies.luau b/dependencies/process-dependencies.luau similarity index 95% rename from dist/npm/dependencies/src/process-dependencies.luau rename to dependencies/process-dependencies.luau index 20820a35..4a7635af 100644 --- a/dist/npm/dependencies/src/process-dependencies.luau +++ b/dependencies/process-dependencies.luau @@ -1,5 +1,5 @@ -local lifecycles = require("../lifecycles") -local types = require("./types") +local lifecycles = require "../lifecycles" +local types = require "./types" export type ProccessDependencyResult = { sortedDependencies: { types.Dependency }, diff --git a/dist/pesde/luau/dependencies/src/sort-by-priority.luau b/dependencies/sort-by-priority.luau similarity index 69% rename from dist/pesde/luau/dependencies/src/sort-by-priority.luau rename to dependencies/sort-by-priority.luau index 638468ab..5d5592af 100644 --- a/dist/pesde/luau/dependencies/src/sort-by-priority.luau +++ b/dependencies/sort-by-priority.luau @@ -1,10 +1,8 @@ -local types = require("./types") +local types = require "./types" local function sortByPriority(dependencies: { types.Dependency }) table.sort(dependencies, function(left: any, right: any) - if left.priority ~= right.priority then - return (left.priority or 1) > (right.priority or 1) - end + if left.priority ~= right.priority then return (left.priority or 1) < (right.priority or 1) end local leftIndex = table.find(dependencies, left) local rightIndex = table.find(dependencies, right) return leftIndex < rightIndex diff --git a/dist/npm/dependencies/src/types.luau b/dependencies/types.luau similarity index 100% rename from dist/npm/dependencies/src/types.luau rename to dependencies/types.luau diff --git a/dist/bundle.rbxl b/dist/bundle.rbxl deleted file mode 100644 index beb9d623..00000000 Binary files a/dist/bundle.rbxl and /dev/null differ diff --git a/dist/bundle.rbxm b/dist/bundle.rbxm deleted file mode 100644 index dbf8b1b6..00000000 Binary files a/dist/bundle.rbxm and /dev/null differ diff --git a/dist/models/dependencies.rbxm b/dist/models/dependencies.rbxm deleted file mode 100644 index 39687f4d..00000000 Binary files a/dist/models/dependencies.rbxm and /dev/null differ diff --git a/dist/models/lifecycles.rbxm b/dist/models/lifecycles.rbxm deleted file mode 100644 index bdb9c7f6..00000000 Binary files a/dist/models/lifecycles.rbxm and /dev/null differ diff --git a/dist/models/logger.rbxm b/dist/models/logger.rbxm deleted file mode 100644 index 31b211bd..00000000 Binary files a/dist/models/logger.rbxm and /dev/null differ diff --git a/dist/models/providers.rbxm b/dist/models/providers.rbxm deleted file mode 100644 index d283676e..00000000 Binary files a/dist/models/providers.rbxm and /dev/null differ diff --git a/dist/models/prvdmwrong.rbxm b/dist/models/prvdmwrong.rbxm deleted file mode 100644 index 90bb7a71..00000000 Binary files a/dist/models/prvdmwrong.rbxm and /dev/null differ diff --git a/dist/models/rbx-components.rbxm b/dist/models/rbx-components.rbxm deleted file mode 100644 index ca27a952..00000000 Binary files a/dist/models/rbx-components.rbxm and /dev/null differ diff --git a/dist/models/rbx-lifecycles.rbxm b/dist/models/rbx-lifecycles.rbxm deleted file mode 100644 index 3f1d199c..00000000 Binary files a/dist/models/rbx-lifecycles.rbxm and /dev/null differ diff --git a/dist/models/roots.rbxm b/dist/models/roots.rbxm deleted file mode 100644 index 121e8de1..00000000 Binary files a/dist/models/roots.rbxm and /dev/null differ diff --git a/dist/models/runtime.rbxm b/dist/models/runtime.rbxm deleted file mode 100644 index 6dc1306a..00000000 Binary files a/dist/models/runtime.rbxm and /dev/null differ diff --git a/dist/models/typecheckers.rbxm b/dist/models/typecheckers.rbxm deleted file mode 100644 index 5cd55bc9..00000000 Binary files a/dist/models/typecheckers.rbxm and /dev/null differ diff --git a/dist/npm/dependencies/LICENSE.md b/dist/npm/dependencies/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/npm/dependencies/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/npm/dependencies/lifecycles.luau b/dist/npm/dependencies/lifecycles.luau deleted file mode 100644 index 53ce025e..00000000 --- a/dist/npm/dependencies/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/npm/dependencies/logger.luau b/dist/npm/dependencies/logger.luau deleted file mode 100644 index 830f960c..00000000 --- a/dist/npm/dependencies/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./Packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/npm/dependencies/package.json b/dist/npm/dependencies/package.json deleted file mode 100644 index 57bd1000..00000000 --- a/dist/npm/dependencies/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "author": "Fire ", - "bugs": { - "url": "https://github.com/prvdmwrong/prvdmwrong/issues" - }, - "dependencies": { - "@prvdmwrong/lifecycles": "0.2.0-rc.4", - "@prvdmwrong/logger": "0.2.0-rc.4" - }, - "description": "Dependency resolution logic for Prvd 'M Wrong", - "files": [ - "src", - "LICENSE.md", - "package.json" - ], - "main": "src/init.luau", - "name": "@prvdmwrong/dependencies", - "repository": { - "type": "git", - "url": "git+https://github.com/prvdmwrong/prvdmwrong.git" - }, - "types": "src/init.luau", - "version": "0.2.0-rc.4" -} \ No newline at end of file diff --git a/dist/npm/dependencies/src/depend.luau b/dist/npm/dependencies/src/depend.luau deleted file mode 100644 index 55230b4e..00000000 --- a/dist/npm/dependencies/src/depend.luau +++ /dev/null @@ -1,30 +0,0 @@ -local logger = require("./logger") -local types = require("./types") - -local function useBeforeConstructed(unresolved: types.UnresolvedDependency) - logger:fatalError({ template = logger.useBeforeConstructed, unresolved.dependency.name or "subdependency" }) -end - -local unresolvedMt = { - __metatable = "This metatable is locked.", - __index = useBeforeConstructed, - __newindex = useBeforeConstructed, -} - -function unresolvedMt:__tostring() - return "UnresolvedDependency" -end - --- Wtf luau -local function depend(dependency: types.Dependency): typeof(({} :: types.Dependency).new( - (nil :: any) :: Dependencies, - ... -)) - -- Return a mock value that will be resolved during dependency resolution. - return setmetatable({ - type = "UnresolvedDependency", - dependency = dependency, - }, unresolvedMt) :: any -end - -return depend diff --git a/dist/npm/dependencies/src/index.d.ts b/dist/npm/dependencies/src/index.d.ts deleted file mode 100644 index 8d992015..00000000 --- a/dist/npm/dependencies/src/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Lifecycle } from "@prvdmwrong/lifecycles"; - -declare namespace dependencies { - export type Dependency = Self & { - dependencies: Dependencies, - priority?: number, - new(dependencies: Dependencies, ...args: NewArgs): Dependency; - }; - - interface ProccessDependencyResult { - sortedDependencies: Dependency[]; - lifecycles: Lifecycle[]; - } - - export type SubdependenciesOf = T extends { dependencies: infer Dependencies } - ? Dependencies - : never; - - export function depend InstanceType>(dependency: T): InstanceType; - export function processDependencies(dependencies: Set>): ProccessDependencyResult; - export function sortByPriority(dependencies: Dependency[]): void; -} - -export = dependencies; -export as namespace dependencies; diff --git a/dist/npm/dependencies/src/init.luau b/dist/npm/dependencies/src/init.luau deleted file mode 100644 index e6b27b24..00000000 --- a/dist/npm/dependencies/src/init.luau +++ /dev/null @@ -1,12 +0,0 @@ -local depend = require("@self/depend") -local processDependencies = require("@self/process-dependencies") -local sortByPriority = require("@self/sort-by-priority") -local types = require("@self/types") - -export type Dependency = types.Dependency - -return table.freeze({ - depend = depend, - processDependencies = processDependencies, - sortByPriority = sortByPriority, -}) diff --git a/dist/npm/dependencies/src/logger.luau b/dist/npm/dependencies/src/logger.luau deleted file mode 100644 index 22f3b307..00000000 --- a/dist/npm/dependencies/src/logger.luau +++ /dev/null @@ -1,7 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/dependencies", logger.standardErrorInfoUrl("dependencies"), { - useBeforeConstructed = "Cannot use %s before it is constructed. Are you using the dependency outside a class method?", - alreadyDestroyed = "Cannot destroy an already destroyed Root.", - alreadyFinished = "Root has already finished.", -}) diff --git a/dist/npm/dependencies/src/process-dependencies.spec.luau b/dist/npm/dependencies/src/process-dependencies.spec.luau deleted file mode 100644 index 0fcfcac8..00000000 --- a/dist/npm/dependencies/src/process-dependencies.spec.luau +++ /dev/null @@ -1,67 +0,0 @@ -local depend = require("./depend") -local processDependencies = require("./process-dependencies") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - -local function nickname(name: string) - return function(tbl: T): T - return setmetatable(tbl :: any, { - __tostring = function() - return name - end, - }) - end -end - -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("processDependencies", function() - test("sortedDependencies", function() - local first = nickname("first")({}) - - local second = nickname("second")({ - dependencies = { - toFirst = depend(first :: any), - toFirstAgain = depend(first :: any), - }, - }) - - local third = nickname("third")({ - dependencies = { - toSecond = depend(second :: any), - }, - }) - - local fourth = nickname("fourth")({ - dependencies = { - toFirst = depend(first :: any), - toSecond = depend(second :: any), - toThird = depend(third :: any), - }, - }) - - local processed = processDependencies({ - [first] = true, - [second] = true, - [third] = true, - [fourth] = true, - } :: any) - - expect(typeof(processed)).is("table") - expect(processed).has_key("sortedDependencies") - expect(typeof(processed.sortedDependencies)).is("table") - - local sortedDependencies = processed.sortedDependencies - - expect(typeof(sortedDependencies)).is("table") - expect(sortedDependencies[1]).is(first) - expect(sortedDependencies[2]).is(second) - expect(sortedDependencies[3]).is(third) - expect(sortedDependencies[4]).is(fourth) - end) - - test("lifecycles", function() end) - end) -end diff --git a/dist/npm/dependencies/src/sort-by-priority.luau b/dist/npm/dependencies/src/sort-by-priority.luau deleted file mode 100644 index 638468ab..00000000 --- a/dist/npm/dependencies/src/sort-by-priority.luau +++ /dev/null @@ -1,14 +0,0 @@ -local types = require("./types") - -local function sortByPriority(dependencies: { types.Dependency }) - table.sort(dependencies, function(left: any, right: any) - if left.priority ~= right.priority then - return (left.priority or 1) > (right.priority or 1) - end - local leftIndex = table.find(dependencies, left) - local rightIndex = table.find(dependencies, right) - return leftIndex < rightIndex - end) -end - -return sortByPriority diff --git a/dist/npm/dependencies/src/sort-by-priority.spec.luau b/dist/npm/dependencies/src/sort-by-priority.spec.luau deleted file mode 100644 index eeb34933..00000000 --- a/dist/npm/dependencies/src/sort-by-priority.spec.luau +++ /dev/null @@ -1,52 +0,0 @@ -local sortByPriority = require("./sort-by-priority") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("sortByPriority", function() - test("dependencies", function() - local first = {} - - local second = { - toFirst = first, - } - - local third = { - toSecond = second, - } - - local sortedDependencies = { - first, - second, - third, - } - - sortByPriority(sortedDependencies :: any) - - expect(sortedDependencies[1]).is(first) - expect(sortedDependencies[2]).is(second) - expect(sortedDependencies[3]).is(third) - end) - - test("priority", function() - local low = {} - - local high = { - priority = 500, - } - - local sortedDependencies = { - low, - high, - } - - sortByPriority(sortedDependencies :: any) - - expect(sortedDependencies[1]).is(high) - expect(sortedDependencies[2]).is(low) - end) - end) -end diff --git a/dist/npm/lifecycles/LICENSE.md b/dist/npm/lifecycles/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/npm/lifecycles/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/npm/lifecycles/logger.luau b/dist/npm/lifecycles/logger.luau deleted file mode 100644 index 830f960c..00000000 --- a/dist/npm/lifecycles/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./Packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/npm/lifecycles/package.json b/dist/npm/lifecycles/package.json deleted file mode 100644 index c8218ee0..00000000 --- a/dist/npm/lifecycles/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "author": "Fire ", - "bugs": { - "url": "https://github.com/prvdmwrong/prvdmwrong/issues" - }, - "dependencies": { - "@prvdmwrong/logger": "0.2.0-rc.4", - "@prvdmwrong/runtime": "0.2.0-rc.4" - }, - "description": "Provider method lifecycles implementation for Prvd 'M Wrong", - "files": [ - "src", - "LICENSE.md", - "package.json" - ], - "main": "src/init.luau", - "name": "@prvdmwrong/lifecycles", - "repository": { - "type": "git", - "url": "git+https://github.com/prvdmwrong/prvdmwrong.git" - }, - "types": "src/init.luau", - "version": "0.2.0-rc.4" -} \ No newline at end of file diff --git a/dist/npm/lifecycles/runtime.luau b/dist/npm/lifecycles/runtime.luau deleted file mode 100644 index c841cb44..00000000 --- a/dist/npm/lifecycles/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/npm/lifecycles/src/create.luau b/dist/npm/lifecycles/src/create.luau deleted file mode 100644 index 6cdd2891..00000000 --- a/dist/npm/lifecycles/src/create.luau +++ /dev/null @@ -1,45 +0,0 @@ -local await = require("./methods/await") -local clear = require("./methods/unregister-all") -local destroy = require("./methods/destroy") -local lifecycleConstructed = require("./hooks/lifecycle-constructed") -local methodToLifecycles = require("./method-to-lifecycles") -local onRegistered = require("./methods/on-registered") -local onUnregistered = require("./methods/on-unregistered") -local register = require("./methods/register") -local types = require("./types") -local unregister = require("./methods/unregister") - -local function create( - method: string, - onFire: (lifecycle: types.Lifecycle, Args...) -> () -): types.Lifecycle - local self: types.Self = { - _isDestroyed = false, - _selfRegistered = {}, - _selfUnregistered = {}, - - type = "Lifecycle", - callbacks = {}, - - fire = onFire, - method = method, - register = register, - unregister = unregister, - clear = clear, - onRegistered = onRegistered, - onUnregistered = onUnregistered, - await = await, - destroy = destroy, - } :: any - - methodToLifecycles[method] = methodToLifecycles[method] or {} - table.insert(methodToLifecycles[method], self) - - for _, onLifecycleConstructed in lifecycleConstructed.callbacks do - onLifecycleConstructed(self :: types.Lifecycle) - end - - return self -end - -return create diff --git a/dist/npm/lifecycles/src/index.d.ts b/dist/npm/lifecycles/src/index.d.ts deleted file mode 100644 index 0e5f324b..00000000 --- a/dist/npm/lifecycles/src/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -declare namespace lifecycles { - export interface Lifecycle { - type: "Lifecycle"; - - callbacks: Array<(...args: Args) => void>; - method: string; - - register(callback: (...args: Args) => void): void; - fire(...args: Args): void; - unregister(callback: (...args: Args) => void): void; - clear(): void; - onRegistered(listener: (callback: (...args: Args) => void) => void): () => void; - onUnegistered(listener: (callback: (...args: Args) => void) => void): () => void; - await(): LuaTuple; - destroy(): void; - } - - export function create( - method: string, - onFire: (lifecycle: Lifecycle, ...args: Args) => void - ): Lifecycle; - - export namespace handlers { - export function fireConcurrent(lifecycle: Lifecycle, ...args: Args): void; - export function fireSequential(lifecycle: Lifecycle, ...args: Args): void; - } - - export namespace hooks { - export function onLifecycleConstructed(callback: (lifecycle: Lifecycle) => void): () => void; - export function onLifecycleDestroyed(callback: (lifecycle: Lifecycle) => void): () => void; - export function onLifecycleRegistered( - callback: (lifecycle: Lifecycle, callback: (...args: Args) => void) => void - ): () => void; - export function onLifecycleUnregistered( - callback: (lifecycle: Lifecycle, callback: (...args: Args) => void) => void - ): () => void; - } - - export namespace _ { - export const methodToLifecycles: Map; - } -} - -export = lifecycles; -export as namespace lifecycles; diff --git a/dist/npm/lifecycles/src/init.luau b/dist/npm/lifecycles/src/init.luau deleted file mode 100644 index dbec091b..00000000 --- a/dist/npm/lifecycles/src/init.luau +++ /dev/null @@ -1,28 +0,0 @@ -local create = require("@self/create") -local fireConcurrent = require("@self/handlers/fire-concurrent") -local fireSequential = require("@self/handlers/fire-sequential") -local lifecycleConstructed = require("@self/hooks/lifecycle-constructed") -local lifecycleDestroyed = require("@self/hooks/lifecycle-destroyed") -local lifecycleRegistered = require("@self/hooks/lifecycle-registered") -local lifecycleUnregistered = require("@self/hooks/lifecycle-unregistered") -local methodToLifecycles = require("@self/method-to-lifecycles") -local types = require("@self/types") - -export type Lifecycle = types.Lifecycle - -return table.freeze({ - create = create, - handlers = table.freeze({ - fireConcurrent = fireConcurrent, - fireSequential = fireSequential, - }), - hooks = table.freeze({ - onLifecycleRegistered = lifecycleRegistered.onLifecycleRegistered, - onLifecycleUnregistered = lifecycleUnregistered.onLifecycleUnregistered, - onLifecycleConstructed = lifecycleConstructed.onLifecycleConstructed, - onLifecycleDestroyed = lifecycleDestroyed.onLifecycleDestroyed, - }), - _ = table.freeze({ - methodToLifecycles = methodToLifecycles, - }), -}) diff --git a/dist/npm/lifecycles/src/method-to-lifecycles.luau b/dist/npm/lifecycles/src/method-to-lifecycles.luau deleted file mode 100644 index 386a8756..00000000 --- a/dist/npm/lifecycles/src/method-to-lifecycles.luau +++ /dev/null @@ -1,5 +0,0 @@ -local types = require("./types") - -local methodToLifecycles: { [string]: { types.Lifecycle } } = {} - -return methodToLifecycles diff --git a/dist/npm/logger/LICENSE.md b/dist/npm/logger/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/npm/logger/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/npm/logger/package.json b/dist/npm/logger/package.json deleted file mode 100644 index b9954136..00000000 --- a/dist/npm/logger/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "author": "Fire ", - "bugs": { - "url": "https://github.com/prvdmwrong/prvdmwrong/issues" - }, - "dependencies": { - "@prvdmwrong/runtime": "0.2.0-rc.4" - }, - "description": "Logging for Prvd 'M Wrong", - "files": [ - "src", - "LICENSE.md", - "package.json" - ], - "main": "src/init.luau", - "name": "@prvdmwrong/logger", - "repository": { - "type": "git", - "url": "git+https://github.com/prvdmwrong/prvdmwrong.git" - }, - "types": "src/init.luau", - "version": "0.2.0-rc.4" -} \ No newline at end of file diff --git a/dist/npm/logger/runtime.luau b/dist/npm/logger/runtime.luau deleted file mode 100644 index c841cb44..00000000 --- a/dist/npm/logger/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/npm/logger/src/allow-web-links.luau b/dist/npm/logger/src/allow-web-links.luau deleted file mode 100644 index dcd0bb82..00000000 --- a/dist/npm/logger/src/allow-web-links.luau +++ /dev/null @@ -1,5 +0,0 @@ -local runtime = require("../runtime") - -local allowWebLinks = if runtime.name == "roblox" then game:GetService("RunService"):IsStudio() else true - -return allowWebLinks diff --git a/dist/npm/logger/src/create.luau b/dist/npm/logger/src/create.luau deleted file mode 100644 index 943aab25..00000000 --- a/dist/npm/logger/src/create.luau +++ /dev/null @@ -1,32 +0,0 @@ -local allowWebLinks = require("./allow-web-links") -local formatLog = require("./format-log") -local runtime = require("../runtime") -local types = require("./types") - -local task = runtime.task -local warn = runtime.warn - -local function create(label: string, errorInfoUrl: string?, templates: T): types.Logger - local self = {} :: types.Logger - self.type = "Logger" - - label = `[{label}] ` - errorInfoUrl = if allowWebLinks then errorInfoUrl else nil - - function self:warn(log) - warn(label .. formatLog(self, log, errorInfoUrl)) - end - - function self:error(log) - task.spawn(error, label .. formatLog(self, log, errorInfoUrl), 0) - end - - function self:fatalError(log) - error(label .. formatLog(self, log, errorInfoUrl)) - end - - setmetatable(self :: any, { __index = templates }) - return self -end - -return create diff --git a/dist/npm/logger/src/format-log.luau b/dist/npm/logger/src/format-log.luau deleted file mode 100644 index 3eeda21b..00000000 --- a/dist/npm/logger/src/format-log.luau +++ /dev/null @@ -1,43 +0,0 @@ -local types = require("./types") - -local function formatLog(self: types.Logger, log: types.Log, errorInfoUrl: string?): string - local formattedTemplate = string.format(log.template, table.unpack(log)) - - local error = log.error - local trace: string? = log.trace - - if error then - trace = error.trace - formattedTemplate = string.gsub(formattedTemplate, "ERROR_MESSAGE", error.message) - end - - local id: string? - - -- TODO: find a better way to do ts while still being ergonomic - for templateKey, template in (self :: any) :: { [string]: string } do - if template == log.template then - id = templateKey - break - end - end - - if id then - formattedTemplate ..= `\nID: {id}` - end - - if errorInfoUrl then - formattedTemplate ..= `\nLearn more: {errorInfoUrl}` - if id then - formattedTemplate ..= `#{string.lower(id)}` - end - end - - if trace then - formattedTemplate ..= `\n---- Stack trace ----\n{trace}` - end - - -- Labels are added from createLogger, so we don't add it here - return string.gsub(formattedTemplate, "\n", "\n ") -end - -return formatLog diff --git a/dist/npm/logger/src/index.d.ts b/dist/npm/logger/src/index.d.ts deleted file mode 100644 index 85251a07..00000000 --- a/dist/npm/logger/src/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -declare namespace Logger { - export interface Error { - type: "Error"; - raw: string; - message: string; - trace: string; - } - - interface LogProps { - template: string; - error?: Error; - trace?: string; - } - - export type Log = LogProps & unknown[]; - - interface LoggerProps { - print(props: Log): void; - warn(props: Log): void; - error(props: Log): void; - fatalError(props: Log): never; - } - - export type Logger> = LoggerProps & Templates; - - export function create>( - label: string, - errorInfoUrl: string | undefined, - templates: Templates - ): Logger; - - export function formatLog>( - logger: Logger, - log: Log, - errorInfoUrl?: string - ): string; - - export function parseError(err: string): Error; - - export const allowWebLinks: boolean; - export function standardErrorInfoUrl(label: string): string; -} - -export = Logger; -export as namespace Logger; diff --git a/dist/npm/logger/src/init.luau b/dist/npm/logger/src/init.luau deleted file mode 100644 index 52760a5d..00000000 --- a/dist/npm/logger/src/init.luau +++ /dev/null @@ -1,18 +0,0 @@ -local allowWebLinks = require("@self/allow-web-links") -local create = require("@self/create") -local formatLog = require("@self/format-log") -local parseError = require("@self/parse-error") -local standardErrorInfoUrl = require("@self/standard-error-info-url") -local types = require("@self/types") - -export type Logger = types.Logger -export type Log = types.Log -export type Error = types.Error - -return table.freeze({ - create = create, - formatLog = formatLog, - parseError = parseError, - allowWebLinks = allowWebLinks, - standardErrorInfoUrl = standardErrorInfoUrl, -}) diff --git a/dist/npm/logger/src/parse-error.luau b/dist/npm/logger/src/parse-error.luau deleted file mode 100644 index e43fe53d..00000000 --- a/dist/npm/logger/src/parse-error.luau +++ /dev/null @@ -1,12 +0,0 @@ -local types = require("./types") - -local function parseError(err: string): types.Error - return { - type = "Error", - raw = err, - message = err:gsub("^.+:%d+:%s*", ""), - trace = debug.traceback(nil, 2), - } -end - -return parseError diff --git a/dist/npm/providers/LICENSE.md b/dist/npm/providers/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/npm/providers/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/npm/providers/dependencies.luau b/dist/npm/providers/dependencies.luau deleted file mode 100644 index c11c4469..00000000 --- a/dist/npm/providers/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/npm/providers/lifecycles.luau b/dist/npm/providers/lifecycles.luau deleted file mode 100644 index 53ce025e..00000000 --- a/dist/npm/providers/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/npm/providers/logger.luau b/dist/npm/providers/logger.luau deleted file mode 100644 index 830f960c..00000000 --- a/dist/npm/providers/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./Packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/npm/providers/package.json b/dist/npm/providers/package.json deleted file mode 100644 index 37cbe6b4..00000000 --- a/dist/npm/providers/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "author": "Fire ", - "bugs": { - "url": "https://github.com/prvdmwrong/prvdmwrong/issues" - }, - "dependencies": { - "@prvdmwrong/dependencies": "0.2.0-rc.4", - "@prvdmwrong/lifecycles": "0.2.0-rc.4", - "@prvdmwrong/logger": "0.2.0-rc.4", - "@prvdmwrong/runtime": "0.2.0-rc.4" - }, - "description": "Provider creation for Prvd 'M Wrong", - "files": [ - "src", - "LICENSE.md", - "package.json" - ], - "main": "src/init.luau", - "name": "@prvdmwrong/providers", - "repository": { - "type": "git", - "url": "git+https://github.com/prvdmwrong/prvdmwrong.git" - }, - "types": "src/init.luau", - "version": "0.2.0-rc.4" -} \ No newline at end of file diff --git a/dist/npm/providers/runtime.luau b/dist/npm/providers/runtime.luau deleted file mode 100644 index c841cb44..00000000 --- a/dist/npm/providers/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/npm/providers/src/create.luau b/dist/npm/providers/src/create.luau deleted file mode 100644 index 016b8a6d..00000000 --- a/dist/npm/providers/src/create.luau +++ /dev/null @@ -1,30 +0,0 @@ -local nameOf = require("./name-of") -local providerClasses = require("./provider-classes") -local types = require("./types") - -local function createProvider(self: Self): types.Provider - local provider: types.Provider = self :: any - - if provider.__index == nil then - provider.__index = provider - end - - if provider.__tostring == nil then - provider.__tostring = nameOf - end - - if provider.new == nil then - function provider.new(dependencies) - local self: types.Provider = setmetatable({}, provider) :: any - if provider.constructor then - return provider.constructor(self, dependencies) or self - end - return self - end - end - - providerClasses[provider] = true - return provider -end - -return createProvider diff --git a/dist/npm/providers/src/index.d.ts b/dist/npm/providers/src/index.d.ts deleted file mode 100644 index 410e31c5..00000000 --- a/dist/npm/providers/src/index.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Dependency } from "@prvdmwrong/dependencies"; - -declare namespace providers { - export type Provider = Dependency< - Self & { - __index: Provider; - name?: string; - constructor?(dependencies: Dependencies): void; - start?(): void; - destroy?(): void; - }, - Dependencies - >; - - // Class decorator syntax - export function create InstanceType>(self: Self): Provider; - // Normal syntax - export function create(self: Self): Provider; - - export function nameOf(provider: Provider): string; - - export namespace _ { - export const providerClasses: Set>; - } - - export interface Start { - start(): void; - } - - export interface Destroy { - destroy(): void; - } -} - -export = providers; -export as namespace providers; diff --git a/dist/npm/providers/src/init.luau b/dist/npm/providers/src/init.luau deleted file mode 100644 index d678d850..00000000 --- a/dist/npm/providers/src/init.luau +++ /dev/null @@ -1,16 +0,0 @@ -local create = require("@self/create") -local nameOf = require("@self/name-of") -local providerClasses = require("@self/provider-classes") -local types = require("@self/types") - -export type Provider = types.Provider - -local providers = table.freeze({ - create = create, - nameOf = nameOf, - _ = table.freeze({ - providerClasses = providerClasses, - }), -}) - -return providers diff --git a/dist/npm/providers/src/name-of.luau b/dist/npm/providers/src/name-of.luau deleted file mode 100644 index 3f86ceec..00000000 --- a/dist/npm/providers/src/name-of.luau +++ /dev/null @@ -1,7 +0,0 @@ -local types = require("./types") - -local function nameOf(provider: types.Provider) - return provider.name or "Provider" -end - -return nameOf diff --git a/dist/npm/prvdmwrong/LICENSE.md b/dist/npm/prvdmwrong/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/npm/prvdmwrong/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/npm/prvdmwrong/dependencies.luau b/dist/npm/prvdmwrong/dependencies.luau deleted file mode 100644 index c11c4469..00000000 --- a/dist/npm/prvdmwrong/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/npm/prvdmwrong/lifecycles.luau b/dist/npm/prvdmwrong/lifecycles.luau deleted file mode 100644 index 53ce025e..00000000 --- a/dist/npm/prvdmwrong/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/npm/prvdmwrong/package.json b/dist/npm/prvdmwrong/package.json deleted file mode 100644 index 9ebac38e..00000000 --- a/dist/npm/prvdmwrong/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "author": "Fire ", - "bugs": { - "url": "https://github.com/prvdmwrong/prvdmwrong/issues" - }, - "dependencies": { - "@prvdmwrong/dependencies": "0.2.0-rc.4", - "@prvdmwrong/lifecycles": "0.2.0-rc.4", - "@prvdmwrong/providers": "0.2.0-rc.4", - "@prvdmwrong/roots": "0.2.0-rc.4" - }, - "description": "Entry point to Prvd 'M Wrong", - "files": [ - "src", - "LICENSE.md", - "package.json" - ], - "main": "src/init.luau", - "name": "@prvdmwrong/prvdmwrong", - "repository": { - "type": "git", - "url": "git+https://github.com/prvdmwrong/prvdmwrong.git" - }, - "types": "src/init.luau", - "version": "0.2.0-rc.4" -} \ No newline at end of file diff --git a/dist/npm/prvdmwrong/providers.luau b/dist/npm/prvdmwrong/providers.luau deleted file mode 100644 index dd417a75..00000000 --- a/dist/npm/prvdmwrong/providers.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/providers") -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/npm/prvdmwrong/roots.luau b/dist/npm/prvdmwrong/roots.luau deleted file mode 100644 index c606c7bd..00000000 --- a/dist/npm/prvdmwrong/roots.luau +++ /dev/null @@ -1,4 +0,0 @@ -local DEPENDENCY = require("./Packages/roots") -export type Root = DEPENDENCY.Root -export type StartedRoot = DEPENDENCY.StartedRoot -return DEPENDENCY diff --git a/dist/npm/prvdmwrong/src/index.d.ts b/dist/npm/prvdmwrong/src/index.d.ts deleted file mode 100644 index 4200df79..00000000 --- a/dist/npm/prvdmwrong/src/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import dependencies from "@prvdmwrong/dependencies"; -import lifecycles from "@prvdmwrong/lifecycles"; -import providers from "@prvdmwrong/providers"; -import roots from "@prvdmwrong/roots"; - -declare namespace prvd { - export type Provider = providers.Provider; - export interface Lifecycle extends lifecycles.Lifecycle { } - export type SubdependenciesOf = dependencies.SubdependenciesOf; - export interface Root extends roots.Root { } - export interface StartedRoot extends roots.StartedRoot { } - - export interface Start extends providers.Start { } - export interface Destroy extends providers.Destroy { } - - export const provider: typeof providers.create; - export const root: typeof roots.create; - export const depend: typeof dependencies.depend; - export const nameOf: typeof providers.nameOf; - - export const lifecycle: typeof lifecycles.create; - export const fireConcurrent: typeof lifecycles.handlers.fireConcurrent; - export const fireSequential: typeof lifecycles.handlers.fireSequential; - - export namespace hooks { - export const onLifecycleConstructed: typeof lifecycles.hooks.onLifecycleConstructed; - export const onLifecycleDestroyed: typeof lifecycles.hooks.onLifecycleDestroyed; - export const onLifecycleRegistered: typeof lifecycles.hooks.onLifecycleRegistered; - export const onLifecycleUnregistered: typeof lifecycles.hooks.onLifecycleUnregistered; - - export const onLifecycleUsed: typeof roots.hooks.onLifecycleUsed; - export const onProviderUsed: typeof roots.hooks.onProviderUsed; - export const onRootUsed: typeof roots.hooks.onRootUsed; - export const onRootConstructing: typeof roots.hooks.onRootConstructing; - export const onRootStarted: typeof roots.hooks.onRootStarted; - export const onRootFinished: typeof roots.hooks.onRootFinished; - export const onRootDestroyed: typeof roots.hooks.onRootDestroyed; - } -} - -export = prvd; -export as namespace prvd; diff --git a/dist/npm/prvdmwrong/src/init.luau b/dist/npm/prvdmwrong/src/init.luau deleted file mode 100644 index 1381801d..00000000 --- a/dist/npm/prvdmwrong/src/init.luau +++ /dev/null @@ -1,45 +0,0 @@ -local dependencies = require("./dependencies") -local lifecycles = require("./lifecycles") -local providers = require("./providers") -local roots = require("./roots") - -export type Provider = providers.Provider -export type Lifecycle = lifecycles.Lifecycle -export type Root = roots.Root -export type StartedRoot = roots.StartedRoot - -local prvd = { - provider = providers.create, - root = roots.create, - depend = dependencies.depend, - nameOf = providers.nameOf, - - lifecycle = lifecycles.create, - fireConcurrent = lifecycles.handlers.fireConcurrent, - fireSequential = lifecycles.handlers.fireSequential, - - hooks = table.freeze({ - onProviderUsed = roots.hooks.onProviderUsed, - onLifecycleUsed = roots.hooks.onLifecycleUsed, - onRootConstructing = roots.hooks.onRootConstructing, - onRootUsed = roots.hooks.onRootUsed, - onRootStarted = roots.hooks.onRootStarted, - onRootFinished = roots.hooks.onRootFinished, - onRootDestroyed = roots.hooks.onRootDestroyed, - - onLifecycleConstructed = lifecycles.hooks.onLifecycleConstructed, - onLifecycleDestroyed = lifecycles.hooks.onLifecycleDestroyed, - onLifecycleRegistered = lifecycles.hooks.onLifecycleRegistered, - onLifecycleUnregistered = lifecycles.hooks.onLifecycleUnregistered, - }), -} - -type PrvdModule = ((provider: Self) -> Provider) & typeof(prvd) - -local mt = {} -function mt.__call(_, provider: Self): providers.Provider - return providers.create(provider) :: any -end - -local module: PrvdModule = setmetatable(prvd, mt) :: any -return module diff --git a/dist/npm/rbx-components/LICENSE.md b/dist/npm/rbx-components/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/npm/rbx-components/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/npm/rbx-components/dependencies.luau b/dist/npm/rbx-components/dependencies.luau deleted file mode 100644 index c11c4469..00000000 --- a/dist/npm/rbx-components/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/npm/rbx-components/logger.luau b/dist/npm/rbx-components/logger.luau deleted file mode 100644 index 830f960c..00000000 --- a/dist/npm/rbx-components/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./Packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/npm/rbx-components/package.json b/dist/npm/rbx-components/package.json deleted file mode 100644 index f7343109..00000000 --- a/dist/npm/rbx-components/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "author": "Fire ", - "bugs": { - "url": "https://github.com/prvdmwrong/prvdmwrong/issues" - }, - "dependencies": { - "@prvdmwrong/dependencies": "0.2.0-rc.4", - "@prvdmwrong/logger": "0.2.0-rc.4", - "@prvdmwrong/providers": "0.2.0-rc.4", - "@prvdmwrong/roots": "0.2.0-rc.4" - }, - "description": "Component functionality for Prvd 'M Wrong", - "files": [ - "src", - "LICENSE.md", - "package.json" - ], - "main": "src/init.luau", - "name": "@prvdmwrong/rbx-components", - "repository": { - "type": "git", - "url": "git+https://github.com/prvdmwrong/prvdmwrong.git" - }, - "types": "src/init.luau", - "version": "0.2.0-rc.4" -} \ No newline at end of file diff --git a/dist/npm/rbx-components/providers.luau b/dist/npm/rbx-components/providers.luau deleted file mode 100644 index dd417a75..00000000 --- a/dist/npm/rbx-components/providers.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/providers") -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/npm/rbx-components/roots.luau b/dist/npm/rbx-components/roots.luau deleted file mode 100644 index c606c7bd..00000000 --- a/dist/npm/rbx-components/roots.luau +++ /dev/null @@ -1,4 +0,0 @@ -local DEPENDENCY = require("./Packages/roots") -export type Root = DEPENDENCY.Root -export type StartedRoot = DEPENDENCY.StartedRoot -return DEPENDENCY diff --git a/dist/npm/rbx-components/src/component-classes.luau b/dist/npm/rbx-components/src/component-classes.luau deleted file mode 100644 index 0dcdb30a..00000000 --- a/dist/npm/rbx-components/src/component-classes.luau +++ /dev/null @@ -1,7 +0,0 @@ -local types = require("./types") - -type Set = { [T]: true } - -local componentClasses: Set> = setmetatable({}, { __mode = "k" }) :: any - -return componentClasses diff --git a/dist/npm/rbx-components/src/component-provider.luau b/dist/npm/rbx-components/src/component-provider.luau deleted file mode 100644 index 85af0d0d..00000000 --- a/dist/npm/rbx-components/src/component-provider.luau +++ /dev/null @@ -1,185 +0,0 @@ -local CollectionService = game:GetService("CollectionService") - -local componentClasses = require("./component-classes") -local logger = require("./logger") -local providers = require("../providers") -local runtime = require("../runtime") -local types = require("./types") - -local threadpool = runtime.threadpool - -type Set = { [T]: true } -type ConstructedComponent = types.AnyComponent -type LuauBug = any - -local ComponentProvider = {} -ComponentProvider.priority = -math.huge -ComponentProvider.name = "@rbx-components" - -function ComponentProvider.constructor(self: ComponentProvider) - self.componentClasses = {} :: Set - self.tagToComponentClasses = {} :: { [string]: Set } - self.instanceToComponents = {} :: { [Instance]: { [types.AnyComponent]: ConstructedComponent } } - self.componentToInstances = {} :: { [types.AnyComponent]: Set? } - self.constructedToClass = {} :: { [ConstructedComponent]: types.AnyComponent? } - - self._destroyingConnections = {} :: { [Instance]: RBXScriptConnection } - self._connections = {} :: { RBXScriptConnection } -end - -function ComponentProvider.start(self: ComponentProvider) - for tag, components in self.tagToComponentClasses do - local function onTagAdded(instance) - local instanceToComponents = self.instanceToComponents[instance] - if not instanceToComponents then - instanceToComponents = {} - self.instanceToComponents[instance] = instanceToComponents - end - - for componentClass in components do - if - (componentClass.blacklistInstances and (componentClass.blacklistInstances :: LuauBug)[instance]) - or (componentClass.whitelistInstances and not (componentClass.whitelistInstances :: LuauBug)[instance]) - or (componentClass.instanceCheck and not componentClass.instanceCheck(instance)) - then - continue - end - - local component: ConstructedComponent = instanceToComponents[componentClass] - if not component then - component = componentClass.new(instance) - instanceToComponents[componentClass] = component - self.constructedToClass[component :: any] = componentClass - end - - if component.added then - component:added() - end - end - - if not self._destroyingConnections[instance] then - self._destroyingConnections[instance] = instance.Destroying:Once(function() - for _, component in instanceToComponents do - if component.destroy then - threadpool.spawn(component.destroy, component) - end - end - table.clear(instanceToComponents) - self.instanceToComponents[instance] = nil - end) - end - end - - table.insert(self._connections, CollectionService:GetInstanceAddedSignal(tag):Connect(onTagAdded)) - table.insert(self._connections, CollectionService:GetInstanceRemovedSignal(tag):Connect(function(instance) end)) - - for _, instance in CollectionService:GetTagged(tag) do - onTagAdded(instance) - end - end -end - -function ComponentProvider.destroy(self: ComponentProvider) - for _, components in self.instanceToComponents do - for _, component in components do - if component.destroy then - component:destroy() - end - end - table.clear(components) - end - - table.clear(self.componentClasses) - table.clear(self.tagToComponentClasses) - table.clear(self.instanceToComponents) - table.clear(self.componentToInstances) - table.clear(self.constructedToClass) - - for _, connection in self._connections do - if connection.Connected then - connection:Disconnect() - end - end - - for _, connection in self._destroyingConnections do - if connection.Connected then - connection:Disconnect() - end - end - - table.clear(self._connections) - table.clear(self._destroyingConnections) -end - -function ComponentProvider.addComponentClass(self: ComponentProvider, class: types.AnyComponent) - if not componentClasses[class] then - logger:fatalError({ template = logger.invalidComponent }) - end - - if self.componentClasses[class] then - logger:fatalError({ template = logger.alreadyRegisteredComponent }) - end - - if class.tag then - local tagToComponentClasses = self.tagToComponentClasses[class.tag] - - if tagToComponentClasses then - if not _G.PRVDMWRONG_SUPPRESS_MULTIPLE_SAME_TAG and #tagToComponentClasses > 0 then - logger:warn({ template = logger.multipleSameTag, class.tag }) - end - else - tagToComponentClasses = {} - self.tagToComponentClasses[class.tag] = tagToComponentClasses - end - - (tagToComponentClasses :: any)[class] = true - end - - self.componentClasses[class] = true - self.componentToInstances[class] = {} -end - -function ComponentProvider.getFromInstance( - self: ComponentProvider, - class: types.Component, - instance: I -): types.Component? - return self.instanceToComponents[instance :: any][class] -end - -function ComponentProvider.getAllComponents( - self: ComponentProvider, - class: types.Component -): Set> - local result = {} - for _, components in self.instanceToComponents do - for _, component in components do - if self.constructedToClass[component] == class then - result[component] = true - end - end - end - return result :: any -end - -function ComponentProvider.addComponent( - self: ComponentProvider, - class: types.Component, - instance: I -): types.Component? - error("not yet implemented") -end - -function ComponentProvider.removeComponent(self: ComponentProvider, class: types.Component, instance: I) - local constructed = self:getFromInstance(class, instance) - if constructed then - self.instanceToComponents[instance :: any][class] = nil - - if constructed.removed then - threadpool.spawn(constructed.removed :: any, constructed, instance) - end - end -end - -export type ComponentProvider = typeof(ComponentProvider) -return providers.create(ComponentProvider) diff --git a/dist/npm/rbx-components/src/create.luau b/dist/npm/rbx-components/src/create.luau deleted file mode 100644 index 24d39a3b..00000000 --- a/dist/npm/rbx-components/src/create.luau +++ /dev/null @@ -1,28 +0,0 @@ -local componentClasses = require("./component-classes") -local types = require("./types") - --- TODO: prvdmwrong/classes package? -local function create(self: Self): types.Component - local component: types.Component = self :: any - - if component.__index == nil then - component.__index = component - end - - -- TODO: abstract nameOf - - if component.new == nil then - function component.new(instance: any) - local self: types.Component = setmetatable({}, component) :: any - if component.constructor then - return component.constructor(self, instance) or self - end - return self - end - end - - componentClasses[component] = true - return component -end - -return create diff --git a/dist/npm/rbx-components/src/logger.luau b/dist/npm/rbx-components/src/logger.luau deleted file mode 100644 index edcc7fac..00000000 --- a/dist/npm/rbx-components/src/logger.luau +++ /dev/null @@ -1,8 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/rbx-components", logger.standardErrorInfoUrl("rbx-components"), { - alreadyExtendedRoot = "Root already has component extension.", - invalidComponent = "Not a component, create one with `components(MyComponent)` or `components.create(MyComponent)`.", - alreadyRegisteredComponent = "Component already registered.", - multipleSameTag = "Multiple components use the CollectionService tag '%s', which is likely a mistake. Supress this warning with `_G.PRVDMWRONG_SUPPRESS_MULTIPLE_SAME_TAG = true`.", -}) diff --git a/dist/npm/rbx-components/src/types.luau b/dist/npm/rbx-components/src/types.luau deleted file mode 100644 index 5bc17dcf..00000000 --- a/dist/npm/rbx-components/src/types.luau +++ /dev/null @@ -1,30 +0,0 @@ -local dependencies = require("../dependencies") -local roots = require("../roots") - -export type Component = dependencies.Dependency, - tag: string?, - instanceCheck: (unknown) -> boolean, - blacklistInstances: { Instance }?, - whitelistInstances: { Instance }?, - constructor: (self: Component, instance: Instance) -> ()?, - added: (self: Component) -> ()?, - removed: (self: Component) -> ()?, - destroyed: (self: Component) -> ()?, -}, nil, Instance> - -export type Root = roots.Root & { - useModuleAsComponent: (root: Root, module: ModuleScript) -> Root, - useModulesAsComponents: (root: Root, modules: { Instance }, predicate: ((ModuleScript) -> boolean)?) -> Root, - useComponent: (root: Root, component: Component) -> Root, - useComponents: (root: Root, components: { Component }) -> Root, -} - -export type RootPrivate = Root & { - _hasComponentExtensions: true?, - _classes: { Component }, -} - -export type AnyComponent = Component - -return nil diff --git a/dist/npm/rbx-lifecycles/LICENSE.md b/dist/npm/rbx-lifecycles/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/npm/rbx-lifecycles/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/npm/rbx-lifecycles/package.json b/dist/npm/rbx-lifecycles/package.json deleted file mode 100644 index 3dffc1ae..00000000 --- a/dist/npm/rbx-lifecycles/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "author": "Fire ", - "bugs": { - "url": "https://github.com/prvdmwrong/prvdmwrong/issues" - }, - "dependencies": { - "@prvdmwrong/prvdmwrong": "0.2.0-rc.4" - }, - "description": "Lifecycles implementations for Roblox", - "files": [ - "src", - "LICENSE.md", - "package.json" - ], - "main": "src/init.luau", - "name": "@prvdmwrong/rbx-lifecycles", - "repository": { - "type": "git", - "url": "git+https://github.com/prvdmwrong/prvdmwrong.git" - }, - "types": "src/init.luau", - "version": "0.2.0-rc.4" -} \ No newline at end of file diff --git a/dist/npm/rbx-lifecycles/prvdmwrong.luau b/dist/npm/rbx-lifecycles/prvdmwrong.luau deleted file mode 100644 index 6f986dff..00000000 --- a/dist/npm/rbx-lifecycles/prvdmwrong.luau +++ /dev/null @@ -1,6 +0,0 @@ -local DEPENDENCY = require("./Packages/prvdmwrong") -export type Root = DEPENDENCY.Root -export type Lifecycle = DEPENDENCY.Lifecycle -export type StartedRoot = DEPENDENCY.StartedRoot -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/npm/rbx-lifecycles/src/index.d.ts b/dist/npm/rbx-lifecycles/src/index.d.ts deleted file mode 100644 index 98361bf5..00000000 --- a/dist/npm/rbx-lifecycles/src/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Lifecycle } from "@prvdmwrong/lifecycles"; -import { Provider } from "@prvdmwrong/providers"; - -declare namespace RbxLifecycles { - export const RbxLifecycles: Provider<{ - preSimulation: Lifecycle<[dt: number]>; - postSimulation: Lifecycle<[dt: number]>; - preAnimation: Lifecycle<[dt: number]>; - preRender: Lifecycle<[dt: number]>; - playerAdded: Lifecycle<[player: Player]>; - playerRemoving: Lifecycle<[player: Player]>; - }>; - - export interface PreSimulation { - preSimulation(dt: number): void; - } - - export interface PostSimulation { - postSimulation(dt: number): void; - } - - export interface PreAnimation { - preAnimation(dt: number): void; - } - - export interface PreRender { - preRender(dt: number): void; - } - - export interface PlayerAdded { - playerAdded(player: Player): void; - } - - export interface PlayerRemoving { - playerRemoving(player: Player): void; - } -} - -export = RbxLifecycles; -export as namespace RbxLifecycles; diff --git a/dist/npm/rbx-lifecycles/src/init.luau b/dist/npm/rbx-lifecycles/src/init.luau deleted file mode 100644 index c1243680..00000000 --- a/dist/npm/rbx-lifecycles/src/init.luau +++ /dev/null @@ -1,67 +0,0 @@ -local Players = game:GetService("Players") -local RunService = game:GetService("RunService") - -local prvd = require("./prvdmwrong") - -local fireConcurrent = prvd.fireConcurrent - -local RbxLifecycles = {} -RbxLifecycles.name = "@prvdmwrong/rbx-lifecycles" -RbxLifecycles.priority = -math.huge - -RbxLifecycles.preSimulation = prvd.lifecycle("preSimulation", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.postSimulation = prvd.lifecycle("postSimulation", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.preAnimation = prvd.lifecycle("preAnimation", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.preRender = prvd.lifecycle("preRender", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.playerAdded = prvd.lifecycle("playerAdded", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.playerRemoving = prvd.lifecycle("playerRemoving", fireConcurrent) :: prvd.Lifecycle - -local function wrapLifecycle(lifecycle: prvd.Lifecycle<...unknown>) - return function(...: unknown) - lifecycle:fire(...) - end -end - -function RbxLifecycles.constructor(self: RbxLifecycles) - self.connections = {} :: { RBXScriptConnection } - - self:_addConnections( - RunService.PreSimulation:Connect(wrapLifecycle(RbxLifecycles.preSimulation :: any)), - RunService.PostSimulation:Connect(wrapLifecycle(RbxLifecycles.postSimulation :: any)), - RunService.PreAnimation:Connect(wrapLifecycle(RbxLifecycles.preAnimation :: any)) - ) - - if RunService:IsClient() then - self:_addConnections(RunService.PreRender:Connect(wrapLifecycle(RbxLifecycles.preRender :: any))) - end - - self:_addConnections( - Players.PlayerAdded:Connect(wrapLifecycle(RbxLifecycles.playerAdded :: any)), - Players.PlayerRemoving:Connect(wrapLifecycle(RbxLifecycles.playerRemoving :: any)) - ) -end - -function RbxLifecycles.finish(self: RbxLifecycles) - for _, connection in self.connections do - if connection.Connected then - connection:Disconnect() - end - end - table.clear(self.connections) -end - -function RbxLifecycles._addConnections(self: RbxLifecycles, ...: RBXScriptConnection) - for index = 1, select("#", ...) do - table.insert(self.connections, select(index, ...) :: any) - end -end - --- Needed so typescript can require the provider as: --- --- ```ts --- import { RbxLifecycles } from "@rbxts/rbx-lifecycles" --- ``` -RbxLifecycles.RbxLifecycles = RbxLifecycles - -export type RbxLifecycles = typeof(RbxLifecycles) -return prvd(RbxLifecycles) diff --git a/dist/npm/roots/LICENSE.md b/dist/npm/roots/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/npm/roots/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/npm/roots/dependencies.luau b/dist/npm/roots/dependencies.luau deleted file mode 100644 index c11c4469..00000000 --- a/dist/npm/roots/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/npm/roots/lifecycles.luau b/dist/npm/roots/lifecycles.luau deleted file mode 100644 index 53ce025e..00000000 --- a/dist/npm/roots/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/npm/roots/logger.luau b/dist/npm/roots/logger.luau deleted file mode 100644 index 830f960c..00000000 --- a/dist/npm/roots/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./Packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/npm/roots/package.json b/dist/npm/roots/package.json deleted file mode 100644 index a65ab21b..00000000 --- a/dist/npm/roots/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "author": "Fire ", - "bugs": { - "url": "https://github.com/prvdmwrong/prvdmwrong/issues" - }, - "dependencies": { - "@prvdmwrong/dependencies": "0.2.0-rc.4", - "@prvdmwrong/lifecycles": "0.2.0-rc.4", - "@prvdmwrong/logger": "0.2.0-rc.4", - "@prvdmwrong/providers": "0.2.0-rc.4", - "@prvdmwrong/runtime": "0.2.0-rc.4" - }, - "description": "Roots implementation for Prvd 'M Wrong", - "files": [ - "src", - "LICENSE.md", - "package.json" - ], - "main": "src/init.luau", - "name": "@prvdmwrong/roots", - "repository": { - "type": "git", - "url": "git+https://github.com/prvdmwrong/prvdmwrong.git" - }, - "types": "src/init.luau", - "version": "0.2.0-rc.4" -} \ No newline at end of file diff --git a/dist/npm/roots/providers.luau b/dist/npm/roots/providers.luau deleted file mode 100644 index dd417a75..00000000 --- a/dist/npm/roots/providers.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/providers") -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/npm/roots/runtime.luau b/dist/npm/roots/runtime.luau deleted file mode 100644 index c841cb44..00000000 --- a/dist/npm/roots/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/npm/roots/src/create.luau b/dist/npm/roots/src/create.luau deleted file mode 100644 index 26c14f4e..00000000 --- a/dist/npm/roots/src/create.luau +++ /dev/null @@ -1,47 +0,0 @@ -local destroy = require("./methods/destroy") -local lifecycles = require("../lifecycles") -local rootConstructing = require("./hooks/root-constructing") -local start = require("./methods/start") -local types = require("./types") -local useModule = require("./methods/use-module") -local useModules = require("./methods/use-modules") -local useProvider = require("./methods/use-provider") -local useProviders = require("./methods/use-providers") -local useRoot = require("./methods/use-root") -local useRoots = require("./methods/use-roots") -local willFinish = require("./methods/will-finish") -local willStart = require("./methods/will-start") - -local function create(): types.Root - local self: types.Self = { - type = "Root", - - start = start, - - useProvider = useProvider, - useProviders = useProviders, - useModule = useModule, - useModules = useModules, - useRoot = useRoot, - useRoots = useRoots, - destroy = destroy, - - willStart = willStart, - willFinish = willFinish, - - _destroyed = false, - _rootProviders = {}, - _rootLifecycles = {}, - _subRoots = {}, - _start = lifecycles.create("start", lifecycles.handlers.fireConcurrent), - _finish = lifecycles.create("destroy", lifecycles.handlers.fireSequential), - } :: any - - for _, callback in rootConstructing.callbacks do - callback(self) - end - - return self -end - -return create diff --git a/dist/npm/roots/src/index.d.ts b/dist/npm/roots/src/index.d.ts deleted file mode 100644 index 6fadb025..00000000 --- a/dist/npm/roots/src/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Lifecycle } from "@prvdmwrong/lifecycles"; -import { Provider } from "@prvdmwrong/providers"; - -declare namespace roots { - export type Root = { - type: "Root"; - - start(): StartedRoot; - - useModule(module: ModuleScript): Root; - useModules(modules: Instance[], predicate?: (module: ModuleScript) => boolean): Root; - useRoot(root: Root): Root; - useRoots(roots: Root[]): Root; - useProvider(provider: Provider): Root; - useProviders(providers: Provider[]): Root; - useLifecycle(lifecycle: Lifecycle): Root; - useLifecycles(lifecycles: Lifecycle): Root; - destroy(): void; - - willStart(callback: () => void): Root; - willFinish(callback: () => void): Root; - }; - - export type StartedRoot = { - type: "StartedRoot"; - - finish(): void; - }; - - export function create(): Root; - - export namespace hooks { - export function onLifecycleUsed(listener: (lifecycle: Lifecycle) => void): () => void; - export function onProviderUsed(listener: (provider: Provider) => void): () => void; - export function onRootUsed(listener: (root: Root, subRoot: Root) => void): () => void; - - export function onRootConstructing(listener: (root: Root) => void): () => void; - export function onRootStarted(listener: (root: Root) => void): () => void; - export function onRootFinished(listener: (root: Root) => void): () => void; - export function onRootDestroyed(listener: (root: Root) => void): () => void; - } -} - -export = roots; -export as namespace roots; diff --git a/dist/npm/roots/src/init.luau b/dist/npm/roots/src/init.luau deleted file mode 100644 index f6aa7495..00000000 --- a/dist/npm/roots/src/init.luau +++ /dev/null @@ -1,28 +0,0 @@ -local create = require("@self/create") -local lifecycleUsed = require("@self/hooks/lifecycle-used") -local providerUsed = require("@self/hooks/provider-used") -local rootConstructing = require("@self/hooks/root-constructing") -local rootDestroyed = require("@self/hooks/root-destroyed") -local rootFinished = require("@self/hooks/root-finished") -local rootStarted = require("@self/hooks/root-started") -local rootUsed = require("@self/hooks/root-used") -local types = require("@self/types") - -export type Root = types.Root -export type StartedRoot = types.StartedRoot - -local roots = table.freeze({ - create = create, - hooks = table.freeze({ - onLifecycleUsed = lifecycleUsed.onLifecycleUsed, - onProviderUsed = providerUsed.onProviderUsed, - onRootUsed = rootUsed.onRootUsed, - - onRootConstructing = rootConstructing.onRootConstructing, - onRootStarted = rootStarted.onRootStarted, - onRootFinished = rootFinished.onRootFinished, - onRootDestroyed = rootDestroyed.onRootDestroyed, - }), -}) - -return roots diff --git a/dist/npm/roots/src/logger.luau b/dist/npm/roots/src/logger.luau deleted file mode 100644 index 92e611ef..00000000 --- a/dist/npm/roots/src/logger.luau +++ /dev/null @@ -1,7 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/roots", logger.standardErrorInfoUrl("roots"), { - useAfterDestroy = "Cannot use Root after it is destroyed.", - alreadyDestroyed = "Cannot destroy an already destroyed Root.", - alreadyFinished = "Root has already finished.", -}) diff --git a/dist/npm/roots/src/types.luau b/dist/npm/roots/src/types.luau deleted file mode 100644 index 104143c4..00000000 --- a/dist/npm/roots/src/types.luau +++ /dev/null @@ -1,40 +0,0 @@ -local lifecycles = require("../lifecycles") -local providers = require("../providers") - -type Set = { [T]: true } - -export type Root = { - type: "Root", - - start: (root: Root) -> StartedRoot, - - useModule: (root: Root, module: ModuleScript) -> Root, - useModules: (root: Root, modules: { Instance }, predicate: ((ModuleScript) -> boolean)?) -> Root, - useRoot: (root: Root, root: Root) -> Root, - useRoots: (root: Root, roots: { Root }) -> Root, - useProvider: (root: Root, provider: providers.Provider) -> Root, - useProviders: (root: Root, providers: { providers.Provider }) -> Root, - useLifecycle: (root: Root, lifecycle: lifecycles.Lifecycle) -> Root, - useLifecycles: (root: Root, lifecycles: { lifecycles.Lifecycle }) -> Root, - destroy: (root: Root) -> (), - - willStart: (callback: () -> ()) -> Root, - willFinish: (callback: () -> ()) -> Root, -} - -export type StartedRoot = { - type: "StartedRoot", - - finish: (root: StartedRoot) -> (), -} - -export type Self = Root & { - _destroyed: boolean, - _rootProviders: Set>, - _rootLifecycles: { lifecycles.Lifecycle }, - _subRoots: Set, - _start: lifecycles.Lifecycle<()>, - _finish: lifecycles.Lifecycle<()>, -} - -return nil diff --git a/dist/npm/runtime/LICENSE.md b/dist/npm/runtime/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/npm/runtime/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/npm/runtime/package.json b/dist/npm/runtime/package.json deleted file mode 100644 index ab51e871..00000000 --- a/dist/npm/runtime/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "author": "Fire ", - "bugs": { - "url": "https://github.com/prvdmwrong/prvdmwrong/issues" - }, - "dependencies": {}, - "description": "Runtime agnostic libraries for Prvd 'M Wrong", - "files": [ - "src", - "LICENSE.md", - "package.json" - ], - "main": "src/init.luau", - "name": "@prvdmwrong/runtime", - "repository": { - "type": "git", - "url": "git+https://github.com/prvdmwrong/prvdmwrong.git" - }, - "types": "src/init.luau", - "version": "0.2.0-rc.4" -} \ No newline at end of file diff --git a/dist/npm/runtime/src/index.d.ts b/dist/npm/runtime/src/index.d.ts deleted file mode 100644 index b227b952..00000000 --- a/dist/npm/runtime/src/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -declare namespace runtime { - export type RuntimeName = "roblox" | "luau" | "lune" | "lute" | "seal" | "zune"; - - export const name: RuntimeName; - - export namespace task { - export function cancel(thread: thread): void; - - export function defer(functionOrThread: (...args: T) => void, ...args: T): thread; - export function defer(functionOrThread: thread): thread; - export function defer( - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function delay( - duration: number, - functionOrThread: (...args: T) => void, - ...args: T - ): thread; - export function delay(duration: number, functionOrThread: thread): thread; - export function delay( - duration: number, - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function spawn(functionOrThread: (...args: T) => void, ...args: T): thread; - export function spawn(functionOrThread: thread): thread; - export function spawn( - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function wait(duration: number): number; - } - - export function warn(...args: T): void; - - export namespace threadpool { - export function spawn(f: (...args: T) => void, ...args: T): void; - export function spawnCallbacks(functions: ((...args: T) => void)[], ...args: T): void; - } -} - -export = runtime; -export as namespace runtime; diff --git a/dist/npm/runtime/src/init.luau b/dist/npm/runtime/src/init.luau deleted file mode 100644 index 26bdeee0..00000000 --- a/dist/npm/runtime/src/init.luau +++ /dev/null @@ -1,15 +0,0 @@ -local implementations = require("@self/implementations") -local task = require("@self/libs/task") -local threadpool = require("@self/batteries/threadpool") -local warn = require("@self/libs/warn") - -export type RuntimeName = implementations.RuntimeName - -return table.freeze({ - name = implementations.currentRuntimeName, - - task = task, - warn = warn, - - threadpool = threadpool, -}) diff --git a/dist/npm/typecheckers/LICENSE.md b/dist/npm/typecheckers/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/npm/typecheckers/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/npm/typecheckers/package.json b/dist/npm/typecheckers/package.json deleted file mode 100644 index c6bd8d0f..00000000 --- a/dist/npm/typecheckers/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "author": "Fire ", - "bugs": { - "url": "https://github.com/prvdmwrong/prvdmwrong/issues" - }, - "dependencies": {}, - "description": "Typechecking primitives and compatibility for Prvd 'M Wrong", - "files": [ - "src", - "LICENSE.md", - "package.json" - ], - "main": "src/init.luau", - "name": "@prvdmwrong/typecheckers", - "repository": { - "type": "git", - "url": "git+https://github.com/prvdmwrong/prvdmwrong.git" - }, - "types": "src/init.luau", - "version": "0.2.0-rc.4" -} \ No newline at end of file diff --git a/dist/npm/typecheckers/src/init.luau b/dist/npm/typecheckers/src/init.luau deleted file mode 100644 index e69de29b..00000000 diff --git a/dist/pesde/luau/dependencies/LICENSE.md b/dist/pesde/luau/dependencies/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/luau/dependencies/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/luau/dependencies/lifecycles.luau b/dist/pesde/luau/dependencies/lifecycles.luau deleted file mode 100644 index a79c5172..00000000 --- a/dist/pesde/luau/dependencies/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./luau_packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/pesde/luau/dependencies/logger.luau b/dist/pesde/luau/dependencies/logger.luau deleted file mode 100644 index 527ed682..00000000 --- a/dist/pesde/luau/dependencies/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./luau_packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/pesde/luau/dependencies/pesde.toml b/dist/pesde/luau/dependencies/pesde.toml deleted file mode 100644 index 8533f8d8..00000000 --- a/dist/pesde/luau/dependencies/pesde.toml +++ /dev/null @@ -1,37 +0,0 @@ -authors = ["Fire "] -description = "Dependency resolution logic for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "lifecycles.luau", - "logger.luau", - "lifecycles.luau", - "logger.luau", - "lifecycles.luau", - "logger.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/dependencies" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "lifecycles.luau", - "logger.luau", - "lifecycles.luau", - "logger.luau", - "lifecycles.luau", - "logger.luau", -] -environment = "luau" -lib = "src/init.luau" -[dependencies] -lifecycles = { workspace = "prvdmwrong/lifecycles", version = "0.2.0-rc.4" } -logger = { workspace = "prvdmwrong/logger", version = "0.2.0-rc.4" } diff --git a/dist/pesde/luau/dependencies/src/index.d.ts b/dist/pesde/luau/dependencies/src/index.d.ts deleted file mode 100644 index a5bddcde..00000000 --- a/dist/pesde/luau/dependencies/src/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Lifecycle } from "../lifecycles"; - -declare namespace dependencies { - export type Dependency = Self & { - dependencies: Dependencies, - priority?: number, - new(dependencies: Dependencies, ...args: NewArgs): Dependency; - }; - - interface ProccessDependencyResult { - sortedDependencies: Dependency[]; - lifecycles: Lifecycle[]; - } - - export type SubdependenciesOf = T extends { dependencies: infer Dependencies } - ? Dependencies - : never; - - export function depend InstanceType>(dependency: T): InstanceType; - export function processDependencies(dependencies: Set>): ProccessDependencyResult; - export function sortByPriority(dependencies: Dependency[]): void; -} - -export = dependencies; -export as namespace dependencies; diff --git a/dist/pesde/luau/dependencies/src/init.luau b/dist/pesde/luau/dependencies/src/init.luau deleted file mode 100644 index e6b27b24..00000000 --- a/dist/pesde/luau/dependencies/src/init.luau +++ /dev/null @@ -1,12 +0,0 @@ -local depend = require("@self/depend") -local processDependencies = require("@self/process-dependencies") -local sortByPriority = require("@self/sort-by-priority") -local types = require("@self/types") - -export type Dependency = types.Dependency - -return table.freeze({ - depend = depend, - processDependencies = processDependencies, - sortByPriority = sortByPriority, -}) diff --git a/dist/pesde/luau/dependencies/src/process-dependencies.luau b/dist/pesde/luau/dependencies/src/process-dependencies.luau deleted file mode 100644 index 20820a35..00000000 --- a/dist/pesde/luau/dependencies/src/process-dependencies.luau +++ /dev/null @@ -1,57 +0,0 @@ -local lifecycles = require("../lifecycles") -local types = require("./types") - -export type ProccessDependencyResult = { - sortedDependencies: { types.Dependency }, - lifecycles: { lifecycles.Lifecycle }, -} - -type Set = { [T]: true } - -local function processDependencies(dependencies: Set>): ProccessDependencyResult - local sortedDependencies = {} - local lifecycles = {} - - -- TODO: optimize ts - local function visitDependency(dependency: types.Dependency) - -- print("Visiting dependency", dependency) - - for key, value in dependency :: any do - if key == "dependencies" then - -- print("Checking [prvd.dependencies]") - if typeof(value) == "table" then - for key, value in value do - -- print("Checking key", key, "value", value) - if typeof(value) == "table" and value.type == "UnresolvedDependency" then - local unresolved: types.UnresolvedDependency = value - -- print("Got unresolved dependency", unresolved.dependency, "visiting") - visitDependency(unresolved.dependency) - end - end - end - - continue - end - - if typeof(value) == "table" and value.type == "Lifecycle" and not table.find(lifecycles, value) then - table.insert(lifecycles, value) - end - end - - if dependencies[dependency] and not table.find(sortedDependencies, dependency) then - -- print("Pushing to sort") - table.insert(sortedDependencies, dependency) - end - end - - for dependency in dependencies do - visitDependency(dependency) - end - - return { - sortedDependencies = sortedDependencies, - lifecycles = lifecycles, - } -end - -return processDependencies diff --git a/dist/pesde/luau/dependencies/src/process-dependencies.spec.luau b/dist/pesde/luau/dependencies/src/process-dependencies.spec.luau deleted file mode 100644 index 0fcfcac8..00000000 --- a/dist/pesde/luau/dependencies/src/process-dependencies.spec.luau +++ /dev/null @@ -1,67 +0,0 @@ -local depend = require("./depend") -local processDependencies = require("./process-dependencies") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - -local function nickname(name: string) - return function(tbl: T): T - return setmetatable(tbl :: any, { - __tostring = function() - return name - end, - }) - end -end - -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("processDependencies", function() - test("sortedDependencies", function() - local first = nickname("first")({}) - - local second = nickname("second")({ - dependencies = { - toFirst = depend(first :: any), - toFirstAgain = depend(first :: any), - }, - }) - - local third = nickname("third")({ - dependencies = { - toSecond = depend(second :: any), - }, - }) - - local fourth = nickname("fourth")({ - dependencies = { - toFirst = depend(first :: any), - toSecond = depend(second :: any), - toThird = depend(third :: any), - }, - }) - - local processed = processDependencies({ - [first] = true, - [second] = true, - [third] = true, - [fourth] = true, - } :: any) - - expect(typeof(processed)).is("table") - expect(processed).has_key("sortedDependencies") - expect(typeof(processed.sortedDependencies)).is("table") - - local sortedDependencies = processed.sortedDependencies - - expect(typeof(sortedDependencies)).is("table") - expect(sortedDependencies[1]).is(first) - expect(sortedDependencies[2]).is(second) - expect(sortedDependencies[3]).is(third) - expect(sortedDependencies[4]).is(fourth) - end) - - test("lifecycles", function() end) - end) -end diff --git a/dist/pesde/luau/dependencies/src/sort-by-priority.spec.luau b/dist/pesde/luau/dependencies/src/sort-by-priority.spec.luau deleted file mode 100644 index eeb34933..00000000 --- a/dist/pesde/luau/dependencies/src/sort-by-priority.spec.luau +++ /dev/null @@ -1,52 +0,0 @@ -local sortByPriority = require("./sort-by-priority") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("sortByPriority", function() - test("dependencies", function() - local first = {} - - local second = { - toFirst = first, - } - - local third = { - toSecond = second, - } - - local sortedDependencies = { - first, - second, - third, - } - - sortByPriority(sortedDependencies :: any) - - expect(sortedDependencies[1]).is(first) - expect(sortedDependencies[2]).is(second) - expect(sortedDependencies[3]).is(third) - end) - - test("priority", function() - local low = {} - - local high = { - priority = 500, - } - - local sortedDependencies = { - low, - high, - } - - sortByPriority(sortedDependencies :: any) - - expect(sortedDependencies[1]).is(high) - expect(sortedDependencies[2]).is(low) - end) - end) -end diff --git a/dist/pesde/luau/dependencies/src/types.luau b/dist/pesde/luau/dependencies/src/types.luau deleted file mode 100644 index 2b1c72aa..00000000 --- a/dist/pesde/luau/dependencies/src/types.luau +++ /dev/null @@ -1,14 +0,0 @@ -export type Dependency = Self & { - dependencies: Dependencies, - priority: number?, - new: (dependencies: Dependencies, NewArgs...) -> Dependency, -} - -export type UnresolvedDependency = { - type: "UnresolvedDependency", - dependency: Dependency, -} - -export type dependencies = { __prvdmwrong_dependencies: never } - -return nil diff --git a/dist/pesde/luau/lifecycles/LICENSE.md b/dist/pesde/luau/lifecycles/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/luau/lifecycles/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/luau/lifecycles/logger.luau b/dist/pesde/luau/lifecycles/logger.luau deleted file mode 100644 index 527ed682..00000000 --- a/dist/pesde/luau/lifecycles/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./luau_packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/pesde/luau/lifecycles/pesde.toml b/dist/pesde/luau/lifecycles/pesde.toml deleted file mode 100644 index a427c0bc..00000000 --- a/dist/pesde/luau/lifecycles/pesde.toml +++ /dev/null @@ -1,37 +0,0 @@ -authors = ["Fire "] -description = "Provider method lifecycles implementation for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "logger.luau", - "runtime.luau", - "logger.luau", - "runtime.luau", - "logger.luau", - "runtime.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/lifecycles" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "logger.luau", - "runtime.luau", - "logger.luau", - "runtime.luau", - "logger.luau", - "runtime.luau", -] -environment = "luau" -lib = "src/init.luau" -[dependencies] -logger = { workspace = "prvdmwrong/logger", version = "0.2.0-rc.4" } -runtime = { workspace = "prvdmwrong/runtime", version = "0.2.0-rc.4" } diff --git a/dist/pesde/luau/lifecycles/runtime.luau b/dist/pesde/luau/lifecycles/runtime.luau deleted file mode 100644 index 0345a532..00000000 --- a/dist/pesde/luau/lifecycles/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./luau_packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/pesde/luau/lifecycles/src/create.luau b/dist/pesde/luau/lifecycles/src/create.luau deleted file mode 100644 index 6cdd2891..00000000 --- a/dist/pesde/luau/lifecycles/src/create.luau +++ /dev/null @@ -1,45 +0,0 @@ -local await = require("./methods/await") -local clear = require("./methods/unregister-all") -local destroy = require("./methods/destroy") -local lifecycleConstructed = require("./hooks/lifecycle-constructed") -local methodToLifecycles = require("./method-to-lifecycles") -local onRegistered = require("./methods/on-registered") -local onUnregistered = require("./methods/on-unregistered") -local register = require("./methods/register") -local types = require("./types") -local unregister = require("./methods/unregister") - -local function create( - method: string, - onFire: (lifecycle: types.Lifecycle, Args...) -> () -): types.Lifecycle - local self: types.Self = { - _isDestroyed = false, - _selfRegistered = {}, - _selfUnregistered = {}, - - type = "Lifecycle", - callbacks = {}, - - fire = onFire, - method = method, - register = register, - unregister = unregister, - clear = clear, - onRegistered = onRegistered, - onUnregistered = onUnregistered, - await = await, - destroy = destroy, - } :: any - - methodToLifecycles[method] = methodToLifecycles[method] or {} - table.insert(methodToLifecycles[method], self) - - for _, onLifecycleConstructed in lifecycleConstructed.callbacks do - onLifecycleConstructed(self :: types.Lifecycle) - end - - return self -end - -return create diff --git a/dist/pesde/luau/lifecycles/src/handlers/fire-sequential.luau b/dist/pesde/luau/lifecycles/src/handlers/fire-sequential.luau deleted file mode 100644 index 80911ad9..00000000 --- a/dist/pesde/luau/lifecycles/src/handlers/fire-sequential.luau +++ /dev/null @@ -1,9 +0,0 @@ -local types = require("../types") - -local function fireSequential(lifecycle: types.Lifecycle, ...: Args...) - for _, callback in lifecycle.callbacks do - callback(...) - end -end - -return fireSequential diff --git a/dist/pesde/luau/lifecycles/src/hooks/lifecycle-destroyed.luau b/dist/pesde/luau/lifecycles/src/hooks/lifecycle-destroyed.luau deleted file mode 100644 index 47abcfab..00000000 --- a/dist/pesde/luau/lifecycles/src/hooks/lifecycle-destroyed.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (lifecycle: types.Lifecycle) -> () } = {} - -local function onLifecycleDestroyed(listener: (lifecycle: types.Lifecycle) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleDestroyed = onLifecycleDestroyed, -}) diff --git a/dist/pesde/luau/lifecycles/src/hooks/lifecycle-registered.luau b/dist/pesde/luau/lifecycles/src/hooks/lifecycle-registered.luau deleted file mode 100644 index fab588a3..00000000 --- a/dist/pesde/luau/lifecycles/src/hooks/lifecycle-registered.luau +++ /dev/null @@ -1,20 +0,0 @@ -local types = require("../types") - -local callbacks: { (lifecycle: types.Lifecycle, callback: (...unknown) -> ()) -> () } = {} - -local function onLifecycleRegistered( - listener: ( - lifecycle: types.Lifecycle, - callback: (Args...) -> () - ) -> () -): () -> () - table.insert(callbacks, listener :: any) - return function() - table.remove(callbacks, table.find(callbacks, listener :: any)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleRegistered = onLifecycleRegistered, -}) diff --git a/dist/pesde/luau/lifecycles/src/hooks/lifecycle-unregistered.luau b/dist/pesde/luau/lifecycles/src/hooks/lifecycle-unregistered.luau deleted file mode 100644 index 0ec81756..00000000 --- a/dist/pesde/luau/lifecycles/src/hooks/lifecycle-unregistered.luau +++ /dev/null @@ -1,20 +0,0 @@ -local types = require("../types") - -local callbacks: { (lifecycle: types.Lifecycle, callback: (...unknown) -> ()) -> () } = {} - -local function onLifecycleUnregistered( - listener: ( - lifecycle: types.Lifecycle, - callback: (Args...) -> () - ) -> () -): () -> () - table.insert(callbacks, listener :: any) - return function() - table.remove(callbacks, table.find(callbacks, listener :: any)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleUnregistered = onLifecycleUnregistered, -}) diff --git a/dist/pesde/luau/lifecycles/src/index.d.ts b/dist/pesde/luau/lifecycles/src/index.d.ts deleted file mode 100644 index 0e5f324b..00000000 --- a/dist/pesde/luau/lifecycles/src/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -declare namespace lifecycles { - export interface Lifecycle { - type: "Lifecycle"; - - callbacks: Array<(...args: Args) => void>; - method: string; - - register(callback: (...args: Args) => void): void; - fire(...args: Args): void; - unregister(callback: (...args: Args) => void): void; - clear(): void; - onRegistered(listener: (callback: (...args: Args) => void) => void): () => void; - onUnegistered(listener: (callback: (...args: Args) => void) => void): () => void; - await(): LuaTuple; - destroy(): void; - } - - export function create( - method: string, - onFire: (lifecycle: Lifecycle, ...args: Args) => void - ): Lifecycle; - - export namespace handlers { - export function fireConcurrent(lifecycle: Lifecycle, ...args: Args): void; - export function fireSequential(lifecycle: Lifecycle, ...args: Args): void; - } - - export namespace hooks { - export function onLifecycleConstructed(callback: (lifecycle: Lifecycle) => void): () => void; - export function onLifecycleDestroyed(callback: (lifecycle: Lifecycle) => void): () => void; - export function onLifecycleRegistered( - callback: (lifecycle: Lifecycle, callback: (...args: Args) => void) => void - ): () => void; - export function onLifecycleUnregistered( - callback: (lifecycle: Lifecycle, callback: (...args: Args) => void) => void - ): () => void; - } - - export namespace _ { - export const methodToLifecycles: Map; - } -} - -export = lifecycles; -export as namespace lifecycles; diff --git a/dist/pesde/luau/lifecycles/src/init.luau b/dist/pesde/luau/lifecycles/src/init.luau deleted file mode 100644 index dbec091b..00000000 --- a/dist/pesde/luau/lifecycles/src/init.luau +++ /dev/null @@ -1,28 +0,0 @@ -local create = require("@self/create") -local fireConcurrent = require("@self/handlers/fire-concurrent") -local fireSequential = require("@self/handlers/fire-sequential") -local lifecycleConstructed = require("@self/hooks/lifecycle-constructed") -local lifecycleDestroyed = require("@self/hooks/lifecycle-destroyed") -local lifecycleRegistered = require("@self/hooks/lifecycle-registered") -local lifecycleUnregistered = require("@self/hooks/lifecycle-unregistered") -local methodToLifecycles = require("@self/method-to-lifecycles") -local types = require("@self/types") - -export type Lifecycle = types.Lifecycle - -return table.freeze({ - create = create, - handlers = table.freeze({ - fireConcurrent = fireConcurrent, - fireSequential = fireSequential, - }), - hooks = table.freeze({ - onLifecycleRegistered = lifecycleRegistered.onLifecycleRegistered, - onLifecycleUnregistered = lifecycleUnregistered.onLifecycleUnregistered, - onLifecycleConstructed = lifecycleConstructed.onLifecycleConstructed, - onLifecycleDestroyed = lifecycleDestroyed.onLifecycleDestroyed, - }), - _ = table.freeze({ - methodToLifecycles = methodToLifecycles, - }), -}) diff --git a/dist/pesde/luau/lifecycles/src/logger.luau b/dist/pesde/luau/lifecycles/src/logger.luau deleted file mode 100644 index 3ae7c27e..00000000 --- a/dist/pesde/luau/lifecycles/src/logger.luau +++ /dev/null @@ -1,6 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/lifecycles", logger.standardErrorInfoUrl("lifecycles"), { - useAfterDestroy = "Cannot use Lifecycle after it is destroyed.", - alreadyDestroyed = "Cannot destroy an already destroyed Lifecycle.", -}) diff --git a/dist/pesde/luau/lifecycles/src/methods/on-unregistered.luau b/dist/pesde/luau/lifecycles/src/methods/on-unregistered.luau deleted file mode 100644 index 842040ec..00000000 --- a/dist/pesde/luau/lifecycles/src/methods/on-unregistered.luau +++ /dev/null @@ -1,17 +0,0 @@ -local logger = require("../logger") -local types = require("../types") - -local function onUnregistered(lifecycle: types.Self, listener: (callback: (Args...) -> ()) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - if _G.PRVDMWRONG_DISALLOW_MULTIPLE_LISTENERS then - table.remove(lifecycle._selfUnregistered, table.find(lifecycle._selfUnregistered, listener)) - end - table.insert(lifecycle._selfUnregistered, listener) - return function() - table.remove(lifecycle._selfUnregistered, table.find(lifecycle._selfUnregistered, listener)) - end -end - -return onUnregistered diff --git a/dist/pesde/luau/lifecycles/src/methods/register.luau b/dist/pesde/luau/lifecycles/src/methods/register.luau deleted file mode 100644 index 3fd74d56..00000000 --- a/dist/pesde/luau/lifecycles/src/methods/register.luau +++ /dev/null @@ -1,18 +0,0 @@ -local logger = require("../logger") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function register(lifecycle: types.Self, callback: (Args...) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - if _G.PRVDMWRONG_DISALLOW_MULTIPLE_LISTENERS then - table.remove(lifecycle.callbacks, table.find(lifecycle.callbacks, callback)) - end - table.insert(lifecycle.callbacks, callback) - threadpool.spawnCallbacks(lifecycle._selfRegistered, callback) -end - -return register diff --git a/dist/pesde/luau/lifecycles/src/methods/unregister-all.luau b/dist/pesde/luau/lifecycles/src/methods/unregister-all.luau deleted file mode 100644 index 5e6235af..00000000 --- a/dist/pesde/luau/lifecycles/src/methods/unregister-all.luau +++ /dev/null @@ -1,17 +0,0 @@ -local logger = require("../logger") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function clear(lifecycle: types.Self) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - for _, callback in lifecycle.callbacks do - threadpool.spawnCallbacks(lifecycle._selfUnregistered, callback) - end - table.clear(lifecycle.callbacks) -end - -return clear diff --git a/dist/pesde/luau/lifecycles/src/methods/unregister.luau b/dist/pesde/luau/lifecycles/src/methods/unregister.luau deleted file mode 100644 index 0ca7223f..00000000 --- a/dist/pesde/luau/lifecycles/src/methods/unregister.luau +++ /dev/null @@ -1,18 +0,0 @@ -local logger = require("../logger") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function unregister(lifecycle: types.Self, callback: (Args...) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - local index = table.find(lifecycle.callbacks, callback) - if index then - table.remove(lifecycle.callbacks, index) - threadpool.spawnCallbacks(lifecycle._selfUnregistered, callback) - end -end - -return unregister diff --git a/dist/pesde/luau/lifecycles/src/types.luau b/dist/pesde/luau/lifecycles/src/types.luau deleted file mode 100644 index f2931b52..00000000 --- a/dist/pesde/luau/lifecycles/src/types.luau +++ /dev/null @@ -1,23 +0,0 @@ -export type Lifecycle = { - type: "Lifecycle", - - callbacks: { (Args...) -> () }, - method: string, - - register: (self: Lifecycle, callback: (Args...) -> ()) -> (), - fire: (self: Lifecycle, Args...) -> (), - unregister: (self: Lifecycle, callback: (Args...) -> ()) -> (), - clear: (self: Lifecycle) -> (), - onRegistered: (self: Lifecycle, listener: (callback: (Args...) -> ()) -> ()) -> () -> (), - onUnregistered: (self: Lifecycle, listener: (callback: (Args...) -> ()) -> ()) -> () -> (), - await: (self: Lifecycle) -> Args..., - destroy: (self: Lifecycle) -> (), -} - -export type Self = Lifecycle & { - _isDestroyed: boolean, - _selfRegistered: { (callback: (Args...) -> ()) -> () }, - _selfUnregistered: { (callback: (Args...) -> ()) -> () }, -} - -return nil diff --git a/dist/pesde/luau/logger/LICENSE.md b/dist/pesde/luau/logger/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/luau/logger/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/luau/logger/pesde.toml b/dist/pesde/luau/logger/pesde.toml deleted file mode 100644 index fcf24d8d..00000000 --- a/dist/pesde/luau/logger/pesde.toml +++ /dev/null @@ -1,30 +0,0 @@ -authors = ["Fire "] -description = "Logging for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "runtime.luau", - "runtime.luau", - "runtime.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/logger" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "runtime.luau", - "runtime.luau", - "runtime.luau", -] -environment = "luau" -lib = "src/init.luau" -[dependencies] -runtime = { workspace = "prvdmwrong/runtime", version = "0.2.0-rc.4" } diff --git a/dist/pesde/luau/logger/runtime.luau b/dist/pesde/luau/logger/runtime.luau deleted file mode 100644 index 0345a532..00000000 --- a/dist/pesde/luau/logger/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./luau_packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/pesde/luau/logger/src/create.luau b/dist/pesde/luau/logger/src/create.luau deleted file mode 100644 index 943aab25..00000000 --- a/dist/pesde/luau/logger/src/create.luau +++ /dev/null @@ -1,32 +0,0 @@ -local allowWebLinks = require("./allow-web-links") -local formatLog = require("./format-log") -local runtime = require("../runtime") -local types = require("./types") - -local task = runtime.task -local warn = runtime.warn - -local function create(label: string, errorInfoUrl: string?, templates: T): types.Logger - local self = {} :: types.Logger - self.type = "Logger" - - label = `[{label}] ` - errorInfoUrl = if allowWebLinks then errorInfoUrl else nil - - function self:warn(log) - warn(label .. formatLog(self, log, errorInfoUrl)) - end - - function self:error(log) - task.spawn(error, label .. formatLog(self, log, errorInfoUrl), 0) - end - - function self:fatalError(log) - error(label .. formatLog(self, log, errorInfoUrl)) - end - - setmetatable(self :: any, { __index = templates }) - return self -end - -return create diff --git a/dist/pesde/luau/logger/src/format-log.luau b/dist/pesde/luau/logger/src/format-log.luau deleted file mode 100644 index 3eeda21b..00000000 --- a/dist/pesde/luau/logger/src/format-log.luau +++ /dev/null @@ -1,43 +0,0 @@ -local types = require("./types") - -local function formatLog(self: types.Logger, log: types.Log, errorInfoUrl: string?): string - local formattedTemplate = string.format(log.template, table.unpack(log)) - - local error = log.error - local trace: string? = log.trace - - if error then - trace = error.trace - formattedTemplate = string.gsub(formattedTemplate, "ERROR_MESSAGE", error.message) - end - - local id: string? - - -- TODO: find a better way to do ts while still being ergonomic - for templateKey, template in (self :: any) :: { [string]: string } do - if template == log.template then - id = templateKey - break - end - end - - if id then - formattedTemplate ..= `\nID: {id}` - end - - if errorInfoUrl then - formattedTemplate ..= `\nLearn more: {errorInfoUrl}` - if id then - formattedTemplate ..= `#{string.lower(id)}` - end - end - - if trace then - formattedTemplate ..= `\n---- Stack trace ----\n{trace}` - end - - -- Labels are added from createLogger, so we don't add it here - return string.gsub(formattedTemplate, "\n", "\n ") -end - -return formatLog diff --git a/dist/pesde/luau/logger/src/index.d.ts b/dist/pesde/luau/logger/src/index.d.ts deleted file mode 100644 index 85251a07..00000000 --- a/dist/pesde/luau/logger/src/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -declare namespace Logger { - export interface Error { - type: "Error"; - raw: string; - message: string; - trace: string; - } - - interface LogProps { - template: string; - error?: Error; - trace?: string; - } - - export type Log = LogProps & unknown[]; - - interface LoggerProps { - print(props: Log): void; - warn(props: Log): void; - error(props: Log): void; - fatalError(props: Log): never; - } - - export type Logger> = LoggerProps & Templates; - - export function create>( - label: string, - errorInfoUrl: string | undefined, - templates: Templates - ): Logger; - - export function formatLog>( - logger: Logger, - log: Log, - errorInfoUrl?: string - ): string; - - export function parseError(err: string): Error; - - export const allowWebLinks: boolean; - export function standardErrorInfoUrl(label: string): string; -} - -export = Logger; -export as namespace Logger; diff --git a/dist/pesde/luau/logger/src/init.luau b/dist/pesde/luau/logger/src/init.luau deleted file mode 100644 index 52760a5d..00000000 --- a/dist/pesde/luau/logger/src/init.luau +++ /dev/null @@ -1,18 +0,0 @@ -local allowWebLinks = require("@self/allow-web-links") -local create = require("@self/create") -local formatLog = require("@self/format-log") -local parseError = require("@self/parse-error") -local standardErrorInfoUrl = require("@self/standard-error-info-url") -local types = require("@self/types") - -export type Logger = types.Logger -export type Log = types.Log -export type Error = types.Error - -return table.freeze({ - create = create, - formatLog = formatLog, - parseError = parseError, - allowWebLinks = allowWebLinks, - standardErrorInfoUrl = standardErrorInfoUrl, -}) diff --git a/dist/pesde/luau/logger/src/standard-error-info-url.luau b/dist/pesde/luau/logger/src/standard-error-info-url.luau deleted file mode 100644 index 345faf36..00000000 --- a/dist/pesde/luau/logger/src/standard-error-info-url.luau +++ /dev/null @@ -1,5 +0,0 @@ -local function standardErrorInfoUrl(label: string): string - return `https://prvdmwrong.luau.page/api-reference/{label}/errors` -end - -return standardErrorInfoUrl diff --git a/dist/pesde/luau/logger/src/types.luau b/dist/pesde/luau/logger/src/types.luau deleted file mode 100644 index d1699037..00000000 --- a/dist/pesde/luau/logger/src/types.luau +++ /dev/null @@ -1,23 +0,0 @@ -export type Error = { - type: "Error", - raw: string, - message: string, - trace: string, -} - -export type Log = { - template: string, - error: Error?, - trace: string?, - [number]: unknown, -} - -export type Logger = Templates & { - type: "Logger", - print: (self: Logger, props: Log) -> (), - warn: (self: Logger, props: Log) -> (), - error: (self: Logger, props: Log) -> (), - fatalError: (self: Logger, props: Log) -> never, -} - -return nil diff --git a/dist/pesde/luau/providers/LICENSE.md b/dist/pesde/luau/providers/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/luau/providers/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/luau/providers/dependencies.luau b/dist/pesde/luau/providers/dependencies.luau deleted file mode 100644 index 61b0667d..00000000 --- a/dist/pesde/luau/providers/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./luau_packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/pesde/luau/providers/lifecycles.luau b/dist/pesde/luau/providers/lifecycles.luau deleted file mode 100644 index a79c5172..00000000 --- a/dist/pesde/luau/providers/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./luau_packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/pesde/luau/providers/logger.luau b/dist/pesde/luau/providers/logger.luau deleted file mode 100644 index 527ed682..00000000 --- a/dist/pesde/luau/providers/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./luau_packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/pesde/luau/providers/pesde.toml b/dist/pesde/luau/providers/pesde.toml deleted file mode 100644 index c2fc7605..00000000 --- a/dist/pesde/luau/providers/pesde.toml +++ /dev/null @@ -1,51 +0,0 @@ -authors = ["Fire "] -description = "Provider creation for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "runtime.luau", - "logger.luau", - "lifecycles.luau", - "dependencies.luau", - "runtime.luau", - "logger.luau", - "lifecycles.luau", - "dependencies.luau", - "runtime.luau", - "logger.luau", - "lifecycles.luau", - "dependencies.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/providers" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "runtime.luau", - "logger.luau", - "lifecycles.luau", - "dependencies.luau", - "runtime.luau", - "logger.luau", - "lifecycles.luau", - "dependencies.luau", - "runtime.luau", - "logger.luau", - "lifecycles.luau", - "dependencies.luau", -] -environment = "luau" -lib = "src/init.luau" -[dependencies] -dependencies = { workspace = "prvdmwrong/dependencies", version = "0.2.0-rc.4" } -runtime = { workspace = "prvdmwrong/runtime", version = "0.2.0-rc.4" } -lifecycles = { workspace = "prvdmwrong/lifecycles", version = "0.2.0-rc.4" } -logger = { workspace = "prvdmwrong/logger", version = "0.2.0-rc.4" } diff --git a/dist/pesde/luau/providers/runtime.luau b/dist/pesde/luau/providers/runtime.luau deleted file mode 100644 index 0345a532..00000000 --- a/dist/pesde/luau/providers/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./luau_packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/pesde/luau/providers/src/create.luau b/dist/pesde/luau/providers/src/create.luau deleted file mode 100644 index 016b8a6d..00000000 --- a/dist/pesde/luau/providers/src/create.luau +++ /dev/null @@ -1,30 +0,0 @@ -local nameOf = require("./name-of") -local providerClasses = require("./provider-classes") -local types = require("./types") - -local function createProvider(self: Self): types.Provider - local provider: types.Provider = self :: any - - if provider.__index == nil then - provider.__index = provider - end - - if provider.__tostring == nil then - provider.__tostring = nameOf - end - - if provider.new == nil then - function provider.new(dependencies) - local self: types.Provider = setmetatable({}, provider) :: any - if provider.constructor then - return provider.constructor(self, dependencies) or self - end - return self - end - end - - providerClasses[provider] = true - return provider -end - -return createProvider diff --git a/dist/pesde/luau/providers/src/index.d.ts b/dist/pesde/luau/providers/src/index.d.ts deleted file mode 100644 index 2ab36e15..00000000 --- a/dist/pesde/luau/providers/src/index.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Dependency } from "../dependencies"; - -declare namespace providers { - export type Provider = Dependency< - Self & { - __index: Provider; - name?: string; - constructor?(dependencies: Dependencies): void; - start?(): void; - destroy?(): void; - }, - Dependencies - >; - - // Class decorator syntax - export function create InstanceType>(self: Self): Provider; - // Normal syntax - export function create(self: Self): Provider; - - export function nameOf(provider: Provider): string; - - export namespace _ { - export const providerClasses: Set>; - } - - export interface Start { - start(): void; - } - - export interface Destroy { - destroy(): void; - } -} - -export = providers; -export as namespace providers; diff --git a/dist/pesde/luau/providers/src/init.luau b/dist/pesde/luau/providers/src/init.luau deleted file mode 100644 index d678d850..00000000 --- a/dist/pesde/luau/providers/src/init.luau +++ /dev/null @@ -1,16 +0,0 @@ -local create = require("@self/create") -local nameOf = require("@self/name-of") -local providerClasses = require("@self/provider-classes") -local types = require("@self/types") - -export type Provider = types.Provider - -local providers = table.freeze({ - create = create, - nameOf = nameOf, - _ = table.freeze({ - providerClasses = providerClasses, - }), -}) - -return providers diff --git a/dist/pesde/luau/providers/src/name-of.luau b/dist/pesde/luau/providers/src/name-of.luau deleted file mode 100644 index 3f86ceec..00000000 --- a/dist/pesde/luau/providers/src/name-of.luau +++ /dev/null @@ -1,7 +0,0 @@ -local types = require("./types") - -local function nameOf(provider: types.Provider) - return provider.name or "Provider" -end - -return nameOf diff --git a/dist/pesde/luau/providers/src/provider-classes.luau b/dist/pesde/luau/providers/src/provider-classes.luau deleted file mode 100644 index cc57922f..00000000 --- a/dist/pesde/luau/providers/src/provider-classes.luau +++ /dev/null @@ -1,7 +0,0 @@ -local types = require("./types") - -type Set = { [T]: true } - -local providerClasses: Set> = setmetatable({}, { __mode = "k" }) :: any - -return providerClasses diff --git a/dist/pesde/luau/providers/src/types.luau b/dist/pesde/luau/providers/src/types.luau deleted file mode 100644 index 4f4d4dc9..00000000 --- a/dist/pesde/luau/providers/src/types.luau +++ /dev/null @@ -1,12 +0,0 @@ -local dependencies = require("../dependencies") - -export type Provider = dependencies.Dependency, - __tostring: (self: Provider) -> string, - name: string?, - constructor: ((self: Provider, dependencies: Dependencies) -> ())?, - start: (self: Provider) -> ()?, - destroy: (self: Provider) -> ()?, -}, Dependencies> - -return nil diff --git a/dist/pesde/luau/prvdmwrong/LICENSE.md b/dist/pesde/luau/prvdmwrong/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/luau/prvdmwrong/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/luau/prvdmwrong/dependencies.luau b/dist/pesde/luau/prvdmwrong/dependencies.luau deleted file mode 100644 index 61b0667d..00000000 --- a/dist/pesde/luau/prvdmwrong/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./luau_packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/pesde/luau/prvdmwrong/lifecycles.luau b/dist/pesde/luau/prvdmwrong/lifecycles.luau deleted file mode 100644 index a79c5172..00000000 --- a/dist/pesde/luau/prvdmwrong/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./luau_packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/pesde/luau/prvdmwrong/pesde.toml b/dist/pesde/luau/prvdmwrong/pesde.toml deleted file mode 100644 index c24ca094..00000000 --- a/dist/pesde/luau/prvdmwrong/pesde.toml +++ /dev/null @@ -1,51 +0,0 @@ -authors = ["Fire "] -description = "Entry point to Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "dependencies.luau", - "roots.luau", - "lifecycles.luau", - "providers.luau", - "dependencies.luau", - "roots.luau", - "lifecycles.luau", - "providers.luau", - "dependencies.luau", - "roots.luau", - "lifecycles.luau", - "providers.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/prvdmwrong" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "dependencies.luau", - "roots.luau", - "lifecycles.luau", - "providers.luau", - "dependencies.luau", - "roots.luau", - "lifecycles.luau", - "providers.luau", - "dependencies.luau", - "roots.luau", - "lifecycles.luau", - "providers.luau", -] -environment = "luau" -lib = "src/init.luau" -[dependencies] -dependencies = { workspace = "prvdmwrong/dependencies", version = "0.2.0-rc.4" } -roots = { workspace = "prvdmwrong/roots", version = "0.2.0-rc.4" } -lifecycles = { workspace = "prvdmwrong/lifecycles", version = "0.2.0-rc.4" } -providers = { workspace = "prvdmwrong/providers", version = "0.2.0-rc.4" } diff --git a/dist/pesde/luau/prvdmwrong/providers.luau b/dist/pesde/luau/prvdmwrong/providers.luau deleted file mode 100644 index 46125aaa..00000000 --- a/dist/pesde/luau/prvdmwrong/providers.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./luau_packages/providers") -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/pesde/luau/prvdmwrong/roots.luau b/dist/pesde/luau/prvdmwrong/roots.luau deleted file mode 100644 index 33a0058a..00000000 --- a/dist/pesde/luau/prvdmwrong/roots.luau +++ /dev/null @@ -1,4 +0,0 @@ -local DEPENDENCY = require("./luau_packages/roots") -export type Root = DEPENDENCY.Root -export type StartedRoot = DEPENDENCY.StartedRoot -return DEPENDENCY diff --git a/dist/pesde/luau/prvdmwrong/src/index.d.ts b/dist/pesde/luau/prvdmwrong/src/index.d.ts deleted file mode 100644 index 2058129c..00000000 --- a/dist/pesde/luau/prvdmwrong/src/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import dependencies from "../dependencies"; -import lifecycles from "../lifecycles"; -import providers from "../providers"; -import roots from "../roots"; - -declare namespace prvd { - export type Provider = providers.Provider; - export interface Lifecycle extends lifecycles.Lifecycle { } - export type SubdependenciesOf = dependencies.SubdependenciesOf; - export interface Root extends roots.Root { } - export interface StartedRoot extends roots.StartedRoot { } - - export interface Start extends providers.Start { } - export interface Destroy extends providers.Destroy { } - - export const provider: typeof providers.create; - export const root: typeof roots.create; - export const depend: typeof dependencies.depend; - export const nameOf: typeof providers.nameOf; - - export const lifecycle: typeof lifecycles.create; - export const fireConcurrent: typeof lifecycles.handlers.fireConcurrent; - export const fireSequential: typeof lifecycles.handlers.fireSequential; - - export namespace hooks { - export const onLifecycleConstructed: typeof lifecycles.hooks.onLifecycleConstructed; - export const onLifecycleDestroyed: typeof lifecycles.hooks.onLifecycleDestroyed; - export const onLifecycleRegistered: typeof lifecycles.hooks.onLifecycleRegistered; - export const onLifecycleUnregistered: typeof lifecycles.hooks.onLifecycleUnregistered; - - export const onLifecycleUsed: typeof roots.hooks.onLifecycleUsed; - export const onProviderUsed: typeof roots.hooks.onProviderUsed; - export const onRootUsed: typeof roots.hooks.onRootUsed; - export const onRootConstructing: typeof roots.hooks.onRootConstructing; - export const onRootStarted: typeof roots.hooks.onRootStarted; - export const onRootFinished: typeof roots.hooks.onRootFinished; - export const onRootDestroyed: typeof roots.hooks.onRootDestroyed; - } -} - -export = prvd; -export as namespace prvd; diff --git a/dist/pesde/luau/prvdmwrong/src/init.luau b/dist/pesde/luau/prvdmwrong/src/init.luau deleted file mode 100644 index 1381801d..00000000 --- a/dist/pesde/luau/prvdmwrong/src/init.luau +++ /dev/null @@ -1,45 +0,0 @@ -local dependencies = require("./dependencies") -local lifecycles = require("./lifecycles") -local providers = require("./providers") -local roots = require("./roots") - -export type Provider = providers.Provider -export type Lifecycle = lifecycles.Lifecycle -export type Root = roots.Root -export type StartedRoot = roots.StartedRoot - -local prvd = { - provider = providers.create, - root = roots.create, - depend = dependencies.depend, - nameOf = providers.nameOf, - - lifecycle = lifecycles.create, - fireConcurrent = lifecycles.handlers.fireConcurrent, - fireSequential = lifecycles.handlers.fireSequential, - - hooks = table.freeze({ - onProviderUsed = roots.hooks.onProviderUsed, - onLifecycleUsed = roots.hooks.onLifecycleUsed, - onRootConstructing = roots.hooks.onRootConstructing, - onRootUsed = roots.hooks.onRootUsed, - onRootStarted = roots.hooks.onRootStarted, - onRootFinished = roots.hooks.onRootFinished, - onRootDestroyed = roots.hooks.onRootDestroyed, - - onLifecycleConstructed = lifecycles.hooks.onLifecycleConstructed, - onLifecycleDestroyed = lifecycles.hooks.onLifecycleDestroyed, - onLifecycleRegistered = lifecycles.hooks.onLifecycleRegistered, - onLifecycleUnregistered = lifecycles.hooks.onLifecycleUnregistered, - }), -} - -type PrvdModule = ((provider: Self) -> Provider) & typeof(prvd) - -local mt = {} -function mt.__call(_, provider: Self): providers.Provider - return providers.create(provider) :: any -end - -local module: PrvdModule = setmetatable(prvd, mt) :: any -return module diff --git a/dist/pesde/luau/rbx-components/LICENSE.md b/dist/pesde/luau/rbx-components/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/luau/rbx-components/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/luau/rbx-components/dependencies.luau b/dist/pesde/luau/rbx-components/dependencies.luau deleted file mode 100644 index 61b0667d..00000000 --- a/dist/pesde/luau/rbx-components/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./luau_packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/pesde/luau/rbx-components/logger.luau b/dist/pesde/luau/rbx-components/logger.luau deleted file mode 100644 index 527ed682..00000000 --- a/dist/pesde/luau/rbx-components/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./luau_packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/pesde/luau/rbx-components/pesde.toml b/dist/pesde/luau/rbx-components/pesde.toml deleted file mode 100644 index 3891a15e..00000000 --- a/dist/pesde/luau/rbx-components/pesde.toml +++ /dev/null @@ -1,51 +0,0 @@ -authors = ["Fire "] -description = "Component functionality for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "logger.luau", - "roots.luau", - "providers.luau", - "dependencies.luau", - "logger.luau", - "roots.luau", - "providers.luau", - "dependencies.luau", - "logger.luau", - "roots.luau", - "providers.luau", - "dependencies.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/rbx_components" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "logger.luau", - "roots.luau", - "providers.luau", - "dependencies.luau", - "logger.luau", - "roots.luau", - "providers.luau", - "dependencies.luau", - "logger.luau", - "roots.luau", - "providers.luau", - "dependencies.luau", -] -environment = "luau" -lib = "src/init.luau" -[dependencies] -logger = { workspace = "prvdmwrong/logger", version = "0.2.0-rc.4" } -roots = { workspace = "prvdmwrong/roots", version = "0.2.0-rc.4" } -providers = { workspace = "prvdmwrong/providers", version = "0.2.0-rc.4" } -dependencies = { workspace = "prvdmwrong/dependencies", version = "0.2.0-rc.4" } diff --git a/dist/pesde/luau/rbx-components/providers.luau b/dist/pesde/luau/rbx-components/providers.luau deleted file mode 100644 index 46125aaa..00000000 --- a/dist/pesde/luau/rbx-components/providers.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./luau_packages/providers") -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/pesde/luau/rbx-components/roots.luau b/dist/pesde/luau/rbx-components/roots.luau deleted file mode 100644 index 33a0058a..00000000 --- a/dist/pesde/luau/rbx-components/roots.luau +++ /dev/null @@ -1,4 +0,0 @@ -local DEPENDENCY = require("./luau_packages/roots") -export type Root = DEPENDENCY.Root -export type StartedRoot = DEPENDENCY.StartedRoot -return DEPENDENCY diff --git a/dist/pesde/luau/rbx-components/src/component-classes.luau b/dist/pesde/luau/rbx-components/src/component-classes.luau deleted file mode 100644 index 0dcdb30a..00000000 --- a/dist/pesde/luau/rbx-components/src/component-classes.luau +++ /dev/null @@ -1,7 +0,0 @@ -local types = require("./types") - -type Set = { [T]: true } - -local componentClasses: Set> = setmetatable({}, { __mode = "k" }) :: any - -return componentClasses diff --git a/dist/pesde/luau/rbx-components/src/component-provider.luau b/dist/pesde/luau/rbx-components/src/component-provider.luau deleted file mode 100644 index 85af0d0d..00000000 --- a/dist/pesde/luau/rbx-components/src/component-provider.luau +++ /dev/null @@ -1,185 +0,0 @@ -local CollectionService = game:GetService("CollectionService") - -local componentClasses = require("./component-classes") -local logger = require("./logger") -local providers = require("../providers") -local runtime = require("../runtime") -local types = require("./types") - -local threadpool = runtime.threadpool - -type Set = { [T]: true } -type ConstructedComponent = types.AnyComponent -type LuauBug = any - -local ComponentProvider = {} -ComponentProvider.priority = -math.huge -ComponentProvider.name = "@rbx-components" - -function ComponentProvider.constructor(self: ComponentProvider) - self.componentClasses = {} :: Set - self.tagToComponentClasses = {} :: { [string]: Set } - self.instanceToComponents = {} :: { [Instance]: { [types.AnyComponent]: ConstructedComponent } } - self.componentToInstances = {} :: { [types.AnyComponent]: Set? } - self.constructedToClass = {} :: { [ConstructedComponent]: types.AnyComponent? } - - self._destroyingConnections = {} :: { [Instance]: RBXScriptConnection } - self._connections = {} :: { RBXScriptConnection } -end - -function ComponentProvider.start(self: ComponentProvider) - for tag, components in self.tagToComponentClasses do - local function onTagAdded(instance) - local instanceToComponents = self.instanceToComponents[instance] - if not instanceToComponents then - instanceToComponents = {} - self.instanceToComponents[instance] = instanceToComponents - end - - for componentClass in components do - if - (componentClass.blacklistInstances and (componentClass.blacklistInstances :: LuauBug)[instance]) - or (componentClass.whitelistInstances and not (componentClass.whitelistInstances :: LuauBug)[instance]) - or (componentClass.instanceCheck and not componentClass.instanceCheck(instance)) - then - continue - end - - local component: ConstructedComponent = instanceToComponents[componentClass] - if not component then - component = componentClass.new(instance) - instanceToComponents[componentClass] = component - self.constructedToClass[component :: any] = componentClass - end - - if component.added then - component:added() - end - end - - if not self._destroyingConnections[instance] then - self._destroyingConnections[instance] = instance.Destroying:Once(function() - for _, component in instanceToComponents do - if component.destroy then - threadpool.spawn(component.destroy, component) - end - end - table.clear(instanceToComponents) - self.instanceToComponents[instance] = nil - end) - end - end - - table.insert(self._connections, CollectionService:GetInstanceAddedSignal(tag):Connect(onTagAdded)) - table.insert(self._connections, CollectionService:GetInstanceRemovedSignal(tag):Connect(function(instance) end)) - - for _, instance in CollectionService:GetTagged(tag) do - onTagAdded(instance) - end - end -end - -function ComponentProvider.destroy(self: ComponentProvider) - for _, components in self.instanceToComponents do - for _, component in components do - if component.destroy then - component:destroy() - end - end - table.clear(components) - end - - table.clear(self.componentClasses) - table.clear(self.tagToComponentClasses) - table.clear(self.instanceToComponents) - table.clear(self.componentToInstances) - table.clear(self.constructedToClass) - - for _, connection in self._connections do - if connection.Connected then - connection:Disconnect() - end - end - - for _, connection in self._destroyingConnections do - if connection.Connected then - connection:Disconnect() - end - end - - table.clear(self._connections) - table.clear(self._destroyingConnections) -end - -function ComponentProvider.addComponentClass(self: ComponentProvider, class: types.AnyComponent) - if not componentClasses[class] then - logger:fatalError({ template = logger.invalidComponent }) - end - - if self.componentClasses[class] then - logger:fatalError({ template = logger.alreadyRegisteredComponent }) - end - - if class.tag then - local tagToComponentClasses = self.tagToComponentClasses[class.tag] - - if tagToComponentClasses then - if not _G.PRVDMWRONG_SUPPRESS_MULTIPLE_SAME_TAG and #tagToComponentClasses > 0 then - logger:warn({ template = logger.multipleSameTag, class.tag }) - end - else - tagToComponentClasses = {} - self.tagToComponentClasses[class.tag] = tagToComponentClasses - end - - (tagToComponentClasses :: any)[class] = true - end - - self.componentClasses[class] = true - self.componentToInstances[class] = {} -end - -function ComponentProvider.getFromInstance( - self: ComponentProvider, - class: types.Component, - instance: I -): types.Component? - return self.instanceToComponents[instance :: any][class] -end - -function ComponentProvider.getAllComponents( - self: ComponentProvider, - class: types.Component -): Set> - local result = {} - for _, components in self.instanceToComponents do - for _, component in components do - if self.constructedToClass[component] == class then - result[component] = true - end - end - end - return result :: any -end - -function ComponentProvider.addComponent( - self: ComponentProvider, - class: types.Component, - instance: I -): types.Component? - error("not yet implemented") -end - -function ComponentProvider.removeComponent(self: ComponentProvider, class: types.Component, instance: I) - local constructed = self:getFromInstance(class, instance) - if constructed then - self.instanceToComponents[instance :: any][class] = nil - - if constructed.removed then - threadpool.spawn(constructed.removed :: any, constructed, instance) - end - end -end - -export type ComponentProvider = typeof(ComponentProvider) -return providers.create(ComponentProvider) diff --git a/dist/pesde/luau/rbx-components/src/create.luau b/dist/pesde/luau/rbx-components/src/create.luau deleted file mode 100644 index 24d39a3b..00000000 --- a/dist/pesde/luau/rbx-components/src/create.luau +++ /dev/null @@ -1,28 +0,0 @@ -local componentClasses = require("./component-classes") -local types = require("./types") - --- TODO: prvdmwrong/classes package? -local function create(self: Self): types.Component - local component: types.Component = self :: any - - if component.__index == nil then - component.__index = component - end - - -- TODO: abstract nameOf - - if component.new == nil then - function component.new(instance: any) - local self: types.Component = setmetatable({}, component) :: any - if component.constructor then - return component.constructor(self, instance) or self - end - return self - end - end - - componentClasses[component] = true - return component -end - -return create diff --git a/dist/pesde/luau/rbx-components/src/extend-root/create-component-class-provider.luau b/dist/pesde/luau/rbx-components/src/extend-root/create-component-class-provider.luau deleted file mode 100644 index 9d5ae999..00000000 --- a/dist/pesde/luau/rbx-components/src/extend-root/create-component-class-provider.luau +++ /dev/null @@ -1,31 +0,0 @@ -local ComponentProvider = require("../component-provider") -local providers = require("../../providers") -local types = require("../types") - -local ComponentClassProvider = {} -ComponentClassProvider.priority = -math.huge -ComponentClassProvider.name = "@rbx-components.ComponentClassProvider" -ComponentClassProvider.dependencies = table.freeze({ - componentProvider = ComponentProvider, -}) - -ComponentClassProvider._components = {} :: { types.AnyComponent } - -function ComponentClassProvider.constructor( - self: ComponentClassProvider, - dependencies: typeof(ComponentClassProvider.dependencies) -) - for _, class in self._components do - dependencies.componentProvider:addComponentClass(class) - end -end - -export type ComponentClassProvider = typeof(ComponentClassProvider) - -local function createComponentClassProvider(components: { types.AnyComponent }) - local provider = table.clone(ComponentClassProvider) - provider._components = components - return providers.create(provider) -end - -return createComponentClassProvider diff --git a/dist/pesde/luau/rbx-components/src/extend-root/init.luau b/dist/pesde/luau/rbx-components/src/extend-root/init.luau deleted file mode 100644 index 6e9f0578..00000000 --- a/dist/pesde/luau/rbx-components/src/extend-root/init.luau +++ /dev/null @@ -1,30 +0,0 @@ -local ComponentProvider = require("./component-provider") -local createComponentClassProvider = require("@self/create-component-class-provider") -local logger = require("./logger") -local roots = require("../roots") -local types = require("./types") -local useComponent = require("@self/use-component") -local useComponents = require("@self/use-components") -local useModuleAsComponent = require("@self/use-module-as-component") -local useModulesAsComponents = require("@self/use-modules-as-components") - -local function extendRoot(root: types.RootPrivate): types.Root - if root._hasComponentExtensions then - return logger:fatalError({ template = logger.alreadyExtendedRoot }) - end - - root._hasComponentExtensions = true - root._classes = {} - - root:useProvider(ComponentProvider) - root:useProvider(createComponentClassProvider(root._classes)) - - root.useComponent = useComponent :: any - root.useComponents = useComponents :: any - root.useModuleAsComponent = useModuleAsComponent :: any - root.useModulesAsComponents = useModulesAsComponents :: any - - return root -end - -return extendRoot :: (root: roots.Root) -> types.Root diff --git a/dist/pesde/luau/rbx-components/src/extend-root/use-component.luau b/dist/pesde/luau/rbx-components/src/extend-root/use-component.luau deleted file mode 100644 index b0bd8d1f..00000000 --- a/dist/pesde/luau/rbx-components/src/extend-root/use-component.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -local function useComponent(root: types.RootPrivate, component: types.AnyComponent) - table.insert(root._classes, component) - return root -end - -return useComponent diff --git a/dist/pesde/luau/rbx-components/src/extend-root/use-components.luau b/dist/pesde/luau/rbx-components/src/extend-root/use-components.luau deleted file mode 100644 index 809a4006..00000000 --- a/dist/pesde/luau/rbx-components/src/extend-root/use-components.luau +++ /dev/null @@ -1,10 +0,0 @@ -local types = require("../types") - -local function useComponents(root: types.RootPrivate, components: { types.AnyComponent }) - for index = 1, #components do - table.insert(root._classes, components[index]) - end - return root -end - -return useComponents diff --git a/dist/pesde/luau/rbx-components/src/extend-root/use-module-as-component.luau b/dist/pesde/luau/rbx-components/src/extend-root/use-module-as-component.luau deleted file mode 100644 index 46724fe7..00000000 --- a/dist/pesde/luau/rbx-components/src/extend-root/use-module-as-component.luau +++ /dev/null @@ -1,12 +0,0 @@ -local componentClasses = require("../component-classes") -local types = require("../types") - -local function useModuleAsComponent(root: types.RootPrivate, module: ModuleScript) - local required = (require)(module) - if componentClasses[required] then - table.insert(root, required) - end - return root -end - -return useModuleAsComponent diff --git a/dist/pesde/luau/rbx-components/src/extend-root/use-modules-as-components.luau b/dist/pesde/luau/rbx-components/src/extend-root/use-modules-as-components.luau deleted file mode 100644 index bababafa..00000000 --- a/dist/pesde/luau/rbx-components/src/extend-root/use-modules-as-components.luau +++ /dev/null @@ -1,28 +0,0 @@ -local componentClasses = require("../component-classes") -local types = require("../types") - -local function useModulesAsComponents( - root: types.RootPrivate, - modules: { Instance }, - predicate: ((ModuleScript) -> boolean)? -) - for index = 1, #modules do - local module = modules[index] - - if not module:IsA("ModuleScript") then - continue - end - - if predicate and not predicate(module) then - continue - end - - local required = (require)(module) - if componentClasses[required] then - table.insert(root, required) - end - end - return root -end - -return useModulesAsComponents diff --git a/dist/pesde/luau/rbx-components/src/init.luau b/dist/pesde/luau/rbx-components/src/init.luau deleted file mode 100644 index 598bcea4..00000000 --- a/dist/pesde/luau/rbx-components/src/init.luau +++ /dev/null @@ -1,24 +0,0 @@ -local componentClasses = require("@self/component-classes") -local create = require("@self/create") -local extendRoot = require("@self/extend-root") -local types = require("@self/types") - -export type Component = types.Component -export type Root = types.Root - -local components = { - create = create, - extendRoot = extendRoot, - _ = table.freeze({ - componentClasses = componentClasses, - }), -} - -local mt = {} - -function mt.__call(_, component: Self): types.Component - return create(component) -end - -table.freeze(mt) -return table.freeze(setmetatable(components, mt)) diff --git a/dist/pesde/luau/rbx-components/src/logger.luau b/dist/pesde/luau/rbx-components/src/logger.luau deleted file mode 100644 index edcc7fac..00000000 --- a/dist/pesde/luau/rbx-components/src/logger.luau +++ /dev/null @@ -1,8 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/rbx-components", logger.standardErrorInfoUrl("rbx-components"), { - alreadyExtendedRoot = "Root already has component extension.", - invalidComponent = "Not a component, create one with `components(MyComponent)` or `components.create(MyComponent)`.", - alreadyRegisteredComponent = "Component already registered.", - multipleSameTag = "Multiple components use the CollectionService tag '%s', which is likely a mistake. Supress this warning with `_G.PRVDMWRONG_SUPPRESS_MULTIPLE_SAME_TAG = true`.", -}) diff --git a/dist/pesde/luau/roots/LICENSE.md b/dist/pesde/luau/roots/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/luau/roots/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/luau/roots/dependencies.luau b/dist/pesde/luau/roots/dependencies.luau deleted file mode 100644 index 61b0667d..00000000 --- a/dist/pesde/luau/roots/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./luau_packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/pesde/luau/roots/lifecycles.luau b/dist/pesde/luau/roots/lifecycles.luau deleted file mode 100644 index a79c5172..00000000 --- a/dist/pesde/luau/roots/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./luau_packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/pesde/luau/roots/logger.luau b/dist/pesde/luau/roots/logger.luau deleted file mode 100644 index 527ed682..00000000 --- a/dist/pesde/luau/roots/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./luau_packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/pesde/luau/roots/pesde.toml b/dist/pesde/luau/roots/pesde.toml deleted file mode 100644 index f79259d3..00000000 --- a/dist/pesde/luau/roots/pesde.toml +++ /dev/null @@ -1,58 +0,0 @@ -authors = ["Fire "] -description = "Roots implementation for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "logger.luau", - "dependencies.luau", - "runtime.luau", - "providers.luau", - "lifecycles.luau", - "logger.luau", - "dependencies.luau", - "runtime.luau", - "providers.luau", - "lifecycles.luau", - "logger.luau", - "dependencies.luau", - "runtime.luau", - "providers.luau", - "lifecycles.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/roots" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "logger.luau", - "dependencies.luau", - "runtime.luau", - "providers.luau", - "lifecycles.luau", - "logger.luau", - "dependencies.luau", - "runtime.luau", - "providers.luau", - "lifecycles.luau", - "logger.luau", - "dependencies.luau", - "runtime.luau", - "providers.luau", - "lifecycles.luau", -] -environment = "luau" -lib = "src/init.luau" -[dependencies] -logger = { workspace = "prvdmwrong/logger", version = "0.2.0-rc.4" } -dependencies = { workspace = "prvdmwrong/dependencies", version = "0.2.0-rc.4" } -providers = { workspace = "prvdmwrong/providers", version = "0.2.0-rc.4" } -lifecycles = { workspace = "prvdmwrong/lifecycles", version = "0.2.0-rc.4" } -runtime = { workspace = "prvdmwrong/runtime", version = "0.2.0-rc.4" } diff --git a/dist/pesde/luau/roots/providers.luau b/dist/pesde/luau/roots/providers.luau deleted file mode 100644 index 46125aaa..00000000 --- a/dist/pesde/luau/roots/providers.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./luau_packages/providers") -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/pesde/luau/roots/runtime.luau b/dist/pesde/luau/roots/runtime.luau deleted file mode 100644 index 0345a532..00000000 --- a/dist/pesde/luau/roots/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./luau_packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/pesde/luau/roots/src/create.luau b/dist/pesde/luau/roots/src/create.luau deleted file mode 100644 index 26c14f4e..00000000 --- a/dist/pesde/luau/roots/src/create.luau +++ /dev/null @@ -1,47 +0,0 @@ -local destroy = require("./methods/destroy") -local lifecycles = require("../lifecycles") -local rootConstructing = require("./hooks/root-constructing") -local start = require("./methods/start") -local types = require("./types") -local useModule = require("./methods/use-module") -local useModules = require("./methods/use-modules") -local useProvider = require("./methods/use-provider") -local useProviders = require("./methods/use-providers") -local useRoot = require("./methods/use-root") -local useRoots = require("./methods/use-roots") -local willFinish = require("./methods/will-finish") -local willStart = require("./methods/will-start") - -local function create(): types.Root - local self: types.Self = { - type = "Root", - - start = start, - - useProvider = useProvider, - useProviders = useProviders, - useModule = useModule, - useModules = useModules, - useRoot = useRoot, - useRoots = useRoots, - destroy = destroy, - - willStart = willStart, - willFinish = willFinish, - - _destroyed = false, - _rootProviders = {}, - _rootLifecycles = {}, - _subRoots = {}, - _start = lifecycles.create("start", lifecycles.handlers.fireConcurrent), - _finish = lifecycles.create("destroy", lifecycles.handlers.fireSequential), - } :: any - - for _, callback in rootConstructing.callbacks do - callback(self) - end - - return self -end - -return create diff --git a/dist/pesde/luau/roots/src/hooks/lifecycle-used.luau b/dist/pesde/luau/roots/src/hooks/lifecycle-used.luau deleted file mode 100644 index bd29276a..00000000 --- a/dist/pesde/luau/roots/src/hooks/lifecycle-used.luau +++ /dev/null @@ -1,16 +0,0 @@ -local lifecycles = require("../../lifecycles") -local types = require("../types") - -local callbacks: { (root: types.Self, provider: lifecycles.Lifecycle) -> () } = {} - -local function onLifecycleUsed(listener: (root: types.Root, lifecycle: lifecycles.Lifecycle) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleUsed = onLifecycleUsed, -}) diff --git a/dist/pesde/luau/roots/src/hooks/provider-used.luau b/dist/pesde/luau/roots/src/hooks/provider-used.luau deleted file mode 100644 index dac2573c..00000000 --- a/dist/pesde/luau/roots/src/hooks/provider-used.luau +++ /dev/null @@ -1,16 +0,0 @@ -local providers = require("../../providers") -local types = require("../types") - -local callbacks: { (root: types.Self, provider: providers.Provider) -> () } = {} - -local function onProviderUsed(listener: (root: types.Root, provider: providers.Provider) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onProviderUsed = onProviderUsed, -}) diff --git a/dist/pesde/luau/roots/src/hooks/root-constructing.luau b/dist/pesde/luau/roots/src/hooks/root-constructing.luau deleted file mode 100644 index 5fb8b819..00000000 --- a/dist/pesde/luau/roots/src/hooks/root-constructing.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self) -> () } = {} - -local function onRootConstructing(listener: (root: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootConstructing = onRootConstructing, -}) diff --git a/dist/pesde/luau/roots/src/hooks/root-destroyed.luau b/dist/pesde/luau/roots/src/hooks/root-destroyed.luau deleted file mode 100644 index 10b79b54..00000000 --- a/dist/pesde/luau/roots/src/hooks/root-destroyed.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self) -> () } = {} - -local function onRootDestroyed(listener: (root: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootDestroyed = onRootDestroyed, -}) diff --git a/dist/pesde/luau/roots/src/hooks/root-started.luau b/dist/pesde/luau/roots/src/hooks/root-started.luau deleted file mode 100644 index 2ae6f90c..00000000 --- a/dist/pesde/luau/roots/src/hooks/root-started.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self) -> () } = {} - -local function onRootStarted(listener: (root: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootStarted = onRootStarted, -}) diff --git a/dist/pesde/luau/roots/src/index.d.ts b/dist/pesde/luau/roots/src/index.d.ts deleted file mode 100644 index d8e100c5..00000000 --- a/dist/pesde/luau/roots/src/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Lifecycle } from "../lifecycles"; -import { Provider } from "../providers"; - -declare namespace roots { - export type Root = { - type: "Root"; - - start(): StartedRoot; - - useModule(module: ModuleScript): Root; - useModules(modules: Instance[], predicate?: (module: ModuleScript) => boolean): Root; - useRoot(root: Root): Root; - useRoots(roots: Root[]): Root; - useProvider(provider: Provider): Root; - useProviders(providers: Provider[]): Root; - useLifecycle(lifecycle: Lifecycle): Root; - useLifecycles(lifecycles: Lifecycle): Root; - destroy(): void; - - willStart(callback: () => void): Root; - willFinish(callback: () => void): Root; - }; - - export type StartedRoot = { - type: "StartedRoot"; - - finish(): void; - }; - - export function create(): Root; - - export namespace hooks { - export function onLifecycleUsed(listener: (lifecycle: Lifecycle) => void): () => void; - export function onProviderUsed(listener: (provider: Provider) => void): () => void; - export function onRootUsed(listener: (root: Root, subRoot: Root) => void): () => void; - - export function onRootConstructing(listener: (root: Root) => void): () => void; - export function onRootStarted(listener: (root: Root) => void): () => void; - export function onRootFinished(listener: (root: Root) => void): () => void; - export function onRootDestroyed(listener: (root: Root) => void): () => void; - } -} - -export = roots; -export as namespace roots; diff --git a/dist/pesde/luau/roots/src/init.luau b/dist/pesde/luau/roots/src/init.luau deleted file mode 100644 index f6aa7495..00000000 --- a/dist/pesde/luau/roots/src/init.luau +++ /dev/null @@ -1,28 +0,0 @@ -local create = require("@self/create") -local lifecycleUsed = require("@self/hooks/lifecycle-used") -local providerUsed = require("@self/hooks/provider-used") -local rootConstructing = require("@self/hooks/root-constructing") -local rootDestroyed = require("@self/hooks/root-destroyed") -local rootFinished = require("@self/hooks/root-finished") -local rootStarted = require("@self/hooks/root-started") -local rootUsed = require("@self/hooks/root-used") -local types = require("@self/types") - -export type Root = types.Root -export type StartedRoot = types.StartedRoot - -local roots = table.freeze({ - create = create, - hooks = table.freeze({ - onLifecycleUsed = lifecycleUsed.onLifecycleUsed, - onProviderUsed = providerUsed.onProviderUsed, - onRootUsed = rootUsed.onRootUsed, - - onRootConstructing = rootConstructing.onRootConstructing, - onRootStarted = rootStarted.onRootStarted, - onRootFinished = rootFinished.onRootFinished, - onRootDestroyed = rootDestroyed.onRootDestroyed, - }), -}) - -return roots diff --git a/dist/pesde/luau/roots/src/logger.luau b/dist/pesde/luau/roots/src/logger.luau deleted file mode 100644 index 92e611ef..00000000 --- a/dist/pesde/luau/roots/src/logger.luau +++ /dev/null @@ -1,7 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/roots", logger.standardErrorInfoUrl("roots"), { - useAfterDestroy = "Cannot use Root after it is destroyed.", - alreadyDestroyed = "Cannot destroy an already destroyed Root.", - alreadyFinished = "Root has already finished.", -}) diff --git a/dist/pesde/luau/roots/src/methods/destroy.luau b/dist/pesde/luau/roots/src/methods/destroy.luau deleted file mode 100644 index 0c62a935..00000000 --- a/dist/pesde/luau/roots/src/methods/destroy.luau +++ /dev/null @@ -1,16 +0,0 @@ -local logger = require("../logger") -local types = require("../types") - -local function destroy(root: types.Self) - if root._destroyed then - logger:fatalError({ template = logger.alreadyDestroyed }) - end - root._destroyed = true - table.clear(root._rootLifecycles) - table.clear(root._rootProviders) - table.clear(root._subRoots) - root._start:clear() - root._finish:clear() -end - -return destroy diff --git a/dist/pesde/luau/roots/src/methods/start.luau b/dist/pesde/luau/roots/src/methods/start.luau deleted file mode 100644 index 3f24dac5..00000000 --- a/dist/pesde/luau/roots/src/methods/start.luau +++ /dev/null @@ -1,102 +0,0 @@ -local dependencies = require("../../dependencies") -local lifecycles = require("../../lifecycles") -local logger = require("../logger") -local providers = require("../../providers") -local rootFinished = require("../hooks/root-finished").callbacks -local rootStarted = require("../hooks/root-started").callbacks -local types = require("../types") - -local function bindLifecycle(lifecycle: lifecycles.Lifecycle<...any>, provider: providers.Provider) - local lifecycleMethod = (provider :: any)[lifecycle.method] - if typeof(lifecycleMethod) == "function" then - -- local isProfiling = _G.PRVDMWRONG_PROFILE_LIFECYCLES - - -- if isProfiling then - -- lifecycle:register(function(...) - -- debug.profilebegin(memoryCategory) - -- debug.setmemorycategory(memoryCategory) - -- lifecycleMethod(provider, ...) - -- debug.resetmemorycategory() - -- debug.profileend() - -- end) - -- else - lifecycle:register(function(...) - lifecycleMethod(provider, ...) - end) - -- end - end -end - -local function nameOf(provider: providers.Provider, extension: string?): string - return if extension then `{tostring(provider)}.{extension}` else tostring(provider) -end - -local function start(root: types.Self): types.StartedRoot - local processed = dependencies.processDependencies(root._rootProviders) - local sortedProviders = processed.sortedDependencies :: { providers.Provider } - local processedLifecycles = processed.lifecycles - table.move(root._rootLifecycles, 1, #root._rootLifecycles, #processedLifecycles + 1, processedLifecycles) - - dependencies.sortByPriority(sortedProviders) - - local constructedProviders = {} - for _, provider in sortedProviders do - local providerDependencies = (provider :: any).dependencies - if typeof(providerDependencies) == "table" then - providerDependencies = table.clone(providerDependencies) - for key, value in providerDependencies do - providerDependencies[key] = constructedProviders[value] - end - end - - local constructed = provider.new(providerDependencies) - constructedProviders[provider] = constructed - bindLifecycle(root._start, constructed) - bindLifecycle(root._finish, constructed) - - for _, lifecycle in processedLifecycles do - bindLifecycle(lifecycle, constructed) - end - end - - local subRoots: { types.StartedRoot } = {} - for root in root._subRoots do - table.insert(subRoots, root:start()) - end - - root._start:fire() - - local startedRoot = {} :: types.StartedRoot - startedRoot.type = "StartedRoot" - - local didFinish = false - - function startedRoot:finish() - if didFinish then - return logger:fatalError({ template = logger.alreadyFinished }) - end - - didFinish = true - root._finish:fire() - - -- NOTE(znotfireman): Assume the user cleans up their own lifecycles - root._start:clear() - root._finish:clear() - - for _, subRoot in subRoots do - subRoot:finish() - end - - for _, hook in rootFinished do - hook(root) - end - end - - for _, hook in rootStarted do - hook(root) - end - - return startedRoot -end - -return start diff --git a/dist/pesde/luau/roots/src/methods/use-lifecycle.luau b/dist/pesde/luau/roots/src/methods/use-lifecycle.luau deleted file mode 100644 index 862c2d07..00000000 --- a/dist/pesde/luau/roots/src/methods/use-lifecycle.luau +++ /dev/null @@ -1,14 +0,0 @@ -local lifecycleUsed = require("../hooks/lifecycle-used").callbacks -local lifecycles = require("../../lifecycles") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useLifecycle(root: types.Self, lifecycle: lifecycles.Lifecycle) - table.insert(root._rootLifecycles, lifecycle) - threadpool.spawnCallbacks(lifecycleUsed, root, lifecycle) - return root -end - -return useLifecycle diff --git a/dist/pesde/luau/roots/src/methods/use-lifecycles.luau b/dist/pesde/luau/roots/src/methods/use-lifecycles.luau deleted file mode 100644 index 3f12341f..00000000 --- a/dist/pesde/luau/roots/src/methods/use-lifecycles.luau +++ /dev/null @@ -1,16 +0,0 @@ -local lifecycleUsed = require("../hooks/lifecycle-used").callbacks -local lifecycles = require("../../lifecycles") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useLifecycles(root: types.Self, lifecycles: { lifecycles.Lifecycle }) - for _, lifecycle in lifecycles do - table.insert(root._rootLifecycles, lifecycle) - threadpool.spawnCallbacks(lifecycleUsed, root, lifecycle) - end - return root -end - -return useLifecycles diff --git a/dist/pesde/luau/roots/src/methods/use-module.luau b/dist/pesde/luau/roots/src/methods/use-module.luau deleted file mode 100644 index a96b3d17..00000000 --- a/dist/pesde/luau/roots/src/methods/use-module.luau +++ /dev/null @@ -1,23 +0,0 @@ -local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool -local providerClasses = providers._.providerClasses - -local function useModule(root: types.Self, module: ModuleScript) - local moduleExport = (require)(module) - - if providerClasses[moduleExport] then - root._rootProviders[moduleExport] = true - if typeof(moduleExport.name) ~= "string" then - moduleExport.name = module.Name - end - threadpool.spawnCallbacks(providerUsed, root, moduleExport) - end - - return root -end - -return useModule diff --git a/dist/pesde/luau/roots/src/methods/use-modules.luau b/dist/pesde/luau/roots/src/methods/use-modules.luau deleted file mode 100644 index 8354a9d0..00000000 --- a/dist/pesde/luau/roots/src/methods/use-modules.luau +++ /dev/null @@ -1,28 +0,0 @@ -local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool -local providerClasses = providers._.providerClasses - -local function useModules(root: types.Self, modules: { Instance }, predicate: ((module: ModuleScript) -> boolean)?) - for _, module in modules do - if not module:IsA("ModuleScript") or predicate and not predicate(module) then - continue - end - - local moduleExport = (require)(module) - if providerClasses[moduleExport] then - root._rootProviders[moduleExport] = true - if typeof(moduleExport.name) ~= "string" then - moduleExport.name = module.Name - end - threadpool.spawnCallbacks(providerUsed, root, moduleExport) - end - end - - return root -end - -return useModules diff --git a/dist/pesde/luau/roots/src/methods/use-provider.luau b/dist/pesde/luau/roots/src/methods/use-provider.luau deleted file mode 100644 index 277d8049..00000000 --- a/dist/pesde/luau/roots/src/methods/use-provider.luau +++ /dev/null @@ -1,14 +0,0 @@ -local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useProvider(root: types.Self, provider: providers.Provider) - root._rootProviders[provider] = true - threadpool.spawnCallbacks(providerUsed, root, provider) - return root -end - -return useProvider diff --git a/dist/pesde/luau/roots/src/methods/use-providers.luau b/dist/pesde/luau/roots/src/methods/use-providers.luau deleted file mode 100644 index 1489c3a3..00000000 --- a/dist/pesde/luau/roots/src/methods/use-providers.luau +++ /dev/null @@ -1,16 +0,0 @@ -local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useProviders(root: types.Self, providers: { providers.Provider }) - for _, provider in providers do - root._rootProviders[provider] = true - threadpool.spawnCallbacks(providerUsed, root, provider) - end - return root -end - -return useProviders diff --git a/dist/pesde/luau/roots/src/methods/will-finish.luau b/dist/pesde/luau/roots/src/methods/will-finish.luau deleted file mode 100644 index 893088f4..00000000 --- a/dist/pesde/luau/roots/src/methods/will-finish.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -local function willFinish(root: types.Self, callback: () -> ()) - root._finish:register(callback) - return root -end - -return willFinish diff --git a/dist/pesde/luau/roots/src/methods/will-start.luau b/dist/pesde/luau/roots/src/methods/will-start.luau deleted file mode 100644 index 7c3d88c3..00000000 --- a/dist/pesde/luau/roots/src/methods/will-start.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -local function willStart(root: types.Self, callback: () -> ()) - root._start:register(callback) - return root -end - -return willStart diff --git a/dist/pesde/luau/roots/src/types.luau b/dist/pesde/luau/roots/src/types.luau deleted file mode 100644 index 104143c4..00000000 --- a/dist/pesde/luau/roots/src/types.luau +++ /dev/null @@ -1,40 +0,0 @@ -local lifecycles = require("../lifecycles") -local providers = require("../providers") - -type Set = { [T]: true } - -export type Root = { - type: "Root", - - start: (root: Root) -> StartedRoot, - - useModule: (root: Root, module: ModuleScript) -> Root, - useModules: (root: Root, modules: { Instance }, predicate: ((ModuleScript) -> boolean)?) -> Root, - useRoot: (root: Root, root: Root) -> Root, - useRoots: (root: Root, roots: { Root }) -> Root, - useProvider: (root: Root, provider: providers.Provider) -> Root, - useProviders: (root: Root, providers: { providers.Provider }) -> Root, - useLifecycle: (root: Root, lifecycle: lifecycles.Lifecycle) -> Root, - useLifecycles: (root: Root, lifecycles: { lifecycles.Lifecycle }) -> Root, - destroy: (root: Root) -> (), - - willStart: (callback: () -> ()) -> Root, - willFinish: (callback: () -> ()) -> Root, -} - -export type StartedRoot = { - type: "StartedRoot", - - finish: (root: StartedRoot) -> (), -} - -export type Self = Root & { - _destroyed: boolean, - _rootProviders: Set>, - _rootLifecycles: { lifecycles.Lifecycle }, - _subRoots: Set, - _start: lifecycles.Lifecycle<()>, - _finish: lifecycles.Lifecycle<()>, -} - -return nil diff --git a/dist/pesde/luau/runtime/LICENSE.md b/dist/pesde/luau/runtime/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/luau/runtime/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/luau/runtime/pesde.toml b/dist/pesde/luau/runtime/pesde.toml deleted file mode 100644 index dd2cf1bf..00000000 --- a/dist/pesde/luau/runtime/pesde.toml +++ /dev/null @@ -1,21 +0,0 @@ -authors = ["Fire "] -description = "Runtime agnostic libraries for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", -] -license = "MPL-2.0" -name = "prvdmwrong/runtime" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = ["src"] -environment = "luau" -lib = "src/init.luau" -[dependencies] diff --git a/dist/pesde/luau/runtime/src/batteries/threadpool.luau b/dist/pesde/luau/runtime/src/batteries/threadpool.luau deleted file mode 100644 index 6caf08b4..00000000 --- a/dist/pesde/luau/runtime/src/batteries/threadpool.luau +++ /dev/null @@ -1,38 +0,0 @@ -local task = require("../libs/task") - -local freeThreads: { thread } = {} - -local function run(f: (T...) -> (), thread: thread, ...) - f(...) - table.insert(freeThreads, thread) -end - -local function yielder() - while true do - run(coroutine.yield()) - end -end - -local function spawn(f: (T...) -> (), ...: T...) - local thread - if #freeThreads > 0 then - thread = freeThreads[#freeThreads] - freeThreads[#freeThreads] = nil - else - thread = coroutine.create(yielder) - coroutine.resume(thread) - end - - task.spawn(thread, f, thread, ...) -end - -local function spawnCallbacks(callbacks: { (Args...) -> () }, ...: Args...) - for _, callback in callbacks do - spawn(callback, ...) - end -end - -return table.freeze({ - spawn = spawn, - spawnCallbacks = spawnCallbacks, -}) diff --git a/dist/pesde/luau/runtime/src/implementations/init.luau b/dist/pesde/luau/runtime/src/implementations/init.luau deleted file mode 100644 index 28dbe015..00000000 --- a/dist/pesde/luau/runtime/src/implementations/init.luau +++ /dev/null @@ -1,56 +0,0 @@ -local types = require("@self/../types") - -type Implementation = { new: (() -> T)?, implementation: T? } - -export type RuntimeName = "roblox" | "luau" | "lune" | "lute" | "seal" | "zune" - -local supportedRuntimes = table.freeze({ - roblox = require("@self/roblox"), - luau = require("@self/luau"), - lune = require("@self/lune"), - lute = require("@self/lute"), - seal = require("@self/seal"), - zune = require("@self/zune"), -}) - -local currentRuntime: types.Runtime = nil -do - for _, runtime in supportedRuntimes :: { [string]: types.Runtime } do - local isRuntime = runtime.is() - if isRuntime then - local currentRuntimePriority = currentRuntime and currentRuntime.priority or 0 - local runtimePriority = runtime.priority or 0 - if currentRuntimePriority <= runtimePriority then - currentRuntime = runtime - end - end - end - assert(currentRuntime, "No supported runtime") -end - -local currentRuntimeName: RuntimeName = currentRuntime.name :: any - -local function notImplemented(functionName: string) - return function() - error(`'{functionName}' is not implemented by runtime '{currentRuntimeName}'`, 2) - end -end - -local function implementFunction(label: string, implementations: { [types.Runtime]: Implementation? }): T - local implementation = implementations[currentRuntime] - if implementation then - if implementation.new then - return implementation.new() - elseif implementation.implementation then - return implementation.implementation - end - end - return notImplemented(label) :: any -end - -return table.freeze({ - supportedRuntimes = supportedRuntimes, - currentRuntime = currentRuntime, - currentRuntimeName = currentRuntimeName, - implementFunction = implementFunction, -}) diff --git a/dist/pesde/luau/runtime/src/implementations/init.spec.luau b/dist/pesde/luau/runtime/src/implementations/init.spec.luau deleted file mode 100644 index 3ce91cbb..00000000 --- a/dist/pesde/luau/runtime/src/implementations/init.spec.luau +++ /dev/null @@ -1,81 +0,0 @@ -local implementations = require("@self/../implementations") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("currentRuntime", function() - test("detects lune runtime", function() - expect(implementations.currentRuntimeName).is("lune") - expect(implementations.currentRuntime).is(implementations.supportedRuntimes.lune) - end) - end) - - describe("implementFunction", function() - test("implements for lune runtime", function() - local lune = function() end - local luau = function() end - - local implementation = implementations.implementFunction("implementation", { - [implementations.supportedRuntimes.lune] = { - implementation = lune, - }, - [implementations.supportedRuntimes.luau] = { - implementation = luau, - }, - }) - - expect(implementation).is_a("function") - expect(implementation).never_is(luau) - expect(implementation).is(lune) - end) - - test("constructs for lune runtime", function() - local lune = function() end - local luau = function() end - - local constructedLune = false - - local implementation = implementations.implementFunction("implementation", { - [implementations.supportedRuntimes.lune] = { - new = function() - constructedLune = true - return lune - end, - }, - [implementations.supportedRuntimes.luau] = { - new = function() - return luau - end, - }, - }) - - expect(implementation).is_a("function") - expect(implementation).never_is(luau) - expect(implementation).is(lune) - expect(constructedLune).is_true() - end) - - test("defaults to not implemented function", function() - local constructSuccess, runSuccess = false, false - - local implementation = implementations.implementFunction("implementation", { - [implementations.supportedRuntimes.roblox] = { - new = function() - constructSuccess = true - return function() - runSuccess = true - end - end, - }, - }) - - expect(constructSuccess).is(false) - expect(implementation).is_a("function") - expect(implementation).fails_with("'implementation' is not implemented by runtime 'lune'") - expect(runSuccess).is(false) - end) - end) -end diff --git a/dist/pesde/luau/runtime/src/implementations/luau.luau b/dist/pesde/luau/runtime/src/implementations/luau.luau deleted file mode 100644 index c67e52f4..00000000 --- a/dist/pesde/luau/runtime/src/implementations/luau.luau +++ /dev/null @@ -1,9 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "luau", - priority = -1, - is = function() - return true - end, -}) diff --git a/dist/pesde/luau/runtime/src/implementations/lune.luau b/dist/pesde/luau/runtime/src/implementations/lune.luau deleted file mode 100644 index f49834eb..00000000 --- a/dist/pesde/luau/runtime/src/implementations/lune.luau +++ /dev/null @@ -1,10 +0,0 @@ -local types = require("../types") - -local LUNE_VERSION_FORMAT = "(Lune) (%d+%.%d+%.%d+.*)+(%d+)" - -return types.Runtime({ - name = "lune", - is = function() - return string.match(_VERSION, LUNE_VERSION_FORMAT) ~= nil - end, -}) diff --git a/dist/pesde/luau/runtime/src/implementations/lute.luau b/dist/pesde/luau/runtime/src/implementations/lute.luau deleted file mode 100644 index 7b6abc58..00000000 --- a/dist/pesde/luau/runtime/src/implementations/lute.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "lute", - is = function() - return false - end, -}) diff --git a/dist/pesde/luau/runtime/src/implementations/roblox.luau b/dist/pesde/luau/runtime/src/implementations/roblox.luau deleted file mode 100644 index 91a780e2..00000000 --- a/dist/pesde/luau/runtime/src/implementations/roblox.luau +++ /dev/null @@ -1,9 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "roblox", - is = function() - -- wtf - return not not (_VERSION == "Luau" and game and workspace) - end, -}) diff --git a/dist/pesde/luau/runtime/src/implementations/seal.luau b/dist/pesde/luau/runtime/src/implementations/seal.luau deleted file mode 100644 index 0a72684c..00000000 --- a/dist/pesde/luau/runtime/src/implementations/seal.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "seal", - is = function() - return false - end, -}) diff --git a/dist/pesde/luau/runtime/src/implementations/zune.luau b/dist/pesde/luau/runtime/src/implementations/zune.luau deleted file mode 100644 index 48243e05..00000000 --- a/dist/pesde/luau/runtime/src/implementations/zune.luau +++ /dev/null @@ -1,10 +0,0 @@ -local types = require("../types") - -local ZUNE_VERSION_FORMAT = "(Zune) (%d+%.%d+%.%d+.*)+(%d+%.%d+)" - -return types.Runtime({ - name = "zune", - is = function() - return string.match(_VERSION, ZUNE_VERSION_FORMAT) ~= nil - end, -}) diff --git a/dist/pesde/luau/runtime/src/index.d.ts b/dist/pesde/luau/runtime/src/index.d.ts deleted file mode 100644 index b227b952..00000000 --- a/dist/pesde/luau/runtime/src/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -declare namespace runtime { - export type RuntimeName = "roblox" | "luau" | "lune" | "lute" | "seal" | "zune"; - - export const name: RuntimeName; - - export namespace task { - export function cancel(thread: thread): void; - - export function defer(functionOrThread: (...args: T) => void, ...args: T): thread; - export function defer(functionOrThread: thread): thread; - export function defer( - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function delay( - duration: number, - functionOrThread: (...args: T) => void, - ...args: T - ): thread; - export function delay(duration: number, functionOrThread: thread): thread; - export function delay( - duration: number, - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function spawn(functionOrThread: (...args: T) => void, ...args: T): thread; - export function spawn(functionOrThread: thread): thread; - export function spawn( - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function wait(duration: number): number; - } - - export function warn(...args: T): void; - - export namespace threadpool { - export function spawn(f: (...args: T) => void, ...args: T): void; - export function spawnCallbacks(functions: ((...args: T) => void)[], ...args: T): void; - } -} - -export = runtime; -export as namespace runtime; diff --git a/dist/pesde/luau/runtime/src/init.luau b/dist/pesde/luau/runtime/src/init.luau deleted file mode 100644 index 26bdeee0..00000000 --- a/dist/pesde/luau/runtime/src/init.luau +++ /dev/null @@ -1,15 +0,0 @@ -local implementations = require("@self/implementations") -local task = require("@self/libs/task") -local threadpool = require("@self/batteries/threadpool") -local warn = require("@self/libs/warn") - -export type RuntimeName = implementations.RuntimeName - -return table.freeze({ - name = implementations.currentRuntimeName, - - task = task, - warn = warn, - - threadpool = threadpool, -}) diff --git a/dist/pesde/luau/runtime/src/libs/task.luau b/dist/pesde/luau/runtime/src/libs/task.luau deleted file mode 100644 index 28c1ac9e..00000000 --- a/dist/pesde/luau/runtime/src/libs/task.luau +++ /dev/null @@ -1,157 +0,0 @@ -local implementations = require("../implementations") - -export type TaskLib = { - cancel: (thread) -> (), - defer: (functionOrThread: thread | (T...) -> (), T...) -> thread, - delay: (duration: number, functionOrThread: thread | (T...) -> (), T...) -> thread, - spawn: (functionOrThread: thread | (T...) -> (), T...) -> thread, - wait: (duration: number?) -> number, -} - -local supportedRuntimes = implementations.supportedRuntimes -local implementFunction = implementations.implementFunction - -local function defaultSpawn(functionOrThread: thread | (T...) -> (), ...: T...): thread - if type(functionOrThread) == "thread" then - coroutine.resume(functionOrThread, ...) - return functionOrThread - else - local thread = coroutine.create(functionOrThread) - coroutine.resume(thread, ...) - return thread - end -end - -local function defaultWait(seconds: number?) - local startTime = os.clock() - local endTime = startTime + (seconds or 1) - local clockTime: number - repeat - clockTime = os.clock() - until clockTime >= endTime - return clockTime - startTime -end - -local task: TaskLib = table.freeze({ - cancel = implementFunction("task.wait", { - [supportedRuntimes.roblox] = { - new = function() - return task.cancel - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").cancel - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").cancel - end, - }, - [supportedRuntimes.luau] = { - implementation = function(thread) - if not coroutine.close(thread) then - error(debug.traceback(thread, "Could not cancel thread")) - end - end, - }, - }), - defer = implementFunction("task.defer", { - [supportedRuntimes.roblox] = { - new = function() - return task.defer :: any - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").defer - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").defer - end, - }, - [supportedRuntimes.luau] = { - implementation = defaultSpawn, - }, - }), - delay = implementFunction("task.delay", { - [supportedRuntimes.roblox] = { - new = function() - return task.delay :: any - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").delay - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").delay - end, - }, - [supportedRuntimes.luau] = { - implementation = function(duration: number, functionOrThread: thread | (T...) -> (), ...: T...): thread - return defaultSpawn( - if typeof(functionOrThread) == "function" - then function(duration, functionOrThread, ...) - defaultWait(duration) - functionOrThread(...) - end - else function(duration, functionOrThread, ...) - defaultWait(duration) - coroutine.resume(...) - end, - duration, - functionOrThread, - ... - ) - end, - }, - }), - spawn = implementFunction("task.spawn", { - [supportedRuntimes.roblox] = { - new = function() - return task.spawn :: any - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").spawn - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").spawn - end, - }, - [supportedRuntimes.luau] = { - implementation = defaultSpawn, - }, - }), - wait = implementFunction("task.wait", { - [supportedRuntimes.roblox] = { - new = function() - return task.wait - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").wait - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").wait - end, - }, - [supportedRuntimes.luau] = { - implementation = defaultWait, - }, - }), -}) - -return task diff --git a/dist/pesde/luau/runtime/src/libs/task.spec.luau b/dist/pesde/luau/runtime/src/libs/task.spec.luau deleted file mode 100644 index 0918e87f..00000000 --- a/dist/pesde/luau/runtime/src/libs/task.spec.luau +++ /dev/null @@ -1,62 +0,0 @@ -local luneTask = require("@lune/task") -local task = require("./task") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - --- FIXME: can't async stuff lol -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("task", function() - test("spawn", function() - expect(task.spawn).is(luneTask.spawn) - local spawned = false - - task.spawn(function() - spawned = true - end) - - expect(spawned).is_true() - end) - - test("defer", function() - expect(task.defer).is(luneTask.defer) - - -- local spawned = false - - -- task.defer(function() - -- spawned = true - -- end) - - -- expect(spawned).never_is_true() - end) - - test("delay", function() - expect(task.delay).is(luneTask.delay) - -- local spawned = false - - -- task.delay(0.25, function() - -- spawned = true - -- end) - - -- expect(spawned).never_is_true() - - -- local startTime = os.clock() - -- repeat - -- until os.clock() - startTime > 0.5 - - -- print(spawned) - - -- expect(spawned).is_true() - end) - - test("wait", function() - expect(task.wait).is(luneTask.wait) - end) - - test("cancel", function() - expect(task.cancel).is(luneTask.cancel) - end) - end) -end diff --git a/dist/pesde/luau/runtime/src/libs/warn.luau b/dist/pesde/luau/runtime/src/libs/warn.luau deleted file mode 100644 index 6a4837ac..00000000 --- a/dist/pesde/luau/runtime/src/libs/warn.luau +++ /dev/null @@ -1,27 +0,0 @@ -local implementations = require("../implementations") - -local supportedRuntimes = implementations.supportedRuntimes -local implementFunction = implementations.implementFunction - -local function tostringTuple(...: any) - local stringified = {} - for index = 1, select("#", ...) do - table.insert(stringified, tostring(select(index, ...))) - end - return table.concat(stringified, " ") -end - -local warn: (T...) -> () = implementFunction("warn", { - [supportedRuntimes.roblox] = { - new = function() - return warn - end, - }, - [supportedRuntimes.luau] = { - implementation = function(...: T...) - print(`\27[0;33m{tostringTuple(...)}\27[0m`) - end, - }, -}) - -return warn diff --git a/dist/pesde/luau/runtime/src/types.luau b/dist/pesde/luau/runtime/src/types.luau deleted file mode 100644 index ca050fce..00000000 --- a/dist/pesde/luau/runtime/src/types.luau +++ /dev/null @@ -1,13 +0,0 @@ -export type Runtime = { - name: string, - priority: number?, - is: () -> boolean, -} - -local function Runtime(x: Runtime) - return table.freeze(x) -end - -return table.freeze({ - Runtime = Runtime, -}) diff --git a/dist/pesde/luau/typecheckers/LICENSE.md b/dist/pesde/luau/typecheckers/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/luau/typecheckers/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/luau/typecheckers/pesde.toml b/dist/pesde/luau/typecheckers/pesde.toml deleted file mode 100644 index b8c44395..00000000 --- a/dist/pesde/luau/typecheckers/pesde.toml +++ /dev/null @@ -1,21 +0,0 @@ -authors = ["Fire "] -description = "Typechecking primitives and compatibility for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", -] -license = "MPL-2.0" -name = "prvdmwrong/typecheckers" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = ["src"] -environment = "luau" -lib = "src/init.luau" -[dependencies] diff --git a/dist/pesde/luau/typecheckers/src/init.luau b/dist/pesde/luau/typecheckers/src/init.luau deleted file mode 100644 index e69de29b..00000000 diff --git a/dist/pesde/lune/dependencies/LICENSE.md b/dist/pesde/lune/dependencies/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/lune/dependencies/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/lune/dependencies/lifecycles.luau b/dist/pesde/lune/dependencies/lifecycles.luau deleted file mode 100644 index 49a51bfa..00000000 --- a/dist/pesde/lune/dependencies/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./lune_packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/pesde/lune/dependencies/logger.luau b/dist/pesde/lune/dependencies/logger.luau deleted file mode 100644 index ddbd462d..00000000 --- a/dist/pesde/lune/dependencies/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./lune_packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/pesde/lune/dependencies/pesde.toml b/dist/pesde/lune/dependencies/pesde.toml deleted file mode 100644 index effecf44..00000000 --- a/dist/pesde/lune/dependencies/pesde.toml +++ /dev/null @@ -1,33 +0,0 @@ -authors = ["Fire "] -description = "Dependency resolution logic for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "lifecycles.luau", - "logger.luau", - "lifecycles.luau", - "logger.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/dependencies" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "lifecycles.luau", - "logger.luau", - "lifecycles.luau", - "logger.luau", -] -environment = "lune" -lib = "src/init.luau" -[dependencies] -lifecycles = { workspace = "prvdmwrong/lifecycles", version = "0.2.0-rc.4" } -logger = { workspace = "prvdmwrong/logger", version = "0.2.0-rc.4" } diff --git a/dist/pesde/lune/dependencies/src/depend.luau b/dist/pesde/lune/dependencies/src/depend.luau deleted file mode 100644 index 55230b4e..00000000 --- a/dist/pesde/lune/dependencies/src/depend.luau +++ /dev/null @@ -1,30 +0,0 @@ -local logger = require("./logger") -local types = require("./types") - -local function useBeforeConstructed(unresolved: types.UnresolvedDependency) - logger:fatalError({ template = logger.useBeforeConstructed, unresolved.dependency.name or "subdependency" }) -end - -local unresolvedMt = { - __metatable = "This metatable is locked.", - __index = useBeforeConstructed, - __newindex = useBeforeConstructed, -} - -function unresolvedMt:__tostring() - return "UnresolvedDependency" -end - --- Wtf luau -local function depend(dependency: types.Dependency): typeof(({} :: types.Dependency).new( - (nil :: any) :: Dependencies, - ... -)) - -- Return a mock value that will be resolved during dependency resolution. - return setmetatable({ - type = "UnresolvedDependency", - dependency = dependency, - }, unresolvedMt) :: any -end - -return depend diff --git a/dist/pesde/lune/dependencies/src/index.d.ts b/dist/pesde/lune/dependencies/src/index.d.ts deleted file mode 100644 index a5bddcde..00000000 --- a/dist/pesde/lune/dependencies/src/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Lifecycle } from "../lifecycles"; - -declare namespace dependencies { - export type Dependency = Self & { - dependencies: Dependencies, - priority?: number, - new(dependencies: Dependencies, ...args: NewArgs): Dependency; - }; - - interface ProccessDependencyResult { - sortedDependencies: Dependency[]; - lifecycles: Lifecycle[]; - } - - export type SubdependenciesOf = T extends { dependencies: infer Dependencies } - ? Dependencies - : never; - - export function depend InstanceType>(dependency: T): InstanceType; - export function processDependencies(dependencies: Set>): ProccessDependencyResult; - export function sortByPriority(dependencies: Dependency[]): void; -} - -export = dependencies; -export as namespace dependencies; diff --git a/dist/pesde/lune/dependencies/src/init.luau b/dist/pesde/lune/dependencies/src/init.luau deleted file mode 100644 index e6b27b24..00000000 --- a/dist/pesde/lune/dependencies/src/init.luau +++ /dev/null @@ -1,12 +0,0 @@ -local depend = require("@self/depend") -local processDependencies = require("@self/process-dependencies") -local sortByPriority = require("@self/sort-by-priority") -local types = require("@self/types") - -export type Dependency = types.Dependency - -return table.freeze({ - depend = depend, - processDependencies = processDependencies, - sortByPriority = sortByPriority, -}) diff --git a/dist/pesde/lune/dependencies/src/logger.luau b/dist/pesde/lune/dependencies/src/logger.luau deleted file mode 100644 index 22f3b307..00000000 --- a/dist/pesde/lune/dependencies/src/logger.luau +++ /dev/null @@ -1,7 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/dependencies", logger.standardErrorInfoUrl("dependencies"), { - useBeforeConstructed = "Cannot use %s before it is constructed. Are you using the dependency outside a class method?", - alreadyDestroyed = "Cannot destroy an already destroyed Root.", - alreadyFinished = "Root has already finished.", -}) diff --git a/dist/pesde/lune/dependencies/src/process-dependencies.luau b/dist/pesde/lune/dependencies/src/process-dependencies.luau deleted file mode 100644 index 20820a35..00000000 --- a/dist/pesde/lune/dependencies/src/process-dependencies.luau +++ /dev/null @@ -1,57 +0,0 @@ -local lifecycles = require("../lifecycles") -local types = require("./types") - -export type ProccessDependencyResult = { - sortedDependencies: { types.Dependency }, - lifecycles: { lifecycles.Lifecycle }, -} - -type Set = { [T]: true } - -local function processDependencies(dependencies: Set>): ProccessDependencyResult - local sortedDependencies = {} - local lifecycles = {} - - -- TODO: optimize ts - local function visitDependency(dependency: types.Dependency) - -- print("Visiting dependency", dependency) - - for key, value in dependency :: any do - if key == "dependencies" then - -- print("Checking [prvd.dependencies]") - if typeof(value) == "table" then - for key, value in value do - -- print("Checking key", key, "value", value) - if typeof(value) == "table" and value.type == "UnresolvedDependency" then - local unresolved: types.UnresolvedDependency = value - -- print("Got unresolved dependency", unresolved.dependency, "visiting") - visitDependency(unresolved.dependency) - end - end - end - - continue - end - - if typeof(value) == "table" and value.type == "Lifecycle" and not table.find(lifecycles, value) then - table.insert(lifecycles, value) - end - end - - if dependencies[dependency] and not table.find(sortedDependencies, dependency) then - -- print("Pushing to sort") - table.insert(sortedDependencies, dependency) - end - end - - for dependency in dependencies do - visitDependency(dependency) - end - - return { - sortedDependencies = sortedDependencies, - lifecycles = lifecycles, - } -end - -return processDependencies diff --git a/dist/pesde/lune/dependencies/src/process-dependencies.spec.luau b/dist/pesde/lune/dependencies/src/process-dependencies.spec.luau deleted file mode 100644 index 0fcfcac8..00000000 --- a/dist/pesde/lune/dependencies/src/process-dependencies.spec.luau +++ /dev/null @@ -1,67 +0,0 @@ -local depend = require("./depend") -local processDependencies = require("./process-dependencies") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - -local function nickname(name: string) - return function(tbl: T): T - return setmetatable(tbl :: any, { - __tostring = function() - return name - end, - }) - end -end - -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("processDependencies", function() - test("sortedDependencies", function() - local first = nickname("first")({}) - - local second = nickname("second")({ - dependencies = { - toFirst = depend(first :: any), - toFirstAgain = depend(first :: any), - }, - }) - - local third = nickname("third")({ - dependencies = { - toSecond = depend(second :: any), - }, - }) - - local fourth = nickname("fourth")({ - dependencies = { - toFirst = depend(first :: any), - toSecond = depend(second :: any), - toThird = depend(third :: any), - }, - }) - - local processed = processDependencies({ - [first] = true, - [second] = true, - [third] = true, - [fourth] = true, - } :: any) - - expect(typeof(processed)).is("table") - expect(processed).has_key("sortedDependencies") - expect(typeof(processed.sortedDependencies)).is("table") - - local sortedDependencies = processed.sortedDependencies - - expect(typeof(sortedDependencies)).is("table") - expect(sortedDependencies[1]).is(first) - expect(sortedDependencies[2]).is(second) - expect(sortedDependencies[3]).is(third) - expect(sortedDependencies[4]).is(fourth) - end) - - test("lifecycles", function() end) - end) -end diff --git a/dist/pesde/lune/dependencies/src/sort-by-priority.luau b/dist/pesde/lune/dependencies/src/sort-by-priority.luau deleted file mode 100644 index 638468ab..00000000 --- a/dist/pesde/lune/dependencies/src/sort-by-priority.luau +++ /dev/null @@ -1,14 +0,0 @@ -local types = require("./types") - -local function sortByPriority(dependencies: { types.Dependency }) - table.sort(dependencies, function(left: any, right: any) - if left.priority ~= right.priority then - return (left.priority or 1) > (right.priority or 1) - end - local leftIndex = table.find(dependencies, left) - local rightIndex = table.find(dependencies, right) - return leftIndex < rightIndex - end) -end - -return sortByPriority diff --git a/dist/pesde/lune/dependencies/src/sort-by-priority.spec.luau b/dist/pesde/lune/dependencies/src/sort-by-priority.spec.luau deleted file mode 100644 index eeb34933..00000000 --- a/dist/pesde/lune/dependencies/src/sort-by-priority.spec.luau +++ /dev/null @@ -1,52 +0,0 @@ -local sortByPriority = require("./sort-by-priority") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("sortByPriority", function() - test("dependencies", function() - local first = {} - - local second = { - toFirst = first, - } - - local third = { - toSecond = second, - } - - local sortedDependencies = { - first, - second, - third, - } - - sortByPriority(sortedDependencies :: any) - - expect(sortedDependencies[1]).is(first) - expect(sortedDependencies[2]).is(second) - expect(sortedDependencies[3]).is(third) - end) - - test("priority", function() - local low = {} - - local high = { - priority = 500, - } - - local sortedDependencies = { - low, - high, - } - - sortByPriority(sortedDependencies :: any) - - expect(sortedDependencies[1]).is(high) - expect(sortedDependencies[2]).is(low) - end) - end) -end diff --git a/dist/pesde/lune/dependencies/src/types.luau b/dist/pesde/lune/dependencies/src/types.luau deleted file mode 100644 index 2b1c72aa..00000000 --- a/dist/pesde/lune/dependencies/src/types.luau +++ /dev/null @@ -1,14 +0,0 @@ -export type Dependency = Self & { - dependencies: Dependencies, - priority: number?, - new: (dependencies: Dependencies, NewArgs...) -> Dependency, -} - -export type UnresolvedDependency = { - type: "UnresolvedDependency", - dependency: Dependency, -} - -export type dependencies = { __prvdmwrong_dependencies: never } - -return nil diff --git a/dist/pesde/lune/lifecycles/LICENSE.md b/dist/pesde/lune/lifecycles/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/lune/lifecycles/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/lune/lifecycles/logger.luau b/dist/pesde/lune/lifecycles/logger.luau deleted file mode 100644 index ddbd462d..00000000 --- a/dist/pesde/lune/lifecycles/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./lune_packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/pesde/lune/lifecycles/pesde.toml b/dist/pesde/lune/lifecycles/pesde.toml deleted file mode 100644 index aff7cd1e..00000000 --- a/dist/pesde/lune/lifecycles/pesde.toml +++ /dev/null @@ -1,33 +0,0 @@ -authors = ["Fire "] -description = "Provider method lifecycles implementation for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "logger.luau", - "runtime.luau", - "logger.luau", - "runtime.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/lifecycles" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "logger.luau", - "runtime.luau", - "logger.luau", - "runtime.luau", -] -environment = "lune" -lib = "src/init.luau" -[dependencies] -logger = { workspace = "prvdmwrong/logger", version = "0.2.0-rc.4" } -runtime = { workspace = "prvdmwrong/runtime", version = "0.2.0-rc.4" } diff --git a/dist/pesde/lune/lifecycles/runtime.luau b/dist/pesde/lune/lifecycles/runtime.luau deleted file mode 100644 index 8e63a7a0..00000000 --- a/dist/pesde/lune/lifecycles/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./lune_packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/pesde/lune/lifecycles/src/handlers/fire-concurrent.luau b/dist/pesde/lune/lifecycles/src/handlers/fire-concurrent.luau deleted file mode 100644 index f279b888..00000000 --- a/dist/pesde/lune/lifecycles/src/handlers/fire-concurrent.luau +++ /dev/null @@ -1,10 +0,0 @@ -local runtime = require("../../runtime") -local types = require("../types") - -local function fireConcurrent(lifecycle: types.Lifecycle, ...: Args...) - for _, callback in lifecycle.callbacks do - runtime.threadpool.spawn(callback, ...) - end -end - -return fireConcurrent diff --git a/dist/pesde/lune/lifecycles/src/handlers/fire-sequential.luau b/dist/pesde/lune/lifecycles/src/handlers/fire-sequential.luau deleted file mode 100644 index 80911ad9..00000000 --- a/dist/pesde/lune/lifecycles/src/handlers/fire-sequential.luau +++ /dev/null @@ -1,9 +0,0 @@ -local types = require("../types") - -local function fireSequential(lifecycle: types.Lifecycle, ...: Args...) - for _, callback in lifecycle.callbacks do - callback(...) - end -end - -return fireSequential diff --git a/dist/pesde/lune/lifecycles/src/hooks/lifecycle-constructed.luau b/dist/pesde/lune/lifecycles/src/hooks/lifecycle-constructed.luau deleted file mode 100644 index 8ea4d81b..00000000 --- a/dist/pesde/lune/lifecycles/src/hooks/lifecycle-constructed.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (lifecycle: types.Lifecycle) -> () } = {} - -local function onLifecycleConstructed(listener: (lifecycle: types.Lifecycle) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleConstructed = onLifecycleConstructed, -}) diff --git a/dist/pesde/lune/lifecycles/src/hooks/lifecycle-destroyed.luau b/dist/pesde/lune/lifecycles/src/hooks/lifecycle-destroyed.luau deleted file mode 100644 index 47abcfab..00000000 --- a/dist/pesde/lune/lifecycles/src/hooks/lifecycle-destroyed.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (lifecycle: types.Lifecycle) -> () } = {} - -local function onLifecycleDestroyed(listener: (lifecycle: types.Lifecycle) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleDestroyed = onLifecycleDestroyed, -}) diff --git a/dist/pesde/lune/lifecycles/src/hooks/lifecycle-registered.luau b/dist/pesde/lune/lifecycles/src/hooks/lifecycle-registered.luau deleted file mode 100644 index fab588a3..00000000 --- a/dist/pesde/lune/lifecycles/src/hooks/lifecycle-registered.luau +++ /dev/null @@ -1,20 +0,0 @@ -local types = require("../types") - -local callbacks: { (lifecycle: types.Lifecycle, callback: (...unknown) -> ()) -> () } = {} - -local function onLifecycleRegistered( - listener: ( - lifecycle: types.Lifecycle, - callback: (Args...) -> () - ) -> () -): () -> () - table.insert(callbacks, listener :: any) - return function() - table.remove(callbacks, table.find(callbacks, listener :: any)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleRegistered = onLifecycleRegistered, -}) diff --git a/dist/pesde/lune/lifecycles/src/index.d.ts b/dist/pesde/lune/lifecycles/src/index.d.ts deleted file mode 100644 index 0e5f324b..00000000 --- a/dist/pesde/lune/lifecycles/src/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -declare namespace lifecycles { - export interface Lifecycle { - type: "Lifecycle"; - - callbacks: Array<(...args: Args) => void>; - method: string; - - register(callback: (...args: Args) => void): void; - fire(...args: Args): void; - unregister(callback: (...args: Args) => void): void; - clear(): void; - onRegistered(listener: (callback: (...args: Args) => void) => void): () => void; - onUnegistered(listener: (callback: (...args: Args) => void) => void): () => void; - await(): LuaTuple; - destroy(): void; - } - - export function create( - method: string, - onFire: (lifecycle: Lifecycle, ...args: Args) => void - ): Lifecycle; - - export namespace handlers { - export function fireConcurrent(lifecycle: Lifecycle, ...args: Args): void; - export function fireSequential(lifecycle: Lifecycle, ...args: Args): void; - } - - export namespace hooks { - export function onLifecycleConstructed(callback: (lifecycle: Lifecycle) => void): () => void; - export function onLifecycleDestroyed(callback: (lifecycle: Lifecycle) => void): () => void; - export function onLifecycleRegistered( - callback: (lifecycle: Lifecycle, callback: (...args: Args) => void) => void - ): () => void; - export function onLifecycleUnregistered( - callback: (lifecycle: Lifecycle, callback: (...args: Args) => void) => void - ): () => void; - } - - export namespace _ { - export const methodToLifecycles: Map; - } -} - -export = lifecycles; -export as namespace lifecycles; diff --git a/dist/pesde/lune/lifecycles/src/init.luau b/dist/pesde/lune/lifecycles/src/init.luau deleted file mode 100644 index dbec091b..00000000 --- a/dist/pesde/lune/lifecycles/src/init.luau +++ /dev/null @@ -1,28 +0,0 @@ -local create = require("@self/create") -local fireConcurrent = require("@self/handlers/fire-concurrent") -local fireSequential = require("@self/handlers/fire-sequential") -local lifecycleConstructed = require("@self/hooks/lifecycle-constructed") -local lifecycleDestroyed = require("@self/hooks/lifecycle-destroyed") -local lifecycleRegistered = require("@self/hooks/lifecycle-registered") -local lifecycleUnregistered = require("@self/hooks/lifecycle-unregistered") -local methodToLifecycles = require("@self/method-to-lifecycles") -local types = require("@self/types") - -export type Lifecycle = types.Lifecycle - -return table.freeze({ - create = create, - handlers = table.freeze({ - fireConcurrent = fireConcurrent, - fireSequential = fireSequential, - }), - hooks = table.freeze({ - onLifecycleRegistered = lifecycleRegistered.onLifecycleRegistered, - onLifecycleUnregistered = lifecycleUnregistered.onLifecycleUnregistered, - onLifecycleConstructed = lifecycleConstructed.onLifecycleConstructed, - onLifecycleDestroyed = lifecycleDestroyed.onLifecycleDestroyed, - }), - _ = table.freeze({ - methodToLifecycles = methodToLifecycles, - }), -}) diff --git a/dist/pesde/lune/lifecycles/src/logger.luau b/dist/pesde/lune/lifecycles/src/logger.luau deleted file mode 100644 index 3ae7c27e..00000000 --- a/dist/pesde/lune/lifecycles/src/logger.luau +++ /dev/null @@ -1,6 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/lifecycles", logger.standardErrorInfoUrl("lifecycles"), { - useAfterDestroy = "Cannot use Lifecycle after it is destroyed.", - alreadyDestroyed = "Cannot destroy an already destroyed Lifecycle.", -}) diff --git a/dist/pesde/lune/lifecycles/src/method-to-lifecycles.luau b/dist/pesde/lune/lifecycles/src/method-to-lifecycles.luau deleted file mode 100644 index 386a8756..00000000 --- a/dist/pesde/lune/lifecycles/src/method-to-lifecycles.luau +++ /dev/null @@ -1,5 +0,0 @@ -local types = require("./types") - -local methodToLifecycles: { [string]: { types.Lifecycle } } = {} - -return methodToLifecycles diff --git a/dist/pesde/lune/lifecycles/src/methods/await.luau b/dist/pesde/lune/lifecycles/src/methods/await.luau deleted file mode 100644 index ed8299d6..00000000 --- a/dist/pesde/lune/lifecycles/src/methods/await.luau +++ /dev/null @@ -1,17 +0,0 @@ -local logger = require("../logger") -local types = require("../types") - -local function await(lifecycle: types.Self): Args... - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - local currentThread = coroutine.running() - local function callback(...: Args...) - lifecycle:unregister(callback) - coroutine.resume(currentThread, ...) - end - lifecycle:register(callback) - return coroutine.yield() -end - -return await diff --git a/dist/pesde/lune/lifecycles/src/methods/destroy.luau b/dist/pesde/lune/lifecycles/src/methods/destroy.luau deleted file mode 100644 index d9d5d6cc..00000000 --- a/dist/pesde/lune/lifecycles/src/methods/destroy.luau +++ /dev/null @@ -1,18 +0,0 @@ -local lifecycleDestroyed = require("../hooks/lifecycle-destroyed") -local logger = require("../logger") -local methodToLifecycles = require("../method-to-lifecycles") -local types = require("../types") - -local function destroy(lifecycle: types.Self) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.alreadyDestroyed }) - end - table.remove(methodToLifecycles[lifecycle.method], table.find(methodToLifecycles[lifecycle.method], lifecycle)) - table.clear(lifecycle.callbacks) - for _, callback in lifecycleDestroyed.callbacks do - callback(lifecycle) - end - lifecycle._isDestroyed = true -end - -return destroy diff --git a/dist/pesde/lune/lifecycles/src/methods/on-registered.luau b/dist/pesde/lune/lifecycles/src/methods/on-registered.luau deleted file mode 100644 index 7ddb009a..00000000 --- a/dist/pesde/lune/lifecycles/src/methods/on-registered.luau +++ /dev/null @@ -1,17 +0,0 @@ -local logger = require("../logger") -local types = require("../types") - -local function onRegistered(lifecycle: types.Self, listener: (callback: (Args...) -> ()) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - if _G.PRVDMWRONG_DISALLOW_MULTIPLE_LISTENERS then - table.remove(lifecycle._selfRegistered, table.find(lifecycle._selfRegistered, listener)) - end - table.insert(lifecycle._selfRegistered, listener) - return function() - table.remove(lifecycle._selfRegistered, table.find(lifecycle._selfRegistered, listener)) - end -end - -return onRegistered diff --git a/dist/pesde/lune/lifecycles/src/methods/register.luau b/dist/pesde/lune/lifecycles/src/methods/register.luau deleted file mode 100644 index 3fd74d56..00000000 --- a/dist/pesde/lune/lifecycles/src/methods/register.luau +++ /dev/null @@ -1,18 +0,0 @@ -local logger = require("../logger") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function register(lifecycle: types.Self, callback: (Args...) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - if _G.PRVDMWRONG_DISALLOW_MULTIPLE_LISTENERS then - table.remove(lifecycle.callbacks, table.find(lifecycle.callbacks, callback)) - end - table.insert(lifecycle.callbacks, callback) - threadpool.spawnCallbacks(lifecycle._selfRegistered, callback) -end - -return register diff --git a/dist/pesde/lune/lifecycles/src/methods/unregister-all.luau b/dist/pesde/lune/lifecycles/src/methods/unregister-all.luau deleted file mode 100644 index 5e6235af..00000000 --- a/dist/pesde/lune/lifecycles/src/methods/unregister-all.luau +++ /dev/null @@ -1,17 +0,0 @@ -local logger = require("../logger") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function clear(lifecycle: types.Self) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - for _, callback in lifecycle.callbacks do - threadpool.spawnCallbacks(lifecycle._selfUnregistered, callback) - end - table.clear(lifecycle.callbacks) -end - -return clear diff --git a/dist/pesde/lune/lifecycles/src/types.luau b/dist/pesde/lune/lifecycles/src/types.luau deleted file mode 100644 index f2931b52..00000000 --- a/dist/pesde/lune/lifecycles/src/types.luau +++ /dev/null @@ -1,23 +0,0 @@ -export type Lifecycle = { - type: "Lifecycle", - - callbacks: { (Args...) -> () }, - method: string, - - register: (self: Lifecycle, callback: (Args...) -> ()) -> (), - fire: (self: Lifecycle, Args...) -> (), - unregister: (self: Lifecycle, callback: (Args...) -> ()) -> (), - clear: (self: Lifecycle) -> (), - onRegistered: (self: Lifecycle, listener: (callback: (Args...) -> ()) -> ()) -> () -> (), - onUnregistered: (self: Lifecycle, listener: (callback: (Args...) -> ()) -> ()) -> () -> (), - await: (self: Lifecycle) -> Args..., - destroy: (self: Lifecycle) -> (), -} - -export type Self = Lifecycle & { - _isDestroyed: boolean, - _selfRegistered: { (callback: (Args...) -> ()) -> () }, - _selfUnregistered: { (callback: (Args...) -> ()) -> () }, -} - -return nil diff --git a/dist/pesde/lune/logger/LICENSE.md b/dist/pesde/lune/logger/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/lune/logger/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/lune/logger/pesde.toml b/dist/pesde/lune/logger/pesde.toml deleted file mode 100644 index 1044b58b..00000000 --- a/dist/pesde/lune/logger/pesde.toml +++ /dev/null @@ -1,28 +0,0 @@ -authors = ["Fire "] -description = "Logging for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "runtime.luau", - "runtime.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/logger" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "runtime.luau", - "runtime.luau", -] -environment = "lune" -lib = "src/init.luau" -[dependencies] -runtime = { workspace = "prvdmwrong/runtime", version = "0.2.0-rc.4" } diff --git a/dist/pesde/lune/logger/runtime.luau b/dist/pesde/lune/logger/runtime.luau deleted file mode 100644 index 8e63a7a0..00000000 --- a/dist/pesde/lune/logger/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./lune_packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/pesde/lune/logger/src/allow-web-links.luau b/dist/pesde/lune/logger/src/allow-web-links.luau deleted file mode 100644 index dcd0bb82..00000000 --- a/dist/pesde/lune/logger/src/allow-web-links.luau +++ /dev/null @@ -1,5 +0,0 @@ -local runtime = require("../runtime") - -local allowWebLinks = if runtime.name == "roblox" then game:GetService("RunService"):IsStudio() else true - -return allowWebLinks diff --git a/dist/pesde/lune/logger/src/create.luau b/dist/pesde/lune/logger/src/create.luau deleted file mode 100644 index 943aab25..00000000 --- a/dist/pesde/lune/logger/src/create.luau +++ /dev/null @@ -1,32 +0,0 @@ -local allowWebLinks = require("./allow-web-links") -local formatLog = require("./format-log") -local runtime = require("../runtime") -local types = require("./types") - -local task = runtime.task -local warn = runtime.warn - -local function create(label: string, errorInfoUrl: string?, templates: T): types.Logger - local self = {} :: types.Logger - self.type = "Logger" - - label = `[{label}] ` - errorInfoUrl = if allowWebLinks then errorInfoUrl else nil - - function self:warn(log) - warn(label .. formatLog(self, log, errorInfoUrl)) - end - - function self:error(log) - task.spawn(error, label .. formatLog(self, log, errorInfoUrl), 0) - end - - function self:fatalError(log) - error(label .. formatLog(self, log, errorInfoUrl)) - end - - setmetatable(self :: any, { __index = templates }) - return self -end - -return create diff --git a/dist/pesde/lune/logger/src/index.d.ts b/dist/pesde/lune/logger/src/index.d.ts deleted file mode 100644 index 85251a07..00000000 --- a/dist/pesde/lune/logger/src/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -declare namespace Logger { - export interface Error { - type: "Error"; - raw: string; - message: string; - trace: string; - } - - interface LogProps { - template: string; - error?: Error; - trace?: string; - } - - export type Log = LogProps & unknown[]; - - interface LoggerProps { - print(props: Log): void; - warn(props: Log): void; - error(props: Log): void; - fatalError(props: Log): never; - } - - export type Logger> = LoggerProps & Templates; - - export function create>( - label: string, - errorInfoUrl: string | undefined, - templates: Templates - ): Logger; - - export function formatLog>( - logger: Logger, - log: Log, - errorInfoUrl?: string - ): string; - - export function parseError(err: string): Error; - - export const allowWebLinks: boolean; - export function standardErrorInfoUrl(label: string): string; -} - -export = Logger; -export as namespace Logger; diff --git a/dist/pesde/lune/logger/src/init.luau b/dist/pesde/lune/logger/src/init.luau deleted file mode 100644 index 52760a5d..00000000 --- a/dist/pesde/lune/logger/src/init.luau +++ /dev/null @@ -1,18 +0,0 @@ -local allowWebLinks = require("@self/allow-web-links") -local create = require("@self/create") -local formatLog = require("@self/format-log") -local parseError = require("@self/parse-error") -local standardErrorInfoUrl = require("@self/standard-error-info-url") -local types = require("@self/types") - -export type Logger = types.Logger -export type Log = types.Log -export type Error = types.Error - -return table.freeze({ - create = create, - formatLog = formatLog, - parseError = parseError, - allowWebLinks = allowWebLinks, - standardErrorInfoUrl = standardErrorInfoUrl, -}) diff --git a/dist/pesde/lune/logger/src/parse-error.luau b/dist/pesde/lune/logger/src/parse-error.luau deleted file mode 100644 index e43fe53d..00000000 --- a/dist/pesde/lune/logger/src/parse-error.luau +++ /dev/null @@ -1,12 +0,0 @@ -local types = require("./types") - -local function parseError(err: string): types.Error - return { - type = "Error", - raw = err, - message = err:gsub("^.+:%d+:%s*", ""), - trace = debug.traceback(nil, 2), - } -end - -return parseError diff --git a/dist/pesde/lune/logger/src/standard-error-info-url.luau b/dist/pesde/lune/logger/src/standard-error-info-url.luau deleted file mode 100644 index 345faf36..00000000 --- a/dist/pesde/lune/logger/src/standard-error-info-url.luau +++ /dev/null @@ -1,5 +0,0 @@ -local function standardErrorInfoUrl(label: string): string - return `https://prvdmwrong.luau.page/api-reference/{label}/errors` -end - -return standardErrorInfoUrl diff --git a/dist/pesde/lune/logger/src/types.luau b/dist/pesde/lune/logger/src/types.luau deleted file mode 100644 index d1699037..00000000 --- a/dist/pesde/lune/logger/src/types.luau +++ /dev/null @@ -1,23 +0,0 @@ -export type Error = { - type: "Error", - raw: string, - message: string, - trace: string, -} - -export type Log = { - template: string, - error: Error?, - trace: string?, - [number]: unknown, -} - -export type Logger = Templates & { - type: "Logger", - print: (self: Logger, props: Log) -> (), - warn: (self: Logger, props: Log) -> (), - error: (self: Logger, props: Log) -> (), - fatalError: (self: Logger, props: Log) -> never, -} - -return nil diff --git a/dist/pesde/lune/providers/LICENSE.md b/dist/pesde/lune/providers/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/lune/providers/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/lune/providers/dependencies.luau b/dist/pesde/lune/providers/dependencies.luau deleted file mode 100644 index e232e1f0..00000000 --- a/dist/pesde/lune/providers/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./lune_packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/pesde/lune/providers/lifecycles.luau b/dist/pesde/lune/providers/lifecycles.luau deleted file mode 100644 index 49a51bfa..00000000 --- a/dist/pesde/lune/providers/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./lune_packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/pesde/lune/providers/logger.luau b/dist/pesde/lune/providers/logger.luau deleted file mode 100644 index ddbd462d..00000000 --- a/dist/pesde/lune/providers/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./lune_packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/pesde/lune/providers/pesde.toml b/dist/pesde/lune/providers/pesde.toml deleted file mode 100644 index 935d5c92..00000000 --- a/dist/pesde/lune/providers/pesde.toml +++ /dev/null @@ -1,43 +0,0 @@ -authors = ["Fire "] -description = "Provider creation for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "runtime.luau", - "logger.luau", - "lifecycles.luau", - "dependencies.luau", - "runtime.luau", - "logger.luau", - "lifecycles.luau", - "dependencies.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/providers" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "runtime.luau", - "logger.luau", - "lifecycles.luau", - "dependencies.luau", - "runtime.luau", - "logger.luau", - "lifecycles.luau", - "dependencies.luau", -] -environment = "lune" -lib = "src/init.luau" -[dependencies] -dependencies = { workspace = "prvdmwrong/dependencies", version = "0.2.0-rc.4" } -runtime = { workspace = "prvdmwrong/runtime", version = "0.2.0-rc.4" } -lifecycles = { workspace = "prvdmwrong/lifecycles", version = "0.2.0-rc.4" } -logger = { workspace = "prvdmwrong/logger", version = "0.2.0-rc.4" } diff --git a/dist/pesde/lune/providers/runtime.luau b/dist/pesde/lune/providers/runtime.luau deleted file mode 100644 index 8e63a7a0..00000000 --- a/dist/pesde/lune/providers/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./lune_packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/pesde/lune/providers/src/create.luau b/dist/pesde/lune/providers/src/create.luau deleted file mode 100644 index 016b8a6d..00000000 --- a/dist/pesde/lune/providers/src/create.luau +++ /dev/null @@ -1,30 +0,0 @@ -local nameOf = require("./name-of") -local providerClasses = require("./provider-classes") -local types = require("./types") - -local function createProvider(self: Self): types.Provider - local provider: types.Provider = self :: any - - if provider.__index == nil then - provider.__index = provider - end - - if provider.__tostring == nil then - provider.__tostring = nameOf - end - - if provider.new == nil then - function provider.new(dependencies) - local self: types.Provider = setmetatable({}, provider) :: any - if provider.constructor then - return provider.constructor(self, dependencies) or self - end - return self - end - end - - providerClasses[provider] = true - return provider -end - -return createProvider diff --git a/dist/pesde/lune/providers/src/index.d.ts b/dist/pesde/lune/providers/src/index.d.ts deleted file mode 100644 index 2ab36e15..00000000 --- a/dist/pesde/lune/providers/src/index.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Dependency } from "../dependencies"; - -declare namespace providers { - export type Provider = Dependency< - Self & { - __index: Provider; - name?: string; - constructor?(dependencies: Dependencies): void; - start?(): void; - destroy?(): void; - }, - Dependencies - >; - - // Class decorator syntax - export function create InstanceType>(self: Self): Provider; - // Normal syntax - export function create(self: Self): Provider; - - export function nameOf(provider: Provider): string; - - export namespace _ { - export const providerClasses: Set>; - } - - export interface Start { - start(): void; - } - - export interface Destroy { - destroy(): void; - } -} - -export = providers; -export as namespace providers; diff --git a/dist/pesde/lune/providers/src/init.luau b/dist/pesde/lune/providers/src/init.luau deleted file mode 100644 index d678d850..00000000 --- a/dist/pesde/lune/providers/src/init.luau +++ /dev/null @@ -1,16 +0,0 @@ -local create = require("@self/create") -local nameOf = require("@self/name-of") -local providerClasses = require("@self/provider-classes") -local types = require("@self/types") - -export type Provider = types.Provider - -local providers = table.freeze({ - create = create, - nameOf = nameOf, - _ = table.freeze({ - providerClasses = providerClasses, - }), -}) - -return providers diff --git a/dist/pesde/lune/providers/src/name-of.luau b/dist/pesde/lune/providers/src/name-of.luau deleted file mode 100644 index 3f86ceec..00000000 --- a/dist/pesde/lune/providers/src/name-of.luau +++ /dev/null @@ -1,7 +0,0 @@ -local types = require("./types") - -local function nameOf(provider: types.Provider) - return provider.name or "Provider" -end - -return nameOf diff --git a/dist/pesde/lune/providers/src/provider-classes.luau b/dist/pesde/lune/providers/src/provider-classes.luau deleted file mode 100644 index cc57922f..00000000 --- a/dist/pesde/lune/providers/src/provider-classes.luau +++ /dev/null @@ -1,7 +0,0 @@ -local types = require("./types") - -type Set = { [T]: true } - -local providerClasses: Set> = setmetatable({}, { __mode = "k" }) :: any - -return providerClasses diff --git a/dist/pesde/lune/providers/src/types.luau b/dist/pesde/lune/providers/src/types.luau deleted file mode 100644 index 4f4d4dc9..00000000 --- a/dist/pesde/lune/providers/src/types.luau +++ /dev/null @@ -1,12 +0,0 @@ -local dependencies = require("../dependencies") - -export type Provider = dependencies.Dependency, - __tostring: (self: Provider) -> string, - name: string?, - constructor: ((self: Provider, dependencies: Dependencies) -> ())?, - start: (self: Provider) -> ()?, - destroy: (self: Provider) -> ()?, -}, Dependencies> - -return nil diff --git a/dist/pesde/lune/prvdmwrong/LICENSE.md b/dist/pesde/lune/prvdmwrong/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/lune/prvdmwrong/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/lune/prvdmwrong/dependencies.luau b/dist/pesde/lune/prvdmwrong/dependencies.luau deleted file mode 100644 index e232e1f0..00000000 --- a/dist/pesde/lune/prvdmwrong/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./lune_packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/pesde/lune/prvdmwrong/lifecycles.luau b/dist/pesde/lune/prvdmwrong/lifecycles.luau deleted file mode 100644 index 49a51bfa..00000000 --- a/dist/pesde/lune/prvdmwrong/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./lune_packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/pesde/lune/prvdmwrong/pesde.toml b/dist/pesde/lune/prvdmwrong/pesde.toml deleted file mode 100644 index bbfecebb..00000000 --- a/dist/pesde/lune/prvdmwrong/pesde.toml +++ /dev/null @@ -1,43 +0,0 @@ -authors = ["Fire "] -description = "Entry point to Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "dependencies.luau", - "roots.luau", - "lifecycles.luau", - "providers.luau", - "dependencies.luau", - "roots.luau", - "lifecycles.luau", - "providers.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/prvdmwrong" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "dependencies.luau", - "roots.luau", - "lifecycles.luau", - "providers.luau", - "dependencies.luau", - "roots.luau", - "lifecycles.luau", - "providers.luau", -] -environment = "lune" -lib = "src/init.luau" -[dependencies] -dependencies = { workspace = "prvdmwrong/dependencies", version = "0.2.0-rc.4" } -roots = { workspace = "prvdmwrong/roots", version = "0.2.0-rc.4" } -lifecycles = { workspace = "prvdmwrong/lifecycles", version = "0.2.0-rc.4" } -providers = { workspace = "prvdmwrong/providers", version = "0.2.0-rc.4" } diff --git a/dist/pesde/lune/prvdmwrong/providers.luau b/dist/pesde/lune/prvdmwrong/providers.luau deleted file mode 100644 index 5539dc07..00000000 --- a/dist/pesde/lune/prvdmwrong/providers.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./lune_packages/providers") -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/pesde/lune/prvdmwrong/roots.luau b/dist/pesde/lune/prvdmwrong/roots.luau deleted file mode 100644 index 76ed284a..00000000 --- a/dist/pesde/lune/prvdmwrong/roots.luau +++ /dev/null @@ -1,4 +0,0 @@ -local DEPENDENCY = require("./lune_packages/roots") -export type Root = DEPENDENCY.Root -export type StartedRoot = DEPENDENCY.StartedRoot -return DEPENDENCY diff --git a/dist/pesde/lune/prvdmwrong/src/index.d.ts b/dist/pesde/lune/prvdmwrong/src/index.d.ts deleted file mode 100644 index 2058129c..00000000 --- a/dist/pesde/lune/prvdmwrong/src/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import dependencies from "../dependencies"; -import lifecycles from "../lifecycles"; -import providers from "../providers"; -import roots from "../roots"; - -declare namespace prvd { - export type Provider = providers.Provider; - export interface Lifecycle extends lifecycles.Lifecycle { } - export type SubdependenciesOf = dependencies.SubdependenciesOf; - export interface Root extends roots.Root { } - export interface StartedRoot extends roots.StartedRoot { } - - export interface Start extends providers.Start { } - export interface Destroy extends providers.Destroy { } - - export const provider: typeof providers.create; - export const root: typeof roots.create; - export const depend: typeof dependencies.depend; - export const nameOf: typeof providers.nameOf; - - export const lifecycle: typeof lifecycles.create; - export const fireConcurrent: typeof lifecycles.handlers.fireConcurrent; - export const fireSequential: typeof lifecycles.handlers.fireSequential; - - export namespace hooks { - export const onLifecycleConstructed: typeof lifecycles.hooks.onLifecycleConstructed; - export const onLifecycleDestroyed: typeof lifecycles.hooks.onLifecycleDestroyed; - export const onLifecycleRegistered: typeof lifecycles.hooks.onLifecycleRegistered; - export const onLifecycleUnregistered: typeof lifecycles.hooks.onLifecycleUnregistered; - - export const onLifecycleUsed: typeof roots.hooks.onLifecycleUsed; - export const onProviderUsed: typeof roots.hooks.onProviderUsed; - export const onRootUsed: typeof roots.hooks.onRootUsed; - export const onRootConstructing: typeof roots.hooks.onRootConstructing; - export const onRootStarted: typeof roots.hooks.onRootStarted; - export const onRootFinished: typeof roots.hooks.onRootFinished; - export const onRootDestroyed: typeof roots.hooks.onRootDestroyed; - } -} - -export = prvd; -export as namespace prvd; diff --git a/dist/pesde/lune/rbx-components/LICENSE.md b/dist/pesde/lune/rbx-components/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/lune/rbx-components/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/lune/rbx-components/dependencies.luau b/dist/pesde/lune/rbx-components/dependencies.luau deleted file mode 100644 index e232e1f0..00000000 --- a/dist/pesde/lune/rbx-components/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./lune_packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/pesde/lune/rbx-components/logger.luau b/dist/pesde/lune/rbx-components/logger.luau deleted file mode 100644 index ddbd462d..00000000 --- a/dist/pesde/lune/rbx-components/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./lune_packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/pesde/lune/rbx-components/pesde.toml b/dist/pesde/lune/rbx-components/pesde.toml deleted file mode 100644 index c7f1dcf0..00000000 --- a/dist/pesde/lune/rbx-components/pesde.toml +++ /dev/null @@ -1,43 +0,0 @@ -authors = ["Fire "] -description = "Component functionality for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "logger.luau", - "roots.luau", - "providers.luau", - "dependencies.luau", - "logger.luau", - "roots.luau", - "providers.luau", - "dependencies.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/rbx_components" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "logger.luau", - "roots.luau", - "providers.luau", - "dependencies.luau", - "logger.luau", - "roots.luau", - "providers.luau", - "dependencies.luau", -] -environment = "lune" -lib = "src/init.luau" -[dependencies] -logger = { workspace = "prvdmwrong/logger", version = "0.2.0-rc.4" } -roots = { workspace = "prvdmwrong/roots", version = "0.2.0-rc.4" } -providers = { workspace = "prvdmwrong/providers", version = "0.2.0-rc.4" } -dependencies = { workspace = "prvdmwrong/dependencies", version = "0.2.0-rc.4" } diff --git a/dist/pesde/lune/rbx-components/providers.luau b/dist/pesde/lune/rbx-components/providers.luau deleted file mode 100644 index 5539dc07..00000000 --- a/dist/pesde/lune/rbx-components/providers.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./lune_packages/providers") -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/pesde/lune/rbx-components/roots.luau b/dist/pesde/lune/rbx-components/roots.luau deleted file mode 100644 index 76ed284a..00000000 --- a/dist/pesde/lune/rbx-components/roots.luau +++ /dev/null @@ -1,4 +0,0 @@ -local DEPENDENCY = require("./lune_packages/roots") -export type Root = DEPENDENCY.Root -export type StartedRoot = DEPENDENCY.StartedRoot -return DEPENDENCY diff --git a/dist/pesde/lune/rbx-components/src/component-provider.luau b/dist/pesde/lune/rbx-components/src/component-provider.luau deleted file mode 100644 index 85af0d0d..00000000 --- a/dist/pesde/lune/rbx-components/src/component-provider.luau +++ /dev/null @@ -1,185 +0,0 @@ -local CollectionService = game:GetService("CollectionService") - -local componentClasses = require("./component-classes") -local logger = require("./logger") -local providers = require("../providers") -local runtime = require("../runtime") -local types = require("./types") - -local threadpool = runtime.threadpool - -type Set = { [T]: true } -type ConstructedComponent = types.AnyComponent -type LuauBug = any - -local ComponentProvider = {} -ComponentProvider.priority = -math.huge -ComponentProvider.name = "@rbx-components" - -function ComponentProvider.constructor(self: ComponentProvider) - self.componentClasses = {} :: Set - self.tagToComponentClasses = {} :: { [string]: Set } - self.instanceToComponents = {} :: { [Instance]: { [types.AnyComponent]: ConstructedComponent } } - self.componentToInstances = {} :: { [types.AnyComponent]: Set? } - self.constructedToClass = {} :: { [ConstructedComponent]: types.AnyComponent? } - - self._destroyingConnections = {} :: { [Instance]: RBXScriptConnection } - self._connections = {} :: { RBXScriptConnection } -end - -function ComponentProvider.start(self: ComponentProvider) - for tag, components in self.tagToComponentClasses do - local function onTagAdded(instance) - local instanceToComponents = self.instanceToComponents[instance] - if not instanceToComponents then - instanceToComponents = {} - self.instanceToComponents[instance] = instanceToComponents - end - - for componentClass in components do - if - (componentClass.blacklistInstances and (componentClass.blacklistInstances :: LuauBug)[instance]) - or (componentClass.whitelistInstances and not (componentClass.whitelistInstances :: LuauBug)[instance]) - or (componentClass.instanceCheck and not componentClass.instanceCheck(instance)) - then - continue - end - - local component: ConstructedComponent = instanceToComponents[componentClass] - if not component then - component = componentClass.new(instance) - instanceToComponents[componentClass] = component - self.constructedToClass[component :: any] = componentClass - end - - if component.added then - component:added() - end - end - - if not self._destroyingConnections[instance] then - self._destroyingConnections[instance] = instance.Destroying:Once(function() - for _, component in instanceToComponents do - if component.destroy then - threadpool.spawn(component.destroy, component) - end - end - table.clear(instanceToComponents) - self.instanceToComponents[instance] = nil - end) - end - end - - table.insert(self._connections, CollectionService:GetInstanceAddedSignal(tag):Connect(onTagAdded)) - table.insert(self._connections, CollectionService:GetInstanceRemovedSignal(tag):Connect(function(instance) end)) - - for _, instance in CollectionService:GetTagged(tag) do - onTagAdded(instance) - end - end -end - -function ComponentProvider.destroy(self: ComponentProvider) - for _, components in self.instanceToComponents do - for _, component in components do - if component.destroy then - component:destroy() - end - end - table.clear(components) - end - - table.clear(self.componentClasses) - table.clear(self.tagToComponentClasses) - table.clear(self.instanceToComponents) - table.clear(self.componentToInstances) - table.clear(self.constructedToClass) - - for _, connection in self._connections do - if connection.Connected then - connection:Disconnect() - end - end - - for _, connection in self._destroyingConnections do - if connection.Connected then - connection:Disconnect() - end - end - - table.clear(self._connections) - table.clear(self._destroyingConnections) -end - -function ComponentProvider.addComponentClass(self: ComponentProvider, class: types.AnyComponent) - if not componentClasses[class] then - logger:fatalError({ template = logger.invalidComponent }) - end - - if self.componentClasses[class] then - logger:fatalError({ template = logger.alreadyRegisteredComponent }) - end - - if class.tag then - local tagToComponentClasses = self.tagToComponentClasses[class.tag] - - if tagToComponentClasses then - if not _G.PRVDMWRONG_SUPPRESS_MULTIPLE_SAME_TAG and #tagToComponentClasses > 0 then - logger:warn({ template = logger.multipleSameTag, class.tag }) - end - else - tagToComponentClasses = {} - self.tagToComponentClasses[class.tag] = tagToComponentClasses - end - - (tagToComponentClasses :: any)[class] = true - end - - self.componentClasses[class] = true - self.componentToInstances[class] = {} -end - -function ComponentProvider.getFromInstance( - self: ComponentProvider, - class: types.Component, - instance: I -): types.Component? - return self.instanceToComponents[instance :: any][class] -end - -function ComponentProvider.getAllComponents( - self: ComponentProvider, - class: types.Component -): Set> - local result = {} - for _, components in self.instanceToComponents do - for _, component in components do - if self.constructedToClass[component] == class then - result[component] = true - end - end - end - return result :: any -end - -function ComponentProvider.addComponent( - self: ComponentProvider, - class: types.Component, - instance: I -): types.Component? - error("not yet implemented") -end - -function ComponentProvider.removeComponent(self: ComponentProvider, class: types.Component, instance: I) - local constructed = self:getFromInstance(class, instance) - if constructed then - self.instanceToComponents[instance :: any][class] = nil - - if constructed.removed then - threadpool.spawn(constructed.removed :: any, constructed, instance) - end - end -end - -export type ComponentProvider = typeof(ComponentProvider) -return providers.create(ComponentProvider) diff --git a/dist/pesde/lune/rbx-components/src/extend-root/init.luau b/dist/pesde/lune/rbx-components/src/extend-root/init.luau deleted file mode 100644 index 6e9f0578..00000000 --- a/dist/pesde/lune/rbx-components/src/extend-root/init.luau +++ /dev/null @@ -1,30 +0,0 @@ -local ComponentProvider = require("./component-provider") -local createComponentClassProvider = require("@self/create-component-class-provider") -local logger = require("./logger") -local roots = require("../roots") -local types = require("./types") -local useComponent = require("@self/use-component") -local useComponents = require("@self/use-components") -local useModuleAsComponent = require("@self/use-module-as-component") -local useModulesAsComponents = require("@self/use-modules-as-components") - -local function extendRoot(root: types.RootPrivate): types.Root - if root._hasComponentExtensions then - return logger:fatalError({ template = logger.alreadyExtendedRoot }) - end - - root._hasComponentExtensions = true - root._classes = {} - - root:useProvider(ComponentProvider) - root:useProvider(createComponentClassProvider(root._classes)) - - root.useComponent = useComponent :: any - root.useComponents = useComponents :: any - root.useModuleAsComponent = useModuleAsComponent :: any - root.useModulesAsComponents = useModulesAsComponents :: any - - return root -end - -return extendRoot :: (root: roots.Root) -> types.Root diff --git a/dist/pesde/lune/rbx-components/src/extend-root/use-modules-as-components.luau b/dist/pesde/lune/rbx-components/src/extend-root/use-modules-as-components.luau deleted file mode 100644 index bababafa..00000000 --- a/dist/pesde/lune/rbx-components/src/extend-root/use-modules-as-components.luau +++ /dev/null @@ -1,28 +0,0 @@ -local componentClasses = require("../component-classes") -local types = require("../types") - -local function useModulesAsComponents( - root: types.RootPrivate, - modules: { Instance }, - predicate: ((ModuleScript) -> boolean)? -) - for index = 1, #modules do - local module = modules[index] - - if not module:IsA("ModuleScript") then - continue - end - - if predicate and not predicate(module) then - continue - end - - local required = (require)(module) - if componentClasses[required] then - table.insert(root, required) - end - end - return root -end - -return useModulesAsComponents diff --git a/dist/pesde/lune/rbx-components/src/init.luau b/dist/pesde/lune/rbx-components/src/init.luau deleted file mode 100644 index 598bcea4..00000000 --- a/dist/pesde/lune/rbx-components/src/init.luau +++ /dev/null @@ -1,24 +0,0 @@ -local componentClasses = require("@self/component-classes") -local create = require("@self/create") -local extendRoot = require("@self/extend-root") -local types = require("@self/types") - -export type Component = types.Component -export type Root = types.Root - -local components = { - create = create, - extendRoot = extendRoot, - _ = table.freeze({ - componentClasses = componentClasses, - }), -} - -local mt = {} - -function mt.__call(_, component: Self): types.Component - return create(component) -end - -table.freeze(mt) -return table.freeze(setmetatable(components, mt)) diff --git a/dist/pesde/lune/rbx-components/src/types.luau b/dist/pesde/lune/rbx-components/src/types.luau deleted file mode 100644 index 5bc17dcf..00000000 --- a/dist/pesde/lune/rbx-components/src/types.luau +++ /dev/null @@ -1,30 +0,0 @@ -local dependencies = require("../dependencies") -local roots = require("../roots") - -export type Component = dependencies.Dependency, - tag: string?, - instanceCheck: (unknown) -> boolean, - blacklistInstances: { Instance }?, - whitelistInstances: { Instance }?, - constructor: (self: Component, instance: Instance) -> ()?, - added: (self: Component) -> ()?, - removed: (self: Component) -> ()?, - destroyed: (self: Component) -> ()?, -}, nil, Instance> - -export type Root = roots.Root & { - useModuleAsComponent: (root: Root, module: ModuleScript) -> Root, - useModulesAsComponents: (root: Root, modules: { Instance }, predicate: ((ModuleScript) -> boolean)?) -> Root, - useComponent: (root: Root, component: Component) -> Root, - useComponents: (root: Root, components: { Component }) -> Root, -} - -export type RootPrivate = Root & { - _hasComponentExtensions: true?, - _classes: { Component }, -} - -export type AnyComponent = Component - -return nil diff --git a/dist/pesde/lune/roots/LICENSE.md b/dist/pesde/lune/roots/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/lune/roots/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/lune/roots/dependencies.luau b/dist/pesde/lune/roots/dependencies.luau deleted file mode 100644 index e232e1f0..00000000 --- a/dist/pesde/lune/roots/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./lune_packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/pesde/lune/roots/lifecycles.luau b/dist/pesde/lune/roots/lifecycles.luau deleted file mode 100644 index 49a51bfa..00000000 --- a/dist/pesde/lune/roots/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./lune_packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/pesde/lune/roots/logger.luau b/dist/pesde/lune/roots/logger.luau deleted file mode 100644 index ddbd462d..00000000 --- a/dist/pesde/lune/roots/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./lune_packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/pesde/lune/roots/pesde.toml b/dist/pesde/lune/roots/pesde.toml deleted file mode 100644 index fa2c83c7..00000000 --- a/dist/pesde/lune/roots/pesde.toml +++ /dev/null @@ -1,48 +0,0 @@ -authors = ["Fire "] -description = "Roots implementation for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "logger.luau", - "dependencies.luau", - "runtime.luau", - "providers.luau", - "lifecycles.luau", - "logger.luau", - "dependencies.luau", - "runtime.luau", - "providers.luau", - "lifecycles.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/roots" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "logger.luau", - "dependencies.luau", - "runtime.luau", - "providers.luau", - "lifecycles.luau", - "logger.luau", - "dependencies.luau", - "runtime.luau", - "providers.luau", - "lifecycles.luau", -] -environment = "lune" -lib = "src/init.luau" -[dependencies] -logger = { workspace = "prvdmwrong/logger", version = "0.2.0-rc.4" } -dependencies = { workspace = "prvdmwrong/dependencies", version = "0.2.0-rc.4" } -providers = { workspace = "prvdmwrong/providers", version = "0.2.0-rc.4" } -lifecycles = { workspace = "prvdmwrong/lifecycles", version = "0.2.0-rc.4" } -runtime = { workspace = "prvdmwrong/runtime", version = "0.2.0-rc.4" } diff --git a/dist/pesde/lune/roots/providers.luau b/dist/pesde/lune/roots/providers.luau deleted file mode 100644 index 5539dc07..00000000 --- a/dist/pesde/lune/roots/providers.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./lune_packages/providers") -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/pesde/lune/roots/runtime.luau b/dist/pesde/lune/roots/runtime.luau deleted file mode 100644 index 8e63a7a0..00000000 --- a/dist/pesde/lune/roots/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./lune_packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/pesde/lune/roots/src/create.luau b/dist/pesde/lune/roots/src/create.luau deleted file mode 100644 index 26c14f4e..00000000 --- a/dist/pesde/lune/roots/src/create.luau +++ /dev/null @@ -1,47 +0,0 @@ -local destroy = require("./methods/destroy") -local lifecycles = require("../lifecycles") -local rootConstructing = require("./hooks/root-constructing") -local start = require("./methods/start") -local types = require("./types") -local useModule = require("./methods/use-module") -local useModules = require("./methods/use-modules") -local useProvider = require("./methods/use-provider") -local useProviders = require("./methods/use-providers") -local useRoot = require("./methods/use-root") -local useRoots = require("./methods/use-roots") -local willFinish = require("./methods/will-finish") -local willStart = require("./methods/will-start") - -local function create(): types.Root - local self: types.Self = { - type = "Root", - - start = start, - - useProvider = useProvider, - useProviders = useProviders, - useModule = useModule, - useModules = useModules, - useRoot = useRoot, - useRoots = useRoots, - destroy = destroy, - - willStart = willStart, - willFinish = willFinish, - - _destroyed = false, - _rootProviders = {}, - _rootLifecycles = {}, - _subRoots = {}, - _start = lifecycles.create("start", lifecycles.handlers.fireConcurrent), - _finish = lifecycles.create("destroy", lifecycles.handlers.fireSequential), - } :: any - - for _, callback in rootConstructing.callbacks do - callback(self) - end - - return self -end - -return create diff --git a/dist/pesde/lune/roots/src/hooks/root-destroyed.luau b/dist/pesde/lune/roots/src/hooks/root-destroyed.luau deleted file mode 100644 index 10b79b54..00000000 --- a/dist/pesde/lune/roots/src/hooks/root-destroyed.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self) -> () } = {} - -local function onRootDestroyed(listener: (root: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootDestroyed = onRootDestroyed, -}) diff --git a/dist/pesde/lune/roots/src/hooks/root-finished.luau b/dist/pesde/lune/roots/src/hooks/root-finished.luau deleted file mode 100644 index d3519cea..00000000 --- a/dist/pesde/lune/roots/src/hooks/root-finished.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self) -> () } = {} - -local function onRootFinished(listener: (root: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootFinished = onRootFinished, -}) diff --git a/dist/pesde/lune/roots/src/hooks/root-started.luau b/dist/pesde/lune/roots/src/hooks/root-started.luau deleted file mode 100644 index 2ae6f90c..00000000 --- a/dist/pesde/lune/roots/src/hooks/root-started.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self) -> () } = {} - -local function onRootStarted(listener: (root: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootStarted = onRootStarted, -}) diff --git a/dist/pesde/lune/roots/src/hooks/root-used.luau b/dist/pesde/lune/roots/src/hooks/root-used.luau deleted file mode 100644 index 71f172cc..00000000 --- a/dist/pesde/lune/roots/src/hooks/root-used.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self, subRoot: types.Root) -> () } = {} - -local function onRootUsed(listener: (root: types.Root, subRoot: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootUsed = onRootUsed, -}) diff --git a/dist/pesde/lune/roots/src/index.d.ts b/dist/pesde/lune/roots/src/index.d.ts deleted file mode 100644 index d8e100c5..00000000 --- a/dist/pesde/lune/roots/src/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Lifecycle } from "../lifecycles"; -import { Provider } from "../providers"; - -declare namespace roots { - export type Root = { - type: "Root"; - - start(): StartedRoot; - - useModule(module: ModuleScript): Root; - useModules(modules: Instance[], predicate?: (module: ModuleScript) => boolean): Root; - useRoot(root: Root): Root; - useRoots(roots: Root[]): Root; - useProvider(provider: Provider): Root; - useProviders(providers: Provider[]): Root; - useLifecycle(lifecycle: Lifecycle): Root; - useLifecycles(lifecycles: Lifecycle): Root; - destroy(): void; - - willStart(callback: () => void): Root; - willFinish(callback: () => void): Root; - }; - - export type StartedRoot = { - type: "StartedRoot"; - - finish(): void; - }; - - export function create(): Root; - - export namespace hooks { - export function onLifecycleUsed(listener: (lifecycle: Lifecycle) => void): () => void; - export function onProviderUsed(listener: (provider: Provider) => void): () => void; - export function onRootUsed(listener: (root: Root, subRoot: Root) => void): () => void; - - export function onRootConstructing(listener: (root: Root) => void): () => void; - export function onRootStarted(listener: (root: Root) => void): () => void; - export function onRootFinished(listener: (root: Root) => void): () => void; - export function onRootDestroyed(listener: (root: Root) => void): () => void; - } -} - -export = roots; -export as namespace roots; diff --git a/dist/pesde/lune/roots/src/init.luau b/dist/pesde/lune/roots/src/init.luau deleted file mode 100644 index f6aa7495..00000000 --- a/dist/pesde/lune/roots/src/init.luau +++ /dev/null @@ -1,28 +0,0 @@ -local create = require("@self/create") -local lifecycleUsed = require("@self/hooks/lifecycle-used") -local providerUsed = require("@self/hooks/provider-used") -local rootConstructing = require("@self/hooks/root-constructing") -local rootDestroyed = require("@self/hooks/root-destroyed") -local rootFinished = require("@self/hooks/root-finished") -local rootStarted = require("@self/hooks/root-started") -local rootUsed = require("@self/hooks/root-used") -local types = require("@self/types") - -export type Root = types.Root -export type StartedRoot = types.StartedRoot - -local roots = table.freeze({ - create = create, - hooks = table.freeze({ - onLifecycleUsed = lifecycleUsed.onLifecycleUsed, - onProviderUsed = providerUsed.onProviderUsed, - onRootUsed = rootUsed.onRootUsed, - - onRootConstructing = rootConstructing.onRootConstructing, - onRootStarted = rootStarted.onRootStarted, - onRootFinished = rootFinished.onRootFinished, - onRootDestroyed = rootDestroyed.onRootDestroyed, - }), -}) - -return roots diff --git a/dist/pesde/lune/roots/src/methods/destroy.luau b/dist/pesde/lune/roots/src/methods/destroy.luau deleted file mode 100644 index 0c62a935..00000000 --- a/dist/pesde/lune/roots/src/methods/destroy.luau +++ /dev/null @@ -1,16 +0,0 @@ -local logger = require("../logger") -local types = require("../types") - -local function destroy(root: types.Self) - if root._destroyed then - logger:fatalError({ template = logger.alreadyDestroyed }) - end - root._destroyed = true - table.clear(root._rootLifecycles) - table.clear(root._rootProviders) - table.clear(root._subRoots) - root._start:clear() - root._finish:clear() -end - -return destroy diff --git a/dist/pesde/lune/roots/src/methods/use-lifecycles.luau b/dist/pesde/lune/roots/src/methods/use-lifecycles.luau deleted file mode 100644 index 3f12341f..00000000 --- a/dist/pesde/lune/roots/src/methods/use-lifecycles.luau +++ /dev/null @@ -1,16 +0,0 @@ -local lifecycleUsed = require("../hooks/lifecycle-used").callbacks -local lifecycles = require("../../lifecycles") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useLifecycles(root: types.Self, lifecycles: { lifecycles.Lifecycle }) - for _, lifecycle in lifecycles do - table.insert(root._rootLifecycles, lifecycle) - threadpool.spawnCallbacks(lifecycleUsed, root, lifecycle) - end - return root -end - -return useLifecycles diff --git a/dist/pesde/lune/roots/src/methods/use-providers.luau b/dist/pesde/lune/roots/src/methods/use-providers.luau deleted file mode 100644 index 1489c3a3..00000000 --- a/dist/pesde/lune/roots/src/methods/use-providers.luau +++ /dev/null @@ -1,16 +0,0 @@ -local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useProviders(root: types.Self, providers: { providers.Provider }) - for _, provider in providers do - root._rootProviders[provider] = true - threadpool.spawnCallbacks(providerUsed, root, provider) - end - return root -end - -return useProviders diff --git a/dist/pesde/lune/roots/src/methods/use-root.luau b/dist/pesde/lune/roots/src/methods/use-root.luau deleted file mode 100644 index efc4ad1e..00000000 --- a/dist/pesde/lune/roots/src/methods/use-root.luau +++ /dev/null @@ -1,13 +0,0 @@ -local rootUsed = require("../hooks/root-used").callbacks -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useRoot(root: types.Self, subRoot: types.Root) - root._subRoots[subRoot] = true - threadpool.spawnCallbacks(rootUsed, root, subRoot) - return root -end - -return useRoot diff --git a/dist/pesde/lune/roots/src/methods/use-roots.luau b/dist/pesde/lune/roots/src/methods/use-roots.luau deleted file mode 100644 index 7b5b9dda..00000000 --- a/dist/pesde/lune/roots/src/methods/use-roots.luau +++ /dev/null @@ -1,15 +0,0 @@ -local rootUsed = require("../hooks/root-used").callbacks -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useRoots(root: types.Self, subRoots: { types.Root }) - for _, subRoot in subRoots do - root._subRoots[subRoot] = true - threadpool.spawnCallbacks(rootUsed, root, subRoot) - end - return root -end - -return useRoots diff --git a/dist/pesde/lune/roots/src/methods/will-finish.luau b/dist/pesde/lune/roots/src/methods/will-finish.luau deleted file mode 100644 index 893088f4..00000000 --- a/dist/pesde/lune/roots/src/methods/will-finish.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -local function willFinish(root: types.Self, callback: () -> ()) - root._finish:register(callback) - return root -end - -return willFinish diff --git a/dist/pesde/lune/roots/src/methods/will-start.luau b/dist/pesde/lune/roots/src/methods/will-start.luau deleted file mode 100644 index 7c3d88c3..00000000 --- a/dist/pesde/lune/roots/src/methods/will-start.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -local function willStart(root: types.Self, callback: () -> ()) - root._start:register(callback) - return root -end - -return willStart diff --git a/dist/pesde/lune/runtime/LICENSE.md b/dist/pesde/lune/runtime/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/lune/runtime/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/lune/runtime/pesde.toml b/dist/pesde/lune/runtime/pesde.toml deleted file mode 100644 index 6ec5bb70..00000000 --- a/dist/pesde/lune/runtime/pesde.toml +++ /dev/null @@ -1,21 +0,0 @@ -authors = ["Fire "] -description = "Runtime agnostic libraries for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", -] -license = "MPL-2.0" -name = "prvdmwrong/runtime" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = ["src"] -environment = "lune" -lib = "src/init.luau" -[dependencies] diff --git a/dist/pesde/lune/runtime/src/implementations/init.luau b/dist/pesde/lune/runtime/src/implementations/init.luau deleted file mode 100644 index 28dbe015..00000000 --- a/dist/pesde/lune/runtime/src/implementations/init.luau +++ /dev/null @@ -1,56 +0,0 @@ -local types = require("@self/../types") - -type Implementation = { new: (() -> T)?, implementation: T? } - -export type RuntimeName = "roblox" | "luau" | "lune" | "lute" | "seal" | "zune" - -local supportedRuntimes = table.freeze({ - roblox = require("@self/roblox"), - luau = require("@self/luau"), - lune = require("@self/lune"), - lute = require("@self/lute"), - seal = require("@self/seal"), - zune = require("@self/zune"), -}) - -local currentRuntime: types.Runtime = nil -do - for _, runtime in supportedRuntimes :: { [string]: types.Runtime } do - local isRuntime = runtime.is() - if isRuntime then - local currentRuntimePriority = currentRuntime and currentRuntime.priority or 0 - local runtimePriority = runtime.priority or 0 - if currentRuntimePriority <= runtimePriority then - currentRuntime = runtime - end - end - end - assert(currentRuntime, "No supported runtime") -end - -local currentRuntimeName: RuntimeName = currentRuntime.name :: any - -local function notImplemented(functionName: string) - return function() - error(`'{functionName}' is not implemented by runtime '{currentRuntimeName}'`, 2) - end -end - -local function implementFunction(label: string, implementations: { [types.Runtime]: Implementation? }): T - local implementation = implementations[currentRuntime] - if implementation then - if implementation.new then - return implementation.new() - elseif implementation.implementation then - return implementation.implementation - end - end - return notImplemented(label) :: any -end - -return table.freeze({ - supportedRuntimes = supportedRuntimes, - currentRuntime = currentRuntime, - currentRuntimeName = currentRuntimeName, - implementFunction = implementFunction, -}) diff --git a/dist/pesde/lune/runtime/src/implementations/init.spec.luau b/dist/pesde/lune/runtime/src/implementations/init.spec.luau deleted file mode 100644 index 3ce91cbb..00000000 --- a/dist/pesde/lune/runtime/src/implementations/init.spec.luau +++ /dev/null @@ -1,81 +0,0 @@ -local implementations = require("@self/../implementations") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("currentRuntime", function() - test("detects lune runtime", function() - expect(implementations.currentRuntimeName).is("lune") - expect(implementations.currentRuntime).is(implementations.supportedRuntimes.lune) - end) - end) - - describe("implementFunction", function() - test("implements for lune runtime", function() - local lune = function() end - local luau = function() end - - local implementation = implementations.implementFunction("implementation", { - [implementations.supportedRuntimes.lune] = { - implementation = lune, - }, - [implementations.supportedRuntimes.luau] = { - implementation = luau, - }, - }) - - expect(implementation).is_a("function") - expect(implementation).never_is(luau) - expect(implementation).is(lune) - end) - - test("constructs for lune runtime", function() - local lune = function() end - local luau = function() end - - local constructedLune = false - - local implementation = implementations.implementFunction("implementation", { - [implementations.supportedRuntimes.lune] = { - new = function() - constructedLune = true - return lune - end, - }, - [implementations.supportedRuntimes.luau] = { - new = function() - return luau - end, - }, - }) - - expect(implementation).is_a("function") - expect(implementation).never_is(luau) - expect(implementation).is(lune) - expect(constructedLune).is_true() - end) - - test("defaults to not implemented function", function() - local constructSuccess, runSuccess = false, false - - local implementation = implementations.implementFunction("implementation", { - [implementations.supportedRuntimes.roblox] = { - new = function() - constructSuccess = true - return function() - runSuccess = true - end - end, - }, - }) - - expect(constructSuccess).is(false) - expect(implementation).is_a("function") - expect(implementation).fails_with("'implementation' is not implemented by runtime 'lune'") - expect(runSuccess).is(false) - end) - end) -end diff --git a/dist/pesde/lune/runtime/src/implementations/luau.luau b/dist/pesde/lune/runtime/src/implementations/luau.luau deleted file mode 100644 index c67e52f4..00000000 --- a/dist/pesde/lune/runtime/src/implementations/luau.luau +++ /dev/null @@ -1,9 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "luau", - priority = -1, - is = function() - return true - end, -}) diff --git a/dist/pesde/lune/runtime/src/implementations/lune.luau b/dist/pesde/lune/runtime/src/implementations/lune.luau deleted file mode 100644 index f49834eb..00000000 --- a/dist/pesde/lune/runtime/src/implementations/lune.luau +++ /dev/null @@ -1,10 +0,0 @@ -local types = require("../types") - -local LUNE_VERSION_FORMAT = "(Lune) (%d+%.%d+%.%d+.*)+(%d+)" - -return types.Runtime({ - name = "lune", - is = function() - return string.match(_VERSION, LUNE_VERSION_FORMAT) ~= nil - end, -}) diff --git a/dist/pesde/lune/runtime/src/implementations/lute.luau b/dist/pesde/lune/runtime/src/implementations/lute.luau deleted file mode 100644 index 7b6abc58..00000000 --- a/dist/pesde/lune/runtime/src/implementations/lute.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "lute", - is = function() - return false - end, -}) diff --git a/dist/pesde/lune/runtime/src/implementations/roblox.luau b/dist/pesde/lune/runtime/src/implementations/roblox.luau deleted file mode 100644 index 91a780e2..00000000 --- a/dist/pesde/lune/runtime/src/implementations/roblox.luau +++ /dev/null @@ -1,9 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "roblox", - is = function() - -- wtf - return not not (_VERSION == "Luau" and game and workspace) - end, -}) diff --git a/dist/pesde/lune/runtime/src/implementations/seal.luau b/dist/pesde/lune/runtime/src/implementations/seal.luau deleted file mode 100644 index 0a72684c..00000000 --- a/dist/pesde/lune/runtime/src/implementations/seal.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "seal", - is = function() - return false - end, -}) diff --git a/dist/pesde/lune/runtime/src/implementations/zune.luau b/dist/pesde/lune/runtime/src/implementations/zune.luau deleted file mode 100644 index 48243e05..00000000 --- a/dist/pesde/lune/runtime/src/implementations/zune.luau +++ /dev/null @@ -1,10 +0,0 @@ -local types = require("../types") - -local ZUNE_VERSION_FORMAT = "(Zune) (%d+%.%d+%.%d+.*)+(%d+%.%d+)" - -return types.Runtime({ - name = "zune", - is = function() - return string.match(_VERSION, ZUNE_VERSION_FORMAT) ~= nil - end, -}) diff --git a/dist/pesde/lune/runtime/src/index.d.ts b/dist/pesde/lune/runtime/src/index.d.ts deleted file mode 100644 index b227b952..00000000 --- a/dist/pesde/lune/runtime/src/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -declare namespace runtime { - export type RuntimeName = "roblox" | "luau" | "lune" | "lute" | "seal" | "zune"; - - export const name: RuntimeName; - - export namespace task { - export function cancel(thread: thread): void; - - export function defer(functionOrThread: (...args: T) => void, ...args: T): thread; - export function defer(functionOrThread: thread): thread; - export function defer( - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function delay( - duration: number, - functionOrThread: (...args: T) => void, - ...args: T - ): thread; - export function delay(duration: number, functionOrThread: thread): thread; - export function delay( - duration: number, - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function spawn(functionOrThread: (...args: T) => void, ...args: T): thread; - export function spawn(functionOrThread: thread): thread; - export function spawn( - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function wait(duration: number): number; - } - - export function warn(...args: T): void; - - export namespace threadpool { - export function spawn(f: (...args: T) => void, ...args: T): void; - export function spawnCallbacks(functions: ((...args: T) => void)[], ...args: T): void; - } -} - -export = runtime; -export as namespace runtime; diff --git a/dist/pesde/lune/runtime/src/init.luau b/dist/pesde/lune/runtime/src/init.luau deleted file mode 100644 index 26bdeee0..00000000 --- a/dist/pesde/lune/runtime/src/init.luau +++ /dev/null @@ -1,15 +0,0 @@ -local implementations = require("@self/implementations") -local task = require("@self/libs/task") -local threadpool = require("@self/batteries/threadpool") -local warn = require("@self/libs/warn") - -export type RuntimeName = implementations.RuntimeName - -return table.freeze({ - name = implementations.currentRuntimeName, - - task = task, - warn = warn, - - threadpool = threadpool, -}) diff --git a/dist/pesde/lune/runtime/src/libs/task.luau b/dist/pesde/lune/runtime/src/libs/task.luau deleted file mode 100644 index 28c1ac9e..00000000 --- a/dist/pesde/lune/runtime/src/libs/task.luau +++ /dev/null @@ -1,157 +0,0 @@ -local implementations = require("../implementations") - -export type TaskLib = { - cancel: (thread) -> (), - defer: (functionOrThread: thread | (T...) -> (), T...) -> thread, - delay: (duration: number, functionOrThread: thread | (T...) -> (), T...) -> thread, - spawn: (functionOrThread: thread | (T...) -> (), T...) -> thread, - wait: (duration: number?) -> number, -} - -local supportedRuntimes = implementations.supportedRuntimes -local implementFunction = implementations.implementFunction - -local function defaultSpawn(functionOrThread: thread | (T...) -> (), ...: T...): thread - if type(functionOrThread) == "thread" then - coroutine.resume(functionOrThread, ...) - return functionOrThread - else - local thread = coroutine.create(functionOrThread) - coroutine.resume(thread, ...) - return thread - end -end - -local function defaultWait(seconds: number?) - local startTime = os.clock() - local endTime = startTime + (seconds or 1) - local clockTime: number - repeat - clockTime = os.clock() - until clockTime >= endTime - return clockTime - startTime -end - -local task: TaskLib = table.freeze({ - cancel = implementFunction("task.wait", { - [supportedRuntimes.roblox] = { - new = function() - return task.cancel - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").cancel - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").cancel - end, - }, - [supportedRuntimes.luau] = { - implementation = function(thread) - if not coroutine.close(thread) then - error(debug.traceback(thread, "Could not cancel thread")) - end - end, - }, - }), - defer = implementFunction("task.defer", { - [supportedRuntimes.roblox] = { - new = function() - return task.defer :: any - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").defer - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").defer - end, - }, - [supportedRuntimes.luau] = { - implementation = defaultSpawn, - }, - }), - delay = implementFunction("task.delay", { - [supportedRuntimes.roblox] = { - new = function() - return task.delay :: any - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").delay - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").delay - end, - }, - [supportedRuntimes.luau] = { - implementation = function(duration: number, functionOrThread: thread | (T...) -> (), ...: T...): thread - return defaultSpawn( - if typeof(functionOrThread) == "function" - then function(duration, functionOrThread, ...) - defaultWait(duration) - functionOrThread(...) - end - else function(duration, functionOrThread, ...) - defaultWait(duration) - coroutine.resume(...) - end, - duration, - functionOrThread, - ... - ) - end, - }, - }), - spawn = implementFunction("task.spawn", { - [supportedRuntimes.roblox] = { - new = function() - return task.spawn :: any - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").spawn - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").spawn - end, - }, - [supportedRuntimes.luau] = { - implementation = defaultSpawn, - }, - }), - wait = implementFunction("task.wait", { - [supportedRuntimes.roblox] = { - new = function() - return task.wait - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").wait - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").wait - end, - }, - [supportedRuntimes.luau] = { - implementation = defaultWait, - }, - }), -}) - -return task diff --git a/dist/pesde/lune/runtime/src/libs/task.spec.luau b/dist/pesde/lune/runtime/src/libs/task.spec.luau deleted file mode 100644 index 0918e87f..00000000 --- a/dist/pesde/lune/runtime/src/libs/task.spec.luau +++ /dev/null @@ -1,62 +0,0 @@ -local luneTask = require("@lune/task") -local task = require("./task") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - --- FIXME: can't async stuff lol -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("task", function() - test("spawn", function() - expect(task.spawn).is(luneTask.spawn) - local spawned = false - - task.spawn(function() - spawned = true - end) - - expect(spawned).is_true() - end) - - test("defer", function() - expect(task.defer).is(luneTask.defer) - - -- local spawned = false - - -- task.defer(function() - -- spawned = true - -- end) - - -- expect(spawned).never_is_true() - end) - - test("delay", function() - expect(task.delay).is(luneTask.delay) - -- local spawned = false - - -- task.delay(0.25, function() - -- spawned = true - -- end) - - -- expect(spawned).never_is_true() - - -- local startTime = os.clock() - -- repeat - -- until os.clock() - startTime > 0.5 - - -- print(spawned) - - -- expect(spawned).is_true() - end) - - test("wait", function() - expect(task.wait).is(luneTask.wait) - end) - - test("cancel", function() - expect(task.cancel).is(luneTask.cancel) - end) - end) -end diff --git a/dist/pesde/lune/runtime/src/libs/warn.luau b/dist/pesde/lune/runtime/src/libs/warn.luau deleted file mode 100644 index 6a4837ac..00000000 --- a/dist/pesde/lune/runtime/src/libs/warn.luau +++ /dev/null @@ -1,27 +0,0 @@ -local implementations = require("../implementations") - -local supportedRuntimes = implementations.supportedRuntimes -local implementFunction = implementations.implementFunction - -local function tostringTuple(...: any) - local stringified = {} - for index = 1, select("#", ...) do - table.insert(stringified, tostring(select(index, ...))) - end - return table.concat(stringified, " ") -end - -local warn: (T...) -> () = implementFunction("warn", { - [supportedRuntimes.roblox] = { - new = function() - return warn - end, - }, - [supportedRuntimes.luau] = { - implementation = function(...: T...) - print(`\27[0;33m{tostringTuple(...)}\27[0m`) - end, - }, -}) - -return warn diff --git a/dist/pesde/lune/runtime/src/types.luau b/dist/pesde/lune/runtime/src/types.luau deleted file mode 100644 index ca050fce..00000000 --- a/dist/pesde/lune/runtime/src/types.luau +++ /dev/null @@ -1,13 +0,0 @@ -export type Runtime = { - name: string, - priority: number?, - is: () -> boolean, -} - -local function Runtime(x: Runtime) - return table.freeze(x) -end - -return table.freeze({ - Runtime = Runtime, -}) diff --git a/dist/pesde/lune/typecheckers/LICENSE.md b/dist/pesde/lune/typecheckers/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/lune/typecheckers/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/lune/typecheckers/pesde.toml b/dist/pesde/lune/typecheckers/pesde.toml deleted file mode 100644 index 0386d30a..00000000 --- a/dist/pesde/lune/typecheckers/pesde.toml +++ /dev/null @@ -1,21 +0,0 @@ -authors = ["Fire "] -description = "Typechecking primitives and compatibility for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", -] -license = "MPL-2.0" -name = "prvdmwrong/typecheckers" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = ["src"] -environment = "lune" -lib = "src/init.luau" -[dependencies] diff --git a/dist/pesde/lune/typecheckers/src/init.luau b/dist/pesde/lune/typecheckers/src/init.luau deleted file mode 100644 index e69de29b..00000000 diff --git a/dist/pesde/roblox/dependencies/.pesde/scripts/roblox_sync_config_generator.luau b/dist/pesde/roblox/dependencies/.pesde/scripts/roblox_sync_config_generator.luau deleted file mode 100644 index 8aa75020..00000000 --- a/dist/pesde/roblox/dependencies/.pesde/scripts/roblox_sync_config_generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/roblox_sync_config_generator") diff --git a/dist/pesde/roblox/dependencies/.pesde/scripts/sourcemap-generator.luau b/dist/pesde/roblox/dependencies/.pesde/scripts/sourcemap-generator.luau deleted file mode 100644 index ba9144a3..00000000 --- a/dist/pesde/roblox/dependencies/.pesde/scripts/sourcemap-generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/sourcemap_generator") diff --git a/dist/pesde/roblox/dependencies/LICENSE.md b/dist/pesde/roblox/dependencies/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/roblox/dependencies/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/roblox/dependencies/lifecycles.luau b/dist/pesde/roblox/dependencies/lifecycles.luau deleted file mode 100644 index 41d507c6..00000000 --- a/dist/pesde/roblox/dependencies/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/pesde/roblox/dependencies/logger.luau b/dist/pesde/roblox/dependencies/logger.luau deleted file mode 100644 index 7f5c3021..00000000 --- a/dist/pesde/roblox/dependencies/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/pesde/roblox/dependencies/pesde.toml b/dist/pesde/roblox/dependencies/pesde.toml deleted file mode 100644 index 696e9c1e..00000000 --- a/dist/pesde/roblox/dependencies/pesde.toml +++ /dev/null @@ -1,38 +0,0 @@ -authors = ["Fire "] -description = "Dependency resolution logic for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "lifecycles.luau", - "logger.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/dependencies" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "lifecycles.luau", - "logger.luau", -] -environment = "roblox" -lib = "src/init.luau" -[dependencies] -lifecycles = { workspace = "prvdmwrong/lifecycles", version = "0.2.0-rc.4" } -logger = { workspace = "prvdmwrong/logger", version = "0.2.0-rc.4" } - - [scripts] - roblox_sync_config_generator = ".pesde/scripts/roblox_sync_config_generator.luau" - sourcemap_generator = ".pesde/scripts/sourcemap_generator.luau" - - [dev_dependencies] - scripts = { name = "pesde/scripts_rojo", version = "^0.1.0", target = "lune" } - rojo = { name = "pesde/rojo", version = "^7.4.4", target = "lune" } - \ No newline at end of file diff --git a/dist/pesde/roblox/dependencies/src/depend.luau b/dist/pesde/roblox/dependencies/src/depend.luau deleted file mode 100644 index 55230b4e..00000000 --- a/dist/pesde/roblox/dependencies/src/depend.luau +++ /dev/null @@ -1,30 +0,0 @@ -local logger = require("./logger") -local types = require("./types") - -local function useBeforeConstructed(unresolved: types.UnresolvedDependency) - logger:fatalError({ template = logger.useBeforeConstructed, unresolved.dependency.name or "subdependency" }) -end - -local unresolvedMt = { - __metatable = "This metatable is locked.", - __index = useBeforeConstructed, - __newindex = useBeforeConstructed, -} - -function unresolvedMt:__tostring() - return "UnresolvedDependency" -end - --- Wtf luau -local function depend(dependency: types.Dependency): typeof(({} :: types.Dependency).new( - (nil :: any) :: Dependencies, - ... -)) - -- Return a mock value that will be resolved during dependency resolution. - return setmetatable({ - type = "UnresolvedDependency", - dependency = dependency, - }, unresolvedMt) :: any -end - -return depend diff --git a/dist/pesde/roblox/dependencies/src/index.d.ts b/dist/pesde/roblox/dependencies/src/index.d.ts deleted file mode 100644 index a5bddcde..00000000 --- a/dist/pesde/roblox/dependencies/src/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Lifecycle } from "../lifecycles"; - -declare namespace dependencies { - export type Dependency = Self & { - dependencies: Dependencies, - priority?: number, - new(dependencies: Dependencies, ...args: NewArgs): Dependency; - }; - - interface ProccessDependencyResult { - sortedDependencies: Dependency[]; - lifecycles: Lifecycle[]; - } - - export type SubdependenciesOf = T extends { dependencies: infer Dependencies } - ? Dependencies - : never; - - export function depend InstanceType>(dependency: T): InstanceType; - export function processDependencies(dependencies: Set>): ProccessDependencyResult; - export function sortByPriority(dependencies: Dependency[]): void; -} - -export = dependencies; -export as namespace dependencies; diff --git a/dist/pesde/roblox/dependencies/src/init.luau b/dist/pesde/roblox/dependencies/src/init.luau deleted file mode 100644 index e6b27b24..00000000 --- a/dist/pesde/roblox/dependencies/src/init.luau +++ /dev/null @@ -1,12 +0,0 @@ -local depend = require("@self/depend") -local processDependencies = require("@self/process-dependencies") -local sortByPriority = require("@self/sort-by-priority") -local types = require("@self/types") - -export type Dependency = types.Dependency - -return table.freeze({ - depend = depend, - processDependencies = processDependencies, - sortByPriority = sortByPriority, -}) diff --git a/dist/pesde/roblox/dependencies/src/logger.luau b/dist/pesde/roblox/dependencies/src/logger.luau deleted file mode 100644 index 22f3b307..00000000 --- a/dist/pesde/roblox/dependencies/src/logger.luau +++ /dev/null @@ -1,7 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/dependencies", logger.standardErrorInfoUrl("dependencies"), { - useBeforeConstructed = "Cannot use %s before it is constructed. Are you using the dependency outside a class method?", - alreadyDestroyed = "Cannot destroy an already destroyed Root.", - alreadyFinished = "Root has already finished.", -}) diff --git a/dist/pesde/roblox/dependencies/src/process-dependencies.luau b/dist/pesde/roblox/dependencies/src/process-dependencies.luau deleted file mode 100644 index 20820a35..00000000 --- a/dist/pesde/roblox/dependencies/src/process-dependencies.luau +++ /dev/null @@ -1,57 +0,0 @@ -local lifecycles = require("../lifecycles") -local types = require("./types") - -export type ProccessDependencyResult = { - sortedDependencies: { types.Dependency }, - lifecycles: { lifecycles.Lifecycle }, -} - -type Set = { [T]: true } - -local function processDependencies(dependencies: Set>): ProccessDependencyResult - local sortedDependencies = {} - local lifecycles = {} - - -- TODO: optimize ts - local function visitDependency(dependency: types.Dependency) - -- print("Visiting dependency", dependency) - - for key, value in dependency :: any do - if key == "dependencies" then - -- print("Checking [prvd.dependencies]") - if typeof(value) == "table" then - for key, value in value do - -- print("Checking key", key, "value", value) - if typeof(value) == "table" and value.type == "UnresolvedDependency" then - local unresolved: types.UnresolvedDependency = value - -- print("Got unresolved dependency", unresolved.dependency, "visiting") - visitDependency(unresolved.dependency) - end - end - end - - continue - end - - if typeof(value) == "table" and value.type == "Lifecycle" and not table.find(lifecycles, value) then - table.insert(lifecycles, value) - end - end - - if dependencies[dependency] and not table.find(sortedDependencies, dependency) then - -- print("Pushing to sort") - table.insert(sortedDependencies, dependency) - end - end - - for dependency in dependencies do - visitDependency(dependency) - end - - return { - sortedDependencies = sortedDependencies, - lifecycles = lifecycles, - } -end - -return processDependencies diff --git a/dist/pesde/roblox/dependencies/src/process-dependencies.spec.luau b/dist/pesde/roblox/dependencies/src/process-dependencies.spec.luau deleted file mode 100644 index 0fcfcac8..00000000 --- a/dist/pesde/roblox/dependencies/src/process-dependencies.spec.luau +++ /dev/null @@ -1,67 +0,0 @@ -local depend = require("./depend") -local processDependencies = require("./process-dependencies") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - -local function nickname(name: string) - return function(tbl: T): T - return setmetatable(tbl :: any, { - __tostring = function() - return name - end, - }) - end -end - -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("processDependencies", function() - test("sortedDependencies", function() - local first = nickname("first")({}) - - local second = nickname("second")({ - dependencies = { - toFirst = depend(first :: any), - toFirstAgain = depend(first :: any), - }, - }) - - local third = nickname("third")({ - dependencies = { - toSecond = depend(second :: any), - }, - }) - - local fourth = nickname("fourth")({ - dependencies = { - toFirst = depend(first :: any), - toSecond = depend(second :: any), - toThird = depend(third :: any), - }, - }) - - local processed = processDependencies({ - [first] = true, - [second] = true, - [third] = true, - [fourth] = true, - } :: any) - - expect(typeof(processed)).is("table") - expect(processed).has_key("sortedDependencies") - expect(typeof(processed.sortedDependencies)).is("table") - - local sortedDependencies = processed.sortedDependencies - - expect(typeof(sortedDependencies)).is("table") - expect(sortedDependencies[1]).is(first) - expect(sortedDependencies[2]).is(second) - expect(sortedDependencies[3]).is(third) - expect(sortedDependencies[4]).is(fourth) - end) - - test("lifecycles", function() end) - end) -end diff --git a/dist/pesde/roblox/dependencies/src/sort-by-priority.luau b/dist/pesde/roblox/dependencies/src/sort-by-priority.luau deleted file mode 100644 index 638468ab..00000000 --- a/dist/pesde/roblox/dependencies/src/sort-by-priority.luau +++ /dev/null @@ -1,14 +0,0 @@ -local types = require("./types") - -local function sortByPriority(dependencies: { types.Dependency }) - table.sort(dependencies, function(left: any, right: any) - if left.priority ~= right.priority then - return (left.priority or 1) > (right.priority or 1) - end - local leftIndex = table.find(dependencies, left) - local rightIndex = table.find(dependencies, right) - return leftIndex < rightIndex - end) -end - -return sortByPriority diff --git a/dist/pesde/roblox/dependencies/src/sort-by-priority.spec.luau b/dist/pesde/roblox/dependencies/src/sort-by-priority.spec.luau deleted file mode 100644 index eeb34933..00000000 --- a/dist/pesde/roblox/dependencies/src/sort-by-priority.spec.luau +++ /dev/null @@ -1,52 +0,0 @@ -local sortByPriority = require("./sort-by-priority") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("sortByPriority", function() - test("dependencies", function() - local first = {} - - local second = { - toFirst = first, - } - - local third = { - toSecond = second, - } - - local sortedDependencies = { - first, - second, - third, - } - - sortByPriority(sortedDependencies :: any) - - expect(sortedDependencies[1]).is(first) - expect(sortedDependencies[2]).is(second) - expect(sortedDependencies[3]).is(third) - end) - - test("priority", function() - local low = {} - - local high = { - priority = 500, - } - - local sortedDependencies = { - low, - high, - } - - sortByPriority(sortedDependencies :: any) - - expect(sortedDependencies[1]).is(high) - expect(sortedDependencies[2]).is(low) - end) - end) -end diff --git a/dist/pesde/roblox/dependencies/src/types.luau b/dist/pesde/roblox/dependencies/src/types.luau deleted file mode 100644 index 2b1c72aa..00000000 --- a/dist/pesde/roblox/dependencies/src/types.luau +++ /dev/null @@ -1,14 +0,0 @@ -export type Dependency = Self & { - dependencies: Dependencies, - priority: number?, - new: (dependencies: Dependencies, NewArgs...) -> Dependency, -} - -export type UnresolvedDependency = { - type: "UnresolvedDependency", - dependency: Dependency, -} - -export type dependencies = { __prvdmwrong_dependencies: never } - -return nil diff --git a/dist/pesde/roblox/lifecycles/.pesde/scripts/roblox_sync_config_generator.luau b/dist/pesde/roblox/lifecycles/.pesde/scripts/roblox_sync_config_generator.luau deleted file mode 100644 index 8aa75020..00000000 --- a/dist/pesde/roblox/lifecycles/.pesde/scripts/roblox_sync_config_generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/roblox_sync_config_generator") diff --git a/dist/pesde/roblox/lifecycles/.pesde/scripts/sourcemap-generator.luau b/dist/pesde/roblox/lifecycles/.pesde/scripts/sourcemap-generator.luau deleted file mode 100644 index ba9144a3..00000000 --- a/dist/pesde/roblox/lifecycles/.pesde/scripts/sourcemap-generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/sourcemap_generator") diff --git a/dist/pesde/roblox/lifecycles/LICENSE.md b/dist/pesde/roblox/lifecycles/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/roblox/lifecycles/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/roblox/lifecycles/logger.luau b/dist/pesde/roblox/lifecycles/logger.luau deleted file mode 100644 index 7f5c3021..00000000 --- a/dist/pesde/roblox/lifecycles/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/pesde/roblox/lifecycles/pesde.toml b/dist/pesde/roblox/lifecycles/pesde.toml deleted file mode 100644 index 1c949f70..00000000 --- a/dist/pesde/roblox/lifecycles/pesde.toml +++ /dev/null @@ -1,38 +0,0 @@ -authors = ["Fire "] -description = "Provider method lifecycles implementation for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "logger.luau", - "runtime.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/lifecycles" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "logger.luau", - "runtime.luau", -] -environment = "roblox" -lib = "src/init.luau" -[dependencies] -logger = { workspace = "prvdmwrong/logger", version = "0.2.0-rc.4" } -runtime = { workspace = "prvdmwrong/runtime", version = "0.2.0-rc.4" } - - [scripts] - roblox_sync_config_generator = ".pesde/scripts/roblox_sync_config_generator.luau" - sourcemap_generator = ".pesde/scripts/sourcemap_generator.luau" - - [dev_dependencies] - scripts = { name = "pesde/scripts_rojo", version = "^0.1.0", target = "lune" } - rojo = { name = "pesde/rojo", version = "^7.4.4", target = "lune" } - \ No newline at end of file diff --git a/dist/pesde/roblox/lifecycles/runtime.luau b/dist/pesde/roblox/lifecycles/runtime.luau deleted file mode 100644 index 7530eb0a..00000000 --- a/dist/pesde/roblox/lifecycles/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/pesde/roblox/lifecycles/src/create.luau b/dist/pesde/roblox/lifecycles/src/create.luau deleted file mode 100644 index 6cdd2891..00000000 --- a/dist/pesde/roblox/lifecycles/src/create.luau +++ /dev/null @@ -1,45 +0,0 @@ -local await = require("./methods/await") -local clear = require("./methods/unregister-all") -local destroy = require("./methods/destroy") -local lifecycleConstructed = require("./hooks/lifecycle-constructed") -local methodToLifecycles = require("./method-to-lifecycles") -local onRegistered = require("./methods/on-registered") -local onUnregistered = require("./methods/on-unregistered") -local register = require("./methods/register") -local types = require("./types") -local unregister = require("./methods/unregister") - -local function create( - method: string, - onFire: (lifecycle: types.Lifecycle, Args...) -> () -): types.Lifecycle - local self: types.Self = { - _isDestroyed = false, - _selfRegistered = {}, - _selfUnregistered = {}, - - type = "Lifecycle", - callbacks = {}, - - fire = onFire, - method = method, - register = register, - unregister = unregister, - clear = clear, - onRegistered = onRegistered, - onUnregistered = onUnregistered, - await = await, - destroy = destroy, - } :: any - - methodToLifecycles[method] = methodToLifecycles[method] or {} - table.insert(methodToLifecycles[method], self) - - for _, onLifecycleConstructed in lifecycleConstructed.callbacks do - onLifecycleConstructed(self :: types.Lifecycle) - end - - return self -end - -return create diff --git a/dist/pesde/roblox/lifecycles/src/handlers/fire-concurrent.luau b/dist/pesde/roblox/lifecycles/src/handlers/fire-concurrent.luau deleted file mode 100644 index f279b888..00000000 --- a/dist/pesde/roblox/lifecycles/src/handlers/fire-concurrent.luau +++ /dev/null @@ -1,10 +0,0 @@ -local runtime = require("../../runtime") -local types = require("../types") - -local function fireConcurrent(lifecycle: types.Lifecycle, ...: Args...) - for _, callback in lifecycle.callbacks do - runtime.threadpool.spawn(callback, ...) - end -end - -return fireConcurrent diff --git a/dist/pesde/roblox/lifecycles/src/hooks/lifecycle-constructed.luau b/dist/pesde/roblox/lifecycles/src/hooks/lifecycle-constructed.luau deleted file mode 100644 index 8ea4d81b..00000000 --- a/dist/pesde/roblox/lifecycles/src/hooks/lifecycle-constructed.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (lifecycle: types.Lifecycle) -> () } = {} - -local function onLifecycleConstructed(listener: (lifecycle: types.Lifecycle) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleConstructed = onLifecycleConstructed, -}) diff --git a/dist/pesde/roblox/lifecycles/src/hooks/lifecycle-unregistered.luau b/dist/pesde/roblox/lifecycles/src/hooks/lifecycle-unregistered.luau deleted file mode 100644 index 0ec81756..00000000 --- a/dist/pesde/roblox/lifecycles/src/hooks/lifecycle-unregistered.luau +++ /dev/null @@ -1,20 +0,0 @@ -local types = require("../types") - -local callbacks: { (lifecycle: types.Lifecycle, callback: (...unknown) -> ()) -> () } = {} - -local function onLifecycleUnregistered( - listener: ( - lifecycle: types.Lifecycle, - callback: (Args...) -> () - ) -> () -): () -> () - table.insert(callbacks, listener :: any) - return function() - table.remove(callbacks, table.find(callbacks, listener :: any)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleUnregistered = onLifecycleUnregistered, -}) diff --git a/dist/pesde/roblox/lifecycles/src/index.d.ts b/dist/pesde/roblox/lifecycles/src/index.d.ts deleted file mode 100644 index 0e5f324b..00000000 --- a/dist/pesde/roblox/lifecycles/src/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -declare namespace lifecycles { - export interface Lifecycle { - type: "Lifecycle"; - - callbacks: Array<(...args: Args) => void>; - method: string; - - register(callback: (...args: Args) => void): void; - fire(...args: Args): void; - unregister(callback: (...args: Args) => void): void; - clear(): void; - onRegistered(listener: (callback: (...args: Args) => void) => void): () => void; - onUnegistered(listener: (callback: (...args: Args) => void) => void): () => void; - await(): LuaTuple; - destroy(): void; - } - - export function create( - method: string, - onFire: (lifecycle: Lifecycle, ...args: Args) => void - ): Lifecycle; - - export namespace handlers { - export function fireConcurrent(lifecycle: Lifecycle, ...args: Args): void; - export function fireSequential(lifecycle: Lifecycle, ...args: Args): void; - } - - export namespace hooks { - export function onLifecycleConstructed(callback: (lifecycle: Lifecycle) => void): () => void; - export function onLifecycleDestroyed(callback: (lifecycle: Lifecycle) => void): () => void; - export function onLifecycleRegistered( - callback: (lifecycle: Lifecycle, callback: (...args: Args) => void) => void - ): () => void; - export function onLifecycleUnregistered( - callback: (lifecycle: Lifecycle, callback: (...args: Args) => void) => void - ): () => void; - } - - export namespace _ { - export const methodToLifecycles: Map; - } -} - -export = lifecycles; -export as namespace lifecycles; diff --git a/dist/pesde/roblox/lifecycles/src/init.luau b/dist/pesde/roblox/lifecycles/src/init.luau deleted file mode 100644 index dbec091b..00000000 --- a/dist/pesde/roblox/lifecycles/src/init.luau +++ /dev/null @@ -1,28 +0,0 @@ -local create = require("@self/create") -local fireConcurrent = require("@self/handlers/fire-concurrent") -local fireSequential = require("@self/handlers/fire-sequential") -local lifecycleConstructed = require("@self/hooks/lifecycle-constructed") -local lifecycleDestroyed = require("@self/hooks/lifecycle-destroyed") -local lifecycleRegistered = require("@self/hooks/lifecycle-registered") -local lifecycleUnregistered = require("@self/hooks/lifecycle-unregistered") -local methodToLifecycles = require("@self/method-to-lifecycles") -local types = require("@self/types") - -export type Lifecycle = types.Lifecycle - -return table.freeze({ - create = create, - handlers = table.freeze({ - fireConcurrent = fireConcurrent, - fireSequential = fireSequential, - }), - hooks = table.freeze({ - onLifecycleRegistered = lifecycleRegistered.onLifecycleRegistered, - onLifecycleUnregistered = lifecycleUnregistered.onLifecycleUnregistered, - onLifecycleConstructed = lifecycleConstructed.onLifecycleConstructed, - onLifecycleDestroyed = lifecycleDestroyed.onLifecycleDestroyed, - }), - _ = table.freeze({ - methodToLifecycles = methodToLifecycles, - }), -}) diff --git a/dist/pesde/roblox/lifecycles/src/logger.luau b/dist/pesde/roblox/lifecycles/src/logger.luau deleted file mode 100644 index 3ae7c27e..00000000 --- a/dist/pesde/roblox/lifecycles/src/logger.luau +++ /dev/null @@ -1,6 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/lifecycles", logger.standardErrorInfoUrl("lifecycles"), { - useAfterDestroy = "Cannot use Lifecycle after it is destroyed.", - alreadyDestroyed = "Cannot destroy an already destroyed Lifecycle.", -}) diff --git a/dist/pesde/roblox/lifecycles/src/method-to-lifecycles.luau b/dist/pesde/roblox/lifecycles/src/method-to-lifecycles.luau deleted file mode 100644 index 386a8756..00000000 --- a/dist/pesde/roblox/lifecycles/src/method-to-lifecycles.luau +++ /dev/null @@ -1,5 +0,0 @@ -local types = require("./types") - -local methodToLifecycles: { [string]: { types.Lifecycle } } = {} - -return methodToLifecycles diff --git a/dist/pesde/roblox/lifecycles/src/methods/await.luau b/dist/pesde/roblox/lifecycles/src/methods/await.luau deleted file mode 100644 index ed8299d6..00000000 --- a/dist/pesde/roblox/lifecycles/src/methods/await.luau +++ /dev/null @@ -1,17 +0,0 @@ -local logger = require("../logger") -local types = require("../types") - -local function await(lifecycle: types.Self): Args... - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - local currentThread = coroutine.running() - local function callback(...: Args...) - lifecycle:unregister(callback) - coroutine.resume(currentThread, ...) - end - lifecycle:register(callback) - return coroutine.yield() -end - -return await diff --git a/dist/pesde/roblox/lifecycles/src/methods/destroy.luau b/dist/pesde/roblox/lifecycles/src/methods/destroy.luau deleted file mode 100644 index d9d5d6cc..00000000 --- a/dist/pesde/roblox/lifecycles/src/methods/destroy.luau +++ /dev/null @@ -1,18 +0,0 @@ -local lifecycleDestroyed = require("../hooks/lifecycle-destroyed") -local logger = require("../logger") -local methodToLifecycles = require("../method-to-lifecycles") -local types = require("../types") - -local function destroy(lifecycle: types.Self) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.alreadyDestroyed }) - end - table.remove(methodToLifecycles[lifecycle.method], table.find(methodToLifecycles[lifecycle.method], lifecycle)) - table.clear(lifecycle.callbacks) - for _, callback in lifecycleDestroyed.callbacks do - callback(lifecycle) - end - lifecycle._isDestroyed = true -end - -return destroy diff --git a/dist/pesde/roblox/lifecycles/src/methods/on-registered.luau b/dist/pesde/roblox/lifecycles/src/methods/on-registered.luau deleted file mode 100644 index 7ddb009a..00000000 --- a/dist/pesde/roblox/lifecycles/src/methods/on-registered.luau +++ /dev/null @@ -1,17 +0,0 @@ -local logger = require("../logger") -local types = require("../types") - -local function onRegistered(lifecycle: types.Self, listener: (callback: (Args...) -> ()) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - if _G.PRVDMWRONG_DISALLOW_MULTIPLE_LISTENERS then - table.remove(lifecycle._selfRegistered, table.find(lifecycle._selfRegistered, listener)) - end - table.insert(lifecycle._selfRegistered, listener) - return function() - table.remove(lifecycle._selfRegistered, table.find(lifecycle._selfRegistered, listener)) - end -end - -return onRegistered diff --git a/dist/pesde/roblox/lifecycles/src/methods/on-unregistered.luau b/dist/pesde/roblox/lifecycles/src/methods/on-unregistered.luau deleted file mode 100644 index 842040ec..00000000 --- a/dist/pesde/roblox/lifecycles/src/methods/on-unregistered.luau +++ /dev/null @@ -1,17 +0,0 @@ -local logger = require("../logger") -local types = require("../types") - -local function onUnregistered(lifecycle: types.Self, listener: (callback: (Args...) -> ()) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - if _G.PRVDMWRONG_DISALLOW_MULTIPLE_LISTENERS then - table.remove(lifecycle._selfUnregistered, table.find(lifecycle._selfUnregistered, listener)) - end - table.insert(lifecycle._selfUnregistered, listener) - return function() - table.remove(lifecycle._selfUnregistered, table.find(lifecycle._selfUnregistered, listener)) - end -end - -return onUnregistered diff --git a/dist/pesde/roblox/lifecycles/src/methods/unregister.luau b/dist/pesde/roblox/lifecycles/src/methods/unregister.luau deleted file mode 100644 index 0ca7223f..00000000 --- a/dist/pesde/roblox/lifecycles/src/methods/unregister.luau +++ /dev/null @@ -1,18 +0,0 @@ -local logger = require("../logger") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function unregister(lifecycle: types.Self, callback: (Args...) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - local index = table.find(lifecycle.callbacks, callback) - if index then - table.remove(lifecycle.callbacks, index) - threadpool.spawnCallbacks(lifecycle._selfUnregistered, callback) - end -end - -return unregister diff --git a/dist/pesde/roblox/lifecycles/src/types.luau b/dist/pesde/roblox/lifecycles/src/types.luau deleted file mode 100644 index f2931b52..00000000 --- a/dist/pesde/roblox/lifecycles/src/types.luau +++ /dev/null @@ -1,23 +0,0 @@ -export type Lifecycle = { - type: "Lifecycle", - - callbacks: { (Args...) -> () }, - method: string, - - register: (self: Lifecycle, callback: (Args...) -> ()) -> (), - fire: (self: Lifecycle, Args...) -> (), - unregister: (self: Lifecycle, callback: (Args...) -> ()) -> (), - clear: (self: Lifecycle) -> (), - onRegistered: (self: Lifecycle, listener: (callback: (Args...) -> ()) -> ()) -> () -> (), - onUnregistered: (self: Lifecycle, listener: (callback: (Args...) -> ()) -> ()) -> () -> (), - await: (self: Lifecycle) -> Args..., - destroy: (self: Lifecycle) -> (), -} - -export type Self = Lifecycle & { - _isDestroyed: boolean, - _selfRegistered: { (callback: (Args...) -> ()) -> () }, - _selfUnregistered: { (callback: (Args...) -> ()) -> () }, -} - -return nil diff --git a/dist/pesde/roblox/logger/.pesde/scripts/roblox_sync_config_generator.luau b/dist/pesde/roblox/logger/.pesde/scripts/roblox_sync_config_generator.luau deleted file mode 100644 index 8aa75020..00000000 --- a/dist/pesde/roblox/logger/.pesde/scripts/roblox_sync_config_generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/roblox_sync_config_generator") diff --git a/dist/pesde/roblox/logger/.pesde/scripts/sourcemap-generator.luau b/dist/pesde/roblox/logger/.pesde/scripts/sourcemap-generator.luau deleted file mode 100644 index ba9144a3..00000000 --- a/dist/pesde/roblox/logger/.pesde/scripts/sourcemap-generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/sourcemap_generator") diff --git a/dist/pesde/roblox/logger/LICENSE.md b/dist/pesde/roblox/logger/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/roblox/logger/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/roblox/logger/pesde.toml b/dist/pesde/roblox/logger/pesde.toml deleted file mode 100644 index 12da700e..00000000 --- a/dist/pesde/roblox/logger/pesde.toml +++ /dev/null @@ -1,35 +0,0 @@ -authors = ["Fire "] -description = "Logging for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "runtime.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/logger" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "runtime.luau", -] -environment = "roblox" -lib = "src/init.luau" -[dependencies] -runtime = { workspace = "prvdmwrong/runtime", version = "0.2.0-rc.4" } - - [scripts] - roblox_sync_config_generator = ".pesde/scripts/roblox_sync_config_generator.luau" - sourcemap_generator = ".pesde/scripts/sourcemap_generator.luau" - - [dev_dependencies] - scripts = { name = "pesde/scripts_rojo", version = "^0.1.0", target = "lune" } - rojo = { name = "pesde/rojo", version = "^7.4.4", target = "lune" } - \ No newline at end of file diff --git a/dist/pesde/roblox/logger/runtime.luau b/dist/pesde/roblox/logger/runtime.luau deleted file mode 100644 index 7530eb0a..00000000 --- a/dist/pesde/roblox/logger/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/pesde/roblox/logger/src/allow-web-links.luau b/dist/pesde/roblox/logger/src/allow-web-links.luau deleted file mode 100644 index dcd0bb82..00000000 --- a/dist/pesde/roblox/logger/src/allow-web-links.luau +++ /dev/null @@ -1,5 +0,0 @@ -local runtime = require("../runtime") - -local allowWebLinks = if runtime.name == "roblox" then game:GetService("RunService"):IsStudio() else true - -return allowWebLinks diff --git a/dist/pesde/roblox/logger/src/create.luau b/dist/pesde/roblox/logger/src/create.luau deleted file mode 100644 index 943aab25..00000000 --- a/dist/pesde/roblox/logger/src/create.luau +++ /dev/null @@ -1,32 +0,0 @@ -local allowWebLinks = require("./allow-web-links") -local formatLog = require("./format-log") -local runtime = require("../runtime") -local types = require("./types") - -local task = runtime.task -local warn = runtime.warn - -local function create(label: string, errorInfoUrl: string?, templates: T): types.Logger - local self = {} :: types.Logger - self.type = "Logger" - - label = `[{label}] ` - errorInfoUrl = if allowWebLinks then errorInfoUrl else nil - - function self:warn(log) - warn(label .. formatLog(self, log, errorInfoUrl)) - end - - function self:error(log) - task.spawn(error, label .. formatLog(self, log, errorInfoUrl), 0) - end - - function self:fatalError(log) - error(label .. formatLog(self, log, errorInfoUrl)) - end - - setmetatable(self :: any, { __index = templates }) - return self -end - -return create diff --git a/dist/pesde/roblox/logger/src/format-log.luau b/dist/pesde/roblox/logger/src/format-log.luau deleted file mode 100644 index 3eeda21b..00000000 --- a/dist/pesde/roblox/logger/src/format-log.luau +++ /dev/null @@ -1,43 +0,0 @@ -local types = require("./types") - -local function formatLog(self: types.Logger, log: types.Log, errorInfoUrl: string?): string - local formattedTemplate = string.format(log.template, table.unpack(log)) - - local error = log.error - local trace: string? = log.trace - - if error then - trace = error.trace - formattedTemplate = string.gsub(formattedTemplate, "ERROR_MESSAGE", error.message) - end - - local id: string? - - -- TODO: find a better way to do ts while still being ergonomic - for templateKey, template in (self :: any) :: { [string]: string } do - if template == log.template then - id = templateKey - break - end - end - - if id then - formattedTemplate ..= `\nID: {id}` - end - - if errorInfoUrl then - formattedTemplate ..= `\nLearn more: {errorInfoUrl}` - if id then - formattedTemplate ..= `#{string.lower(id)}` - end - end - - if trace then - formattedTemplate ..= `\n---- Stack trace ----\n{trace}` - end - - -- Labels are added from createLogger, so we don't add it here - return string.gsub(formattedTemplate, "\n", "\n ") -end - -return formatLog diff --git a/dist/pesde/roblox/logger/src/index.d.ts b/dist/pesde/roblox/logger/src/index.d.ts deleted file mode 100644 index 85251a07..00000000 --- a/dist/pesde/roblox/logger/src/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -declare namespace Logger { - export interface Error { - type: "Error"; - raw: string; - message: string; - trace: string; - } - - interface LogProps { - template: string; - error?: Error; - trace?: string; - } - - export type Log = LogProps & unknown[]; - - interface LoggerProps { - print(props: Log): void; - warn(props: Log): void; - error(props: Log): void; - fatalError(props: Log): never; - } - - export type Logger> = LoggerProps & Templates; - - export function create>( - label: string, - errorInfoUrl: string | undefined, - templates: Templates - ): Logger; - - export function formatLog>( - logger: Logger, - log: Log, - errorInfoUrl?: string - ): string; - - export function parseError(err: string): Error; - - export const allowWebLinks: boolean; - export function standardErrorInfoUrl(label: string): string; -} - -export = Logger; -export as namespace Logger; diff --git a/dist/pesde/roblox/logger/src/init.luau b/dist/pesde/roblox/logger/src/init.luau deleted file mode 100644 index 52760a5d..00000000 --- a/dist/pesde/roblox/logger/src/init.luau +++ /dev/null @@ -1,18 +0,0 @@ -local allowWebLinks = require("@self/allow-web-links") -local create = require("@self/create") -local formatLog = require("@self/format-log") -local parseError = require("@self/parse-error") -local standardErrorInfoUrl = require("@self/standard-error-info-url") -local types = require("@self/types") - -export type Logger = types.Logger -export type Log = types.Log -export type Error = types.Error - -return table.freeze({ - create = create, - formatLog = formatLog, - parseError = parseError, - allowWebLinks = allowWebLinks, - standardErrorInfoUrl = standardErrorInfoUrl, -}) diff --git a/dist/pesde/roblox/logger/src/parse-error.luau b/dist/pesde/roblox/logger/src/parse-error.luau deleted file mode 100644 index e43fe53d..00000000 --- a/dist/pesde/roblox/logger/src/parse-error.luau +++ /dev/null @@ -1,12 +0,0 @@ -local types = require("./types") - -local function parseError(err: string): types.Error - return { - type = "Error", - raw = err, - message = err:gsub("^.+:%d+:%s*", ""), - trace = debug.traceback(nil, 2), - } -end - -return parseError diff --git a/dist/pesde/roblox/logger/src/standard-error-info-url.luau b/dist/pesde/roblox/logger/src/standard-error-info-url.luau deleted file mode 100644 index 345faf36..00000000 --- a/dist/pesde/roblox/logger/src/standard-error-info-url.luau +++ /dev/null @@ -1,5 +0,0 @@ -local function standardErrorInfoUrl(label: string): string - return `https://prvdmwrong.luau.page/api-reference/{label}/errors` -end - -return standardErrorInfoUrl diff --git a/dist/pesde/roblox/logger/src/types.luau b/dist/pesde/roblox/logger/src/types.luau deleted file mode 100644 index d1699037..00000000 --- a/dist/pesde/roblox/logger/src/types.luau +++ /dev/null @@ -1,23 +0,0 @@ -export type Error = { - type: "Error", - raw: string, - message: string, - trace: string, -} - -export type Log = { - template: string, - error: Error?, - trace: string?, - [number]: unknown, -} - -export type Logger = Templates & { - type: "Logger", - print: (self: Logger, props: Log) -> (), - warn: (self: Logger, props: Log) -> (), - error: (self: Logger, props: Log) -> (), - fatalError: (self: Logger, props: Log) -> never, -} - -return nil diff --git a/dist/pesde/roblox/providers/.pesde/scripts/roblox_sync_config_generator.luau b/dist/pesde/roblox/providers/.pesde/scripts/roblox_sync_config_generator.luau deleted file mode 100644 index 8aa75020..00000000 --- a/dist/pesde/roblox/providers/.pesde/scripts/roblox_sync_config_generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/roblox_sync_config_generator") diff --git a/dist/pesde/roblox/providers/.pesde/scripts/sourcemap-generator.luau b/dist/pesde/roblox/providers/.pesde/scripts/sourcemap-generator.luau deleted file mode 100644 index ba9144a3..00000000 --- a/dist/pesde/roblox/providers/.pesde/scripts/sourcemap-generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/sourcemap_generator") diff --git a/dist/pesde/roblox/providers/LICENSE.md b/dist/pesde/roblox/providers/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/roblox/providers/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/roblox/providers/dependencies.luau b/dist/pesde/roblox/providers/dependencies.luau deleted file mode 100644 index 8613b470..00000000 --- a/dist/pesde/roblox/providers/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/pesde/roblox/providers/lifecycles.luau b/dist/pesde/roblox/providers/lifecycles.luau deleted file mode 100644 index 41d507c6..00000000 --- a/dist/pesde/roblox/providers/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/pesde/roblox/providers/logger.luau b/dist/pesde/roblox/providers/logger.luau deleted file mode 100644 index 7f5c3021..00000000 --- a/dist/pesde/roblox/providers/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/pesde/roblox/providers/pesde.toml b/dist/pesde/roblox/providers/pesde.toml deleted file mode 100644 index 2c228e8b..00000000 --- a/dist/pesde/roblox/providers/pesde.toml +++ /dev/null @@ -1,44 +0,0 @@ -authors = ["Fire "] -description = "Provider creation for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "runtime.luau", - "logger.luau", - "lifecycles.luau", - "dependencies.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/providers" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "runtime.luau", - "logger.luau", - "lifecycles.luau", - "dependencies.luau", -] -environment = "roblox" -lib = "src/init.luau" -[dependencies] -dependencies = { workspace = "prvdmwrong/dependencies", version = "0.2.0-rc.4" } -runtime = { workspace = "prvdmwrong/runtime", version = "0.2.0-rc.4" } -lifecycles = { workspace = "prvdmwrong/lifecycles", version = "0.2.0-rc.4" } -logger = { workspace = "prvdmwrong/logger", version = "0.2.0-rc.4" } - - [scripts] - roblox_sync_config_generator = ".pesde/scripts/roblox_sync_config_generator.luau" - sourcemap_generator = ".pesde/scripts/sourcemap_generator.luau" - - [dev_dependencies] - scripts = { name = "pesde/scripts_rojo", version = "^0.1.0", target = "lune" } - rojo = { name = "pesde/rojo", version = "^7.4.4", target = "lune" } - \ No newline at end of file diff --git a/dist/pesde/roblox/providers/runtime.luau b/dist/pesde/roblox/providers/runtime.luau deleted file mode 100644 index 7530eb0a..00000000 --- a/dist/pesde/roblox/providers/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/pesde/roblox/providers/src/create.luau b/dist/pesde/roblox/providers/src/create.luau deleted file mode 100644 index 016b8a6d..00000000 --- a/dist/pesde/roblox/providers/src/create.luau +++ /dev/null @@ -1,30 +0,0 @@ -local nameOf = require("./name-of") -local providerClasses = require("./provider-classes") -local types = require("./types") - -local function createProvider(self: Self): types.Provider - local provider: types.Provider = self :: any - - if provider.__index == nil then - provider.__index = provider - end - - if provider.__tostring == nil then - provider.__tostring = nameOf - end - - if provider.new == nil then - function provider.new(dependencies) - local self: types.Provider = setmetatable({}, provider) :: any - if provider.constructor then - return provider.constructor(self, dependencies) or self - end - return self - end - end - - providerClasses[provider] = true - return provider -end - -return createProvider diff --git a/dist/pesde/roblox/providers/src/index.d.ts b/dist/pesde/roblox/providers/src/index.d.ts deleted file mode 100644 index 2ab36e15..00000000 --- a/dist/pesde/roblox/providers/src/index.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Dependency } from "../dependencies"; - -declare namespace providers { - export type Provider = Dependency< - Self & { - __index: Provider; - name?: string; - constructor?(dependencies: Dependencies): void; - start?(): void; - destroy?(): void; - }, - Dependencies - >; - - // Class decorator syntax - export function create InstanceType>(self: Self): Provider; - // Normal syntax - export function create(self: Self): Provider; - - export function nameOf(provider: Provider): string; - - export namespace _ { - export const providerClasses: Set>; - } - - export interface Start { - start(): void; - } - - export interface Destroy { - destroy(): void; - } -} - -export = providers; -export as namespace providers; diff --git a/dist/pesde/roblox/providers/src/init.luau b/dist/pesde/roblox/providers/src/init.luau deleted file mode 100644 index d678d850..00000000 --- a/dist/pesde/roblox/providers/src/init.luau +++ /dev/null @@ -1,16 +0,0 @@ -local create = require("@self/create") -local nameOf = require("@self/name-of") -local providerClasses = require("@self/provider-classes") -local types = require("@self/types") - -export type Provider = types.Provider - -local providers = table.freeze({ - create = create, - nameOf = nameOf, - _ = table.freeze({ - providerClasses = providerClasses, - }), -}) - -return providers diff --git a/dist/pesde/roblox/providers/src/name-of.luau b/dist/pesde/roblox/providers/src/name-of.luau deleted file mode 100644 index 3f86ceec..00000000 --- a/dist/pesde/roblox/providers/src/name-of.luau +++ /dev/null @@ -1,7 +0,0 @@ -local types = require("./types") - -local function nameOf(provider: types.Provider) - return provider.name or "Provider" -end - -return nameOf diff --git a/dist/pesde/roblox/providers/src/provider-classes.luau b/dist/pesde/roblox/providers/src/provider-classes.luau deleted file mode 100644 index cc57922f..00000000 --- a/dist/pesde/roblox/providers/src/provider-classes.luau +++ /dev/null @@ -1,7 +0,0 @@ -local types = require("./types") - -type Set = { [T]: true } - -local providerClasses: Set> = setmetatable({}, { __mode = "k" }) :: any - -return providerClasses diff --git a/dist/pesde/roblox/providers/src/types.luau b/dist/pesde/roblox/providers/src/types.luau deleted file mode 100644 index 4f4d4dc9..00000000 --- a/dist/pesde/roblox/providers/src/types.luau +++ /dev/null @@ -1,12 +0,0 @@ -local dependencies = require("../dependencies") - -export type Provider = dependencies.Dependency, - __tostring: (self: Provider) -> string, - name: string?, - constructor: ((self: Provider, dependencies: Dependencies) -> ())?, - start: (self: Provider) -> ()?, - destroy: (self: Provider) -> ()?, -}, Dependencies> - -return nil diff --git a/dist/pesde/roblox/prvdmwrong/.pesde/scripts/roblox_sync_config_generator.luau b/dist/pesde/roblox/prvdmwrong/.pesde/scripts/roblox_sync_config_generator.luau deleted file mode 100644 index 8aa75020..00000000 --- a/dist/pesde/roblox/prvdmwrong/.pesde/scripts/roblox_sync_config_generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/roblox_sync_config_generator") diff --git a/dist/pesde/roblox/prvdmwrong/.pesde/scripts/sourcemap-generator.luau b/dist/pesde/roblox/prvdmwrong/.pesde/scripts/sourcemap-generator.luau deleted file mode 100644 index ba9144a3..00000000 --- a/dist/pesde/roblox/prvdmwrong/.pesde/scripts/sourcemap-generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/sourcemap_generator") diff --git a/dist/pesde/roblox/prvdmwrong/LICENSE.md b/dist/pesde/roblox/prvdmwrong/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/roblox/prvdmwrong/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/roblox/prvdmwrong/dependencies.luau b/dist/pesde/roblox/prvdmwrong/dependencies.luau deleted file mode 100644 index 8613b470..00000000 --- a/dist/pesde/roblox/prvdmwrong/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/pesde/roblox/prvdmwrong/lifecycles.luau b/dist/pesde/roblox/prvdmwrong/lifecycles.luau deleted file mode 100644 index 41d507c6..00000000 --- a/dist/pesde/roblox/prvdmwrong/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/pesde/roblox/prvdmwrong/pesde.toml b/dist/pesde/roblox/prvdmwrong/pesde.toml deleted file mode 100644 index 065c5392..00000000 --- a/dist/pesde/roblox/prvdmwrong/pesde.toml +++ /dev/null @@ -1,44 +0,0 @@ -authors = ["Fire "] -description = "Entry point to Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "dependencies.luau", - "roots.luau", - "lifecycles.luau", - "providers.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/prvdmwrong" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "dependencies.luau", - "roots.luau", - "lifecycles.luau", - "providers.luau", -] -environment = "roblox" -lib = "src/init.luau" -[dependencies] -dependencies = { workspace = "prvdmwrong/dependencies", version = "0.2.0-rc.4" } -roots = { workspace = "prvdmwrong/roots", version = "0.2.0-rc.4" } -lifecycles = { workspace = "prvdmwrong/lifecycles", version = "0.2.0-rc.4" } -providers = { workspace = "prvdmwrong/providers", version = "0.2.0-rc.4" } - - [scripts] - roblox_sync_config_generator = ".pesde/scripts/roblox_sync_config_generator.luau" - sourcemap_generator = ".pesde/scripts/sourcemap_generator.luau" - - [dev_dependencies] - scripts = { name = "pesde/scripts_rojo", version = "^0.1.0", target = "lune" } - rojo = { name = "pesde/rojo", version = "^7.4.4", target = "lune" } - \ No newline at end of file diff --git a/dist/pesde/roblox/prvdmwrong/providers.luau b/dist/pesde/roblox/prvdmwrong/providers.luau deleted file mode 100644 index bdf28037..00000000 --- a/dist/pesde/roblox/prvdmwrong/providers.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/providers") -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/pesde/roblox/prvdmwrong/roots.luau b/dist/pesde/roblox/prvdmwrong/roots.luau deleted file mode 100644 index 29353bdf..00000000 --- a/dist/pesde/roblox/prvdmwrong/roots.luau +++ /dev/null @@ -1,4 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/roots") -export type Root = DEPENDENCY.Root -export type StartedRoot = DEPENDENCY.StartedRoot -return DEPENDENCY diff --git a/dist/pesde/roblox/prvdmwrong/src/index.d.ts b/dist/pesde/roblox/prvdmwrong/src/index.d.ts deleted file mode 100644 index 2058129c..00000000 --- a/dist/pesde/roblox/prvdmwrong/src/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import dependencies from "../dependencies"; -import lifecycles from "../lifecycles"; -import providers from "../providers"; -import roots from "../roots"; - -declare namespace prvd { - export type Provider = providers.Provider; - export interface Lifecycle extends lifecycles.Lifecycle { } - export type SubdependenciesOf = dependencies.SubdependenciesOf; - export interface Root extends roots.Root { } - export interface StartedRoot extends roots.StartedRoot { } - - export interface Start extends providers.Start { } - export interface Destroy extends providers.Destroy { } - - export const provider: typeof providers.create; - export const root: typeof roots.create; - export const depend: typeof dependencies.depend; - export const nameOf: typeof providers.nameOf; - - export const lifecycle: typeof lifecycles.create; - export const fireConcurrent: typeof lifecycles.handlers.fireConcurrent; - export const fireSequential: typeof lifecycles.handlers.fireSequential; - - export namespace hooks { - export const onLifecycleConstructed: typeof lifecycles.hooks.onLifecycleConstructed; - export const onLifecycleDestroyed: typeof lifecycles.hooks.onLifecycleDestroyed; - export const onLifecycleRegistered: typeof lifecycles.hooks.onLifecycleRegistered; - export const onLifecycleUnregistered: typeof lifecycles.hooks.onLifecycleUnregistered; - - export const onLifecycleUsed: typeof roots.hooks.onLifecycleUsed; - export const onProviderUsed: typeof roots.hooks.onProviderUsed; - export const onRootUsed: typeof roots.hooks.onRootUsed; - export const onRootConstructing: typeof roots.hooks.onRootConstructing; - export const onRootStarted: typeof roots.hooks.onRootStarted; - export const onRootFinished: typeof roots.hooks.onRootFinished; - export const onRootDestroyed: typeof roots.hooks.onRootDestroyed; - } -} - -export = prvd; -export as namespace prvd; diff --git a/dist/pesde/roblox/prvdmwrong/src/init.luau b/dist/pesde/roblox/prvdmwrong/src/init.luau deleted file mode 100644 index 1381801d..00000000 --- a/dist/pesde/roblox/prvdmwrong/src/init.luau +++ /dev/null @@ -1,45 +0,0 @@ -local dependencies = require("./dependencies") -local lifecycles = require("./lifecycles") -local providers = require("./providers") -local roots = require("./roots") - -export type Provider = providers.Provider -export type Lifecycle = lifecycles.Lifecycle -export type Root = roots.Root -export type StartedRoot = roots.StartedRoot - -local prvd = { - provider = providers.create, - root = roots.create, - depend = dependencies.depend, - nameOf = providers.nameOf, - - lifecycle = lifecycles.create, - fireConcurrent = lifecycles.handlers.fireConcurrent, - fireSequential = lifecycles.handlers.fireSequential, - - hooks = table.freeze({ - onProviderUsed = roots.hooks.onProviderUsed, - onLifecycleUsed = roots.hooks.onLifecycleUsed, - onRootConstructing = roots.hooks.onRootConstructing, - onRootUsed = roots.hooks.onRootUsed, - onRootStarted = roots.hooks.onRootStarted, - onRootFinished = roots.hooks.onRootFinished, - onRootDestroyed = roots.hooks.onRootDestroyed, - - onLifecycleConstructed = lifecycles.hooks.onLifecycleConstructed, - onLifecycleDestroyed = lifecycles.hooks.onLifecycleDestroyed, - onLifecycleRegistered = lifecycles.hooks.onLifecycleRegistered, - onLifecycleUnregistered = lifecycles.hooks.onLifecycleUnregistered, - }), -} - -type PrvdModule = ((provider: Self) -> Provider) & typeof(prvd) - -local mt = {} -function mt.__call(_, provider: Self): providers.Provider - return providers.create(provider) :: any -end - -local module: PrvdModule = setmetatable(prvd, mt) :: any -return module diff --git a/dist/pesde/roblox/rbx-components/.pesde/scripts/roblox_sync_config_generator.luau b/dist/pesde/roblox/rbx-components/.pesde/scripts/roblox_sync_config_generator.luau deleted file mode 100644 index 8aa75020..00000000 --- a/dist/pesde/roblox/rbx-components/.pesde/scripts/roblox_sync_config_generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/roblox_sync_config_generator") diff --git a/dist/pesde/roblox/rbx-components/.pesde/scripts/sourcemap-generator.luau b/dist/pesde/roblox/rbx-components/.pesde/scripts/sourcemap-generator.luau deleted file mode 100644 index ba9144a3..00000000 --- a/dist/pesde/roblox/rbx-components/.pesde/scripts/sourcemap-generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/sourcemap_generator") diff --git a/dist/pesde/roblox/rbx-components/LICENSE.md b/dist/pesde/roblox/rbx-components/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/roblox/rbx-components/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/roblox/rbx-components/dependencies.luau b/dist/pesde/roblox/rbx-components/dependencies.luau deleted file mode 100644 index 8613b470..00000000 --- a/dist/pesde/roblox/rbx-components/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/pesde/roblox/rbx-components/logger.luau b/dist/pesde/roblox/rbx-components/logger.luau deleted file mode 100644 index 7f5c3021..00000000 --- a/dist/pesde/roblox/rbx-components/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/pesde/roblox/rbx-components/pesde.toml b/dist/pesde/roblox/rbx-components/pesde.toml deleted file mode 100644 index a481f22b..00000000 --- a/dist/pesde/roblox/rbx-components/pesde.toml +++ /dev/null @@ -1,44 +0,0 @@ -authors = ["Fire "] -description = "Component functionality for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "logger.luau", - "roots.luau", - "providers.luau", - "dependencies.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/rbx_components" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "logger.luau", - "roots.luau", - "providers.luau", - "dependencies.luau", -] -environment = "roblox" -lib = "src/init.luau" -[dependencies] -logger = { workspace = "prvdmwrong/logger", version = "0.2.0-rc.4" } -roots = { workspace = "prvdmwrong/roots", version = "0.2.0-rc.4" } -providers = { workspace = "prvdmwrong/providers", version = "0.2.0-rc.4" } -dependencies = { workspace = "prvdmwrong/dependencies", version = "0.2.0-rc.4" } - - [scripts] - roblox_sync_config_generator = ".pesde/scripts/roblox_sync_config_generator.luau" - sourcemap_generator = ".pesde/scripts/sourcemap_generator.luau" - - [dev_dependencies] - scripts = { name = "pesde/scripts_rojo", version = "^0.1.0", target = "lune" } - rojo = { name = "pesde/rojo", version = "^7.4.4", target = "lune" } - \ No newline at end of file diff --git a/dist/pesde/roblox/rbx-components/providers.luau b/dist/pesde/roblox/rbx-components/providers.luau deleted file mode 100644 index bdf28037..00000000 --- a/dist/pesde/roblox/rbx-components/providers.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/providers") -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/pesde/roblox/rbx-components/roots.luau b/dist/pesde/roblox/rbx-components/roots.luau deleted file mode 100644 index 29353bdf..00000000 --- a/dist/pesde/roblox/rbx-components/roots.luau +++ /dev/null @@ -1,4 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/roots") -export type Root = DEPENDENCY.Root -export type StartedRoot = DEPENDENCY.StartedRoot -return DEPENDENCY diff --git a/dist/pesde/roblox/rbx-components/src/component-classes.luau b/dist/pesde/roblox/rbx-components/src/component-classes.luau deleted file mode 100644 index 0dcdb30a..00000000 --- a/dist/pesde/roblox/rbx-components/src/component-classes.luau +++ /dev/null @@ -1,7 +0,0 @@ -local types = require("./types") - -type Set = { [T]: true } - -local componentClasses: Set> = setmetatable({}, { __mode = "k" }) :: any - -return componentClasses diff --git a/dist/pesde/roblox/rbx-components/src/create.luau b/dist/pesde/roblox/rbx-components/src/create.luau deleted file mode 100644 index 24d39a3b..00000000 --- a/dist/pesde/roblox/rbx-components/src/create.luau +++ /dev/null @@ -1,28 +0,0 @@ -local componentClasses = require("./component-classes") -local types = require("./types") - --- TODO: prvdmwrong/classes package? -local function create(self: Self): types.Component - local component: types.Component = self :: any - - if component.__index == nil then - component.__index = component - end - - -- TODO: abstract nameOf - - if component.new == nil then - function component.new(instance: any) - local self: types.Component = setmetatable({}, component) :: any - if component.constructor then - return component.constructor(self, instance) or self - end - return self - end - end - - componentClasses[component] = true - return component -end - -return create diff --git a/dist/pesde/roblox/rbx-components/src/extend-root/create-component-class-provider.luau b/dist/pesde/roblox/rbx-components/src/extend-root/create-component-class-provider.luau deleted file mode 100644 index 9d5ae999..00000000 --- a/dist/pesde/roblox/rbx-components/src/extend-root/create-component-class-provider.luau +++ /dev/null @@ -1,31 +0,0 @@ -local ComponentProvider = require("../component-provider") -local providers = require("../../providers") -local types = require("../types") - -local ComponentClassProvider = {} -ComponentClassProvider.priority = -math.huge -ComponentClassProvider.name = "@rbx-components.ComponentClassProvider" -ComponentClassProvider.dependencies = table.freeze({ - componentProvider = ComponentProvider, -}) - -ComponentClassProvider._components = {} :: { types.AnyComponent } - -function ComponentClassProvider.constructor( - self: ComponentClassProvider, - dependencies: typeof(ComponentClassProvider.dependencies) -) - for _, class in self._components do - dependencies.componentProvider:addComponentClass(class) - end -end - -export type ComponentClassProvider = typeof(ComponentClassProvider) - -local function createComponentClassProvider(components: { types.AnyComponent }) - local provider = table.clone(ComponentClassProvider) - provider._components = components - return providers.create(provider) -end - -return createComponentClassProvider diff --git a/dist/pesde/roblox/rbx-components/src/extend-root/init.luau b/dist/pesde/roblox/rbx-components/src/extend-root/init.luau deleted file mode 100644 index 6e9f0578..00000000 --- a/dist/pesde/roblox/rbx-components/src/extend-root/init.luau +++ /dev/null @@ -1,30 +0,0 @@ -local ComponentProvider = require("./component-provider") -local createComponentClassProvider = require("@self/create-component-class-provider") -local logger = require("./logger") -local roots = require("../roots") -local types = require("./types") -local useComponent = require("@self/use-component") -local useComponents = require("@self/use-components") -local useModuleAsComponent = require("@self/use-module-as-component") -local useModulesAsComponents = require("@self/use-modules-as-components") - -local function extendRoot(root: types.RootPrivate): types.Root - if root._hasComponentExtensions then - return logger:fatalError({ template = logger.alreadyExtendedRoot }) - end - - root._hasComponentExtensions = true - root._classes = {} - - root:useProvider(ComponentProvider) - root:useProvider(createComponentClassProvider(root._classes)) - - root.useComponent = useComponent :: any - root.useComponents = useComponents :: any - root.useModuleAsComponent = useModuleAsComponent :: any - root.useModulesAsComponents = useModulesAsComponents :: any - - return root -end - -return extendRoot :: (root: roots.Root) -> types.Root diff --git a/dist/pesde/roblox/rbx-components/src/extend-root/use-component.luau b/dist/pesde/roblox/rbx-components/src/extend-root/use-component.luau deleted file mode 100644 index b0bd8d1f..00000000 --- a/dist/pesde/roblox/rbx-components/src/extend-root/use-component.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -local function useComponent(root: types.RootPrivate, component: types.AnyComponent) - table.insert(root._classes, component) - return root -end - -return useComponent diff --git a/dist/pesde/roblox/rbx-components/src/extend-root/use-components.luau b/dist/pesde/roblox/rbx-components/src/extend-root/use-components.luau deleted file mode 100644 index 809a4006..00000000 --- a/dist/pesde/roblox/rbx-components/src/extend-root/use-components.luau +++ /dev/null @@ -1,10 +0,0 @@ -local types = require("../types") - -local function useComponents(root: types.RootPrivate, components: { types.AnyComponent }) - for index = 1, #components do - table.insert(root._classes, components[index]) - end - return root -end - -return useComponents diff --git a/dist/pesde/roblox/rbx-components/src/extend-root/use-module-as-component.luau b/dist/pesde/roblox/rbx-components/src/extend-root/use-module-as-component.luau deleted file mode 100644 index 46724fe7..00000000 --- a/dist/pesde/roblox/rbx-components/src/extend-root/use-module-as-component.luau +++ /dev/null @@ -1,12 +0,0 @@ -local componentClasses = require("../component-classes") -local types = require("../types") - -local function useModuleAsComponent(root: types.RootPrivate, module: ModuleScript) - local required = (require)(module) - if componentClasses[required] then - table.insert(root, required) - end - return root -end - -return useModuleAsComponent diff --git a/dist/pesde/roblox/rbx-components/src/extend-root/use-modules-as-components.luau b/dist/pesde/roblox/rbx-components/src/extend-root/use-modules-as-components.luau deleted file mode 100644 index bababafa..00000000 --- a/dist/pesde/roblox/rbx-components/src/extend-root/use-modules-as-components.luau +++ /dev/null @@ -1,28 +0,0 @@ -local componentClasses = require("../component-classes") -local types = require("../types") - -local function useModulesAsComponents( - root: types.RootPrivate, - modules: { Instance }, - predicate: ((ModuleScript) -> boolean)? -) - for index = 1, #modules do - local module = modules[index] - - if not module:IsA("ModuleScript") then - continue - end - - if predicate and not predicate(module) then - continue - end - - local required = (require)(module) - if componentClasses[required] then - table.insert(root, required) - end - end - return root -end - -return useModulesAsComponents diff --git a/dist/pesde/roblox/rbx-components/src/init.luau b/dist/pesde/roblox/rbx-components/src/init.luau deleted file mode 100644 index 598bcea4..00000000 --- a/dist/pesde/roblox/rbx-components/src/init.luau +++ /dev/null @@ -1,24 +0,0 @@ -local componentClasses = require("@self/component-classes") -local create = require("@self/create") -local extendRoot = require("@self/extend-root") -local types = require("@self/types") - -export type Component = types.Component -export type Root = types.Root - -local components = { - create = create, - extendRoot = extendRoot, - _ = table.freeze({ - componentClasses = componentClasses, - }), -} - -local mt = {} - -function mt.__call(_, component: Self): types.Component - return create(component) -end - -table.freeze(mt) -return table.freeze(setmetatable(components, mt)) diff --git a/dist/pesde/roblox/rbx-components/src/logger.luau b/dist/pesde/roblox/rbx-components/src/logger.luau deleted file mode 100644 index edcc7fac..00000000 --- a/dist/pesde/roblox/rbx-components/src/logger.luau +++ /dev/null @@ -1,8 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/rbx-components", logger.standardErrorInfoUrl("rbx-components"), { - alreadyExtendedRoot = "Root already has component extension.", - invalidComponent = "Not a component, create one with `components(MyComponent)` or `components.create(MyComponent)`.", - alreadyRegisteredComponent = "Component already registered.", - multipleSameTag = "Multiple components use the CollectionService tag '%s', which is likely a mistake. Supress this warning with `_G.PRVDMWRONG_SUPPRESS_MULTIPLE_SAME_TAG = true`.", -}) diff --git a/dist/pesde/roblox/rbx-components/src/types.luau b/dist/pesde/roblox/rbx-components/src/types.luau deleted file mode 100644 index 5bc17dcf..00000000 --- a/dist/pesde/roblox/rbx-components/src/types.luau +++ /dev/null @@ -1,30 +0,0 @@ -local dependencies = require("../dependencies") -local roots = require("../roots") - -export type Component = dependencies.Dependency, - tag: string?, - instanceCheck: (unknown) -> boolean, - blacklistInstances: { Instance }?, - whitelistInstances: { Instance }?, - constructor: (self: Component, instance: Instance) -> ()?, - added: (self: Component) -> ()?, - removed: (self: Component) -> ()?, - destroyed: (self: Component) -> ()?, -}, nil, Instance> - -export type Root = roots.Root & { - useModuleAsComponent: (root: Root, module: ModuleScript) -> Root, - useModulesAsComponents: (root: Root, modules: { Instance }, predicate: ((ModuleScript) -> boolean)?) -> Root, - useComponent: (root: Root, component: Component) -> Root, - useComponents: (root: Root, components: { Component }) -> Root, -} - -export type RootPrivate = Root & { - _hasComponentExtensions: true?, - _classes: { Component }, -} - -export type AnyComponent = Component - -return nil diff --git a/dist/pesde/roblox/rbx-lifecycles/.pesde/scripts/roblox_sync_config_generator.luau b/dist/pesde/roblox/rbx-lifecycles/.pesde/scripts/roblox_sync_config_generator.luau deleted file mode 100644 index 8aa75020..00000000 --- a/dist/pesde/roblox/rbx-lifecycles/.pesde/scripts/roblox_sync_config_generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/roblox_sync_config_generator") diff --git a/dist/pesde/roblox/rbx-lifecycles/.pesde/scripts/sourcemap-generator.luau b/dist/pesde/roblox/rbx-lifecycles/.pesde/scripts/sourcemap-generator.luau deleted file mode 100644 index ba9144a3..00000000 --- a/dist/pesde/roblox/rbx-lifecycles/.pesde/scripts/sourcemap-generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/sourcemap_generator") diff --git a/dist/pesde/roblox/rbx-lifecycles/LICENSE.md b/dist/pesde/roblox/rbx-lifecycles/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/roblox/rbx-lifecycles/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/roblox/rbx-lifecycles/pesde.toml b/dist/pesde/roblox/rbx-lifecycles/pesde.toml deleted file mode 100644 index 1a9be374..00000000 --- a/dist/pesde/roblox/rbx-lifecycles/pesde.toml +++ /dev/null @@ -1,35 +0,0 @@ -authors = ["Fire "] -description = "Lifecycles implementations for Roblox" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "prvdmwrong.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/rbx_lifecycles" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "prvdmwrong.luau", -] -environment = "roblox" -lib = "src/init.luau" -[dependencies] -prvdmwrong = { workspace = "prvdmwrong/prvdmwrong", version = "0.2.0-rc.4" } - - [scripts] - roblox_sync_config_generator = ".pesde/scripts/roblox_sync_config_generator.luau" - sourcemap_generator = ".pesde/scripts/sourcemap_generator.luau" - - [dev_dependencies] - scripts = { name = "pesde/scripts_rojo", version = "^0.1.0", target = "lune" } - rojo = { name = "pesde/rojo", version = "^7.4.4", target = "lune" } - \ No newline at end of file diff --git a/dist/pesde/roblox/rbx-lifecycles/prvdmwrong.luau b/dist/pesde/roblox/rbx-lifecycles/prvdmwrong.luau deleted file mode 100644 index 96053434..00000000 --- a/dist/pesde/roblox/rbx-lifecycles/prvdmwrong.luau +++ /dev/null @@ -1,6 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/prvdmwrong") -export type Root = DEPENDENCY.Root -export type Lifecycle = DEPENDENCY.Lifecycle -export type StartedRoot = DEPENDENCY.StartedRoot -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/pesde/roblox/rbx-lifecycles/src/index.d.ts b/dist/pesde/roblox/rbx-lifecycles/src/index.d.ts deleted file mode 100644 index 3ad36447..00000000 --- a/dist/pesde/roblox/rbx-lifecycles/src/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Lifecycle } from "../lifecycles"; -import { Provider } from "../providers"; - -declare namespace RbxLifecycles { - export const RbxLifecycles: Provider<{ - preSimulation: Lifecycle<[dt: number]>; - postSimulation: Lifecycle<[dt: number]>; - preAnimation: Lifecycle<[dt: number]>; - preRender: Lifecycle<[dt: number]>; - playerAdded: Lifecycle<[player: Player]>; - playerRemoving: Lifecycle<[player: Player]>; - }>; - - export interface PreSimulation { - preSimulation(dt: number): void; - } - - export interface PostSimulation { - postSimulation(dt: number): void; - } - - export interface PreAnimation { - preAnimation(dt: number): void; - } - - export interface PreRender { - preRender(dt: number): void; - } - - export interface PlayerAdded { - playerAdded(player: Player): void; - } - - export interface PlayerRemoving { - playerRemoving(player: Player): void; - } -} - -export = RbxLifecycles; -export as namespace RbxLifecycles; diff --git a/dist/pesde/roblox/rbx-lifecycles/src/init.luau b/dist/pesde/roblox/rbx-lifecycles/src/init.luau deleted file mode 100644 index c1243680..00000000 --- a/dist/pesde/roblox/rbx-lifecycles/src/init.luau +++ /dev/null @@ -1,67 +0,0 @@ -local Players = game:GetService("Players") -local RunService = game:GetService("RunService") - -local prvd = require("./prvdmwrong") - -local fireConcurrent = prvd.fireConcurrent - -local RbxLifecycles = {} -RbxLifecycles.name = "@prvdmwrong/rbx-lifecycles" -RbxLifecycles.priority = -math.huge - -RbxLifecycles.preSimulation = prvd.lifecycle("preSimulation", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.postSimulation = prvd.lifecycle("postSimulation", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.preAnimation = prvd.lifecycle("preAnimation", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.preRender = prvd.lifecycle("preRender", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.playerAdded = prvd.lifecycle("playerAdded", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.playerRemoving = prvd.lifecycle("playerRemoving", fireConcurrent) :: prvd.Lifecycle - -local function wrapLifecycle(lifecycle: prvd.Lifecycle<...unknown>) - return function(...: unknown) - lifecycle:fire(...) - end -end - -function RbxLifecycles.constructor(self: RbxLifecycles) - self.connections = {} :: { RBXScriptConnection } - - self:_addConnections( - RunService.PreSimulation:Connect(wrapLifecycle(RbxLifecycles.preSimulation :: any)), - RunService.PostSimulation:Connect(wrapLifecycle(RbxLifecycles.postSimulation :: any)), - RunService.PreAnimation:Connect(wrapLifecycle(RbxLifecycles.preAnimation :: any)) - ) - - if RunService:IsClient() then - self:_addConnections(RunService.PreRender:Connect(wrapLifecycle(RbxLifecycles.preRender :: any))) - end - - self:_addConnections( - Players.PlayerAdded:Connect(wrapLifecycle(RbxLifecycles.playerAdded :: any)), - Players.PlayerRemoving:Connect(wrapLifecycle(RbxLifecycles.playerRemoving :: any)) - ) -end - -function RbxLifecycles.finish(self: RbxLifecycles) - for _, connection in self.connections do - if connection.Connected then - connection:Disconnect() - end - end - table.clear(self.connections) -end - -function RbxLifecycles._addConnections(self: RbxLifecycles, ...: RBXScriptConnection) - for index = 1, select("#", ...) do - table.insert(self.connections, select(index, ...) :: any) - end -end - --- Needed so typescript can require the provider as: --- --- ```ts --- import { RbxLifecycles } from "@rbxts/rbx-lifecycles" --- ``` -RbxLifecycles.RbxLifecycles = RbxLifecycles - -export type RbxLifecycles = typeof(RbxLifecycles) -return prvd(RbxLifecycles) diff --git a/dist/pesde/roblox/roots/.pesde/scripts/roblox_sync_config_generator.luau b/dist/pesde/roblox/roots/.pesde/scripts/roblox_sync_config_generator.luau deleted file mode 100644 index 8aa75020..00000000 --- a/dist/pesde/roblox/roots/.pesde/scripts/roblox_sync_config_generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/roblox_sync_config_generator") diff --git a/dist/pesde/roblox/roots/.pesde/scripts/sourcemap-generator.luau b/dist/pesde/roblox/roots/.pesde/scripts/sourcemap-generator.luau deleted file mode 100644 index ba9144a3..00000000 --- a/dist/pesde/roblox/roots/.pesde/scripts/sourcemap-generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/sourcemap_generator") diff --git a/dist/pesde/roblox/roots/LICENSE.md b/dist/pesde/roblox/roots/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/roblox/roots/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/roblox/roots/dependencies.luau b/dist/pesde/roblox/roots/dependencies.luau deleted file mode 100644 index 8613b470..00000000 --- a/dist/pesde/roblox/roots/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/pesde/roblox/roots/lifecycles.luau b/dist/pesde/roblox/roots/lifecycles.luau deleted file mode 100644 index 41d507c6..00000000 --- a/dist/pesde/roblox/roots/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/pesde/roblox/roots/logger.luau b/dist/pesde/roblox/roots/logger.luau deleted file mode 100644 index 7f5c3021..00000000 --- a/dist/pesde/roblox/roots/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/pesde/roblox/roots/pesde.toml b/dist/pesde/roblox/roots/pesde.toml deleted file mode 100644 index d21822cd..00000000 --- a/dist/pesde/roblox/roots/pesde.toml +++ /dev/null @@ -1,47 +0,0 @@ -authors = ["Fire "] -description = "Roots implementation for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", - "logger.luau", - "dependencies.luau", - "runtime.luau", - "providers.luau", - "lifecycles.luau", -] -license = "MPL-2.0" -name = "prvdmwrong/roots" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = [ - "src", - "logger.luau", - "dependencies.luau", - "runtime.luau", - "providers.luau", - "lifecycles.luau", -] -environment = "roblox" -lib = "src/init.luau" -[dependencies] -logger = { workspace = "prvdmwrong/logger", version = "0.2.0-rc.4" } -dependencies = { workspace = "prvdmwrong/dependencies", version = "0.2.0-rc.4" } -providers = { workspace = "prvdmwrong/providers", version = "0.2.0-rc.4" } -lifecycles = { workspace = "prvdmwrong/lifecycles", version = "0.2.0-rc.4" } -runtime = { workspace = "prvdmwrong/runtime", version = "0.2.0-rc.4" } - - [scripts] - roblox_sync_config_generator = ".pesde/scripts/roblox_sync_config_generator.luau" - sourcemap_generator = ".pesde/scripts/sourcemap_generator.luau" - - [dev_dependencies] - scripts = { name = "pesde/scripts_rojo", version = "^0.1.0", target = "lune" } - rojo = { name = "pesde/rojo", version = "^7.4.4", target = "lune" } - \ No newline at end of file diff --git a/dist/pesde/roblox/roots/providers.luau b/dist/pesde/roblox/roots/providers.luau deleted file mode 100644 index bdf28037..00000000 --- a/dist/pesde/roblox/roots/providers.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/providers") -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/pesde/roblox/roots/runtime.luau b/dist/pesde/roblox/roots/runtime.luau deleted file mode 100644 index 7530eb0a..00000000 --- a/dist/pesde/roblox/roots/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./roblox_packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/pesde/roblox/roots/src/create.luau b/dist/pesde/roblox/roots/src/create.luau deleted file mode 100644 index 26c14f4e..00000000 --- a/dist/pesde/roblox/roots/src/create.luau +++ /dev/null @@ -1,47 +0,0 @@ -local destroy = require("./methods/destroy") -local lifecycles = require("../lifecycles") -local rootConstructing = require("./hooks/root-constructing") -local start = require("./methods/start") -local types = require("./types") -local useModule = require("./methods/use-module") -local useModules = require("./methods/use-modules") -local useProvider = require("./methods/use-provider") -local useProviders = require("./methods/use-providers") -local useRoot = require("./methods/use-root") -local useRoots = require("./methods/use-roots") -local willFinish = require("./methods/will-finish") -local willStart = require("./methods/will-start") - -local function create(): types.Root - local self: types.Self = { - type = "Root", - - start = start, - - useProvider = useProvider, - useProviders = useProviders, - useModule = useModule, - useModules = useModules, - useRoot = useRoot, - useRoots = useRoots, - destroy = destroy, - - willStart = willStart, - willFinish = willFinish, - - _destroyed = false, - _rootProviders = {}, - _rootLifecycles = {}, - _subRoots = {}, - _start = lifecycles.create("start", lifecycles.handlers.fireConcurrent), - _finish = lifecycles.create("destroy", lifecycles.handlers.fireSequential), - } :: any - - for _, callback in rootConstructing.callbacks do - callback(self) - end - - return self -end - -return create diff --git a/dist/pesde/roblox/roots/src/hooks/lifecycle-used.luau b/dist/pesde/roblox/roots/src/hooks/lifecycle-used.luau deleted file mode 100644 index bd29276a..00000000 --- a/dist/pesde/roblox/roots/src/hooks/lifecycle-used.luau +++ /dev/null @@ -1,16 +0,0 @@ -local lifecycles = require("../../lifecycles") -local types = require("../types") - -local callbacks: { (root: types.Self, provider: lifecycles.Lifecycle) -> () } = {} - -local function onLifecycleUsed(listener: (root: types.Root, lifecycle: lifecycles.Lifecycle) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleUsed = onLifecycleUsed, -}) diff --git a/dist/pesde/roblox/roots/src/hooks/provider-used.luau b/dist/pesde/roblox/roots/src/hooks/provider-used.luau deleted file mode 100644 index dac2573c..00000000 --- a/dist/pesde/roblox/roots/src/hooks/provider-used.luau +++ /dev/null @@ -1,16 +0,0 @@ -local providers = require("../../providers") -local types = require("../types") - -local callbacks: { (root: types.Self, provider: providers.Provider) -> () } = {} - -local function onProviderUsed(listener: (root: types.Root, provider: providers.Provider) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onProviderUsed = onProviderUsed, -}) diff --git a/dist/pesde/roblox/roots/src/hooks/root-constructing.luau b/dist/pesde/roblox/roots/src/hooks/root-constructing.luau deleted file mode 100644 index 5fb8b819..00000000 --- a/dist/pesde/roblox/roots/src/hooks/root-constructing.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self) -> () } = {} - -local function onRootConstructing(listener: (root: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootConstructing = onRootConstructing, -}) diff --git a/dist/pesde/roblox/roots/src/hooks/root-finished.luau b/dist/pesde/roblox/roots/src/hooks/root-finished.luau deleted file mode 100644 index d3519cea..00000000 --- a/dist/pesde/roblox/roots/src/hooks/root-finished.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self) -> () } = {} - -local function onRootFinished(listener: (root: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootFinished = onRootFinished, -}) diff --git a/dist/pesde/roblox/roots/src/hooks/root-used.luau b/dist/pesde/roblox/roots/src/hooks/root-used.luau deleted file mode 100644 index 71f172cc..00000000 --- a/dist/pesde/roblox/roots/src/hooks/root-used.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self, subRoot: types.Root) -> () } = {} - -local function onRootUsed(listener: (root: types.Root, subRoot: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootUsed = onRootUsed, -}) diff --git a/dist/pesde/roblox/roots/src/index.d.ts b/dist/pesde/roblox/roots/src/index.d.ts deleted file mode 100644 index d8e100c5..00000000 --- a/dist/pesde/roblox/roots/src/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Lifecycle } from "../lifecycles"; -import { Provider } from "../providers"; - -declare namespace roots { - export type Root = { - type: "Root"; - - start(): StartedRoot; - - useModule(module: ModuleScript): Root; - useModules(modules: Instance[], predicate?: (module: ModuleScript) => boolean): Root; - useRoot(root: Root): Root; - useRoots(roots: Root[]): Root; - useProvider(provider: Provider): Root; - useProviders(providers: Provider[]): Root; - useLifecycle(lifecycle: Lifecycle): Root; - useLifecycles(lifecycles: Lifecycle): Root; - destroy(): void; - - willStart(callback: () => void): Root; - willFinish(callback: () => void): Root; - }; - - export type StartedRoot = { - type: "StartedRoot"; - - finish(): void; - }; - - export function create(): Root; - - export namespace hooks { - export function onLifecycleUsed(listener: (lifecycle: Lifecycle) => void): () => void; - export function onProviderUsed(listener: (provider: Provider) => void): () => void; - export function onRootUsed(listener: (root: Root, subRoot: Root) => void): () => void; - - export function onRootConstructing(listener: (root: Root) => void): () => void; - export function onRootStarted(listener: (root: Root) => void): () => void; - export function onRootFinished(listener: (root: Root) => void): () => void; - export function onRootDestroyed(listener: (root: Root) => void): () => void; - } -} - -export = roots; -export as namespace roots; diff --git a/dist/pesde/roblox/roots/src/init.luau b/dist/pesde/roblox/roots/src/init.luau deleted file mode 100644 index f6aa7495..00000000 --- a/dist/pesde/roblox/roots/src/init.luau +++ /dev/null @@ -1,28 +0,0 @@ -local create = require("@self/create") -local lifecycleUsed = require("@self/hooks/lifecycle-used") -local providerUsed = require("@self/hooks/provider-used") -local rootConstructing = require("@self/hooks/root-constructing") -local rootDestroyed = require("@self/hooks/root-destroyed") -local rootFinished = require("@self/hooks/root-finished") -local rootStarted = require("@self/hooks/root-started") -local rootUsed = require("@self/hooks/root-used") -local types = require("@self/types") - -export type Root = types.Root -export type StartedRoot = types.StartedRoot - -local roots = table.freeze({ - create = create, - hooks = table.freeze({ - onLifecycleUsed = lifecycleUsed.onLifecycleUsed, - onProviderUsed = providerUsed.onProviderUsed, - onRootUsed = rootUsed.onRootUsed, - - onRootConstructing = rootConstructing.onRootConstructing, - onRootStarted = rootStarted.onRootStarted, - onRootFinished = rootFinished.onRootFinished, - onRootDestroyed = rootDestroyed.onRootDestroyed, - }), -}) - -return roots diff --git a/dist/pesde/roblox/roots/src/logger.luau b/dist/pesde/roblox/roots/src/logger.luau deleted file mode 100644 index 92e611ef..00000000 --- a/dist/pesde/roblox/roots/src/logger.luau +++ /dev/null @@ -1,7 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/roots", logger.standardErrorInfoUrl("roots"), { - useAfterDestroy = "Cannot use Root after it is destroyed.", - alreadyDestroyed = "Cannot destroy an already destroyed Root.", - alreadyFinished = "Root has already finished.", -}) diff --git a/dist/pesde/roblox/roots/src/methods/start.luau b/dist/pesde/roblox/roots/src/methods/start.luau deleted file mode 100644 index 3f24dac5..00000000 --- a/dist/pesde/roblox/roots/src/methods/start.luau +++ /dev/null @@ -1,102 +0,0 @@ -local dependencies = require("../../dependencies") -local lifecycles = require("../../lifecycles") -local logger = require("../logger") -local providers = require("../../providers") -local rootFinished = require("../hooks/root-finished").callbacks -local rootStarted = require("../hooks/root-started").callbacks -local types = require("../types") - -local function bindLifecycle(lifecycle: lifecycles.Lifecycle<...any>, provider: providers.Provider) - local lifecycleMethod = (provider :: any)[lifecycle.method] - if typeof(lifecycleMethod) == "function" then - -- local isProfiling = _G.PRVDMWRONG_PROFILE_LIFECYCLES - - -- if isProfiling then - -- lifecycle:register(function(...) - -- debug.profilebegin(memoryCategory) - -- debug.setmemorycategory(memoryCategory) - -- lifecycleMethod(provider, ...) - -- debug.resetmemorycategory() - -- debug.profileend() - -- end) - -- else - lifecycle:register(function(...) - lifecycleMethod(provider, ...) - end) - -- end - end -end - -local function nameOf(provider: providers.Provider, extension: string?): string - return if extension then `{tostring(provider)}.{extension}` else tostring(provider) -end - -local function start(root: types.Self): types.StartedRoot - local processed = dependencies.processDependencies(root._rootProviders) - local sortedProviders = processed.sortedDependencies :: { providers.Provider } - local processedLifecycles = processed.lifecycles - table.move(root._rootLifecycles, 1, #root._rootLifecycles, #processedLifecycles + 1, processedLifecycles) - - dependencies.sortByPriority(sortedProviders) - - local constructedProviders = {} - for _, provider in sortedProviders do - local providerDependencies = (provider :: any).dependencies - if typeof(providerDependencies) == "table" then - providerDependencies = table.clone(providerDependencies) - for key, value in providerDependencies do - providerDependencies[key] = constructedProviders[value] - end - end - - local constructed = provider.new(providerDependencies) - constructedProviders[provider] = constructed - bindLifecycle(root._start, constructed) - bindLifecycle(root._finish, constructed) - - for _, lifecycle in processedLifecycles do - bindLifecycle(lifecycle, constructed) - end - end - - local subRoots: { types.StartedRoot } = {} - for root in root._subRoots do - table.insert(subRoots, root:start()) - end - - root._start:fire() - - local startedRoot = {} :: types.StartedRoot - startedRoot.type = "StartedRoot" - - local didFinish = false - - function startedRoot:finish() - if didFinish then - return logger:fatalError({ template = logger.alreadyFinished }) - end - - didFinish = true - root._finish:fire() - - -- NOTE(znotfireman): Assume the user cleans up their own lifecycles - root._start:clear() - root._finish:clear() - - for _, subRoot in subRoots do - subRoot:finish() - end - - for _, hook in rootFinished do - hook(root) - end - end - - for _, hook in rootStarted do - hook(root) - end - - return startedRoot -end - -return start diff --git a/dist/pesde/roblox/roots/src/methods/use-lifecycle.luau b/dist/pesde/roblox/roots/src/methods/use-lifecycle.luau deleted file mode 100644 index 862c2d07..00000000 --- a/dist/pesde/roblox/roots/src/methods/use-lifecycle.luau +++ /dev/null @@ -1,14 +0,0 @@ -local lifecycleUsed = require("../hooks/lifecycle-used").callbacks -local lifecycles = require("../../lifecycles") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useLifecycle(root: types.Self, lifecycle: lifecycles.Lifecycle) - table.insert(root._rootLifecycles, lifecycle) - threadpool.spawnCallbacks(lifecycleUsed, root, lifecycle) - return root -end - -return useLifecycle diff --git a/dist/pesde/roblox/roots/src/methods/use-module.luau b/dist/pesde/roblox/roots/src/methods/use-module.luau deleted file mode 100644 index a96b3d17..00000000 --- a/dist/pesde/roblox/roots/src/methods/use-module.luau +++ /dev/null @@ -1,23 +0,0 @@ -local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool -local providerClasses = providers._.providerClasses - -local function useModule(root: types.Self, module: ModuleScript) - local moduleExport = (require)(module) - - if providerClasses[moduleExport] then - root._rootProviders[moduleExport] = true - if typeof(moduleExport.name) ~= "string" then - moduleExport.name = module.Name - end - threadpool.spawnCallbacks(providerUsed, root, moduleExport) - end - - return root -end - -return useModule diff --git a/dist/pesde/roblox/roots/src/methods/use-modules.luau b/dist/pesde/roblox/roots/src/methods/use-modules.luau deleted file mode 100644 index 8354a9d0..00000000 --- a/dist/pesde/roblox/roots/src/methods/use-modules.luau +++ /dev/null @@ -1,28 +0,0 @@ -local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool -local providerClasses = providers._.providerClasses - -local function useModules(root: types.Self, modules: { Instance }, predicate: ((module: ModuleScript) -> boolean)?) - for _, module in modules do - if not module:IsA("ModuleScript") or predicate and not predicate(module) then - continue - end - - local moduleExport = (require)(module) - if providerClasses[moduleExport] then - root._rootProviders[moduleExport] = true - if typeof(moduleExport.name) ~= "string" then - moduleExport.name = module.Name - end - threadpool.spawnCallbacks(providerUsed, root, moduleExport) - end - end - - return root -end - -return useModules diff --git a/dist/pesde/roblox/roots/src/methods/use-provider.luau b/dist/pesde/roblox/roots/src/methods/use-provider.luau deleted file mode 100644 index 277d8049..00000000 --- a/dist/pesde/roblox/roots/src/methods/use-provider.luau +++ /dev/null @@ -1,14 +0,0 @@ -local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useProvider(root: types.Self, provider: providers.Provider) - root._rootProviders[provider] = true - threadpool.spawnCallbacks(providerUsed, root, provider) - return root -end - -return useProvider diff --git a/dist/pesde/roblox/roots/src/methods/use-root.luau b/dist/pesde/roblox/roots/src/methods/use-root.luau deleted file mode 100644 index efc4ad1e..00000000 --- a/dist/pesde/roblox/roots/src/methods/use-root.luau +++ /dev/null @@ -1,13 +0,0 @@ -local rootUsed = require("../hooks/root-used").callbacks -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useRoot(root: types.Self, subRoot: types.Root) - root._subRoots[subRoot] = true - threadpool.spawnCallbacks(rootUsed, root, subRoot) - return root -end - -return useRoot diff --git a/dist/pesde/roblox/roots/src/methods/use-roots.luau b/dist/pesde/roblox/roots/src/methods/use-roots.luau deleted file mode 100644 index 7b5b9dda..00000000 --- a/dist/pesde/roblox/roots/src/methods/use-roots.luau +++ /dev/null @@ -1,15 +0,0 @@ -local rootUsed = require("../hooks/root-used").callbacks -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useRoots(root: types.Self, subRoots: { types.Root }) - for _, subRoot in subRoots do - root._subRoots[subRoot] = true - threadpool.spawnCallbacks(rootUsed, root, subRoot) - end - return root -end - -return useRoots diff --git a/dist/pesde/roblox/roots/src/types.luau b/dist/pesde/roblox/roots/src/types.luau deleted file mode 100644 index 104143c4..00000000 --- a/dist/pesde/roblox/roots/src/types.luau +++ /dev/null @@ -1,40 +0,0 @@ -local lifecycles = require("../lifecycles") -local providers = require("../providers") - -type Set = { [T]: true } - -export type Root = { - type: "Root", - - start: (root: Root) -> StartedRoot, - - useModule: (root: Root, module: ModuleScript) -> Root, - useModules: (root: Root, modules: { Instance }, predicate: ((ModuleScript) -> boolean)?) -> Root, - useRoot: (root: Root, root: Root) -> Root, - useRoots: (root: Root, roots: { Root }) -> Root, - useProvider: (root: Root, provider: providers.Provider) -> Root, - useProviders: (root: Root, providers: { providers.Provider }) -> Root, - useLifecycle: (root: Root, lifecycle: lifecycles.Lifecycle) -> Root, - useLifecycles: (root: Root, lifecycles: { lifecycles.Lifecycle }) -> Root, - destroy: (root: Root) -> (), - - willStart: (callback: () -> ()) -> Root, - willFinish: (callback: () -> ()) -> Root, -} - -export type StartedRoot = { - type: "StartedRoot", - - finish: (root: StartedRoot) -> (), -} - -export type Self = Root & { - _destroyed: boolean, - _rootProviders: Set>, - _rootLifecycles: { lifecycles.Lifecycle }, - _subRoots: Set, - _start: lifecycles.Lifecycle<()>, - _finish: lifecycles.Lifecycle<()>, -} - -return nil diff --git a/dist/pesde/roblox/runtime/.pesde/scripts/roblox_sync_config_generator.luau b/dist/pesde/roblox/runtime/.pesde/scripts/roblox_sync_config_generator.luau deleted file mode 100644 index 8aa75020..00000000 --- a/dist/pesde/roblox/runtime/.pesde/scripts/roblox_sync_config_generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/roblox_sync_config_generator") diff --git a/dist/pesde/roblox/runtime/.pesde/scripts/sourcemap-generator.luau b/dist/pesde/roblox/runtime/.pesde/scripts/sourcemap-generator.luau deleted file mode 100644 index ba9144a3..00000000 --- a/dist/pesde/roblox/runtime/.pesde/scripts/sourcemap-generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/sourcemap_generator") diff --git a/dist/pesde/roblox/runtime/LICENSE.md b/dist/pesde/roblox/runtime/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/roblox/runtime/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/roblox/runtime/pesde.toml b/dist/pesde/roblox/runtime/pesde.toml deleted file mode 100644 index b4cfc6ad..00000000 --- a/dist/pesde/roblox/runtime/pesde.toml +++ /dev/null @@ -1,30 +0,0 @@ -authors = ["Fire "] -description = "Runtime agnostic libraries for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", -] -license = "MPL-2.0" -name = "prvdmwrong/runtime" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = ["src"] -environment = "roblox" -lib = "src/init.luau" -[dependencies] - - [scripts] - roblox_sync_config_generator = ".pesde/scripts/roblox_sync_config_generator.luau" - sourcemap_generator = ".pesde/scripts/sourcemap_generator.luau" - - [dev_dependencies] - scripts = { name = "pesde/scripts_rojo", version = "^0.1.0", target = "lune" } - rojo = { name = "pesde/rojo", version = "^7.4.4", target = "lune" } - \ No newline at end of file diff --git a/dist/pesde/roblox/runtime/src/batteries/threadpool.luau b/dist/pesde/roblox/runtime/src/batteries/threadpool.luau deleted file mode 100644 index 6caf08b4..00000000 --- a/dist/pesde/roblox/runtime/src/batteries/threadpool.luau +++ /dev/null @@ -1,38 +0,0 @@ -local task = require("../libs/task") - -local freeThreads: { thread } = {} - -local function run(f: (T...) -> (), thread: thread, ...) - f(...) - table.insert(freeThreads, thread) -end - -local function yielder() - while true do - run(coroutine.yield()) - end -end - -local function spawn(f: (T...) -> (), ...: T...) - local thread - if #freeThreads > 0 then - thread = freeThreads[#freeThreads] - freeThreads[#freeThreads] = nil - else - thread = coroutine.create(yielder) - coroutine.resume(thread) - end - - task.spawn(thread, f, thread, ...) -end - -local function spawnCallbacks(callbacks: { (Args...) -> () }, ...: Args...) - for _, callback in callbacks do - spawn(callback, ...) - end -end - -return table.freeze({ - spawn = spawn, - spawnCallbacks = spawnCallbacks, -}) diff --git a/dist/pesde/roblox/runtime/src/implementations/init.luau b/dist/pesde/roblox/runtime/src/implementations/init.luau deleted file mode 100644 index 28dbe015..00000000 --- a/dist/pesde/roblox/runtime/src/implementations/init.luau +++ /dev/null @@ -1,56 +0,0 @@ -local types = require("@self/../types") - -type Implementation = { new: (() -> T)?, implementation: T? } - -export type RuntimeName = "roblox" | "luau" | "lune" | "lute" | "seal" | "zune" - -local supportedRuntimes = table.freeze({ - roblox = require("@self/roblox"), - luau = require("@self/luau"), - lune = require("@self/lune"), - lute = require("@self/lute"), - seal = require("@self/seal"), - zune = require("@self/zune"), -}) - -local currentRuntime: types.Runtime = nil -do - for _, runtime in supportedRuntimes :: { [string]: types.Runtime } do - local isRuntime = runtime.is() - if isRuntime then - local currentRuntimePriority = currentRuntime and currentRuntime.priority or 0 - local runtimePriority = runtime.priority or 0 - if currentRuntimePriority <= runtimePriority then - currentRuntime = runtime - end - end - end - assert(currentRuntime, "No supported runtime") -end - -local currentRuntimeName: RuntimeName = currentRuntime.name :: any - -local function notImplemented(functionName: string) - return function() - error(`'{functionName}' is not implemented by runtime '{currentRuntimeName}'`, 2) - end -end - -local function implementFunction(label: string, implementations: { [types.Runtime]: Implementation? }): T - local implementation = implementations[currentRuntime] - if implementation then - if implementation.new then - return implementation.new() - elseif implementation.implementation then - return implementation.implementation - end - end - return notImplemented(label) :: any -end - -return table.freeze({ - supportedRuntimes = supportedRuntimes, - currentRuntime = currentRuntime, - currentRuntimeName = currentRuntimeName, - implementFunction = implementFunction, -}) diff --git a/dist/pesde/roblox/runtime/src/implementations/init.spec.luau b/dist/pesde/roblox/runtime/src/implementations/init.spec.luau deleted file mode 100644 index 3ce91cbb..00000000 --- a/dist/pesde/roblox/runtime/src/implementations/init.spec.luau +++ /dev/null @@ -1,81 +0,0 @@ -local implementations = require("@self/../implementations") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("currentRuntime", function() - test("detects lune runtime", function() - expect(implementations.currentRuntimeName).is("lune") - expect(implementations.currentRuntime).is(implementations.supportedRuntimes.lune) - end) - end) - - describe("implementFunction", function() - test("implements for lune runtime", function() - local lune = function() end - local luau = function() end - - local implementation = implementations.implementFunction("implementation", { - [implementations.supportedRuntimes.lune] = { - implementation = lune, - }, - [implementations.supportedRuntimes.luau] = { - implementation = luau, - }, - }) - - expect(implementation).is_a("function") - expect(implementation).never_is(luau) - expect(implementation).is(lune) - end) - - test("constructs for lune runtime", function() - local lune = function() end - local luau = function() end - - local constructedLune = false - - local implementation = implementations.implementFunction("implementation", { - [implementations.supportedRuntimes.lune] = { - new = function() - constructedLune = true - return lune - end, - }, - [implementations.supportedRuntimes.luau] = { - new = function() - return luau - end, - }, - }) - - expect(implementation).is_a("function") - expect(implementation).never_is(luau) - expect(implementation).is(lune) - expect(constructedLune).is_true() - end) - - test("defaults to not implemented function", function() - local constructSuccess, runSuccess = false, false - - local implementation = implementations.implementFunction("implementation", { - [implementations.supportedRuntimes.roblox] = { - new = function() - constructSuccess = true - return function() - runSuccess = true - end - end, - }, - }) - - expect(constructSuccess).is(false) - expect(implementation).is_a("function") - expect(implementation).fails_with("'implementation' is not implemented by runtime 'lune'") - expect(runSuccess).is(false) - end) - end) -end diff --git a/dist/pesde/roblox/runtime/src/implementations/luau.luau b/dist/pesde/roblox/runtime/src/implementations/luau.luau deleted file mode 100644 index c67e52f4..00000000 --- a/dist/pesde/roblox/runtime/src/implementations/luau.luau +++ /dev/null @@ -1,9 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "luau", - priority = -1, - is = function() - return true - end, -}) diff --git a/dist/pesde/roblox/runtime/src/implementations/lune.luau b/dist/pesde/roblox/runtime/src/implementations/lune.luau deleted file mode 100644 index f49834eb..00000000 --- a/dist/pesde/roblox/runtime/src/implementations/lune.luau +++ /dev/null @@ -1,10 +0,0 @@ -local types = require("../types") - -local LUNE_VERSION_FORMAT = "(Lune) (%d+%.%d+%.%d+.*)+(%d+)" - -return types.Runtime({ - name = "lune", - is = function() - return string.match(_VERSION, LUNE_VERSION_FORMAT) ~= nil - end, -}) diff --git a/dist/pesde/roblox/runtime/src/implementations/lute.luau b/dist/pesde/roblox/runtime/src/implementations/lute.luau deleted file mode 100644 index 7b6abc58..00000000 --- a/dist/pesde/roblox/runtime/src/implementations/lute.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "lute", - is = function() - return false - end, -}) diff --git a/dist/pesde/roblox/runtime/src/implementations/roblox.luau b/dist/pesde/roblox/runtime/src/implementations/roblox.luau deleted file mode 100644 index 91a780e2..00000000 --- a/dist/pesde/roblox/runtime/src/implementations/roblox.luau +++ /dev/null @@ -1,9 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "roblox", - is = function() - -- wtf - return not not (_VERSION == "Luau" and game and workspace) - end, -}) diff --git a/dist/pesde/roblox/runtime/src/implementations/seal.luau b/dist/pesde/roblox/runtime/src/implementations/seal.luau deleted file mode 100644 index 0a72684c..00000000 --- a/dist/pesde/roblox/runtime/src/implementations/seal.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "seal", - is = function() - return false - end, -}) diff --git a/dist/pesde/roblox/runtime/src/implementations/zune.luau b/dist/pesde/roblox/runtime/src/implementations/zune.luau deleted file mode 100644 index 48243e05..00000000 --- a/dist/pesde/roblox/runtime/src/implementations/zune.luau +++ /dev/null @@ -1,10 +0,0 @@ -local types = require("../types") - -local ZUNE_VERSION_FORMAT = "(Zune) (%d+%.%d+%.%d+.*)+(%d+%.%d+)" - -return types.Runtime({ - name = "zune", - is = function() - return string.match(_VERSION, ZUNE_VERSION_FORMAT) ~= nil - end, -}) diff --git a/dist/pesde/roblox/runtime/src/index.d.ts b/dist/pesde/roblox/runtime/src/index.d.ts deleted file mode 100644 index b227b952..00000000 --- a/dist/pesde/roblox/runtime/src/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -declare namespace runtime { - export type RuntimeName = "roblox" | "luau" | "lune" | "lute" | "seal" | "zune"; - - export const name: RuntimeName; - - export namespace task { - export function cancel(thread: thread): void; - - export function defer(functionOrThread: (...args: T) => void, ...args: T): thread; - export function defer(functionOrThread: thread): thread; - export function defer( - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function delay( - duration: number, - functionOrThread: (...args: T) => void, - ...args: T - ): thread; - export function delay(duration: number, functionOrThread: thread): thread; - export function delay( - duration: number, - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function spawn(functionOrThread: (...args: T) => void, ...args: T): thread; - export function spawn(functionOrThread: thread): thread; - export function spawn( - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function wait(duration: number): number; - } - - export function warn(...args: T): void; - - export namespace threadpool { - export function spawn(f: (...args: T) => void, ...args: T): void; - export function spawnCallbacks(functions: ((...args: T) => void)[], ...args: T): void; - } -} - -export = runtime; -export as namespace runtime; diff --git a/dist/pesde/roblox/runtime/src/init.luau b/dist/pesde/roblox/runtime/src/init.luau deleted file mode 100644 index 26bdeee0..00000000 --- a/dist/pesde/roblox/runtime/src/init.luau +++ /dev/null @@ -1,15 +0,0 @@ -local implementations = require("@self/implementations") -local task = require("@self/libs/task") -local threadpool = require("@self/batteries/threadpool") -local warn = require("@self/libs/warn") - -export type RuntimeName = implementations.RuntimeName - -return table.freeze({ - name = implementations.currentRuntimeName, - - task = task, - warn = warn, - - threadpool = threadpool, -}) diff --git a/dist/pesde/roblox/runtime/src/libs/task.luau b/dist/pesde/roblox/runtime/src/libs/task.luau deleted file mode 100644 index 28c1ac9e..00000000 --- a/dist/pesde/roblox/runtime/src/libs/task.luau +++ /dev/null @@ -1,157 +0,0 @@ -local implementations = require("../implementations") - -export type TaskLib = { - cancel: (thread) -> (), - defer: (functionOrThread: thread | (T...) -> (), T...) -> thread, - delay: (duration: number, functionOrThread: thread | (T...) -> (), T...) -> thread, - spawn: (functionOrThread: thread | (T...) -> (), T...) -> thread, - wait: (duration: number?) -> number, -} - -local supportedRuntimes = implementations.supportedRuntimes -local implementFunction = implementations.implementFunction - -local function defaultSpawn(functionOrThread: thread | (T...) -> (), ...: T...): thread - if type(functionOrThread) == "thread" then - coroutine.resume(functionOrThread, ...) - return functionOrThread - else - local thread = coroutine.create(functionOrThread) - coroutine.resume(thread, ...) - return thread - end -end - -local function defaultWait(seconds: number?) - local startTime = os.clock() - local endTime = startTime + (seconds or 1) - local clockTime: number - repeat - clockTime = os.clock() - until clockTime >= endTime - return clockTime - startTime -end - -local task: TaskLib = table.freeze({ - cancel = implementFunction("task.wait", { - [supportedRuntimes.roblox] = { - new = function() - return task.cancel - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").cancel - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").cancel - end, - }, - [supportedRuntimes.luau] = { - implementation = function(thread) - if not coroutine.close(thread) then - error(debug.traceback(thread, "Could not cancel thread")) - end - end, - }, - }), - defer = implementFunction("task.defer", { - [supportedRuntimes.roblox] = { - new = function() - return task.defer :: any - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").defer - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").defer - end, - }, - [supportedRuntimes.luau] = { - implementation = defaultSpawn, - }, - }), - delay = implementFunction("task.delay", { - [supportedRuntimes.roblox] = { - new = function() - return task.delay :: any - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").delay - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").delay - end, - }, - [supportedRuntimes.luau] = { - implementation = function(duration: number, functionOrThread: thread | (T...) -> (), ...: T...): thread - return defaultSpawn( - if typeof(functionOrThread) == "function" - then function(duration, functionOrThread, ...) - defaultWait(duration) - functionOrThread(...) - end - else function(duration, functionOrThread, ...) - defaultWait(duration) - coroutine.resume(...) - end, - duration, - functionOrThread, - ... - ) - end, - }, - }), - spawn = implementFunction("task.spawn", { - [supportedRuntimes.roblox] = { - new = function() - return task.spawn :: any - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").spawn - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").spawn - end, - }, - [supportedRuntimes.luau] = { - implementation = defaultSpawn, - }, - }), - wait = implementFunction("task.wait", { - [supportedRuntimes.roblox] = { - new = function() - return task.wait - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").wait - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").wait - end, - }, - [supportedRuntimes.luau] = { - implementation = defaultWait, - }, - }), -}) - -return task diff --git a/dist/pesde/roblox/runtime/src/libs/task.spec.luau b/dist/pesde/roblox/runtime/src/libs/task.spec.luau deleted file mode 100644 index 0918e87f..00000000 --- a/dist/pesde/roblox/runtime/src/libs/task.spec.luau +++ /dev/null @@ -1,62 +0,0 @@ -local luneTask = require("@lune/task") -local task = require("./task") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - --- FIXME: can't async stuff lol -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("task", function() - test("spawn", function() - expect(task.spawn).is(luneTask.spawn) - local spawned = false - - task.spawn(function() - spawned = true - end) - - expect(spawned).is_true() - end) - - test("defer", function() - expect(task.defer).is(luneTask.defer) - - -- local spawned = false - - -- task.defer(function() - -- spawned = true - -- end) - - -- expect(spawned).never_is_true() - end) - - test("delay", function() - expect(task.delay).is(luneTask.delay) - -- local spawned = false - - -- task.delay(0.25, function() - -- spawned = true - -- end) - - -- expect(spawned).never_is_true() - - -- local startTime = os.clock() - -- repeat - -- until os.clock() - startTime > 0.5 - - -- print(spawned) - - -- expect(spawned).is_true() - end) - - test("wait", function() - expect(task.wait).is(luneTask.wait) - end) - - test("cancel", function() - expect(task.cancel).is(luneTask.cancel) - end) - end) -end diff --git a/dist/pesde/roblox/runtime/src/libs/warn.luau b/dist/pesde/roblox/runtime/src/libs/warn.luau deleted file mode 100644 index 6a4837ac..00000000 --- a/dist/pesde/roblox/runtime/src/libs/warn.luau +++ /dev/null @@ -1,27 +0,0 @@ -local implementations = require("../implementations") - -local supportedRuntimes = implementations.supportedRuntimes -local implementFunction = implementations.implementFunction - -local function tostringTuple(...: any) - local stringified = {} - for index = 1, select("#", ...) do - table.insert(stringified, tostring(select(index, ...))) - end - return table.concat(stringified, " ") -end - -local warn: (T...) -> () = implementFunction("warn", { - [supportedRuntimes.roblox] = { - new = function() - return warn - end, - }, - [supportedRuntimes.luau] = { - implementation = function(...: T...) - print(`\27[0;33m{tostringTuple(...)}\27[0m`) - end, - }, -}) - -return warn diff --git a/dist/pesde/roblox/runtime/src/types.luau b/dist/pesde/roblox/runtime/src/types.luau deleted file mode 100644 index ca050fce..00000000 --- a/dist/pesde/roblox/runtime/src/types.luau +++ /dev/null @@ -1,13 +0,0 @@ -export type Runtime = { - name: string, - priority: number?, - is: () -> boolean, -} - -local function Runtime(x: Runtime) - return table.freeze(x) -end - -return table.freeze({ - Runtime = Runtime, -}) diff --git a/dist/pesde/roblox/typecheckers/.pesde/scripts/roblox_sync_config_generator.luau b/dist/pesde/roblox/typecheckers/.pesde/scripts/roblox_sync_config_generator.luau deleted file mode 100644 index 8aa75020..00000000 --- a/dist/pesde/roblox/typecheckers/.pesde/scripts/roblox_sync_config_generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/roblox_sync_config_generator") diff --git a/dist/pesde/roblox/typecheckers/.pesde/scripts/sourcemap-generator.luau b/dist/pesde/roblox/typecheckers/.pesde/scripts/sourcemap-generator.luau deleted file mode 100644 index ba9144a3..00000000 --- a/dist/pesde/roblox/typecheckers/.pesde/scripts/sourcemap-generator.luau +++ /dev/null @@ -1 +0,0 @@ -return (require)("./../../lune_packages/.pesde/pesde+scripts_rojo/0.1.0/scripts_rojo/sourcemap_generator") diff --git a/dist/pesde/roblox/typecheckers/LICENSE.md b/dist/pesde/roblox/typecheckers/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/pesde/roblox/typecheckers/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/pesde/roblox/typecheckers/pesde.toml b/dist/pesde/roblox/typecheckers/pesde.toml deleted file mode 100644 index 83bc60a1..00000000 --- a/dist/pesde/roblox/typecheckers/pesde.toml +++ /dev/null @@ -1,30 +0,0 @@ -authors = ["Fire "] -description = "Typechecking primitives and compatibility for Prvd 'M Wrong" -includes = [ - "src/**/*.luau", - "LICENSE.md", - "README.md", - "pesde.toml", -] -license = "MPL-2.0" -name = "prvdmwrong/typecheckers" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[indices] -default = "https://github.com/pesde-pkg/index" - -[target] -build_files = ["src"] -environment = "roblox" -lib = "src/init.luau" -[dependencies] - - [scripts] - roblox_sync_config_generator = ".pesde/scripts/roblox_sync_config_generator.luau" - sourcemap_generator = ".pesde/scripts/sourcemap_generator.luau" - - [dev_dependencies] - scripts = { name = "pesde/scripts_rojo", version = "^0.1.0", target = "lune" } - rojo = { name = "pesde/rojo", version = "^7.4.4", target = "lune" } - \ No newline at end of file diff --git a/dist/pesde/roblox/typecheckers/src/init.luau b/dist/pesde/roblox/typecheckers/src/init.luau deleted file mode 100644 index e69de29b..00000000 diff --git a/dist/wally/dependencies/LICENSE.md b/dist/wally/dependencies/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/wally/dependencies/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/wally/dependencies/Wally.toml b/dist/wally/dependencies/Wally.toml deleted file mode 100644 index 88dc8fb1..00000000 --- a/dist/wally/dependencies/Wally.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -authors = ["Fire "] -description = "Dependency resolution logic for Prvd 'M Wrong" -homepage = "https://prvdmwrong.luau.page/latest/" -license = "MPL-2.0" -name = "prvdmwrong/dependencies" -private = false -realm = "shared" -registry = "https://github.com/upliftgames/wally-index" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[package.dependencies] -lifecycles = "prvdmwrong/lifecycles@0.2.0-rc.4" -logger = "prvdmwrong/logger@0.2.0-rc.4" diff --git a/dist/wally/dependencies/lifecycles.luau b/dist/wally/dependencies/lifecycles.luau deleted file mode 100644 index 53ce025e..00000000 --- a/dist/wally/dependencies/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/wally/dependencies/logger.luau b/dist/wally/dependencies/logger.luau deleted file mode 100644 index 830f960c..00000000 --- a/dist/wally/dependencies/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./Packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/wally/dependencies/src/depend.luau b/dist/wally/dependencies/src/depend.luau deleted file mode 100644 index 55230b4e..00000000 --- a/dist/wally/dependencies/src/depend.luau +++ /dev/null @@ -1,30 +0,0 @@ -local logger = require("./logger") -local types = require("./types") - -local function useBeforeConstructed(unresolved: types.UnresolvedDependency) - logger:fatalError({ template = logger.useBeforeConstructed, unresolved.dependency.name or "subdependency" }) -end - -local unresolvedMt = { - __metatable = "This metatable is locked.", - __index = useBeforeConstructed, - __newindex = useBeforeConstructed, -} - -function unresolvedMt:__tostring() - return "UnresolvedDependency" -end - --- Wtf luau -local function depend(dependency: types.Dependency): typeof(({} :: types.Dependency).new( - (nil :: any) :: Dependencies, - ... -)) - -- Return a mock value that will be resolved during dependency resolution. - return setmetatable({ - type = "UnresolvedDependency", - dependency = dependency, - }, unresolvedMt) :: any -end - -return depend diff --git a/dist/wally/dependencies/src/index.d.ts b/dist/wally/dependencies/src/index.d.ts deleted file mode 100644 index a5bddcde..00000000 --- a/dist/wally/dependencies/src/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Lifecycle } from "../lifecycles"; - -declare namespace dependencies { - export type Dependency = Self & { - dependencies: Dependencies, - priority?: number, - new(dependencies: Dependencies, ...args: NewArgs): Dependency; - }; - - interface ProccessDependencyResult { - sortedDependencies: Dependency[]; - lifecycles: Lifecycle[]; - } - - export type SubdependenciesOf = T extends { dependencies: infer Dependencies } - ? Dependencies - : never; - - export function depend InstanceType>(dependency: T): InstanceType; - export function processDependencies(dependencies: Set>): ProccessDependencyResult; - export function sortByPriority(dependencies: Dependency[]): void; -} - -export = dependencies; -export as namespace dependencies; diff --git a/dist/wally/dependencies/src/init.luau b/dist/wally/dependencies/src/init.luau deleted file mode 100644 index e6b27b24..00000000 --- a/dist/wally/dependencies/src/init.luau +++ /dev/null @@ -1,12 +0,0 @@ -local depend = require("@self/depend") -local processDependencies = require("@self/process-dependencies") -local sortByPriority = require("@self/sort-by-priority") -local types = require("@self/types") - -export type Dependency = types.Dependency - -return table.freeze({ - depend = depend, - processDependencies = processDependencies, - sortByPriority = sortByPriority, -}) diff --git a/dist/wally/dependencies/src/logger.luau b/dist/wally/dependencies/src/logger.luau deleted file mode 100644 index 22f3b307..00000000 --- a/dist/wally/dependencies/src/logger.luau +++ /dev/null @@ -1,7 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/dependencies", logger.standardErrorInfoUrl("dependencies"), { - useBeforeConstructed = "Cannot use %s before it is constructed. Are you using the dependency outside a class method?", - alreadyDestroyed = "Cannot destroy an already destroyed Root.", - alreadyFinished = "Root has already finished.", -}) diff --git a/dist/wally/dependencies/src/process-dependencies.luau b/dist/wally/dependencies/src/process-dependencies.luau deleted file mode 100644 index 20820a35..00000000 --- a/dist/wally/dependencies/src/process-dependencies.luau +++ /dev/null @@ -1,57 +0,0 @@ -local lifecycles = require("../lifecycles") -local types = require("./types") - -export type ProccessDependencyResult = { - sortedDependencies: { types.Dependency }, - lifecycles: { lifecycles.Lifecycle }, -} - -type Set = { [T]: true } - -local function processDependencies(dependencies: Set>): ProccessDependencyResult - local sortedDependencies = {} - local lifecycles = {} - - -- TODO: optimize ts - local function visitDependency(dependency: types.Dependency) - -- print("Visiting dependency", dependency) - - for key, value in dependency :: any do - if key == "dependencies" then - -- print("Checking [prvd.dependencies]") - if typeof(value) == "table" then - for key, value in value do - -- print("Checking key", key, "value", value) - if typeof(value) == "table" and value.type == "UnresolvedDependency" then - local unresolved: types.UnresolvedDependency = value - -- print("Got unresolved dependency", unresolved.dependency, "visiting") - visitDependency(unresolved.dependency) - end - end - end - - continue - end - - if typeof(value) == "table" and value.type == "Lifecycle" and not table.find(lifecycles, value) then - table.insert(lifecycles, value) - end - end - - if dependencies[dependency] and not table.find(sortedDependencies, dependency) then - -- print("Pushing to sort") - table.insert(sortedDependencies, dependency) - end - end - - for dependency in dependencies do - visitDependency(dependency) - end - - return { - sortedDependencies = sortedDependencies, - lifecycles = lifecycles, - } -end - -return processDependencies diff --git a/dist/wally/dependencies/src/process-dependencies.spec.luau b/dist/wally/dependencies/src/process-dependencies.spec.luau deleted file mode 100644 index 0fcfcac8..00000000 --- a/dist/wally/dependencies/src/process-dependencies.spec.luau +++ /dev/null @@ -1,67 +0,0 @@ -local depend = require("./depend") -local processDependencies = require("./process-dependencies") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - -local function nickname(name: string) - return function(tbl: T): T - return setmetatable(tbl :: any, { - __tostring = function() - return name - end, - }) - end -end - -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("processDependencies", function() - test("sortedDependencies", function() - local first = nickname("first")({}) - - local second = nickname("second")({ - dependencies = { - toFirst = depend(first :: any), - toFirstAgain = depend(first :: any), - }, - }) - - local third = nickname("third")({ - dependencies = { - toSecond = depend(second :: any), - }, - }) - - local fourth = nickname("fourth")({ - dependencies = { - toFirst = depend(first :: any), - toSecond = depend(second :: any), - toThird = depend(third :: any), - }, - }) - - local processed = processDependencies({ - [first] = true, - [second] = true, - [third] = true, - [fourth] = true, - } :: any) - - expect(typeof(processed)).is("table") - expect(processed).has_key("sortedDependencies") - expect(typeof(processed.sortedDependencies)).is("table") - - local sortedDependencies = processed.sortedDependencies - - expect(typeof(sortedDependencies)).is("table") - expect(sortedDependencies[1]).is(first) - expect(sortedDependencies[2]).is(second) - expect(sortedDependencies[3]).is(third) - expect(sortedDependencies[4]).is(fourth) - end) - - test("lifecycles", function() end) - end) -end diff --git a/dist/wally/dependencies/src/sort-by-priority.luau b/dist/wally/dependencies/src/sort-by-priority.luau deleted file mode 100644 index 638468ab..00000000 --- a/dist/wally/dependencies/src/sort-by-priority.luau +++ /dev/null @@ -1,14 +0,0 @@ -local types = require("./types") - -local function sortByPriority(dependencies: { types.Dependency }) - table.sort(dependencies, function(left: any, right: any) - if left.priority ~= right.priority then - return (left.priority or 1) > (right.priority or 1) - end - local leftIndex = table.find(dependencies, left) - local rightIndex = table.find(dependencies, right) - return leftIndex < rightIndex - end) -end - -return sortByPriority diff --git a/dist/wally/dependencies/src/sort-by-priority.spec.luau b/dist/wally/dependencies/src/sort-by-priority.spec.luau deleted file mode 100644 index eeb34933..00000000 --- a/dist/wally/dependencies/src/sort-by-priority.spec.luau +++ /dev/null @@ -1,52 +0,0 @@ -local sortByPriority = require("./sort-by-priority") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("sortByPriority", function() - test("dependencies", function() - local first = {} - - local second = { - toFirst = first, - } - - local third = { - toSecond = second, - } - - local sortedDependencies = { - first, - second, - third, - } - - sortByPriority(sortedDependencies :: any) - - expect(sortedDependencies[1]).is(first) - expect(sortedDependencies[2]).is(second) - expect(sortedDependencies[3]).is(third) - end) - - test("priority", function() - local low = {} - - local high = { - priority = 500, - } - - local sortedDependencies = { - low, - high, - } - - sortByPriority(sortedDependencies :: any) - - expect(sortedDependencies[1]).is(high) - expect(sortedDependencies[2]).is(low) - end) - end) -end diff --git a/dist/wally/dependencies/src/types.luau b/dist/wally/dependencies/src/types.luau deleted file mode 100644 index 2b1c72aa..00000000 --- a/dist/wally/dependencies/src/types.luau +++ /dev/null @@ -1,14 +0,0 @@ -export type Dependency = Self & { - dependencies: Dependencies, - priority: number?, - new: (dependencies: Dependencies, NewArgs...) -> Dependency, -} - -export type UnresolvedDependency = { - type: "UnresolvedDependency", - dependency: Dependency, -} - -export type dependencies = { __prvdmwrong_dependencies: never } - -return nil diff --git a/dist/wally/lifecycles/LICENSE.md b/dist/wally/lifecycles/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/wally/lifecycles/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/wally/lifecycles/Wally.toml b/dist/wally/lifecycles/Wally.toml deleted file mode 100644 index 9a305d68..00000000 --- a/dist/wally/lifecycles/Wally.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -authors = ["Fire "] -description = "Provider method lifecycles implementation for Prvd 'M Wrong" -homepage = "https://prvdmwrong.luau.page/latest/" -license = "MPL-2.0" -name = "prvdmwrong/lifecycles" -private = false -realm = "shared" -registry = "https://github.com/upliftgames/wally-index" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[package.dependencies] -logger = "prvdmwrong/logger@0.2.0-rc.4" -runtime = "prvdmwrong/runtime@0.2.0-rc.4" diff --git a/dist/wally/lifecycles/logger.luau b/dist/wally/lifecycles/logger.luau deleted file mode 100644 index 830f960c..00000000 --- a/dist/wally/lifecycles/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./Packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/wally/lifecycles/runtime.luau b/dist/wally/lifecycles/runtime.luau deleted file mode 100644 index c841cb44..00000000 --- a/dist/wally/lifecycles/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/wally/lifecycles/src/create.luau b/dist/wally/lifecycles/src/create.luau deleted file mode 100644 index 6cdd2891..00000000 --- a/dist/wally/lifecycles/src/create.luau +++ /dev/null @@ -1,45 +0,0 @@ -local await = require("./methods/await") -local clear = require("./methods/unregister-all") -local destroy = require("./methods/destroy") -local lifecycleConstructed = require("./hooks/lifecycle-constructed") -local methodToLifecycles = require("./method-to-lifecycles") -local onRegistered = require("./methods/on-registered") -local onUnregistered = require("./methods/on-unregistered") -local register = require("./methods/register") -local types = require("./types") -local unregister = require("./methods/unregister") - -local function create( - method: string, - onFire: (lifecycle: types.Lifecycle, Args...) -> () -): types.Lifecycle - local self: types.Self = { - _isDestroyed = false, - _selfRegistered = {}, - _selfUnregistered = {}, - - type = "Lifecycle", - callbacks = {}, - - fire = onFire, - method = method, - register = register, - unregister = unregister, - clear = clear, - onRegistered = onRegistered, - onUnregistered = onUnregistered, - await = await, - destroy = destroy, - } :: any - - methodToLifecycles[method] = methodToLifecycles[method] or {} - table.insert(methodToLifecycles[method], self) - - for _, onLifecycleConstructed in lifecycleConstructed.callbacks do - onLifecycleConstructed(self :: types.Lifecycle) - end - - return self -end - -return create diff --git a/dist/wally/lifecycles/src/handlers/fire-concurrent.luau b/dist/wally/lifecycles/src/handlers/fire-concurrent.luau deleted file mode 100644 index f279b888..00000000 --- a/dist/wally/lifecycles/src/handlers/fire-concurrent.luau +++ /dev/null @@ -1,10 +0,0 @@ -local runtime = require("../../runtime") -local types = require("../types") - -local function fireConcurrent(lifecycle: types.Lifecycle, ...: Args...) - for _, callback in lifecycle.callbacks do - runtime.threadpool.spawn(callback, ...) - end -end - -return fireConcurrent diff --git a/dist/wally/lifecycles/src/handlers/fire-sequential.luau b/dist/wally/lifecycles/src/handlers/fire-sequential.luau deleted file mode 100644 index 80911ad9..00000000 --- a/dist/wally/lifecycles/src/handlers/fire-sequential.luau +++ /dev/null @@ -1,9 +0,0 @@ -local types = require("../types") - -local function fireSequential(lifecycle: types.Lifecycle, ...: Args...) - for _, callback in lifecycle.callbacks do - callback(...) - end -end - -return fireSequential diff --git a/dist/wally/lifecycles/src/hooks/lifecycle-constructed.luau b/dist/wally/lifecycles/src/hooks/lifecycle-constructed.luau deleted file mode 100644 index 8ea4d81b..00000000 --- a/dist/wally/lifecycles/src/hooks/lifecycle-constructed.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (lifecycle: types.Lifecycle) -> () } = {} - -local function onLifecycleConstructed(listener: (lifecycle: types.Lifecycle) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleConstructed = onLifecycleConstructed, -}) diff --git a/dist/wally/lifecycles/src/hooks/lifecycle-destroyed.luau b/dist/wally/lifecycles/src/hooks/lifecycle-destroyed.luau deleted file mode 100644 index 47abcfab..00000000 --- a/dist/wally/lifecycles/src/hooks/lifecycle-destroyed.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (lifecycle: types.Lifecycle) -> () } = {} - -local function onLifecycleDestroyed(listener: (lifecycle: types.Lifecycle) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleDestroyed = onLifecycleDestroyed, -}) diff --git a/dist/wally/lifecycles/src/hooks/lifecycle-registered.luau b/dist/wally/lifecycles/src/hooks/lifecycle-registered.luau deleted file mode 100644 index fab588a3..00000000 --- a/dist/wally/lifecycles/src/hooks/lifecycle-registered.luau +++ /dev/null @@ -1,20 +0,0 @@ -local types = require("../types") - -local callbacks: { (lifecycle: types.Lifecycle, callback: (...unknown) -> ()) -> () } = {} - -local function onLifecycleRegistered( - listener: ( - lifecycle: types.Lifecycle, - callback: (Args...) -> () - ) -> () -): () -> () - table.insert(callbacks, listener :: any) - return function() - table.remove(callbacks, table.find(callbacks, listener :: any)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleRegistered = onLifecycleRegistered, -}) diff --git a/dist/wally/lifecycles/src/hooks/lifecycle-unregistered.luau b/dist/wally/lifecycles/src/hooks/lifecycle-unregistered.luau deleted file mode 100644 index 0ec81756..00000000 --- a/dist/wally/lifecycles/src/hooks/lifecycle-unregistered.luau +++ /dev/null @@ -1,20 +0,0 @@ -local types = require("../types") - -local callbacks: { (lifecycle: types.Lifecycle, callback: (...unknown) -> ()) -> () } = {} - -local function onLifecycleUnregistered( - listener: ( - lifecycle: types.Lifecycle, - callback: (Args...) -> () - ) -> () -): () -> () - table.insert(callbacks, listener :: any) - return function() - table.remove(callbacks, table.find(callbacks, listener :: any)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleUnregistered = onLifecycleUnregistered, -}) diff --git a/dist/wally/lifecycles/src/index.d.ts b/dist/wally/lifecycles/src/index.d.ts deleted file mode 100644 index 0e5f324b..00000000 --- a/dist/wally/lifecycles/src/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -declare namespace lifecycles { - export interface Lifecycle { - type: "Lifecycle"; - - callbacks: Array<(...args: Args) => void>; - method: string; - - register(callback: (...args: Args) => void): void; - fire(...args: Args): void; - unregister(callback: (...args: Args) => void): void; - clear(): void; - onRegistered(listener: (callback: (...args: Args) => void) => void): () => void; - onUnegistered(listener: (callback: (...args: Args) => void) => void): () => void; - await(): LuaTuple; - destroy(): void; - } - - export function create( - method: string, - onFire: (lifecycle: Lifecycle, ...args: Args) => void - ): Lifecycle; - - export namespace handlers { - export function fireConcurrent(lifecycle: Lifecycle, ...args: Args): void; - export function fireSequential(lifecycle: Lifecycle, ...args: Args): void; - } - - export namespace hooks { - export function onLifecycleConstructed(callback: (lifecycle: Lifecycle) => void): () => void; - export function onLifecycleDestroyed(callback: (lifecycle: Lifecycle) => void): () => void; - export function onLifecycleRegistered( - callback: (lifecycle: Lifecycle, callback: (...args: Args) => void) => void - ): () => void; - export function onLifecycleUnregistered( - callback: (lifecycle: Lifecycle, callback: (...args: Args) => void) => void - ): () => void; - } - - export namespace _ { - export const methodToLifecycles: Map; - } -} - -export = lifecycles; -export as namespace lifecycles; diff --git a/dist/wally/lifecycles/src/init.luau b/dist/wally/lifecycles/src/init.luau deleted file mode 100644 index dbec091b..00000000 --- a/dist/wally/lifecycles/src/init.luau +++ /dev/null @@ -1,28 +0,0 @@ -local create = require("@self/create") -local fireConcurrent = require("@self/handlers/fire-concurrent") -local fireSequential = require("@self/handlers/fire-sequential") -local lifecycleConstructed = require("@self/hooks/lifecycle-constructed") -local lifecycleDestroyed = require("@self/hooks/lifecycle-destroyed") -local lifecycleRegistered = require("@self/hooks/lifecycle-registered") -local lifecycleUnregistered = require("@self/hooks/lifecycle-unregistered") -local methodToLifecycles = require("@self/method-to-lifecycles") -local types = require("@self/types") - -export type Lifecycle = types.Lifecycle - -return table.freeze({ - create = create, - handlers = table.freeze({ - fireConcurrent = fireConcurrent, - fireSequential = fireSequential, - }), - hooks = table.freeze({ - onLifecycleRegistered = lifecycleRegistered.onLifecycleRegistered, - onLifecycleUnregistered = lifecycleUnregistered.onLifecycleUnregistered, - onLifecycleConstructed = lifecycleConstructed.onLifecycleConstructed, - onLifecycleDestroyed = lifecycleDestroyed.onLifecycleDestroyed, - }), - _ = table.freeze({ - methodToLifecycles = methodToLifecycles, - }), -}) diff --git a/dist/wally/lifecycles/src/logger.luau b/dist/wally/lifecycles/src/logger.luau deleted file mode 100644 index 3ae7c27e..00000000 --- a/dist/wally/lifecycles/src/logger.luau +++ /dev/null @@ -1,6 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/lifecycles", logger.standardErrorInfoUrl("lifecycles"), { - useAfterDestroy = "Cannot use Lifecycle after it is destroyed.", - alreadyDestroyed = "Cannot destroy an already destroyed Lifecycle.", -}) diff --git a/dist/wally/lifecycles/src/method-to-lifecycles.luau b/dist/wally/lifecycles/src/method-to-lifecycles.luau deleted file mode 100644 index 386a8756..00000000 --- a/dist/wally/lifecycles/src/method-to-lifecycles.luau +++ /dev/null @@ -1,5 +0,0 @@ -local types = require("./types") - -local methodToLifecycles: { [string]: { types.Lifecycle } } = {} - -return methodToLifecycles diff --git a/dist/wally/lifecycles/src/methods/await.luau b/dist/wally/lifecycles/src/methods/await.luau deleted file mode 100644 index ed8299d6..00000000 --- a/dist/wally/lifecycles/src/methods/await.luau +++ /dev/null @@ -1,17 +0,0 @@ -local logger = require("../logger") -local types = require("../types") - -local function await(lifecycle: types.Self): Args... - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - local currentThread = coroutine.running() - local function callback(...: Args...) - lifecycle:unregister(callback) - coroutine.resume(currentThread, ...) - end - lifecycle:register(callback) - return coroutine.yield() -end - -return await diff --git a/dist/wally/lifecycles/src/methods/destroy.luau b/dist/wally/lifecycles/src/methods/destroy.luau deleted file mode 100644 index d9d5d6cc..00000000 --- a/dist/wally/lifecycles/src/methods/destroy.luau +++ /dev/null @@ -1,18 +0,0 @@ -local lifecycleDestroyed = require("../hooks/lifecycle-destroyed") -local logger = require("../logger") -local methodToLifecycles = require("../method-to-lifecycles") -local types = require("../types") - -local function destroy(lifecycle: types.Self) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.alreadyDestroyed }) - end - table.remove(methodToLifecycles[lifecycle.method], table.find(methodToLifecycles[lifecycle.method], lifecycle)) - table.clear(lifecycle.callbacks) - for _, callback in lifecycleDestroyed.callbacks do - callback(lifecycle) - end - lifecycle._isDestroyed = true -end - -return destroy diff --git a/dist/wally/lifecycles/src/methods/on-registered.luau b/dist/wally/lifecycles/src/methods/on-registered.luau deleted file mode 100644 index 7ddb009a..00000000 --- a/dist/wally/lifecycles/src/methods/on-registered.luau +++ /dev/null @@ -1,17 +0,0 @@ -local logger = require("../logger") -local types = require("../types") - -local function onRegistered(lifecycle: types.Self, listener: (callback: (Args...) -> ()) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - if _G.PRVDMWRONG_DISALLOW_MULTIPLE_LISTENERS then - table.remove(lifecycle._selfRegistered, table.find(lifecycle._selfRegistered, listener)) - end - table.insert(lifecycle._selfRegistered, listener) - return function() - table.remove(lifecycle._selfRegistered, table.find(lifecycle._selfRegistered, listener)) - end -end - -return onRegistered diff --git a/dist/wally/lifecycles/src/methods/on-unregistered.luau b/dist/wally/lifecycles/src/methods/on-unregistered.luau deleted file mode 100644 index 842040ec..00000000 --- a/dist/wally/lifecycles/src/methods/on-unregistered.luau +++ /dev/null @@ -1,17 +0,0 @@ -local logger = require("../logger") -local types = require("../types") - -local function onUnregistered(lifecycle: types.Self, listener: (callback: (Args...) -> ()) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - if _G.PRVDMWRONG_DISALLOW_MULTIPLE_LISTENERS then - table.remove(lifecycle._selfUnregistered, table.find(lifecycle._selfUnregistered, listener)) - end - table.insert(lifecycle._selfUnregistered, listener) - return function() - table.remove(lifecycle._selfUnregistered, table.find(lifecycle._selfUnregistered, listener)) - end -end - -return onUnregistered diff --git a/dist/wally/lifecycles/src/methods/register.luau b/dist/wally/lifecycles/src/methods/register.luau deleted file mode 100644 index 3fd74d56..00000000 --- a/dist/wally/lifecycles/src/methods/register.luau +++ /dev/null @@ -1,18 +0,0 @@ -local logger = require("../logger") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function register(lifecycle: types.Self, callback: (Args...) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - if _G.PRVDMWRONG_DISALLOW_MULTIPLE_LISTENERS then - table.remove(lifecycle.callbacks, table.find(lifecycle.callbacks, callback)) - end - table.insert(lifecycle.callbacks, callback) - threadpool.spawnCallbacks(lifecycle._selfRegistered, callback) -end - -return register diff --git a/dist/wally/lifecycles/src/methods/unregister-all.luau b/dist/wally/lifecycles/src/methods/unregister-all.luau deleted file mode 100644 index 5e6235af..00000000 --- a/dist/wally/lifecycles/src/methods/unregister-all.luau +++ /dev/null @@ -1,17 +0,0 @@ -local logger = require("../logger") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function clear(lifecycle: types.Self) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - for _, callback in lifecycle.callbacks do - threadpool.spawnCallbacks(lifecycle._selfUnregistered, callback) - end - table.clear(lifecycle.callbacks) -end - -return clear diff --git a/dist/wally/lifecycles/src/methods/unregister.luau b/dist/wally/lifecycles/src/methods/unregister.luau deleted file mode 100644 index 0ca7223f..00000000 --- a/dist/wally/lifecycles/src/methods/unregister.luau +++ /dev/null @@ -1,18 +0,0 @@ -local logger = require("../logger") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function unregister(lifecycle: types.Self, callback: (Args...) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - local index = table.find(lifecycle.callbacks, callback) - if index then - table.remove(lifecycle.callbacks, index) - threadpool.spawnCallbacks(lifecycle._selfUnregistered, callback) - end -end - -return unregister diff --git a/dist/wally/lifecycles/src/types.luau b/dist/wally/lifecycles/src/types.luau deleted file mode 100644 index f2931b52..00000000 --- a/dist/wally/lifecycles/src/types.luau +++ /dev/null @@ -1,23 +0,0 @@ -export type Lifecycle = { - type: "Lifecycle", - - callbacks: { (Args...) -> () }, - method: string, - - register: (self: Lifecycle, callback: (Args...) -> ()) -> (), - fire: (self: Lifecycle, Args...) -> (), - unregister: (self: Lifecycle, callback: (Args...) -> ()) -> (), - clear: (self: Lifecycle) -> (), - onRegistered: (self: Lifecycle, listener: (callback: (Args...) -> ()) -> ()) -> () -> (), - onUnregistered: (self: Lifecycle, listener: (callback: (Args...) -> ()) -> ()) -> () -> (), - await: (self: Lifecycle) -> Args..., - destroy: (self: Lifecycle) -> (), -} - -export type Self = Lifecycle & { - _isDestroyed: boolean, - _selfRegistered: { (callback: (Args...) -> ()) -> () }, - _selfUnregistered: { (callback: (Args...) -> ()) -> () }, -} - -return nil diff --git a/dist/wally/logger/LICENSE.md b/dist/wally/logger/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/wally/logger/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/wally/logger/Wally.toml b/dist/wally/logger/Wally.toml deleted file mode 100644 index 15b4cdc3..00000000 --- a/dist/wally/logger/Wally.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -authors = ["Fire "] -description = "Logging for Prvd 'M Wrong" -homepage = "https://prvdmwrong.luau.page/latest/" -license = "MPL-2.0" -name = "prvdmwrong/logger" -private = false -realm = "shared" -registry = "https://github.com/upliftgames/wally-index" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[package.dependencies] -runtime = "prvdmwrong/runtime@0.2.0-rc.4" diff --git a/dist/wally/logger/runtime.luau b/dist/wally/logger/runtime.luau deleted file mode 100644 index c841cb44..00000000 --- a/dist/wally/logger/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/wally/logger/src/allow-web-links.luau b/dist/wally/logger/src/allow-web-links.luau deleted file mode 100644 index dcd0bb82..00000000 --- a/dist/wally/logger/src/allow-web-links.luau +++ /dev/null @@ -1,5 +0,0 @@ -local runtime = require("../runtime") - -local allowWebLinks = if runtime.name == "roblox" then game:GetService("RunService"):IsStudio() else true - -return allowWebLinks diff --git a/dist/wally/logger/src/create.luau b/dist/wally/logger/src/create.luau deleted file mode 100644 index 943aab25..00000000 --- a/dist/wally/logger/src/create.luau +++ /dev/null @@ -1,32 +0,0 @@ -local allowWebLinks = require("./allow-web-links") -local formatLog = require("./format-log") -local runtime = require("../runtime") -local types = require("./types") - -local task = runtime.task -local warn = runtime.warn - -local function create(label: string, errorInfoUrl: string?, templates: T): types.Logger - local self = {} :: types.Logger - self.type = "Logger" - - label = `[{label}] ` - errorInfoUrl = if allowWebLinks then errorInfoUrl else nil - - function self:warn(log) - warn(label .. formatLog(self, log, errorInfoUrl)) - end - - function self:error(log) - task.spawn(error, label .. formatLog(self, log, errorInfoUrl), 0) - end - - function self:fatalError(log) - error(label .. formatLog(self, log, errorInfoUrl)) - end - - setmetatable(self :: any, { __index = templates }) - return self -end - -return create diff --git a/dist/wally/logger/src/format-log.luau b/dist/wally/logger/src/format-log.luau deleted file mode 100644 index 3eeda21b..00000000 --- a/dist/wally/logger/src/format-log.luau +++ /dev/null @@ -1,43 +0,0 @@ -local types = require("./types") - -local function formatLog(self: types.Logger, log: types.Log, errorInfoUrl: string?): string - local formattedTemplate = string.format(log.template, table.unpack(log)) - - local error = log.error - local trace: string? = log.trace - - if error then - trace = error.trace - formattedTemplate = string.gsub(formattedTemplate, "ERROR_MESSAGE", error.message) - end - - local id: string? - - -- TODO: find a better way to do ts while still being ergonomic - for templateKey, template in (self :: any) :: { [string]: string } do - if template == log.template then - id = templateKey - break - end - end - - if id then - formattedTemplate ..= `\nID: {id}` - end - - if errorInfoUrl then - formattedTemplate ..= `\nLearn more: {errorInfoUrl}` - if id then - formattedTemplate ..= `#{string.lower(id)}` - end - end - - if trace then - formattedTemplate ..= `\n---- Stack trace ----\n{trace}` - end - - -- Labels are added from createLogger, so we don't add it here - return string.gsub(formattedTemplate, "\n", "\n ") -end - -return formatLog diff --git a/dist/wally/logger/src/index.d.ts b/dist/wally/logger/src/index.d.ts deleted file mode 100644 index 85251a07..00000000 --- a/dist/wally/logger/src/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -declare namespace Logger { - export interface Error { - type: "Error"; - raw: string; - message: string; - trace: string; - } - - interface LogProps { - template: string; - error?: Error; - trace?: string; - } - - export type Log = LogProps & unknown[]; - - interface LoggerProps { - print(props: Log): void; - warn(props: Log): void; - error(props: Log): void; - fatalError(props: Log): never; - } - - export type Logger> = LoggerProps & Templates; - - export function create>( - label: string, - errorInfoUrl: string | undefined, - templates: Templates - ): Logger; - - export function formatLog>( - logger: Logger, - log: Log, - errorInfoUrl?: string - ): string; - - export function parseError(err: string): Error; - - export const allowWebLinks: boolean; - export function standardErrorInfoUrl(label: string): string; -} - -export = Logger; -export as namespace Logger; diff --git a/dist/wally/logger/src/init.luau b/dist/wally/logger/src/init.luau deleted file mode 100644 index 52760a5d..00000000 --- a/dist/wally/logger/src/init.luau +++ /dev/null @@ -1,18 +0,0 @@ -local allowWebLinks = require("@self/allow-web-links") -local create = require("@self/create") -local formatLog = require("@self/format-log") -local parseError = require("@self/parse-error") -local standardErrorInfoUrl = require("@self/standard-error-info-url") -local types = require("@self/types") - -export type Logger = types.Logger -export type Log = types.Log -export type Error = types.Error - -return table.freeze({ - create = create, - formatLog = formatLog, - parseError = parseError, - allowWebLinks = allowWebLinks, - standardErrorInfoUrl = standardErrorInfoUrl, -}) diff --git a/dist/wally/logger/src/parse-error.luau b/dist/wally/logger/src/parse-error.luau deleted file mode 100644 index e43fe53d..00000000 --- a/dist/wally/logger/src/parse-error.luau +++ /dev/null @@ -1,12 +0,0 @@ -local types = require("./types") - -local function parseError(err: string): types.Error - return { - type = "Error", - raw = err, - message = err:gsub("^.+:%d+:%s*", ""), - trace = debug.traceback(nil, 2), - } -end - -return parseError diff --git a/dist/wally/logger/src/standard-error-info-url.luau b/dist/wally/logger/src/standard-error-info-url.luau deleted file mode 100644 index 345faf36..00000000 --- a/dist/wally/logger/src/standard-error-info-url.luau +++ /dev/null @@ -1,5 +0,0 @@ -local function standardErrorInfoUrl(label: string): string - return `https://prvdmwrong.luau.page/api-reference/{label}/errors` -end - -return standardErrorInfoUrl diff --git a/dist/wally/logger/src/types.luau b/dist/wally/logger/src/types.luau deleted file mode 100644 index d1699037..00000000 --- a/dist/wally/logger/src/types.luau +++ /dev/null @@ -1,23 +0,0 @@ -export type Error = { - type: "Error", - raw: string, - message: string, - trace: string, -} - -export type Log = { - template: string, - error: Error?, - trace: string?, - [number]: unknown, -} - -export type Logger = Templates & { - type: "Logger", - print: (self: Logger, props: Log) -> (), - warn: (self: Logger, props: Log) -> (), - error: (self: Logger, props: Log) -> (), - fatalError: (self: Logger, props: Log) -> never, -} - -return nil diff --git a/dist/wally/providers/LICENSE.md b/dist/wally/providers/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/wally/providers/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/wally/providers/Wally.toml b/dist/wally/providers/Wally.toml deleted file mode 100644 index 1299a231..00000000 --- a/dist/wally/providers/Wally.toml +++ /dev/null @@ -1,17 +0,0 @@ -[package] -authors = ["Fire "] -description = "Provider creation for Prvd 'M Wrong" -homepage = "https://prvdmwrong.luau.page/latest/" -license = "MPL-2.0" -name = "prvdmwrong/providers" -private = false -realm = "shared" -registry = "https://github.com/upliftgames/wally-index" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[package.dependencies] -dependencies = "prvdmwrong/dependencies@0.2.0-rc.4" -lifecycles = "prvdmwrong/lifecycles@0.2.0-rc.4" -logger = "prvdmwrong/logger@0.2.0-rc.4" -runtime = "prvdmwrong/runtime@0.2.0-rc.4" diff --git a/dist/wally/providers/dependencies.luau b/dist/wally/providers/dependencies.luau deleted file mode 100644 index c11c4469..00000000 --- a/dist/wally/providers/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/wally/providers/lifecycles.luau b/dist/wally/providers/lifecycles.luau deleted file mode 100644 index 53ce025e..00000000 --- a/dist/wally/providers/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/wally/providers/logger.luau b/dist/wally/providers/logger.luau deleted file mode 100644 index 830f960c..00000000 --- a/dist/wally/providers/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./Packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/wally/providers/runtime.luau b/dist/wally/providers/runtime.luau deleted file mode 100644 index c841cb44..00000000 --- a/dist/wally/providers/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/wally/providers/src/create.luau b/dist/wally/providers/src/create.luau deleted file mode 100644 index 016b8a6d..00000000 --- a/dist/wally/providers/src/create.luau +++ /dev/null @@ -1,30 +0,0 @@ -local nameOf = require("./name-of") -local providerClasses = require("./provider-classes") -local types = require("./types") - -local function createProvider(self: Self): types.Provider - local provider: types.Provider = self :: any - - if provider.__index == nil then - provider.__index = provider - end - - if provider.__tostring == nil then - provider.__tostring = nameOf - end - - if provider.new == nil then - function provider.new(dependencies) - local self: types.Provider = setmetatable({}, provider) :: any - if provider.constructor then - return provider.constructor(self, dependencies) or self - end - return self - end - end - - providerClasses[provider] = true - return provider -end - -return createProvider diff --git a/dist/wally/providers/src/index.d.ts b/dist/wally/providers/src/index.d.ts deleted file mode 100644 index 2ab36e15..00000000 --- a/dist/wally/providers/src/index.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Dependency } from "../dependencies"; - -declare namespace providers { - export type Provider = Dependency< - Self & { - __index: Provider; - name?: string; - constructor?(dependencies: Dependencies): void; - start?(): void; - destroy?(): void; - }, - Dependencies - >; - - // Class decorator syntax - export function create InstanceType>(self: Self): Provider; - // Normal syntax - export function create(self: Self): Provider; - - export function nameOf(provider: Provider): string; - - export namespace _ { - export const providerClasses: Set>; - } - - export interface Start { - start(): void; - } - - export interface Destroy { - destroy(): void; - } -} - -export = providers; -export as namespace providers; diff --git a/dist/wally/providers/src/init.luau b/dist/wally/providers/src/init.luau deleted file mode 100644 index d678d850..00000000 --- a/dist/wally/providers/src/init.luau +++ /dev/null @@ -1,16 +0,0 @@ -local create = require("@self/create") -local nameOf = require("@self/name-of") -local providerClasses = require("@self/provider-classes") -local types = require("@self/types") - -export type Provider = types.Provider - -local providers = table.freeze({ - create = create, - nameOf = nameOf, - _ = table.freeze({ - providerClasses = providerClasses, - }), -}) - -return providers diff --git a/dist/wally/providers/src/name-of.luau b/dist/wally/providers/src/name-of.luau deleted file mode 100644 index 3f86ceec..00000000 --- a/dist/wally/providers/src/name-of.luau +++ /dev/null @@ -1,7 +0,0 @@ -local types = require("./types") - -local function nameOf(provider: types.Provider) - return provider.name or "Provider" -end - -return nameOf diff --git a/dist/wally/providers/src/provider-classes.luau b/dist/wally/providers/src/provider-classes.luau deleted file mode 100644 index cc57922f..00000000 --- a/dist/wally/providers/src/provider-classes.luau +++ /dev/null @@ -1,7 +0,0 @@ -local types = require("./types") - -type Set = { [T]: true } - -local providerClasses: Set> = setmetatable({}, { __mode = "k" }) :: any - -return providerClasses diff --git a/dist/wally/providers/src/types.luau b/dist/wally/providers/src/types.luau deleted file mode 100644 index 4f4d4dc9..00000000 --- a/dist/wally/providers/src/types.luau +++ /dev/null @@ -1,12 +0,0 @@ -local dependencies = require("../dependencies") - -export type Provider = dependencies.Dependency, - __tostring: (self: Provider) -> string, - name: string?, - constructor: ((self: Provider, dependencies: Dependencies) -> ())?, - start: (self: Provider) -> ()?, - destroy: (self: Provider) -> ()?, -}, Dependencies> - -return nil diff --git a/dist/wally/prvdmwrong/LICENSE.md b/dist/wally/prvdmwrong/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/wally/prvdmwrong/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/wally/prvdmwrong/Wally.toml b/dist/wally/prvdmwrong/Wally.toml deleted file mode 100644 index 1f4e3fac..00000000 --- a/dist/wally/prvdmwrong/Wally.toml +++ /dev/null @@ -1,17 +0,0 @@ -[package] -authors = ["Fire "] -description = "Entry point to Prvd 'M Wrong" -homepage = "https://prvdmwrong.luau.page/latest/" -license = "MPL-2.0" -name = "prvdmwrong/prvdmwrong" -private = false -realm = "shared" -registry = "https://github.com/upliftgames/wally-index" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[package.dependencies] -dependencies = "prvdmwrong/dependencies@0.2.0-rc.4" -lifecycles = "prvdmwrong/lifecycles@0.2.0-rc.4" -providers = "prvdmwrong/providers@0.2.0-rc.4" -roots = "prvdmwrong/roots@0.2.0-rc.4" diff --git a/dist/wally/prvdmwrong/dependencies.luau b/dist/wally/prvdmwrong/dependencies.luau deleted file mode 100644 index c11c4469..00000000 --- a/dist/wally/prvdmwrong/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/wally/prvdmwrong/lifecycles.luau b/dist/wally/prvdmwrong/lifecycles.luau deleted file mode 100644 index 53ce025e..00000000 --- a/dist/wally/prvdmwrong/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/wally/prvdmwrong/providers.luau b/dist/wally/prvdmwrong/providers.luau deleted file mode 100644 index dd417a75..00000000 --- a/dist/wally/prvdmwrong/providers.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/providers") -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/wally/prvdmwrong/roots.luau b/dist/wally/prvdmwrong/roots.luau deleted file mode 100644 index c606c7bd..00000000 --- a/dist/wally/prvdmwrong/roots.luau +++ /dev/null @@ -1,4 +0,0 @@ -local DEPENDENCY = require("./Packages/roots") -export type Root = DEPENDENCY.Root -export type StartedRoot = DEPENDENCY.StartedRoot -return DEPENDENCY diff --git a/dist/wally/prvdmwrong/src/index.d.ts b/dist/wally/prvdmwrong/src/index.d.ts deleted file mode 100644 index 2058129c..00000000 --- a/dist/wally/prvdmwrong/src/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import dependencies from "../dependencies"; -import lifecycles from "../lifecycles"; -import providers from "../providers"; -import roots from "../roots"; - -declare namespace prvd { - export type Provider = providers.Provider; - export interface Lifecycle extends lifecycles.Lifecycle { } - export type SubdependenciesOf = dependencies.SubdependenciesOf; - export interface Root extends roots.Root { } - export interface StartedRoot extends roots.StartedRoot { } - - export interface Start extends providers.Start { } - export interface Destroy extends providers.Destroy { } - - export const provider: typeof providers.create; - export const root: typeof roots.create; - export const depend: typeof dependencies.depend; - export const nameOf: typeof providers.nameOf; - - export const lifecycle: typeof lifecycles.create; - export const fireConcurrent: typeof lifecycles.handlers.fireConcurrent; - export const fireSequential: typeof lifecycles.handlers.fireSequential; - - export namespace hooks { - export const onLifecycleConstructed: typeof lifecycles.hooks.onLifecycleConstructed; - export const onLifecycleDestroyed: typeof lifecycles.hooks.onLifecycleDestroyed; - export const onLifecycleRegistered: typeof lifecycles.hooks.onLifecycleRegistered; - export const onLifecycleUnregistered: typeof lifecycles.hooks.onLifecycleUnregistered; - - export const onLifecycleUsed: typeof roots.hooks.onLifecycleUsed; - export const onProviderUsed: typeof roots.hooks.onProviderUsed; - export const onRootUsed: typeof roots.hooks.onRootUsed; - export const onRootConstructing: typeof roots.hooks.onRootConstructing; - export const onRootStarted: typeof roots.hooks.onRootStarted; - export const onRootFinished: typeof roots.hooks.onRootFinished; - export const onRootDestroyed: typeof roots.hooks.onRootDestroyed; - } -} - -export = prvd; -export as namespace prvd; diff --git a/dist/wally/prvdmwrong/src/init.luau b/dist/wally/prvdmwrong/src/init.luau deleted file mode 100644 index 1381801d..00000000 --- a/dist/wally/prvdmwrong/src/init.luau +++ /dev/null @@ -1,45 +0,0 @@ -local dependencies = require("./dependencies") -local lifecycles = require("./lifecycles") -local providers = require("./providers") -local roots = require("./roots") - -export type Provider = providers.Provider -export type Lifecycle = lifecycles.Lifecycle -export type Root = roots.Root -export type StartedRoot = roots.StartedRoot - -local prvd = { - provider = providers.create, - root = roots.create, - depend = dependencies.depend, - nameOf = providers.nameOf, - - lifecycle = lifecycles.create, - fireConcurrent = lifecycles.handlers.fireConcurrent, - fireSequential = lifecycles.handlers.fireSequential, - - hooks = table.freeze({ - onProviderUsed = roots.hooks.onProviderUsed, - onLifecycleUsed = roots.hooks.onLifecycleUsed, - onRootConstructing = roots.hooks.onRootConstructing, - onRootUsed = roots.hooks.onRootUsed, - onRootStarted = roots.hooks.onRootStarted, - onRootFinished = roots.hooks.onRootFinished, - onRootDestroyed = roots.hooks.onRootDestroyed, - - onLifecycleConstructed = lifecycles.hooks.onLifecycleConstructed, - onLifecycleDestroyed = lifecycles.hooks.onLifecycleDestroyed, - onLifecycleRegistered = lifecycles.hooks.onLifecycleRegistered, - onLifecycleUnregistered = lifecycles.hooks.onLifecycleUnregistered, - }), -} - -type PrvdModule = ((provider: Self) -> Provider) & typeof(prvd) - -local mt = {} -function mt.__call(_, provider: Self): providers.Provider - return providers.create(provider) :: any -end - -local module: PrvdModule = setmetatable(prvd, mt) :: any -return module diff --git a/dist/wally/rbx-components/LICENSE.md b/dist/wally/rbx-components/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/wally/rbx-components/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/wally/rbx-components/Wally.toml b/dist/wally/rbx-components/Wally.toml deleted file mode 100644 index 5c89a9ff..00000000 --- a/dist/wally/rbx-components/Wally.toml +++ /dev/null @@ -1,17 +0,0 @@ -[package] -authors = ["Fire "] -description = "Component functionality for Prvd 'M Wrong" -homepage = "https://prvdmwrong.luau.page/latest/" -license = "MPL-2.0" -name = "prvdmwrong/rbx-components" -private = false -realm = "shared" -registry = "https://github.com/upliftgames/wally-index" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[package.dependencies] -dependencies = "prvdmwrong/dependencies@0.2.0-rc.4" -logger = "prvdmwrong/logger@0.2.0-rc.4" -providers = "prvdmwrong/providers@0.2.0-rc.4" -roots = "prvdmwrong/roots@0.2.0-rc.4" diff --git a/dist/wally/rbx-components/dependencies.luau b/dist/wally/rbx-components/dependencies.luau deleted file mode 100644 index c11c4469..00000000 --- a/dist/wally/rbx-components/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/wally/rbx-components/logger.luau b/dist/wally/rbx-components/logger.luau deleted file mode 100644 index 830f960c..00000000 --- a/dist/wally/rbx-components/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./Packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/wally/rbx-components/providers.luau b/dist/wally/rbx-components/providers.luau deleted file mode 100644 index dd417a75..00000000 --- a/dist/wally/rbx-components/providers.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/providers") -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/wally/rbx-components/roots.luau b/dist/wally/rbx-components/roots.luau deleted file mode 100644 index c606c7bd..00000000 --- a/dist/wally/rbx-components/roots.luau +++ /dev/null @@ -1,4 +0,0 @@ -local DEPENDENCY = require("./Packages/roots") -export type Root = DEPENDENCY.Root -export type StartedRoot = DEPENDENCY.StartedRoot -return DEPENDENCY diff --git a/dist/wally/rbx-components/src/component-classes.luau b/dist/wally/rbx-components/src/component-classes.luau deleted file mode 100644 index 0dcdb30a..00000000 --- a/dist/wally/rbx-components/src/component-classes.luau +++ /dev/null @@ -1,7 +0,0 @@ -local types = require("./types") - -type Set = { [T]: true } - -local componentClasses: Set> = setmetatable({}, { __mode = "k" }) :: any - -return componentClasses diff --git a/dist/wally/rbx-components/src/component-provider.luau b/dist/wally/rbx-components/src/component-provider.luau deleted file mode 100644 index 85af0d0d..00000000 --- a/dist/wally/rbx-components/src/component-provider.luau +++ /dev/null @@ -1,185 +0,0 @@ -local CollectionService = game:GetService("CollectionService") - -local componentClasses = require("./component-classes") -local logger = require("./logger") -local providers = require("../providers") -local runtime = require("../runtime") -local types = require("./types") - -local threadpool = runtime.threadpool - -type Set = { [T]: true } -type ConstructedComponent = types.AnyComponent -type LuauBug = any - -local ComponentProvider = {} -ComponentProvider.priority = -math.huge -ComponentProvider.name = "@rbx-components" - -function ComponentProvider.constructor(self: ComponentProvider) - self.componentClasses = {} :: Set - self.tagToComponentClasses = {} :: { [string]: Set } - self.instanceToComponents = {} :: { [Instance]: { [types.AnyComponent]: ConstructedComponent } } - self.componentToInstances = {} :: { [types.AnyComponent]: Set? } - self.constructedToClass = {} :: { [ConstructedComponent]: types.AnyComponent? } - - self._destroyingConnections = {} :: { [Instance]: RBXScriptConnection } - self._connections = {} :: { RBXScriptConnection } -end - -function ComponentProvider.start(self: ComponentProvider) - for tag, components in self.tagToComponentClasses do - local function onTagAdded(instance) - local instanceToComponents = self.instanceToComponents[instance] - if not instanceToComponents then - instanceToComponents = {} - self.instanceToComponents[instance] = instanceToComponents - end - - for componentClass in components do - if - (componentClass.blacklistInstances and (componentClass.blacklistInstances :: LuauBug)[instance]) - or (componentClass.whitelistInstances and not (componentClass.whitelistInstances :: LuauBug)[instance]) - or (componentClass.instanceCheck and not componentClass.instanceCheck(instance)) - then - continue - end - - local component: ConstructedComponent = instanceToComponents[componentClass] - if not component then - component = componentClass.new(instance) - instanceToComponents[componentClass] = component - self.constructedToClass[component :: any] = componentClass - end - - if component.added then - component:added() - end - end - - if not self._destroyingConnections[instance] then - self._destroyingConnections[instance] = instance.Destroying:Once(function() - for _, component in instanceToComponents do - if component.destroy then - threadpool.spawn(component.destroy, component) - end - end - table.clear(instanceToComponents) - self.instanceToComponents[instance] = nil - end) - end - end - - table.insert(self._connections, CollectionService:GetInstanceAddedSignal(tag):Connect(onTagAdded)) - table.insert(self._connections, CollectionService:GetInstanceRemovedSignal(tag):Connect(function(instance) end)) - - for _, instance in CollectionService:GetTagged(tag) do - onTagAdded(instance) - end - end -end - -function ComponentProvider.destroy(self: ComponentProvider) - for _, components in self.instanceToComponents do - for _, component in components do - if component.destroy then - component:destroy() - end - end - table.clear(components) - end - - table.clear(self.componentClasses) - table.clear(self.tagToComponentClasses) - table.clear(self.instanceToComponents) - table.clear(self.componentToInstances) - table.clear(self.constructedToClass) - - for _, connection in self._connections do - if connection.Connected then - connection:Disconnect() - end - end - - for _, connection in self._destroyingConnections do - if connection.Connected then - connection:Disconnect() - end - end - - table.clear(self._connections) - table.clear(self._destroyingConnections) -end - -function ComponentProvider.addComponentClass(self: ComponentProvider, class: types.AnyComponent) - if not componentClasses[class] then - logger:fatalError({ template = logger.invalidComponent }) - end - - if self.componentClasses[class] then - logger:fatalError({ template = logger.alreadyRegisteredComponent }) - end - - if class.tag then - local tagToComponentClasses = self.tagToComponentClasses[class.tag] - - if tagToComponentClasses then - if not _G.PRVDMWRONG_SUPPRESS_MULTIPLE_SAME_TAG and #tagToComponentClasses > 0 then - logger:warn({ template = logger.multipleSameTag, class.tag }) - end - else - tagToComponentClasses = {} - self.tagToComponentClasses[class.tag] = tagToComponentClasses - end - - (tagToComponentClasses :: any)[class] = true - end - - self.componentClasses[class] = true - self.componentToInstances[class] = {} -end - -function ComponentProvider.getFromInstance( - self: ComponentProvider, - class: types.Component, - instance: I -): types.Component? - return self.instanceToComponents[instance :: any][class] -end - -function ComponentProvider.getAllComponents( - self: ComponentProvider, - class: types.Component -): Set> - local result = {} - for _, components in self.instanceToComponents do - for _, component in components do - if self.constructedToClass[component] == class then - result[component] = true - end - end - end - return result :: any -end - -function ComponentProvider.addComponent( - self: ComponentProvider, - class: types.Component, - instance: I -): types.Component? - error("not yet implemented") -end - -function ComponentProvider.removeComponent(self: ComponentProvider, class: types.Component, instance: I) - local constructed = self:getFromInstance(class, instance) - if constructed then - self.instanceToComponents[instance :: any][class] = nil - - if constructed.removed then - threadpool.spawn(constructed.removed :: any, constructed, instance) - end - end -end - -export type ComponentProvider = typeof(ComponentProvider) -return providers.create(ComponentProvider) diff --git a/dist/wally/rbx-components/src/create.luau b/dist/wally/rbx-components/src/create.luau deleted file mode 100644 index 24d39a3b..00000000 --- a/dist/wally/rbx-components/src/create.luau +++ /dev/null @@ -1,28 +0,0 @@ -local componentClasses = require("./component-classes") -local types = require("./types") - --- TODO: prvdmwrong/classes package? -local function create(self: Self): types.Component - local component: types.Component = self :: any - - if component.__index == nil then - component.__index = component - end - - -- TODO: abstract nameOf - - if component.new == nil then - function component.new(instance: any) - local self: types.Component = setmetatable({}, component) :: any - if component.constructor then - return component.constructor(self, instance) or self - end - return self - end - end - - componentClasses[component] = true - return component -end - -return create diff --git a/dist/wally/rbx-components/src/extend-root/create-component-class-provider.luau b/dist/wally/rbx-components/src/extend-root/create-component-class-provider.luau deleted file mode 100644 index 9d5ae999..00000000 --- a/dist/wally/rbx-components/src/extend-root/create-component-class-provider.luau +++ /dev/null @@ -1,31 +0,0 @@ -local ComponentProvider = require("../component-provider") -local providers = require("../../providers") -local types = require("../types") - -local ComponentClassProvider = {} -ComponentClassProvider.priority = -math.huge -ComponentClassProvider.name = "@rbx-components.ComponentClassProvider" -ComponentClassProvider.dependencies = table.freeze({ - componentProvider = ComponentProvider, -}) - -ComponentClassProvider._components = {} :: { types.AnyComponent } - -function ComponentClassProvider.constructor( - self: ComponentClassProvider, - dependencies: typeof(ComponentClassProvider.dependencies) -) - for _, class in self._components do - dependencies.componentProvider:addComponentClass(class) - end -end - -export type ComponentClassProvider = typeof(ComponentClassProvider) - -local function createComponentClassProvider(components: { types.AnyComponent }) - local provider = table.clone(ComponentClassProvider) - provider._components = components - return providers.create(provider) -end - -return createComponentClassProvider diff --git a/dist/wally/rbx-components/src/extend-root/init.luau b/dist/wally/rbx-components/src/extend-root/init.luau deleted file mode 100644 index 6e9f0578..00000000 --- a/dist/wally/rbx-components/src/extend-root/init.luau +++ /dev/null @@ -1,30 +0,0 @@ -local ComponentProvider = require("./component-provider") -local createComponentClassProvider = require("@self/create-component-class-provider") -local logger = require("./logger") -local roots = require("../roots") -local types = require("./types") -local useComponent = require("@self/use-component") -local useComponents = require("@self/use-components") -local useModuleAsComponent = require("@self/use-module-as-component") -local useModulesAsComponents = require("@self/use-modules-as-components") - -local function extendRoot(root: types.RootPrivate): types.Root - if root._hasComponentExtensions then - return logger:fatalError({ template = logger.alreadyExtendedRoot }) - end - - root._hasComponentExtensions = true - root._classes = {} - - root:useProvider(ComponentProvider) - root:useProvider(createComponentClassProvider(root._classes)) - - root.useComponent = useComponent :: any - root.useComponents = useComponents :: any - root.useModuleAsComponent = useModuleAsComponent :: any - root.useModulesAsComponents = useModulesAsComponents :: any - - return root -end - -return extendRoot :: (root: roots.Root) -> types.Root diff --git a/dist/wally/rbx-components/src/extend-root/use-component.luau b/dist/wally/rbx-components/src/extend-root/use-component.luau deleted file mode 100644 index b0bd8d1f..00000000 --- a/dist/wally/rbx-components/src/extend-root/use-component.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -local function useComponent(root: types.RootPrivate, component: types.AnyComponent) - table.insert(root._classes, component) - return root -end - -return useComponent diff --git a/dist/wally/rbx-components/src/extend-root/use-components.luau b/dist/wally/rbx-components/src/extend-root/use-components.luau deleted file mode 100644 index 809a4006..00000000 --- a/dist/wally/rbx-components/src/extend-root/use-components.luau +++ /dev/null @@ -1,10 +0,0 @@ -local types = require("../types") - -local function useComponents(root: types.RootPrivate, components: { types.AnyComponent }) - for index = 1, #components do - table.insert(root._classes, components[index]) - end - return root -end - -return useComponents diff --git a/dist/wally/rbx-components/src/extend-root/use-module-as-component.luau b/dist/wally/rbx-components/src/extend-root/use-module-as-component.luau deleted file mode 100644 index 46724fe7..00000000 --- a/dist/wally/rbx-components/src/extend-root/use-module-as-component.luau +++ /dev/null @@ -1,12 +0,0 @@ -local componentClasses = require("../component-classes") -local types = require("../types") - -local function useModuleAsComponent(root: types.RootPrivate, module: ModuleScript) - local required = (require)(module) - if componentClasses[required] then - table.insert(root, required) - end - return root -end - -return useModuleAsComponent diff --git a/dist/wally/rbx-components/src/extend-root/use-modules-as-components.luau b/dist/wally/rbx-components/src/extend-root/use-modules-as-components.luau deleted file mode 100644 index bababafa..00000000 --- a/dist/wally/rbx-components/src/extend-root/use-modules-as-components.luau +++ /dev/null @@ -1,28 +0,0 @@ -local componentClasses = require("../component-classes") -local types = require("../types") - -local function useModulesAsComponents( - root: types.RootPrivate, - modules: { Instance }, - predicate: ((ModuleScript) -> boolean)? -) - for index = 1, #modules do - local module = modules[index] - - if not module:IsA("ModuleScript") then - continue - end - - if predicate and not predicate(module) then - continue - end - - local required = (require)(module) - if componentClasses[required] then - table.insert(root, required) - end - end - return root -end - -return useModulesAsComponents diff --git a/dist/wally/rbx-components/src/init.luau b/dist/wally/rbx-components/src/init.luau deleted file mode 100644 index 598bcea4..00000000 --- a/dist/wally/rbx-components/src/init.luau +++ /dev/null @@ -1,24 +0,0 @@ -local componentClasses = require("@self/component-classes") -local create = require("@self/create") -local extendRoot = require("@self/extend-root") -local types = require("@self/types") - -export type Component = types.Component -export type Root = types.Root - -local components = { - create = create, - extendRoot = extendRoot, - _ = table.freeze({ - componentClasses = componentClasses, - }), -} - -local mt = {} - -function mt.__call(_, component: Self): types.Component - return create(component) -end - -table.freeze(mt) -return table.freeze(setmetatable(components, mt)) diff --git a/dist/wally/rbx-components/src/logger.luau b/dist/wally/rbx-components/src/logger.luau deleted file mode 100644 index edcc7fac..00000000 --- a/dist/wally/rbx-components/src/logger.luau +++ /dev/null @@ -1,8 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/rbx-components", logger.standardErrorInfoUrl("rbx-components"), { - alreadyExtendedRoot = "Root already has component extension.", - invalidComponent = "Not a component, create one with `components(MyComponent)` or `components.create(MyComponent)`.", - alreadyRegisteredComponent = "Component already registered.", - multipleSameTag = "Multiple components use the CollectionService tag '%s', which is likely a mistake. Supress this warning with `_G.PRVDMWRONG_SUPPRESS_MULTIPLE_SAME_TAG = true`.", -}) diff --git a/dist/wally/rbx-components/src/types.luau b/dist/wally/rbx-components/src/types.luau deleted file mode 100644 index 5bc17dcf..00000000 --- a/dist/wally/rbx-components/src/types.luau +++ /dev/null @@ -1,30 +0,0 @@ -local dependencies = require("../dependencies") -local roots = require("../roots") - -export type Component = dependencies.Dependency, - tag: string?, - instanceCheck: (unknown) -> boolean, - blacklistInstances: { Instance }?, - whitelistInstances: { Instance }?, - constructor: (self: Component, instance: Instance) -> ()?, - added: (self: Component) -> ()?, - removed: (self: Component) -> ()?, - destroyed: (self: Component) -> ()?, -}, nil, Instance> - -export type Root = roots.Root & { - useModuleAsComponent: (root: Root, module: ModuleScript) -> Root, - useModulesAsComponents: (root: Root, modules: { Instance }, predicate: ((ModuleScript) -> boolean)?) -> Root, - useComponent: (root: Root, component: Component) -> Root, - useComponents: (root: Root, components: { Component }) -> Root, -} - -export type RootPrivate = Root & { - _hasComponentExtensions: true?, - _classes: { Component }, -} - -export type AnyComponent = Component - -return nil diff --git a/dist/wally/rbx-lifecycles/LICENSE.md b/dist/wally/rbx-lifecycles/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/wally/rbx-lifecycles/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/wally/rbx-lifecycles/Wally.toml b/dist/wally/rbx-lifecycles/Wally.toml deleted file mode 100644 index 3412f852..00000000 --- a/dist/wally/rbx-lifecycles/Wally.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -authors = ["Fire "] -description = "Lifecycles implementations for Roblox" -homepage = "https://prvdmwrong.luau.page/latest/" -license = "MPL-2.0" -name = "prvdmwrong/rbx-lifecycles" -private = false -realm = "shared" -registry = "https://github.com/upliftgames/wally-index" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[package.dependencies] -prvdmwrong = "prvdmwrong/prvdmwrong@0.2.0-rc.4" diff --git a/dist/wally/rbx-lifecycles/prvdmwrong.luau b/dist/wally/rbx-lifecycles/prvdmwrong.luau deleted file mode 100644 index 6f986dff..00000000 --- a/dist/wally/rbx-lifecycles/prvdmwrong.luau +++ /dev/null @@ -1,6 +0,0 @@ -local DEPENDENCY = require("./Packages/prvdmwrong") -export type Root = DEPENDENCY.Root -export type Lifecycle = DEPENDENCY.Lifecycle -export type StartedRoot = DEPENDENCY.StartedRoot -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/wally/rbx-lifecycles/src/index.d.ts b/dist/wally/rbx-lifecycles/src/index.d.ts deleted file mode 100644 index 3ad36447..00000000 --- a/dist/wally/rbx-lifecycles/src/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Lifecycle } from "../lifecycles"; -import { Provider } from "../providers"; - -declare namespace RbxLifecycles { - export const RbxLifecycles: Provider<{ - preSimulation: Lifecycle<[dt: number]>; - postSimulation: Lifecycle<[dt: number]>; - preAnimation: Lifecycle<[dt: number]>; - preRender: Lifecycle<[dt: number]>; - playerAdded: Lifecycle<[player: Player]>; - playerRemoving: Lifecycle<[player: Player]>; - }>; - - export interface PreSimulation { - preSimulation(dt: number): void; - } - - export interface PostSimulation { - postSimulation(dt: number): void; - } - - export interface PreAnimation { - preAnimation(dt: number): void; - } - - export interface PreRender { - preRender(dt: number): void; - } - - export interface PlayerAdded { - playerAdded(player: Player): void; - } - - export interface PlayerRemoving { - playerRemoving(player: Player): void; - } -} - -export = RbxLifecycles; -export as namespace RbxLifecycles; diff --git a/dist/wally/rbx-lifecycles/src/init.luau b/dist/wally/rbx-lifecycles/src/init.luau deleted file mode 100644 index c1243680..00000000 --- a/dist/wally/rbx-lifecycles/src/init.luau +++ /dev/null @@ -1,67 +0,0 @@ -local Players = game:GetService("Players") -local RunService = game:GetService("RunService") - -local prvd = require("./prvdmwrong") - -local fireConcurrent = prvd.fireConcurrent - -local RbxLifecycles = {} -RbxLifecycles.name = "@prvdmwrong/rbx-lifecycles" -RbxLifecycles.priority = -math.huge - -RbxLifecycles.preSimulation = prvd.lifecycle("preSimulation", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.postSimulation = prvd.lifecycle("postSimulation", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.preAnimation = prvd.lifecycle("preAnimation", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.preRender = prvd.lifecycle("preRender", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.playerAdded = prvd.lifecycle("playerAdded", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.playerRemoving = prvd.lifecycle("playerRemoving", fireConcurrent) :: prvd.Lifecycle - -local function wrapLifecycle(lifecycle: prvd.Lifecycle<...unknown>) - return function(...: unknown) - lifecycle:fire(...) - end -end - -function RbxLifecycles.constructor(self: RbxLifecycles) - self.connections = {} :: { RBXScriptConnection } - - self:_addConnections( - RunService.PreSimulation:Connect(wrapLifecycle(RbxLifecycles.preSimulation :: any)), - RunService.PostSimulation:Connect(wrapLifecycle(RbxLifecycles.postSimulation :: any)), - RunService.PreAnimation:Connect(wrapLifecycle(RbxLifecycles.preAnimation :: any)) - ) - - if RunService:IsClient() then - self:_addConnections(RunService.PreRender:Connect(wrapLifecycle(RbxLifecycles.preRender :: any))) - end - - self:_addConnections( - Players.PlayerAdded:Connect(wrapLifecycle(RbxLifecycles.playerAdded :: any)), - Players.PlayerRemoving:Connect(wrapLifecycle(RbxLifecycles.playerRemoving :: any)) - ) -end - -function RbxLifecycles.finish(self: RbxLifecycles) - for _, connection in self.connections do - if connection.Connected then - connection:Disconnect() - end - end - table.clear(self.connections) -end - -function RbxLifecycles._addConnections(self: RbxLifecycles, ...: RBXScriptConnection) - for index = 1, select("#", ...) do - table.insert(self.connections, select(index, ...) :: any) - end -end - --- Needed so typescript can require the provider as: --- --- ```ts --- import { RbxLifecycles } from "@rbxts/rbx-lifecycles" --- ``` -RbxLifecycles.RbxLifecycles = RbxLifecycles - -export type RbxLifecycles = typeof(RbxLifecycles) -return prvd(RbxLifecycles) diff --git a/dist/wally/roots/LICENSE.md b/dist/wally/roots/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/wally/roots/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/wally/roots/Wally.toml b/dist/wally/roots/Wally.toml deleted file mode 100644 index 0fcbbd8c..00000000 --- a/dist/wally/roots/Wally.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -authors = ["Fire "] -description = "Roots implementation for Prvd 'M Wrong" -homepage = "https://prvdmwrong.luau.page/latest/" -license = "MPL-2.0" -name = "prvdmwrong/roots" -private = false -realm = "shared" -registry = "https://github.com/upliftgames/wally-index" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[package.dependencies] -dependencies = "prvdmwrong/dependencies@0.2.0-rc.4" -lifecycles = "prvdmwrong/lifecycles@0.2.0-rc.4" -logger = "prvdmwrong/logger@0.2.0-rc.4" -providers = "prvdmwrong/providers@0.2.0-rc.4" -runtime = "prvdmwrong/runtime@0.2.0-rc.4" diff --git a/dist/wally/roots/dependencies.luau b/dist/wally/roots/dependencies.luau deleted file mode 100644 index c11c4469..00000000 --- a/dist/wally/roots/dependencies.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/dependencies") -export type Dependency = DEPENDENCY.Dependency -return DEPENDENCY diff --git a/dist/wally/roots/lifecycles.luau b/dist/wally/roots/lifecycles.luau deleted file mode 100644 index 53ce025e..00000000 --- a/dist/wally/roots/lifecycles.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/lifecycles") -export type Lifecycle = DEPENDENCY.Lifecycle -return DEPENDENCY diff --git a/dist/wally/roots/logger.luau b/dist/wally/roots/logger.luau deleted file mode 100644 index 830f960c..00000000 --- a/dist/wally/roots/logger.luau +++ /dev/null @@ -1,5 +0,0 @@ -local DEPENDENCY = require("./Packages/logger") -export type Logger = DEPENDENCY.Logger -export type Log = DEPENDENCY.Log -export type Error = DEPENDENCY.Error -return DEPENDENCY diff --git a/dist/wally/roots/providers.luau b/dist/wally/roots/providers.luau deleted file mode 100644 index dd417a75..00000000 --- a/dist/wally/roots/providers.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/providers") -export type Provider = DEPENDENCY.Provider -return DEPENDENCY diff --git a/dist/wally/roots/runtime.luau b/dist/wally/roots/runtime.luau deleted file mode 100644 index c841cb44..00000000 --- a/dist/wally/roots/runtime.luau +++ /dev/null @@ -1,3 +0,0 @@ -local DEPENDENCY = require("./Packages/runtime") -export type RuntimeName = DEPENDENCY.RuntimeName -return DEPENDENCY diff --git a/dist/wally/roots/src/create.luau b/dist/wally/roots/src/create.luau deleted file mode 100644 index 26c14f4e..00000000 --- a/dist/wally/roots/src/create.luau +++ /dev/null @@ -1,47 +0,0 @@ -local destroy = require("./methods/destroy") -local lifecycles = require("../lifecycles") -local rootConstructing = require("./hooks/root-constructing") -local start = require("./methods/start") -local types = require("./types") -local useModule = require("./methods/use-module") -local useModules = require("./methods/use-modules") -local useProvider = require("./methods/use-provider") -local useProviders = require("./methods/use-providers") -local useRoot = require("./methods/use-root") -local useRoots = require("./methods/use-roots") -local willFinish = require("./methods/will-finish") -local willStart = require("./methods/will-start") - -local function create(): types.Root - local self: types.Self = { - type = "Root", - - start = start, - - useProvider = useProvider, - useProviders = useProviders, - useModule = useModule, - useModules = useModules, - useRoot = useRoot, - useRoots = useRoots, - destroy = destroy, - - willStart = willStart, - willFinish = willFinish, - - _destroyed = false, - _rootProviders = {}, - _rootLifecycles = {}, - _subRoots = {}, - _start = lifecycles.create("start", lifecycles.handlers.fireConcurrent), - _finish = lifecycles.create("destroy", lifecycles.handlers.fireSequential), - } :: any - - for _, callback in rootConstructing.callbacks do - callback(self) - end - - return self -end - -return create diff --git a/dist/wally/roots/src/hooks/lifecycle-used.luau b/dist/wally/roots/src/hooks/lifecycle-used.luau deleted file mode 100644 index bd29276a..00000000 --- a/dist/wally/roots/src/hooks/lifecycle-used.luau +++ /dev/null @@ -1,16 +0,0 @@ -local lifecycles = require("../../lifecycles") -local types = require("../types") - -local callbacks: { (root: types.Self, provider: lifecycles.Lifecycle) -> () } = {} - -local function onLifecycleUsed(listener: (root: types.Root, lifecycle: lifecycles.Lifecycle) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleUsed = onLifecycleUsed, -}) diff --git a/dist/wally/roots/src/hooks/provider-used.luau b/dist/wally/roots/src/hooks/provider-used.luau deleted file mode 100644 index dac2573c..00000000 --- a/dist/wally/roots/src/hooks/provider-used.luau +++ /dev/null @@ -1,16 +0,0 @@ -local providers = require("../../providers") -local types = require("../types") - -local callbacks: { (root: types.Self, provider: providers.Provider) -> () } = {} - -local function onProviderUsed(listener: (root: types.Root, provider: providers.Provider) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onProviderUsed = onProviderUsed, -}) diff --git a/dist/wally/roots/src/hooks/root-constructing.luau b/dist/wally/roots/src/hooks/root-constructing.luau deleted file mode 100644 index 5fb8b819..00000000 --- a/dist/wally/roots/src/hooks/root-constructing.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self) -> () } = {} - -local function onRootConstructing(listener: (root: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootConstructing = onRootConstructing, -}) diff --git a/dist/wally/roots/src/hooks/root-destroyed.luau b/dist/wally/roots/src/hooks/root-destroyed.luau deleted file mode 100644 index 10b79b54..00000000 --- a/dist/wally/roots/src/hooks/root-destroyed.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self) -> () } = {} - -local function onRootDestroyed(listener: (root: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootDestroyed = onRootDestroyed, -}) diff --git a/dist/wally/roots/src/hooks/root-finished.luau b/dist/wally/roots/src/hooks/root-finished.luau deleted file mode 100644 index d3519cea..00000000 --- a/dist/wally/roots/src/hooks/root-finished.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self) -> () } = {} - -local function onRootFinished(listener: (root: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootFinished = onRootFinished, -}) diff --git a/dist/wally/roots/src/hooks/root-started.luau b/dist/wally/roots/src/hooks/root-started.luau deleted file mode 100644 index 2ae6f90c..00000000 --- a/dist/wally/roots/src/hooks/root-started.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self) -> () } = {} - -local function onRootStarted(listener: (root: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootStarted = onRootStarted, -}) diff --git a/dist/wally/roots/src/hooks/root-used.luau b/dist/wally/roots/src/hooks/root-used.luau deleted file mode 100644 index 71f172cc..00000000 --- a/dist/wally/roots/src/hooks/root-used.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self, subRoot: types.Root) -> () } = {} - -local function onRootUsed(listener: (root: types.Root, subRoot: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootUsed = onRootUsed, -}) diff --git a/dist/wally/roots/src/index.d.ts b/dist/wally/roots/src/index.d.ts deleted file mode 100644 index d8e100c5..00000000 --- a/dist/wally/roots/src/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Lifecycle } from "../lifecycles"; -import { Provider } from "../providers"; - -declare namespace roots { - export type Root = { - type: "Root"; - - start(): StartedRoot; - - useModule(module: ModuleScript): Root; - useModules(modules: Instance[], predicate?: (module: ModuleScript) => boolean): Root; - useRoot(root: Root): Root; - useRoots(roots: Root[]): Root; - useProvider(provider: Provider): Root; - useProviders(providers: Provider[]): Root; - useLifecycle(lifecycle: Lifecycle): Root; - useLifecycles(lifecycles: Lifecycle): Root; - destroy(): void; - - willStart(callback: () => void): Root; - willFinish(callback: () => void): Root; - }; - - export type StartedRoot = { - type: "StartedRoot"; - - finish(): void; - }; - - export function create(): Root; - - export namespace hooks { - export function onLifecycleUsed(listener: (lifecycle: Lifecycle) => void): () => void; - export function onProviderUsed(listener: (provider: Provider) => void): () => void; - export function onRootUsed(listener: (root: Root, subRoot: Root) => void): () => void; - - export function onRootConstructing(listener: (root: Root) => void): () => void; - export function onRootStarted(listener: (root: Root) => void): () => void; - export function onRootFinished(listener: (root: Root) => void): () => void; - export function onRootDestroyed(listener: (root: Root) => void): () => void; - } -} - -export = roots; -export as namespace roots; diff --git a/dist/wally/roots/src/init.luau b/dist/wally/roots/src/init.luau deleted file mode 100644 index f6aa7495..00000000 --- a/dist/wally/roots/src/init.luau +++ /dev/null @@ -1,28 +0,0 @@ -local create = require("@self/create") -local lifecycleUsed = require("@self/hooks/lifecycle-used") -local providerUsed = require("@self/hooks/provider-used") -local rootConstructing = require("@self/hooks/root-constructing") -local rootDestroyed = require("@self/hooks/root-destroyed") -local rootFinished = require("@self/hooks/root-finished") -local rootStarted = require("@self/hooks/root-started") -local rootUsed = require("@self/hooks/root-used") -local types = require("@self/types") - -export type Root = types.Root -export type StartedRoot = types.StartedRoot - -local roots = table.freeze({ - create = create, - hooks = table.freeze({ - onLifecycleUsed = lifecycleUsed.onLifecycleUsed, - onProviderUsed = providerUsed.onProviderUsed, - onRootUsed = rootUsed.onRootUsed, - - onRootConstructing = rootConstructing.onRootConstructing, - onRootStarted = rootStarted.onRootStarted, - onRootFinished = rootFinished.onRootFinished, - onRootDestroyed = rootDestroyed.onRootDestroyed, - }), -}) - -return roots diff --git a/dist/wally/roots/src/logger.luau b/dist/wally/roots/src/logger.luau deleted file mode 100644 index 92e611ef..00000000 --- a/dist/wally/roots/src/logger.luau +++ /dev/null @@ -1,7 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/roots", logger.standardErrorInfoUrl("roots"), { - useAfterDestroy = "Cannot use Root after it is destroyed.", - alreadyDestroyed = "Cannot destroy an already destroyed Root.", - alreadyFinished = "Root has already finished.", -}) diff --git a/dist/wally/roots/src/methods/destroy.luau b/dist/wally/roots/src/methods/destroy.luau deleted file mode 100644 index 0c62a935..00000000 --- a/dist/wally/roots/src/methods/destroy.luau +++ /dev/null @@ -1,16 +0,0 @@ -local logger = require("../logger") -local types = require("../types") - -local function destroy(root: types.Self) - if root._destroyed then - logger:fatalError({ template = logger.alreadyDestroyed }) - end - root._destroyed = true - table.clear(root._rootLifecycles) - table.clear(root._rootProviders) - table.clear(root._subRoots) - root._start:clear() - root._finish:clear() -end - -return destroy diff --git a/dist/wally/roots/src/methods/start.luau b/dist/wally/roots/src/methods/start.luau deleted file mode 100644 index 3f24dac5..00000000 --- a/dist/wally/roots/src/methods/start.luau +++ /dev/null @@ -1,102 +0,0 @@ -local dependencies = require("../../dependencies") -local lifecycles = require("../../lifecycles") -local logger = require("../logger") -local providers = require("../../providers") -local rootFinished = require("../hooks/root-finished").callbacks -local rootStarted = require("../hooks/root-started").callbacks -local types = require("../types") - -local function bindLifecycle(lifecycle: lifecycles.Lifecycle<...any>, provider: providers.Provider) - local lifecycleMethod = (provider :: any)[lifecycle.method] - if typeof(lifecycleMethod) == "function" then - -- local isProfiling = _G.PRVDMWRONG_PROFILE_LIFECYCLES - - -- if isProfiling then - -- lifecycle:register(function(...) - -- debug.profilebegin(memoryCategory) - -- debug.setmemorycategory(memoryCategory) - -- lifecycleMethod(provider, ...) - -- debug.resetmemorycategory() - -- debug.profileend() - -- end) - -- else - lifecycle:register(function(...) - lifecycleMethod(provider, ...) - end) - -- end - end -end - -local function nameOf(provider: providers.Provider, extension: string?): string - return if extension then `{tostring(provider)}.{extension}` else tostring(provider) -end - -local function start(root: types.Self): types.StartedRoot - local processed = dependencies.processDependencies(root._rootProviders) - local sortedProviders = processed.sortedDependencies :: { providers.Provider } - local processedLifecycles = processed.lifecycles - table.move(root._rootLifecycles, 1, #root._rootLifecycles, #processedLifecycles + 1, processedLifecycles) - - dependencies.sortByPriority(sortedProviders) - - local constructedProviders = {} - for _, provider in sortedProviders do - local providerDependencies = (provider :: any).dependencies - if typeof(providerDependencies) == "table" then - providerDependencies = table.clone(providerDependencies) - for key, value in providerDependencies do - providerDependencies[key] = constructedProviders[value] - end - end - - local constructed = provider.new(providerDependencies) - constructedProviders[provider] = constructed - bindLifecycle(root._start, constructed) - bindLifecycle(root._finish, constructed) - - for _, lifecycle in processedLifecycles do - bindLifecycle(lifecycle, constructed) - end - end - - local subRoots: { types.StartedRoot } = {} - for root in root._subRoots do - table.insert(subRoots, root:start()) - end - - root._start:fire() - - local startedRoot = {} :: types.StartedRoot - startedRoot.type = "StartedRoot" - - local didFinish = false - - function startedRoot:finish() - if didFinish then - return logger:fatalError({ template = logger.alreadyFinished }) - end - - didFinish = true - root._finish:fire() - - -- NOTE(znotfireman): Assume the user cleans up their own lifecycles - root._start:clear() - root._finish:clear() - - for _, subRoot in subRoots do - subRoot:finish() - end - - for _, hook in rootFinished do - hook(root) - end - end - - for _, hook in rootStarted do - hook(root) - end - - return startedRoot -end - -return start diff --git a/dist/wally/roots/src/methods/use-lifecycle.luau b/dist/wally/roots/src/methods/use-lifecycle.luau deleted file mode 100644 index 862c2d07..00000000 --- a/dist/wally/roots/src/methods/use-lifecycle.luau +++ /dev/null @@ -1,14 +0,0 @@ -local lifecycleUsed = require("../hooks/lifecycle-used").callbacks -local lifecycles = require("../../lifecycles") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useLifecycle(root: types.Self, lifecycle: lifecycles.Lifecycle) - table.insert(root._rootLifecycles, lifecycle) - threadpool.spawnCallbacks(lifecycleUsed, root, lifecycle) - return root -end - -return useLifecycle diff --git a/dist/wally/roots/src/methods/use-lifecycles.luau b/dist/wally/roots/src/methods/use-lifecycles.luau deleted file mode 100644 index 3f12341f..00000000 --- a/dist/wally/roots/src/methods/use-lifecycles.luau +++ /dev/null @@ -1,16 +0,0 @@ -local lifecycleUsed = require("../hooks/lifecycle-used").callbacks -local lifecycles = require("../../lifecycles") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useLifecycles(root: types.Self, lifecycles: { lifecycles.Lifecycle }) - for _, lifecycle in lifecycles do - table.insert(root._rootLifecycles, lifecycle) - threadpool.spawnCallbacks(lifecycleUsed, root, lifecycle) - end - return root -end - -return useLifecycles diff --git a/dist/wally/roots/src/methods/use-module.luau b/dist/wally/roots/src/methods/use-module.luau deleted file mode 100644 index a96b3d17..00000000 --- a/dist/wally/roots/src/methods/use-module.luau +++ /dev/null @@ -1,23 +0,0 @@ -local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool -local providerClasses = providers._.providerClasses - -local function useModule(root: types.Self, module: ModuleScript) - local moduleExport = (require)(module) - - if providerClasses[moduleExport] then - root._rootProviders[moduleExport] = true - if typeof(moduleExport.name) ~= "string" then - moduleExport.name = module.Name - end - threadpool.spawnCallbacks(providerUsed, root, moduleExport) - end - - return root -end - -return useModule diff --git a/dist/wally/roots/src/methods/use-modules.luau b/dist/wally/roots/src/methods/use-modules.luau deleted file mode 100644 index 8354a9d0..00000000 --- a/dist/wally/roots/src/methods/use-modules.luau +++ /dev/null @@ -1,28 +0,0 @@ -local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool -local providerClasses = providers._.providerClasses - -local function useModules(root: types.Self, modules: { Instance }, predicate: ((module: ModuleScript) -> boolean)?) - for _, module in modules do - if not module:IsA("ModuleScript") or predicate and not predicate(module) then - continue - end - - local moduleExport = (require)(module) - if providerClasses[moduleExport] then - root._rootProviders[moduleExport] = true - if typeof(moduleExport.name) ~= "string" then - moduleExport.name = module.Name - end - threadpool.spawnCallbacks(providerUsed, root, moduleExport) - end - end - - return root -end - -return useModules diff --git a/dist/wally/roots/src/methods/use-provider.luau b/dist/wally/roots/src/methods/use-provider.luau deleted file mode 100644 index 277d8049..00000000 --- a/dist/wally/roots/src/methods/use-provider.luau +++ /dev/null @@ -1,14 +0,0 @@ -local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useProvider(root: types.Self, provider: providers.Provider) - root._rootProviders[provider] = true - threadpool.spawnCallbacks(providerUsed, root, provider) - return root -end - -return useProvider diff --git a/dist/wally/roots/src/methods/use-providers.luau b/dist/wally/roots/src/methods/use-providers.luau deleted file mode 100644 index 1489c3a3..00000000 --- a/dist/wally/roots/src/methods/use-providers.luau +++ /dev/null @@ -1,16 +0,0 @@ -local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useProviders(root: types.Self, providers: { providers.Provider }) - for _, provider in providers do - root._rootProviders[provider] = true - threadpool.spawnCallbacks(providerUsed, root, provider) - end - return root -end - -return useProviders diff --git a/dist/wally/roots/src/methods/use-root.luau b/dist/wally/roots/src/methods/use-root.luau deleted file mode 100644 index efc4ad1e..00000000 --- a/dist/wally/roots/src/methods/use-root.luau +++ /dev/null @@ -1,13 +0,0 @@ -local rootUsed = require("../hooks/root-used").callbacks -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useRoot(root: types.Self, subRoot: types.Root) - root._subRoots[subRoot] = true - threadpool.spawnCallbacks(rootUsed, root, subRoot) - return root -end - -return useRoot diff --git a/dist/wally/roots/src/methods/use-roots.luau b/dist/wally/roots/src/methods/use-roots.luau deleted file mode 100644 index 7b5b9dda..00000000 --- a/dist/wally/roots/src/methods/use-roots.luau +++ /dev/null @@ -1,15 +0,0 @@ -local rootUsed = require("../hooks/root-used").callbacks -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useRoots(root: types.Self, subRoots: { types.Root }) - for _, subRoot in subRoots do - root._subRoots[subRoot] = true - threadpool.spawnCallbacks(rootUsed, root, subRoot) - end - return root -end - -return useRoots diff --git a/dist/wally/roots/src/methods/will-finish.luau b/dist/wally/roots/src/methods/will-finish.luau deleted file mode 100644 index 893088f4..00000000 --- a/dist/wally/roots/src/methods/will-finish.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -local function willFinish(root: types.Self, callback: () -> ()) - root._finish:register(callback) - return root -end - -return willFinish diff --git a/dist/wally/roots/src/methods/will-start.luau b/dist/wally/roots/src/methods/will-start.luau deleted file mode 100644 index 7c3d88c3..00000000 --- a/dist/wally/roots/src/methods/will-start.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -local function willStart(root: types.Self, callback: () -> ()) - root._start:register(callback) - return root -end - -return willStart diff --git a/dist/wally/roots/src/types.luau b/dist/wally/roots/src/types.luau deleted file mode 100644 index 104143c4..00000000 --- a/dist/wally/roots/src/types.luau +++ /dev/null @@ -1,40 +0,0 @@ -local lifecycles = require("../lifecycles") -local providers = require("../providers") - -type Set = { [T]: true } - -export type Root = { - type: "Root", - - start: (root: Root) -> StartedRoot, - - useModule: (root: Root, module: ModuleScript) -> Root, - useModules: (root: Root, modules: { Instance }, predicate: ((ModuleScript) -> boolean)?) -> Root, - useRoot: (root: Root, root: Root) -> Root, - useRoots: (root: Root, roots: { Root }) -> Root, - useProvider: (root: Root, provider: providers.Provider) -> Root, - useProviders: (root: Root, providers: { providers.Provider }) -> Root, - useLifecycle: (root: Root, lifecycle: lifecycles.Lifecycle) -> Root, - useLifecycles: (root: Root, lifecycles: { lifecycles.Lifecycle }) -> Root, - destroy: (root: Root) -> (), - - willStart: (callback: () -> ()) -> Root, - willFinish: (callback: () -> ()) -> Root, -} - -export type StartedRoot = { - type: "StartedRoot", - - finish: (root: StartedRoot) -> (), -} - -export type Self = Root & { - _destroyed: boolean, - _rootProviders: Set>, - _rootLifecycles: { lifecycles.Lifecycle }, - _subRoots: Set, - _start: lifecycles.Lifecycle<()>, - _finish: lifecycles.Lifecycle<()>, -} - -return nil diff --git a/dist/wally/runtime/LICENSE.md b/dist/wally/runtime/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/wally/runtime/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/wally/runtime/Wally.toml b/dist/wally/runtime/Wally.toml deleted file mode 100644 index 66b37d73..00000000 --- a/dist/wally/runtime/Wally.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -authors = ["Fire "] -description = "Runtime agnostic libraries for Prvd 'M Wrong" -homepage = "https://prvdmwrong.luau.page/latest/" -license = "MPL-2.0" -name = "prvdmwrong/runtime" -private = false -realm = "shared" -registry = "https://github.com/upliftgames/wally-index" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[package.dependencies] diff --git a/dist/wally/runtime/src/batteries/threadpool.luau b/dist/wally/runtime/src/batteries/threadpool.luau deleted file mode 100644 index 6caf08b4..00000000 --- a/dist/wally/runtime/src/batteries/threadpool.luau +++ /dev/null @@ -1,38 +0,0 @@ -local task = require("../libs/task") - -local freeThreads: { thread } = {} - -local function run(f: (T...) -> (), thread: thread, ...) - f(...) - table.insert(freeThreads, thread) -end - -local function yielder() - while true do - run(coroutine.yield()) - end -end - -local function spawn(f: (T...) -> (), ...: T...) - local thread - if #freeThreads > 0 then - thread = freeThreads[#freeThreads] - freeThreads[#freeThreads] = nil - else - thread = coroutine.create(yielder) - coroutine.resume(thread) - end - - task.spawn(thread, f, thread, ...) -end - -local function spawnCallbacks(callbacks: { (Args...) -> () }, ...: Args...) - for _, callback in callbacks do - spawn(callback, ...) - end -end - -return table.freeze({ - spawn = spawn, - spawnCallbacks = spawnCallbacks, -}) diff --git a/dist/wally/runtime/src/implementations/init.luau b/dist/wally/runtime/src/implementations/init.luau deleted file mode 100644 index 28dbe015..00000000 --- a/dist/wally/runtime/src/implementations/init.luau +++ /dev/null @@ -1,56 +0,0 @@ -local types = require("@self/../types") - -type Implementation = { new: (() -> T)?, implementation: T? } - -export type RuntimeName = "roblox" | "luau" | "lune" | "lute" | "seal" | "zune" - -local supportedRuntimes = table.freeze({ - roblox = require("@self/roblox"), - luau = require("@self/luau"), - lune = require("@self/lune"), - lute = require("@self/lute"), - seal = require("@self/seal"), - zune = require("@self/zune"), -}) - -local currentRuntime: types.Runtime = nil -do - for _, runtime in supportedRuntimes :: { [string]: types.Runtime } do - local isRuntime = runtime.is() - if isRuntime then - local currentRuntimePriority = currentRuntime and currentRuntime.priority or 0 - local runtimePriority = runtime.priority or 0 - if currentRuntimePriority <= runtimePriority then - currentRuntime = runtime - end - end - end - assert(currentRuntime, "No supported runtime") -end - -local currentRuntimeName: RuntimeName = currentRuntime.name :: any - -local function notImplemented(functionName: string) - return function() - error(`'{functionName}' is not implemented by runtime '{currentRuntimeName}'`, 2) - end -end - -local function implementFunction(label: string, implementations: { [types.Runtime]: Implementation? }): T - local implementation = implementations[currentRuntime] - if implementation then - if implementation.new then - return implementation.new() - elseif implementation.implementation then - return implementation.implementation - end - end - return notImplemented(label) :: any -end - -return table.freeze({ - supportedRuntimes = supportedRuntimes, - currentRuntime = currentRuntime, - currentRuntimeName = currentRuntimeName, - implementFunction = implementFunction, -}) diff --git a/dist/wally/runtime/src/implementations/init.spec.luau b/dist/wally/runtime/src/implementations/init.spec.luau deleted file mode 100644 index 3ce91cbb..00000000 --- a/dist/wally/runtime/src/implementations/init.spec.luau +++ /dev/null @@ -1,81 +0,0 @@ -local implementations = require("@self/../implementations") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("currentRuntime", function() - test("detects lune runtime", function() - expect(implementations.currentRuntimeName).is("lune") - expect(implementations.currentRuntime).is(implementations.supportedRuntimes.lune) - end) - end) - - describe("implementFunction", function() - test("implements for lune runtime", function() - local lune = function() end - local luau = function() end - - local implementation = implementations.implementFunction("implementation", { - [implementations.supportedRuntimes.lune] = { - implementation = lune, - }, - [implementations.supportedRuntimes.luau] = { - implementation = luau, - }, - }) - - expect(implementation).is_a("function") - expect(implementation).never_is(luau) - expect(implementation).is(lune) - end) - - test("constructs for lune runtime", function() - local lune = function() end - local luau = function() end - - local constructedLune = false - - local implementation = implementations.implementFunction("implementation", { - [implementations.supportedRuntimes.lune] = { - new = function() - constructedLune = true - return lune - end, - }, - [implementations.supportedRuntimes.luau] = { - new = function() - return luau - end, - }, - }) - - expect(implementation).is_a("function") - expect(implementation).never_is(luau) - expect(implementation).is(lune) - expect(constructedLune).is_true() - end) - - test("defaults to not implemented function", function() - local constructSuccess, runSuccess = false, false - - local implementation = implementations.implementFunction("implementation", { - [implementations.supportedRuntimes.roblox] = { - new = function() - constructSuccess = true - return function() - runSuccess = true - end - end, - }, - }) - - expect(constructSuccess).is(false) - expect(implementation).is_a("function") - expect(implementation).fails_with("'implementation' is not implemented by runtime 'lune'") - expect(runSuccess).is(false) - end) - end) -end diff --git a/dist/wally/runtime/src/implementations/luau.luau b/dist/wally/runtime/src/implementations/luau.luau deleted file mode 100644 index c67e52f4..00000000 --- a/dist/wally/runtime/src/implementations/luau.luau +++ /dev/null @@ -1,9 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "luau", - priority = -1, - is = function() - return true - end, -}) diff --git a/dist/wally/runtime/src/implementations/lune.luau b/dist/wally/runtime/src/implementations/lune.luau deleted file mode 100644 index f49834eb..00000000 --- a/dist/wally/runtime/src/implementations/lune.luau +++ /dev/null @@ -1,10 +0,0 @@ -local types = require("../types") - -local LUNE_VERSION_FORMAT = "(Lune) (%d+%.%d+%.%d+.*)+(%d+)" - -return types.Runtime({ - name = "lune", - is = function() - return string.match(_VERSION, LUNE_VERSION_FORMAT) ~= nil - end, -}) diff --git a/dist/wally/runtime/src/implementations/lute.luau b/dist/wally/runtime/src/implementations/lute.luau deleted file mode 100644 index 7b6abc58..00000000 --- a/dist/wally/runtime/src/implementations/lute.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "lute", - is = function() - return false - end, -}) diff --git a/dist/wally/runtime/src/implementations/roblox.luau b/dist/wally/runtime/src/implementations/roblox.luau deleted file mode 100644 index 91a780e2..00000000 --- a/dist/wally/runtime/src/implementations/roblox.luau +++ /dev/null @@ -1,9 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "roblox", - is = function() - -- wtf - return not not (_VERSION == "Luau" and game and workspace) - end, -}) diff --git a/dist/wally/runtime/src/implementations/seal.luau b/dist/wally/runtime/src/implementations/seal.luau deleted file mode 100644 index 0a72684c..00000000 --- a/dist/wally/runtime/src/implementations/seal.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "seal", - is = function() - return false - end, -}) diff --git a/dist/wally/runtime/src/implementations/zune.luau b/dist/wally/runtime/src/implementations/zune.luau deleted file mode 100644 index 48243e05..00000000 --- a/dist/wally/runtime/src/implementations/zune.luau +++ /dev/null @@ -1,10 +0,0 @@ -local types = require("../types") - -local ZUNE_VERSION_FORMAT = "(Zune) (%d+%.%d+%.%d+.*)+(%d+%.%d+)" - -return types.Runtime({ - name = "zune", - is = function() - return string.match(_VERSION, ZUNE_VERSION_FORMAT) ~= nil - end, -}) diff --git a/dist/wally/runtime/src/index.d.ts b/dist/wally/runtime/src/index.d.ts deleted file mode 100644 index b227b952..00000000 --- a/dist/wally/runtime/src/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -declare namespace runtime { - export type RuntimeName = "roblox" | "luau" | "lune" | "lute" | "seal" | "zune"; - - export const name: RuntimeName; - - export namespace task { - export function cancel(thread: thread): void; - - export function defer(functionOrThread: (...args: T) => void, ...args: T): thread; - export function defer(functionOrThread: thread): thread; - export function defer( - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function delay( - duration: number, - functionOrThread: (...args: T) => void, - ...args: T - ): thread; - export function delay(duration: number, functionOrThread: thread): thread; - export function delay( - duration: number, - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function spawn(functionOrThread: (...args: T) => void, ...args: T): thread; - export function spawn(functionOrThread: thread): thread; - export function spawn( - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function wait(duration: number): number; - } - - export function warn(...args: T): void; - - export namespace threadpool { - export function spawn(f: (...args: T) => void, ...args: T): void; - export function spawnCallbacks(functions: ((...args: T) => void)[], ...args: T): void; - } -} - -export = runtime; -export as namespace runtime; diff --git a/dist/wally/runtime/src/init.luau b/dist/wally/runtime/src/init.luau deleted file mode 100644 index 26bdeee0..00000000 --- a/dist/wally/runtime/src/init.luau +++ /dev/null @@ -1,15 +0,0 @@ -local implementations = require("@self/implementations") -local task = require("@self/libs/task") -local threadpool = require("@self/batteries/threadpool") -local warn = require("@self/libs/warn") - -export type RuntimeName = implementations.RuntimeName - -return table.freeze({ - name = implementations.currentRuntimeName, - - task = task, - warn = warn, - - threadpool = threadpool, -}) diff --git a/dist/wally/runtime/src/libs/task.luau b/dist/wally/runtime/src/libs/task.luau deleted file mode 100644 index 28c1ac9e..00000000 --- a/dist/wally/runtime/src/libs/task.luau +++ /dev/null @@ -1,157 +0,0 @@ -local implementations = require("../implementations") - -export type TaskLib = { - cancel: (thread) -> (), - defer: (functionOrThread: thread | (T...) -> (), T...) -> thread, - delay: (duration: number, functionOrThread: thread | (T...) -> (), T...) -> thread, - spawn: (functionOrThread: thread | (T...) -> (), T...) -> thread, - wait: (duration: number?) -> number, -} - -local supportedRuntimes = implementations.supportedRuntimes -local implementFunction = implementations.implementFunction - -local function defaultSpawn(functionOrThread: thread | (T...) -> (), ...: T...): thread - if type(functionOrThread) == "thread" then - coroutine.resume(functionOrThread, ...) - return functionOrThread - else - local thread = coroutine.create(functionOrThread) - coroutine.resume(thread, ...) - return thread - end -end - -local function defaultWait(seconds: number?) - local startTime = os.clock() - local endTime = startTime + (seconds or 1) - local clockTime: number - repeat - clockTime = os.clock() - until clockTime >= endTime - return clockTime - startTime -end - -local task: TaskLib = table.freeze({ - cancel = implementFunction("task.wait", { - [supportedRuntimes.roblox] = { - new = function() - return task.cancel - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").cancel - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").cancel - end, - }, - [supportedRuntimes.luau] = { - implementation = function(thread) - if not coroutine.close(thread) then - error(debug.traceback(thread, "Could not cancel thread")) - end - end, - }, - }), - defer = implementFunction("task.defer", { - [supportedRuntimes.roblox] = { - new = function() - return task.defer :: any - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").defer - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").defer - end, - }, - [supportedRuntimes.luau] = { - implementation = defaultSpawn, - }, - }), - delay = implementFunction("task.delay", { - [supportedRuntimes.roblox] = { - new = function() - return task.delay :: any - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").delay - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").delay - end, - }, - [supportedRuntimes.luau] = { - implementation = function(duration: number, functionOrThread: thread | (T...) -> (), ...: T...): thread - return defaultSpawn( - if typeof(functionOrThread) == "function" - then function(duration, functionOrThread, ...) - defaultWait(duration) - functionOrThread(...) - end - else function(duration, functionOrThread, ...) - defaultWait(duration) - coroutine.resume(...) - end, - duration, - functionOrThread, - ... - ) - end, - }, - }), - spawn = implementFunction("task.spawn", { - [supportedRuntimes.roblox] = { - new = function() - return task.spawn :: any - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").spawn - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").spawn - end, - }, - [supportedRuntimes.luau] = { - implementation = defaultSpawn, - }, - }), - wait = implementFunction("task.wait", { - [supportedRuntimes.roblox] = { - new = function() - return task.wait - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").wait - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").wait - end, - }, - [supportedRuntimes.luau] = { - implementation = defaultWait, - }, - }), -}) - -return task diff --git a/dist/wally/runtime/src/libs/task.spec.luau b/dist/wally/runtime/src/libs/task.spec.luau deleted file mode 100644 index 0918e87f..00000000 --- a/dist/wally/runtime/src/libs/task.spec.luau +++ /dev/null @@ -1,62 +0,0 @@ -local luneTask = require("@lune/task") -local task = require("./task") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - --- FIXME: can't async stuff lol -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("task", function() - test("spawn", function() - expect(task.spawn).is(luneTask.spawn) - local spawned = false - - task.spawn(function() - spawned = true - end) - - expect(spawned).is_true() - end) - - test("defer", function() - expect(task.defer).is(luneTask.defer) - - -- local spawned = false - - -- task.defer(function() - -- spawned = true - -- end) - - -- expect(spawned).never_is_true() - end) - - test("delay", function() - expect(task.delay).is(luneTask.delay) - -- local spawned = false - - -- task.delay(0.25, function() - -- spawned = true - -- end) - - -- expect(spawned).never_is_true() - - -- local startTime = os.clock() - -- repeat - -- until os.clock() - startTime > 0.5 - - -- print(spawned) - - -- expect(spawned).is_true() - end) - - test("wait", function() - expect(task.wait).is(luneTask.wait) - end) - - test("cancel", function() - expect(task.cancel).is(luneTask.cancel) - end) - end) -end diff --git a/dist/wally/runtime/src/libs/warn.luau b/dist/wally/runtime/src/libs/warn.luau deleted file mode 100644 index 6a4837ac..00000000 --- a/dist/wally/runtime/src/libs/warn.luau +++ /dev/null @@ -1,27 +0,0 @@ -local implementations = require("../implementations") - -local supportedRuntimes = implementations.supportedRuntimes -local implementFunction = implementations.implementFunction - -local function tostringTuple(...: any) - local stringified = {} - for index = 1, select("#", ...) do - table.insert(stringified, tostring(select(index, ...))) - end - return table.concat(stringified, " ") -end - -local warn: (T...) -> () = implementFunction("warn", { - [supportedRuntimes.roblox] = { - new = function() - return warn - end, - }, - [supportedRuntimes.luau] = { - implementation = function(...: T...) - print(`\27[0;33m{tostringTuple(...)}\27[0m`) - end, - }, -}) - -return warn diff --git a/dist/wally/runtime/src/types.luau b/dist/wally/runtime/src/types.luau deleted file mode 100644 index ca050fce..00000000 --- a/dist/wally/runtime/src/types.luau +++ /dev/null @@ -1,13 +0,0 @@ -export type Runtime = { - name: string, - priority: number?, - is: () -> boolean, -} - -local function Runtime(x: Runtime) - return table.freeze(x) -end - -return table.freeze({ - Runtime = Runtime, -}) diff --git a/dist/wally/typecheckers/LICENSE.md b/dist/wally/typecheckers/LICENSE.md deleted file mode 100644 index f6610311..00000000 --- a/dist/wally/typecheckers/LICENSE.md +++ /dev/null @@ -1,355 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -### 1. Definitions - -**1.1. “Contributor”** - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -**1.2. “Contributor Version”** - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -**1.3. “Contribution”** - means Covered Software of a particular Contributor. - -**1.4. “Covered Software”** - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -**1.5. “Incompatible With Secondary Licenses”** - means - -* **(a)** that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or -* **(b)** that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -**1.6. “Executable Form”** - means any form of the work other than Source Code Form. - -**1.7. “Larger Work”** - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -**1.8. “License”** - means this document. - -**1.9. “Licensable”** - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -**1.10. “Modifications”** - means any of the following: - -* **(a)** any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or -* **(b)** any new file in Source Code Form that contains any Covered - Software. - -**1.11. “Patent Claims” of a Contributor** - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -**1.12. “Secondary License”** - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -**1.13. “Source Code Form”** - means the form of the work preferred for making modifications. - -**1.14. “You” (or “Your”)** - means an individual or a legal entity exercising rights under this - License. For legal entities, “You” includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, “control” means **(a)** the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or **(b)** ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - -### 2. License Grants and Conditions - -#### 2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -* **(a)** under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and -* **(b)** under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -#### 2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -#### 2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -* **(a)** for any code that a Contributor has removed from Covered Software; - or -* **(b)** for infringements caused by: **(i)** Your and any other third party's - modifications of Covered Software, or **(ii)** the combination of its - Contributions with other software (except as part of its Contributor - Version); or -* **(c)** under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -#### 2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -#### 2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -#### 2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -#### 2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - - -### 3. Responsibilities - -#### 3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -#### 3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -* **(a)** such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -* **(b)** You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -#### 3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -#### 3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -#### 3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - - -### 4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: **(a)** comply with -the terms of this License to the maximum extent possible; and **(b)** -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - - -### 5. Termination - -**5.1.** The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated **(a)** provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and **(b)** on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -**5.2.** If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -**5.3.** In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - - -### 6. Disclaimer of Warranty - -> Covered Software is provided under this License on an “as is” -> basis, without warranty of any kind, either expressed, implied, or -> statutory, including, without limitation, warranties that the -> Covered Software is free of defects, merchantable, fit for a -> particular purpose or non-infringing. The entire risk as to the -> quality and performance of the Covered Software is with You. -> Should any Covered Software prove defective in any respect, You -> (not any Contributor) assume the cost of any necessary servicing, -> repair, or correction. This disclaimer of warranty constitutes an -> essential part of this License. No use of any Covered Software is -> authorized under this License except under this disclaimer. - -### 7. Limitation of Liability - -> Under no circumstances and under no legal theory, whether tort -> (including negligence), contract, or otherwise, shall any -> Contributor, or anyone who distributes Covered Software as -> permitted above, be liable to You for any direct, indirect, -> special, incidental, or consequential damages of any character -> including, without limitation, damages for lost profits, loss of -> goodwill, work stoppage, computer failure or malfunction, or any -> and all other commercial damages or losses, even if such party -> shall have been informed of the possibility of such damages. This -> limitation of liability shall not apply to liability for death or -> personal injury resulting from such party's negligence to the -> extent applicable law prohibits such limitation. Some -> jurisdictions do not allow the exclusion or limitation of -> incidental or consequential damages, so this exclusion and -> limitation may not apply to You. - - -### 8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - - -### 9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - - -### 10. Versions of the License - -#### 10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -#### 10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -#### 10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -#### 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -## Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -## Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/dist/wally/typecheckers/Wally.toml b/dist/wally/typecheckers/Wally.toml deleted file mode 100644 index 4532c3e5..00000000 --- a/dist/wally/typecheckers/Wally.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -authors = ["Fire "] -description = "Typechecking primitives and compatibility for Prvd 'M Wrong" -homepage = "https://prvdmwrong.luau.page/latest/" -license = "MPL-2.0" -name = "prvdmwrong/typecheckers" -private = false -realm = "shared" -registry = "https://github.com/upliftgames/wally-index" -repository = "https://github.com/prvdmwrong/prvdmwrong" -version = "0.2.0-rc.4" - -[package.dependencies] diff --git a/dist/wally/typecheckers/src/init.luau b/dist/wally/typecheckers/src/init.luau deleted file mode 100644 index e69de29b..00000000 diff --git a/gh-assets/wordmark-dark.svg b/gh-assets/wordmark-dark.svg deleted file mode 100644 index d5454624..00000000 --- a/gh-assets/wordmark-dark.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/gh-assets/wordmark-light.svg b/gh-assets/wordmark-light.svg deleted file mode 100644 index b5d7c845..00000000 --- a/gh-assets/wordmark-light.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/dist/pesde/lune/lifecycles/src/create.luau b/lifecycles/create.luau similarity index 60% rename from dist/pesde/lune/lifecycles/src/create.luau rename to lifecycles/create.luau index 6cdd2891..b0319742 100644 --- a/dist/pesde/lune/lifecycles/src/create.luau +++ b/lifecycles/create.luau @@ -1,13 +1,13 @@ -local await = require("./methods/await") -local clear = require("./methods/unregister-all") -local destroy = require("./methods/destroy") -local lifecycleConstructed = require("./hooks/lifecycle-constructed") -local methodToLifecycles = require("./method-to-lifecycles") -local onRegistered = require("./methods/on-registered") -local onUnregistered = require("./methods/on-unregistered") -local register = require("./methods/register") -local types = require("./types") -local unregister = require("./methods/unregister") +local await = require "./methods/await" +local clear = require "./methods/unregister-all" +local destroy = require "./methods/destroy" +local lifecycleConstructed = require "./hooks/lifecycle-constructed" +local methodToLifecycles = require "./method-to-lifecycles" +local onRegistered = require "./methods/on-registered" +local onUnregistered = require "./methods/on-unregistered" +local register = require "./methods/register" +local types = require "./types" +local unregister = require "./methods/unregister" local function create( method: string, diff --git a/dist/pesde/luau/lifecycles/src/handlers/fire-concurrent.luau b/lifecycles/handlers/fire-concurrent.luau similarity index 73% rename from dist/pesde/luau/lifecycles/src/handlers/fire-concurrent.luau rename to lifecycles/handlers/fire-concurrent.luau index f279b888..4689b5c2 100644 --- a/dist/pesde/luau/lifecycles/src/handlers/fire-concurrent.luau +++ b/lifecycles/handlers/fire-concurrent.luau @@ -1,5 +1,5 @@ -local runtime = require("../../runtime") -local types = require("../types") +local runtime = require "../../runtime" +local types = require "../types" local function fireConcurrent(lifecycle: types.Lifecycle, ...: Args...) for _, callback in lifecycle.callbacks do diff --git a/dist/pesde/roblox/lifecycles/src/handlers/fire-sequential.luau b/lifecycles/handlers/fire-sequential.luau similarity index 84% rename from dist/pesde/roblox/lifecycles/src/handlers/fire-sequential.luau rename to lifecycles/handlers/fire-sequential.luau index 80911ad9..f2bcb593 100644 --- a/dist/pesde/roblox/lifecycles/src/handlers/fire-sequential.luau +++ b/lifecycles/handlers/fire-sequential.luau @@ -1,4 +1,4 @@ -local types = require("../types") +local types = require "../types" local function fireSequential(lifecycle: types.Lifecycle, ...: Args...) for _, callback in lifecycle.callbacks do diff --git a/dist/pesde/luau/lifecycles/src/hooks/lifecycle-constructed.luau b/lifecycles/hooks/lifecycle-constructed.luau similarity index 65% rename from dist/pesde/luau/lifecycles/src/hooks/lifecycle-constructed.luau rename to lifecycles/hooks/lifecycle-constructed.luau index 8ea4d81b..c534ae16 100644 --- a/dist/pesde/luau/lifecycles/src/hooks/lifecycle-constructed.luau +++ b/lifecycles/hooks/lifecycle-constructed.luau @@ -1,15 +1,13 @@ -local types = require("../types") +local types = require "../types" local callbacks: { (lifecycle: types.Lifecycle) -> () } = {} local function onLifecycleConstructed(listener: (lifecycle: types.Lifecycle) -> ()): () -> () table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end + return function() table.remove(callbacks, table.find(callbacks, listener)) end end -return table.freeze({ +return table.freeze { callbacks = callbacks, onLifecycleConstructed = onLifecycleConstructed, -}) +} diff --git a/dist/pesde/roblox/lifecycles/src/hooks/lifecycle-destroyed.luau b/lifecycles/hooks/lifecycle-destroyed.luau similarity index 65% rename from dist/pesde/roblox/lifecycles/src/hooks/lifecycle-destroyed.luau rename to lifecycles/hooks/lifecycle-destroyed.luau index 47abcfab..81fbab8b 100644 --- a/dist/pesde/roblox/lifecycles/src/hooks/lifecycle-destroyed.luau +++ b/lifecycles/hooks/lifecycle-destroyed.luau @@ -1,15 +1,13 @@ -local types = require("../types") +local types = require "../types" local callbacks: { (lifecycle: types.Lifecycle) -> () } = {} local function onLifecycleDestroyed(listener: (lifecycle: types.Lifecycle) -> ()): () -> () table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end + return function() table.remove(callbacks, table.find(callbacks, listener)) end end -return table.freeze({ +return table.freeze { callbacks = callbacks, onLifecycleDestroyed = onLifecycleDestroyed, -}) +} diff --git a/dist/pesde/roblox/lifecycles/src/hooks/lifecycle-registered.luau b/lifecycles/hooks/lifecycle-registered.luau similarity index 70% rename from dist/pesde/roblox/lifecycles/src/hooks/lifecycle-registered.luau rename to lifecycles/hooks/lifecycle-registered.luau index fab588a3..8ee76453 100644 --- a/dist/pesde/roblox/lifecycles/src/hooks/lifecycle-registered.luau +++ b/lifecycles/hooks/lifecycle-registered.luau @@ -1,4 +1,4 @@ -local types = require("../types") +local types = require "../types" local callbacks: { (lifecycle: types.Lifecycle, callback: (...unknown) -> ()) -> () } = {} @@ -9,12 +9,10 @@ local function onLifecycleRegistered( ) -> () ): () -> () table.insert(callbacks, listener :: any) - return function() - table.remove(callbacks, table.find(callbacks, listener :: any)) - end + return function() table.remove(callbacks, table.find(callbacks, listener :: any)) end end -return table.freeze({ +return table.freeze { callbacks = callbacks, onLifecycleRegistered = onLifecycleRegistered, -}) +} diff --git a/dist/pesde/lune/lifecycles/src/hooks/lifecycle-unregistered.luau b/lifecycles/hooks/lifecycle-unregistered.luau similarity index 71% rename from dist/pesde/lune/lifecycles/src/hooks/lifecycle-unregistered.luau rename to lifecycles/hooks/lifecycle-unregistered.luau index 0ec81756..e66f5afa 100644 --- a/dist/pesde/lune/lifecycles/src/hooks/lifecycle-unregistered.luau +++ b/lifecycles/hooks/lifecycle-unregistered.luau @@ -1,4 +1,4 @@ -local types = require("../types") +local types = require "../types" local callbacks: { (lifecycle: types.Lifecycle, callback: (...unknown) -> ()) -> () } = {} @@ -9,12 +9,10 @@ local function onLifecycleUnregistered( ) -> () ): () -> () table.insert(callbacks, listener :: any) - return function() - table.remove(callbacks, table.find(callbacks, listener :: any)) - end + return function() table.remove(callbacks, table.find(callbacks, listener :: any)) end end -return table.freeze({ +return table.freeze { callbacks = callbacks, onLifecycleUnregistered = onLifecycleUnregistered, -}) +} diff --git a/lifecycles/init.luau b/lifecycles/init.luau new file mode 100644 index 00000000..bc8a5abe --- /dev/null +++ b/lifecycles/init.luau @@ -0,0 +1,28 @@ +local create = require "@self/create" +local fireConcurrent = require "@self/handlers/fire-concurrent" +local fireSequential = require "@self/handlers/fire-sequential" +local lifecycleConstructed = require "@self/hooks/lifecycle-constructed" +local lifecycleDestroyed = require "@self/hooks/lifecycle-destroyed" +local lifecycleRegistered = require "@self/hooks/lifecycle-registered" +local lifecycleUnregistered = require "@self/hooks/lifecycle-unregistered" +local methodToLifecycles = require "@self/method-to-lifecycles" +local types = require "@self/types" + +export type Lifecycle = types.Lifecycle + +return table.freeze { + create = create, + handlers = table.freeze { + fireConcurrent = fireConcurrent, + fireSequential = fireSequential, + }, + hooks = table.freeze { + onLifecycleRegistered = lifecycleRegistered.onLifecycleRegistered, + onLifecycleUnregistered = lifecycleUnregistered.onLifecycleUnregistered, + onLifecycleConstructed = lifecycleConstructed.onLifecycleConstructed, + onLifecycleDestroyed = lifecycleDestroyed.onLifecycleDestroyed, + }, + _ = table.freeze { + methodToLifecycles = methodToLifecycles, + }, +} diff --git a/dist/npm/lifecycles/src/logger.luau b/lifecycles/logger.luau similarity index 76% rename from dist/npm/lifecycles/src/logger.luau rename to lifecycles/logger.luau index 3ae7c27e..3c9582ce 100644 --- a/dist/npm/lifecycles/src/logger.luau +++ b/lifecycles/logger.luau @@ -1,6 +1,6 @@ -local logger = require("../logger") +local logger = require "../logger" -return logger.create("@prvdmwrong/lifecycles", logger.standardErrorInfoUrl("lifecycles"), { +return logger.create("@prvdmwrong/lifecycles", logger.standardErrorInfoUrl "lifecycles", { useAfterDestroy = "Cannot use Lifecycle after it is destroyed.", alreadyDestroyed = "Cannot destroy an already destroyed Lifecycle.", }) diff --git a/dist/pesde/luau/lifecycles/src/method-to-lifecycles.luau b/lifecycles/method-to-lifecycles.luau similarity index 73% rename from dist/pesde/luau/lifecycles/src/method-to-lifecycles.luau rename to lifecycles/method-to-lifecycles.luau index 386a8756..bcdc62b2 100644 --- a/dist/pesde/luau/lifecycles/src/method-to-lifecycles.luau +++ b/lifecycles/method-to-lifecycles.luau @@ -1,4 +1,4 @@ -local types = require("./types") +local types = require "./types" local methodToLifecycles: { [string]: { types.Lifecycle } } = {} diff --git a/dist/pesde/luau/lifecycles/src/methods/await.luau b/lifecycles/methods/await.luau similarity index 64% rename from dist/pesde/luau/lifecycles/src/methods/await.luau rename to lifecycles/methods/await.luau index ed8299d6..c521c0f9 100644 --- a/dist/pesde/luau/lifecycles/src/methods/await.luau +++ b/lifecycles/methods/await.luau @@ -1,10 +1,8 @@ -local logger = require("../logger") -local types = require("../types") +local logger = require "../logger" +local types = require "../types" local function await(lifecycle: types.Self): Args... - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end + if lifecycle._isDestroyed then logger:fatalError { template = logger.useAfterDestroy } end local currentThread = coroutine.running() local function callback(...: Args...) lifecycle:unregister(callback) diff --git a/dist/pesde/luau/lifecycles/src/methods/destroy.luau b/lifecycles/methods/destroy.luau similarity index 53% rename from dist/pesde/luau/lifecycles/src/methods/destroy.luau rename to lifecycles/methods/destroy.luau index d9d5d6cc..9af7d656 100644 --- a/dist/pesde/luau/lifecycles/src/methods/destroy.luau +++ b/lifecycles/methods/destroy.luau @@ -1,12 +1,10 @@ -local lifecycleDestroyed = require("../hooks/lifecycle-destroyed") -local logger = require("../logger") -local methodToLifecycles = require("../method-to-lifecycles") -local types = require("../types") +local lifecycleDestroyed = require "../hooks/lifecycle-destroyed" +local logger = require "../logger" +local methodToLifecycles = require "../method-to-lifecycles" +local types = require "../types" local function destroy(lifecycle: types.Self) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.alreadyDestroyed }) - end + if lifecycle._isDestroyed then logger:fatalError { template = logger.alreadyDestroyed } end table.remove(methodToLifecycles[lifecycle.method], table.find(methodToLifecycles[lifecycle.method], lifecycle)) table.clear(lifecycle.callbacks) for _, callback in lifecycleDestroyed.callbacks do diff --git a/dist/pesde/luau/lifecycles/src/methods/on-registered.luau b/lifecycles/methods/on-registered.luau similarity index 54% rename from dist/pesde/luau/lifecycles/src/methods/on-registered.luau rename to lifecycles/methods/on-registered.luau index 7ddb009a..421c153d 100644 --- a/dist/pesde/luau/lifecycles/src/methods/on-registered.luau +++ b/lifecycles/methods/on-registered.luau @@ -1,17 +1,13 @@ -local logger = require("../logger") -local types = require("../types") +local logger = require "../logger" +local types = require "../types" local function onRegistered(lifecycle: types.Self, listener: (callback: (Args...) -> ()) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end + if lifecycle._isDestroyed then logger:fatalError { template = logger.useAfterDestroy } end if _G.PRVDMWRONG_DISALLOW_MULTIPLE_LISTENERS then table.remove(lifecycle._selfRegistered, table.find(lifecycle._selfRegistered, listener)) end table.insert(lifecycle._selfRegistered, listener) - return function() - table.remove(lifecycle._selfRegistered, table.find(lifecycle._selfRegistered, listener)) - end + return function() table.remove(lifecycle._selfRegistered, table.find(lifecycle._selfRegistered, listener)) end end return onRegistered diff --git a/dist/pesde/lune/lifecycles/src/methods/on-unregistered.luau b/lifecycles/methods/on-unregistered.luau similarity index 54% rename from dist/pesde/lune/lifecycles/src/methods/on-unregistered.luau rename to lifecycles/methods/on-unregistered.luau index 842040ec..d1193017 100644 --- a/dist/pesde/lune/lifecycles/src/methods/on-unregistered.luau +++ b/lifecycles/methods/on-unregistered.luau @@ -1,17 +1,13 @@ -local logger = require("../logger") -local types = require("../types") +local logger = require "../logger" +local types = require "../types" local function onUnregistered(lifecycle: types.Self, listener: (callback: (Args...) -> ()) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end + if lifecycle._isDestroyed then logger:fatalError { template = logger.useAfterDestroy } end if _G.PRVDMWRONG_DISALLOW_MULTIPLE_LISTENERS then table.remove(lifecycle._selfUnregistered, table.find(lifecycle._selfUnregistered, listener)) end table.insert(lifecycle._selfUnregistered, listener) - return function() - table.remove(lifecycle._selfUnregistered, table.find(lifecycle._selfUnregistered, listener)) - end + return function() table.remove(lifecycle._selfUnregistered, table.find(lifecycle._selfUnregistered, listener)) end end return onUnregistered diff --git a/dist/pesde/roblox/lifecycles/src/methods/register.luau b/lifecycles/methods/register.luau similarity index 65% rename from dist/pesde/roblox/lifecycles/src/methods/register.luau rename to lifecycles/methods/register.luau index 3fd74d56..b57cef34 100644 --- a/dist/pesde/roblox/lifecycles/src/methods/register.luau +++ b/lifecycles/methods/register.luau @@ -1,13 +1,11 @@ -local logger = require("../logger") -local runtime = require("../../runtime") -local types = require("../types") +local logger = require "../logger" +local runtime = require "../../runtime" +local types = require "../types" local threadpool = runtime.threadpool local function register(lifecycle: types.Self, callback: (Args...) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end + if lifecycle._isDestroyed then logger:fatalError { template = logger.useAfterDestroy } end if _G.PRVDMWRONG_DISALLOW_MULTIPLE_LISTENERS then table.remove(lifecycle.callbacks, table.find(lifecycle.callbacks, callback)) end diff --git a/dist/pesde/roblox/lifecycles/src/methods/unregister-all.luau b/lifecycles/methods/unregister-all.luau similarity index 56% rename from dist/pesde/roblox/lifecycles/src/methods/unregister-all.luau rename to lifecycles/methods/unregister-all.luau index 5e6235af..0b4025f9 100644 --- a/dist/pesde/roblox/lifecycles/src/methods/unregister-all.luau +++ b/lifecycles/methods/unregister-all.luau @@ -1,13 +1,11 @@ -local logger = require("../logger") -local runtime = require("../../runtime") -local types = require("../types") +local logger = require "../logger" +local runtime = require "../../runtime" +local types = require "../types" local threadpool = runtime.threadpool local function clear(lifecycle: types.Self) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end + if lifecycle._isDestroyed then logger:fatalError { template = logger.useAfterDestroy } end for _, callback in lifecycle.callbacks do threadpool.spawnCallbacks(lifecycle._selfUnregistered, callback) end diff --git a/dist/pesde/lune/lifecycles/src/methods/unregister.luau b/lifecycles/methods/unregister.luau similarity index 62% rename from dist/pesde/lune/lifecycles/src/methods/unregister.luau rename to lifecycles/methods/unregister.luau index 0ca7223f..8e33ed75 100644 --- a/dist/pesde/lune/lifecycles/src/methods/unregister.luau +++ b/lifecycles/methods/unregister.luau @@ -1,13 +1,11 @@ -local logger = require("../logger") -local runtime = require("../../runtime") -local types = require("../types") +local logger = require "../logger" +local runtime = require "../../runtime" +local types = require "../types" local threadpool = runtime.threadpool local function unregister(lifecycle: types.Self, callback: (Args...) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end + if lifecycle._isDestroyed then logger:fatalError { template = logger.useAfterDestroy } end local index = table.find(lifecycle.callbacks, callback) if index then table.remove(lifecycle.callbacks, index) diff --git a/dist/npm/lifecycles/src/types.luau b/lifecycles/types.luau similarity index 100% rename from dist/npm/lifecycles/src/types.luau rename to lifecycles/types.luau diff --git a/dist/pesde/luau/logger/src/allow-web-links.luau b/logger/allow-web-links.luau similarity index 77% rename from dist/pesde/luau/logger/src/allow-web-links.luau rename to logger/allow-web-links.luau index dcd0bb82..dbc24d41 100644 --- a/dist/pesde/luau/logger/src/allow-web-links.luau +++ b/logger/allow-web-links.luau @@ -1,4 +1,4 @@ -local runtime = require("../runtime") +local runtime = require "../runtime" local allowWebLinks = if runtime.name == "roblox" then game:GetService("RunService"):IsStudio() else true diff --git a/logger/create.luau b/logger/create.luau new file mode 100644 index 00000000..f0a01f6e --- /dev/null +++ b/logger/create.luau @@ -0,0 +1,26 @@ +local allowWebLinks = require "./allow-web-links" +local formatLog = require "./format-log" +local runtime = require "../runtime" +local types = require "./types" + +local warn = runtime.warn +local threadpool = runtime.threadpool + +local function create(label: string, errorInfoUrl: string?, templates: T): types.Logger + local self = {} :: types.Logger + self.type = "Logger" + + label = `[{label}] ` + errorInfoUrl = if allowWebLinks then errorInfoUrl else nil + + function self:warn(log) warn(label .. formatLog(self, log, errorInfoUrl)) end + + function self:error(log) threadpool.spawn(error, label .. formatLog(self, log, errorInfoUrl), 0) end + + function self:fatalError(log) error(label .. formatLog(self, log, errorInfoUrl)) end + + setmetatable(self :: any, { __index = templates }) + return self +end + +return create diff --git a/dist/pesde/lune/logger/src/format-log.luau b/logger/format-log.luau similarity index 96% rename from dist/pesde/lune/logger/src/format-log.luau rename to logger/format-log.luau index 3eeda21b..7c998deb 100644 --- a/dist/pesde/lune/logger/src/format-log.luau +++ b/logger/format-log.luau @@ -1,4 +1,4 @@ -local types = require("./types") +local types = require "./types" local function formatLog(self: types.Logger, log: types.Log, errorInfoUrl: string?): string local formattedTemplate = string.format(log.template, table.unpack(log)) diff --git a/logger/init.luau b/logger/init.luau new file mode 100644 index 00000000..a1ff2070 --- /dev/null +++ b/logger/init.luau @@ -0,0 +1,18 @@ +local allowWebLinks = require "@self/allow-web-links" +local create = require "@self/create" +local formatLog = require "@self/format-log" +local parseError = require "@self/parse-error" +local standardErrorInfoUrl = require "@self/standard-error-info-url" +local types = require "@self/types" + +export type Logger = types.Logger +export type Log = types.Log +export type Error = types.Error + +return table.freeze { + create = create, + formatLog = formatLog, + parseError = parseError, + allowWebLinks = allowWebLinks, + standardErrorInfoUrl = standardErrorInfoUrl, +} diff --git a/dist/pesde/luau/logger/src/parse-error.luau b/logger/parse-error.luau similarity index 85% rename from dist/pesde/luau/logger/src/parse-error.luau rename to logger/parse-error.luau index e43fe53d..a08a1cb9 100644 --- a/dist/pesde/luau/logger/src/parse-error.luau +++ b/logger/parse-error.luau @@ -1,4 +1,4 @@ -local types = require("./types") +local types = require "./types" local function parseError(err: string): types.Error return { diff --git a/dist/npm/logger/src/standard-error-info-url.luau b/logger/standard-error-info-url.luau similarity index 100% rename from dist/npm/logger/src/standard-error-info-url.luau rename to logger/standard-error-info-url.luau diff --git a/dist/npm/logger/src/types.luau b/logger/types.luau similarity index 100% rename from dist/npm/logger/src/types.luau rename to logger/types.luau diff --git a/lune/run-example.luau b/lune/run-example.luau deleted file mode 100644 index e69de29b..00000000 diff --git a/lune/tiniest.luau b/lune/tiniest.luau deleted file mode 100644 index e69de29b..00000000 diff --git a/package.json b/package.json deleted file mode 100644 index 38c80717..00000000 --- a/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "private": true, - "files": [ - "**/out", - "!**/*.tsbuildinfo" - ], - "prettier": { - "printWidth": 120, - "tabWidth": 4, - "useTabs": true, - "endOfLine": "lf" - }, - "devDependencies": { - "@rbxts/compiler-types": "1.2.3-types.1", - "@rbxts/types": "1.0.543", - "@typescript-eslint/eslint-plugin": "5.1.0", - "@typescript-eslint/parser": "5.1.0", - "eslint": "8.1.0", - "eslint-config-prettier": "8.3.0", - "eslint-plugin-prettier": "4.0.0", - "eslint-plugin-roblox-ts": "0.0.32", - "prettier": "2.4.1", - "typescript": "4.4.4" - } -} \ No newline at end of file diff --git a/packages/dependencies/depend.luau b/packages/dependencies/depend.luau deleted file mode 100644 index 55230b4e..00000000 --- a/packages/dependencies/depend.luau +++ /dev/null @@ -1,30 +0,0 @@ -local logger = require("./logger") -local types = require("./types") - -local function useBeforeConstructed(unresolved: types.UnresolvedDependency) - logger:fatalError({ template = logger.useBeforeConstructed, unresolved.dependency.name or "subdependency" }) -end - -local unresolvedMt = { - __metatable = "This metatable is locked.", - __index = useBeforeConstructed, - __newindex = useBeforeConstructed, -} - -function unresolvedMt:__tostring() - return "UnresolvedDependency" -end - --- Wtf luau -local function depend(dependency: types.Dependency): typeof(({} :: types.Dependency).new( - (nil :: any) :: Dependencies, - ... -)) - -- Return a mock value that will be resolved during dependency resolution. - return setmetatable({ - type = "UnresolvedDependency", - dependency = dependency, - }, unresolvedMt) :: any -end - -return depend diff --git a/packages/dependencies/index.d.ts b/packages/dependencies/index.d.ts deleted file mode 100644 index a5bddcde..00000000 --- a/packages/dependencies/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Lifecycle } from "../lifecycles"; - -declare namespace dependencies { - export type Dependency = Self & { - dependencies: Dependencies, - priority?: number, - new(dependencies: Dependencies, ...args: NewArgs): Dependency; - }; - - interface ProccessDependencyResult { - sortedDependencies: Dependency[]; - lifecycles: Lifecycle[]; - } - - export type SubdependenciesOf = T extends { dependencies: infer Dependencies } - ? Dependencies - : never; - - export function depend InstanceType>(dependency: T): InstanceType; - export function processDependencies(dependencies: Set>): ProccessDependencyResult; - export function sortByPriority(dependencies: Dependency[]): void; -} - -export = dependencies; -export as namespace dependencies; diff --git a/packages/dependencies/init.luau b/packages/dependencies/init.luau deleted file mode 100644 index e6b27b24..00000000 --- a/packages/dependencies/init.luau +++ /dev/null @@ -1,12 +0,0 @@ -local depend = require("@self/depend") -local processDependencies = require("@self/process-dependencies") -local sortByPriority = require("@self/sort-by-priority") -local types = require("@self/types") - -export type Dependency = types.Dependency - -return table.freeze({ - depend = depend, - processDependencies = processDependencies, - sortByPriority = sortByPriority, -}) diff --git a/packages/dependencies/logger.luau b/packages/dependencies/logger.luau deleted file mode 100644 index 22f3b307..00000000 --- a/packages/dependencies/logger.luau +++ /dev/null @@ -1,7 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/dependencies", logger.standardErrorInfoUrl("dependencies"), { - useBeforeConstructed = "Cannot use %s before it is constructed. Are you using the dependency outside a class method?", - alreadyDestroyed = "Cannot destroy an already destroyed Root.", - alreadyFinished = "Root has already finished.", -}) diff --git a/packages/dependencies/process-dependencies.luau b/packages/dependencies/process-dependencies.luau deleted file mode 100644 index 20820a35..00000000 --- a/packages/dependencies/process-dependencies.luau +++ /dev/null @@ -1,57 +0,0 @@ -local lifecycles = require("../lifecycles") -local types = require("./types") - -export type ProccessDependencyResult = { - sortedDependencies: { types.Dependency }, - lifecycles: { lifecycles.Lifecycle }, -} - -type Set = { [T]: true } - -local function processDependencies(dependencies: Set>): ProccessDependencyResult - local sortedDependencies = {} - local lifecycles = {} - - -- TODO: optimize ts - local function visitDependency(dependency: types.Dependency) - -- print("Visiting dependency", dependency) - - for key, value in dependency :: any do - if key == "dependencies" then - -- print("Checking [prvd.dependencies]") - if typeof(value) == "table" then - for key, value in value do - -- print("Checking key", key, "value", value) - if typeof(value) == "table" and value.type == "UnresolvedDependency" then - local unresolved: types.UnresolvedDependency = value - -- print("Got unresolved dependency", unresolved.dependency, "visiting") - visitDependency(unresolved.dependency) - end - end - end - - continue - end - - if typeof(value) == "table" and value.type == "Lifecycle" and not table.find(lifecycles, value) then - table.insert(lifecycles, value) - end - end - - if dependencies[dependency] and not table.find(sortedDependencies, dependency) then - -- print("Pushing to sort") - table.insert(sortedDependencies, dependency) - end - end - - for dependency in dependencies do - visitDependency(dependency) - end - - return { - sortedDependencies = sortedDependencies, - lifecycles = lifecycles, - } -end - -return processDependencies diff --git a/packages/dependencies/process-dependencies.spec.luau b/packages/dependencies/process-dependencies.spec.luau deleted file mode 100644 index 0fcfcac8..00000000 --- a/packages/dependencies/process-dependencies.spec.luau +++ /dev/null @@ -1,67 +0,0 @@ -local depend = require("./depend") -local processDependencies = require("./process-dependencies") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - -local function nickname(name: string) - return function(tbl: T): T - return setmetatable(tbl :: any, { - __tostring = function() - return name - end, - }) - end -end - -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("processDependencies", function() - test("sortedDependencies", function() - local first = nickname("first")({}) - - local second = nickname("second")({ - dependencies = { - toFirst = depend(first :: any), - toFirstAgain = depend(first :: any), - }, - }) - - local third = nickname("third")({ - dependencies = { - toSecond = depend(second :: any), - }, - }) - - local fourth = nickname("fourth")({ - dependencies = { - toFirst = depend(first :: any), - toSecond = depend(second :: any), - toThird = depend(third :: any), - }, - }) - - local processed = processDependencies({ - [first] = true, - [second] = true, - [third] = true, - [fourth] = true, - } :: any) - - expect(typeof(processed)).is("table") - expect(processed).has_key("sortedDependencies") - expect(typeof(processed.sortedDependencies)).is("table") - - local sortedDependencies = processed.sortedDependencies - - expect(typeof(sortedDependencies)).is("table") - expect(sortedDependencies[1]).is(first) - expect(sortedDependencies[2]).is(second) - expect(sortedDependencies[3]).is(third) - expect(sortedDependencies[4]).is(fourth) - end) - - test("lifecycles", function() end) - end) -end diff --git a/packages/dependencies/prvd.config.luau b/packages/dependencies/prvd.config.luau deleted file mode 100644 index f265b2db..00000000 --- a/packages/dependencies/prvd.config.luau +++ /dev/null @@ -1,15 +0,0 @@ -local configure = require("@lune-lib/configure") - -return configure.package({ - name = "dependencies", - description = "Dependency resolution logic for Prvd 'M Wrong", - - types = table.freeze({ - ["Dependency"] = "Dependency", - }), - - dependencies = configure.dependencies({ - lifecycles = true, - logger = true, - }), -}) diff --git a/packages/dependencies/sort-by-priority.luau b/packages/dependencies/sort-by-priority.luau deleted file mode 100644 index 638468ab..00000000 --- a/packages/dependencies/sort-by-priority.luau +++ /dev/null @@ -1,14 +0,0 @@ -local types = require("./types") - -local function sortByPriority(dependencies: { types.Dependency }) - table.sort(dependencies, function(left: any, right: any) - if left.priority ~= right.priority then - return (left.priority or 1) > (right.priority or 1) - end - local leftIndex = table.find(dependencies, left) - local rightIndex = table.find(dependencies, right) - return leftIndex < rightIndex - end) -end - -return sortByPriority diff --git a/packages/dependencies/sort-by-priority.spec.luau b/packages/dependencies/sort-by-priority.spec.luau deleted file mode 100644 index eeb34933..00000000 --- a/packages/dependencies/sort-by-priority.spec.luau +++ /dev/null @@ -1,52 +0,0 @@ -local sortByPriority = require("./sort-by-priority") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("sortByPriority", function() - test("dependencies", function() - local first = {} - - local second = { - toFirst = first, - } - - local third = { - toSecond = second, - } - - local sortedDependencies = { - first, - second, - third, - } - - sortByPriority(sortedDependencies :: any) - - expect(sortedDependencies[1]).is(first) - expect(sortedDependencies[2]).is(second) - expect(sortedDependencies[3]).is(third) - end) - - test("priority", function() - local low = {} - - local high = { - priority = 500, - } - - local sortedDependencies = { - low, - high, - } - - sortByPriority(sortedDependencies :: any) - - expect(sortedDependencies[1]).is(high) - expect(sortedDependencies[2]).is(low) - end) - end) -end diff --git a/packages/dependencies/types.luau b/packages/dependencies/types.luau deleted file mode 100644 index 2b1c72aa..00000000 --- a/packages/dependencies/types.luau +++ /dev/null @@ -1,14 +0,0 @@ -export type Dependency = Self & { - dependencies: Dependencies, - priority: number?, - new: (dependencies: Dependencies, NewArgs...) -> Dependency, -} - -export type UnresolvedDependency = { - type: "UnresolvedDependency", - dependency: Dependency, -} - -export type dependencies = { __prvdmwrong_dependencies: never } - -return nil diff --git a/packages/lifecycles/create.luau b/packages/lifecycles/create.luau deleted file mode 100644 index 6cdd2891..00000000 --- a/packages/lifecycles/create.luau +++ /dev/null @@ -1,45 +0,0 @@ -local await = require("./methods/await") -local clear = require("./methods/unregister-all") -local destroy = require("./methods/destroy") -local lifecycleConstructed = require("./hooks/lifecycle-constructed") -local methodToLifecycles = require("./method-to-lifecycles") -local onRegistered = require("./methods/on-registered") -local onUnregistered = require("./methods/on-unregistered") -local register = require("./methods/register") -local types = require("./types") -local unregister = require("./methods/unregister") - -local function create( - method: string, - onFire: (lifecycle: types.Lifecycle, Args...) -> () -): types.Lifecycle - local self: types.Self = { - _isDestroyed = false, - _selfRegistered = {}, - _selfUnregistered = {}, - - type = "Lifecycle", - callbacks = {}, - - fire = onFire, - method = method, - register = register, - unregister = unregister, - clear = clear, - onRegistered = onRegistered, - onUnregistered = onUnregistered, - await = await, - destroy = destroy, - } :: any - - methodToLifecycles[method] = methodToLifecycles[method] or {} - table.insert(methodToLifecycles[method], self) - - for _, onLifecycleConstructed in lifecycleConstructed.callbacks do - onLifecycleConstructed(self :: types.Lifecycle) - end - - return self -end - -return create diff --git a/packages/lifecycles/handlers/fire-concurrent.luau b/packages/lifecycles/handlers/fire-concurrent.luau deleted file mode 100644 index f279b888..00000000 --- a/packages/lifecycles/handlers/fire-concurrent.luau +++ /dev/null @@ -1,10 +0,0 @@ -local runtime = require("../../runtime") -local types = require("../types") - -local function fireConcurrent(lifecycle: types.Lifecycle, ...: Args...) - for _, callback in lifecycle.callbacks do - runtime.threadpool.spawn(callback, ...) - end -end - -return fireConcurrent diff --git a/packages/lifecycles/handlers/fire-sequential.luau b/packages/lifecycles/handlers/fire-sequential.luau deleted file mode 100644 index 80911ad9..00000000 --- a/packages/lifecycles/handlers/fire-sequential.luau +++ /dev/null @@ -1,9 +0,0 @@ -local types = require("../types") - -local function fireSequential(lifecycle: types.Lifecycle, ...: Args...) - for _, callback in lifecycle.callbacks do - callback(...) - end -end - -return fireSequential diff --git a/packages/lifecycles/hooks/lifecycle-constructed.luau b/packages/lifecycles/hooks/lifecycle-constructed.luau deleted file mode 100644 index 8ea4d81b..00000000 --- a/packages/lifecycles/hooks/lifecycle-constructed.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (lifecycle: types.Lifecycle) -> () } = {} - -local function onLifecycleConstructed(listener: (lifecycle: types.Lifecycle) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleConstructed = onLifecycleConstructed, -}) diff --git a/packages/lifecycles/hooks/lifecycle-destroyed.luau b/packages/lifecycles/hooks/lifecycle-destroyed.luau deleted file mode 100644 index 47abcfab..00000000 --- a/packages/lifecycles/hooks/lifecycle-destroyed.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (lifecycle: types.Lifecycle) -> () } = {} - -local function onLifecycleDestroyed(listener: (lifecycle: types.Lifecycle) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleDestroyed = onLifecycleDestroyed, -}) diff --git a/packages/lifecycles/hooks/lifecycle-registered.luau b/packages/lifecycles/hooks/lifecycle-registered.luau deleted file mode 100644 index fab588a3..00000000 --- a/packages/lifecycles/hooks/lifecycle-registered.luau +++ /dev/null @@ -1,20 +0,0 @@ -local types = require("../types") - -local callbacks: { (lifecycle: types.Lifecycle, callback: (...unknown) -> ()) -> () } = {} - -local function onLifecycleRegistered( - listener: ( - lifecycle: types.Lifecycle, - callback: (Args...) -> () - ) -> () -): () -> () - table.insert(callbacks, listener :: any) - return function() - table.remove(callbacks, table.find(callbacks, listener :: any)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleRegistered = onLifecycleRegistered, -}) diff --git a/packages/lifecycles/hooks/lifecycle-unregistered.luau b/packages/lifecycles/hooks/lifecycle-unregistered.luau deleted file mode 100644 index 0ec81756..00000000 --- a/packages/lifecycles/hooks/lifecycle-unregistered.luau +++ /dev/null @@ -1,20 +0,0 @@ -local types = require("../types") - -local callbacks: { (lifecycle: types.Lifecycle, callback: (...unknown) -> ()) -> () } = {} - -local function onLifecycleUnregistered( - listener: ( - lifecycle: types.Lifecycle, - callback: (Args...) -> () - ) -> () -): () -> () - table.insert(callbacks, listener :: any) - return function() - table.remove(callbacks, table.find(callbacks, listener :: any)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleUnregistered = onLifecycleUnregistered, -}) diff --git a/packages/lifecycles/index.d.ts b/packages/lifecycles/index.d.ts deleted file mode 100644 index 0e5f324b..00000000 --- a/packages/lifecycles/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -declare namespace lifecycles { - export interface Lifecycle { - type: "Lifecycle"; - - callbacks: Array<(...args: Args) => void>; - method: string; - - register(callback: (...args: Args) => void): void; - fire(...args: Args): void; - unregister(callback: (...args: Args) => void): void; - clear(): void; - onRegistered(listener: (callback: (...args: Args) => void) => void): () => void; - onUnegistered(listener: (callback: (...args: Args) => void) => void): () => void; - await(): LuaTuple; - destroy(): void; - } - - export function create( - method: string, - onFire: (lifecycle: Lifecycle, ...args: Args) => void - ): Lifecycle; - - export namespace handlers { - export function fireConcurrent(lifecycle: Lifecycle, ...args: Args): void; - export function fireSequential(lifecycle: Lifecycle, ...args: Args): void; - } - - export namespace hooks { - export function onLifecycleConstructed(callback: (lifecycle: Lifecycle) => void): () => void; - export function onLifecycleDestroyed(callback: (lifecycle: Lifecycle) => void): () => void; - export function onLifecycleRegistered( - callback: (lifecycle: Lifecycle, callback: (...args: Args) => void) => void - ): () => void; - export function onLifecycleUnregistered( - callback: (lifecycle: Lifecycle, callback: (...args: Args) => void) => void - ): () => void; - } - - export namespace _ { - export const methodToLifecycles: Map; - } -} - -export = lifecycles; -export as namespace lifecycles; diff --git a/packages/lifecycles/init.luau b/packages/lifecycles/init.luau deleted file mode 100644 index dbec091b..00000000 --- a/packages/lifecycles/init.luau +++ /dev/null @@ -1,28 +0,0 @@ -local create = require("@self/create") -local fireConcurrent = require("@self/handlers/fire-concurrent") -local fireSequential = require("@self/handlers/fire-sequential") -local lifecycleConstructed = require("@self/hooks/lifecycle-constructed") -local lifecycleDestroyed = require("@self/hooks/lifecycle-destroyed") -local lifecycleRegistered = require("@self/hooks/lifecycle-registered") -local lifecycleUnregistered = require("@self/hooks/lifecycle-unregistered") -local methodToLifecycles = require("@self/method-to-lifecycles") -local types = require("@self/types") - -export type Lifecycle = types.Lifecycle - -return table.freeze({ - create = create, - handlers = table.freeze({ - fireConcurrent = fireConcurrent, - fireSequential = fireSequential, - }), - hooks = table.freeze({ - onLifecycleRegistered = lifecycleRegistered.onLifecycleRegistered, - onLifecycleUnregistered = lifecycleUnregistered.onLifecycleUnregistered, - onLifecycleConstructed = lifecycleConstructed.onLifecycleConstructed, - onLifecycleDestroyed = lifecycleDestroyed.onLifecycleDestroyed, - }), - _ = table.freeze({ - methodToLifecycles = methodToLifecycles, - }), -}) diff --git a/packages/lifecycles/logger.luau b/packages/lifecycles/logger.luau deleted file mode 100644 index 3ae7c27e..00000000 --- a/packages/lifecycles/logger.luau +++ /dev/null @@ -1,6 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/lifecycles", logger.standardErrorInfoUrl("lifecycles"), { - useAfterDestroy = "Cannot use Lifecycle after it is destroyed.", - alreadyDestroyed = "Cannot destroy an already destroyed Lifecycle.", -}) diff --git a/packages/lifecycles/method-to-lifecycles.luau b/packages/lifecycles/method-to-lifecycles.luau deleted file mode 100644 index 386a8756..00000000 --- a/packages/lifecycles/method-to-lifecycles.luau +++ /dev/null @@ -1,5 +0,0 @@ -local types = require("./types") - -local methodToLifecycles: { [string]: { types.Lifecycle } } = {} - -return methodToLifecycles diff --git a/packages/lifecycles/methods/await.luau b/packages/lifecycles/methods/await.luau deleted file mode 100644 index ed8299d6..00000000 --- a/packages/lifecycles/methods/await.luau +++ /dev/null @@ -1,17 +0,0 @@ -local logger = require("../logger") -local types = require("../types") - -local function await(lifecycle: types.Self): Args... - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - local currentThread = coroutine.running() - local function callback(...: Args...) - lifecycle:unregister(callback) - coroutine.resume(currentThread, ...) - end - lifecycle:register(callback) - return coroutine.yield() -end - -return await diff --git a/packages/lifecycles/methods/destroy.luau b/packages/lifecycles/methods/destroy.luau deleted file mode 100644 index d9d5d6cc..00000000 --- a/packages/lifecycles/methods/destroy.luau +++ /dev/null @@ -1,18 +0,0 @@ -local lifecycleDestroyed = require("../hooks/lifecycle-destroyed") -local logger = require("../logger") -local methodToLifecycles = require("../method-to-lifecycles") -local types = require("../types") - -local function destroy(lifecycle: types.Self) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.alreadyDestroyed }) - end - table.remove(methodToLifecycles[lifecycle.method], table.find(methodToLifecycles[lifecycle.method], lifecycle)) - table.clear(lifecycle.callbacks) - for _, callback in lifecycleDestroyed.callbacks do - callback(lifecycle) - end - lifecycle._isDestroyed = true -end - -return destroy diff --git a/packages/lifecycles/methods/on-registered.luau b/packages/lifecycles/methods/on-registered.luau deleted file mode 100644 index 7ddb009a..00000000 --- a/packages/lifecycles/methods/on-registered.luau +++ /dev/null @@ -1,17 +0,0 @@ -local logger = require("../logger") -local types = require("../types") - -local function onRegistered(lifecycle: types.Self, listener: (callback: (Args...) -> ()) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - if _G.PRVDMWRONG_DISALLOW_MULTIPLE_LISTENERS then - table.remove(lifecycle._selfRegistered, table.find(lifecycle._selfRegistered, listener)) - end - table.insert(lifecycle._selfRegistered, listener) - return function() - table.remove(lifecycle._selfRegistered, table.find(lifecycle._selfRegistered, listener)) - end -end - -return onRegistered diff --git a/packages/lifecycles/methods/on-unregistered.luau b/packages/lifecycles/methods/on-unregistered.luau deleted file mode 100644 index 842040ec..00000000 --- a/packages/lifecycles/methods/on-unregistered.luau +++ /dev/null @@ -1,17 +0,0 @@ -local logger = require("../logger") -local types = require("../types") - -local function onUnregistered(lifecycle: types.Self, listener: (callback: (Args...) -> ()) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - if _G.PRVDMWRONG_DISALLOW_MULTIPLE_LISTENERS then - table.remove(lifecycle._selfUnregistered, table.find(lifecycle._selfUnregistered, listener)) - end - table.insert(lifecycle._selfUnregistered, listener) - return function() - table.remove(lifecycle._selfUnregistered, table.find(lifecycle._selfUnregistered, listener)) - end -end - -return onUnregistered diff --git a/packages/lifecycles/methods/register.luau b/packages/lifecycles/methods/register.luau deleted file mode 100644 index 3fd74d56..00000000 --- a/packages/lifecycles/methods/register.luau +++ /dev/null @@ -1,18 +0,0 @@ -local logger = require("../logger") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function register(lifecycle: types.Self, callback: (Args...) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - if _G.PRVDMWRONG_DISALLOW_MULTIPLE_LISTENERS then - table.remove(lifecycle.callbacks, table.find(lifecycle.callbacks, callback)) - end - table.insert(lifecycle.callbacks, callback) - threadpool.spawnCallbacks(lifecycle._selfRegistered, callback) -end - -return register diff --git a/packages/lifecycles/methods/unregister-all.luau b/packages/lifecycles/methods/unregister-all.luau deleted file mode 100644 index 5e6235af..00000000 --- a/packages/lifecycles/methods/unregister-all.luau +++ /dev/null @@ -1,17 +0,0 @@ -local logger = require("../logger") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function clear(lifecycle: types.Self) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - for _, callback in lifecycle.callbacks do - threadpool.spawnCallbacks(lifecycle._selfUnregistered, callback) - end - table.clear(lifecycle.callbacks) -end - -return clear diff --git a/packages/lifecycles/methods/unregister.luau b/packages/lifecycles/methods/unregister.luau deleted file mode 100644 index 0ca7223f..00000000 --- a/packages/lifecycles/methods/unregister.luau +++ /dev/null @@ -1,18 +0,0 @@ -local logger = require("../logger") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function unregister(lifecycle: types.Self, callback: (Args...) -> ()) - if lifecycle._isDestroyed then - logger:fatalError({ template = logger.useAfterDestroy }) - end - local index = table.find(lifecycle.callbacks, callback) - if index then - table.remove(lifecycle.callbacks, index) - threadpool.spawnCallbacks(lifecycle._selfUnregistered, callback) - end -end - -return unregister diff --git a/packages/lifecycles/prvd.config.luau b/packages/lifecycles/prvd.config.luau deleted file mode 100644 index fc83a55e..00000000 --- a/packages/lifecycles/prvd.config.luau +++ /dev/null @@ -1,15 +0,0 @@ -local configure = require("@lune-lib/configure") - -return configure.package({ - name = "lifecycles", - description = "Provider method lifecycles implementation for Prvd 'M Wrong", - - dependencies = configure.dependencies({ - logger = true, - runtime = true, - }), - - types = { - ["Lifecycle"] = "Lifecycle", - }, -}) diff --git a/packages/lifecycles/types.luau b/packages/lifecycles/types.luau deleted file mode 100644 index f2931b52..00000000 --- a/packages/lifecycles/types.luau +++ /dev/null @@ -1,23 +0,0 @@ -export type Lifecycle = { - type: "Lifecycle", - - callbacks: { (Args...) -> () }, - method: string, - - register: (self: Lifecycle, callback: (Args...) -> ()) -> (), - fire: (self: Lifecycle, Args...) -> (), - unregister: (self: Lifecycle, callback: (Args...) -> ()) -> (), - clear: (self: Lifecycle) -> (), - onRegistered: (self: Lifecycle, listener: (callback: (Args...) -> ()) -> ()) -> () -> (), - onUnregistered: (self: Lifecycle, listener: (callback: (Args...) -> ()) -> ()) -> () -> (), - await: (self: Lifecycle) -> Args..., - destroy: (self: Lifecycle) -> (), -} - -export type Self = Lifecycle & { - _isDestroyed: boolean, - _selfRegistered: { (callback: (Args...) -> ()) -> () }, - _selfUnregistered: { (callback: (Args...) -> ()) -> () }, -} - -return nil diff --git a/packages/logger/allow-web-links.luau b/packages/logger/allow-web-links.luau deleted file mode 100644 index dcd0bb82..00000000 --- a/packages/logger/allow-web-links.luau +++ /dev/null @@ -1,5 +0,0 @@ -local runtime = require("../runtime") - -local allowWebLinks = if runtime.name == "roblox" then game:GetService("RunService"):IsStudio() else true - -return allowWebLinks diff --git a/packages/logger/create.luau b/packages/logger/create.luau deleted file mode 100644 index 943aab25..00000000 --- a/packages/logger/create.luau +++ /dev/null @@ -1,32 +0,0 @@ -local allowWebLinks = require("./allow-web-links") -local formatLog = require("./format-log") -local runtime = require("../runtime") -local types = require("./types") - -local task = runtime.task -local warn = runtime.warn - -local function create(label: string, errorInfoUrl: string?, templates: T): types.Logger - local self = {} :: types.Logger - self.type = "Logger" - - label = `[{label}] ` - errorInfoUrl = if allowWebLinks then errorInfoUrl else nil - - function self:warn(log) - warn(label .. formatLog(self, log, errorInfoUrl)) - end - - function self:error(log) - task.spawn(error, label .. formatLog(self, log, errorInfoUrl), 0) - end - - function self:fatalError(log) - error(label .. formatLog(self, log, errorInfoUrl)) - end - - setmetatable(self :: any, { __index = templates }) - return self -end - -return create diff --git a/packages/logger/format-log.luau b/packages/logger/format-log.luau deleted file mode 100644 index 3eeda21b..00000000 --- a/packages/logger/format-log.luau +++ /dev/null @@ -1,43 +0,0 @@ -local types = require("./types") - -local function formatLog(self: types.Logger, log: types.Log, errorInfoUrl: string?): string - local formattedTemplate = string.format(log.template, table.unpack(log)) - - local error = log.error - local trace: string? = log.trace - - if error then - trace = error.trace - formattedTemplate = string.gsub(formattedTemplate, "ERROR_MESSAGE", error.message) - end - - local id: string? - - -- TODO: find a better way to do ts while still being ergonomic - for templateKey, template in (self :: any) :: { [string]: string } do - if template == log.template then - id = templateKey - break - end - end - - if id then - formattedTemplate ..= `\nID: {id}` - end - - if errorInfoUrl then - formattedTemplate ..= `\nLearn more: {errorInfoUrl}` - if id then - formattedTemplate ..= `#{string.lower(id)}` - end - end - - if trace then - formattedTemplate ..= `\n---- Stack trace ----\n{trace}` - end - - -- Labels are added from createLogger, so we don't add it here - return string.gsub(formattedTemplate, "\n", "\n ") -end - -return formatLog diff --git a/packages/logger/index.d.ts b/packages/logger/index.d.ts deleted file mode 100644 index 85251a07..00000000 --- a/packages/logger/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -declare namespace Logger { - export interface Error { - type: "Error"; - raw: string; - message: string; - trace: string; - } - - interface LogProps { - template: string; - error?: Error; - trace?: string; - } - - export type Log = LogProps & unknown[]; - - interface LoggerProps { - print(props: Log): void; - warn(props: Log): void; - error(props: Log): void; - fatalError(props: Log): never; - } - - export type Logger> = LoggerProps & Templates; - - export function create>( - label: string, - errorInfoUrl: string | undefined, - templates: Templates - ): Logger; - - export function formatLog>( - logger: Logger, - log: Log, - errorInfoUrl?: string - ): string; - - export function parseError(err: string): Error; - - export const allowWebLinks: boolean; - export function standardErrorInfoUrl(label: string): string; -} - -export = Logger; -export as namespace Logger; diff --git a/packages/logger/init.luau b/packages/logger/init.luau deleted file mode 100644 index 52760a5d..00000000 --- a/packages/logger/init.luau +++ /dev/null @@ -1,18 +0,0 @@ -local allowWebLinks = require("@self/allow-web-links") -local create = require("@self/create") -local formatLog = require("@self/format-log") -local parseError = require("@self/parse-error") -local standardErrorInfoUrl = require("@self/standard-error-info-url") -local types = require("@self/types") - -export type Logger = types.Logger -export type Log = types.Log -export type Error = types.Error - -return table.freeze({ - create = create, - formatLog = formatLog, - parseError = parseError, - allowWebLinks = allowWebLinks, - standardErrorInfoUrl = standardErrorInfoUrl, -}) diff --git a/packages/logger/parse-error.luau b/packages/logger/parse-error.luau deleted file mode 100644 index e43fe53d..00000000 --- a/packages/logger/parse-error.luau +++ /dev/null @@ -1,12 +0,0 @@ -local types = require("./types") - -local function parseError(err: string): types.Error - return { - type = "Error", - raw = err, - message = err:gsub("^.+:%d+:%s*", ""), - trace = debug.traceback(nil, 2), - } -end - -return parseError diff --git a/packages/logger/prvd.config.luau b/packages/logger/prvd.config.luau deleted file mode 100644 index 11c071ba..00000000 --- a/packages/logger/prvd.config.luau +++ /dev/null @@ -1,16 +0,0 @@ -local configure = require("@lune-lib/configure") - -return configure.package({ - name = "logger", - description = "Logging for Prvd 'M Wrong", - - dependencies = configure.dependencies({ - runtime = true, - }), - - types = { - ["Logger"] = true, - Log = true, - Error = true, - }, -}) diff --git a/packages/logger/standard-error-info-url.luau b/packages/logger/standard-error-info-url.luau deleted file mode 100644 index 345faf36..00000000 --- a/packages/logger/standard-error-info-url.luau +++ /dev/null @@ -1,5 +0,0 @@ -local function standardErrorInfoUrl(label: string): string - return `https://prvdmwrong.luau.page/api-reference/{label}/errors` -end - -return standardErrorInfoUrl diff --git a/packages/logger/types.luau b/packages/logger/types.luau deleted file mode 100644 index d1699037..00000000 --- a/packages/logger/types.luau +++ /dev/null @@ -1,23 +0,0 @@ -export type Error = { - type: "Error", - raw: string, - message: string, - trace: string, -} - -export type Log = { - template: string, - error: Error?, - trace: string?, - [number]: unknown, -} - -export type Logger = Templates & { - type: "Logger", - print: (self: Logger, props: Log) -> (), - warn: (self: Logger, props: Log) -> (), - error: (self: Logger, props: Log) -> (), - fatalError: (self: Logger, props: Log) -> never, -} - -return nil diff --git a/packages/providers/README.md b/packages/providers/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/providers/create.luau b/packages/providers/create.luau deleted file mode 100644 index 016b8a6d..00000000 --- a/packages/providers/create.luau +++ /dev/null @@ -1,30 +0,0 @@ -local nameOf = require("./name-of") -local providerClasses = require("./provider-classes") -local types = require("./types") - -local function createProvider(self: Self): types.Provider - local provider: types.Provider = self :: any - - if provider.__index == nil then - provider.__index = provider - end - - if provider.__tostring == nil then - provider.__tostring = nameOf - end - - if provider.new == nil then - function provider.new(dependencies) - local self: types.Provider = setmetatable({}, provider) :: any - if provider.constructor then - return provider.constructor(self, dependencies) or self - end - return self - end - end - - providerClasses[provider] = true - return provider -end - -return createProvider diff --git a/packages/providers/index.d.ts b/packages/providers/index.d.ts deleted file mode 100644 index 2ab36e15..00000000 --- a/packages/providers/index.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { Dependency } from "../dependencies"; - -declare namespace providers { - export type Provider = Dependency< - Self & { - __index: Provider; - name?: string; - constructor?(dependencies: Dependencies): void; - start?(): void; - destroy?(): void; - }, - Dependencies - >; - - // Class decorator syntax - export function create InstanceType>(self: Self): Provider; - // Normal syntax - export function create(self: Self): Provider; - - export function nameOf(provider: Provider): string; - - export namespace _ { - export const providerClasses: Set>; - } - - export interface Start { - start(): void; - } - - export interface Destroy { - destroy(): void; - } -} - -export = providers; -export as namespace providers; diff --git a/packages/providers/init.luau b/packages/providers/init.luau deleted file mode 100644 index d678d850..00000000 --- a/packages/providers/init.luau +++ /dev/null @@ -1,16 +0,0 @@ -local create = require("@self/create") -local nameOf = require("@self/name-of") -local providerClasses = require("@self/provider-classes") -local types = require("@self/types") - -export type Provider = types.Provider - -local providers = table.freeze({ - create = create, - nameOf = nameOf, - _ = table.freeze({ - providerClasses = providerClasses, - }), -}) - -return providers diff --git a/packages/providers/name-of.luau b/packages/providers/name-of.luau deleted file mode 100644 index 3f86ceec..00000000 --- a/packages/providers/name-of.luau +++ /dev/null @@ -1,7 +0,0 @@ -local types = require("./types") - -local function nameOf(provider: types.Provider) - return provider.name or "Provider" -end - -return nameOf diff --git a/packages/providers/provider-classes.luau b/packages/providers/provider-classes.luau deleted file mode 100644 index cc57922f..00000000 --- a/packages/providers/provider-classes.luau +++ /dev/null @@ -1,7 +0,0 @@ -local types = require("./types") - -type Set = { [T]: true } - -local providerClasses: Set> = setmetatable({}, { __mode = "k" }) :: any - -return providerClasses diff --git a/packages/providers/prvd.config.luau b/packages/providers/prvd.config.luau deleted file mode 100644 index 5d8b602f..00000000 --- a/packages/providers/prvd.config.luau +++ /dev/null @@ -1,17 +0,0 @@ -local configure = require("@lune-lib/configure") - -return configure.package({ - name = "providers", - description = "Provider creation for Prvd 'M Wrong", - - types = { - ["Provider"] = "Provider", - }, - - dependencies = configure.dependencies({ - dependencies = true, - logger = true, - lifecycles = true, - runtime = true, - }), -}) diff --git a/packages/providers/types.luau b/packages/providers/types.luau deleted file mode 100644 index 4f4d4dc9..00000000 --- a/packages/providers/types.luau +++ /dev/null @@ -1,12 +0,0 @@ -local dependencies = require("../dependencies") - -export type Provider = dependencies.Dependency, - __tostring: (self: Provider) -> string, - name: string?, - constructor: ((self: Provider, dependencies: Dependencies) -> ())?, - start: (self: Provider) -> ()?, - destroy: (self: Provider) -> ()?, -}, Dependencies> - -return nil diff --git a/packages/prvdmwrong/index.d.ts b/packages/prvdmwrong/index.d.ts deleted file mode 100644 index 2058129c..00000000 --- a/packages/prvdmwrong/index.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import dependencies from "../dependencies"; -import lifecycles from "../lifecycles"; -import providers from "../providers"; -import roots from "../roots"; - -declare namespace prvd { - export type Provider = providers.Provider; - export interface Lifecycle extends lifecycles.Lifecycle { } - export type SubdependenciesOf = dependencies.SubdependenciesOf; - export interface Root extends roots.Root { } - export interface StartedRoot extends roots.StartedRoot { } - - export interface Start extends providers.Start { } - export interface Destroy extends providers.Destroy { } - - export const provider: typeof providers.create; - export const root: typeof roots.create; - export const depend: typeof dependencies.depend; - export const nameOf: typeof providers.nameOf; - - export const lifecycle: typeof lifecycles.create; - export const fireConcurrent: typeof lifecycles.handlers.fireConcurrent; - export const fireSequential: typeof lifecycles.handlers.fireSequential; - - export namespace hooks { - export const onLifecycleConstructed: typeof lifecycles.hooks.onLifecycleConstructed; - export const onLifecycleDestroyed: typeof lifecycles.hooks.onLifecycleDestroyed; - export const onLifecycleRegistered: typeof lifecycles.hooks.onLifecycleRegistered; - export const onLifecycleUnregistered: typeof lifecycles.hooks.onLifecycleUnregistered; - - export const onLifecycleUsed: typeof roots.hooks.onLifecycleUsed; - export const onProviderUsed: typeof roots.hooks.onProviderUsed; - export const onRootUsed: typeof roots.hooks.onRootUsed; - export const onRootConstructing: typeof roots.hooks.onRootConstructing; - export const onRootStarted: typeof roots.hooks.onRootStarted; - export const onRootFinished: typeof roots.hooks.onRootFinished; - export const onRootDestroyed: typeof roots.hooks.onRootDestroyed; - } -} - -export = prvd; -export as namespace prvd; diff --git a/packages/prvdmwrong/init.luau b/packages/prvdmwrong/init.luau deleted file mode 100644 index 1381801d..00000000 --- a/packages/prvdmwrong/init.luau +++ /dev/null @@ -1,45 +0,0 @@ -local dependencies = require("./dependencies") -local lifecycles = require("./lifecycles") -local providers = require("./providers") -local roots = require("./roots") - -export type Provider = providers.Provider -export type Lifecycle = lifecycles.Lifecycle -export type Root = roots.Root -export type StartedRoot = roots.StartedRoot - -local prvd = { - provider = providers.create, - root = roots.create, - depend = dependencies.depend, - nameOf = providers.nameOf, - - lifecycle = lifecycles.create, - fireConcurrent = lifecycles.handlers.fireConcurrent, - fireSequential = lifecycles.handlers.fireSequential, - - hooks = table.freeze({ - onProviderUsed = roots.hooks.onProviderUsed, - onLifecycleUsed = roots.hooks.onLifecycleUsed, - onRootConstructing = roots.hooks.onRootConstructing, - onRootUsed = roots.hooks.onRootUsed, - onRootStarted = roots.hooks.onRootStarted, - onRootFinished = roots.hooks.onRootFinished, - onRootDestroyed = roots.hooks.onRootDestroyed, - - onLifecycleConstructed = lifecycles.hooks.onLifecycleConstructed, - onLifecycleDestroyed = lifecycles.hooks.onLifecycleDestroyed, - onLifecycleRegistered = lifecycles.hooks.onLifecycleRegistered, - onLifecycleUnregistered = lifecycles.hooks.onLifecycleUnregistered, - }), -} - -type PrvdModule = ((provider: Self) -> Provider) & typeof(prvd) - -local mt = {} -function mt.__call(_, provider: Self): providers.Provider - return providers.create(provider) :: any -end - -local module: PrvdModule = setmetatable(prvd, mt) :: any -return module diff --git a/packages/prvdmwrong/prvd.config.luau b/packages/prvdmwrong/prvd.config.luau deleted file mode 100644 index b094986a..00000000 --- a/packages/prvdmwrong/prvd.config.luau +++ /dev/null @@ -1,20 +0,0 @@ -local configure = require("@lune-lib/configure") - -return configure.package({ - name = "prvdmwrong", - description = "Entry point to Prvd 'M Wrong", - - types = { - ["Lifecycle"] = "Lifecycle", - ["Provider"] = "Provider", - Root = true, - StartedRoot = true, - }, - - dependencies = configure.dependencies({ - dependencies = true, - lifecycles = true, - providers = true, - roots = true, - }), -}) diff --git a/packages/rbx-components/component-classes.luau b/packages/rbx-components/component-classes.luau deleted file mode 100644 index 0dcdb30a..00000000 --- a/packages/rbx-components/component-classes.luau +++ /dev/null @@ -1,7 +0,0 @@ -local types = require("./types") - -type Set = { [T]: true } - -local componentClasses: Set> = setmetatable({}, { __mode = "k" }) :: any - -return componentClasses diff --git a/packages/rbx-components/component-provider.luau b/packages/rbx-components/component-provider.luau deleted file mode 100644 index 85af0d0d..00000000 --- a/packages/rbx-components/component-provider.luau +++ /dev/null @@ -1,185 +0,0 @@ -local CollectionService = game:GetService("CollectionService") - -local componentClasses = require("./component-classes") -local logger = require("./logger") -local providers = require("../providers") -local runtime = require("../runtime") -local types = require("./types") - -local threadpool = runtime.threadpool - -type Set = { [T]: true } -type ConstructedComponent = types.AnyComponent -type LuauBug = any - -local ComponentProvider = {} -ComponentProvider.priority = -math.huge -ComponentProvider.name = "@rbx-components" - -function ComponentProvider.constructor(self: ComponentProvider) - self.componentClasses = {} :: Set - self.tagToComponentClasses = {} :: { [string]: Set } - self.instanceToComponents = {} :: { [Instance]: { [types.AnyComponent]: ConstructedComponent } } - self.componentToInstances = {} :: { [types.AnyComponent]: Set? } - self.constructedToClass = {} :: { [ConstructedComponent]: types.AnyComponent? } - - self._destroyingConnections = {} :: { [Instance]: RBXScriptConnection } - self._connections = {} :: { RBXScriptConnection } -end - -function ComponentProvider.start(self: ComponentProvider) - for tag, components in self.tagToComponentClasses do - local function onTagAdded(instance) - local instanceToComponents = self.instanceToComponents[instance] - if not instanceToComponents then - instanceToComponents = {} - self.instanceToComponents[instance] = instanceToComponents - end - - for componentClass in components do - if - (componentClass.blacklistInstances and (componentClass.blacklistInstances :: LuauBug)[instance]) - or (componentClass.whitelistInstances and not (componentClass.whitelistInstances :: LuauBug)[instance]) - or (componentClass.instanceCheck and not componentClass.instanceCheck(instance)) - then - continue - end - - local component: ConstructedComponent = instanceToComponents[componentClass] - if not component then - component = componentClass.new(instance) - instanceToComponents[componentClass] = component - self.constructedToClass[component :: any] = componentClass - end - - if component.added then - component:added() - end - end - - if not self._destroyingConnections[instance] then - self._destroyingConnections[instance] = instance.Destroying:Once(function() - for _, component in instanceToComponents do - if component.destroy then - threadpool.spawn(component.destroy, component) - end - end - table.clear(instanceToComponents) - self.instanceToComponents[instance] = nil - end) - end - end - - table.insert(self._connections, CollectionService:GetInstanceAddedSignal(tag):Connect(onTagAdded)) - table.insert(self._connections, CollectionService:GetInstanceRemovedSignal(tag):Connect(function(instance) end)) - - for _, instance in CollectionService:GetTagged(tag) do - onTagAdded(instance) - end - end -end - -function ComponentProvider.destroy(self: ComponentProvider) - for _, components in self.instanceToComponents do - for _, component in components do - if component.destroy then - component:destroy() - end - end - table.clear(components) - end - - table.clear(self.componentClasses) - table.clear(self.tagToComponentClasses) - table.clear(self.instanceToComponents) - table.clear(self.componentToInstances) - table.clear(self.constructedToClass) - - for _, connection in self._connections do - if connection.Connected then - connection:Disconnect() - end - end - - for _, connection in self._destroyingConnections do - if connection.Connected then - connection:Disconnect() - end - end - - table.clear(self._connections) - table.clear(self._destroyingConnections) -end - -function ComponentProvider.addComponentClass(self: ComponentProvider, class: types.AnyComponent) - if not componentClasses[class] then - logger:fatalError({ template = logger.invalidComponent }) - end - - if self.componentClasses[class] then - logger:fatalError({ template = logger.alreadyRegisteredComponent }) - end - - if class.tag then - local tagToComponentClasses = self.tagToComponentClasses[class.tag] - - if tagToComponentClasses then - if not _G.PRVDMWRONG_SUPPRESS_MULTIPLE_SAME_TAG and #tagToComponentClasses > 0 then - logger:warn({ template = logger.multipleSameTag, class.tag }) - end - else - tagToComponentClasses = {} - self.tagToComponentClasses[class.tag] = tagToComponentClasses - end - - (tagToComponentClasses :: any)[class] = true - end - - self.componentClasses[class] = true - self.componentToInstances[class] = {} -end - -function ComponentProvider.getFromInstance( - self: ComponentProvider, - class: types.Component, - instance: I -): types.Component? - return self.instanceToComponents[instance :: any][class] -end - -function ComponentProvider.getAllComponents( - self: ComponentProvider, - class: types.Component -): Set> - local result = {} - for _, components in self.instanceToComponents do - for _, component in components do - if self.constructedToClass[component] == class then - result[component] = true - end - end - end - return result :: any -end - -function ComponentProvider.addComponent( - self: ComponentProvider, - class: types.Component, - instance: I -): types.Component? - error("not yet implemented") -end - -function ComponentProvider.removeComponent(self: ComponentProvider, class: types.Component, instance: I) - local constructed = self:getFromInstance(class, instance) - if constructed then - self.instanceToComponents[instance :: any][class] = nil - - if constructed.removed then - threadpool.spawn(constructed.removed :: any, constructed, instance) - end - end -end - -export type ComponentProvider = typeof(ComponentProvider) -return providers.create(ComponentProvider) diff --git a/packages/rbx-components/create.luau b/packages/rbx-components/create.luau deleted file mode 100644 index 24d39a3b..00000000 --- a/packages/rbx-components/create.luau +++ /dev/null @@ -1,28 +0,0 @@ -local componentClasses = require("./component-classes") -local types = require("./types") - --- TODO: prvdmwrong/classes package? -local function create(self: Self): types.Component - local component: types.Component = self :: any - - if component.__index == nil then - component.__index = component - end - - -- TODO: abstract nameOf - - if component.new == nil then - function component.new(instance: any) - local self: types.Component = setmetatable({}, component) :: any - if component.constructor then - return component.constructor(self, instance) or self - end - return self - end - end - - componentClasses[component] = true - return component -end - -return create diff --git a/packages/rbx-components/extend-root/create-component-class-provider.luau b/packages/rbx-components/extend-root/create-component-class-provider.luau deleted file mode 100644 index 9d5ae999..00000000 --- a/packages/rbx-components/extend-root/create-component-class-provider.luau +++ /dev/null @@ -1,31 +0,0 @@ -local ComponentProvider = require("../component-provider") -local providers = require("../../providers") -local types = require("../types") - -local ComponentClassProvider = {} -ComponentClassProvider.priority = -math.huge -ComponentClassProvider.name = "@rbx-components.ComponentClassProvider" -ComponentClassProvider.dependencies = table.freeze({ - componentProvider = ComponentProvider, -}) - -ComponentClassProvider._components = {} :: { types.AnyComponent } - -function ComponentClassProvider.constructor( - self: ComponentClassProvider, - dependencies: typeof(ComponentClassProvider.dependencies) -) - for _, class in self._components do - dependencies.componentProvider:addComponentClass(class) - end -end - -export type ComponentClassProvider = typeof(ComponentClassProvider) - -local function createComponentClassProvider(components: { types.AnyComponent }) - local provider = table.clone(ComponentClassProvider) - provider._components = components - return providers.create(provider) -end - -return createComponentClassProvider diff --git a/packages/rbx-components/extend-root/init.luau b/packages/rbx-components/extend-root/init.luau deleted file mode 100644 index 6e9f0578..00000000 --- a/packages/rbx-components/extend-root/init.luau +++ /dev/null @@ -1,30 +0,0 @@ -local ComponentProvider = require("./component-provider") -local createComponentClassProvider = require("@self/create-component-class-provider") -local logger = require("./logger") -local roots = require("../roots") -local types = require("./types") -local useComponent = require("@self/use-component") -local useComponents = require("@self/use-components") -local useModuleAsComponent = require("@self/use-module-as-component") -local useModulesAsComponents = require("@self/use-modules-as-components") - -local function extendRoot(root: types.RootPrivate): types.Root - if root._hasComponentExtensions then - return logger:fatalError({ template = logger.alreadyExtendedRoot }) - end - - root._hasComponentExtensions = true - root._classes = {} - - root:useProvider(ComponentProvider) - root:useProvider(createComponentClassProvider(root._classes)) - - root.useComponent = useComponent :: any - root.useComponents = useComponents :: any - root.useModuleAsComponent = useModuleAsComponent :: any - root.useModulesAsComponents = useModulesAsComponents :: any - - return root -end - -return extendRoot :: (root: roots.Root) -> types.Root diff --git a/packages/rbx-components/extend-root/use-component.luau b/packages/rbx-components/extend-root/use-component.luau deleted file mode 100644 index b0bd8d1f..00000000 --- a/packages/rbx-components/extend-root/use-component.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -local function useComponent(root: types.RootPrivate, component: types.AnyComponent) - table.insert(root._classes, component) - return root -end - -return useComponent diff --git a/packages/rbx-components/extend-root/use-components.luau b/packages/rbx-components/extend-root/use-components.luau deleted file mode 100644 index 809a4006..00000000 --- a/packages/rbx-components/extend-root/use-components.luau +++ /dev/null @@ -1,10 +0,0 @@ -local types = require("../types") - -local function useComponents(root: types.RootPrivate, components: { types.AnyComponent }) - for index = 1, #components do - table.insert(root._classes, components[index]) - end - return root -end - -return useComponents diff --git a/packages/rbx-components/extend-root/use-module-as-component.luau b/packages/rbx-components/extend-root/use-module-as-component.luau deleted file mode 100644 index 46724fe7..00000000 --- a/packages/rbx-components/extend-root/use-module-as-component.luau +++ /dev/null @@ -1,12 +0,0 @@ -local componentClasses = require("../component-classes") -local types = require("../types") - -local function useModuleAsComponent(root: types.RootPrivate, module: ModuleScript) - local required = (require)(module) - if componentClasses[required] then - table.insert(root, required) - end - return root -end - -return useModuleAsComponent diff --git a/packages/rbx-components/extend-root/use-modules-as-components.luau b/packages/rbx-components/extend-root/use-modules-as-components.luau deleted file mode 100644 index bababafa..00000000 --- a/packages/rbx-components/extend-root/use-modules-as-components.luau +++ /dev/null @@ -1,28 +0,0 @@ -local componentClasses = require("../component-classes") -local types = require("../types") - -local function useModulesAsComponents( - root: types.RootPrivate, - modules: { Instance }, - predicate: ((ModuleScript) -> boolean)? -) - for index = 1, #modules do - local module = modules[index] - - if not module:IsA("ModuleScript") then - continue - end - - if predicate and not predicate(module) then - continue - end - - local required = (require)(module) - if componentClasses[required] then - table.insert(root, required) - end - end - return root -end - -return useModulesAsComponents diff --git a/packages/rbx-components/init.luau b/packages/rbx-components/init.luau deleted file mode 100644 index 598bcea4..00000000 --- a/packages/rbx-components/init.luau +++ /dev/null @@ -1,24 +0,0 @@ -local componentClasses = require("@self/component-classes") -local create = require("@self/create") -local extendRoot = require("@self/extend-root") -local types = require("@self/types") - -export type Component = types.Component -export type Root = types.Root - -local components = { - create = create, - extendRoot = extendRoot, - _ = table.freeze({ - componentClasses = componentClasses, - }), -} - -local mt = {} - -function mt.__call(_, component: Self): types.Component - return create(component) -end - -table.freeze(mt) -return table.freeze(setmetatable(components, mt)) diff --git a/packages/rbx-components/logger.luau b/packages/rbx-components/logger.luau deleted file mode 100644 index edcc7fac..00000000 --- a/packages/rbx-components/logger.luau +++ /dev/null @@ -1,8 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/rbx-components", logger.standardErrorInfoUrl("rbx-components"), { - alreadyExtendedRoot = "Root already has component extension.", - invalidComponent = "Not a component, create one with `components(MyComponent)` or `components.create(MyComponent)`.", - alreadyRegisteredComponent = "Component already registered.", - multipleSameTag = "Multiple components use the CollectionService tag '%s', which is likely a mistake. Supress this warning with `_G.PRVDMWRONG_SUPPRESS_MULTIPLE_SAME_TAG = true`.", -}) diff --git a/packages/rbx-components/prvd.config.luau b/packages/rbx-components/prvd.config.luau deleted file mode 100644 index 7d6f179c..00000000 --- a/packages/rbx-components/prvd.config.luau +++ /dev/null @@ -1,15 +0,0 @@ -local configure = require("@lune-lib/configure") - -return configure.package({ - name = "rbx-components", - description = "Component functionality for Prvd 'M Wrong", - - unreleased = true, - - dependencies = configure.dependencies({ - logger = true, - roots = true, - providers = true, - dependencies = true, - }), -}) diff --git a/packages/rbx-components/types.luau b/packages/rbx-components/types.luau deleted file mode 100644 index 5bc17dcf..00000000 --- a/packages/rbx-components/types.luau +++ /dev/null @@ -1,30 +0,0 @@ -local dependencies = require("../dependencies") -local roots = require("../roots") - -export type Component = dependencies.Dependency, - tag: string?, - instanceCheck: (unknown) -> boolean, - blacklistInstances: { Instance }?, - whitelistInstances: { Instance }?, - constructor: (self: Component, instance: Instance) -> ()?, - added: (self: Component) -> ()?, - removed: (self: Component) -> ()?, - destroyed: (self: Component) -> ()?, -}, nil, Instance> - -export type Root = roots.Root & { - useModuleAsComponent: (root: Root, module: ModuleScript) -> Root, - useModulesAsComponents: (root: Root, modules: { Instance }, predicate: ((ModuleScript) -> boolean)?) -> Root, - useComponent: (root: Root, component: Component) -> Root, - useComponents: (root: Root, components: { Component }) -> Root, -} - -export type RootPrivate = Root & { - _hasComponentExtensions: true?, - _classes: { Component }, -} - -export type AnyComponent = Component - -return nil diff --git a/packages/rbx-lifecycles/index.d.ts b/packages/rbx-lifecycles/index.d.ts deleted file mode 100644 index 3ad36447..00000000 --- a/packages/rbx-lifecycles/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Lifecycle } from "../lifecycles"; -import { Provider } from "../providers"; - -declare namespace RbxLifecycles { - export const RbxLifecycles: Provider<{ - preSimulation: Lifecycle<[dt: number]>; - postSimulation: Lifecycle<[dt: number]>; - preAnimation: Lifecycle<[dt: number]>; - preRender: Lifecycle<[dt: number]>; - playerAdded: Lifecycle<[player: Player]>; - playerRemoving: Lifecycle<[player: Player]>; - }>; - - export interface PreSimulation { - preSimulation(dt: number): void; - } - - export interface PostSimulation { - postSimulation(dt: number): void; - } - - export interface PreAnimation { - preAnimation(dt: number): void; - } - - export interface PreRender { - preRender(dt: number): void; - } - - export interface PlayerAdded { - playerAdded(player: Player): void; - } - - export interface PlayerRemoving { - playerRemoving(player: Player): void; - } -} - -export = RbxLifecycles; -export as namespace RbxLifecycles; diff --git a/packages/rbx-lifecycles/init.luau b/packages/rbx-lifecycles/init.luau deleted file mode 100644 index c1243680..00000000 --- a/packages/rbx-lifecycles/init.luau +++ /dev/null @@ -1,67 +0,0 @@ -local Players = game:GetService("Players") -local RunService = game:GetService("RunService") - -local prvd = require("./prvdmwrong") - -local fireConcurrent = prvd.fireConcurrent - -local RbxLifecycles = {} -RbxLifecycles.name = "@prvdmwrong/rbx-lifecycles" -RbxLifecycles.priority = -math.huge - -RbxLifecycles.preSimulation = prvd.lifecycle("preSimulation", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.postSimulation = prvd.lifecycle("postSimulation", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.preAnimation = prvd.lifecycle("preAnimation", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.preRender = prvd.lifecycle("preRender", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.playerAdded = prvd.lifecycle("playerAdded", fireConcurrent) :: prvd.Lifecycle -RbxLifecycles.playerRemoving = prvd.lifecycle("playerRemoving", fireConcurrent) :: prvd.Lifecycle - -local function wrapLifecycle(lifecycle: prvd.Lifecycle<...unknown>) - return function(...: unknown) - lifecycle:fire(...) - end -end - -function RbxLifecycles.constructor(self: RbxLifecycles) - self.connections = {} :: { RBXScriptConnection } - - self:_addConnections( - RunService.PreSimulation:Connect(wrapLifecycle(RbxLifecycles.preSimulation :: any)), - RunService.PostSimulation:Connect(wrapLifecycle(RbxLifecycles.postSimulation :: any)), - RunService.PreAnimation:Connect(wrapLifecycle(RbxLifecycles.preAnimation :: any)) - ) - - if RunService:IsClient() then - self:_addConnections(RunService.PreRender:Connect(wrapLifecycle(RbxLifecycles.preRender :: any))) - end - - self:_addConnections( - Players.PlayerAdded:Connect(wrapLifecycle(RbxLifecycles.playerAdded :: any)), - Players.PlayerRemoving:Connect(wrapLifecycle(RbxLifecycles.playerRemoving :: any)) - ) -end - -function RbxLifecycles.finish(self: RbxLifecycles) - for _, connection in self.connections do - if connection.Connected then - connection:Disconnect() - end - end - table.clear(self.connections) -end - -function RbxLifecycles._addConnections(self: RbxLifecycles, ...: RBXScriptConnection) - for index = 1, select("#", ...) do - table.insert(self.connections, select(index, ...) :: any) - end -end - --- Needed so typescript can require the provider as: --- --- ```ts --- import { RbxLifecycles } from "@rbxts/rbx-lifecycles" --- ``` -RbxLifecycles.RbxLifecycles = RbxLifecycles - -export type RbxLifecycles = typeof(RbxLifecycles) -return prvd(RbxLifecycles) diff --git a/packages/rbx-lifecycles/prvd.config.luau b/packages/rbx-lifecycles/prvd.config.luau deleted file mode 100644 index 5f590508..00000000 --- a/packages/rbx-lifecycles/prvd.config.luau +++ /dev/null @@ -1,14 +0,0 @@ -local configure = require("@lune-lib/configure") - -return configure.package({ - name = "rbx-lifecycles", - description = "Lifecycles implementations for Roblox", - - pesdeTargets = { - roblox = true, - }, - - dependencies = configure.dependencies({ - prvdmwrong = true, - }), -}) diff --git a/packages/roots/create.luau b/packages/roots/create.luau deleted file mode 100644 index 26c14f4e..00000000 --- a/packages/roots/create.luau +++ /dev/null @@ -1,47 +0,0 @@ -local destroy = require("./methods/destroy") -local lifecycles = require("../lifecycles") -local rootConstructing = require("./hooks/root-constructing") -local start = require("./methods/start") -local types = require("./types") -local useModule = require("./methods/use-module") -local useModules = require("./methods/use-modules") -local useProvider = require("./methods/use-provider") -local useProviders = require("./methods/use-providers") -local useRoot = require("./methods/use-root") -local useRoots = require("./methods/use-roots") -local willFinish = require("./methods/will-finish") -local willStart = require("./methods/will-start") - -local function create(): types.Root - local self: types.Self = { - type = "Root", - - start = start, - - useProvider = useProvider, - useProviders = useProviders, - useModule = useModule, - useModules = useModules, - useRoot = useRoot, - useRoots = useRoots, - destroy = destroy, - - willStart = willStart, - willFinish = willFinish, - - _destroyed = false, - _rootProviders = {}, - _rootLifecycles = {}, - _subRoots = {}, - _start = lifecycles.create("start", lifecycles.handlers.fireConcurrent), - _finish = lifecycles.create("destroy", lifecycles.handlers.fireSequential), - } :: any - - for _, callback in rootConstructing.callbacks do - callback(self) - end - - return self -end - -return create diff --git a/packages/roots/hooks/lifecycle-used.luau b/packages/roots/hooks/lifecycle-used.luau deleted file mode 100644 index bd29276a..00000000 --- a/packages/roots/hooks/lifecycle-used.luau +++ /dev/null @@ -1,16 +0,0 @@ -local lifecycles = require("../../lifecycles") -local types = require("../types") - -local callbacks: { (root: types.Self, provider: lifecycles.Lifecycle) -> () } = {} - -local function onLifecycleUsed(listener: (root: types.Root, lifecycle: lifecycles.Lifecycle) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onLifecycleUsed = onLifecycleUsed, -}) diff --git a/packages/roots/hooks/provider-used.luau b/packages/roots/hooks/provider-used.luau deleted file mode 100644 index dac2573c..00000000 --- a/packages/roots/hooks/provider-used.luau +++ /dev/null @@ -1,16 +0,0 @@ -local providers = require("../../providers") -local types = require("../types") - -local callbacks: { (root: types.Self, provider: providers.Provider) -> () } = {} - -local function onProviderUsed(listener: (root: types.Root, provider: providers.Provider) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onProviderUsed = onProviderUsed, -}) diff --git a/packages/roots/hooks/root-constructing.luau b/packages/roots/hooks/root-constructing.luau deleted file mode 100644 index 5fb8b819..00000000 --- a/packages/roots/hooks/root-constructing.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self) -> () } = {} - -local function onRootConstructing(listener: (root: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootConstructing = onRootConstructing, -}) diff --git a/packages/roots/hooks/root-destroyed.luau b/packages/roots/hooks/root-destroyed.luau deleted file mode 100644 index 10b79b54..00000000 --- a/packages/roots/hooks/root-destroyed.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self) -> () } = {} - -local function onRootDestroyed(listener: (root: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootDestroyed = onRootDestroyed, -}) diff --git a/packages/roots/hooks/root-finished.luau b/packages/roots/hooks/root-finished.luau deleted file mode 100644 index d3519cea..00000000 --- a/packages/roots/hooks/root-finished.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self) -> () } = {} - -local function onRootFinished(listener: (root: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootFinished = onRootFinished, -}) diff --git a/packages/roots/hooks/root-started.luau b/packages/roots/hooks/root-started.luau deleted file mode 100644 index 2ae6f90c..00000000 --- a/packages/roots/hooks/root-started.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self) -> () } = {} - -local function onRootStarted(listener: (root: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootStarted = onRootStarted, -}) diff --git a/packages/roots/hooks/root-used.luau b/packages/roots/hooks/root-used.luau deleted file mode 100644 index 71f172cc..00000000 --- a/packages/roots/hooks/root-used.luau +++ /dev/null @@ -1,15 +0,0 @@ -local types = require("../types") - -local callbacks: { (root: types.Self, subRoot: types.Root) -> () } = {} - -local function onRootUsed(listener: (root: types.Root, subRoot: types.Root) -> ()): () -> () - table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end -end - -return table.freeze({ - callbacks = callbacks, - onRootUsed = onRootUsed, -}) diff --git a/packages/roots/index.d.ts b/packages/roots/index.d.ts deleted file mode 100644 index d8e100c5..00000000 --- a/packages/roots/index.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Lifecycle } from "../lifecycles"; -import { Provider } from "../providers"; - -declare namespace roots { - export type Root = { - type: "Root"; - - start(): StartedRoot; - - useModule(module: ModuleScript): Root; - useModules(modules: Instance[], predicate?: (module: ModuleScript) => boolean): Root; - useRoot(root: Root): Root; - useRoots(roots: Root[]): Root; - useProvider(provider: Provider): Root; - useProviders(providers: Provider[]): Root; - useLifecycle(lifecycle: Lifecycle): Root; - useLifecycles(lifecycles: Lifecycle): Root; - destroy(): void; - - willStart(callback: () => void): Root; - willFinish(callback: () => void): Root; - }; - - export type StartedRoot = { - type: "StartedRoot"; - - finish(): void; - }; - - export function create(): Root; - - export namespace hooks { - export function onLifecycleUsed(listener: (lifecycle: Lifecycle) => void): () => void; - export function onProviderUsed(listener: (provider: Provider) => void): () => void; - export function onRootUsed(listener: (root: Root, subRoot: Root) => void): () => void; - - export function onRootConstructing(listener: (root: Root) => void): () => void; - export function onRootStarted(listener: (root: Root) => void): () => void; - export function onRootFinished(listener: (root: Root) => void): () => void; - export function onRootDestroyed(listener: (root: Root) => void): () => void; - } -} - -export = roots; -export as namespace roots; diff --git a/packages/roots/init.luau b/packages/roots/init.luau deleted file mode 100644 index f6aa7495..00000000 --- a/packages/roots/init.luau +++ /dev/null @@ -1,28 +0,0 @@ -local create = require("@self/create") -local lifecycleUsed = require("@self/hooks/lifecycle-used") -local providerUsed = require("@self/hooks/provider-used") -local rootConstructing = require("@self/hooks/root-constructing") -local rootDestroyed = require("@self/hooks/root-destroyed") -local rootFinished = require("@self/hooks/root-finished") -local rootStarted = require("@self/hooks/root-started") -local rootUsed = require("@self/hooks/root-used") -local types = require("@self/types") - -export type Root = types.Root -export type StartedRoot = types.StartedRoot - -local roots = table.freeze({ - create = create, - hooks = table.freeze({ - onLifecycleUsed = lifecycleUsed.onLifecycleUsed, - onProviderUsed = providerUsed.onProviderUsed, - onRootUsed = rootUsed.onRootUsed, - - onRootConstructing = rootConstructing.onRootConstructing, - onRootStarted = rootStarted.onRootStarted, - onRootFinished = rootFinished.onRootFinished, - onRootDestroyed = rootDestroyed.onRootDestroyed, - }), -}) - -return roots diff --git a/packages/roots/logger.luau b/packages/roots/logger.luau deleted file mode 100644 index 92e611ef..00000000 --- a/packages/roots/logger.luau +++ /dev/null @@ -1,7 +0,0 @@ -local logger = require("../logger") - -return logger.create("@prvdmwrong/roots", logger.standardErrorInfoUrl("roots"), { - useAfterDestroy = "Cannot use Root after it is destroyed.", - alreadyDestroyed = "Cannot destroy an already destroyed Root.", - alreadyFinished = "Root has already finished.", -}) diff --git a/packages/roots/methods/destroy.luau b/packages/roots/methods/destroy.luau deleted file mode 100644 index 0c62a935..00000000 --- a/packages/roots/methods/destroy.luau +++ /dev/null @@ -1,16 +0,0 @@ -local logger = require("../logger") -local types = require("../types") - -local function destroy(root: types.Self) - if root._destroyed then - logger:fatalError({ template = logger.alreadyDestroyed }) - end - root._destroyed = true - table.clear(root._rootLifecycles) - table.clear(root._rootProviders) - table.clear(root._subRoots) - root._start:clear() - root._finish:clear() -end - -return destroy diff --git a/packages/roots/methods/start.luau b/packages/roots/methods/start.luau deleted file mode 100644 index 3f24dac5..00000000 --- a/packages/roots/methods/start.luau +++ /dev/null @@ -1,102 +0,0 @@ -local dependencies = require("../../dependencies") -local lifecycles = require("../../lifecycles") -local logger = require("../logger") -local providers = require("../../providers") -local rootFinished = require("../hooks/root-finished").callbacks -local rootStarted = require("../hooks/root-started").callbacks -local types = require("../types") - -local function bindLifecycle(lifecycle: lifecycles.Lifecycle<...any>, provider: providers.Provider) - local lifecycleMethod = (provider :: any)[lifecycle.method] - if typeof(lifecycleMethod) == "function" then - -- local isProfiling = _G.PRVDMWRONG_PROFILE_LIFECYCLES - - -- if isProfiling then - -- lifecycle:register(function(...) - -- debug.profilebegin(memoryCategory) - -- debug.setmemorycategory(memoryCategory) - -- lifecycleMethod(provider, ...) - -- debug.resetmemorycategory() - -- debug.profileend() - -- end) - -- else - lifecycle:register(function(...) - lifecycleMethod(provider, ...) - end) - -- end - end -end - -local function nameOf(provider: providers.Provider, extension: string?): string - return if extension then `{tostring(provider)}.{extension}` else tostring(provider) -end - -local function start(root: types.Self): types.StartedRoot - local processed = dependencies.processDependencies(root._rootProviders) - local sortedProviders = processed.sortedDependencies :: { providers.Provider } - local processedLifecycles = processed.lifecycles - table.move(root._rootLifecycles, 1, #root._rootLifecycles, #processedLifecycles + 1, processedLifecycles) - - dependencies.sortByPriority(sortedProviders) - - local constructedProviders = {} - for _, provider in sortedProviders do - local providerDependencies = (provider :: any).dependencies - if typeof(providerDependencies) == "table" then - providerDependencies = table.clone(providerDependencies) - for key, value in providerDependencies do - providerDependencies[key] = constructedProviders[value] - end - end - - local constructed = provider.new(providerDependencies) - constructedProviders[provider] = constructed - bindLifecycle(root._start, constructed) - bindLifecycle(root._finish, constructed) - - for _, lifecycle in processedLifecycles do - bindLifecycle(lifecycle, constructed) - end - end - - local subRoots: { types.StartedRoot } = {} - for root in root._subRoots do - table.insert(subRoots, root:start()) - end - - root._start:fire() - - local startedRoot = {} :: types.StartedRoot - startedRoot.type = "StartedRoot" - - local didFinish = false - - function startedRoot:finish() - if didFinish then - return logger:fatalError({ template = logger.alreadyFinished }) - end - - didFinish = true - root._finish:fire() - - -- NOTE(znotfireman): Assume the user cleans up their own lifecycles - root._start:clear() - root._finish:clear() - - for _, subRoot in subRoots do - subRoot:finish() - end - - for _, hook in rootFinished do - hook(root) - end - end - - for _, hook in rootStarted do - hook(root) - end - - return startedRoot -end - -return start diff --git a/packages/roots/methods/use-lifecycle.luau b/packages/roots/methods/use-lifecycle.luau deleted file mode 100644 index 862c2d07..00000000 --- a/packages/roots/methods/use-lifecycle.luau +++ /dev/null @@ -1,14 +0,0 @@ -local lifecycleUsed = require("../hooks/lifecycle-used").callbacks -local lifecycles = require("../../lifecycles") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useLifecycle(root: types.Self, lifecycle: lifecycles.Lifecycle) - table.insert(root._rootLifecycles, lifecycle) - threadpool.spawnCallbacks(lifecycleUsed, root, lifecycle) - return root -end - -return useLifecycle diff --git a/packages/roots/methods/use-lifecycles.luau b/packages/roots/methods/use-lifecycles.luau deleted file mode 100644 index 3f12341f..00000000 --- a/packages/roots/methods/use-lifecycles.luau +++ /dev/null @@ -1,16 +0,0 @@ -local lifecycleUsed = require("../hooks/lifecycle-used").callbacks -local lifecycles = require("../../lifecycles") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useLifecycles(root: types.Self, lifecycles: { lifecycles.Lifecycle }) - for _, lifecycle in lifecycles do - table.insert(root._rootLifecycles, lifecycle) - threadpool.spawnCallbacks(lifecycleUsed, root, lifecycle) - end - return root -end - -return useLifecycles diff --git a/packages/roots/methods/use-module.luau b/packages/roots/methods/use-module.luau deleted file mode 100644 index a96b3d17..00000000 --- a/packages/roots/methods/use-module.luau +++ /dev/null @@ -1,23 +0,0 @@ -local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool -local providerClasses = providers._.providerClasses - -local function useModule(root: types.Self, module: ModuleScript) - local moduleExport = (require)(module) - - if providerClasses[moduleExport] then - root._rootProviders[moduleExport] = true - if typeof(moduleExport.name) ~= "string" then - moduleExport.name = module.Name - end - threadpool.spawnCallbacks(providerUsed, root, moduleExport) - end - - return root -end - -return useModule diff --git a/packages/roots/methods/use-modules.luau b/packages/roots/methods/use-modules.luau deleted file mode 100644 index 8354a9d0..00000000 --- a/packages/roots/methods/use-modules.luau +++ /dev/null @@ -1,28 +0,0 @@ -local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool -local providerClasses = providers._.providerClasses - -local function useModules(root: types.Self, modules: { Instance }, predicate: ((module: ModuleScript) -> boolean)?) - for _, module in modules do - if not module:IsA("ModuleScript") or predicate and not predicate(module) then - continue - end - - local moduleExport = (require)(module) - if providerClasses[moduleExport] then - root._rootProviders[moduleExport] = true - if typeof(moduleExport.name) ~= "string" then - moduleExport.name = module.Name - end - threadpool.spawnCallbacks(providerUsed, root, moduleExport) - end - end - - return root -end - -return useModules diff --git a/packages/roots/methods/use-provider.luau b/packages/roots/methods/use-provider.luau deleted file mode 100644 index 277d8049..00000000 --- a/packages/roots/methods/use-provider.luau +++ /dev/null @@ -1,14 +0,0 @@ -local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useProvider(root: types.Self, provider: providers.Provider) - root._rootProviders[provider] = true - threadpool.spawnCallbacks(providerUsed, root, provider) - return root -end - -return useProvider diff --git a/packages/roots/methods/use-providers.luau b/packages/roots/methods/use-providers.luau deleted file mode 100644 index 1489c3a3..00000000 --- a/packages/roots/methods/use-providers.luau +++ /dev/null @@ -1,16 +0,0 @@ -local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useProviders(root: types.Self, providers: { providers.Provider }) - for _, provider in providers do - root._rootProviders[provider] = true - threadpool.spawnCallbacks(providerUsed, root, provider) - end - return root -end - -return useProviders diff --git a/packages/roots/methods/use-root.luau b/packages/roots/methods/use-root.luau deleted file mode 100644 index efc4ad1e..00000000 --- a/packages/roots/methods/use-root.luau +++ /dev/null @@ -1,13 +0,0 @@ -local rootUsed = require("../hooks/root-used").callbacks -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useRoot(root: types.Self, subRoot: types.Root) - root._subRoots[subRoot] = true - threadpool.spawnCallbacks(rootUsed, root, subRoot) - return root -end - -return useRoot diff --git a/packages/roots/methods/use-roots.luau b/packages/roots/methods/use-roots.luau deleted file mode 100644 index 7b5b9dda..00000000 --- a/packages/roots/methods/use-roots.luau +++ /dev/null @@ -1,15 +0,0 @@ -local rootUsed = require("../hooks/root-used").callbacks -local runtime = require("../../runtime") -local types = require("../types") - -local threadpool = runtime.threadpool - -local function useRoots(root: types.Self, subRoots: { types.Root }) - for _, subRoot in subRoots do - root._subRoots[subRoot] = true - threadpool.spawnCallbacks(rootUsed, root, subRoot) - end - return root -end - -return useRoots diff --git a/packages/roots/methods/will-finish.luau b/packages/roots/methods/will-finish.luau deleted file mode 100644 index 893088f4..00000000 --- a/packages/roots/methods/will-finish.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -local function willFinish(root: types.Self, callback: () -> ()) - root._finish:register(callback) - return root -end - -return willFinish diff --git a/packages/roots/methods/will-start.luau b/packages/roots/methods/will-start.luau deleted file mode 100644 index 7c3d88c3..00000000 --- a/packages/roots/methods/will-start.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -local function willStart(root: types.Self, callback: () -> ()) - root._start:register(callback) - return root -end - -return willStart diff --git a/packages/roots/prvd.config.luau b/packages/roots/prvd.config.luau deleted file mode 100644 index 9391d60d..00000000 --- a/packages/roots/prvd.config.luau +++ /dev/null @@ -1,19 +0,0 @@ -local configure = require("@lune-lib/configure") - -return configure.package({ - name = "roots", - description = "Roots implementation for Prvd 'M Wrong", - - types = { - Root = true, - StartedRoot = true, - }, - - dependencies = configure.dependencies({ - dependencies = true, - logger = true, - lifecycles = true, - runtime = true, - providers = true, - }), -}) diff --git a/packages/roots/types.luau b/packages/roots/types.luau deleted file mode 100644 index 104143c4..00000000 --- a/packages/roots/types.luau +++ /dev/null @@ -1,40 +0,0 @@ -local lifecycles = require("../lifecycles") -local providers = require("../providers") - -type Set = { [T]: true } - -export type Root = { - type: "Root", - - start: (root: Root) -> StartedRoot, - - useModule: (root: Root, module: ModuleScript) -> Root, - useModules: (root: Root, modules: { Instance }, predicate: ((ModuleScript) -> boolean)?) -> Root, - useRoot: (root: Root, root: Root) -> Root, - useRoots: (root: Root, roots: { Root }) -> Root, - useProvider: (root: Root, provider: providers.Provider) -> Root, - useProviders: (root: Root, providers: { providers.Provider }) -> Root, - useLifecycle: (root: Root, lifecycle: lifecycles.Lifecycle) -> Root, - useLifecycles: (root: Root, lifecycles: { lifecycles.Lifecycle }) -> Root, - destroy: (root: Root) -> (), - - willStart: (callback: () -> ()) -> Root, - willFinish: (callback: () -> ()) -> Root, -} - -export type StartedRoot = { - type: "StartedRoot", - - finish: (root: StartedRoot) -> (), -} - -export type Self = Root & { - _destroyed: boolean, - _rootProviders: Set>, - _rootLifecycles: { lifecycles.Lifecycle }, - _subRoots: Set, - _start: lifecycles.Lifecycle<()>, - _finish: lifecycles.Lifecycle<()>, -} - -return nil diff --git a/packages/runtime/batteries/threadpool.luau b/packages/runtime/batteries/threadpool.luau deleted file mode 100644 index 6caf08b4..00000000 --- a/packages/runtime/batteries/threadpool.luau +++ /dev/null @@ -1,38 +0,0 @@ -local task = require("../libs/task") - -local freeThreads: { thread } = {} - -local function run(f: (T...) -> (), thread: thread, ...) - f(...) - table.insert(freeThreads, thread) -end - -local function yielder() - while true do - run(coroutine.yield()) - end -end - -local function spawn(f: (T...) -> (), ...: T...) - local thread - if #freeThreads > 0 then - thread = freeThreads[#freeThreads] - freeThreads[#freeThreads] = nil - else - thread = coroutine.create(yielder) - coroutine.resume(thread) - end - - task.spawn(thread, f, thread, ...) -end - -local function spawnCallbacks(callbacks: { (Args...) -> () }, ...: Args...) - for _, callback in callbacks do - spawn(callback, ...) - end -end - -return table.freeze({ - spawn = spawn, - spawnCallbacks = spawnCallbacks, -}) diff --git a/packages/runtime/implementations/init.luau b/packages/runtime/implementations/init.luau deleted file mode 100644 index 28dbe015..00000000 --- a/packages/runtime/implementations/init.luau +++ /dev/null @@ -1,56 +0,0 @@ -local types = require("@self/../types") - -type Implementation = { new: (() -> T)?, implementation: T? } - -export type RuntimeName = "roblox" | "luau" | "lune" | "lute" | "seal" | "zune" - -local supportedRuntimes = table.freeze({ - roblox = require("@self/roblox"), - luau = require("@self/luau"), - lune = require("@self/lune"), - lute = require("@self/lute"), - seal = require("@self/seal"), - zune = require("@self/zune"), -}) - -local currentRuntime: types.Runtime = nil -do - for _, runtime in supportedRuntimes :: { [string]: types.Runtime } do - local isRuntime = runtime.is() - if isRuntime then - local currentRuntimePriority = currentRuntime and currentRuntime.priority or 0 - local runtimePriority = runtime.priority or 0 - if currentRuntimePriority <= runtimePriority then - currentRuntime = runtime - end - end - end - assert(currentRuntime, "No supported runtime") -end - -local currentRuntimeName: RuntimeName = currentRuntime.name :: any - -local function notImplemented(functionName: string) - return function() - error(`'{functionName}' is not implemented by runtime '{currentRuntimeName}'`, 2) - end -end - -local function implementFunction(label: string, implementations: { [types.Runtime]: Implementation? }): T - local implementation = implementations[currentRuntime] - if implementation then - if implementation.new then - return implementation.new() - elseif implementation.implementation then - return implementation.implementation - end - end - return notImplemented(label) :: any -end - -return table.freeze({ - supportedRuntimes = supportedRuntimes, - currentRuntime = currentRuntime, - currentRuntimeName = currentRuntimeName, - implementFunction = implementFunction, -}) diff --git a/packages/runtime/implementations/init.spec.luau b/packages/runtime/implementations/init.spec.luau deleted file mode 100644 index 3ce91cbb..00000000 --- a/packages/runtime/implementations/init.spec.luau +++ /dev/null @@ -1,81 +0,0 @@ -local implementations = require("@self/../implementations") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("currentRuntime", function() - test("detects lune runtime", function() - expect(implementations.currentRuntimeName).is("lune") - expect(implementations.currentRuntime).is(implementations.supportedRuntimes.lune) - end) - end) - - describe("implementFunction", function() - test("implements for lune runtime", function() - local lune = function() end - local luau = function() end - - local implementation = implementations.implementFunction("implementation", { - [implementations.supportedRuntimes.lune] = { - implementation = lune, - }, - [implementations.supportedRuntimes.luau] = { - implementation = luau, - }, - }) - - expect(implementation).is_a("function") - expect(implementation).never_is(luau) - expect(implementation).is(lune) - end) - - test("constructs for lune runtime", function() - local lune = function() end - local luau = function() end - - local constructedLune = false - - local implementation = implementations.implementFunction("implementation", { - [implementations.supportedRuntimes.lune] = { - new = function() - constructedLune = true - return lune - end, - }, - [implementations.supportedRuntimes.luau] = { - new = function() - return luau - end, - }, - }) - - expect(implementation).is_a("function") - expect(implementation).never_is(luau) - expect(implementation).is(lune) - expect(constructedLune).is_true() - end) - - test("defaults to not implemented function", function() - local constructSuccess, runSuccess = false, false - - local implementation = implementations.implementFunction("implementation", { - [implementations.supportedRuntimes.roblox] = { - new = function() - constructSuccess = true - return function() - runSuccess = true - end - end, - }, - }) - - expect(constructSuccess).is(false) - expect(implementation).is_a("function") - expect(implementation).fails_with("'implementation' is not implemented by runtime 'lune'") - expect(runSuccess).is(false) - end) - end) -end diff --git a/packages/runtime/implementations/luau.luau b/packages/runtime/implementations/luau.luau deleted file mode 100644 index c67e52f4..00000000 --- a/packages/runtime/implementations/luau.luau +++ /dev/null @@ -1,9 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "luau", - priority = -1, - is = function() - return true - end, -}) diff --git a/packages/runtime/implementations/lune.luau b/packages/runtime/implementations/lune.luau deleted file mode 100644 index f49834eb..00000000 --- a/packages/runtime/implementations/lune.luau +++ /dev/null @@ -1,10 +0,0 @@ -local types = require("../types") - -local LUNE_VERSION_FORMAT = "(Lune) (%d+%.%d+%.%d+.*)+(%d+)" - -return types.Runtime({ - name = "lune", - is = function() - return string.match(_VERSION, LUNE_VERSION_FORMAT) ~= nil - end, -}) diff --git a/packages/runtime/implementations/lute.luau b/packages/runtime/implementations/lute.luau deleted file mode 100644 index 7b6abc58..00000000 --- a/packages/runtime/implementations/lute.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "lute", - is = function() - return false - end, -}) diff --git a/packages/runtime/implementations/roblox.luau b/packages/runtime/implementations/roblox.luau deleted file mode 100644 index 91a780e2..00000000 --- a/packages/runtime/implementations/roblox.luau +++ /dev/null @@ -1,9 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "roblox", - is = function() - -- wtf - return not not (_VERSION == "Luau" and game and workspace) - end, -}) diff --git a/packages/runtime/implementations/seal.luau b/packages/runtime/implementations/seal.luau deleted file mode 100644 index 0a72684c..00000000 --- a/packages/runtime/implementations/seal.luau +++ /dev/null @@ -1,8 +0,0 @@ -local types = require("../types") - -return types.Runtime({ - name = "seal", - is = function() - return false - end, -}) diff --git a/packages/runtime/implementations/zune.luau b/packages/runtime/implementations/zune.luau deleted file mode 100644 index 48243e05..00000000 --- a/packages/runtime/implementations/zune.luau +++ /dev/null @@ -1,10 +0,0 @@ -local types = require("../types") - -local ZUNE_VERSION_FORMAT = "(Zune) (%d+%.%d+%.%d+.*)+(%d+%.%d+)" - -return types.Runtime({ - name = "zune", - is = function() - return string.match(_VERSION, ZUNE_VERSION_FORMAT) ~= nil - end, -}) diff --git a/packages/runtime/index.d.ts b/packages/runtime/index.d.ts deleted file mode 100644 index b227b952..00000000 --- a/packages/runtime/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -declare namespace runtime { - export type RuntimeName = "roblox" | "luau" | "lune" | "lute" | "seal" | "zune"; - - export const name: RuntimeName; - - export namespace task { - export function cancel(thread: thread): void; - - export function defer(functionOrThread: (...args: T) => void, ...args: T): thread; - export function defer(functionOrThread: thread): thread; - export function defer( - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function delay( - duration: number, - functionOrThread: (...args: T) => void, - ...args: T - ): thread; - export function delay(duration: number, functionOrThread: thread): thread; - export function delay( - duration: number, - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function spawn(functionOrThread: (...args: T) => void, ...args: T): thread; - export function spawn(functionOrThread: thread): thread; - export function spawn( - functionOrThread: thread | ((...args: T) => void), - ...args: T - ): thread; - - export function wait(duration: number): number; - } - - export function warn(...args: T): void; - - export namespace threadpool { - export function spawn(f: (...args: T) => void, ...args: T): void; - export function spawnCallbacks(functions: ((...args: T) => void)[], ...args: T): void; - } -} - -export = runtime; -export as namespace runtime; diff --git a/packages/runtime/init.luau b/packages/runtime/init.luau deleted file mode 100644 index 26bdeee0..00000000 --- a/packages/runtime/init.luau +++ /dev/null @@ -1,15 +0,0 @@ -local implementations = require("@self/implementations") -local task = require("@self/libs/task") -local threadpool = require("@self/batteries/threadpool") -local warn = require("@self/libs/warn") - -export type RuntimeName = implementations.RuntimeName - -return table.freeze({ - name = implementations.currentRuntimeName, - - task = task, - warn = warn, - - threadpool = threadpool, -}) diff --git a/packages/runtime/libs/task.luau b/packages/runtime/libs/task.luau deleted file mode 100644 index 28c1ac9e..00000000 --- a/packages/runtime/libs/task.luau +++ /dev/null @@ -1,157 +0,0 @@ -local implementations = require("../implementations") - -export type TaskLib = { - cancel: (thread) -> (), - defer: (functionOrThread: thread | (T...) -> (), T...) -> thread, - delay: (duration: number, functionOrThread: thread | (T...) -> (), T...) -> thread, - spawn: (functionOrThread: thread | (T...) -> (), T...) -> thread, - wait: (duration: number?) -> number, -} - -local supportedRuntimes = implementations.supportedRuntimes -local implementFunction = implementations.implementFunction - -local function defaultSpawn(functionOrThread: thread | (T...) -> (), ...: T...): thread - if type(functionOrThread) == "thread" then - coroutine.resume(functionOrThread, ...) - return functionOrThread - else - local thread = coroutine.create(functionOrThread) - coroutine.resume(thread, ...) - return thread - end -end - -local function defaultWait(seconds: number?) - local startTime = os.clock() - local endTime = startTime + (seconds or 1) - local clockTime: number - repeat - clockTime = os.clock() - until clockTime >= endTime - return clockTime - startTime -end - -local task: TaskLib = table.freeze({ - cancel = implementFunction("task.wait", { - [supportedRuntimes.roblox] = { - new = function() - return task.cancel - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").cancel - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").cancel - end, - }, - [supportedRuntimes.luau] = { - implementation = function(thread) - if not coroutine.close(thread) then - error(debug.traceback(thread, "Could not cancel thread")) - end - end, - }, - }), - defer = implementFunction("task.defer", { - [supportedRuntimes.roblox] = { - new = function() - return task.defer :: any - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").defer - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").defer - end, - }, - [supportedRuntimes.luau] = { - implementation = defaultSpawn, - }, - }), - delay = implementFunction("task.delay", { - [supportedRuntimes.roblox] = { - new = function() - return task.delay :: any - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").delay - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").delay - end, - }, - [supportedRuntimes.luau] = { - implementation = function(duration: number, functionOrThread: thread | (T...) -> (), ...: T...): thread - return defaultSpawn( - if typeof(functionOrThread) == "function" - then function(duration, functionOrThread, ...) - defaultWait(duration) - functionOrThread(...) - end - else function(duration, functionOrThread, ...) - defaultWait(duration) - coroutine.resume(...) - end, - duration, - functionOrThread, - ... - ) - end, - }, - }), - spawn = implementFunction("task.spawn", { - [supportedRuntimes.roblox] = { - new = function() - return task.spawn :: any - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").spawn - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").spawn - end, - }, - [supportedRuntimes.luau] = { - implementation = defaultSpawn, - }, - }), - wait = implementFunction("task.wait", { - [supportedRuntimes.roblox] = { - new = function() - return task.wait - end, - }, - [supportedRuntimes.lune] = { - new = function() - return require("@lune/task").wait - end, - }, - [supportedRuntimes.zune] = { - new = function() - return require("@zcore/task").wait - end, - }, - [supportedRuntimes.luau] = { - implementation = defaultWait, - }, - }), -}) - -return task diff --git a/packages/runtime/libs/task.spec.luau b/packages/runtime/libs/task.spec.luau deleted file mode 100644 index 0918e87f..00000000 --- a/packages/runtime/libs/task.spec.luau +++ /dev/null @@ -1,62 +0,0 @@ -local luneTask = require("@lune/task") -local task = require("./task") -local tiniest = require("@lune-lib/tiniest/tiniest_for_lune") - --- FIXME: can't async stuff lol -return function(tiniest: tiniest.Configured): () - local test = tiniest.test - local expect = tiniest.expect - local describe = tiniest.describe - - describe("task", function() - test("spawn", function() - expect(task.spawn).is(luneTask.spawn) - local spawned = false - - task.spawn(function() - spawned = true - end) - - expect(spawned).is_true() - end) - - test("defer", function() - expect(task.defer).is(luneTask.defer) - - -- local spawned = false - - -- task.defer(function() - -- spawned = true - -- end) - - -- expect(spawned).never_is_true() - end) - - test("delay", function() - expect(task.delay).is(luneTask.delay) - -- local spawned = false - - -- task.delay(0.25, function() - -- spawned = true - -- end) - - -- expect(spawned).never_is_true() - - -- local startTime = os.clock() - -- repeat - -- until os.clock() - startTime > 0.5 - - -- print(spawned) - - -- expect(spawned).is_true() - end) - - test("wait", function() - expect(task.wait).is(luneTask.wait) - end) - - test("cancel", function() - expect(task.cancel).is(luneTask.cancel) - end) - end) -end diff --git a/packages/runtime/libs/warn.luau b/packages/runtime/libs/warn.luau deleted file mode 100644 index 6a4837ac..00000000 --- a/packages/runtime/libs/warn.luau +++ /dev/null @@ -1,27 +0,0 @@ -local implementations = require("../implementations") - -local supportedRuntimes = implementations.supportedRuntimes -local implementFunction = implementations.implementFunction - -local function tostringTuple(...: any) - local stringified = {} - for index = 1, select("#", ...) do - table.insert(stringified, tostring(select(index, ...))) - end - return table.concat(stringified, " ") -end - -local warn: (T...) -> () = implementFunction("warn", { - [supportedRuntimes.roblox] = { - new = function() - return warn - end, - }, - [supportedRuntimes.luau] = { - implementation = function(...: T...) - print(`\27[0;33m{tostringTuple(...)}\27[0m`) - end, - }, -}) - -return warn diff --git a/packages/runtime/prvd.config.luau b/packages/runtime/prvd.config.luau deleted file mode 100644 index b171ea71..00000000 --- a/packages/runtime/prvd.config.luau +++ /dev/null @@ -1,10 +0,0 @@ -local configure = require("@lune-lib/configure") - -return configure.package({ - name = "runtime", - description = "Runtime agnostic libraries for Prvd 'M Wrong", - - types = { - RuntimeName = true, - }, -}) diff --git a/packages/runtime/types.luau b/packages/runtime/types.luau deleted file mode 100644 index ca050fce..00000000 --- a/packages/runtime/types.luau +++ /dev/null @@ -1,13 +0,0 @@ -export type Runtime = { - name: string, - priority: number?, - is: () -> boolean, -} - -local function Runtime(x: Runtime) - return table.freeze(x) -end - -return table.freeze({ - Runtime = Runtime, -}) diff --git a/packages/typecheckers/init.luau b/packages/typecheckers/init.luau deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/typecheckers/prvd.config.luau b/packages/typecheckers/prvd.config.luau deleted file mode 100644 index 00a3fba7..00000000 --- a/packages/typecheckers/prvd.config.luau +++ /dev/null @@ -1,6 +0,0 @@ -local configure = require("@lune-lib/configure") - -return configure.package({ - name = "typecheckers", - description = "Typechecking primitives and compatibility for Prvd 'M Wrong", -}) diff --git a/pesde.toml b/pesde.toml deleted file mode 100644 index ad6b2d51..00000000 --- a/pesde.toml +++ /dev/null @@ -1,8 +0,0 @@ -name = "prvdmwrong/repo" -version = "0.0.0" -private = true - -workspace_members = ["dist/pesde/roblox/*"] - -[target] - environment = "luau" diff --git a/providers/create.luau b/providers/create.luau new file mode 100644 index 00000000..592cb798 --- /dev/null +++ b/providers/create.luau @@ -0,0 +1,27 @@ +local nameOf = require "./name-of" +local providerClasses = require "./provider-classes" +local types = require "./types" + +local PROVIDER_MT = { __tostring = nameOf } + +local function createProvider(self: Self): types.Provider + local provider: types.Provider = self :: any + setmetatable(provider, PROVIDER_MT) + + if provider.__index == nil then provider.__index = provider end + + if provider.__tostring == nil then provider.__tostring = nameOf end + + if provider.new == nil then + function provider.new(dependencies) + local self: types.Provider = setmetatable({}, provider) :: any + if provider.constructor then return provider.constructor(self, dependencies) or self end + return self + end + end + + providerClasses[provider] = true + return provider +end + +return createProvider diff --git a/providers/init.luau b/providers/init.luau new file mode 100644 index 00000000..4c7d7381 --- /dev/null +++ b/providers/init.luau @@ -0,0 +1,16 @@ +local create = require "@self/create" +local nameOf = require "@self/name-of" +local providerClasses = require "@self/provider-classes" +local types = require "@self/types" + +export type Provider = types.Provider + +local providers = table.freeze { + create = create, + nameOf = nameOf, + _ = table.freeze { + providerClasses = providerClasses, + }, +} + +return providers diff --git a/providers/name-of.luau b/providers/name-of.luau new file mode 100644 index 00000000..41a5437d --- /dev/null +++ b/providers/name-of.luau @@ -0,0 +1,5 @@ +local types = require "./types" + +local function nameOf(provider: types.Provider) return provider.name or "Provider" end + +return nameOf diff --git a/dist/npm/providers/src/provider-classes.luau b/providers/provider-classes.luau similarity index 81% rename from dist/npm/providers/src/provider-classes.luau rename to providers/provider-classes.luau index cc57922f..95f9b2c7 100644 --- a/dist/npm/providers/src/provider-classes.luau +++ b/providers/provider-classes.luau @@ -1,4 +1,4 @@ -local types = require("./types") +local types = require "./types" type Set = { [T]: true } diff --git a/dist/npm/providers/src/types.luau b/providers/types.luau similarity index 66% rename from dist/npm/providers/src/types.luau rename to providers/types.luau index 4f4d4dc9..859d6568 100644 --- a/dist/npm/providers/src/types.luau +++ b/providers/types.luau @@ -1,12 +1,12 @@ -local dependencies = require("../dependencies") +local dependencies = require "../dependencies" export type Provider = dependencies.Dependency, __tostring: (self: Provider) -> string, name: string?, constructor: ((self: Provider, dependencies: Dependencies) -> ())?, - start: (self: Provider) -> ()?, - destroy: (self: Provider) -> ()?, + onStart: (self: Provider) -> ()?, + onFinish: (self: Provider) -> ()?, }, Dependencies> return nil diff --git a/prvd.config.luau b/prvd.config.luau deleted file mode 100644 index 9282af01..00000000 --- a/prvd.config.luau +++ /dev/null @@ -1,17 +0,0 @@ -local configure = require("@lune-lib/configure") - -return configure.root({ - repository = "https://github.com/prvdmwrong/prvdmwrong", - homepage = "https://prvdmwrong.luau.page/latest/", - packageDir = "packages", - defaults = { - authors = { "Fire " }, - license = "MPL-2.0", - version = "0.2.0-rc.4", - }, - publishers = { - pesde = configure.publisher({ scope = "prvdmwrong", registry = "https://github.com/pesde-pkg/index" }), - wally = configure.publisher({ scope = "prvdmwrong", registry = "https://github.com/upliftgames/wally-index" }), - npm = configure.publisher({ scope = "prvdmwrong", registry = "" }), - }, -}) diff --git a/dist/pesde/lune/prvdmwrong/src/init.luau b/prvdmwrong/init.luau similarity index 79% rename from dist/pesde/lune/prvdmwrong/src/init.luau rename to prvdmwrong/init.luau index 1381801d..c2193a66 100644 --- a/dist/pesde/lune/prvdmwrong/src/init.luau +++ b/prvdmwrong/init.luau @@ -1,10 +1,10 @@ -local dependencies = require("./dependencies") -local lifecycles = require("./lifecycles") -local providers = require("./providers") -local roots = require("./roots") +local dependencies = require "./dependencies" +local lifecycles = require "./lifecycles" +local providers = require "./providers" +local roots = require "./roots" export type Provider = providers.Provider -export type Lifecycle = lifecycles.Lifecycle +export type Lifecycle = lifecycles.Lifecycle export type Root = roots.Root export type StartedRoot = roots.StartedRoot @@ -18,7 +18,7 @@ local prvd = { fireConcurrent = lifecycles.handlers.fireConcurrent, fireSequential = lifecycles.handlers.fireSequential, - hooks = table.freeze({ + hooks = table.freeze { onProviderUsed = roots.hooks.onProviderUsed, onLifecycleUsed = roots.hooks.onLifecycleUsed, onRootConstructing = roots.hooks.onRootConstructing, @@ -31,15 +31,13 @@ local prvd = { onLifecycleDestroyed = lifecycles.hooks.onLifecycleDestroyed, onLifecycleRegistered = lifecycles.hooks.onLifecycleRegistered, onLifecycleUnregistered = lifecycles.hooks.onLifecycleUnregistered, - }), + }, } type PrvdModule = ((provider: Self) -> Provider) & typeof(prvd) local mt = {} -function mt.__call(_, provider: Self): providers.Provider - return providers.create(provider) :: any -end +function mt.__call(_, provider: Self): providers.Provider return providers.create(provider) :: any end local module: PrvdModule = setmetatable(prvd, mt) :: any return module diff --git a/dist/pesde/lune/rbx-components/src/component-classes.luau b/rbx-components/component-classes.luau similarity index 81% rename from dist/pesde/lune/rbx-components/src/component-classes.luau rename to rbx-components/component-classes.luau index 0dcdb30a..d5b2af6c 100644 --- a/dist/pesde/lune/rbx-components/src/component-classes.luau +++ b/rbx-components/component-classes.luau @@ -1,4 +1,4 @@ -local types = require("./types") +local types = require "./types" type Set = { [T]: true } diff --git a/dist/pesde/roblox/rbx-components/src/component-provider.luau b/rbx-components/component-provider.luau similarity index 80% rename from dist/pesde/roblox/rbx-components/src/component-provider.luau rename to rbx-components/component-provider.luau index 85af0d0d..a389caa8 100644 --- a/dist/pesde/roblox/rbx-components/src/component-provider.luau +++ b/rbx-components/component-provider.luau @@ -1,10 +1,10 @@ -local CollectionService = game:GetService("CollectionService") +local CollectionService = game:GetService "CollectionService" -local componentClasses = require("./component-classes") -local logger = require("./logger") -local providers = require("../providers") -local runtime = require("../runtime") -local types = require("./types") +local componentClasses = require "./component-classes" +local logger = require "./logger" +local providers = require "../providers" +local runtime = require "../runtime" +local types = require "./types" local threadpool = runtime.threadpool @@ -52,17 +52,13 @@ function ComponentProvider.start(self: ComponentProvider) self.constructedToClass[component :: any] = componentClass end - if component.added then - component:added() - end + if component.added then component:added() end end if not self._destroyingConnections[instance] then self._destroyingConnections[instance] = instance.Destroying:Once(function() for _, component in instanceToComponents do - if component.destroy then - threadpool.spawn(component.destroy, component) - end + if component.destroy then threadpool.spawn(component.destroy, component) end end table.clear(instanceToComponents) self.instanceToComponents[instance] = nil @@ -82,9 +78,7 @@ end function ComponentProvider.destroy(self: ComponentProvider) for _, components in self.instanceToComponents do for _, component in components do - if component.destroy then - component:destroy() - end + if component.destroy then component:destroy() end end table.clear(components) end @@ -96,15 +90,11 @@ function ComponentProvider.destroy(self: ComponentProvider) table.clear(self.constructedToClass) for _, connection in self._connections do - if connection.Connected then - connection:Disconnect() - end + if connection.Connected then connection:Disconnect() end end for _, connection in self._destroyingConnections do - if connection.Connected then - connection:Disconnect() - end + if connection.Connected then connection:Disconnect() end end table.clear(self._connections) @@ -112,20 +102,16 @@ function ComponentProvider.destroy(self: ComponentProvider) end function ComponentProvider.addComponentClass(self: ComponentProvider, class: types.AnyComponent) - if not componentClasses[class] then - logger:fatalError({ template = logger.invalidComponent }) - end + if not componentClasses[class] then logger:fatalError { template = logger.invalidComponent } end - if self.componentClasses[class] then - logger:fatalError({ template = logger.alreadyRegisteredComponent }) - end + if self.componentClasses[class] then logger:fatalError { template = logger.alreadyRegisteredComponent } end if class.tag then local tagToComponentClasses = self.tagToComponentClasses[class.tag] if tagToComponentClasses then if not _G.PRVDMWRONG_SUPPRESS_MULTIPLE_SAME_TAG and #tagToComponentClasses > 0 then - logger:warn({ template = logger.multipleSameTag, class.tag }) + logger:warn { template = logger.multipleSameTag, class.tag } end else tagToComponentClasses = {} @@ -154,9 +140,7 @@ function ComponentProvider.getAllComponents( local result = {} for _, components in self.instanceToComponents do for _, component in components do - if self.constructedToClass[component] == class then - result[component] = true - end + if self.constructedToClass[component] == class then result[component] = true end end end return result :: any @@ -167,7 +151,7 @@ function ComponentProvider.addComponent( class: types.Component, instance: I ): types.Component? - error("not yet implemented") + error "not yet implemented" end function ComponentProvider.removeComponent(self: ComponentProvider, class: types.Component, instance: I) @@ -175,9 +159,7 @@ function ComponentProvider.removeComponent(self: ComponentProvider, class: if constructed then self.instanceToComponents[instance :: any][class] = nil - if constructed.removed then - threadpool.spawn(constructed.removed :: any, constructed, instance) - end + if constructed.removed then threadpool.spawn(constructed.removed :: any, constructed, instance) end end end diff --git a/dist/pesde/lune/rbx-components/src/create.luau b/rbx-components/create.luau similarity index 62% rename from dist/pesde/lune/rbx-components/src/create.luau rename to rbx-components/create.luau index 24d39a3b..f19a5ff3 100644 --- a/dist/pesde/lune/rbx-components/src/create.luau +++ b/rbx-components/create.luau @@ -1,22 +1,18 @@ -local componentClasses = require("./component-classes") -local types = require("./types") +local componentClasses = require "./component-classes" +local types = require "./types" -- TODO: prvdmwrong/classes package? local function create(self: Self): types.Component local component: types.Component = self :: any - if component.__index == nil then - component.__index = component - end + if component.__index == nil then component.__index = component end -- TODO: abstract nameOf if component.new == nil then function component.new(instance: any) local self: types.Component = setmetatable({}, component) :: any - if component.constructor then - return component.constructor(self, instance) or self - end + if component.constructor then return component.constructor(self, instance) or self end return self end end diff --git a/dist/pesde/lune/rbx-components/src/extend-root/create-component-class-provider.luau b/rbx-components/extend-root/create-component-class-provider.luau similarity index 80% rename from dist/pesde/lune/rbx-components/src/extend-root/create-component-class-provider.luau rename to rbx-components/extend-root/create-component-class-provider.luau index 9d5ae999..e56a8c7a 100644 --- a/dist/pesde/lune/rbx-components/src/extend-root/create-component-class-provider.luau +++ b/rbx-components/extend-root/create-component-class-provider.luau @@ -1,13 +1,13 @@ -local ComponentProvider = require("../component-provider") -local providers = require("../../providers") -local types = require("../types") +local ComponentProvider = require "../component-provider" +local providers = require "../../providers" +local types = require "../types" local ComponentClassProvider = {} ComponentClassProvider.priority = -math.huge ComponentClassProvider.name = "@rbx-components.ComponentClassProvider" -ComponentClassProvider.dependencies = table.freeze({ +ComponentClassProvider.dependencies = table.freeze { componentProvider = ComponentProvider, -}) +} ComponentClassProvider._components = {} :: { types.AnyComponent } diff --git a/rbx-components/extend-root/init.luau b/rbx-components/extend-root/init.luau new file mode 100644 index 00000000..38ebbd7d --- /dev/null +++ b/rbx-components/extend-root/init.luau @@ -0,0 +1,28 @@ +local ComponentProvider = require "./component-provider" +local createComponentClassProvider = require "@self/create-component-class-provider" +local logger = require "./logger" +local roots = require "../roots" +local types = require "./types" +local useComponent = require "@self/use-component" +local useComponents = require "@self/use-components" +local useModuleAsComponent = require "@self/use-module-as-component" +local useModulesAsComponents = require "@self/use-modules-as-components" + +local function extendRoot(root: types.RootPrivate): types.Root + if root._hasComponentExtensions then return logger:fatalError { template = logger.alreadyExtendedRoot } end + + root._hasComponentExtensions = true + root._classes = {} + + root:useProvider(ComponentProvider) + root:useProvider(createComponentClassProvider(root._classes)) + + root.useComponent = useComponent :: any + root.useComponents = useComponents :: any + root.useModuleAsComponent = useModuleAsComponent :: any + root.useModulesAsComponents = useModulesAsComponents :: any + + return root +end + +return extendRoot :: (root: roots.Root) -> types.Root diff --git a/dist/pesde/lune/rbx-components/src/extend-root/use-component.luau b/rbx-components/extend-root/use-component.luau similarity index 82% rename from dist/pesde/lune/rbx-components/src/extend-root/use-component.luau rename to rbx-components/extend-root/use-component.luau index b0bd8d1f..e68c8a06 100644 --- a/dist/pesde/lune/rbx-components/src/extend-root/use-component.luau +++ b/rbx-components/extend-root/use-component.luau @@ -1,4 +1,4 @@ -local types = require("../types") +local types = require "../types" local function useComponent(root: types.RootPrivate, component: types.AnyComponent) table.insert(root._classes, component) diff --git a/dist/pesde/lune/rbx-components/src/extend-root/use-components.luau b/rbx-components/extend-root/use-components.luau similarity index 86% rename from dist/pesde/lune/rbx-components/src/extend-root/use-components.luau rename to rbx-components/extend-root/use-components.luau index 809a4006..0e56b047 100644 --- a/dist/pesde/lune/rbx-components/src/extend-root/use-components.luau +++ b/rbx-components/extend-root/use-components.luau @@ -1,4 +1,4 @@ -local types = require("../types") +local types = require "../types" local function useComponents(root: types.RootPrivate, components: { types.AnyComponent }) for index = 1, #components do diff --git a/dist/pesde/lune/rbx-components/src/extend-root/use-module-as-component.luau b/rbx-components/extend-root/use-module-as-component.luau similarity index 50% rename from dist/pesde/lune/rbx-components/src/extend-root/use-module-as-component.luau rename to rbx-components/extend-root/use-module-as-component.luau index 46724fe7..e9902371 100644 --- a/dist/pesde/lune/rbx-components/src/extend-root/use-module-as-component.luau +++ b/rbx-components/extend-root/use-module-as-component.luau @@ -1,11 +1,9 @@ -local componentClasses = require("../component-classes") -local types = require("../types") +local componentClasses = require "../component-classes" +local types = require "../types" local function useModuleAsComponent(root: types.RootPrivate, module: ModuleScript) local required = (require)(module) - if componentClasses[required] then - table.insert(root, required) - end + if componentClasses[required] then table.insert(root, required) end return root end diff --git a/rbx-components/extend-root/use-modules-as-components.luau b/rbx-components/extend-root/use-modules-as-components.luau new file mode 100644 index 00000000..ed253b6a --- /dev/null +++ b/rbx-components/extend-root/use-modules-as-components.luau @@ -0,0 +1,22 @@ +local componentClasses = require "../component-classes" +local types = require "../types" + +local function useModulesAsComponents( + root: types.RootPrivate, + modules: { Instance }, + predicate: ((ModuleScript) -> boolean)? +) + for index = 1, #modules do + local module = modules[index] + + if not module:IsA "ModuleScript" then continue end + + if predicate and not predicate(module) then continue end + + local required = (require)(module) + if componentClasses[required] then table.insert(root, required) end + end + return root +end + +return useModulesAsComponents diff --git a/dist/npm/rbx-components/src/init.luau b/rbx-components/init.luau similarity index 59% rename from dist/npm/rbx-components/src/init.luau rename to rbx-components/init.luau index 598bcea4..e3e80a6f 100644 --- a/dist/npm/rbx-components/src/init.luau +++ b/rbx-components/init.luau @@ -1,7 +1,7 @@ -local componentClasses = require("@self/component-classes") -local create = require("@self/create") -local extendRoot = require("@self/extend-root") -local types = require("@self/types") +local componentClasses = require "@self/component-classes" +local create = require "@self/create" +local extendRoot = require "@self/extend-root" +local types = require "@self/types" export type Component = types.Component export type Root = types.Root @@ -9,16 +9,14 @@ export type Root = types.Root local components = { create = create, extendRoot = extendRoot, - _ = table.freeze({ + _ = table.freeze { componentClasses = componentClasses, - }), + }, } local mt = {} -function mt.__call(_, component: Self): types.Component - return create(component) -end +function mt.__call(_, component: Self): types.Component return create(component) end table.freeze(mt) return table.freeze(setmetatable(components, mt)) diff --git a/dist/pesde/lune/rbx-components/src/logger.luau b/rbx-components/logger.luau similarity index 87% rename from dist/pesde/lune/rbx-components/src/logger.luau rename to rbx-components/logger.luau index edcc7fac..563004ea 100644 --- a/dist/pesde/lune/rbx-components/src/logger.luau +++ b/rbx-components/logger.luau @@ -1,6 +1,6 @@ -local logger = require("../logger") +local logger = require "../logger" -return logger.create("@prvdmwrong/rbx-components", logger.standardErrorInfoUrl("rbx-components"), { +return logger.create("@prvdmwrong/rbx-components", logger.standardErrorInfoUrl "rbx-components", { alreadyExtendedRoot = "Root already has component extension.", invalidComponent = "Not a component, create one with `components(MyComponent)` or `components.create(MyComponent)`.", alreadyRegisteredComponent = "Component already registered.", diff --git a/dist/pesde/luau/rbx-components/src/types.luau b/rbx-components/types.luau similarity index 92% rename from dist/pesde/luau/rbx-components/src/types.luau rename to rbx-components/types.luau index 5bc17dcf..26f899a2 100644 --- a/dist/pesde/luau/rbx-components/src/types.luau +++ b/rbx-components/types.luau @@ -1,5 +1,5 @@ -local dependencies = require("../dependencies") -local roots = require("../roots") +local dependencies = require "../dependencies" +local roots = require "../roots" export type Component = dependencies.Dependency, diff --git a/rbx-lifecycles/init.luau b/rbx-lifecycles/init.luau new file mode 100644 index 00000000..47a0165b --- /dev/null +++ b/rbx-lifecycles/init.luau @@ -0,0 +1,81 @@ +local Players = game:GetService "Players" +local RunService = game:GetService "RunService" + +local prvd = require "./prvdmwrong" + +local fireConcurrent = prvd.fireConcurrent + +local RbxLifecycles = {} +RbxLifecycles.name = "@prvdmwrong/rbx-lifecycles" +RbxLifecycles.priority = -math.huge + +RbxLifecycles.preSimulation = prvd.lifecycle("onPreSimulation", fireConcurrent) :: prvd.Lifecycle +RbxLifecycles.postSimulation = prvd.lifecycle("onPostSimulation", fireConcurrent) :: prvd.Lifecycle +RbxLifecycles.preAnimation = prvd.lifecycle("onPreAnimation", fireConcurrent) :: prvd.Lifecycle +RbxLifecycles.preRender = prvd.lifecycle("onPreRender", fireConcurrent) :: prvd.Lifecycle +RbxLifecycles.playerAdded = prvd.lifecycle("onPlayerAdded", fireConcurrent) :: prvd.Lifecycle +RbxLifecycles.playerRemoving = prvd.lifecycle("onPlayerRemoving", fireConcurrent) :: prvd.Lifecycle +RbxLifecycles.characterAdded = prvd.lifecycle("onCharacterAdded", fireConcurrent) :: prvd.Lifecycle +RbxLifecycles.characterRemoving = prvd.lifecycle("onCharacterRemoving", fireConcurrent) :: prvd.Lifecycle +RbxLifecycles.localCharacterAdded = prvd.lifecycle("onLocalCharacterAdded", fireConcurrent) :: prvd.Lifecycle +RbxLifecycles.localCharacterRemoving = + prvd.lifecycle("onLocalCharacterRemoving", fireConcurrent) :: prvd.Lifecycle + +local function wrapLifecycle(lifecycle: prvd.Lifecycle<...unknown>) + return function(...: unknown) lifecycle:fire(...) end +end + +function RbxLifecycles.constructor(self: RbxLifecycles) + self.connections = {} :: { RBXScriptConnection } + + self:_addConnections( + RunService.PreSimulation:Connect(wrapLifecycle(RbxLifecycles.preSimulation :: any)), + RunService.PostSimulation:Connect(wrapLifecycle(RbxLifecycles.postSimulation :: any)), + RunService.PreAnimation:Connect(wrapLifecycle(RbxLifecycles.preAnimation :: any)) + ) + + if RunService:IsClient() then + self:_addConnections(RunService.PreRender:Connect(wrapLifecycle(RbxLifecycles.preRender :: any))) + end + + local function onPlayerAdded(player: Player) + self.playerAdded:fire(player) + + local character = player.Character or player.CharacterAdded:Wait() + self.characterAdded:fire(character) + + if player == Players.LocalPlayer then self.localCharacterAdded:fire(character) end + end + + for _, existingPlayer in Players:GetPlayers() do + task.spawn(onPlayerAdded, existingPlayer) + end + + self:_addConnections( + Players.PlayerAdded:Connect(onPlayerAdded), + Players.PlayerRemoving:Connect(wrapLifecycle(RbxLifecycles.playerRemoving :: any)) + ) +end + +function RbxLifecycles.finish(self: RbxLifecycles) + for _, connection in self.connections do + if connection.Connected then connection:Disconnect() end + end + table.clear(self.connections) +end + +function RbxLifecycles._addConnections(self: RbxLifecycles, ...: RBXScriptConnection) + for index = 1, select("#", ...) do + table.insert(self.connections, select(index, ...) :: any) + end +end + +-- Needed so typescript can require the provider as: +-- +-- ```ts +-- import { RbxLifecycles } from "@rbxts/rbx-lifecycles" +-- ``` +RbxLifecycles.RbxLifecycles = RbxLifecycles + +export type RbxLifecycles = typeof(RbxLifecycles) +return prvd(RbxLifecycles) diff --git a/rokit.toml b/rokit.toml index f44178d6..49df5b2a 100644 --- a/rokit.toml +++ b/rokit.toml @@ -4,10 +4,8 @@ # New tools can be added by running `rokit add ` in a terminal. [tools] -stylua = "JohnnyMorganz/StyLua@2.3.1" -luau-lsp = "JohnnyMorganz/luau-lsp@1.58.0" -rojo = "rojo-rbx/rojo@7.6.1" -# Runtimes -lune = "lune-org/lune@0.10.4" -zune = "Scythe-Technology/Zune@0.5.2" -lute = "luau-lang/lute@0.1.0-nightly.20251220" +luau-lsp = "JohnnyMorganz/luau-lsp@1.68.0" +pesde = "pesde-pkg/pesde@0.7.3+registry.0.2.3" +stylua = "JohnnyMorganz/StyLua@2.5.2" +lute = "luau-lang/lute@1.0.0" +rojo = "rojo-rbx/rojo@7.7.0-rc.1" diff --git a/roots/create.luau b/roots/create.luau new file mode 100644 index 00000000..f0e3e9a7 --- /dev/null +++ b/roots/create.luau @@ -0,0 +1,48 @@ +local destroy = require "./methods/destroy" +local lifecycles = require "../lifecycles" +local rootConstructing = require "./hooks/root-constructing" +local start = require "./methods/start" +local types = require "./types" +local useModule = require "./methods/use-module" +local useModules = require "./methods/use-modules" +local useProvider = require "./methods/use-provider" +local useProviders = require "./methods/use-providers" +local useRoot = require "./methods/use-root" +local useRoots = require "./methods/use-roots" +local willFinish = require "./methods/will-finish" +local willStart = require "./methods/will-start" + +local function create(): types.Root + local self: types.Self = { + type = "Root", + + start = start, + + useProvider = useProvider, + useProviders = useProviders, + useModule = useModule, + useModules = useModules, + useRoot = useRoot, + useRoots = useRoots, + destroy = destroy, + + willStart = willStart, + willFinish = willFinish, + + _destroyed = false, + _rootProviders = {}, + _rootLifecycles = {}, + _subRoots = {}, + -- WTH DEVIATION: better method names, to be upstreamed + _start = lifecycles.create("onStart", lifecycles.handlers.fireConcurrent), + _finish = lifecycles.create("onFinish", lifecycles.handlers.fireSequential), + } :: any + + for _, callback in rootConstructing.callbacks do + callback(self) + end + + return self +end + +return create diff --git a/dist/pesde/lune/roots/src/hooks/lifecycle-used.luau b/roots/hooks/lifecycle-used.luau similarity index 60% rename from dist/pesde/lune/roots/src/hooks/lifecycle-used.luau rename to roots/hooks/lifecycle-used.luau index bd29276a..d15e5ab4 100644 --- a/dist/pesde/lune/roots/src/hooks/lifecycle-used.luau +++ b/roots/hooks/lifecycle-used.luau @@ -1,16 +1,14 @@ -local lifecycles = require("../../lifecycles") -local types = require("../types") +local lifecycles = require "../../lifecycles" +local types = require "../types" local callbacks: { (root: types.Self, provider: lifecycles.Lifecycle) -> () } = {} local function onLifecycleUsed(listener: (root: types.Root, lifecycle: lifecycles.Lifecycle) -> ()): () -> () table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end + return function() table.remove(callbacks, table.find(callbacks, listener)) end end -return table.freeze({ +return table.freeze { callbacks = callbacks, onLifecycleUsed = onLifecycleUsed, -}) +} diff --git a/dist/pesde/lune/roots/src/hooks/provider-used.luau b/roots/hooks/provider-used.luau similarity index 61% rename from dist/pesde/lune/roots/src/hooks/provider-used.luau rename to roots/hooks/provider-used.luau index dac2573c..f4d93347 100644 --- a/dist/pesde/lune/roots/src/hooks/provider-used.luau +++ b/roots/hooks/provider-used.luau @@ -1,16 +1,14 @@ -local providers = require("../../providers") -local types = require("../types") +local providers = require "../../providers" +local types = require "../types" local callbacks: { (root: types.Self, provider: providers.Provider) -> () } = {} local function onProviderUsed(listener: (root: types.Root, provider: providers.Provider) -> ()): () -> () table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end + return function() table.remove(callbacks, table.find(callbacks, listener)) end end -return table.freeze({ +return table.freeze { callbacks = callbacks, onProviderUsed = onProviderUsed, -}) +} diff --git a/dist/pesde/lune/roots/src/hooks/root-constructing.luau b/roots/hooks/root-constructing.luau similarity index 62% rename from dist/pesde/lune/roots/src/hooks/root-constructing.luau rename to roots/hooks/root-constructing.luau index 5fb8b819..22126b9b 100644 --- a/dist/pesde/lune/roots/src/hooks/root-constructing.luau +++ b/roots/hooks/root-constructing.luau @@ -1,15 +1,13 @@ -local types = require("../types") +local types = require "../types" local callbacks: { (root: types.Self) -> () } = {} local function onRootConstructing(listener: (root: types.Root) -> ()): () -> () table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end + return function() table.remove(callbacks, table.find(callbacks, listener)) end end -return table.freeze({ +return table.freeze { callbacks = callbacks, onRootConstructing = onRootConstructing, -}) +} diff --git a/dist/pesde/roblox/roots/src/hooks/root-destroyed.luau b/roots/hooks/root-destroyed.luau similarity index 61% rename from dist/pesde/roblox/roots/src/hooks/root-destroyed.luau rename to roots/hooks/root-destroyed.luau index 10b79b54..f26eed20 100644 --- a/dist/pesde/roblox/roots/src/hooks/root-destroyed.luau +++ b/roots/hooks/root-destroyed.luau @@ -1,15 +1,13 @@ -local types = require("../types") +local types = require "../types" local callbacks: { (root: types.Self) -> () } = {} local function onRootDestroyed(listener: (root: types.Root) -> ()): () -> () table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end + return function() table.remove(callbacks, table.find(callbacks, listener)) end end -return table.freeze({ +return table.freeze { callbacks = callbacks, onRootDestroyed = onRootDestroyed, -}) +} diff --git a/dist/pesde/luau/roots/src/hooks/root-finished.luau b/roots/hooks/root-finished.luau similarity index 61% rename from dist/pesde/luau/roots/src/hooks/root-finished.luau rename to roots/hooks/root-finished.luau index d3519cea..1027ec0f 100644 --- a/dist/pesde/luau/roots/src/hooks/root-finished.luau +++ b/roots/hooks/root-finished.luau @@ -1,15 +1,13 @@ -local types = require("../types") +local types = require "../types" local callbacks: { (root: types.Self) -> () } = {} local function onRootFinished(listener: (root: types.Root) -> ()): () -> () table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end + return function() table.remove(callbacks, table.find(callbacks, listener)) end end -return table.freeze({ +return table.freeze { callbacks = callbacks, onRootFinished = onRootFinished, -}) +} diff --git a/dist/pesde/roblox/roots/src/hooks/root-started.luau b/roots/hooks/root-started.luau similarity index 61% rename from dist/pesde/roblox/roots/src/hooks/root-started.luau rename to roots/hooks/root-started.luau index 2ae6f90c..aff71743 100644 --- a/dist/pesde/roblox/roots/src/hooks/root-started.luau +++ b/roots/hooks/root-started.luau @@ -1,15 +1,13 @@ -local types = require("../types") +local types = require "../types" local callbacks: { (root: types.Self) -> () } = {} local function onRootStarted(listener: (root: types.Root) -> ()): () -> () table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end + return function() table.remove(callbacks, table.find(callbacks, listener)) end end -return table.freeze({ +return table.freeze { callbacks = callbacks, onRootStarted = onRootStarted, -}) +} diff --git a/dist/pesde/luau/roots/src/hooks/root-used.luau b/roots/hooks/root-used.luau similarity index 64% rename from dist/pesde/luau/roots/src/hooks/root-used.luau rename to roots/hooks/root-used.luau index 71f172cc..3e0c26e1 100644 --- a/dist/pesde/luau/roots/src/hooks/root-used.luau +++ b/roots/hooks/root-used.luau @@ -1,15 +1,13 @@ -local types = require("../types") +local types = require "../types" local callbacks: { (root: types.Self, subRoot: types.Root) -> () } = {} local function onRootUsed(listener: (root: types.Root, subRoot: types.Root) -> ()): () -> () table.insert(callbacks, listener) - return function() - table.remove(callbacks, table.find(callbacks, listener)) - end + return function() table.remove(callbacks, table.find(callbacks, listener)) end end -return table.freeze({ +return table.freeze { callbacks = callbacks, onRootUsed = onRootUsed, -}) +} diff --git a/roots/init.luau b/roots/init.luau new file mode 100644 index 00000000..857a4577 --- /dev/null +++ b/roots/init.luau @@ -0,0 +1,28 @@ +local create = require "@self/create" +local lifecycleUsed = require "@self/hooks/lifecycle-used" +local providerUsed = require "@self/hooks/provider-used" +local rootConstructing = require "@self/hooks/root-constructing" +local rootDestroyed = require "@self/hooks/root-destroyed" +local rootFinished = require "@self/hooks/root-finished" +local rootStarted = require "@self/hooks/root-started" +local rootUsed = require "@self/hooks/root-used" +local types = require "@self/types" + +export type Root = types.Root +export type StartedRoot = types.StartedRoot + +local roots = table.freeze { + create = create, + hooks = table.freeze { + onLifecycleUsed = lifecycleUsed.onLifecycleUsed, + onProviderUsed = providerUsed.onProviderUsed, + onRootUsed = rootUsed.onRootUsed, + + onRootConstructing = rootConstructing.onRootConstructing, + onRootStarted = rootStarted.onRootStarted, + onRootFinished = rootFinished.onRootFinished, + onRootDestroyed = rootDestroyed.onRootDestroyed, + }, +} + +return roots diff --git a/dist/pesde/lune/roots/src/logger.luau b/roots/logger.luau similarity index 81% rename from dist/pesde/lune/roots/src/logger.luau rename to roots/logger.luau index 92e611ef..211115f3 100644 --- a/dist/pesde/lune/roots/src/logger.luau +++ b/roots/logger.luau @@ -1,6 +1,6 @@ -local logger = require("../logger") +local logger = require "../logger" -return logger.create("@prvdmwrong/roots", logger.standardErrorInfoUrl("roots"), { +return logger.create("@prvdmwrong/roots", logger.standardErrorInfoUrl "roots", { useAfterDestroy = "Cannot use Root after it is destroyed.", alreadyDestroyed = "Cannot destroy an already destroyed Root.", alreadyFinished = "Root has already finished.", diff --git a/dist/pesde/roblox/roots/src/methods/destroy.luau b/roots/methods/destroy.luau similarity index 58% rename from dist/pesde/roblox/roots/src/methods/destroy.luau rename to roots/methods/destroy.luau index 0c62a935..5e72ddac 100644 --- a/dist/pesde/roblox/roots/src/methods/destroy.luau +++ b/roots/methods/destroy.luau @@ -1,10 +1,8 @@ -local logger = require("../logger") -local types = require("../types") +local logger = require "../logger" +local types = require "../types" local function destroy(root: types.Self) - if root._destroyed then - logger:fatalError({ template = logger.alreadyDestroyed }) - end + if root._destroyed then logger:fatalError { template = logger.alreadyDestroyed } end root._destroyed = true table.clear(root._rootLifecycles) table.clear(root._rootProviders) diff --git a/dist/pesde/lune/roots/src/methods/start.luau b/roots/methods/start.luau similarity index 62% rename from dist/pesde/lune/roots/src/methods/start.luau rename to roots/methods/start.luau index 3f24dac5..c880cecd 100644 --- a/dist/pesde/lune/roots/src/methods/start.luau +++ b/roots/methods/start.luau @@ -1,10 +1,10 @@ -local dependencies = require("../../dependencies") -local lifecycles = require("../../lifecycles") -local logger = require("../logger") -local providers = require("../../providers") +local dependencies = require "../../dependencies" +local lifecycles = require "../../lifecycles" +local logger = require "../logger" +local providers = require "../../providers" local rootFinished = require("../hooks/root-finished").callbacks local rootStarted = require("../hooks/root-started").callbacks -local types = require("../types") +local types = require "../types" local function bindLifecycle(lifecycle: lifecycles.Lifecycle<...any>, provider: providers.Provider) local lifecycleMethod = (provider :: any)[lifecycle.method] @@ -20,9 +20,7 @@ local function bindLifecycle(lifecycle: lifecycles.Lifecycle<...any>, provider: -- debug.profileend() -- end) -- else - lifecycle:register(function(...) - lifecycleMethod(provider, ...) - end) + lifecycle:register(function(...) lifecycleMethod(provider, ...) end) -- end end end @@ -40,17 +38,37 @@ local function start(root: types.Self): types.StartedRoot dependencies.sortByPriority(sortedProviders) local constructedProviders = {} + + -- PHASE 1: Instantiate everything first so they all exist in memory + for _, provider in sortedProviders do + -- If your provider.new() strictly REQUIRES dependencies immediately at creation, + -- pass an empty table that we mutate in Phase 2, or construct them with a placeholder. + local constructed = provider.new {} + constructedProviders[provider] = constructed + end + + -- PHASE 2: Resolve dependencies and bind lifecycles now that everyone exists for _, provider in sortedProviders do + local constructed = constructedProviders[provider] local providerDependencies = (provider :: any).dependencies + if typeof(providerDependencies) == "table" then - providerDependencies = table.clone(providerDependencies) - for key, value in providerDependencies do - providerDependencies[key] = constructedProviders[value] + -- Rebuild the actual dependency table with the INSTANCES we created in Phase 1 + local resolvedDeps = {} + for key, dependencyBlueprint in providerDependencies do + local instance = constructedProviders[dependencyBlueprint] + if not instance then + logger:fatalError { template = "Missing dependency: " .. tostring(dependencyBlueprint) } + end + resolvedDeps[key] = instance end + + -- Inject the resolved dependencies into the constructed instance + -- (Assuming your framework allows injecting post-init, or via a method) + constructed.dependencies = resolvedDeps end - local constructed = provider.new(providerDependencies) - constructedProviders[provider] = constructed + -- Now safe to bind lifecycles bindLifecycle(root._start, constructed) bindLifecycle(root._finish, constructed) @@ -72,9 +90,7 @@ local function start(root: types.Self): types.StartedRoot local didFinish = false function startedRoot:finish() - if didFinish then - return logger:fatalError({ template = logger.alreadyFinished }) - end + if didFinish then return logger:fatalError { template = logger.alreadyFinished } end didFinish = true root._finish:fire() diff --git a/dist/pesde/lune/roots/src/methods/use-lifecycle.luau b/roots/methods/use-lifecycle.luau similarity index 73% rename from dist/pesde/lune/roots/src/methods/use-lifecycle.luau rename to roots/methods/use-lifecycle.luau index 862c2d07..1e33bb8e 100644 --- a/dist/pesde/lune/roots/src/methods/use-lifecycle.luau +++ b/roots/methods/use-lifecycle.luau @@ -1,7 +1,7 @@ local lifecycleUsed = require("../hooks/lifecycle-used").callbacks -local lifecycles = require("../../lifecycles") -local runtime = require("../../runtime") -local types = require("../types") +local lifecycles = require "../../lifecycles" +local runtime = require "../../runtime" +local types = require "../types" local threadpool = runtime.threadpool diff --git a/dist/pesde/roblox/roots/src/methods/use-lifecycles.luau b/roots/methods/use-lifecycles.luau similarity index 75% rename from dist/pesde/roblox/roots/src/methods/use-lifecycles.luau rename to roots/methods/use-lifecycles.luau index 3f12341f..c09931ac 100644 --- a/dist/pesde/roblox/roots/src/methods/use-lifecycles.luau +++ b/roots/methods/use-lifecycles.luau @@ -1,7 +1,7 @@ local lifecycleUsed = require("../hooks/lifecycle-used").callbacks -local lifecycles = require("../../lifecycles") -local runtime = require("../../runtime") -local types = require("../types") +local lifecycles = require "../../lifecycles" +local runtime = require "../../runtime" +local types = require "../types" local threadpool = runtime.threadpool diff --git a/dist/pesde/lune/roots/src/methods/use-module.luau b/roots/methods/use-module.luau similarity index 68% rename from dist/pesde/lune/roots/src/methods/use-module.luau rename to roots/methods/use-module.luau index a96b3d17..460236b8 100644 --- a/dist/pesde/lune/roots/src/methods/use-module.luau +++ b/roots/methods/use-module.luau @@ -1,7 +1,7 @@ local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") +local providers = require "../../providers" +local runtime = require "../../runtime" +local types = require "../types" local threadpool = runtime.threadpool local providerClasses = providers._.providerClasses @@ -11,9 +11,7 @@ local function useModule(root: types.Self, module: ModuleScript) if providerClasses[moduleExport] then root._rootProviders[moduleExport] = true - if typeof(moduleExport.name) ~= "string" then - moduleExport.name = module.Name - end + if typeof(moduleExport.name) ~= "string" then moduleExport.name = module.Name end threadpool.spawnCallbacks(providerUsed, root, moduleExport) end diff --git a/dist/pesde/lune/roots/src/methods/use-modules.luau b/roots/methods/use-modules.luau similarity index 63% rename from dist/pesde/lune/roots/src/methods/use-modules.luau rename to roots/methods/use-modules.luau index 8354a9d0..85396e2d 100644 --- a/dist/pesde/lune/roots/src/methods/use-modules.luau +++ b/roots/methods/use-modules.luau @@ -1,23 +1,19 @@ local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") +local providers = require "../../providers" +local runtime = require "../../runtime" +local types = require "../types" local threadpool = runtime.threadpool local providerClasses = providers._.providerClasses local function useModules(root: types.Self, modules: { Instance }, predicate: ((module: ModuleScript) -> boolean)?) for _, module in modules do - if not module:IsA("ModuleScript") or predicate and not predicate(module) then - continue - end + if not module:IsA "ModuleScript" or predicate and not predicate(module) then continue end local moduleExport = (require)(module) if providerClasses[moduleExport] then root._rootProviders[moduleExport] = true - if typeof(moduleExport.name) ~= "string" then - moduleExport.name = module.Name - end + if typeof(moduleExport.name) ~= "string" then moduleExport.name = module.Name end threadpool.spawnCallbacks(providerUsed, root, moduleExport) end end diff --git a/dist/pesde/lune/roots/src/methods/use-provider.luau b/roots/methods/use-provider.luau similarity index 72% rename from dist/pesde/lune/roots/src/methods/use-provider.luau rename to roots/methods/use-provider.luau index 277d8049..ad7e11d1 100644 --- a/dist/pesde/lune/roots/src/methods/use-provider.luau +++ b/roots/methods/use-provider.luau @@ -1,7 +1,7 @@ local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") +local providers = require "../../providers" +local runtime = require "../../runtime" +local types = require "../types" local threadpool = runtime.threadpool diff --git a/dist/pesde/roblox/roots/src/methods/use-providers.luau b/roots/methods/use-providers.luau similarity index 75% rename from dist/pesde/roblox/roots/src/methods/use-providers.luau rename to roots/methods/use-providers.luau index 1489c3a3..41e3a00b 100644 --- a/dist/pesde/roblox/roots/src/methods/use-providers.luau +++ b/roots/methods/use-providers.luau @@ -1,7 +1,7 @@ local providerUsed = require("../hooks/provider-used").callbacks -local providers = require("../../providers") -local runtime = require("../../runtime") -local types = require("../types") +local providers = require "../../providers" +local runtime = require "../../runtime" +local types = require "../types" local threadpool = runtime.threadpool diff --git a/dist/pesde/luau/roots/src/methods/use-root.luau b/roots/methods/use-root.luau similarity index 78% rename from dist/pesde/luau/roots/src/methods/use-root.luau rename to roots/methods/use-root.luau index efc4ad1e..a84f94b8 100644 --- a/dist/pesde/luau/roots/src/methods/use-root.luau +++ b/roots/methods/use-root.luau @@ -1,6 +1,6 @@ local rootUsed = require("../hooks/root-used").callbacks -local runtime = require("../../runtime") -local types = require("../types") +local runtime = require "../../runtime" +local types = require "../types" local threadpool = runtime.threadpool diff --git a/dist/pesde/luau/roots/src/methods/use-roots.luau b/roots/methods/use-roots.luau similarity index 81% rename from dist/pesde/luau/roots/src/methods/use-roots.luau rename to roots/methods/use-roots.luau index 7b5b9dda..92fba4f8 100644 --- a/dist/pesde/luau/roots/src/methods/use-roots.luau +++ b/roots/methods/use-roots.luau @@ -1,6 +1,6 @@ local rootUsed = require("../hooks/root-used").callbacks -local runtime = require("../../runtime") -local types = require("../types") +local runtime = require "../../runtime" +local types = require "../types" local threadpool = runtime.threadpool diff --git a/dist/pesde/roblox/roots/src/methods/will-finish.luau b/roots/methods/will-finish.luau similarity index 79% rename from dist/pesde/roblox/roots/src/methods/will-finish.luau rename to roots/methods/will-finish.luau index 893088f4..3f3d5ad3 100644 --- a/dist/pesde/roblox/roots/src/methods/will-finish.luau +++ b/roots/methods/will-finish.luau @@ -1,4 +1,4 @@ -local types = require("../types") +local types = require "../types" local function willFinish(root: types.Self, callback: () -> ()) root._finish:register(callback) diff --git a/dist/pesde/roblox/roots/src/methods/will-start.luau b/roots/methods/will-start.luau similarity index 79% rename from dist/pesde/roblox/roots/src/methods/will-start.luau rename to roots/methods/will-start.luau index 7c3d88c3..b69581ca 100644 --- a/dist/pesde/roblox/roots/src/methods/will-start.luau +++ b/roots/methods/will-start.luau @@ -1,4 +1,4 @@ -local types = require("../types") +local types = require "../types" local function willStart(root: types.Self, callback: () -> ()) root._start:register(callback) diff --git a/dist/pesde/lune/roots/src/types.luau b/roots/types.luau similarity index 84% rename from dist/pesde/lune/roots/src/types.luau rename to roots/types.luau index 104143c4..38d9b625 100644 --- a/dist/pesde/lune/roots/src/types.luau +++ b/roots/types.luau @@ -1,5 +1,5 @@ -local lifecycles = require("../lifecycles") -local providers = require("../providers") +local lifecycles = require "../lifecycles" +local providers = require "../providers" type Set = { [T]: true } @@ -18,8 +18,8 @@ export type Root = { useLifecycles: (root: Root, lifecycles: { lifecycles.Lifecycle }) -> Root, destroy: (root: Root) -> (), - willStart: (callback: () -> ()) -> Root, - willFinish: (callback: () -> ()) -> Root, + willStart: (root: Root, callback: () -> ()) -> Root, + willFinish: (root: Root, callback: () -> ()) -> Root, } export type StartedRoot = { diff --git a/runtime/init.luau b/runtime/init.luau new file mode 100644 index 00000000..8665cc7f --- /dev/null +++ b/runtime/init.luau @@ -0,0 +1,16 @@ +-- Son its just Roblox +-- local implementations = require("@self/implementations") +-- local task = require("@self/libs/task") +local threadpool = require "@self/threadpool" +-- local warn = require("@self/libs/warn") + +-- export type RuntimeName = implementations.RuntimeName + +return table.freeze { + name = "roblox", + + task = task, + warn = warn, + + threadpool = threadpool, +} diff --git a/dist/pesde/lune/runtime/src/batteries/threadpool.luau b/runtime/threadpool.luau similarity index 76% rename from dist/pesde/lune/runtime/src/batteries/threadpool.luau rename to runtime/threadpool.luau index 6caf08b4..05ca7160 100644 --- a/dist/pesde/lune/runtime/src/batteries/threadpool.luau +++ b/runtime/threadpool.luau @@ -1,5 +1,3 @@ -local task = require("../libs/task") - local freeThreads: { thread } = {} local function run(f: (T...) -> (), thread: thread, ...) @@ -9,11 +7,11 @@ end local function yielder() while true do - run(coroutine.yield()) + (run :: any)(coroutine.yield()) end end -local function spawn(f: (T...) -> (), ...: T...) +local function spawn(f: (T...) -> (), ...: T...): thread local thread if #freeThreads > 0 then thread = freeThreads[#freeThreads] @@ -23,7 +21,7 @@ local function spawn(f: (T...) -> (), ...: T...) coroutine.resume(thread) end - task.spawn(thread, f, thread, ...) + return task.spawn(thread, f, thread, ...) end local function spawnCallbacks(callbacks: { (Args...) -> () }, ...: Args...) @@ -32,7 +30,7 @@ local function spawnCallbacks(callbacks: { (Args...) -> () }, ...: Args end end -return table.freeze({ +return table.freeze { spawn = spawn, spawnCallbacks = spawnCallbacks, -}) +} diff --git a/dist/npm/runtime/src/types.luau b/runtime/types.luau similarity index 53% rename from dist/npm/runtime/src/types.luau rename to runtime/types.luau index ca050fce..c105b874 100644 --- a/dist/npm/runtime/src/types.luau +++ b/runtime/types.luau @@ -4,10 +4,8 @@ export type Runtime = { is: () -> boolean, } -local function Runtime(x: Runtime) - return table.freeze(x) -end +local function Runtime(x: Runtime) return table.freeze(x) end -return table.freeze({ +return table.freeze { Runtime = Runtime, -}) +} diff --git a/sitegen/README.md b/sitegen/README.md deleted file mode 100644 index facc8a0d..00000000 --- a/sitegen/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# Sitegen - -## Usage - -```sh -lune run sitegen watch -``` - -## Acknowledgements - -- -- \ No newline at end of file diff --git a/sitegen/build.luau b/sitegen/build.luau deleted file mode 100644 index c968aaec..00000000 --- a/sitegen/build.luau +++ /dev/null @@ -1,26 +0,0 @@ -local fs = require("@lune/fs") -local h = require("./h") -local path = require("@lune-lib/utils/path") -local process = require("@lune/process") -local siteUrls = require("@sitegen/config/site-urls") -local sitemap = require("@sitegen/config/sitemap") - -local rootPath = process.args[1] - -pcall(fs.removeDir, "site") -fs.copy(path(rootPath, "static"), siteUrls.base) - -for _, location in sitemap do - local locationPath = location.path:gsub("^/", ""):gsub("/$", ""):split("/") - local parentPath = table.clone(locationPath) - parentPath[#parentPath] = nil - - local dirPath = path(siteUrls.base, table.unpack(locationPath)) - local filePath = path(dirPath, "index.html") - - print("Rendering page", filePath) - local rendered = h.flatten(location.render(location.props)) - - pcall(fs.writeDir, dirPath) - fs.writeFile(filePath, rendered) -end diff --git a/sitegen/components/article.luau b/sitegen/components/article.luau deleted file mode 100644 index 0141d423..00000000 --- a/sitegen/components/article.luau +++ /dev/null @@ -1,74 +0,0 @@ -local Document = require("./document") -local h = require("@sitegen/h") -local siteBaseUrl = require("@sitegen/utils/site-base-url") - -export type ArticleSection = { - title: string, - content: { h.Child }, - sections: { ArticleSection }?, -} - -local headings = { - h.h1, - h.h2, - h.h3, - h.h4, - h.h5, - h.h6, -} - -local defaultHeading = h.h6 - -local function Article(props: ArticleSection) - local toc = {} - - local content = { - h.h1(props.title) :: any, - props.content, - } - - local function processSections(sections: { ArticleSection }, depth: number) - for _, section in sections do - table.insert(content, { - (headings[depth] or defaultHeading)(section.title), - section.content :: any, - }) - - if section.sections then - processSections(section.sections, depth + 1) - end - end - end - - if props.sections then - processSections(props.sections, 1) - end - - return Document({ - title = props.title, - extraHead = { - h.link({ rel = "stylesheet", href = siteBaseUrl("stylesheets/article.css") }), - }, - main = { - h.section({ - class = "article-container", - - h.nav({ - class = "article-nav", - }), - - h.article({ - class = "article-content", - content, - }), - - h.div({ - class = "article-toc", - toc, - }), - }), - }, - }) -end - -return Article diff --git a/sitegen/components/button.luau b/sitegen/components/button.luau deleted file mode 100644 index 33c50d6b..00000000 --- a/sitegen/components/button.luau +++ /dev/null @@ -1,15 +0,0 @@ -local h = require("@sitegen/h") - -local function Button(props: { - href: string, - [number]: h.Child, -}) - return h.a({ - href = props.href, - class = "button", - - table.unpack(props), - }) -end - -return Button diff --git a/sitegen/components/code-snippet.luau b/sitegen/components/code-snippet.luau deleted file mode 100644 index 4c3a399c..00000000 --- a/sitegen/components/code-snippet.luau +++ /dev/null @@ -1,19 +0,0 @@ -local h = require("@sitegen/h") - -local function CodeSnippet(props: { - language: "lua" | "shell" | "typescript", - - [number]: h.Child, -}) - return h.pre({ - class = `code-snippet`, - - h.code({ - class = `language-{props.language}`, - - table.unpack(props), - }), - }) -end - -return CodeSnippet diff --git a/sitegen/components/document.luau b/sitegen/components/document.luau deleted file mode 100644 index 834159c0..00000000 --- a/sitegen/components/document.luau +++ /dev/null @@ -1,47 +0,0 @@ -local Navbar = require("@sitegen/components/navbar") -local h = require("@sitegen/h") -local siteBaseUrl = require("@sitegen/utils/site-base-url") - -local function Document(props: { - title: string?, - main: h.Child, - header: h.Child?, - extraHead: h.Child?, -}) - return { - "", - h.html({ - lang = "en", - h.head({ - h.meta({ charset = "UTF-8" }), - h.meta({ name = "viewport", content = "width=device-width, initial-scale=1.0" }), - - h.title((if props.title then `{props.title} - ` else "") .. "Prvd 'M Wrong"), - - h.link({ rel = "stylesheet", href = siteBaseUrl("stylesheets/reset.css") }), - h.link({ rel = "stylesheet", href = siteBaseUrl("stylesheets/fonts.css") }), - h.link({ rel = "stylesheet", href = siteBaseUrl("stylesheets/common.css") }), - - h.link({ - rel = "stylesheet", - href = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/default.min.css", - }), - h.script({ src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js" }), - h.script({ src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/languages/lua.min.js" }), - h.script({ src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/languages/ts.min.js" }), - h.script({ src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/languages/shell.min.js" }), - - props.extraHead :: any, - }), - h.body({ - Navbar(), - props.header and h.header(props.header) :: any, - h.main(props.main), - - h.script("hljs.highlightAll();"), - }), - }), - } -end - -return Document diff --git a/sitegen/components/navbar.luau b/sitegen/components/navbar.luau deleted file mode 100644 index 66448880..00000000 --- a/sitegen/components/navbar.luau +++ /dev/null @@ -1,28 +0,0 @@ -local forEach = require("@sitegen/utils/for-each") -local h = require("@sitegen/h") -local navPages = require("@sitegen/config/nav-pages") -local siteBaseUrl = require("@sitegen/utils/site-base-url") - -local function Navbar() - return h.nav({ - class = "navbar", - - h.div({ - class = "navbar-inner", - - h.a({ - href = siteBaseUrl(""), - "Prvd 'M Wrong", - }), - - forEach(navPages, function(index, page) - return index, h.a({ - href = page.href, - page.title, - }) - end) :: any, - }), - }) -end - -return Navbar diff --git a/sitegen/config/common-urls.luau b/sitegen/config/common-urls.luau deleted file mode 100644 index 80b19b67..00000000 --- a/sitegen/config/common-urls.luau +++ /dev/null @@ -1,3 +0,0 @@ -return { - rossThread = "https://discord.com/channels/385151591524597761/1267055070374268969", -} diff --git a/sitegen/config/nav-pages.luau b/sitegen/config/nav-pages.luau deleted file mode 100644 index 9f2c87ab..00000000 --- a/sitegen/config/nav-pages.luau +++ /dev/null @@ -1,30 +0,0 @@ -local siteBaseUrl = require("@sitegen/utils/site-base-url") - -export type NavPage = { - id: string, - href: string, - title: string, -} - -return { - { - id = "learn", - href = siteBaseUrl("learn"), - title = "Learn", - }, - { - id = "api", - href = siteBaseUrl("api"), - title = "API", - }, - { - id = "releases", - href = siteBaseUrl("releases"), - title = "Releases", - }, - { - id = "blog", - href = siteBaseUrl("blog"), - title = "Blog", - }, -} :: { NavPage } diff --git a/sitegen/config/site-urls.luau b/sitegen/config/site-urls.luau deleted file mode 100644 index 95256e58..00000000 --- a/sitegen/config/site-urls.luau +++ /dev/null @@ -1,6 +0,0 @@ -local path = require("@lune-lib/utils/path") -local process = require("@lune/process") - -return { - base = if process.env.IS_CI then "https://prvdmwrong.luau.page/" else path(process.cwd, "site"), -} diff --git a/sitegen/config/sitemap.luau b/sitegen/config/sitemap.luau deleted file mode 100644 index 0c6b4d1c..00000000 --- a/sitegen/config/sitemap.luau +++ /dev/null @@ -1,15 +0,0 @@ -local h = require("@sitegen/h") - -export type SitemapEntry = { - path: string, - render: (Props) -> h.Child, - props: Props, -} - -local sitemap: { SitemapEntry } = { - { path = "", render = require("@sitegen/pages/index") }, - { path = "learn", render = require("@sitegen/pages/learn/index") }, - { path = "learn/installation", render = require("@sitegen/pages/learn/installation") }, -} - -return sitemap diff --git a/sitegen/h.luau b/sitegen/h.luau deleted file mode 100644 index d363ec47..00000000 --- a/sitegen/h.luau +++ /dev/null @@ -1,133 +0,0 @@ -export type Child = string | { Child } - -local function flatten(child: Child): string - if typeof(child) == "string" then - return child - else - local flat = "" - for _, sub_child in child do - flat ..= flatten(sub_child) - end - return flat - end -end - -local function escape(attribute: string): string - attribute = string.gsub(attribute, "&", "&") - attribute = string.gsub(attribute, "<", "<") - attribute = string.gsub(attribute, ">", ">") - attribute = string.gsub(attribute, "'", "'") - attribute = string.gsub(attribute, '"', """) - return attribute -end - -local function createElement(tag: string) - local function element(props: string | { [unknown]: unknown }) - if typeof(props) == "table" then - local attributes = "" - for key, value in props do - if typeof(key) == "string" then - assert(typeof(value) == "string", "HTML attribute value must be string") - attributes ..= ` {key}="{escape(value)}"` - end - end - return `<{tag}{attributes}>{flatten({ table.unpack(props :: any) })}` - end - - return `<{tag}>{props}` - end - - return element -end - -return table.freeze({ - escape = escape, - flatten = flatten, - - div = createElement("div"), - span = createElement("span"), - h1 = createElement("h1"), - h2 = createElement("h2"), - h3 = createElement("h3"), - h4 = createElement("h4"), - h5 = createElement("h5"), - h6 = createElement("h6"), - p = createElement("p"), - a = createElement("a"), - img = createElement("img"), - button = createElement("button"), - input = createElement("input"), - label = createElement("label"), - textarea = createElement("textarea"), - select = createElement("select"), - option = createElement("option"), - ul = createElement("ul"), - ol = createElement("ol"), - li = createElement("li"), - table = createElement("table"), - tr = createElement("tr"), - td = createElement("td"), - th = createElement("th"), - thead = createElement("thead"), - tbody = createElement("tbody"), - tfoot = createElement("tfoot"), - form = createElement("form"), - br = createElement("br"), - hr = createElement("hr"), - strong = createElement("strong"), - b = createElement("b"), - em = createElement("em"), - i = createElement("i"), - u = createElement("u"), - s = createElement("s"), - sup = createElement("sup"), - sub = createElement("sub"), - small = createElement("small"), - code = createElement("code"), - pre = createElement("pre"), - blockquote = createElement("blockquote"), - nav = createElement("nav"), - header = createElement("header"), - footer = createElement("footer"), - section = createElement("section"), - article = createElement("article"), - aside = createElement("aside"), - main = createElement("main"), - details = createElement("details"), - summary = createElement("summary"), - dialog = createElement("dialog"), - time = createElement("time"), - address = createElement("address"), - mark = createElement("mark"), - progress = createElement("progress"), - meter = createElement("meter"), - caption = createElement("caption"), - figure = createElement("figure"), - figcaption = createElement("figcaption"), - legend = createElement("legend"), - fieldset = createElement("fieldset"), - dfn = createElement("dfn"), - kbd = createElement("kbd"), - var = createElement("var"), - cite = createElement("cite"), - q = createElement("q"), - - html = createElement("html"), - head = createElement("head"), - title = createElement("title"), - meta = createElement("meta"), - link = createElement("link"), - style = createElement("style"), - body = createElement("body"), - - script = createElement("script"), - noscript = createElement("noscript"), - - audio = createElement("audio"), - video = createElement("video"), - source = createElement("source"), - track = createElement("track"), - iframe = createElement("iframe"), - canvas = createElement("canvas"), - svg = createElement("svg"), -}) diff --git a/sitegen/init.luau b/sitegen/init.luau deleted file mode 100644 index 5f42c510..00000000 --- a/sitegen/init.luau +++ /dev/null @@ -1,65 +0,0 @@ -local fs = require("@lune/fs") -local path = require("@lune-lib/utils/path") -local process = require("@lune/process") -local stdio = require("@lune/stdio") -local task = require("@lune/task") - -local sitegenRootPath = path(process.cwd, "sitegen") -local sitePath = path(process.cwd, "site") - -local function watchPaths() - local paths = {} - - local function watch(path: string) - if fs.isDir(path) then - for _, name in fs.readDir(path) do - watch(path .. "/" .. name) - end - elseif fs.isFile(path) then - table.insert(paths, path) - end - end - - watch(sitegenRootPath) - - return paths -end - -local function spawnBuild() - local result = process.exec("lune", { "run", "sitegen/build", sitegenRootPath }) - stdio.write(result.stdout) - stdio.write(result.stderr) - - if not result.ok then - print("Failed to build site") - process.exit(1) - end - - return -end - -if table.find(process.args, "watch") then - local lastModifiedAt = {} - - while task.wait(1) do - local paths = watchPaths() - - local rebuild = false - for _, watched in paths do - local meta = fs.metadata(watched) - if rebuild or lastModifiedAt[watched] ~= meta.modifiedAt then - lastModifiedAt[watched] = meta.modifiedAt - rebuild = true - end - end - - if rebuild then - print(string.rep("\n", 80)) - spawnBuild() - end - end - - return -end - -spawnBuild() diff --git a/sitegen/pages/api/index.luau b/sitegen/pages/api/index.luau deleted file mode 100644 index e69de29b..00000000 diff --git a/sitegen/pages/index.luau b/sitegen/pages/index.luau deleted file mode 100644 index 277a4130..00000000 --- a/sitegen/pages/index.luau +++ /dev/null @@ -1,97 +0,0 @@ -local Button = require("@sitegen/components/button") -local CodeSnippet = require("@sitegen/components/code-snippet") -local Document = require("@sitegen/components/document") -local h = require("@sitegen/h") -local rootConfig = require("@lune-lib/root-config") -local siteBaseUrl = require("@sitegen/utils/site-base-url") - -local CODE_EXAMPLE = [[ -function MyProvider.constructor( - self: MyProvider, - dependencies: typeof(MyProvider.dependencies) -) - self.value = otherProvider:someMethod() -end - -function MyProvider.start(self: MyProvider) - print("Value:", self.value) -end - -export type MyProvider = typeof(MyProvider) -return prvd(MyProvider)]] - -return function() - return Document({ - header = { - h.div({ - class = "hero-inner", - - h.section({ - class = "hero-lead", - - h.h1("Luau's Unstoppable Force"), - h.p("The Luau provider framework with a fantastic featureset, extensibility, \ - and intuitiveness. Structure Luau projects with service providers. All \ - free from logistical nightmares and zero sprawling mazes of bloaty \ - dependencies."), - - Button({ - href = siteBaseUrl("learn"), - "Get Started", - }), - }), - - h.section({ - class = "hero-supports", - - h.div({ - h.span("Available On"), - h.div({ - class = "hero-supports-icons", - h.a({ - href = "https://github.com/prvdmwrong/prvdmwrong", - }), - h.a({ - href = "https://pesde.dev/packages/prvdmwrong/prvdmwrong/latest/any", - }), - h.a({ - href = "https://wally.run/package/prvdmwrong/prvdmwrong", - }), - h.a({ - href = "https://github.com/prvdmwrong/prvdmwrong", - }), - }), - }), - - h.div({ - h.span("Supported Runtimes"), - h.div({ - class = "hero-supports-icons", - h.a({}), - h.a({}), - h.a({}), - h.a({}), - }), - }), - }), - - h.section({ - class = "hero-code-example", - - CodeSnippet({ - language = "lua", - - CODE_EXAMPLE, - }), - }), - }), - }, - main = { - h.section({}), - h.h1(string.rep("placeholder
", 80)), - }, - extraHead = { - h.link({ rel = "stylesheet", href = siteBaseUrl("stylesheets/landing.css") }), - }, - }) -end diff --git a/sitegen/pages/learn/fundamentals/lifecycles.luau b/sitegen/pages/learn/fundamentals/lifecycles.luau deleted file mode 100644 index e69de29b..00000000 diff --git a/sitegen/pages/learn/fundamentals/providers.luau b/sitegen/pages/learn/fundamentals/providers.luau deleted file mode 100644 index e69de29b..00000000 diff --git a/sitegen/pages/learn/fundamentals/roots.luau b/sitegen/pages/learn/fundamentals/roots.luau deleted file mode 100644 index e69de29b..00000000 diff --git a/sitegen/pages/learn/fundamentals/using-dependencies.luau b/sitegen/pages/learn/fundamentals/using-dependencies.luau deleted file mode 100644 index e69de29b..00000000 diff --git a/sitegen/pages/learn/index.luau b/sitegen/pages/learn/index.luau deleted file mode 100644 index 9004659b..00000000 --- a/sitegen/pages/learn/index.luau +++ /dev/null @@ -1,61 +0,0 @@ -local Article = require("@sitegen/components/article") -local commonUrls = require("@sitegen/config/common-urls") -local h = require("@sitegen/h") - -return function() - return Article({ - title = "Learn Prvd 'M Wrong", - content = { - h.p("Congratulations on choosing Prvd 'M Wrong, you’re finally making good decisions!"), - h.p("You will learn how to build great projects with Prvd 'M Wrong, even if you never used \ - it before, with advice from maintainers who know Prvd 'M Wrong best."), - }, - sections = { - { - title = "Expectations", - content = { - h.p("Prvd 'M Wrong expects:"), - h.ul({ - h.li("That you're comfortable with the Luau scripting language."), - h.li("That — if you will use Roblox-specific packages — you're familiar with Roblox"), - }), - h.p("Some articles might challenge you more than others. Remember, Prvd 'M Wrong is \ - built with you in mind, but it may still take a bit of time to absorb some \ - concepts. Take your time and explore at your own pace."), - }, - }, - { - title = "Support", - content = { - h.p("Prvd 'M Wrong is built with you in mind and our documentation aims to be as \ - useful and comprehensive as possible. However, you might need specific advice \ - on an issue, perhaps you may want to learn Prvd 'M Wrong through other means, \ - or you caught a bug."), - h.p({ - "Whatever you're looking for, feel free to swing by our ", - h.a({ - href = commonUrls.rossThread, - "dedicated thread over the Roblox OSS Discord server.", - }), - " Maintainers drop in frequently alongside eager \ - Prvd 'M Wrong users.", - }), - }, - }, - { - title = "Using the Documentation", - content = { - h.p("The Prvd 'M Wrong documentation aims to be as useful and comprehensive as \ - possible. You can open the documentation settings by clicking the gear \ - icon in the top right corner."), - h.p("These customization settings will persist between sessions:"), - h.ul({ - h.li("Dark, light and sepia color schemes"), - h.li("Preferred monospace fonts for code snippets"), - h.li("Relevant documentation for Luau and Roblox TypeScript"), - }), - }, - }, - }, - }) -end diff --git a/sitegen/pages/learn/installation.luau b/sitegen/pages/learn/installation.luau deleted file mode 100644 index 3cb2eb8e..00000000 --- a/sitegen/pages/learn/installation.luau +++ /dev/null @@ -1,33 +0,0 @@ -local Article = require("@sitegen/components/article") -local commonUrls = require("@sitegen/config/common-urls") -local h = require("@sitegen/h") - -return function() - return Article({ - title = "Installation", - content = { - h.p("Prvd 'M Wrong is distributed as several packages that needs to be installed into \ - your game."), - }, - sections = { - { - title = "Templates", - content = { - h.p("TBA"), - }, - }, - { - title = "Installation", - content = { - h.p("TBA"), - }, - }, - { - title = "Build from Source", - content = { - h.p("TBA"), - }, - }, - }, - }) -end diff --git a/sitegen/pages/learn/roblox/components.luau b/sitegen/pages/learn/roblox/components.luau deleted file mode 100644 index e69de29b..00000000 diff --git a/sitegen/pages/learn/roblox/roblox-lifecycles.luau b/sitegen/pages/learn/roblox/roblox-lifecycles.luau deleted file mode 100644 index e69de29b..00000000 diff --git a/sitegen/publish.luau b/sitegen/publish.luau deleted file mode 100644 index e69de29b..00000000 diff --git a/sitegen/static/fonts/jura.ttf b/sitegen/static/fonts/jura.ttf deleted file mode 100644 index 5256bad0..00000000 Binary files a/sitegen/static/fonts/jura.ttf and /dev/null differ diff --git a/sitegen/static/stylesheets/article.css b/sitegen/static/stylesheets/article.css deleted file mode 100644 index 4440427f..00000000 --- a/sitegen/static/stylesheets/article.css +++ /dev/null @@ -1,18 +0,0 @@ -.article-container { - display: flex; - justify-content: space-between; - margin-top: var(--navbar-height); -} - -.article-content { - margin: var(--content-padding); - max-width: var(--max-content-width); - width: 100%; - flex-grow: 1; -} - -.article-toc, -.article-nav { - background-color: blue; - width: 20rem; -} diff --git a/sitegen/static/stylesheets/common.css b/sitegen/static/stylesheets/common.css deleted file mode 100644 index c73695c2..00000000 --- a/sitegen/static/stylesheets/common.css +++ /dev/null @@ -1,136 +0,0 @@ -:root { - --prvdmwrong-hue: 240; - --prvdmwrong-chroma: 0.025; - --prvdmwrong-gray-0: oklch(0 var(--prvdmwrong-chroma) var(--prvdmwrong-hue)); - --prvdmwrong-gray-1: oklch(0.05 var(--prvdmwrong-chroma) var(--prvdmwrong-hue)); - --prvdmwrong-gray-2: oklch(0.1 var(--prvdmwrong-chroma) var(--prvdmwrong-hue)); - --prvdmwrong-gray-3: oklch(0.15 var(--prvdmwrong-chroma) var(--prvdmwrong-hue)); - --prvdmwrong-gray-4: oklch(0.2 var(--prvdmwrong-chroma) var(--prvdmwrong-hue)); - --prvdmwrong-gray-5: oklch(0.3 var(--prvdmwrong-chroma) var(--prvdmwrong-hue)); - --prvdmwrong-gray-6: oklch(0.8 var(--prvdmwrong-chroma) var(--prvdmwrong-hue)); - --prvdmwrong-gray-7: oklch(0.85 var(--prvdmwrong-chroma) var(--prvdmwrong-hue)); - --prvdmwrong-gray-8: oklch(0.9 var(--prvdmwrong-chroma) var(--prvdmwrong-hue)); - --prvdmwrong-gray-9: oklch(0.95 var(--prvdmwrong-chroma) var(--prvdmwrong-hue)); - --prvdmwrong-gray-10: oklch(1 var(--prvdmwrong-chroma) var(--prvdmwrong-hue)); - - --prvdmwrong-accent-hue: 50; - --prvdmwrong-accent-chroma: 0.15; - --prvdmwrong-accent: oklch(0.6 var(--prvdmwrong-accent-chroma) var(--prvdmwrong-accent-hue)); - --prvdmwrong-accent-dark: oklch(0.55 var(--prvdmwrong-accent-chroma) var(--prvdmwrong-accent-hue)); - --prvdmwrong-accent-darker: oklch(0.4 var(--prvdmwrong-accent-chroma) var(--prvdmwrong-accent-hue)); - --prvdmwrong-accent-light: oklch(0.65 var(--prvdmwrong-accent-chroma) var(--prvdmwrong-accent-hue)); - --prvdmwrong-accent-lighter: oklch(0.7 var(--prvdmwrong-accent-chroma) var(--prvdmwrong-accent-hue)); - - --fg: var(--prvdmwrong-gray-8); - --fg-light: var(--prvdmwrong-gray-7); - --fg-lighter: var(--prvdmwrong-gray-6); - --fg-lightest: var(--prvdmwrong-gray-5); - --bg: var(--prvdmwrong-gray-4); - --bg-light: var(--prvdmwrong-gray-3); - --bg-lighter: var(--prvdmwrong-gray-2); - --bg-lightest: var(--prvdmwrong-gray-1); - --accent: var(--prvdmwrong-accent); - - --content-padding: 2rem; - --max-content-width: 80rem; - --mobile-width: 80rem; - --current-content-width: max(var(--max-content-width), calc(100vw - var(--content-padding) - var(--content-padding))); - - --navbar-height: 4rem; -} - -body { - background: var(--bg); - color: var(--fg); -} - -body>* { - image-rendering: pixelated; -} - -header { - display: flex; - justify-content: center; - - --vertical-padding: max(2em, calc(30svh - 10em)); - - padding: var(--vertical-padding) 0; - padding-top: calc(var(--vertical-padding) + var(--navbar-height)); - - background-color: var(--bg-light); - border-bottom: 0.1rem solid var(--fg-lightest); -} - -header h1 { - font-size: 3rem; -} - -.navbar { - display: flex; - justify-content: center; - - position: fixed; - z-index: 9999; - top: 0; - height: var(--navbar-height); - width: 100%; - - background-color: var(--bg-light); - border-bottom: 0.1rem solid var(--fg-lightest); -} - -.navbar-inner { - display: flex; - align-items: center; - gap: 1rem; - - margin: 0 var(--content-padding); - max-width: var(--max-content-width); - height: 100%; - width: 100%; -} - -.navbar-inner :first-child { - margin-right: auto; -} - -.navbar-inner a { - color: var(--fg); - text-decoration: none; -} - -.button { - background-color: var(--fg); - color: var(--bg); - - padding: 0.5rem 1rem; - - border-radius: 0.25rem; - font-weight: 700; - text-decoration: none; -} - -.code-snippet { - /* white-space: pre-wrap; - word-wrap: break-word; - text-align: justify; */ - /* overflow: auto ; */ - /* max-width: var(--current-content-width); */ -} - -.code-snippet code { - - /* overflow-x: scroll; */ -} - -.hljs { - background-color: var(--bg-lightest) !important; - border: 0.1rem solid var(--fg-lightest); - border-radius: 0.5rem; - overflow-x: scroll !important; -} - -a { - color: var(--accent); - text-decoration: none; -} diff --git a/sitegen/static/stylesheets/fonts.css b/sitegen/static/stylesheets/fonts.css deleted file mode 100644 index 2925cae6..00000000 --- a/sitegen/static/stylesheets/fonts.css +++ /dev/null @@ -1,63 +0,0 @@ -@font-face { - font-family: 'Jura'; - src: url('../fonts/jura.ttf') format('truetype') -} - -* { - text-balance: pretty; -} - -body { - font-family: "Jura", system-ui; - line-height: 2; -} - -h1, -h2, -h3, -h4, -h5, -h6 { - font-weight: 700; - - &:not(:first-child) { - margin-top: 1rem; - } -} - -h1 { - font-size: 2em; - line-height: 1.5; -} - -h2 { - font-size: 1.5em; - line-height: 1.5; -} - -h3 { - font-size: 1.25em; - line-height: 1.5; -} - -h4, -h5, -h6, -strong, -b { - font-size: 1em; - line-height: 1.5; - letter-spacing: 0.125em; - text-shadow: 0.125em 0; -} - -u, -a { - text-decoration-thickness: 0.125em; - text-underline-offset: 0.125em; -} - -small, -pre { - font-size: 0.75rem; -} diff --git a/sitegen/static/stylesheets/landing.css b/sitegen/static/stylesheets/landing.css deleted file mode 100644 index 8b4b833e..00000000 --- a/sitegen/static/stylesheets/landing.css +++ /dev/null @@ -1,65 +0,0 @@ -.hero-inner { - display: flex; - flex-direction: column; - position: relative; - gap: 1rem; - width: 100%; - - padding: 0 var(--content-padding); - max-width: var(--max-content-width); -} - -.hero-lead { - flex: 1 1 auto; -} - -.hero-lead :not(:last-child) { - margin-bottom: 0.5rem; -} - -.hero-supports { - display: flex; - flex-direction: row; - gap: 1rem; -} - -.hero-supports div span { - font-weight: 700; - opacity: 50%; -} - -.hero-supports .hero-supports-icons { - display: flex; - gap: 0.5rem; -} - -.hero-supports .hero-supports-icons a { - width: 4rem; - height: 4rem; - background-color: red; -} - -@media only screen and (max-width: 50rem) { - .hero-supports { - flex-direction: column; - } -} - -.hero-left, -.hero-right { - display: flex; - flex-direction: column; - gap: 1rem; -} - - -.hero-buttons { - display: flex; - gap: 1rem; -} - -/* .hero-inner > section { - display: flex; - position: relative; - max-width: 100%; -} */ diff --git a/sitegen/static/stylesheets/reset.css b/sitegen/static/stylesheets/reset.css deleted file mode 100644 index 7e547adb..00000000 --- a/sitegen/static/stylesheets/reset.css +++ /dev/null @@ -1,47 +0,0 @@ -/* - Josh's Custom CSS Reset - https://www.joshwcomeau.com/css/custom-css-reset/ -*/ - -*, *::before, *::after { - box-sizing: border-box; -} - -* { - margin: 0; -} - -@media (prefers-reduced-motion: no-preference) { - html { - interpolate-size: allow-keywords; - } -} - -body { - line-height: 1.5; - -webkit-font-smoothing: antialiased; -} - -img, picture, video, canvas, svg { - display: block; - max-width: 100%; -} - -input, button, textarea, select { - font: inherit; -} - -p, h1, h2, h3, h4, h5, h6 { - overflow-wrap: break-word; -} - -p { - text-wrap: pretty; -} -h1, h2, h3, h4, h5, h6 { - text-wrap: balance; -} - -#root, #__next { - isolation: isolate; -} \ No newline at end of file diff --git a/sitegen/utils/for-each.luau b/sitegen/utils/for-each.luau deleted file mode 100644 index c38c62f0..00000000 --- a/sitegen/utils/for-each.luau +++ /dev/null @@ -1,14 +0,0 @@ -local function forEach(input: { [KI]: VI }, func: (KI, VI) -> (KO, VO)): { [KO]: VO } - local output = {} - for keyIn, valueIn in input do - local keyOut, valueOut = func(keyIn, valueIn) - if keyOut == nil or valueOut == nil then - continue - end - assert(output[keyOut] == nil, "Key collision") - output[keyOut] = valueOut - end - return output -end - -return forEach diff --git a/sitegen/utils/site-base-url.luau b/sitegen/utils/site-base-url.luau deleted file mode 100644 index 08b357df..00000000 --- a/sitegen/utils/site-base-url.luau +++ /dev/null @@ -1,7 +0,0 @@ -local siteUrls = require("@sitegen/config/site-urls") - -local function siteBaseUrl(suffix: string) - return siteUrls.base .. "/" .. suffix -end - -return siteBaseUrl diff --git a/stylua.toml b/stylua.toml deleted file mode 100644 index 77fa854a..00000000 --- a/stylua.toml +++ /dev/null @@ -1,4 +0,0 @@ -syntax = "Luau" - -[sort_requires] - enabled = true diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 2d3ebeb1..00000000 --- a/tsconfig.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "compilerOptions": { - "allowSyntheticDefaultImports": true, - "downlevelIteration": true, - "module": "commonjs", - "moduleResolution": "Node", - "noLib": true, - "resolveJsonModule": true, - "forceConsistentCasingInFileNames": true, - "experimentalDecorators": true, - "strict": true, - "target": "ESNext", - "typeRoots": [ - "node_modules/@rbxts" - ], - // i dont care - "jsx": "react", - "jsxFactory": "Roact.createElement", - "jsxFragmentFactory": "Roact.Fragment", - "rootDir": "packages", - "outDir": "out", - "baseUrl": "packages", - "incremental": true, - "tsBuildInfoFile": "out/tsconfig.tsbuildinfo", - "declaration": true - } -} diff --git a/.lune/lib/publish/init.luau b/typecheckers/init.luau similarity index 100% rename from .lune/lib/publish/init.luau rename to typecheckers/init.luau diff --git a/types/g.d.luau b/types/g.d.luau deleted file mode 100644 index edfb7af3..00000000 --- a/types/g.d.luau +++ /dev/null @@ -1,5 +0,0 @@ -declare _G: { - PRVDMWRONG_SUPPRESS_MULTIPLE_SAME_TAG: unknown, - PRVDMWRONG_DISALLOW_MULTIPLE_LISTENERS: unknown, - PRVDMWRONG_PROFILE_LIFECYCLES: unknown -}