anki/ts/congrats/BUILD.bazel

84 lines
1.4 KiB
Python
Raw Normal View History

load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("//ts:prettier.bzl", "prettier_test")
load("//ts:eslint.bzl", "eslint_test")
load("//ts/svelte:svelte.bzl", "svelte", "svelte_check")
load("//ts:esbuild.bzl", "esbuild")
svelte(
name = "CongratsPage",
entry_point = "CongratsPage.svelte",
)
ts_library(
name = "index",
srcs = ["index.ts"],
deps = [
"CongratsPage",
"lib",
"//ts/lib",
"@npm//svelte2tsx",
],
)
ts_library(
name = "lib",
srcs = ["lib.ts"],
deps = [
"//ts/lib",
"//ts/lib:backend_proto",
],
)
esbuild(
name = "congrats",
srcs = [
"//ts:protobuf-shim.js",
],
args = [
"--global-name=anki",
"--inject:ts/protobuf-shim.js",
],
entry_point = "index.ts",
external = [
"protobufjs/light",
],
output_css = True,
visibility = ["//visibility:public"],
deps = [
"CongratsPage",
"index",
"//ts/lib",
"//ts/lib:backend_proto",
"//ts/lib:fluent_proto",
"//ts/sass:core_css",
],
)
exports_files(["congrats.html"])
# Tests
################
prettier_test(
name = "format_check",
srcs = glob([
"*.ts",
"*.svelte",
]),
)
eslint_test(
name = "eslint",
srcs = glob([
"*.ts",
]),
)
svelte_check(
name = "svelte_check",
srcs = glob([
"*.ts",
"*.svelte",
]),
)