@@ -108,7 +108,6 @@ def _closure_js_library_impl(
108108 convention = "CLOSURE" ,
109109 no_closure_library = False ,
110110 internal_expect_failure = False ,
111- ts_lib = None ,
112111
113112 # These file definitions for our outputs are deprecated,
114113 # and will be replaced with |actions.declare_file()| soon.
@@ -150,15 +149,6 @@ def _closure_js_library_impl(
150149 "%s.i.js" % label .name ,
151150 )
152151
153- # Wrapper around a ts_library. It's like creating a closure_js_library with
154- # the runtime_deps of the ts_library, and the srcs are the tsickle outputs from
155- # the ts_library.
156- if ts_lib :
157- srcs = srcs + ts_lib .typescript .transitive_es6_sources .to_list ()
158- # Note that we need to modify deps before calling unfurl below for exports to work.
159- deps = deps + ts_lib .typescript .runtime_deps .to_list ()
160- suppress = suppress + ["checkTypes" , "reportUnknownTypes" , "analyzerChecks" , "JSC_EXTRA_REQUIRE_WARNING" ]
161-
162152 # Create a list of direct children of this rule. If any direct dependencies
163153 # have the exports attribute, those labels become direct dependencies here.
164154 deps = unfurl (deps , provider = "closure_js_library" )
@@ -393,14 +383,26 @@ def _closure_js_library(ctx):
393383 print ("closure_js_library 'externs' is deprecated; just use 'srcs'" )
394384 srcs = ctx .files .externs + srcs
395385
386+ deps = ctx .attr .deps
387+ suppress = ctx .attr .suppress
388+
389+ # Wrapper around a ts_library. It's like creating a closure_js_library with
390+ # the runtime_deps of the ts_library, and the srcs are the tsickle outputs from
391+ # the ts_library.
392+ if ctx .attr .ts_lib :
393+ srcs = srcs + ctx .attr .ts_lib .typescript .transitive_es6_sources .to_list ()
394+ # Note that we need to modify deps before calling unfurl below for exports to work.
395+ deps = deps + ctx .attr .ts_lib .typescript .runtime_deps .to_list ()
396+ suppress = suppress + ["checkTypes" , "strictCheckTypes" , "reportUnknownTypes" , "analyzerChecks" , "JSC_EXTRA_REQUIRE_WARNING" ]
397+
396398 library = _closure_js_library_impl (
397399 ctx .actions ,
398400 ctx .label ,
399401 ctx .workspace_name ,
400402 srcs ,
401- ctx . attr . deps ,
403+ deps ,
402404 ctx .attr .testonly ,
403- ctx . attr . suppress ,
405+ suppress ,
404406 ctx .attr .lenient ,
405407 ctx .files ._closure_library_base ,
406408 ctx .executable ._ClosureWorker ,
@@ -410,7 +412,6 @@ def _closure_js_library(ctx):
410412 ctx .attr .convention ,
411413 ctx .attr .no_closure_library ,
412414 ctx .attr .internal_expect_failure ,
413- ctx .attr .ts_lib ,
414415
415416 # Deprecated output files.
416417 ctx .outputs .info ,
@@ -429,7 +430,7 @@ def _closure_js_library(ctx):
429430 transitive_files = (depset ([] if ctx .attr .no_closure_library else ctx .files ._closure_library_base ) |
430431 collect_runfiles (
431432 unfurl (
432- ctx .attr .deps ,
433+ deps + ctx .attr .exports ,
433434 provider = "closure_js_library" ,
434435 ),
435436 ) |
0 commit comments