public function generateComponent($component_data, $existing_module_files = []) {
    // Add the top-level component to the data.
    $component_type = $this->base;
    $component_data['base'] = $component_type;

    // The component name is just the same as the type for the base generator.
    $component_name = $component_type;

    // Assemble the component list from the request data.
    $component_collection = $this->getHelper('ComponentCollector')->assembleComponentList($component_data);
    // Backward-compatiblity.
    // TODO: replace this.
    $this->component_list = $component_collection->getComponents();

    \DrupalCodeBuilder\Factory::getEnvironment()->log(array_keys($this->component_list), "Complete component list names");

    // Let each component detect whether it already exists in the given module
    // files.
    $this->detectExistence($this->component_list, $existing_module_files);

    // Now assemble them into a tree.
    // Calls containingComponent() on everything and puts it into a 2-D array
    // of parent => [children].
    // TODO: replace use of $tree with accessor on the collection.
    $tree = $component_collection->assembleContainmentTree();

    \DrupalCodeBuilder\Factory::getEnvironment()->log($tree, "Component tree");

    $files_assembled = $this->component_list = $this->getHelper('FileAssembler')->generateFiles(
      $component_data,
      $component_collection
    );

    return $files_assembled;
  }