Files
SkyZeroZx 748faa4f95 docs(docs-infra): Add build-time validation for API and guide links using route manifest
Adds build-time validation to catch broken, stale, or miscased internal documentation links in both JSDoc and markdown, including `/api/` and `/guide/` URLs and their fragments. Updates the documentation pipeline to share the canonical route manifest, ensuring that all references are checked against the current navigation structure.

(cherry picked from commit c1829f6d7c)
2026-07-08 10:24:51 -07:00

62 lines
1.8 KiB
Python

load("@aspect_rules_ts//ts:defs.bzl", "ts_project")
load("//adev/shared-docs:defaults.bzl", "js_binary", "js_run_binary")
package(default_visibility = ["//adev:__subpackages__"])
ts_project(
name = "generate_routes_lib",
srcs = [
"generate-routes.mts",
],
data = [
"//adev/src/assets:docs_api_manifest",
"//adev/src/content/tutorials/deferrable-views",
"//adev/src/content/tutorials/first-app",
"//adev/src/content/tutorials/learn-angular",
"//adev/src/content/tutorials/signal-forms",
"//adev/src/content/tutorials/signals",
],
tsconfig = {
"compilerOptions": {
"target": "ES2022",
"module": "nodenext",
"moduleResolution": "nodenext",
"types": ["node"],
"rootDir": ".",
"skipLibCheck": True,
},
},
deps = [
"//adev:node_modules/@angular/docs",
"//adev:node_modules/@types/node",
"//adev/shared-docs/pipeline/shared:heading",
"//adev/src/app/routing/navigation-entries",
"//adev/src/content/reference/errors:route-nav-items",
"//adev/src/content/reference/extended-diagnostics:route-nav-items",
],
)
js_binary(
name = "generate_route",
data = [
"generate-routes.mjs",
":generate_routes_lib",
"//adev/src/content:guide_files",
],
entry_point = ":generate-routes.mjs",
)
js_run_binary(
name = "run_generate_route",
outs = ["defined-routes.json"],
chdir = package_name(),
tool = ":generate_route",
# Public so the api-gen rendering pipeline (used from //packages/...) can validate guide
# links against the same set of routes defined for the live site.
visibility = [
"//adev:__subpackages__",
"//packages:__subpackages__",
"//tools:__subpackages__",
],
)