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")
|
2021-03-20 05:02:19 +01:00
|
|
|
load("//ts:esbuild.bzl", "esbuild")
|
2021-03-28 18:47:06 +02:00
|
|
|
load("//ts:vendor.bzl", "copy_bootstrap_icons")
|
2021-04-13 18:17:32 +02:00
|
|
|
load("//ts:compile_sass.bzl", "compile_sass")
|
2021-01-31 19:03:40 +01:00
|
|
|
|
2021-04-13 18:17:32 +02:00
|
|
|
compile_sass(
|
2021-04-12 06:18:30 +02:00
|
|
|
srcs = [
|
|
|
|
"editable.scss",
|
2021-04-19 23:51:09 +02:00
|
|
|
],
|
|
|
|
group = "editable_scss",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
"//ts/sass:scrollbar_lib",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
compile_sass(
|
|
|
|
srcs = [
|
|
|
|
"fields.scss",
|
2021-04-12 06:18:30 +02:00
|
|
|
],
|
2021-04-13 18:17:32 +02:00
|
|
|
group = "base_css",
|
2021-04-12 06:18:30 +02:00
|
|
|
visibility = ["//visibility:public"],
|
2021-04-13 18:17:32 +02:00
|
|
|
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"]),
|
2021-03-26 04:58:03 +01:00
|
|
|
tsconfig = "//ts:tsconfig.json",
|
2021-01-31 14:15:03 +01:00
|
|
|
deps = [
|
2021-03-28 10:17:07 +02:00
|
|
|
"//ts:image_module_support",
|
2021-03-25 00:43:01 +01:00
|
|
|
"//ts/html-filter",
|
2021-04-19 23:51:09 +02:00
|
|
|
"//ts/editor-toolbar",
|
2021-01-31 14:15:03 +01:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2021-03-28 18:47:06 +02:00
|
|
|
copy_bootstrap_icons(
|
2021-03-26 04:18:16 +01:00
|
|
|
name = "bootstrap-icons",
|
2021-03-28 18:47:06 +02:00
|
|
|
icons = ["pin-angle.svg"],
|
2021-03-26 04:18:16 +01:00
|
|
|
)
|
|
|
|
|
2021-03-20 05:02:19 +01:00
|
|
|
esbuild(
|
2021-01-31 14:15:03 +01:00
|
|
|
name = "editor",
|
2021-04-19 23:51:09 +02:00
|
|
|
srcs = [
|
|
|
|
"//ts:protobuf-shim.js",
|
|
|
|
],
|
2021-03-29 09:59:06 +02:00
|
|
|
args = [
|
|
|
|
"--loader:.svg=text",
|
2021-04-19 23:51:09 +02:00
|
|
|
"--inject:$(location //ts:protobuf-shim.js)",
|
2021-04-07 06:53:53 +02:00
|
|
|
"--resolve-extensions=.mjs,.js",
|
|
|
|
"--log-level=warning",
|
2021-03-29 09:59:06 +02:00
|
|
|
],
|
2021-04-19 23:51:09 +02:00
|
|
|
output_css = "editor.css",
|
|
|
|
external = [
|
|
|
|
"protobufjs/light",
|
|
|
|
],
|
2021-03-20 05:02:19 +01:00
|
|
|
entry_point = "index_wrapper.ts",
|
2021-01-31 14:15:03 +01:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
2021-04-12 06:18:30 +02:00
|
|
|
"base_css",
|
2021-04-19 23:51:09 +02:00
|
|
|
"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",
|
|
|
|
# ],
|
|
|
|
# ),
|
|
|
|
# )
|