blob: 47217f622a4504b98002228c16e6068989fb2125 [file] [log] [blame]
load(
"//infra-sk:index.bzl",
"copy_file_from_npm_pkg",
"karma_test",
"sk_demo_page_server",
"sk_element",
"sk_element_puppeteer_test",
"sk_page",
"ts_library",
)
sk_demo_page_server(
name = "demo_page_server",
sk_page = ":debugger-app-sk-demo",
static_assets = {
"/dist": [
"//shaders/wasm_libs:version.js",
],
},
)
# Under rules_js (https://github.com/aspect-build/rules_js), we cannot refer to files inside NPM
# packages directly. Instead, we must create local copies of those files. See the
# copy_file_from_npm_pkg macro documentation for details.
copy_file_from_npm_pkg(
name = "codemirror_codemirror_css",
src = "lib/codemirror.css",
out = "codemirror_codemirror.css",
npm_package_name = "codemirror",
)
copy_file_from_npm_pkg(
name = "codemirror5_ambiance_css",
src = "theme/ambiance.css",
out = "codemirror_ambiance.css",
npm_package_name = "codemirror",
)
copy_file_from_npm_pkg(
name = "codemirror_base16-light_css",
src = "theme/base16-light.css",
out = "codemirror_base16-light.css",
npm_package_name = "codemirror",
)
sk_element(
name = "debugger-app-sk",
sass_deps = [
"//shaders/modules/themes:themes_sass_lib",
],
sass_srcs = [
"debugger-app-sk.scss",
"codemirror_codemirror.css", # keep
"codemirror_ambiance.css", # keep
"codemirror_base16-light.css", # keep
],
sk_element_deps = [
"//infra-sk/modules/theme-chooser-sk",
"//infra-sk/modules/app-sk",
],
ts_deps = [
"//infra-sk/modules/ElementSk:index_ts_lib",
"//shaders/modules/debug-trace-player:debug-trace-player_ts_lib",
"//shaders/modules/debug-trace:debug-trace_ts_lib",
"//shaders/modules/sksl-constants:sksl-constants_ts_lib",
"//elements-sk/modules:define_ts_lib",
"//infra-sk/modules:dom_ts_lib",
"//:node_modules/@types/codemirror",
"//:node_modules/codemirror",
"//:node_modules/lit-html",
],
ts_srcs = [
"index.ts",
"debugger-app-sk.ts",
],
visibility = ["//visibility:public"],
)
sk_page(
name = "debugger-app-sk-demo",
html_file = "debugger-app-sk-demo.html",
scss_entry_point = "debugger-app-sk-demo.scss",
sk_element_deps = [":debugger-app-sk"],
ts_entry_point = "debugger-app-sk-demo.ts",
)
sk_element_puppeteer_test(
name = "debugger-app-sk_puppeteer_test",
src = "debugger-app-sk_puppeteer_test.ts",
sk_demo_page_server = ":demo_page_server",
deps = [
":demo_data_ts_lib",
"//:node_modules/@types/chai",
"//:node_modules/chai",
"//puppeteer-tests:util_ts_lib",
],
)
karma_test(
name = "debugger-app-sk_test",
src = "debugger-app-sk_test.ts",
karma_config_file = "//shaders:karma_config",
static_karma_files = [
"//shaders/wasm_libs:canvaskit.js",
"//shaders/wasm_libs:canvaskit.wasm",
"//shaders/wasm_libs:version.js",
],
deps = [
":debugger-app-sk",
":demo_data_ts_lib",
"//:node_modules/@types/chai",
"//:node_modules/@types/codemirror",
"//:node_modules/chai",
"//:node_modules/codemirror",
"//infra-sk/modules:dom_ts_lib",
"//infra-sk/modules:test_util_ts_lib",
],
)
ts_library(
name = "demo_data_ts_lib",
srcs = ["demo_data.ts"],
visibility = ["//visibility:public"],
deps = ["//shaders/modules/debug-trace/generate:debug-trace-quicktype_ts_lib"],
)