Skip to content

chore: standardize repository setup#510

Merged
afc163 merged 37 commits into
masterfrom
codex/standardize-rc-config
Jun 29, 2026
Merged

chore: standardize repository setup#510
afc163 merged 37 commits into
masterfrom
codex/standardize-rc-config

Conversation

@afc163

@afc163 afc163 commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

Standardize this rc-component repository as part of the Ant Design rc-component maintenance sweep.

Tracking issue: ant-design/ant-design#58514

Scope

  • Redesign README.md and README.zh-CN.md with centered title, Ant Design ecosystem branding, aligned badges, scoped Bundlephobia badge, install command, Usage, Development, Release, and License sections.
  • Standardize package metadata, GitHub repo metadata, npm package name, package entry fields, types: "./es/index.d.ts", publishConfig, and release flow through @rc-component/np.
  • Align shared dependencies and scripts for React, testing-library, Jest/Vitest where existing, TypeScript, ESLint, Prettier, Less, dumi, father, Husky, lint-staged, and Dependabot.
  • Use the shared react-component/rc-test/.github/workflows/test-utoo.yml@main workflow, React Doctor, Codecov, CodeQL, updated GitHub Actions versions, and guarded Surge preview fallback.
  • Keep Vercel preview configuration compatible with docs-dist output and remove legacy now-build / Cloudflare Pages residue.
  • Keep API docs, demos, tests, TypeScript checks, funding metadata, and npm package files aligned with the repository standardization matrix.

Notes

  • No breaking runtime behavior is intended.
  • React peer dependency ranges are preserved when narrowing them would be a breaking change.
  • secrets: inherit is kept until react-component/rc-test#176 is merged, then it can be narrowed to explicit CODECOV_TOKEN forwarding.

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
image Error Error Jun 29, 2026 6:27am

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@afc163, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable usage-based reviews in Billing to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information, and refer to the rate limits docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: edbb1551-acc8-47b1-8033-140cd1ba0394

📥 Commits

Reviewing files that changed from the base of the PR and between fa53789 and edb6363.

📒 Files selected for processing (8)
  • .fatherrc.ts
  • .github/workflows/react-component-ci.yml
  • .github/workflows/surge-preview.yml
  • .husky/pre-commit
  • README.md
  • README.zh-CN.md
  • package.json
  • tsconfig.json

Walkthrough

README 改写为 @rc-component/image 的文档结构,构建/部署输出切到 docs-dist,补全资金与许可证文件,并新增或切换了测试、诊断和预览工作流。

Changes

仓库文档与发布配置

Layer / File(s) Summary
README 头部与入门
README.md
品牌展示、Highlights、Install、Usage、Preview Group 和 Examples 入口被重写。
README API 与类型
README.md
ImagePreviewConfigImage.PreviewGroup 的 API 表以及 TransformTypeActionsToolbarRenderInfoType 类型说明被更新。
README 收尾
README.md
Development、Release 和 License 部分替换为新的内容。
构建与部署配置
.dumirc.ts, package.json, tsconfig.json, vercel.json, now.json, .gitignore, .prettierignore
脚本、TypeScript include、文档输出目录和部署配置被同步调整。
资金与许可证
.github/FUNDING.yml, LICENSE
资金配置仅保留 GitHub Sponsors 与 Open Collective,LICENSE 补全为完整 MIT 文本。

工作流自动化

Layer / File(s) Summary
复用测试工作流引用
.github/workflows/react-component-ci.yml
jobs.test 的可复用工作流引用切换为 test-utoo.yml@main,并保留 secrets: inherit
React Doctor 工作流
.github/workflows/react-doctor.yml
新增 master push 和 PR 事件触发、权限、并发控制,以及 checkout 和 millionco/react-doctor 作业步骤。
Surge Preview 工作流
.github/workflows/surge-preview.yml
新增 pull_request 触发、SURGE_TOKEN 检查、构建发布步骤和无 token 跳过步骤。

