2025-07-14 14:45:06 +00:00
|
|
|
load("//adev/shared-docs:defaults.bzl", "esbuild", "js_binary", "ts_project")
|
2024-08-02 16:42:23 +00:00
|
|
|
|
|
|
|
|
package(default_visibility = ["//adev/shared-docs/pipeline/api-gen:__subpackages__"])
|
|
|
|
|
|
2025-07-02 21:25:43 +00:00
|
|
|
esbuild(
|
2024-08-02 16:42:23 +00:00
|
|
|
name = "bin",
|
2025-05-06 20:59:30 +00:00
|
|
|
entry_point = ":index.mts",
|
2025-09-01 21:21:21 +00:00
|
|
|
external = [
|
|
|
|
|
"jsdom",
|
|
|
|
|
"playwright-core",
|
2026-01-15 22:41:41 +00:00
|
|
|
"typescript",
|
2025-09-01 21:21:21 +00:00
|
|
|
],
|
2025-07-02 21:25:43 +00:00
|
|
|
format = "esm",
|
2024-08-02 16:42:23 +00:00
|
|
|
output = "bin.mjs",
|
|
|
|
|
platform = "node",
|
|
|
|
|
target = "es2022",
|
|
|
|
|
deps = [
|
2025-07-30 17:43:25 +00:00
|
|
|
":render_api_to_html_lib",
|
2024-08-02 16:42:23 +00:00
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
2025-05-06 20:59:30 +00:00
|
|
|
ts_project(
|
2024-08-02 16:42:23 +00:00
|
|
|
name = "render_api_to_html_lib",
|
|
|
|
|
srcs = glob(
|
|
|
|
|
[
|
2025-05-06 20:59:30 +00:00
|
|
|
"**/*.mts",
|
2024-08-02 16:42:23 +00:00
|
|
|
"**/*.tsx",
|
|
|
|
|
],
|
|
|
|
|
exclude = [
|
2025-05-06 20:59:30 +00:00
|
|
|
"entities.mts",
|
2024-08-02 16:42:23 +00:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
deps = [
|
2025-07-30 17:43:25 +00:00
|
|
|
":entities",
|
2025-08-25 16:46:42 +00:00
|
|
|
"//adev:node_modules/marked",
|
2025-07-02 21:25:43 +00:00
|
|
|
"//adev:node_modules/preact",
|
|
|
|
|
"//adev:node_modules/preact-render-to-string",
|
|
|
|
|
"//adev:node_modules/prettier",
|
2025-08-25 16:46:42 +00:00
|
|
|
"//adev:node_modules/shiki",
|
|
|
|
|
"//adev/shared-docs/pipeline/shared:linking",
|
2025-08-25 01:59:16 +00:00
|
|
|
"//adev/shared-docs/pipeline/shared:shiki",
|
|
|
|
|
"//adev/shared-docs/pipeline/shared/marked",
|
|
|
|
|
"//adev/shared-docs/pipeline/shared/regions",
|
2024-08-02 16:42:23 +00:00
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
2025-05-06 20:59:30 +00:00
|
|
|
ts_project(
|
2024-08-02 16:42:23 +00:00
|
|
|
name = "entities",
|
|
|
|
|
srcs = [
|
2025-05-06 20:59:30 +00:00
|
|
|
"entities.mts",
|
2024-08-02 16:42:23 +00:00
|
|
|
],
|
|
|
|
|
visibility = [
|
|
|
|
|
"//adev/shared-docs/pipeline/api-gen/rendering:__pkg__",
|
|
|
|
|
"//docs/pipeline/guides:__pkg__",
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Action binary for the api_gen bazel rule.
|
2025-07-02 19:57:26 +00:00
|
|
|
js_binary(
|
2024-08-02 16:42:23 +00:00
|
|
|
name = "render_api_to_html",
|
|
|
|
|
data = [
|
|
|
|
|
":render_api_to_html_lib",
|
|
|
|
|
],
|
|
|
|
|
entry_point = "bin.mjs",
|
|
|
|
|
# Do not use the NodeJS linker because:
|
|
|
|
|
# - it's brittle and causes race conditions on Windows.
|
|
|
|
|
# - it requires additional work to setup the runtime linker.
|
2025-07-02 19:57:26 +00:00
|
|
|
fixed_args = [
|
2024-08-02 16:42:23 +00:00
|
|
|
"--node_options=--preserve-symlinks-main",
|
|
|
|
|
],
|
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Expose the sources in the dev-infra NPM package.
|
|
|
|
|
filegroup(
|
|
|
|
|
name = "files",
|
|
|
|
|
srcs = glob(["**/*"]),
|
|
|
|
|
)
|