anki/ts/components/BUILD.bazel

78 lines
1.5 KiB
Python
Raw Normal View History

2021-03-25 21:11:40 +01:00
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("//ts/svelte:svelte.bzl", "compile_svelte", "svelte_check")
load("//ts:prettier.bzl", "prettier_test")
load("//ts:eslint.bzl", "eslint_test")
load("//ts:esbuild.bzl", "esbuild")
svelte_files = glob(["*.svelte"])
svelte_names = [f.replace(".svelte", "") for f in svelte_files]
filegroup(
name = "svelte_components",
srcs = svelte_names,
visibility = ["//visibility:public"],
)
2021-03-25 21:11:40 +01:00
compile_svelte(
name = "svelte",
srcs = svelte_files,
2021-04-15 14:04:41 +02:00
deps = [
2021-04-15 15:33:47 +02:00
"//ts/sass:button_mixins_lib",
2021-04-15 14:04:41 +02:00
"//ts/sass/bootstrap",
],
visibility = ["//visibility:public"],
2021-03-25 21:11:40 +01:00
)
ts_library(
2021-04-27 23:08:47 +02:00
name = "components",
module_name = "components",
srcs = glob(
["*.ts"],
exclude = ["*.test.ts"],
),
tsconfig = "//ts:tsconfig.json",
2021-03-25 21:11:40 +01:00
visibility = ["//visibility:public"],
deps = [
"//ts/lib",
"//ts/lib:backend_proto",
"//ts/sveltelib",
"@npm//@popperjs/core",
"@npm//@types/bootstrap",
"@npm//bootstrap",
"@npm//svelte",
] + svelte_names,
2021-03-25 21:11:40 +01:00
)
# 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",
2021-04-15 15:33:47 +02:00
]) + [
"//ts/sass:button_mixins_lib",
"//ts/sass/bootstrap",
"@npm//@types/bootstrap",
2021-04-15 15:33:47 +02:00
],
2021-03-25 21:11:40 +01:00
)