package(default_visibility = ["//visibility:public"])

exports_files(["tsconfig.json"])

load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")

ts_library(
    name = "lib",
    srcs = glob(
        ["internal/**/*.ts"],
        # exclude all backwards compatibility code because we don't have a bazel target setup for that
        exclude = [
            "internal/Rx.ts",
            "internal-compatibility/**",
            "internal/patching/**",
            "internal/umd.ts",
        ],
    ),
    # Specify the compile-time dependencies to run the compilation (eg. typescript)
    # The default value assumes that the end-user has a target //:node_modules
    # but not all users do.
    # This also makes the build more reproducible, in case the user's TypeScript
    # version isn't compatible.
    node_modules = "@build_bazel_rules_typescript_tsc_wrapped_deps//:node_modules",
    tsconfig = "tsconfig.json",
)

ts_library(
    name = "rxjs",
    srcs = ["index.ts"],
    module_name = "rxjs",
    module_root = "index.d.ts",
    # See comment above
    node_modules = "@build_bazel_rules_typescript_tsc_wrapped_deps//:node_modules",
    tsconfig = "tsconfig.json",
    deps = [
        ":lib",
        "//ajax",
        "//operators",
        "//testing",
        "//webSocket",
    ],
)
