emotesco/asink

Lightweight bootstrapper for Roblox

Asink

Asink is a lightweight bootstrapper for Roblox that aims to give developers absolute control over their development processes.

It uses Promises to Setup and Start your "Systems" and sinks any modules that fail in either lifecycle, preventing them from loading any further.

Install

Asink is currently supported via pesde, or as a GitHub submodule, but you could copy the source into the ReplicatedStorage of any Roblox Studio projects and it would work as expected.

Installing via pesde

pesde add emotesco/asink

Installing via Submodule

git submodule add https://github.com/Emotes-CO/Asink src/shared

Basic Usage

Asink is simply a bootstrapper, so the usage is as follows:

-- runtime.server.luau / runtime.client.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Asink = ReplicatedStorage:WaitForChild("Asink") -- or wherever you've decided to install it

Asink:AddSystems(script.Parent.Systems) -- or wherever your systems are

Asink:Start():andThen(function()
    print("Game started!") -- or whatever you want it to say
end):catch(warn)

A basic system might look like this:

-- ThisSystem.luau

-- // Variables & Dependencies // --

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

local ThisSystem = {}

-- // Types // --

type ThisSystem = typeof(ThisSystem)

-- // Functions // --

function ThisSystem._Setup(self: ThisSystem) 
    print("ThisSystem initialised")
end

function ThisSystem._Start(self: ThisSystem) 
    print("ThisSystem started")
end

return ThisSystem