anki/ts/deck-options/BUILD.bazel
Damien Elmes 046c6c55d3 use extra rootDir in tsconfig instead of symlinks
The nice thing about the symlink approach is that it allowed tsc -b
to function without any changes to the tsconfig.json file, but it meant
there were extra links we had to maintain. So instead, we just add an
extra rootDirs entry, and add two commented-out lines that can be
uncommented when wanting to build with tsc directly.
2021-10-01 18:36:52 +10:00

93 lines
1.9 KiB
Python

load("//ts:prettier.bzl", "prettier_test")
load("//ts:eslint.bzl", "eslint_test")
load("//ts/svelte:svelte.bzl", "compile_svelte", "svelte", "svelte_check")
load("//ts:esbuild.bzl", "esbuild")
load("//ts:vendor.bzl", "copy_bootstrap_icons")
load("//ts:compile_sass.bzl", "compile_sass")
load("//ts:jest.bzl", "jest_test")
load("//ts:typescript.bzl", "typescript")
compile_sass(
srcs = ["deck-options-base.scss"],
group = "base_css",
visibility = ["//visibility:public"],
deps = [
"//ts/sass:base_lib",
"//ts/sass:scrollbar_lib",
"//ts/sass/bootstrap",
],
)
compile_svelte()
typescript(
name = "index",
deps = [
":svelte",
"//ts/components",
"//ts/lib",
"//ts/sveltelib",
"@npm//@fluent",
"@npm//@popperjs",
"@npm//@types/jest",
"@npm//bootstrap-icons",
"@npm//lodash-es",
"@npm//svelte",
],
)
esbuild(
name = "deck-options",
args = {
"globalName": "anki",
"loader": {".svg": "text"},
},
entry_point = "index.ts",
output_css = "deck-options.css",
visibility = ["//visibility:public"],
deps = [
"index",
":base_css",
":svelte",
"//ts/components",
"//ts/lib",
"//ts/sveltelib",
"@npm//bootstrap",
"@npm//marked",
"@npm//protobufjs",
],
)
exports_files(["deck-options.html"])
# Tests
################
prettier_test()
eslint_test()
svelte_check(
name = "svelte_check",
srcs = glob([
"*.ts",
"*.svelte",
]) + [
"//ts/sass:button_mixins_lib",
"//ts/sass:night_mode_lib",
"//ts/sass/bootstrap",
"@npm//@types/bootstrap",
"@npm//@types/lodash-es",
"@npm//@types/marked",
"//ts/components",
"//ts/sveltelib:sveltelib_pkg",
],
)
jest_test(
protobuf = True,
deps = [
":index",
],
)