From 9e469b6c63a71d929d4bce6580a99e4abe4869d7 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 10:14:06 +0000 Subject: [PATCH 1/6] perf(docs): send the browser a trimmed page tree, serve the footer neighbours from the server Claude-Session: https://claude.ai/code/session_01L9qibzZRa3nLMmeQvLoDWE Co-authored-by: Claude --- .../docs/app/[lang]/docs/[[...slug]]/page.tsx | 10 +- apps/docs/app/[lang]/docs/layout.tsx | 5 +- apps/docs/lib/client-page-tree.ts | 129 ++++++++++++++++++ 3 files changed, 142 insertions(+), 2 deletions(-) create mode 100644 apps/docs/lib/client-page-tree.ts diff --git a/apps/docs/app/[lang]/docs/[[...slug]]/page.tsx b/apps/docs/app/[lang]/docs/[[...slug]]/page.tsx index c3443d03953..5ee605a5508 100644 --- a/apps/docs/app/[lang]/docs/[[...slug]]/page.tsx +++ b/apps/docs/app/[lang]/docs/[[...slug]]/page.tsx @@ -10,6 +10,7 @@ import { File, Folder, Files } from 'fumadocs-ui/components/files'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; import { LLMCopyButton, ViewOptions } from '@/components/ai/page-actions'; import { gitConfig } from '@/lib/layout.shared'; +import { footerNeighbours } from '@/lib/client-page-tree'; import { absoluteUrl } from '@/lib/site'; import { breadcrumbList, @@ -166,7 +167,14 @@ export default async function Page(props: { const MDX = page.data.body; return ( - + {page.data.title} {page.data.description} diff --git a/apps/docs/app/[lang]/docs/layout.tsx b/apps/docs/app/[lang]/docs/layout.tsx index 1a15cb1ce87..58012b899a7 100644 --- a/apps/docs/app/[lang]/docs/layout.tsx +++ b/apps/docs/app/[lang]/docs/layout.tsx @@ -2,6 +2,7 @@ import { source } from '@/lib/source'; import { DocsLayout } from 'fumadocs-ui/layouts/docs'; import type { ReactNode } from 'react'; import { baseOptions } from '@/lib/layout.shared'; +import { toClientPageTree } from '@/lib/client-page-tree'; export default async function Layout({ params, @@ -14,7 +15,9 @@ export default async function Layout({ return ( {children} diff --git a/apps/docs/lib/client-page-tree.ts b/apps/docs/lib/client-page-tree.ts new file mode 100644 index 00000000000..0d446d51cd1 --- /dev/null +++ b/apps/docs/lib/client-page-tree.ts @@ -0,0 +1,129 @@ +import type { Item, Node, Root } from 'fumadocs-core/page-tree'; + +/** + * The docs page tree as the BROWSER receives it. + * + * `DocsLayout` is a client component, so the `tree` prop is serialised into the + * RSC payload of every docs page -- once inline in the prerendered HTML, once in + * the `.rsc` file -- and the whole site's tree (500+ nodes) rides on each of the + * 500+ pages. Measured on the offline `vercel build` output before this file + * existed: ~175 KB of tree per page, ~168 MiB of a ~743 MiB deploy. + * + * Most of those bytes are fields no client component reads: + * + * - `$ref` -- the loader's link back to the source file; server-side only. + * - a page's `description` -- the sidebar never shows it. Its one client reader + * is the previous / next footer (`fumadocs-ui` `layouts/docs/page/slots/footer`), + * which looks the neighbours up in this tree and prints their description. + * `footerNeighbours()` below hands the footer those two items from the server + * instead, so the footer text is unchanged and the tree no longer carries 500 + * descriptions for it. Folder descriptions stay: the sidebar's root-folder tabs + * read them. + * - keys whose value is `undefined` (`icon` on almost every page): React still + * serialises the key with an `$undefined` marker. + * + * Everything else -- `$id` (the client's tree identity and React keys), names, + * urls, `external`, folder state, icons that are set -- passes through untouched, + * and unknown keys pass through too, so a field a later fumadocs release starts + * reading is not silently dropped here. + */ +export function toClientPageTree(tree: Root): Root { + const cached = clientTrees.get(tree); + if (cached) return cached; + const trimmed = trimNode(tree) as Root; + clientTrees.set(tree, trimmed); + return trimmed; +} + +const clientTrees = new WeakMap(); + +function trimNode(value: unknown): unknown { + if (Array.isArray(value)) return value.map((entry) => trimNode(entry)); + if (value === null || typeof value !== 'object') return value; + // A React element (a resolved icon) is not tree data: hand it through as is. + if ('$$typeof' in value) return value; + + const node = value as Record; + const page = node.type === 'page'; + const out: Record = {}; + for (const [key, entry] of Object.entries(node)) { + if (entry === undefined) continue; + if (key === '$ref') continue; + if (key === 'description' && page) continue; + out[key] = trimNode(entry); + } + return out; +} + +/** What the footer reads off a neighbour: nothing else is sent. */ +export interface FooterItem { + name: Item['name']; + url: string; + description?: Item['description']; +} + +/** + * The previous / next pages for `url`, computed exactly the way the client + * footer would compute them from the full tree (`fumadocs-ui` + * `utils/use-footer-items`): every folder's index page, then its children, depth + * first, external links skipped, over the root the page sits under. + * + * The docs declare no root folders (`"root": true` in a `meta.json`), so that + * root is the tree itself. If one is ever added, the client footer would scope + * to it and this function would not: `rootFolderGuard()` makes that a build + * failure instead of a footer that quietly disagrees with the sidebar. + */ +export function footerNeighbours( + tree: Root, + url: string, +): { previous?: FooterItem; next?: FooterItem } { + rootFolderGuard(tree); + const list = footerList(tree); + const index = list.findIndex((item) => item.url === url); + if (index === -1) return {}; + return { previous: toFooterItem(list[index - 1]), next: toFooterItem(list[index + 1]) }; +} + +const footerLists = new WeakMap(); + +function footerList(tree: Root): Item[] { + const cached = footerLists.get(tree); + if (cached) return cached; + const list: Item[] = []; + const visit = (node: Node) => { + if (node.type === 'folder') { + if (node.index) visit(node.index); + for (const child of node.children) visit(child); + } else if (node.type === 'page' && !node.external) { + list.push(node); + } + }; + for (const child of tree.children) visit(child); + footerLists.set(tree, list); + return list; +} + +function toFooterItem(item: Item | undefined): FooterItem | undefined { + if (!item) return undefined; + const out: FooterItem = { name: item.name, url: item.url }; + if (item.description !== undefined) out.description = item.description; + return out; +} + +function rootFolderGuard(tree: Root): void { + const visit = (nodes: Node[]) => { + for (const node of nodes) { + if (node.type !== 'folder') continue; + if (node.root) { + throw new Error( + `docs page tree: folder "${String(node.name)}" is a root folder. The footer neighbours in ` + + 'apps/docs/lib/client-page-tree.ts walk the whole tree, while the client footer scopes ' + + 'to the root folder a page sits under; teach footerNeighbours() that scoping before ' + + 'adding a root folder.', + ); + } + visit(node.children); + } + }; + visit(tree.children); +} From 342aa1d43756828c255a68092295bacbfa0603a9 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 10:19:01 +0000 Subject: [PATCH 2/6] chore(docs): a script that measures what a docs deployment uploads, by part Claude-Session: https://claude.ai/code/session_01L9qibzZRa3nLMmeQvLoDWE Co-authored-by: Claude --- apps/docs/scripts/measure-deploy-output.mjs | 164 ++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 apps/docs/scripts/measure-deploy-output.mjs diff --git a/apps/docs/scripts/measure-deploy-output.mjs b/apps/docs/scripts/measure-deploy-output.mjs new file mode 100644 index 00000000000..2ade54e92d4 --- /dev/null +++ b/apps/docs/scripts/measure-deploy-output.mjs @@ -0,0 +1,164 @@ +#!/usr/bin/env node +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +/** + * Prints what a docs deployment uploads, by part: the Build Output API tree + * `vercel build` writes (`.vercel/output`) PLUS the files its functions pull in + * from the repository. + * + * node apps/docs/scripts/measure-deploy-output.mjs # from the repo root + * node apps/docs/scripts/measure-deploy-output.mjs --root + * node apps/docs/scripts/measure-deploy-output.mjs --json + * + * Read-only, offline, no credentials: run it after any `vercel build` (the + * Docs Deploy workflow's, or a local one). + * + * ## Why the output directory alone is the wrong number + * + * A function directory under `.vercel/output/functions/` holds little more than + * its `.vc-config.json`. The code it runs -- the route's chunks under + * `apps/docs/.next/server` and the traced `node_modules` -- is listed in that + * file's `filePathMap` and uploaded from the repository by `vercel deploy + * --prebuilt`. `du .vercel/output` therefore misses the function code entirely. + * The two halves together reproduce the CLI's own file count (its "Downloading N + * deployment files" line): every output entry, symbolic links included, plus + * every distinct `filePathMap` file. + * + * ## Why sizes are by content + * + * The upload is content-addressed: a file is sent once per distinct SHA-1, + * however many paths carry it (a symlinked function, a segment file identical + * to its page's `.rsc`, a layout segment every page shares). Bytes are summed + * over distinct contents, each counted in the first part that holds it, so the + * parts add up to the total. + */ + +import { createHash } from 'node:crypto'; +import { existsSync, lstatSync, readdirSync, readFileSync, statSync } from 'node:fs'; +import { join, relative, resolve, sep } from 'node:path'; + +const args = process.argv.slice(2); +const json = args.includes('--json'); +const rootIndex = args.indexOf('--root'); +const root = resolve(rootIndex === -1 ? process.cwd() : args[rootIndex + 1]); +const output = join(root, '.vercel', 'output'); + +if (!existsSync(join(output, 'config.json'))) { + console.error( + `measure-deploy-output: no Build Output API tree at ${output} (no config.json). ` + + 'Run `vercel build` from the repository root first, or pass --root .', + ); + process.exit(2); +} + +/** The part a path in `.vercel/output` belongs to, in a reader's words. */ +function outputPart(rel) { + const p = rel.split(sep).join('/'); + if (p.startsWith('static/')) { + return p === 'static/llms-full.txt' ? 'static: llms-full.txt' : 'static: assets and public/'; + } + if (p.startsWith('functions/og/')) return 'OG images (prerendered)'; + if (p.startsWith('functions/llms.mdx/')) return 'llms.mdx bodies (prerendered)'; + if (/^functions\/en(\/|\.)/.test(p)) { + if (p.includes('.segments/')) return 'pages: RSC segment files'; + if (p.endsWith('.html')) return 'pages: HTML (prerendered)'; + if (p.endsWith('.rsc')) return 'pages: full RSC (prerendered)'; + return 'pages: prerender configs'; + } + if (p.endsWith('.vc-config.json')) return 'function configs'; + return 'other output'; +} + +const parts = new Map(); +const seen = new Set(); +let entries = 0; +let links = 0; + +function add(part, file) { + const body = readFileSync(file); + const sha = createHash('sha1').update(body).digest('hex'); + if (seen.has(sha)) return; + seen.add(sha); + const row = parts.get(part) ?? { bytes: 0, files: 0 }; + row.bytes += body.length; + row.files += 1; + parts.set(part, row); +} + +const funcs = []; +function walk(dir) { + for (const name of readdirSync(dir)) { + const path = join(dir, name); + const stat = lstatSync(path); + if (stat.isSymbolicLink()) { + entries += 1; + links += 1; + continue; + } + if (stat.isDirectory()) { + if (name.endsWith('.func')) funcs.push(path); + walk(path); + continue; + } + entries += 1; + add(outputPart(relative(output, path)), path); + } +} +walk(output); + +const traced = new Set(); +const listed = new Set(); +const functions = []; +for (const func of funcs) { + const config = JSON.parse(readFileSync(join(func, '.vc-config.json'), 'utf8')); + const map = config.filePathMap ?? {}; + let bytes = 0; + for (const from of Object.values(map)) { + // Counted as the CLI counts it: one deployment file per distinct map entry, + // whatever is on disk at that path. + listed.add(from); + const path = join(root, from); + if (!existsSync(path) || !statSync(path).isFile()) continue; + bytes += statSync(path).size; + traced.add(from); + } + functions.push({ function: relative(join(output, 'functions'), func), files: Object.keys(map).length, bytes }); +} +for (const from of [...traced].sort()) { + add(from.startsWith('apps/docs/.next/') ? 'function code: apps/docs/.next' : 'function code: node_modules', join(root, from)); +} + +const rows = [...parts.entries()] + .map(([part, row]) => ({ part, ...row })) + .sort((a, b) => b.bytes - a.bytes); +const totalBytes = rows.reduce((sum, row) => sum + row.bytes, 0); +const totalFiles = rows.reduce((sum, row) => sum + row.files, 0); +const deploymentFiles = entries + listed.size; + +if (json) { + console.log( + JSON.stringify( + { root, deploymentFiles, outputEntries: entries, outputLinks: links, tracedEntries: listed.size, tracedFiles: traced.size, uniqueFiles: totalFiles, uniqueBytes: totalBytes, parts: rows, functions }, + null, + 2, + ), + ); +} else { + const mib = (bytes) => (bytes / 2 ** 20).toFixed(1).padStart(8); + console.log(`Docs deploy output at ${output}`); + console.log( + `Deployment files: ${deploymentFiles} (${entries} output entries, ${links} of them symbolic links, + ${listed.size} traced repository entries)`, + ); + console.log(`Distinct contents: ${totalFiles} files, ${(totalBytes / 2 ** 20).toFixed(1)} MiB`); + console.log(''); + console.log(' MiB share files part'); + for (const row of rows) { + const share = ((100 * row.bytes) / totalBytes).toFixed(1).padStart(5); + console.log(`${mib(row.bytes)} ${share}% ${String(row.files).padStart(7)} ${row.part}`); + } + console.log(''); + console.log('Functions (filePathMap, before de-duplication):'); + for (const f of functions.sort((a, b) => b.bytes - a.bytes)) { + console.log(`${mib(f.bytes)} MiB ${String(f.files).padStart(6)} files ${f.function}`); + } +} From 86099d6389ee4c182f3e88b3d5133cf56c892f63 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 10:19:42 +0000 Subject: [PATCH 3/6] perf(docs): docs, blog, OG and llms.mdx routes serve only their prerendered params Claude-Session: https://claude.ai/code/session_01L9qibzZRa3nLMmeQvLoDWE Co-authored-by: Claude --- apps/docs/app/[lang]/blog/[[...slug]]/page.tsx | 7 +++++++ apps/docs/app/[lang]/docs/[[...slug]]/page.tsx | 12 ++++++++++++ apps/docs/app/llms.mdx/docs/[[...slug]]/route.ts | 7 +++++++ apps/docs/app/og/docs/[...slug]/route.tsx | 7 +++++++ 4 files changed, 33 insertions(+) diff --git a/apps/docs/app/[lang]/blog/[[...slug]]/page.tsx b/apps/docs/app/[lang]/blog/[[...slug]]/page.tsx index 6cebe119f61..5344e2ff6b6 100644 --- a/apps/docs/app/[lang]/blog/[[...slug]]/page.tsx +++ b/apps/docs/app/[lang]/blog/[[...slug]]/page.tsx @@ -245,6 +245,13 @@ export default async function BlogPage({ ); } +/** + * Only the prerendered posts (and the blog index) exist; an unknown slug is a static 404 instead of + * a call into an on-demand fallback function uploaded with every deploy. The + * reasoning is spelled out once, in `app/[lang]/docs/[[...slug]]/page.tsx`. + */ +export const dynamicParams = false; + export async function generateStaticParams() { return blog.getPages().map((page) => ({ slug: page.slugs, diff --git a/apps/docs/app/[lang]/docs/[[...slug]]/page.tsx b/apps/docs/app/[lang]/docs/[[...slug]]/page.tsx index 5ee605a5508..140223db037 100644 --- a/apps/docs/app/[lang]/docs/[[...slug]]/page.tsx +++ b/apps/docs/app/[lang]/docs/[[...slug]]/page.tsx @@ -204,6 +204,18 @@ export default async function Page(props: { ); } +/** + * Every docs page is prerendered from `generateStaticParams()` and nothing else + * exists: a slug the loader does not know answers 404 either way. With the + * default (`dynamicParams = true`) Vercel stores each page as a prerender WITH a + * fallback function, and that function -- the route's whole server bundle -- is + * uploaded on every deploy so that an unknown slug can be rendered into the same + * 404 on demand. `false` makes the 404 static too, so the pages are plain files + * and no function backs them; `scripts/measure-deploy-output.mjs` takes the + * reading. + */ +export const dynamicParams = false; + export async function generateStaticParams() { return source.generateParams(); } diff --git a/apps/docs/app/llms.mdx/docs/[[...slug]]/route.ts b/apps/docs/app/llms.mdx/docs/[[...slug]]/route.ts index fe641f68ede..bb198d618ea 100644 --- a/apps/docs/app/llms.mdx/docs/[[...slug]]/route.ts +++ b/apps/docs/app/llms.mdx/docs/[[...slug]]/route.ts @@ -18,6 +18,13 @@ export async function GET( }); } +/** + * Only the prerendered markdown bodies, one per docs page, exist; an unknown slug is a static 404 instead of + * a call into an on-demand fallback function uploaded with every deploy. The + * reasoning is spelled out once, in `app/[lang]/docs/[[...slug]]/page.tsx`. + */ +export const dynamicParams = false; + export function generateStaticParams() { return source.generateParams(); } diff --git a/apps/docs/app/og/docs/[...slug]/route.tsx b/apps/docs/app/og/docs/[...slug]/route.tsx index 5efbc353e38..abcd47c392f 100644 --- a/apps/docs/app/og/docs/[...slug]/route.tsx +++ b/apps/docs/app/og/docs/[...slug]/route.tsx @@ -26,6 +26,13 @@ export async function GET( ); } +/** + * Only the prerendered cards, one per docs page, exist; an unknown slug is a static 404 instead of + * a call into an on-demand fallback function uploaded with every deploy. The + * reasoning is spelled out once, in `app/[lang]/docs/[[...slug]]/page.tsx`. + */ +export const dynamicParams = false; + export function generateStaticParams() { return source.getPages().map((page) => ({ slug: getPageImage(page).segments, From b60d067d142b8c22312e3c69ad5aff03b09bd5f4 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 10:24:02 +0000 Subject: [PATCH 4/6] Revert "perf(docs): docs, blog, OG and llms.mdx routes serve only their prerendered params" Measured on the offline vercel build: dynamicParams = false leaves every prerender backed by a function (Vercel's Next builder emits a fallback function for each Prerender regardless), so it bought 6 output entries and 0 MiB. Not worth a behaviour change on unknown slugs. Claude-Session: https://claude.ai/code/session_01L9qibzZRa3nLMmeQvLoDWE Co-authored-by: Claude --- apps/docs/app/[lang]/blog/[[...slug]]/page.tsx | 7 ------- apps/docs/app/[lang]/docs/[[...slug]]/page.tsx | 12 ------------ apps/docs/app/llms.mdx/docs/[[...slug]]/route.ts | 7 ------- apps/docs/app/og/docs/[...slug]/route.tsx | 7 ------- 4 files changed, 33 deletions(-) diff --git a/apps/docs/app/[lang]/blog/[[...slug]]/page.tsx b/apps/docs/app/[lang]/blog/[[...slug]]/page.tsx index 5344e2ff6b6..6cebe119f61 100644 --- a/apps/docs/app/[lang]/blog/[[...slug]]/page.tsx +++ b/apps/docs/app/[lang]/blog/[[...slug]]/page.tsx @@ -245,13 +245,6 @@ export default async function BlogPage({ ); } -/** - * Only the prerendered posts (and the blog index) exist; an unknown slug is a static 404 instead of - * a call into an on-demand fallback function uploaded with every deploy. The - * reasoning is spelled out once, in `app/[lang]/docs/[[...slug]]/page.tsx`. - */ -export const dynamicParams = false; - export async function generateStaticParams() { return blog.getPages().map((page) => ({ slug: page.slugs, diff --git a/apps/docs/app/[lang]/docs/[[...slug]]/page.tsx b/apps/docs/app/[lang]/docs/[[...slug]]/page.tsx index 140223db037..5ee605a5508 100644 --- a/apps/docs/app/[lang]/docs/[[...slug]]/page.tsx +++ b/apps/docs/app/[lang]/docs/[[...slug]]/page.tsx @@ -204,18 +204,6 @@ export default async function Page(props: { ); } -/** - * Every docs page is prerendered from `generateStaticParams()` and nothing else - * exists: a slug the loader does not know answers 404 either way. With the - * default (`dynamicParams = true`) Vercel stores each page as a prerender WITH a - * fallback function, and that function -- the route's whole server bundle -- is - * uploaded on every deploy so that an unknown slug can be rendered into the same - * 404 on demand. `false` makes the 404 static too, so the pages are plain files - * and no function backs them; `scripts/measure-deploy-output.mjs` takes the - * reading. - */ -export const dynamicParams = false; - export async function generateStaticParams() { return source.generateParams(); } diff --git a/apps/docs/app/llms.mdx/docs/[[...slug]]/route.ts b/apps/docs/app/llms.mdx/docs/[[...slug]]/route.ts index bb198d618ea..fe641f68ede 100644 --- a/apps/docs/app/llms.mdx/docs/[[...slug]]/route.ts +++ b/apps/docs/app/llms.mdx/docs/[[...slug]]/route.ts @@ -18,13 +18,6 @@ export async function GET( }); } -/** - * Only the prerendered markdown bodies, one per docs page, exist; an unknown slug is a static 404 instead of - * a call into an on-demand fallback function uploaded with every deploy. The - * reasoning is spelled out once, in `app/[lang]/docs/[[...slug]]/page.tsx`. - */ -export const dynamicParams = false; - export function generateStaticParams() { return source.generateParams(); } diff --git a/apps/docs/app/og/docs/[...slug]/route.tsx b/apps/docs/app/og/docs/[...slug]/route.tsx index abcd47c392f..5efbc353e38 100644 --- a/apps/docs/app/og/docs/[...slug]/route.tsx +++ b/apps/docs/app/og/docs/[...slug]/route.tsx @@ -26,13 +26,6 @@ export async function GET( ); } -/** - * Only the prerendered cards, one per docs page, exist; an unknown slug is a static 404 instead of - * a call into an on-demand fallback function uploaded with every deploy. The - * reasoning is spelled out once, in `app/[lang]/docs/[[...slug]]/page.tsx`. - */ -export const dynamicParams = false; - export function generateStaticParams() { return source.getPages().map((page) => ({ slug: getPageImage(page).segments, From 9d66e038b18f55e148f2b5eef07acf8d75645530 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 11:17:08 +0000 Subject: [PATCH 5/6] ci(docs-deploy): print what each deploy uploads, by part, before the upload Claude-Session: https://claude.ai/code/session_01L9qibzZRa3nLMmeQvLoDWE Co-authored-by: Claude --- .github/workflows/docs-deploy.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml index e56cb1993b6..b96386b3e66 100644 --- a/.github/workflows/docs-deploy.yml +++ b/.github/workflows/docs-deploy.yml @@ -188,6 +188,36 @@ jobs: fi echo "Built docs app: BUILD_ID=$(cat apps/docs/.next/BUILD_ID)" + # A reading, not a gate: what this deploy is about to upload, by part + # (prerendered pages, function code, OG images, llms bodies, static + # files), in this log and in the run summary. It runs BEFORE the upload + # so the reading exists for exactly the runs that need it most, the ones + # whose upload aborts. `.vercel/output` alone undercounts: the function + # code rides in each function's `filePathMap` from the repository, which + # the script adds; its header says how the file count reproduces the + # CLI's own "Downloading N deployment files" line. + # + # `continue-on-error` on purpose, and the only step here that has it: a + # broken measurement must never stop the docs from publishing (the header's + # failure direction is about the PUBLISH going quietly stale; this step + # publishes nothing). A failure still shows as a warning annotation. + - name: Measure what this deploy uploads + continue-on-error: true + run: | + set -euo pipefail + if ! node apps/docs/scripts/measure-deploy-output.mjs > "$RUNNER_TEMP/deploy-output-reading.txt"; then + echo "::warning::measure-deploy-output.mjs failed; the deploy goes ahead without a size reading." + exit 1 + fi + cat "$RUNNER_TEMP/deploy-output-reading.txt" + { + echo "### Docs deploy output" + echo + echo '```text' + cat "$RUNNER_TEMP/deploy-output-reading.txt" + echo '```' + } >> "$GITHUB_STEP_SUMMARY" + - name: Deploy the prebuilt output to production id: deploy env: From cd1513fc0a4028a58482e2be07cd2b5539128d4c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Nov 2026 12:11:08 +0000 Subject: [PATCH 6/6] ci(docs-deploy): give the measuring step a 5-minute timeout continue-on-error does not absorb a hang: without a step timeout only the job's 30-minute clock would end it, and the deploy would not run. Claude-Session: https://claude.ai/code/session_01L9qibzZRa3nLMmeQvLoDWE Co-authored-by: Claude --- .github/workflows/docs-deploy.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml index b96386b3e66..d850b0373ca 100644 --- a/.github/workflows/docs-deploy.yml +++ b/.github/workflows/docs-deploy.yml @@ -201,8 +201,12 @@ jobs: # broken measurement must never stop the docs from publishing (the header's # failure direction is about the PUBLISH going quietly stale; this step # publishes nothing). A failure still shows as a warning annotation. + # `timeout-minutes` because `continue-on-error` does not absorb a hang: + # without it only the job's clock would end the step, with no deploy. The + # script is synchronous local reads (seconds); 5 minutes is the ceiling. - name: Measure what this deploy uploads continue-on-error: true + timeout-minutes: 5 run: | set -euo pipefail if ! node apps/docs/scripts/measure-deploy-output.mjs > "$RUNNER_TEMP/deploy-output-reading.txt"; then