2020-11-01 05:26:58 +01:00
|
|
|
load("@npm//@bazel/typescript:index.bzl", "ts_library")
|
|
|
|
load("//ts:prettier.bzl", "prettier_test")
|
|
|
|
load("//ts:eslint.bzl", "eslint_test")
|
2021-03-20 05:56:08 +01:00
|
|
|
load("//ts/svelte:svelte.bzl", "svelte", "svelte_check")
|
2021-03-20 05:02:19 +01:00
|
|
|
load("//ts:esbuild.bzl", "esbuild")
|
2020-11-01 05:26:58 +01:00
|
|
|
|
|
|
|
svelte(
|
|
|
|
name = "CongratsPage",
|
|
|
|
entry_point = "CongratsPage.svelte",
|
|
|
|
)
|
|
|
|
|
|
|
|
ts_library(
|
2021-03-21 13:47:52 +01:00
|
|
|
name = "index",
|
|
|
|
srcs = ["index.ts"],
|
2020-11-01 05:26:58 +01:00
|
|
|
deps = [
|
|
|
|
"CongratsPage",
|
|
|
|
"lib",
|
|
|
|
"//ts/lib",
|
|
|
|
"@npm//svelte2tsx",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "lib",
|
|
|
|
srcs = ["lib.ts"],
|
|
|
|
deps = [
|
|
|
|
"//ts/lib",
|
|
|
|
"//ts/lib:backend_proto",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2021-03-20 05:02:19 +01:00
|
|
|
esbuild(
|
2020-11-01 05:26:58 +01:00
|
|
|
name = "congrats",
|
2021-03-20 05:02:19 +01:00
|
|
|
srcs = [
|
|
|
|
"//ts:protobuf-shim.js",
|
|
|
|
],
|
|
|
|
args = [
|
|
|
|
"--global-name=anki",
|
2021-03-28 00:35:46 +01:00
|
|
|
"--inject:$(location //ts:protobuf-shim.js)",
|
2021-03-20 05:02:19 +01:00
|
|
|
],
|
2021-03-21 13:47:52 +01:00
|
|
|
entry_point = "index.ts",
|
2021-03-20 05:02:19 +01:00
|
|
|
external = [
|
|
|
|
"protobufjs/light",
|
|
|
|
],
|
2021-03-21 13:47:52 +01:00
|
|
|
output_css = True,
|
2020-11-01 05:26:58 +01:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
"CongratsPage",
|
2021-03-21 13:47:52 +01:00
|
|
|
"index",
|
2021-01-02 12:18:10 +01:00
|
|
|
"//ts/lib",
|
2021-03-20 01:22:06 +01:00
|
|
|
"//ts/lib:backend_proto",
|
2021-03-21 13:47:52 +01:00
|
|
|
"//ts/sass:core_css",
|
2020-11-01 05:26:58 +01:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
exports_files(["congrats.html"])
|
|
|
|
|
|
|
|
# Tests
|
|
|
|
################
|
|
|
|
|
|
|
|
prettier_test(
|
2020-11-12 11:11:40 +01:00
|
|
|
name = "format_check",
|
2020-11-01 05:26:58 +01:00
|
|
|
srcs = glob([
|
|
|
|
"*.ts",
|
|
|
|
"*.svelte",
|
|
|
|
]),
|
|
|
|
)
|
|
|
|
|
|
|
|
eslint_test(
|
|
|
|
name = "eslint",
|
|
|
|
srcs = glob([
|
|
|
|
"*.ts",
|
|
|
|
]),
|
|
|
|
)
|
|
|
|
|
|
|
|
svelte_check(
|
2020-11-12 11:11:40 +01:00
|
|
|
name = "svelte_check",
|
2020-11-01 05:26:58 +01:00
|
|
|
srcs = glob([
|
|
|
|
"*.ts",
|
|
|
|
"*.svelte",
|
|
|
|
]),
|
|
|
|
)
|