|
11 | 11 | // node scripts/docs-audit/affected-docs.mjs --bridge-coverage [--json] # how much of the DECLARED client-bound route surface the `sdk` bridge can reach (diff-free) |
12 | 12 | // |
13 | 13 | // Scope: hand-written docs only = content/docs/**/*.mdx MINUS content/docs/references/** |
14 | | -// (references are generated from packages/spec and handled by a separate regenerate pass). |
| 14 | +// and content/docs/ui/components/** (references are generated from packages/spec and |
| 15 | +// handled by a separate regenerate pass; the component reference is generated from |
| 16 | +// sdui.manifest.json by scripts/gen-sdui-reference.mjs, whose --check holds it). |
15 | 17 | // |
16 | 18 | // THE ABOVE SCOPE IS THE RECALL DENOMINATOR (#13306, maintainer ruling 2026-08-31). Any |
17 | 19 | // recall figure for this tool — "of the docs pages that should have been listed, how many |
|
198 | 200 |
|
199 | 201 | import { execSync } from 'node:child_process'; |
200 | 202 | import { readFileSync, readdirSync, existsSync, statSync } from 'node:fs'; |
201 | | -import { join, relative } from 'node:path'; |
| 203 | +import { join, relative, sep } from 'node:path'; |
202 | 204 | // The one answer to "is this span a comment, or code?" (#9367). Dependency-free and |
203 | 205 | // side-effect-free on import, so the no-install contract this script runs under holds. |
204 | 206 | // `codeOnly` IS the tree's one comments+literals projection (#15776), imported |
@@ -1074,9 +1076,11 @@ function walk(dir, out = []) { |
1074 | 1076 | return out; |
1075 | 1077 | } |
1076 | 1078 | const docsRoot = join(repoRoot, 'content/docs'); |
1077 | | -const refsRoot = join(repoRoot, 'content/docs/references'); |
| 1079 | +// The generated trees, each wholly written by its generator: `references/` by |
| 1080 | +// packages/spec's build-docs.ts, `ui/components/` by scripts/gen-sdui-reference.mjs. |
| 1081 | +const generatedRoots = ['content/docs/references', 'content/docs/ui/components'].map((r) => join(repoRoot, r) + sep); |
1078 | 1082 | const handwritten = walk(docsRoot) |
1079 | | - .filter((p) => !p.startsWith(refsRoot)) |
| 1083 | + .filter((p) => !generatedRoots.some((root) => p.startsWith(root))) |
1080 | 1084 | .map((p) => relative(repoRoot, p)) |
1081 | 1085 | .sort(); |
1082 | 1086 |
|
|
0 commit comments