npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@rbxts/zircon

v1.0.9

Published

<div> <img src="https://i.imgur.com/YgpbX7G.png" align="left" width="128"/> <h1>ZIRCON</h1> <h3>A clean, sleek, runtime debugging console for Roblox</h3> <a href="https://npmjs.com/package/@rbxts/zircon"><img src="https://badge.fury.io

Downloads

31

Readme

Setup

To begin, it is recommended to do

npm i @rbxts/zircon @rbxts/log

This will install both Zircon, as well as the logging support. It is recommended to use the logging as it can be filtered easily through the Zircon console.

Features

  • Zirconium Language Scripting

    Zircon comes inbuilt with a runtime scripting language called Zirconium. This allows you to run scripts against your game during runtime.

    More information on how to set this up, will come when Zircon is closer to being production-ready.

    Supports:

    • Functions

      Using ZirconServer.Registry.RegisterFunction + ZirconFunctionBuilder

    • Namespaces

      Using ZirconServer.Registry.RegisterNamespace + ZirconNamespaceBuilder

    • Enums

      Using ZirconServer.Registry.RegisterEnum + ZirconEnumBuilder

  • Structured Logging

    If you want logging for Zircon, you will need to install @rbxts/log.

    Then to use Zircon with Log, you simply do

    import Log from "@rbxts/log";
    import Log, { Logger } from "@rbxts/log";
    import Zircon from "@rbxts/zircon";
    
    Log.SetLogger(
        Logger.configure()
            // ... Any other configurations/enrichers go here.
            .WriteTo(Zircon.Log.Console()) // This will emit any `Log` messages to the Zircon console
            .Create() // Creates the logger from the configuration
    );

    This will need to be done on both the client and server to achieve full logging.

    All logging done through this can be filtered through the console itself. That's the power of structured logging! ;-)

Registering and using Zircon Commands

Below is an example of how to register a command in Zircon:

import { 
    ZirconServer,
    ZirconFunctionBuilder,
    ZirconDefaultGroup,
    ZirconConfigurationBuilder
} from "@rbxts/zircon";
import Log from "@rbxts/log";

const PrintMessage = new ZirconFunctionBuilder("print_message")
    .AddArguments("string")
    .Bind((context, message) => Log.Info(
            "Zircon says {Message} from {Player}", 
            message,
            context.GetExecutor()
    ));

const CreatorCommand = new ZirconFunctionBuilder("kill")
    .AddArguments("player")
    .Bind((context, player) => {
        const character = player.Character;
        if (character) {
            character.BreakJoints()
        }
    });

ZirconServer.Registry.Init(
    new ZirconConfigurationBuilder()
        // Creates a 'creator' group
        .CreateDefaultCreatorGroup()
        // Creates a 'user' group
        .CreateDefaultUserGroup()
        // Adds an executable function called 'print_message', allowed to be executed by `User` (everyone)
        .AddFunction(PrintMessage, [ZirconDefaultGroup.User])
        // Adds an executable function called 'kill' that can only be executed by a creator of the place.
        .AddFunction(CreatorCommand, [ZirconDefaultGroup.Creator])
        // Builds the configuration for Zircon
        .Build()
);

This will create a global print_message that all players can run.

Then if run in Zircon:

The first argument of RegisterFunction takes a ZirconFunctionBuilder - which is the easiest way to build a function. AddArguments takes any number of arguments for types you want, in built types in Zircon you can use a string for. Otherwise you supply the type validator object.

Troubleshooting

Attempted to call AsyncFunction 'ZrSOi4/GetZirconInit' - which has no user defined callback

  • You need to call ZirconServer.Registry.Init - an example of that can be found here

Unhandled promise rejection: ... Component returned invalid children ...

  • You need to update your version of roact to the latest. That can be done via npm i @rbxts/roact@latest.

More Help & Links

Australis OSS Community