anki/qt/aqt/data/web/js/BUILD.bazel
2021-10-18 19:39:45 +10:00

72 lines
1.2 KiB
Python

load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//ts:typescript.bzl", "typescript")
load("//ts:copy.bzl", "copy_files_into_group")
load("//ts:prettier.bzl", "prettier_test")
load("//ts:eslint.bzl", "eslint_test")
js_library(
name = "pycmd",
srcs = ["pycmd.d.ts"],
visibility = ["//qt/aqt/data/web/js:__subpackages__"],
)
typescript(
name = "aqt",
srcs = glob(
["*.ts"],
exclude = ["*.d.ts"],
),
deps = [
"pycmd",
"@npm//@types/jquery",
"@npm//@types/jqueryui",
],
)
copy_files_into_group(
name = "editor",
srcs = [
"editor.js",
],
package = "//ts/editor",
)
copy_files_into_group(
name = "reviewer",
srcs = [
"reviewer.js",
],
package = "//ts/reviewer",
)
filegroup(
name = "js",
srcs = [
"aqt",
"editor",
"mathjax.js",
"reviewer",
"//qt/aqt/data/web/js/vendor",
],
visibility = ["//qt:__subpackages__"],
)
prettier_test(
name = "format_check",
srcs = glob([
"*.ts",
"*.js",
]),
)
# source files need fixing first
eslint_test(
name = "eslint",
srcs = glob(["*.ts"]),
)
exports_files([
"mathjax.js",
"tsconfig.json",
])