function getAllAddonsByNameWithinHost(projectOrAddon, addonName, config = { proxies: [] }) {
  if (!config.originalHost) {
    config.originalHost = projectOrAddon;
  }

  projectOrAddon.addons.forEach((addon) => {
    if (addon.name === addonName) {
      if (config.realAddon && !addon[TARGET_INSTANCE]) {
        throw new Error(
          `The real addon (\`${addon.name}\`) has already been set for a given host (\`${
            typeof config.originalHost.name === 'function' ? config.originalHost.name() : config.originalHost.name
          }\`); the proxy for addon caching is not working correctly`
        );
      }

      if (addon[TARGET_INSTANCE]) {
        config.proxies.push(addon);
      } else {
        config.realAddon = addon;
      }
    }

    // stop traversing within another host
    if (!isLazyEngine(addon)) {
      getAllAddonsByNameWithinHost(addon, addonName, config);
    }
  });

  return config;
}
This collects all addons by name within a given host; it stops traversing when it
encounters another host (i.e., a lazy engine). Within a given host we should expect
at most 1 real addon, otherwise this is an error condition. We otherwise add all
proxies to `config.proxies`

@name getAllAddonsByNameWithinHost
@param {Project|Addon} projectOrAddon
@param {string} addonName
@param {Object} [config]
@returns {{proxies: Proxy[], realAddon: Addon}}