92 lines
1.8 KiB
Python
92 lines
1.8 KiB
Python
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")
|
|
load("//ts:compile_sass.bzl", "compile_sass")
|
|
|
|
svelte_files = glob(["*.svelte"])
|
|
|
|
svelte_names = [f.replace(".svelte", "") for f in svelte_files]
|
|
|
|
filegroup(
|
|
name = "svelte_components",
|
|
srcs = svelte_names,
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
compile_svelte(
|
|
name = "svelte",
|
|
srcs = svelte_files,
|
|
deps = [
|
|
"//ts/sass:button_mixins_lib",
|
|
"//ts/sass/bootstrap",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
compile_sass(
|
|
srcs = [
|
|
"bootstrap.scss",
|
|
"legacy.scss",
|
|
],
|
|
group = "local_css",
|
|
deps = [
|
|
"//ts/sass:button_mixins_lib",
|
|
"//ts/sass/bootstrap",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
ts_library(
|
|
name = "editor-toolbar",
|
|
module_name = "editor-toolbar",
|
|
srcs = glob(
|
|
["*.ts"],
|
|
exclude = ["*.test.ts"],
|
|
),
|
|
tsconfig = "//ts:tsconfig.json",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//ts/lib",
|
|
"//ts/lib:backend_proto",
|
|
"//ts/sveltelib",
|
|
"@npm//@popperjs/core",
|
|
"@npm//@types/bootstrap",
|
|
"@npm//bootstrap",
|
|
"@npm//svelte",
|
|
],
|
|
)
|
|
|
|
# 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",
|
|
]) + [
|
|
"//ts/sass:button_mixins_lib",
|
|
"//ts/sass/bootstrap",
|
|
"@npm//@types/bootstrap",
|
|
],
|
|
)
|