refactor(bazel): add support for starlark's unused_inputs_list (#45946)
refactor(bazel): add support for starlark's unused_inputs_list (#45946)

This change adds the capability of ngc_wrapped to emit an
unused_inputs_list file that could be used by starlark.

We are making this change because in situations where angular modules
depend on angular modules, it becomes very easy for a single change to
trigger a long cascading set of angular builds since each angular rule
depends on the transitive closure of input files.

With this change in place, and once it is properly configured, bazel
will update the set of inputs to a build rule after it is built once
removing any of the inputs specified in this list, making incremental
builds quicker by skipping any rebuilds that only had changes to unused
inputs.

This logic should be, and is likely duplicated in tsc_wrapped to solve
the same problem in pure TypeScript situations, ideally we could use the
same implementation one day.

In addition, its possible that tree artifacts are not as supported as
we'd like, and where this change should mark entire directories as
unused, we may get better performance gains by enumerating the directory
and being more explicit about specific inputs which are unused.

PR Close #45946

gnomeontherun/angular,angular/angular,JiaLiPassion/angular,angular/angular,gnomeontherun/angular,angular-indonesia/angular,angular-indonesia/angular,angular-indonesia/angular,angular/angular,gkalpak/angular,angular-indonesia/angular,gkalpak/angular,JiaLiPassion/angular,JiaLiPassion/angular,gnomeontherun/angular,angular/angular,gnomeontherun/angular,gkalpak/angular,gkalpak/angular,JiaLiPassion/angular