Sequence Diagram(s)

React Doctor 工作流

sequenceDiagram
  participant GitHubActions
  participant actions/checkout
  participant millionco/react-doctor

  GitHubActions->>actions/checkout: checkout with fetch-depth: 0
  actions/checkout-->>GitHubActions: repository history
  GitHubActions->>millionco/react-doctor: run checks
  millionco/react-doctor-->>GitHubActions: results
Loading

Surge Preview 工作流

sequenceDiagram
  participant GitHubActions
  participant Shell
  participant actions/checkout
  participant afc163/surge-preview

  GitHubActions->>Shell: check SURGE_TOKEN
  Shell-->>GitHubActions: enabled true/false
  alt enabled=true
    GitHubActions->>actions/checkout: checkout repository
    actions/checkout-->>GitHubActions: files
    GitHubActions->>afc163/surge-preview: build and publish docs-dist
    afc163/surge-preview-->>GitHubActions: preview status
  else enabled=false
    GitHubActions->>GitHubActions: skip preview log
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

可能相关的 PRs

  • react-component/image#369: 也修改了 .github/workflows/react-component-ci.yml 中的可复用工作流引用,和本次 CI 变更直接相关。

Poem

我是小兔,蹦进仓库边,
README 换上新门面。
预览、诊断一起跑,
docs-dist 里灯火亮闪闪。
啦哩啵,发布与检查都安稳上线! 🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 标题准确概括了此次以仓库配置、工作流和文档标准化为主的变更。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/standardize-rc-config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

✅ Preview is ready!

PR preview ✅ Ready ✅ Ready
🔗 Preview https://react-component-image-preview-pr-510.surge.sh
📝 Commitedb6363
⏱️ Build time21.954s
📦 Size17.9 MB (no change) · 79 files
🪵 LogsView logs
📱 MobileScan to open preview on mobile

↩️ Previous: ⚡️ edb6363 · react-component-image-preview-pr-510.surge.sh (open ↗) · 2026-06-29 06:29:35 UTC

🤖 Powered by surge-preview

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the repository configuration, package name references to @rc-component/image, and the README documentation. It also introduces a new vercel.json configuration and updates scripts in package.json. Feedback on these changes highlights two issues: the outputDirectory in vercel.json should be corrected to docs-dist to prevent deployment failures, and the TransformAction type definition should be restored in the README as it is still referenced in the API tables.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread vercel.json Outdated
Comment thread README.md
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.44%. Comparing base (0169e59) to head (edb6363).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #510   +/-   ##
=======================================
  Coverage   99.44%   99.44%           
=======================================
  Files          17       17           
  Lines         541      541           
  Branches      165      164    -1     
=======================================
  Hits          538      538           
  Misses          3        3           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🧹 Nitpick comments (2)
README.md (1)

104-104: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

imageRender 参数名与源码不一致

README 写为 (node, info),而 src/Image.tsx 中实际参数名为 originalNode。参数名不一致会增加开发者对照源码时的认知成本。

建议将 node 改为 originalNode 以匹配源码。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 104, The README entry for imageRender uses a parameter
name that does not match the implementation in Image; update the documented
signature so the first argument name matches the source symbol originalNode
instead of node. Keep the rest of the type unchanged and make sure the
description aligns with the actual callback shape used by Image.tsx.
.github/workflows/react-doctor.yml (1)

9-14: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

建议按事件收紧权限范围。

