2020-11-01 05:26:58 +01:00
|
|
|
load("@npm//@bazel/typescript:index.bzl", "ts_library")
|
2021-01-30 17:54:07 +01:00
|
|
|
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
|
2020-11-01 05:26:58 +01:00
|
|
|
load("//ts:prettier.bzl", "prettier_test")
|
2021-01-30 17:54:07 +01:00
|
|
|
load("//ts:eslint.bzl", "eslint_test")
|
2020-11-01 05:26:58 +01:00
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "pycmd",
|
|
|
|
srcs = ["pycmd.d.ts"],
|
2021-01-30 17:54:07 +01:00
|
|
|
visibility = ["//qt/aqt/data/web/js:__subpackages__"],
|
2020-11-01 05:26:58 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "aqt",
|
|
|
|
srcs = glob(
|
|
|
|
["*.ts"],
|
|
|
|
exclude = ["*.d.ts"],
|
|
|
|
),
|
|
|
|
tsconfig = "tsconfig.json",
|
|
|
|
deps = [
|
|
|
|
"pycmd",
|
|
|
|
"@npm//@types/jquery",
|
|
|
|
"@npm//@types/jqueryui",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "aqt_es5",
|
|
|
|
srcs = ["aqt"],
|
|
|
|
output_group = "es5_sources",
|
|
|
|
)
|
|
|
|
|
2021-01-30 17:54:07 +01:00
|
|
|
###### aqt bundles
|
|
|
|
|
|
|
|
rollup_bundle(
|
|
|
|
name = "editor",
|
|
|
|
config_file = "rollup.config.js",
|
|
|
|
entry_point = "//qt/aqt/data/web/js/editor:index.ts",
|
|
|
|
format = "iife",
|
|
|
|
link_workspace_root = True,
|
|
|
|
silent = True,
|
|
|
|
sourcemap = "false",
|
|
|
|
deps = [
|
|
|
|
"//qt/aqt/data/web/js/editor",
|
|
|
|
"@npm//@rollup/plugin-commonjs",
|
|
|
|
"@npm//@rollup/plugin-node-resolve",
|
|
|
|
"@npm//rollup-plugin-terser",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2020-11-01 05:26:58 +01:00
|
|
|
filegroup(
|
|
|
|
name = "js",
|
|
|
|
srcs = [
|
|
|
|
"aqt_es5",
|
2021-01-30 17:54:07 +01:00
|
|
|
"editor",
|
2020-11-15 11:22:28 +01:00
|
|
|
"mathjax.js",
|
|
|
|
"//qt/aqt/data/web/js/vendor",
|
2020-11-01 05:26:58 +01:00
|
|
|
],
|
|
|
|
visibility = ["//qt:__subpackages__"],
|
|
|
|
)
|
|
|
|
|
|
|
|
prettier_test(
|
2020-11-12 11:11:40 +01:00
|
|
|
name = "format_check",
|
2020-12-21 07:09:23 +01:00
|
|
|
srcs = glob(["*.ts", "*.js"]),
|
2020-11-01 05:26:58 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# source files need fixing first
|
|
|
|
# eslint_test(
|
|
|
|
# name = "eslint",
|
|
|
|
# srcs = glob(["*.ts"]),
|
|
|
|
# )
|
2020-11-30 06:15:37 +01:00
|
|
|
|
2021-01-30 17:54:07 +01:00
|
|
|
exports_files([
|
|
|
|
"mathjax.js",
|
|
|
|
"tsconfig.json",
|
|
|
|
])
|