5b1fcccf33
* First attempt at adding a directory for icons under //ts * Fix image import * Fix import order * Add cloze button group * Fix issue with toolbar.toolbar dynamically slottable * Change tooltip for repeating cloze deletion * Fix repeat cloze button not working on macOS (dae)
109 lines
2.2 KiB
Python
109 lines
2.2 KiB
Python
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")
|
|
load("//ts:typescript.bzl", "typescript")
|
|
|
|
compile_sass(
|
|
srcs = [
|
|
"editor-base.scss",
|
|
"legacy.scss",
|
|
],
|
|
group = "editor_css",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//sass:base_lib",
|
|
"//sass:button_mixins_lib",
|
|
"//sass:scrollbar_lib",
|
|
],
|
|
)
|
|
|
|
_ts_deps = [
|
|
"//ts/components",
|
|
"//ts/editable:editable_ts",
|
|
"//ts/html-filter",
|
|
"//ts/lib",
|
|
"//ts/domlib",
|
|
"//ts/sveltelib",
|
|
"@npm//@fluent",
|
|
"@npm//@types/codemirror",
|
|
"@npm//codemirror",
|
|
"@npm//svelte",
|
|
]
|
|
|
|
compile_svelte(deps = _ts_deps)
|
|
|
|
typescript(
|
|
name = "editor",
|
|
deps = _ts_deps + [
|
|
":svelte",
|
|
],
|
|
)
|
|
|
|
_esbuild_deps = [
|
|
":editor",
|
|
":editor_css",
|
|
"//sass:button_mixins_lib",
|
|
"@npm//@mdi",
|
|
"@npm//bootstrap-icons",
|
|
"//ts/icons",
|
|
"@npm//protobufjs",
|
|
]
|
|
|
|
esbuild(
|
|
name = "browser_editor",
|
|
args = {
|
|
"loader": {".svg": "text"},
|
|
},
|
|
entry_point = "index_browser.ts",
|
|
output_css = "browser_editor.css",
|
|
visibility = ["//visibility:public"],
|
|
deps = _esbuild_deps,
|
|
)
|
|
|
|
esbuild(
|
|
name = "reviewer_editor",
|
|
args = {
|
|
"loader": {".svg": "text"},
|
|
},
|
|
entry_point = "index_reviewer.ts",
|
|
output_css = "reviewer_editor.css",
|
|
visibility = ["//visibility:public"],
|
|
deps = _esbuild_deps,
|
|
)
|
|
|
|
esbuild(
|
|
name = "note_creator",
|
|
args = {
|
|
"loader": {".svg": "text"},
|
|
},
|
|
entry_point = "index_creator.ts",
|
|
output_css = "note_creator.css",
|
|
visibility = ["//visibility:public"],
|
|
deps = _esbuild_deps,
|
|
)
|
|
|
|
# Tests
|
|
################
|
|
|
|
prettier_test()
|
|
|
|
eslint_test()
|
|
|
|
svelte_check(
|
|
name = "svelte_check",
|
|
srcs = glob([
|
|
"**/*.ts",
|
|
"**/*.svelte",
|
|
]) + [
|
|
"//sass:button_mixins_lib",
|
|
"//sass/bootstrap",
|
|
"//ts/components",
|
|
"//ts/editable:editable_ts",
|
|
"@npm//@types/bootstrap",
|
|
"@npm//@types/codemirror",
|
|
"@npm//codemirror",
|
|
],
|
|
)
|