docs: private void addCodeToRequireGoogModules(SoyFileNode soyFile) {
      int counter = 1;
  
      // Get all the unique calls in the file.
      Set<String> calls = new HashSet<>();
      for (CallBasicNode callNode : SoyTreeUtils.getAllNodesOfType(soyFile, CallBasicNode.class)) {
        calls.add(callNode.getCalleeName());
      }
  
      // Map all the unique namespaces to the templates in those namespaces.
      SetMultimap<String, String> namespaceToTemplates = TreeMultimap.create();
      for (String call : calls) {
        namespaceToTemplates.put(call.substring(0, call.lastIndexOf('.')), call);
      }
  
      for (String namespace : namespaceToTemplates.keySet()) {
        // Skip the file's own namespace as there is nothing to import/alias.
        if (namespace.equals(soyFile.getNamespace())) {
          continue;
        }
  
        // Add a require of the module
        String namespaceAlias = "$import" + counter++;
        String importNamespace = getGoogModuleNamespace(namespace);
        jsCodeBuilder.append(
            VariableDeclaration.builder(namespaceAlias)
                .setRhs(GOOG_REQUIRE.call(stringLiteral(importNamespace)))
                .build());
        // Alias all the templates used from the module
        for (String fullyQualifiedName : namespaceToTemplates.get(namespace)) {
          String alias = templateAliases.get(fullyQualifiedName);
          String shortName = fullyQualifiedName.substring(fullyQualifiedName.lastIndexOf('.'));
          jsCodeBuilder.append(
              VariableDeclaration.builder(alias)
                  .setRhs(dottedIdNoRequire(namespaceAlias + shortName))
                  .build());
        }
      }
    }