refactor: rename js_filegroup to js_info_files (#1615)

diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel
index ec5b8cd..17ce797 100644
--- a/docs/BUILD.bazel
+++ b/docs/BUILD.bazel
@@ -22,8 +22,8 @@
 )
 
 stardoc_with_diff_test(
-    name = "js_filegroup",
-    bzl_library_target = "//js/private:js_filegroup",
+    name = "js_info_files",
+    bzl_library_target = "//js/private:js_info_files",
 )
 
 stardoc_with_diff_test(
diff --git a/docs/js_filegroup.md b/docs/js_filegroup.md
deleted file mode 100644
index 2cca482..0000000
--- a/docs/js_filegroup.md
+++ /dev/null
@@ -1,32 +0,0 @@
-<!-- Generated with Stardoc: http://skydoc.bazel.build -->
-
-Helper rule to gather files from JsInfo providers of targets and provide them as default outputs
-
-<a id="js_filegroup"></a>
-
-## js_filegroup
-
-<pre>
-js_filegroup(<a href="#js_filegroup-name">name</a>, <a href="#js_filegroup-include_declarations">include_declarations</a>, <a href="#js_filegroup-include_npm_linked_packages">include_npm_linked_packages</a>, <a href="#js_filegroup-include_sources">include_sources</a>,
-             <a href="#js_filegroup-include_transitive_declarations">include_transitive_declarations</a>, <a href="#js_filegroup-include_transitive_sources">include_transitive_sources</a>, <a href="#js_filegroup-srcs">srcs</a>)
-</pre>
-
-Gathers files from the JsInfo providers from targets in srcs and provides them as default outputs.
-
-This helper rule is used by the `js_run_binary` macro.
-
-
-**ATTRIBUTES**
-
-
-| Name  | Description | Type | Mandatory | Default |
-| :------------- | :------------- | :------------- | :------------- | :------------- |
-| <a id="js_filegroup-name"></a>name |  A unique name for this target.   | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required |  |
-| <a id="js_filegroup-include_declarations"></a>include_declarations |  When True, <code>declarations</code> from <code>JsInfo</code> providers in srcs targets are included in the default outputs of the target.<br><br>            Defaults to False since declarations are generally not needed at runtime and introducing them could slow down developer round trip             time due to having to generate typings on source file changes.   | Boolean | optional | <code>False</code> |
-| <a id="js_filegroup-include_npm_linked_packages"></a>include_npm_linked_packages |  When True, files in <code>npm_linked_packages</code> from <code>JsInfo</code> providers in srcs targets are included in the default outputs of the target.<br><br>            <code>transitive_files</code> from <code>NpmPackageStoreInfo</code> providers in data targets are also included in the default outputs of the target.   | Boolean | optional | <code>True</code> |
-| <a id="js_filegroup-include_sources"></a>include_sources |  When True, <code>sources</code> from <code>JsInfo</code> providers in <code>srcs</code> targets are included in the default outputs of the target.   | Boolean | optional | <code>True</code> |
-| <a id="js_filegroup-include_transitive_declarations"></a>include_transitive_declarations |  When True, <code>transitive_declarations</code> from <code>JsInfo</code> providers in srcs targets are included in the default outputs of the target.<br><br>            Defaults to False since declarations are generally not needed at runtime and introducing them could slow down developer round trip             time due to having to generate typings on source file changes.   | Boolean | optional | <code>False</code> |
-| <a id="js_filegroup-include_transitive_sources"></a>include_transitive_sources |  When True, <code>transitive_sources</code> from <code>JsInfo</code> providers in <code>srcs</code> targets are included in the default outputs of the target.   | Boolean | optional | <code>True</code> |
-| <a id="js_filegroup-srcs"></a>srcs |  List of targets to gather files from.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | <code>[]</code> |
-
-
diff --git a/docs/js_info_files.md b/docs/js_info_files.md
new file mode 100644
index 0000000..c5a8e7f
--- /dev/null
+++ b/docs/js_info_files.md
@@ -0,0 +1,32 @@
+<!-- Generated with Stardoc: http://skydoc.bazel.build -->
+
+Helper rule to gather files from JsInfo providers of targets and provide them as default outputs
+
+<a id="js_info_files"></a>
+
+## js_info_files
+
+<pre>
+js_info_files(<a href="#js_info_files-name">name</a>, <a href="#js_info_files-include_declarations">include_declarations</a>, <a href="#js_info_files-include_npm_linked_packages">include_npm_linked_packages</a>, <a href="#js_info_files-include_sources">include_sources</a>,
+              <a href="#js_info_files-include_transitive_declarations">include_transitive_declarations</a>, <a href="#js_info_files-include_transitive_sources">include_transitive_sources</a>, <a href="#js_info_files-srcs">srcs</a>)
+</pre>
+
+Gathers files from the JsInfo providers from targets in srcs and provides them as default outputs.
+
+This helper rule is used by the `js_run_binary` macro.
+
+
+**ATTRIBUTES**
+
+
+| Name  | Description | Type | Mandatory | Default |
+| :------------- | :------------- | :------------- | :------------- | :------------- |
+| <a id="js_info_files-name"></a>name |  A unique name for this target.   | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required |  |
+| <a id="js_info_files-include_declarations"></a>include_declarations |  When True, <code>declarations</code> from <code>JsInfo</code> providers in srcs targets are included in the default outputs of the target.<br><br>            Defaults to False since declarations are generally not needed at runtime and introducing them could slow down developer round trip             time due to having to generate typings on source file changes.   | Boolean | optional | <code>False</code> |
+| <a id="js_info_files-include_npm_linked_packages"></a>include_npm_linked_packages |  When True, files in <code>npm_linked_packages</code> from <code>JsInfo</code> providers in srcs targets are included in the default outputs of the target.<br><br>            <code>transitive_files</code> from <code>NpmPackageStoreInfo</code> providers in data targets are also included in the default outputs of the target.   | Boolean | optional | <code>True</code> |
+| <a id="js_info_files-include_sources"></a>include_sources |  When True, <code>sources</code> from <code>JsInfo</code> providers in <code>srcs</code> targets are included in the default outputs of the target.   | Boolean | optional | <code>True</code> |
+| <a id="js_info_files-include_transitive_declarations"></a>include_transitive_declarations |  When True, <code>transitive_declarations</code> from <code>JsInfo</code> providers in srcs targets are included in the default outputs of the target.<br><br>            Defaults to False since declarations are generally not needed at runtime and introducing them could slow down developer round trip             time due to having to generate typings on source file changes.   | Boolean | optional | <code>False</code> |
+| <a id="js_info_files-include_transitive_sources"></a>include_transitive_sources |  When True, <code>transitive_sources</code> from <code>JsInfo</code> providers in <code>srcs</code> targets are included in the default outputs of the target.   | Boolean | optional | <code>True</code> |
+| <a id="js_info_files-srcs"></a>srcs |  List of targets to gather files from.   | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | <code>[]</code> |
+
+
diff --git a/docs/js_run_binary.md b/docs/js_run_binary.md
index b97e1d9..7b62a5a 100644
--- a/docs/js_run_binary.md
+++ b/docs/js_run_binary.md
@@ -62,9 +62,9 @@
 | <a id="js_run_binary-silent_on_success"></a>silent_on_success |  produce no output on stdout nor stderr when program exits with status code 0.<br><br>This makes node binaries match the expected bazel paradigm.   |  <code>True</code> |
 | <a id="js_run_binary-use_execroot_entry_point"></a>use_execroot_entry_point |  Use the <code>entry_point</code> script of the <code>js_binary</code> <code>tool</code> that is in the execroot output tree instead of the copy that is in runfiles.<br><br>Runfiles of <code>tool</code> are all hoisted to <code>srcs</code> of the underlying <code>run_binary</code> so they are included as execroot inputs to the action.<br><br>Using the entry point script that is in the execroot output tree means that there will be no conflicting runfiles <code>node_modules</code> in the node_modules resolution path which can confuse npm packages such as next and react that don't like being resolved in multiple node_modules trees. This more closely emulates the environment that tools such as Next.js see when they are run outside of Bazel.<br><br>When True, the <code>js_binary</code> tool must have <code>copy_data_to_bin</code> set to True (the default) so that all data files needed by the binary are available in the execroot output tree. This requirement can be turned off with by setting <code>allow_execroot_entry_point_with_no_copy_data_to_bin</code> to True.   |  <code>True</code> |
 | <a id="js_run_binary-copy_srcs_to_bin"></a>copy_srcs_to_bin |  When True, all srcs files are copied to the output tree that are not already there.   |  <code>True</code> |
-| <a id="js_run_binary-include_transitive_sources"></a>include_transitive_sources |  see <code>js_filegroup</code> documentation   |  <code>True</code> |
-| <a id="js_run_binary-include_declarations"></a>include_declarations |  see <code>js_filegroup</code> documentation   |  <code>False</code> |
-| <a id="js_run_binary-include_npm_linked_packages"></a>include_npm_linked_packages |  see <code>js_filegroup</code> documentation   |  <code>True</code> |
+| <a id="js_run_binary-include_transitive_sources"></a>include_transitive_sources |  see <code>js_info_files</code> documentation   |  <code>True</code> |
+| <a id="js_run_binary-include_declarations"></a>include_declarations |  see <code>js_info_files</code> documentation   |  <code>False</code> |
+| <a id="js_run_binary-include_npm_linked_packages"></a>include_npm_linked_packages |  see <code>js_info_files</code> documentation   |  <code>True</code> |
 | <a id="js_run_binary-log_level"></a>log_level |  Set the logging level of the <code>js_binary</code> tool.<br><br>This overrides the log level set on the <code>js_binary</code> tool target.   |  <code>None</code> |
 | <a id="js_run_binary-mnemonic"></a>mnemonic |  A one-word description of the action, for example, CppCompile or GoLink.   |  <code>"JsRunBinary"</code> |
 | <a id="js_run_binary-progress_message"></a>progress_message |  Progress message to show to the user during the build, for example, "Compiling foo.cc to create foo.o". The message may contain %{label}, %{input}, or %{output} patterns, which are substituted with label string, first input, or output's path, respectively. Prefer to use patterns instead of static strings, because the former are more efficient.   |  <code>None</code> |
diff --git a/js/defs.bzl b/js/defs.bzl
index 12f80ed..623a4b9 100644
--- a/js/defs.bzl
+++ b/js/defs.bzl
@@ -14,8 +14,8 @@
     _js_run_binary = "js_run_binary",
 )
 load(
-    "//js/private:js_filegroup.bzl",
-    _js_filegroup = "js_filegroup",
+    "//js/private:js_info_files.bzl",
+    _js_info_files = "js_info_files",
 )
 load(
     "//js/private:js_run_devserver.bzl",
@@ -45,7 +45,7 @@
     )
 
 js_run_devserver = _js_run_devserver
