@@ -5,14 +5,13 @@ load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
55load ("@aspect_bazel_lib//lib:jq.bzl" , "jq" )
66load ("@aspect_bazel_lib//lib:utils.bzl" , "to_label" )
77load ("@build_bazel_rules_nodejs//:index.bzl" , _js_library = "js_library" , _pkg_npm = "pkg_npm" )
8- load ("@npm//@angular/bazel:index.bzl" , _ng_module = "ng_module" , _ng_package = "ng_package" )
8+ load ("@npm//@angular/bazel:index.bzl" , _ng_package = "ng_package" )
99load ("@npm//@angular/build-tooling/bazel:extract_js_module_output.bzl" , "extract_js_module_output" )
1010load ("@rules_pkg//:pkg.bzl" , "pkg_tar" )
1111load ("//tools:link_package_json_to_tarballs.bzl" , "link_package_json_to_tarballs" )
1212load ("//tools:snapshot_repo_filter.bzl" , "SNAPSHOT_REPO_JQ_FILTER" )
1313load ("//tools:substitutions.bzl" , "NO_STAMP_PACKAGE_SUBSTITUTIONS" , "NPM_PACKAGE_SUBSTITUTIONS" )
1414
15- _DEFAULT_TSCONFIG_NG = "//:tsconfig-build-ng"
1615_DEFAULT_TSCONFIG_TEST = "//:tsconfig-test.json"
1716
1817def _default_module_name (testonly ):
@@ -177,45 +176,6 @@ def pkg_npm(name, pkg_deps = [], use_prodmode_output = False, **kwargs):
177176 visibility = visibility ,
178177 )
179178
180- def ng_module (name , tsconfig = None , entry_point = None , testonly = False , deps = [], module_name = None , package_name = None , ** kwargs ):
181- """Default values for ng_module"""
182- deps = deps + ["@npm//tslib" ]
183- if testonly :
184- # Match the types[] in //packages:tsconfig-test.json
185- deps .append ("@npm//@types/jasmine" )
186- deps .append ("@npm//@types/node" )
187- if not tsconfig :
188- if testonly :
189- tsconfig = _DEFAULT_TSCONFIG_TEST
190- else :
191- tsconfig = _DEFAULT_TSCONFIG_NG
192-
193- if not module_name :
194- module_name = _default_module_name (testonly )
195-
196- # If no `package_name` is explicitly set, we use the default module name as package
197- # name, so that the target can be resolved within NodeJS executions, by activating
198- # the Bazel NodeJS linker. See: https://github.com/bazelbuild/rules_nodejs/pull/2799.
199- if not package_name :
200- package_name = _default_module_name (testonly )
201-
202- if not entry_point :
203- entry_point = "public_api.ts"
204- _ng_module (
205- name = name ,
206- flat_module_out_file = name ,
207- tsconfig = tsconfig ,
208- entry_point = entry_point ,
209- testonly = testonly ,
210- deps = deps ,
211- # `module_name` is used for AMD module names within emitted JavaScript files.
212- module_name = module_name ,
213- # `package_name` can be set to allow for the Bazel NodeJS linker to run. This
214- # allows for resolution of the given target within the `node_modules/`.
215- package_name = package_name ,
216- ** kwargs
217- )
218-
219179def ng_package (deps = [], ** kwargs ):
220180 _ng_package (
221181 deps = deps ,
0 commit comments