mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Move ts_project and ng_project into a macro for adev/ instead of providing a custom tsconfig on every target PR Close #61319
75 lines
1.9 KiB
Text
75 lines
1.9 KiB
Text
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
|
|
load("@npm//@angular/build-tooling/bazel/esbuild:index.bzl", "esbuild_esm_bundle")
|
|
load("//adev/shared-docs:defaults.bzl", "ts_project")
|
|
|
|
package(default_visibility = ["//adev/shared-docs/pipeline/api-gen:__subpackages__"])
|
|
|
|
esbuild_esm_bundle(
|
|
name = "bin",
|
|
entry_point = ":index.mts",
|
|
output = "bin.mjs",
|
|
platform = "node",
|
|
target = "es2022",
|
|
deps = [
|
|
":render_api_to_html_lib",
|
|
],
|
|
)
|
|
|
|
ts_project(
|
|
name = "render_api_to_html_lib",
|
|
srcs = glob(
|
|
[
|
|
"**/*.mts",
|
|
"**/*.tsx",
|
|
"shiki.d.ts",
|
|
],
|
|
exclude = [
|
|
"entities.mts",
|
|
],
|
|
),
|
|
deps = [
|
|
":entities_rjs",
|
|
"//:node_modules/@bazel/runfiles",
|
|
"//:node_modules/@types/node",
|
|
"//:node_modules/html-entities",
|
|
"//:node_modules/marked",
|
|
"//:node_modules/preact",
|
|
"//:node_modules/preact-render-to-string",
|
|
"//:node_modules/prettier",
|
|
"//:node_modules/shiki",
|
|
],
|
|
)
|
|
|
|
ts_project(
|
|
name = "entities",
|
|
srcs = [
|
|
"entities.mts",
|
|
],
|
|
visibility = [
|
|
"//adev/shared-docs/pipeline/api-gen/rendering:__pkg__",
|
|
"//docs/pipeline/guides:__pkg__",
|
|
],
|
|
)
|
|
|
|
# Action binary for the api_gen bazel rule.
|
|
nodejs_binary(
|
|
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.
|
|
templated_args = [
|
|
"--bazel_patch_module_resolver",
|
|
"--node_options=--preserve-symlinks-main",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
# Expose the sources in the dev-infra NPM package.
|
|
filegroup(
|
|
name = "files",
|
|
srcs = glob(["**/*"]),
|
|
)
|