anki/ts/editor/BUILD.bazel

107 lines
2.4 KiB
Python
Raw Normal View History

2021-01-31 14:15:03 +01:00
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("//ts:prettier.bzl", "prettier_test")
load("//ts:eslint.bzl", "eslint_test")
load("//ts:esbuild.bzl", "esbuild")
2021-03-28 18:47:06 +02:00
load("//ts:vendor.bzl", "copy_bootstrap_icons")
load("//ts:compile_sass.bzl", "compile_sass")
2021-01-31 19:03:40 +01:00
compile_sass(
srcs = [
"editable.scss",
],
group = "editable_scss",
visibility = ["//visibility:public"],
deps = [
"//ts/sass:scrollbar_lib",
],
)
compile_sass(
srcs = [
"fields.scss",
],
group = "base_css",
visibility = ["//visibility:public"],
deps = [
"//ts/sass:base_lib",
"//ts/sass:buttons_lib",
"//ts/sass:scrollbar_lib",
],
2021-01-31 19:03:40 +01:00
)
2021-01-31 14:15:03 +01:00
ts_library(
name = "editor_ts",
srcs = glob(["*.ts"]),
tsconfig = "//ts:tsconfig.json",
2021-01-31 14:15:03 +01:00
deps = [
"//ts:image_module_support",
"//ts/html-filter",
"//ts/editor-toolbar",
2021-01-31 14:15:03 +01:00
],
)
2021-03-28 18:47:06 +02:00
copy_bootstrap_icons(
name = "bootstrap-icons",
2021-03-28 18:47:06 +02:00
icons = ["pin-angle.svg"],
)
esbuild(
2021-01-31 14:15:03 +01:00
name = "editor",
srcs = [
"//ts:protobuf-shim.js",
],
args = [
"--loader:.svg=text",
"--inject:$(location //ts:protobuf-shim.js)",
2021-04-07 06:53:53 +02:00
"--resolve-extensions=.mjs,.js",
"--log-level=warning",
],
output_css = "editor.css",
external = [
"protobufjs/light",
],
entry_point = "index_wrapper.ts",
2021-01-31 14:15:03 +01:00
visibility = ["//visibility:public"],
deps = [
"base_css",
"bootstrap-icons",
"editor_ts",
"//ts/editor-toolbar:local_css",
"//ts/editor-toolbar:bootstrap-icons",
"//ts/editor-toolbar:mdi-icons",
"//ts/editor-toolbar:ButtonDropdown",
"//ts/editor-toolbar:ButtonGroup",
"//ts/editor-toolbar:IconButton",
"//ts/editor-toolbar:LabelButton",
"//ts/editor-toolbar:SelectButton",
"//ts/editor-toolbar:SelectOption",
"//ts/editor-toolbar:RawButton",
"//ts/editor-toolbar:EditorToolbar",
"//ts/editor-toolbar:CommandIconButton",
"//ts/editor-toolbar:WithDropdownMenu",
"//ts/editor-toolbar:DropdownItem",
"//ts/editor-toolbar:DropdownMenu",
"//ts/editor-toolbar:SquareButton",
"//ts/editor-toolbar:ColorPicker",
2021-01-31 14:15:03 +01:00
],
)
# Tests
################
prettier_test(
name = "format_check",
srcs = glob([
"*.ts",
]),
)
2021-01-31 20:55:36 +01:00
# eslint_test(
# name = "eslint",
# srcs = glob(
# [
# "*.ts",
# ],
# ),
# )