anki/qt/aqt/data/web/js/BUILD.bazel
Henrik Giesel 3beea5e1e4
Split/Merge editor.py for its three use cases (#1581)
* Forbid inserting object and iframe tags via PlainTextInput

* Add optional browserMode parameter to Editor

* Create new ts modules for three editor instances

- note-creator for AddCards
- browser-editor for the editor in the Browser
- reviewer-editor for the EditCurrent

* Revert "Forbid inserting object and iframe tags via PlainTextInput"

This reverts commit ab90ae8194494d883a1863126496e2d8f332509e.

* Refactor browserMode to editorMode

* Move new editor variants inside /ts/editor directory

* Fix typo
2022-01-12 14:51:43 +10:00

74 lines
1.3 KiB
Python

load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//ts:typescript.bzl", "typescript")
load("//ts:copy.bzl", "copy_files_into_group")
load("//ts:prettier.bzl", "prettier_test")
load("//ts:eslint.bzl", "eslint_test")
js_library(
name = "pycmd",
srcs = ["pycmd.d.ts"],
visibility = ["//qt/aqt/data/web/js:__subpackages__"],
)
typescript(
name = "aqt",
srcs = glob(
["*.ts"],
exclude = ["*.d.ts"],
),
deps = [
"pycmd",
"@npm//@types/jquery",
"@npm//@types/jqueryui",
],
)
copy_files_into_group(
name = "editor",
srcs = [
"browser_editor.js",
"reviewer_editor.js",
"note_creator.js",
],
package = "//ts/editor",
)
copy_files_into_group(
name = "reviewer",
srcs = [
"reviewer.js",
],
package = "//ts/reviewer",
)
filegroup(
name = "js",
srcs = [
"aqt",
"mathjax.js",
"reviewer",
"editor",
"//qt/aqt/data/web/js/vendor",
],
visibility = ["//qt:__subpackages__"],
)
prettier_test(
name = "format_check",
srcs = glob([
"*.ts",
"*.js",
]),
)
# source files need fixing first
eslint_test(
name = "eslint",
srcs = glob(["*.ts"]),
)
exports_files([
"mathjax.js",
"tsconfig.json",
])