这里的工作流级写权限会同时作用于 pull_requestpush。但 pushmaster 并没有对应的 PR/Issue 上下文,pull-requests: writeissues: write 在这个事件里是多余的,扩大了 GITHUB_TOKEN 的权限面。更稳妥的做法是把权限下沉到 job,或拆成 PR / push 两套权限配置。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/react-doctor.yml around lines 9 - 14, The workflow-level
permissions are too broad for all events in react-doctor.yml, since
pull-requests: write and issues: write also apply on push runs where they are
unnecessary. Restrict the permissions by event, either by moving them into the
relevant job(s) or by splitting the workflow into separate pull_request and push
permission sets, and keep only the minimum required scope for the job that uses
the GitHub API.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/cloudflare-pages-preview.yml:
- Around line 3-12: 当前 Cloudflare Pages 预览工作流缺少并发控制,导致同一 PR 的多次运行可能互相覆盖。请在
preview 工作流中为 jobs.preview 添加 concurrency 配置,并开启 cancel-in-progress,以
github.head_ref 作为分组键,确保同一 PR 只保留最新一次运行并自动取消旧运行。

In @.github/workflows/react-component-ci.yml:
- Around line 5-6: The reusable workflow reference in the workflow job is too
permissive because it points to a moving branch and inherits all secrets. Update
the job that uses react-component/rc-test/.github/workflows/test-utoo.yml to pin
the workflow to an immutable commit SHA instead of `@main`, and replace secrets:
inherit with an explicit minimal secrets mapping only if the called workflow
actually needs secrets; otherwise remove secrets entirely.

In @.github/workflows/surge-preview.yml:
- Around line 3-14: The Surge preview workflow is missing PR-scoped concurrency
control, so multiple runs for the same pull request can overlap and leave stale
previews/statuses. Add a top-level concurrency block to the workflow in the same
YAML that defines the pull_request trigger and preview job, using a group keyed
by github.workflow and github.event.pull_request.number, and enable
cancel-in-progress so only the latest run for each PR continues.

In `@README.md`:
- Around line 115-124: The Image.PreviewGroup API table is missing several props
exposed by PreviewGroupProps, so update the README entry for Image.PreviewGroup
to include classNames, styles, and children. Add brief descriptions and types
for classNames and styles using the semantic popup shape from PreviewGroupProps,
and document children as React.ReactNode so the public API matches the component
implementation.
- Line 120: The README entry for the custom preview operation icons type does
not match the actual source type, so update the documentation reference in the
preview group section to use the symbol from PreviewGroup.tsx, namely
PreviewProps['icons'], unless OperationIcons is a real public alias that is
exported elsewhere. Make sure the table describes the same type name that
developers can find in the codebase.
- Line 99: README 中的 actionsRender 类型仍引用了已移除的 ToolbarRenderInfoType,导致 info
参数结构不明确。请在文档里为 ToolbarRenderInfoType 补充明确的定义,或直接把 ToolbarRenderInfoType 的字段内联展开到
actionsRender 这一行,确保读者能从 ToolbarRenderInfoType / actionsRender 处直接看到 info
的完整类型结构。
- Line 99: The README entry for actionsRender uses the wrong info type and does
not match the source signature. Update the documentation to reflect the actual
type used in Image.tsx for actionsRender, where the info parameter is
Omit<ToolbarRenderInfoType, 'current' | 'total'> rather than the full
ToolbarRenderInfoType, so the docs accurately describe that current and total
are not included.
- Around line 95-114: The PreviewConfig API table in the README is missing the
cover property exposed by the PreviewConfig type in Image.tsx. Update the
documentation table to include cover with its type (React.ReactNode |
CoverConfig) and a brief description, keeping it consistent with the existing
PreviewConfig entries and the source interface.
- Line 112: The README entry for onOpenChange does not match the actual API
contract in PreviewConfig and Image; update the documented callback signature to
reflect the source definition with a single boolean parameter, and keep the docs
aligned with the implementation so consumers see the correct contract.

---

Nitpick comments:
In @.github/workflows/react-doctor.yml:
- Around line 9-14: The workflow-level permissions are too broad for all events
in react-doctor.yml, since pull-requests: write and issues: write also apply on
push runs where they are unnecessary. Restrict the permissions by event, either
by moving them into the relevant job(s) or by splitting the workflow into
separate pull_request and push permission sets, and keep only the minimum
required scope for the job that uses the GitHub API.

