flatten_component_tree

Function flatten_component_tree 

Source
pub fn flatten_component_tree(
    tree: &HashMap<String, ComponentItemSpec>,
) -> HashMap<String, ComponentItemSpec>
Expand description

Flattens a hierarchical component item map into a flat map with dot-separated keys.

This transformation is useful for:

  • Displaying component interfaces in CLI (arcella list --exports)
  • Generating flat dependency lists
  • Simplifying manifest validation

ยงExample

Input:

{
  "logger": ComponentInstance {
    exports: { "log": ComponentFunc(...) }
  }
}

Output:

{
  "logger": ComponentInstance(...),
  "logger.log": ComponentFunc(...)
}