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") load("//ts:vendor.bzl", "copy_bootstrap_icons") load("//ts:compile_sass.bzl", "compile_sass") 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", ], ) ts_library( name = "editor_ts", srcs = glob(["*.ts"]), tsconfig = "//ts:tsconfig.json", deps = [ "//ts:image_module_support", "//ts/html-filter", "//ts/editor-toolbar", ], ) copy_bootstrap_icons( name = "bootstrap-icons", icons = ["pin-angle.svg"], ) esbuild( name = "editor", srcs = [ "//ts:protobuf-shim.js", ], args = [ "--loader:.svg=text", "--inject:$(location //ts:protobuf-shim.js)", "--resolve-extensions=.mjs,.js", "--log-level=warning", ], output_css = "editor.css", external = [ "protobufjs/light", ], entry_point = "index_wrapper.ts", 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", ], ) # Tests ################ prettier_test( name = "format_check", srcs = glob([ "*.ts", ]), ) # eslint_test( # name = "eslint", # srcs = glob( # [ # "*.ts", # ], # ), # )