Build modular services with Catwork!

Catwork

Source Code

Catwork is an evolution of the guiding principles behind Tabby, but instead of being restricted to plugins, it can be used anywhere.

Basic Usage

Code is encapsulated in objects called Fragments, if you’ve used Tabby, you understand them already, though there are some differences you should be aware of.

return Catwork.Fragment {
  Init = function(self)
    print("Hello Catwork!")
  end
end

No runtime?

You may have noticed that Catwork doesn’t come with a runtime, you can blame Rojo for this. The runtime I use involves CollectionService and script tags, but this isn’t very easy to do in rojo projects.

Services

Services are where the power behind Catwork lies, think of them as objects that control how Fragments behave, you can see some example services in the Catwork repo.

Services have built-in default logic defined in Service.lua, but you can override all of these callbacks.

Motivation

There are many frameworks, so why make another? The main reason is an issue I see a lot, many frameworks require you to return a function or some abstract object, Catwork doesn’t.

The issue lies in interfacing with the object. What are you going to do with a function that requires some abstract class that you dont have?

As soon as a service calls CreateFragmentForService, thats it, the fragment is running (or might not be, but normally Fragments are spawned as soon as the service’s constructor is called).

License

Licensed under the MIT License - metatablecat games 2024


TODO: Service docs, templates, a basic runtime

5 Likes

could you possibly convert it into a roblox model? not everyone finds sourcing code on GitHub and building from scratch appealing or convenient.

Here’s the latest build. I dont maintain a build on the repository as its a little inconvenient to keep rebuilding it. I can make a quick source builder from the sourcecode’s zip file if thats what you want?

build.rbxm (10.4 KB)

Here’s that source builder, drop it into your workspace and just require it using the command bar.

CatworkInstaller.rbxm (10.5 KB)

1 Like