Skip to main content

Crate yog_cli

Crate yog_cli 

Source
Expand description

The yog CLI’s internals: yog.toml parsing, the generated .yog-build/ workspace, .yres resources, content/ blocks and items, .yui screens and #[yog_export] crates.

Not for external use — a library only so the yog binary, its tests and its benches share the code. No API stability, not published separately.

Modules§

bench
yog bench — a mod’s benchmarks: benches/*.rs files whose #[yog_api::bench] functions run under criterion.
cargo_toml
The generated .yog-build/Cargo.toml.
content
.yblock / .yitem content files — a mod’s blocks and items: their properties, 3D model, block states and item form, in one JSON file each, edited in Yog-IDLE’s 3D model editor — and .yrecipe files, one recipe each (crafting, shapeless, smelting), edited in its recipe editor. See Yog-IDLE’s docs/blocks-items.md for the formats.
design
The .yui screen designer’s backend: the canvas drawn by yog-ui itself (the crate mods render with in game) through a recording YogGfxApi, rasterized with Minecraft’s own font and textures from the local game files; a preview mode driving the same tree with real UI events (click:X:Y, scroll:DY, scrollbar drags); and code-behind handlers.
diagnostics
What a build or a check finds, each as a record: what it is (a code), how bad, what’s wrong and where. Written for a tool — a Yog Data frame each to the file YOG_DIAGNOSTICS names (yog_ids::env::DIAGNOSTICS) — while the text goes on as ever (each one’s Display).
exports
yog publish exports — the -exports crate generated from a mod’s #[yog_export] items.
files
A project’s files: those under a folder, by what they are, and a fingerprint of a set of them that changes when any of them does.
manifest
yog.toml — a mod project’s manifest, the only build file mod authors write.
mappings
yog mappings (docs/design/nanites.md, “Names”): a host’s mapping table — Mojang’s names → the host’s run-time names — from Mojang’s mappings and the loader’s (Fabric’s intermediary, Forge’s SRG), fetched once into Yog’s cache.
serve
yog serve — the CLI as a service for tools (Yog-IDLE): frames of binary Yog Data (yog_data::io) on stdin and stdout, each request a [Request] and each answer a [Reply]. Every format is read, written and converted here, so a tool needn’t be rebuilt when a format changes — only this binary. Answers hold plain values: a typed one (@item:x) is sent as its string.
yres
.yres resource files — a mod’s texts, images, sounds, files, colors, numbers and flags, like a C# project’s Resources/*.resx. See Yog-IDLE’s docs/yres.md for the format.
yui
.yui screen files — the declarative form of a yog-ui widget tree that Yog-IDLE’s screen designer edits — and their code generation.
yui_component
Component .yui files: a <Component> root declaring properties and events, with one body element bound to them through {x:Bind ...} (the same bindings as view-model screens, [crate::yui_vm::compile_bind]). Generates a struct with one typed field per property and its yog_api::ui::component::Component implementation, registered with ui_component!. See Yog-IDLE’s docs/yui.md, “Components”.
yui_grid
<Grid> in .yui — WPF’s Grid: rows and columns, children placed in cells with attached Grid.Row / Grid.Column / Grid.RowSpan / Grid.ColumnSpan.

Functions§

slash_path
path with / between its parts, whatever the system’s separator.