feat(examples): rewrite baker-family as coherent Competition Week narrative
Rewrote the baker-family example around a unified story: the annual Harvest Baking Competition is Saturday. Martha's sourdough starter Old Maggie is sluggish from a cold snap, Jane is secretly entering the FreeStyle category, Emma's science fair project is "The Chemistry of Fermentation", Henry is judging for the first time and worried about impartiality, and Roland is defending last year's title. The week's schedules (Mon guild meeting → Tue test bakes → Wed sourcing → Thu dough prep → Fri science fair → Sat competition → Sun recovery) are now fully populated with narrative-specific actions. Files split for composability: - behaviors/baker_behaviors.sb → 5 focused files by character/domain - schema/types.sb → 4 files (core, baking, world, social) - schedules/work_schedules.sb → 4 files (one per schedule) - relationships/baker_family_relationships.sb → family + bakery Strong typing: replaced all enumerable string fields with concepts (BakerSpecialty, Occupation, LocationType, InstitutionType, ParentingStyle, Intensity, BakeryDomain, BakingDiscipline, ManagementDomain, CompetitiveAdvantage). Remove new-syntax-demo.sb (superseded by baker-family example).
This commit is contained in:
@@ -119,15 +119,15 @@ fn test_baker_family_field_values() {
|
||||
panic!("age should be a Number");
|
||||
}
|
||||
|
||||
// Martha sets specialty: "sourdough" (overriding Baker template default
|
||||
// "bread")
|
||||
if let Some(storybook::syntax::ast::Value::Text(specialty)) = martha.fields.get("specialty") {
|
||||
// Martha sets specialty: Sourdough (overriding Baker template default Bread)
|
||||
if let Some(storybook::syntax::ast::Value::Identifier(parts)) = martha.fields.get("specialty") {
|
||||
assert_eq!(
|
||||
specialty, "sourdough",
|
||||
"Martha's specialty should be sourdough"
|
||||
parts,
|
||||
&vec!["Sourdough".to_string()],
|
||||
"Martha's specialty should be Sourdough"
|
||||
);
|
||||
} else {
|
||||
panic!("specialty should be a Text");
|
||||
panic!("specialty should be an Identifier");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,9 +182,13 @@ fn test_baker_family_has_expected_schedules() {
|
||||
#[test]
|
||||
fn test_baker_family_multi_file_structure() {
|
||||
// Baker family is organized across multiple files:
|
||||
// - schema/templates.sb
|
||||
// - behaviors/baker_behaviors.sb
|
||||
// - schedules/work_schedules.sb
|
||||
// - schema/core_types.sb, baking_types.sb, world_types.sb, social_types.sb
|
||||
// - schema/templates.sb, life_arcs.sb
|
||||
// - behaviors/baker_behaviors.sb, person_behaviors.sb, child_behaviors.sb
|
||||
// - behaviors/competition_behaviors.sb, henry_behaviors.sb
|
||||
// - schedules/base_schedule.sb, baker_schedule.sb, school_schedule.sb,
|
||||
// retired_schedule.sb
|
||||
// - relationships/family_relationships.sb, bakery_relationships.sb
|
||||
// - characters/*.sb
|
||||
|
||||
let project = load_example("baker-family");
|
||||
|
||||
Reference in New Issue
Block a user