Refactor the "output_groups" string to the OutputGroupInfo() provider.

This is the beginning of removing the legacy providers, per https://github.com/bazelbuild/bazel/issues/7347

See https://docs.bazel.build/versions/master/skylark/rules.html#migrating-from-legacy-providers:
"The field output_groups takes a struct value and corresponds to an
OutputGroupInfo."

PiperOrigin-RevId: 265162279
diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl
index 6af26b5..70a66d7 100644
--- a/internal/common/compilation.bzl
+++ b/internal/common/compilation.bzl
@@ -479,6 +479,10 @@
                 ),
                 files = depset(transitive = files_depsets),
             ),
+            OutputGroupInfo(
+                es5_sources = es5_sources,
+                es6_sources = es6_sources,
+            ),
         ],
         "instrumented_files": {
             "dependency_attributes": ["deps", "runtime_deps"],
@@ -489,10 +493,6 @@
         # e.g. rollup_bundle under Bazel needs to convert this into a UMD global
         # name in the Rollup configuration.
         "module_name": getattr(ctx.attr, "module_name", None),
-        "output_groups": {
-            "es5_sources": es5_sources,
-            "es6_sources": es6_sources,
-        },
         # Expose the tags so that a Skylark aspect can access them.
         "tags": ctx.attr.tags if hasattr(ctx.attr, "tags") else ctx.rule.attr.tags,
         # TODO(martinprobst): Prune transitive deps, only re-export what's needed.