rojo

repository·master·Indexed 23 days ago

https://github.com/rojo-rbx/rojo

A tool that enables professional-grade development for Roblox developers by bridging the gap between Roblox and software engineering practices. It allows the use of external editors like VS Code and version control systems like Git. Key features include filesystem-based development, real-time streaming of models into Roblox Studio, CLI deployment, and the memofs virtual filesystem.

Tokens
3.8K
Snippets
6
Records
37
Agent score
80%

What's inside rojo

  1. Overview of Rojo features

    master

    Rojo is a tool that enables Roblox developers to use professional software engineering workflows. Key capabilities include:

    • Filesystem-based development: Work on scripts and models directly from your filesystem using editors like Visual Studio Code.
    • Version Control: Use Git or other Version Control Systems (VCS) to manage your game, library, or plugin code.
    • Real-time Streaming: Stream .rbxmx and .rbxm models into your Roblox game session in real time.
    • CLI Deployment: Package and deploy projects to Roblox.com directly from the command line.
    • Syncback: Use rojo syncback to pull Instances from Roblox place and model files back into an existing Rojo project.
    • Two-way Sync: An optional setting in the Rojo Studio plugin allows supported edits made in Roblox Studio to sync back to your local filesystem.
  2. Overview of memofs virtual filesystem

    master
    memofs is a virtual filesystem implementation designed with a configurable backend and file watching capabilities. It provides an API similar to Rust's std::fs. While it is currently an unstable minimum viable library, its primary consumer is Rojo. It is intended for use cases requiring filesystem abstractions with pluggable storage backends.
  3. Configure memofs backends

    master

    memofs supports different backends that determine how files are stored and watched. You can choose a backend based on your requirements:

    • StdBackend: Uses the standard std::fs and the notify crate for real filesystem operations and file watching.
    • NoopBackend: A backend that always throws errors; useful for disabling filesystem operations.
    • InMemoryFs: A simple in-memory filesystem, primarily useful for testing environments where persistent storage is not required.
  4. Configure Vfs backends

    master

    You can initialize a Vfs with different backends depending on your needs:

    • StdBackend: Uses the standard OS filesystem (std::fs) and supports file watching via the notify crate. Use Vfs::new_default() for this.
    • InMemoryFs: A simple in-memory filesystem, ideal for testing.
    • NoopBackend: A backend that always throws errors, useful for testing error paths.
  5. Understand the Sourcemap JSON structure

    master

    The generated sourcemap is a JSON tree of SourcemapNode objects. Each node represents an instance in the Rojo project hierarchy.

    Fields:

    • name: The name of the instance.
    • className: The class name of the instance (e.g., Script, Folder).
    • filePaths: An array of paths to the files associated with this instance. These are either relative to the project directory or absolute, depending on the --absolute flag.
    • children: An array of SourcemapNode objects representing the children of this instance.
  6. Authentication methods for `upload`

    master

    The upload command supports two distinct authentication workflows:

    Uses the standard Roblox web authentication.

    • Requirement: Provide a --cookie or ensure a valid cookie is available in your system environment.
    • Note: If you provide --universe_id while using this method, it will be ignored and a warning will be issued.

    2. Open Cloud API (API Key-based)

    Uses the modern Roblox Open Cloud interface.

    • Requirement: You must provide both --api_key AND --universe_id.
    • Note: If you provide --cookie while using this method, it will be ignored and a warning will be issued.
    • Limitation: This method currently only supports uploading to a place.
  7. Use syncback to convert Roblox files to a Rojo project

    master

    The syncback command automatically converts Roblox files (.rbxl, .rbxlx, .rbxm, or .rbxmx) into a Rojo project. It uses your existing project.json file to traverse the Roblox file and serialize Instances into the filesystem in a format Rojo understands.

    To use it, provide the path to your Rojo project and the path to the Roblox file you want to pull from. By default, the command will prompt you for confirmation before writing any changes to your filesystem.