Files
craft-libs/crates/craft
aiongg dffc61a7e0 Merge storytold main 832883b5 (sync 16 Nov)
961 upstream commits since 7bb6c900. Resolutions:
- Test-only conflicts: upstream tests from before the base that our side
  cut stay cut; tests new upstream are kept (audio aac/config, layout,
  encode_format; cms lutfile; media mux; print windows_native, ticket;
  update self_update; xml hostile).
- Code our side moved, with upstream's change carried to the new place:
  craft-media mux roll sample groups (mux/boxes.rs) and writer-start
  offsets with overflow checks (mux/progressive.rs); craft-print's
  shrink-to-fit scale guard (sheets/plan.rs); craft-update's nextest
  archive detection (self_update/detect.rs); craft-vectorcraft-format's
  Tail::write_to_with (container.rs); craft-i18n's pedantic fixes
  (bidi.rs, negotiation.rs).
- craft-ui: the old crate's modules stay removed; gpu_test_lock guarded
  their per-test wgpu renderers, which the snapshot kit does not have.
- New upstream tests in crates that build their integration tests into
  the library's test executable are modules of tests/main.rs (audio
  flac_decode and qoa_oracle, cms, docpath, pcraft-format,
  vectorcraft-format).
- The 22 new crates are optional members of the craft facade.
2026-11-16 01:52:09 +00:00
..

craft

The craft libraries in one dependency. An app pins one revision of this crate and turns on features; everything is imported as craft::<crate>.

[workspace.dependencies]
craft = { git = "https://github.com/storytold/craft-libs", rev = "…" }

# crates/ui-egui/Cargo.toml
craft = { workspace = true, features = ["ui", "color", "draw", "imaging", "keymap", "platform-appearance"] }

Always on

craft::theme, craft::i18n, craft::host.

Features

  • One feature per crate, named after the crate without craft-: color turns on craft-color and re-exports it as craft::color.
  • ui turns on craft-ui (craft::ui), re-exports egui (craft::egui, the egui the library is built with) and forwards ui to every enabled crate.
  • screen-testing implies ui and forwards to every enabled crate.
  • Each crate feature is forwarded as <crate>-<feature> (platform-appearance, text-hyphen, ui-window-frame).
  • A crate whose ui needs another family's ui turns that family's feature on (draw turns on color).

The [features] table in Cargo.toml is written by tests/features.rs from the member crates' manifests. After changing a member's features or adding a crate, run UPDATE_FACADE=1 cargo test -p craft -- integration::features and commit the result. A comment on a feature line marks a crate that does not build for wasm32-unknown-unknown.

Reached through other crates, not named in the facade: the six library crates (craft-ui-contract to craft-ui-shell), craft-ui-macros and craft-behavior through craft-ui, and craft-win32 through craft-window.

Not in the facade, because they are tools or test harnesses: craft-ui-gallery, story-render, feature-root (the features local builds resolve with), craft-ui-bench, craft-ui-test-kit, craft-fonts-build (a build-script helper), craft-design-lint, craft-plate-test, craft-media-testkit.

Family dependencies

tests/families.rs fails when one family crate's ui depends on another family crate's ui. craft-color is the base family that any family may use.

egui fork

craft::egui_fork::{GIT, REV} name the egui fork the library is built with, and check_lockfile(lock) checks that an app's Cargo.lock takes every egui package from it. An app's xtask calls it in its ci and check commands. The app's workspace must also patch egui to this fork, since [patch] applies only at the workspace root.