|
1 | 1 | """Re-export of some bazel rules with repository-wide defaults."""
|
2 | 2 |
|
| 3 | +load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory") |
| 4 | +load("@aspect_bazel_lib//lib:jq.bzl", "jq") |
| 5 | +load("@aspect_bazel_lib//lib:utils.bzl", "to_label") |
| 6 | +load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin", _js_library = "js_library", _pkg_npm = "pkg_npm") |
3 | 7 | load("@npm//@angular/bazel:index.bzl", _ng_module = "ng_module", _ng_package = "ng_package")
|
| 8 | +load("@npm//@angular/build-tooling/bazel:extract_js_module_output.bzl", "extract_js_module_output") |
4 | 9 | load("@npm//@bazel/concatjs:index.bzl", _ts_library = "ts_library")
|
5 |
| -load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin", _js_library = "js_library", _pkg_npm = "pkg_npm") |
6 | 10 | load("@rules_pkg//:pkg.bzl", "pkg_tar")
|
7 |
| -load("@npm//@bazel/esbuild:index.bzl", "esbuild") |
8 |
| -load("@npm//@angular/build-tooling/bazel:extract_js_module_output.bzl", "extract_js_module_output") |
9 |
| -load("@aspect_bazel_lib//lib:utils.bzl", "to_label") |
10 |
| -load("@aspect_bazel_lib//lib:jq.bzl", "jq") |
11 |
| -load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory") |
| 11 | +load("//:constants.bzl", "RELEASE_ENGINES_NODE", "RELEASE_ENGINES_NPM", "RELEASE_ENGINES_YARN") |
12 | 12 | load("//tools:link_package_json_to_tarballs.bzl", "link_package_json_to_tarballs")
|
13 | 13 | load("//tools:snapshot_repo_filter.bzl", "SNAPSHOT_REPO_JQ_FILTER")
|
14 |
| -load("//:constants.bzl", "RELEASE_ENGINES_NODE", "RELEASE_ENGINES_NPM", "RELEASE_ENGINES_YARN") |
15 | 14 |
|
16 | 15 | _DEFAULT_TSCONFIG = "//:tsconfig-build.json"
|
17 | 16 | _DEFAULT_TSCONFIG_NG = "//:tsconfig-build-ng"
|
@@ -281,44 +280,3 @@ def ng_package(deps = [], **kwargs):
|
281 | 280 | }),
|
282 | 281 | **kwargs
|
283 | 282 | )
|
284 |
| - |
285 |
| -def ng_test_library(name, entry_point = None, deps = [], tsconfig = None, **kwargs): |
286 |
| - local_deps = [ |
287 |
| - # We declare "@angular/core" as default dependencies because |
288 |
| - # all Angular component unit tests use the `TestBed` and `Component` exports. |
289 |
| - "@npm//@angular/core", |
290 |
| - ] + deps |
291 |
| - |
292 |
| - if not tsconfig: |
293 |
| - tsconfig = _DEFAULT_TSCONFIG_TEST |
294 |
| - |
295 |
| - ts_library_name = name + "_ts_library" |
296 |
| - ts_library( |
297 |
| - name = ts_library_name, |
298 |
| - testonly = 1, |
299 |
| - tsconfig = tsconfig, |
300 |
| - deps = local_deps, |
301 |
| - **kwargs |
302 |
| - ) |
303 |
| - |
304 |
| - esbuild( |
305 |
| - name, |
306 |
| - testonly = 1, |
307 |
| - args = { |
308 |
| - "keepNames": True, |
309 |
| - # ensure that esbuild prefers .mjs to .js if both are available |
310 |
| - # since ts_library produces both |
311 |
| - "resolveExtensions": [ |
312 |
| - ".mjs", |
313 |
| - ".js", |
314 |
| - ], |
315 |
| - }, |
316 |
| - output = name + "_spec.js", |
317 |
| - entry_point = entry_point, |
318 |
| - format = "iife", |
319 |
| - # We cannot use `ES2017` or higher as that would result in `async/await` not being downleveled. |
320 |
| - # ZoneJS needs to be able to intercept these as otherwise change detection would not work properly. |
321 |
| - target = "es2016", |
322 |
| - platform = "node", |
323 |
| - deps = [":" + ts_library_name], |
324 |
| - ) |
0 commit comments