| load("@npm//@bazel/rollup:index.bzl", "rollup_bundle") |
| load("//tools/js:eslint.bzl", "plugin_eslint") |
| load("//tools/bzl:js.bzl", "gerrit_js_bundle", "karma_test") |
| load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project") |
| load("//tools/bzl:plugin.bzl", "gerrit_plugin") |
| |
| ts_config( |
| name = "tsconfig", |
| src = "tsconfig.json", |
| deps = [ |
| "//plugins:tsconfig-plugins-base.json", |
| ], |
| ) |
| |
| ts_project( |
| name = "code_coverage_ts", |
| srcs = glob( |
| ["**/*.ts"], |
| exclude = ["**/*test*"], |
| ), |
| incremental = True, |
| out_dir = "_bazel_ts_out", |
| tsc = "//tools/node_tools:tsc-bin", |
| tsconfig = ":tsconfig", |
| deps = [ |
| "@plugins_npm//@gerritcodereview/typescript-api", |
| "@plugins_npm//lit", |
| ], |
| ) |
| |
| gerrit_js_bundle( |
| name = "code_coverage", |
| srcs = [":code_coverage_ts"], |
| entry_point = "_bazel_ts_out/plugin.js", |
| ) |
| |
| ts_project( |
| name = "code_coverage_ts-tests", |
| srcs = glob(["**/*.ts"]), |
| incremental = True, |
| out_dir = "_bazel_ts_out_tests", |
| tsc = "//tools/node_tools:tsc-bin", |
| tsconfig = ":tsconfig", |
| deps = [ |
| "@plugins_npm//:node_modules", |
| "@ui_dev_npm//:node_modules", |
| ], |
| ) |
| |
| karma_test( |
| name = "karma_test", |
| srcs = ["karma_test.sh"], |
| data = [":code_coverage_ts-tests"], |
| ) |
| |
| plugin_eslint() |