How inbestigator/godact works
Based on our analysis of the file tree and README, this project is a conversion tool—specifically, a library that lets you write React components and have them converted into Godot scenes along with transpiling TypeScript/JavaScript code into GDScript. It leverages a React-like syntax for declaring Godot nodes (e.g., Node2D, Sprite2D, CollisionShape2D, etc.) and provides various categories (visual, physics, controls, etc.) as well as examples to illustrate its use.
Main Components
• Client/Developer Code (React Components): Representing the high-level UI and game scene definitions. This is where the user writes their game logic and scene composition using React’s component syntax.
• Conversion Engine: The core logic contained in the “lib” directory. This includes:
• Node Definitions and Their Renderers (e.g., files in lib/core/nodes/* and nodes within categories such as physics, visual, controls). This part maps React components to Godot nodes.
• Internal Utilities such as the container, reconciler, renderer, and helper files under lib/internal.
• Transpiler: The module in lib/internal (e.g., ts2gd.ts) that converts TypeScript/JavaScript logic into GDScript code.
• Examples: Demonstrative projects (found under the examples directory) that provide practical scenarios of converting React components (such as a logo or platformer game) into corresponding Godot scenes.
• Test Suite: The tests directory, ensuring correctness of transformations and node behaviors.
Relationships and Interactions
• The input layers come from the React components written by the user. These components call the conversion functions such as createGodactScene.
• The Conversion Engine processes the component tree, mapping each node (based on its type/category) to a corresponding Godot node. It uses the files in lib/core/nodes and lib/core/resources.
• The Transpiler branch (ts2gd.ts) then takes the converted scene or behavior logic and outputs valid GDScript code.
• The examples serve both as validation and as usage models for how the components are intended to interact.
• Continuous Integration is maintained via the GitHub workflows (in .github/workflows), ensuring that tests and publishing steps are executed correctly.
Architectural Patterns/Design Principles
• Component-Based Design: The project is built around individual “node” components that have independent logic and properties. The separation by directory (controls, physics, visual) reflects this modularity.
• Declarative UI Programming: Using React-like syntax to declaratively define Godot scenes.
• Transpilation Pipeline: A clear transformation chain from React components to Godot scene definitions and from TypeScript/JavaScript to GDScript.
• Extensibility: The node registry table in the README and the organized node directories show that new nodes can be added or extended upon request.
Relevant Technologies, Frameworks, and Libraries
• Deno (deno.json indicates that this is likely built on Deno, providing the runtime for TypeScript).
• TypeScript/React (as the input and component definition language).
• Godot (the target runtime, with nodes, scenes, and GDScript).
• GitHub Actions and related configuration files for CI/CD.
• Internal helper libraries such as ts2gd for transpilation and the internal reconciler and renderer logic.
Final Details
• Clarity and thoroughness – each directory (or group) should be distinctly represented so that someone reviewing the architecture can track how a React component is transformed into a Godot scene.
• To capture both compile-time and runtime stages, showing how the TypeScript/React code becomes the final GDScript and scene definitions.
Happy diagramming!