In `@README.md`:
- Line 104: The README entry for imageRender uses a parameter name that does not
match the implementation in Image; update the documented signature so the first
argument name matches the source symbol originalNode instead of node. Keep the
rest of the type unchanged and make sure the description aligns with the actual
callback shape used by Image.tsx.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bff64328-9fd9-49c1-a66b-a4d8a6d63156

📥 Commits

Reviewing files that changed from the base of the PR and between 0169e59 and 1244874.

📒 Files selected for processing (9)
  • .github/FUNDING.yml
  • .github/workflows/cloudflare-pages-preview.yml
  • .github/workflows/react-component-ci.yml
  • .github/workflows/react-doctor.yml
  • .github/workflows/surge-preview.yml
  • README.md
  • now.json
  • package.json
  • vercel.json
💤 Files with no reviewable changes (1)
  • now.json

Comment thread .github/workflows/cloudflare-pages-preview.yml Outdated
Comment thread .github/workflows/react-component-ci.yml Outdated
Comment thread .github/workflows/surge-preview.yml
Comment thread README.md
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md
Comment thread README.md Outdated
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/afc163s-projects?upgradeToPro=build-rate-limit

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/react-component?upgradeToPro=build-rate-limit

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
.github/workflows/surge-preview.yml (1)

38-42: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

在工作流里固定 Node 版本
当前仓库没有 .nvmrc.node-versionpackage.json#engines 作为版本来源;这里直接依赖 ubuntu-latest 自带的 Node,runner 升级后构建结果可能漂移。建议在 Build preview 前加 actions/setup-node 并显式锁定版本。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/surge-preview.yml around lines 38 - 42, The Build preview
step in the surge preview workflow relies on the runner’s default Node version,
which can drift over time. Add an explicit actions/setup-node step before Build
preview and pin a specific Node version there, using the workflow’s existing
build job context so npm install and npm run build execute against the locked
runtime.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.zh-CN.md`:
- Line 123: The `children` parameter description has a mistranslation in the
Chinese README: the label shown in the table is a literal error and should be
corrected to the proper React meaning. Update the `children` entry in the README
documentation to use “子元素” or “子节点” instead of the current incorrect wording,
keeping the rest of the table format unchanged.
- Line 93: README.zh-CN.md 中的表格项 src 说明仍是英文“Image
source”,与中文文档不一致;请在该参数描述处将其改为中文表述(如“图片源”或“图片地址”),并保持与同页其他字段说明的语言风格一致。

---

Nitpick comments:
In @.github/workflows/surge-preview.yml:
- Around line 38-42: The Build preview step in the surge preview workflow relies
on the runner’s default Node version, which can drift over time. Add an explicit
actions/setup-node step before Build preview and pin a specific Node version
there, using the workflow’s existing build job context so npm install and npm
run build execute against the locked runtime.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 00f9708e-4c4e-46db-894d-2647120ca979

📥 Commits

Reviewing files that changed from the base of the PR and between 433155d and fa53789.

📒 Files selected for processing (11)
  • .dumirc.ts
  • .github/dependabot.yml
  • .github/workflows/react-doctor.yml
  • .github/workflows/surge-preview.yml
  • .gitignore
  • .prettierignore
  • LICENSE
  • README.md
  • README.zh-CN.md
  • package.json
  • tsconfig.json
✅ Files skipped from review due to trivial changes (3)
  • LICENSE
  • .prettierignore
  • .gitignore
🚧 Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/react-doctor.yml
  • tsconfig.json
  • README.md

Comment thread README.zh-CN.md Outdated
Comment thread README.zh-CN.md Outdated
@afc163 afc163 merged commit b03f216 into master Jun 29, 2026
12 of 13 checks passed
@afc163 afc163 deleted the codex/standardize-rc-config branch June 29, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant