add reviewer_extras.js back

This commit is contained in:
Damien Elmes 2021-07-27 15:13:39 +10:00
parent a6fbb1227a
commit f3b8022a4c
2 changed files with 33 additions and 2 deletions

View file

@ -14,10 +14,13 @@ compile_sass(
deps = [],
)
ts_library(
name = "reviewer_ts",
srcs = glob(["*.ts"]),
srcs = glob(
["*.ts"],
exclude = ["reviewer_extras.ts"],
),
module_name = "reviewer",
deps = [
"//ts/lib",
"//ts/lib:backend_proto",
@ -42,6 +45,25 @@ esbuild(
],
)
esbuild(
name = "reviewer_extras",
srcs = [
"reviewer_extras.ts",
],
args = [
"--resolve-extensions=.mjs,.js",
"--log-level=warning",
],
entry_point = "reviewer_extras.ts",
visibility = ["//visibility:public"],
deps = [
":reviewer_ts",
"//ts/lib",
"//ts/lib:backend_proto",
"@npm//protobufjs",
],
)
# Tests
################

View file

@ -0,0 +1,9 @@
// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
// A standalone bundle that adds mutateNextCardStates to the anki namespace.
// When all clients are using reviewer.js directly, we can get rid of this.
import { mutateNextCardStates } from "reviewer/answering";
globalThis.anki.mutateNextCardStates = mutateNextCardStates;