Anki/ts/lib/BUILD.bazel
Henrik Giesel 51af6b2544 Rename i18n and i18n_helpers to i18n-generated and i18n
- This way, we can restrict the awkwardness of importing files outside
  the ts directory within lib
2021-10-02 23:34:03 +02:00

63 lines
1.2 KiB
Text

load("//ts:prettier.bzl", "prettier_test")
load("//ts:eslint.bzl", "eslint_test")
load("//ts:protobuf.bzl", "protobufjs_library")
load("//ts:typescript.bzl", "typescript")
load("@rules_python//python:defs.bzl", "py_binary")
load("@py_deps//:requirements.bzl", "requirement")
load("//ts:jest.bzl", "jest_test")
protobufjs_library(
name = "backend_proto",
proto = "//proto:backend_proto_lib",
visibility = ["//visibility:public"],
)
py_binary(
name = "genfluent",
srcs = [
"genfluent.py",
],
deps = [
requirement("black"),
requirement("stringcase"),
],
)
genrule(
name = "fluent_gen",
outs = ["i18n-generated.ts"],
cmd = "$(location genfluent) $(location //rslib/i18n:strings.json) $@",
tools = [
"genfluent",
"//rslib/i18n:strings.json",
],
)
typescript(
name = "lib",
generated = [
":i18n-generated.ts",
],
deps = [
":backend_proto",
"@npm//@fluent/bundle",
"@npm//@types/jest",
"@npm//@types/long",
"@npm//intl-pluralrules",
"@npm//protobufjs",
"@npm//tslib",
],
)
# Tests
################
prettier_test()
eslint_test()
jest_test(
deps = [
":lib",
],
)