docs: function getHelperMetadata(file) {
    const globals = new Set();
    const localBindingNames = new Set();
    // Maps imported identifier -> helper name
    const dependencies = new Map();
  
    let exportName;
    let exportPath;
    const exportBindingAssignments = [];
    const importPaths = [];
    const importBindingsReferences = [];
  
    traverse(file, {
      ImportDeclaration(child) {
        const name = child.node.source.value;
        if (!helpers[name]) {
          throw child.buildCodeFrameError(`Unknown helper ${name}`);
        }
        if (
          child.get("specifiers").length !== 1 ||
          !child.get("specifiers.0").isImportDefaultSpecifier()
        ) {
          throw child.buildCodeFrameError(
            "Helpers can only import a default value",
          );
        }
        const bindingIdentifier = child.node.specifiers[0].local;
        dependencies.set(bindingIdentifier, name);
        importPaths.push(makePath(child));
      },
      ExportDefaultDeclaration(child) {
        const decl = child.get("declaration");
  
        if (decl.isFunctionDeclaration()) {
          if (!decl.node.id) {
            throw decl.buildCodeFrameError(
              "Helpers should give names to their exported func declaration",
            );
          }
  
          exportName = decl.node.id.name;
        }
        exportPath = makePath(child);
      },
      ExportAllDeclaration(child) {
        throw child.buildCodeFrameError("Helpers can only export default");
      },
      ExportNamedDeclaration(child) {
        throw child.buildCodeFrameError("Helpers can only export default");
      },
      Statement(child) {
        if (child.isModuleDeclaration()) return;
  
        child.skip();
      },
    });
  
    traverse(file, {
      Program(path) {
        const bindings = path.scope.getAllBindings();
  
        Object.keys(bindings).forEach(name => {
          if (name === exportName) return;
          if (dependencies.has(bindings[name].identifier)) return;
  
          localBindingNames.add(name);
        });
      },
      ReferencedIdentifier(child) {
        const name = child.node.name;
        const binding = child.scope.getBinding(name, /* noGlobal */ true);
        if (!binding) {
          globals.add(name);
        } else if (dependencies.has(binding.identifier)) {
          importBindingsReferences.push(makePath(child));
        }
      },
      AssignmentExpression(child) {
        const left = child.get("left");
  
        if (!(exportName in left.getBindingIdentifiers())) return;
  
        if (!left.isIdentifier()) {
          throw left.buildCodeFrameError(
            "Only simple assignments to exports are allowed in helpers",
          );
        }
  
        const binding = child.scope.getBinding(exportName);
  
        if (binding && binding.scope.path.isProgram()) {
          exportBindingAssignments.push(makePath(child));
        }
      },
    });
  
    if (!exportPath) throw new Error("Helpers must default-export something.");
  
    // Process these in reverse so that mutating the references does not invalidate any later paths in
    // the list.
    exportBindingAssignments.reverse();
  
    return {
      globals: Array.from(globals),
      localBindingNames: Array.from(localBindingNames),
      dependencies,
      exportBindingAssignments,
      exportPath,
      exportName,
      importBindingsReferences,
      importPaths,
    };
  }