# TODO: Make this private when we can import from the root index.ts
package(default_visibility = ["//visibility:public"])

load("@angular//:index.bzl", "ng_module")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library", "ts_web_test")

ng_module(
    name = "<%= sourceDir %>",
    srcs = glob(
        ["*.ts"],
        exclude = ["*.spec.ts"],
    ),
    deps = [
        "@rxjs",
    ],
)

ts_library(
    name = "test_lib",
    testonly = 1,
    srcs = glob(["*.spec.ts"]),
    deps = [
        ":<%= sourceDir %>",
    ],
)

ts_web_test(
    name = "test",
    bootstrap = ["//:angular_bootstrap_scripts"],
    deps = [
        ":test_lib",
        "//:angular_bundles",
        "//:angular_test_bundles",
    ],
)
