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]
|
|
|
|
|
2021-04-21 13:18:31 +02:00
|
|
|
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",
|
|
|
|
],
|
2021-04-19 23:51:09 +02:00
|
|
|
visibility = ["//visibility:public"],
|
2021-03-25 21:11:40 +01:00
|
|
|
)
|
|
|
|
|
2021-04-19 23:51:09 +02:00
|
|
|
ts_library(
|
2021-04-27 23:08:47 +02:00
|
|
|
name = "components",
|
|
|
|
module_name = "components",
|
2021-04-19 23:51:09 +02:00
|
|
|
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",
|
2021-04-19 23:51:09 +02:00
|
|
|
"//ts/sveltelib",
|
|
|
|
"@npm//@popperjs/core",
|
|
|
|
"@npm//@types/bootstrap",
|
|
|
|
"@npm//bootstrap",
|
|
|
|
"@npm//svelte",
|
2021-04-28 13:09:25 +02:00
|
|
|
] + 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",
|
2021-04-15 15:51:56 +02:00
|
|
|
"@npm//@types/bootstrap",
|
2021-04-15 15:33:47 +02:00
|
|
|
],
|
2021-03-25 21:11:40 +01:00
|
|
|
)
|