coatcheck 0.1.0

Story, prop, and scene contracts for Topcoat component workbenches.
Documentation
  • Coverage
  • 100%
    69 out of 69 items documented1 out of 20 items with examples
  • Size
  • Source code size: 18.4 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 879.0 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • superposition/coatcheck
    0 1 10
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • superposition

Coatcheck

Coatcheck is a component workbench platform for Topcoat.

It provides reusable contracts for Storybook-style Topcoat tooling: stories, typed props, controls, scenes, catalog validation, viewports, and surfaces. A Coatcheck application supplies its production components and exposes them in an isolated canvas.

Cold Front is the first reference application. Its components remain game-specific; Coatcheck remains reusable.

Status

Coatcheck is experimental and tracks Topcoat's early-stage development. The 0.1 line establishes the public data model while the manager, story discovery, CLI, and test runner are developed.

Define a catalog

use coatcheck::{ArgType, Catalog, ControlKind, Story, StoryKind};

const LABEL: ArgType = ArgType {
    name: "label",
    type_name: "String",
    control: ControlKind::Text,
    default_value: "Enter briefing",
    description: "Visible action copy.",
    options: &[],
};

const STORIES: &[Story] = &[Story {
    id: "action-link",
    title: "Action link",
    tier: "Atoms",
    kind: StoryKind::Playground,
    description: "A navigational action.",
    source: "src/atoms.rs",
    args: &[LABEL],
}];

const CATALOG: Catalog = Catalog::new("Example", STORIES);

assert!(CATALOG.validate().is_ok());
assert_eq!(CATALOG.story("action-link").unwrap().title, "Action link");

Current guarantees

  • Story IDs are unique.
  • Prop names are unique within each story.
  • Required story metadata is present.
  • Choice controls declare at least one option.
  • Catalog lookup does not require allocation.
  • Story kinds distinguish playgrounds, named states, matrices, scenes, and docs.
  • Default viewport, surface, and scene contracts are available.

License

MIT