fix(site): make docs build resilient to remote badge fetch failures (#2695)#2718
Merged
Merged
Conversation
…2695) `Build Docs` (@object-ui/site#build) runs fumadocs' remark-image plugin, which fetches every remote image at build time to inline its width/height. For remote badges (shields.io / skills.sh) this turns an external service's availability into a hard build dependency: a shields.io hiccup (Cloudflare 520 / 1200 "Too many requests") throws and fails the entire docs build, unrelated to the PR under test (observed on #2684). Configure remark-image via source.config.ts: - external: { timeout: 10_000 } — bound each remote fetch so a hung connection can't stall CI. - onError — warn (don't fail the build) when a remote image can't be sized, while re-throwing for local/authored images so broken in-repo paths stay fatal. The only live remote badge triggering a build-time fetch is the skills.sh badge in content/docs/guide/agent-skills.md; the shields.io references live inside code fences and are never fetched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
os-zhuang
added a commit
that referenced
this pull request
Jul 20, 2026
…2721) `useViewTabLabel()` (ViewTabBar) and `useViewLabel()` (ManageViewsDialog) returned the raw `t()` result, typed `string | object` by i18next. Their return values are rendered directly as React children and passed as aria-labels at ~35 sites, so vite build's dts pass emitted TS2322 (`string | object` not assignable to ReactNode). plugin-view has no type-check gate, so these did not fail the build — but if `t()` ever resolves a key to an object, React throws and white-screens. Coerce the resolved value with `String(v)` and annotate the helper's return type as `string`. Same "i18n/expression value is string|object, rendered raw → white-screen" class tracked separately from PR #2718. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2695
问题
Build Docs(@object-ui/site#build)用 fumadocs 的remark-image插件在构建期拉取每一张远程图片以取得尺寸(getImageSize)。远程徽章(shields.io / skills.sh)因此把一个外部服务的可用性变成了构建的硬依赖——shields.io 一抖(Cloudflare 520 / 1200 "Too many requests")就抛错并让整个 docs 构建失败,与 PR 内容无关(见 #2684)。根因定位
content/docs里唯一活跃触发构建期拉取的远程徽章是content/docs/guide/agent-skills.md:12的 skills.sh 徽章。shields.io引用都在代码围栏内(plugins/plugin-markdown.mdx),不会被remark-image处理。dashboard-filters.md→/img/*.png)在 Next.js bundler 流程里走import解析,不经过网络。方案(issue 选项 1)
在
apps/site/source.config.ts给remark-image配置容错:external: { timeout: 10_000 }—— 给每次远程拉取加超时,避免挂死的连接卡住 CI;onError—— 远程图片取尺寸失败时告警而非 fail 构建;对本地/仓内图片仍然throw(保持严格,坏路径照样卡构建)。只加安全网,不改成功路径:远程可达时行为不变,徽章照常内联尺寸。
验收对照
Build Docs不再整体失败;agent-skills.md:12)。验证
直接用改后的真实
source.config.ts驱动fumadocs-core的remarkImage跑失败 URL:pnpm exec fumadocs-mdx编译配置通过(接受remarkImageOptions)。🤖 Generated with Claude Code