-js_filegroup = _js_filegroup
+js_info_files = _js_info_files
 js_library = _js_library
 js_run_binary = _js_run_binary
 js_image_layer = _js_image_layer
diff --git a/js/private/BUILD.bazel b/js/private/BUILD.bazel
index b223fea..16e59b3 100644
--- a/js/private/BUILD.bazel
+++ b/js/private/BUILD.bazel
@@ -20,8 +20,8 @@
 ])
 
 bzl_library(
-    name = "js_filegroup",
-    srcs = ["js_filegroup.bzl"],
+    name = "js_info_files",
+    srcs = ["js_info_files.bzl"],
     visibility = [
         "//docs:__subpackages__",
         "//js:__subpackages__",
@@ -87,8 +87,8 @@
         "//js:__subpackages__",
     ],
     deps = [
-        ":js_filegroup",
         ":js_helpers",
+        ":js_info_files",
         ":js_library",
         "@aspect_bazel_lib//lib:copy_to_bin",
         "@aspect_bazel_lib//lib:run_binary",
diff --git a/js/private/js_helpers.bzl b/js/private/js_helpers.bzl
index f202ac7..d7a5f50 100644
--- a/js/private/js_helpers.bzl
+++ b/js/private/js_helpers.bzl
@@ -193,15 +193,15 @@
             file such as a file in an external repository. In most cases, this option is not needed.
             See `copy_data_files_to_bin` docstring for more info.
 
-        include_sources: see js_filegroup documentation
+        include_sources: see js_info_files documentation
 
-        include_transitive_sources: see js_filegroup documentation
+        include_transitive_sources: see js_info_files documentation
 
-        include_declarations: see js_filegroup documentation
+        include_declarations: see js_info_files documentation
 
-        include_transitive_declarations: see js_filegroup documentation
+        include_transitive_declarations: see js_info_files documentation
 
-        include_npm_linked_packages: see js_filegroup documentation
+        include_npm_linked_packages: see js_info_files documentation
 
     Returns:
         A [runfiles](https://bazel.build/rules/lib/runfiles) object created with [ctx.runfiles](https://bazel.build/rules/lib/ctx#runfiles).
@@ -293,11 +293,11 @@
 
     Args:
         targets: list of target to gather from
-        include_sources: see js_filegroup documentation
-        include_transitive_sources: see js_filegroup documentation
-        include_declarations: see js_filegroup documentation
-        include_transitive_declarations: see js_filegroup documentation
-        include_npm_linked_packages: see js_filegroup documentation
+        include_sources: see js_info_files documentation
+        include_transitive_sources: see js_info_files documentation
+        include_declarations: see js_info_files documentation
+        include_transitive_declarations: see js_info_files documentation
+        include_npm_linked_packages: see js_info_files documentation
 
     Returns:
         A depset of files
diff --git a/js/private/js_filegroup.bzl b/js/private/js_info_files.bzl
similarity index 96%
rename from js/private/js_filegroup.bzl
rename to js/private/js_info_files.bzl
index 6425bd3..9240946 100644
--- a/js/private/js_filegroup.bzl
+++ b/js/private/js_info_files.bzl
@@ -7,7 +7,7 @@
 This helper rule is used by the `js_run_binary` macro.
 """
 
-def _js_filegroup_impl(ctx):
+def _js_info_files_impl(ctx):
     return DefaultInfo(files = _gather_files_from_js_providers(
         targets = ctx.attr.srcs,
         include_sources = ctx.attr.include_sources,
@@ -17,9 +17,9 @@
         include_npm_linked_packages = ctx.attr.include_npm_linked_packages,
     ))
 
-js_filegroup = rule(
+js_info_files = rule(
     doc = _DOC,
-    implementation = _js_filegroup_impl,
+    implementation = _js_info_files_impl,
     attrs = {
         "srcs": attr.label_list(
             doc = """List of targets to gather files from.""",
diff --git a/js/private/js_run_binary.bzl b/js/private/js_run_binary.bzl
index c07a8dd..35811cb 100644
--- a/js/private/js_run_binary.bzl
+++ b/js/private/js_run_binary.bzl
@@ -15,7 +15,7 @@
 load("@aspect_bazel_lib//lib:copy_to_bin.bzl", _copy_to_bin = "copy_to_bin")
 load("@bazel_skylib//lib:dicts.bzl", "dicts")
 load(":js_helpers.bzl", _envs_for_log_level = "envs_for_log_level")
-load(":js_filegroup.bzl", _js_filegroup = "js_filegroup")
+load(":js_info_files.bzl", _js_info_files = "js_info_files")
 load(":js_library.bzl", _js_library = "js_library")
 
 def js_run_binary(
@@ -150,11 +150,11 @@
 
         copy_srcs_to_bin: When True, all srcs files are copied to the output tree that are not already there.
 
-        include_transitive_sources: see `js_filegroup` documentation
+        include_transitive_sources: see `js_info_files` documentation
 
-        include_declarations: see `js_filegroup` documentation
+        include_declarations: see `js_info_files` documentation
 
-        include_npm_linked_packages: see `js_filegroup` documentation
+        include_npm_linked_packages: see `js_info_files` documentation
 
         log_level: Set the logging level of the `js_binary` tool.
 
@@ -245,13 +245,13 @@
     extra_srcs = []
 
     # Hoist js provider files to DefaultInfo
-    make_js_filegroup_target = (include_transitive_sources or
-                                include_declarations or
-                                include_npm_linked_packages)
-    if make_js_filegroup_target:
-        js_filegroup_name = "{}_js_filegroup".format(name)
-        _js_filegroup(
-            name = js_filegroup_name,
+    make_js_info_files_target = (include_transitive_sources or
+                                 include_declarations or
+                                 include_npm_linked_packages)
+    if make_js_info_files_target:
+        js_info_files_name = "{}_js_info_files".format(name)
+        _js_info_files(
+            name = js_info_files_name,
             srcs = srcs,
             include_transitive_sources = include_transitive_sources,
             include_declarations = include_declarations,
@@ -261,7 +261,7 @@
             # Always propagate the testonly attribute
             testonly = kwargs.get("testonly", False),
         )
-        extra_srcs.append(":{}".format(js_filegroup_name))
+        extra_srcs.append(":{}".format(js_info_files_name))
 
     # Copy srcs to bin
     if copy_srcs_to_bin: