Modules: Core¶
Core framework — service lifecycle, logging, and error handling (@rbx/core). Status: Implemented (~130 tests).
Purpose¶
- Provide the service lifecycle used by every game and package (
register → boot → onInit → onStart). - Centralize structured logging with named child loggers and log levels.
- Supply resource cleanup via
Janitorand time helpers viaClock. - Reusable across every game — all higher-level packages depend on core.
Public API¶
Service lifecycle¶
Application— top-level container that registersServiceinstances.Service— base class withonInit()andonStart()lifecycle hooks.createPlayerLifecycleService()— factory that wires upPlayers.PlayerAdded/PlayerRemovingevents.
Logging¶
createLogger(name)— returns aLoggerwithdebug,info,warn,errormethods.Logger— supports child loggers for scoped context.LogLevel—Debug | Info | Warn | Error.logError()— rich error formatter that handles strings, tables, and error objects.
Utilities¶
Janitor— tracks connections, instances, and cleanup callbacks;destroy()releases all.Clock—now()(os.clock) andtimestamp()(os.time).- Collection helpers —
arraySize,arrayRemoveAt,arrayTake,setSize.
Dependencies¶
@rbx/shared-types(zero-runtime-dep type package).
Data ownership¶
Core owns no player data. It provides lifecycle hooks for other modules to load/save their own data.
Trust & security¶
Core runs entirely server-side. No client API surface.
Configuration¶
No feature flags. Log level is set at createLogger call-site.
Observability¶
core.service_init— emitted when a service completesonInit.core.service_start— emitted when a service completesonStart.core.player_added/core.player_removing— lifecycle events.
Testing¶
~130 unit tests covering service lifecycle, logger output, Janitor cleanup, Clock wrappers, and collection helpers.