hunk.code_window:       } else {
           throw failure;
         }
       }
       // Return if the build encountered any errors
       if (result.errors.length) {
         return {
           errors: result.errors,
  
hunk.labels: keep keep keep keep add keep keep keep keep
hunk.after_edit:     // Update files that should be watched.
       // While this should technically not be linked to incremental mode, incremental is only
       // currently enabled with watch mode where watch files are needed.
       if (this.incremental) {
         this.watchFiles.clear();
         // Add input files except virtual angular files which do not exist on disk
         Object.keys(result.metafile.inputs)
           .filter((input) => !input.startsWith('angular:'))
           .forEach((input) => this.watchFiles.add(join(this.workspaceRoot, input)));
       }
  
hunk.file_path: packages/angular_devkit/build_angular/src/tools/esbuild/bundler-context.ts
hunk.type: add
file: # Copyright Google Inc. All Rights Reserved.
  #
  # Use of this source code is governed by an MIT-style license that can be
  # found in the LICENSE file at https://angular.io/license
  
  def _ts_json_schema_interface_impl(ctx):
      args = [
          ctx.files.src[0].path,
          ctx.outputs.ts.path,
      ]
  
      ctx.actions.run(
          inputs = ctx.files.src + ctx.files.data,
          executable = ctx.executable._binary,
          outputs = [ctx.outputs.ts],
          arguments = args,
      )
  
      return [DefaultInfo()]
  
  _ts_json_schema_interface = rule(
      _ts_json_schema_interface_impl,
      attrs = {
          "src": attr.label(
              allow_files = [".json"],
              mandatory = True,
          ),
          "out": attr.string(
              mandatory = True,
          ),
          "data": attr.label_list(
              allow_files = [".json"],
          ),
          "_binary": attr.label(
              default = Label("//tools:quicktype_runner"),
              executable = True,
              cfg = "exec",
          ),
      },
      outputs = {
          "ts": "%{out}",
      },
  )
  
  # Generates a TS file that contains the interface for a JSON Schema file. Takes a single `src`
  # argument as input, an optional data field for reference files, and produces a
  # _ts_json_schema_interface() rule containing the typescript interface.
  # The file produced will have the same name, with the extension replaced from `.json` to `.ts`.
  # Any filename collision will be an error thrown by Bazel.
  def ts_json_schema(name, src, data = []):
      out = src.replace(".json", ".ts")
  
      _ts_json_schema_interface(
          name = name + ".interface",
          src = src,
          out = out,
          data = data,
      )
  