Skip to content

chore: standardize repository setup#247

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

chore: standardize repository setup#247
afc163 merged 32 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.

Summary by CodeRabbit

  • New Features

    • 新增中文与结构化英文文档,补充安装、使用、API、开发和发布说明。
    • 新增预览、质量检查与诊断相关的自动化工作流,提升在线预览与代码检查覆盖。
    • 新增赞助入口配置,方便支持项目。
  • Bug Fixes

    • 优化下拉组件在子元素不支持 ref 时的处理,确保打开状态样式正常应用。
    • 调整构建与部署输出目录,统一站点发布行为。

@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: 9624afb7-e09c-4d36-887c-004ae350fcf5

📥 Commits

Reviewing files that changed from the base of the PR and between 38493da and 8ee3fec.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Walkthrough

本 PR 调整了 Dropdown 子节点与动画类型处理,迁移文档构建与部署配置,更新 CI/预览工作流和仓库脚本依赖,并重写英文 README、新增中文 README。

Changes

Dropdown 组件核心变更

Layer / File(s) Summary
Dropdown 动画类型与子节点包装逻辑
src/Dropdown.tsx, tests/basic.test.tsx
animation 属性类型改为 stringchildrenNode 重写为按 ref 支持情况分别克隆子元素或用 span 包裹;新增不支持 ref 的子节点会获得 rc-dropdown-open 类名的测试。

构建、部署与 CI 基础设施

Layer / File(s) Summary
文档构建路径与部署配置迁移
.dumirc.ts, now.json, vercel.json, tsconfig.json, .gitignore
outputPath 改为 docs-dist,并根据 GH_PAGES 计算 base/publicPath;删除旧 now.json;新增 vercel.json 的构建与输出配置;tsconfig.json 扩展编译入口;忽略项加入 docs-dist
package.json 脚本与依赖更新
package.json, .husky/pre-commit, .prettierignore, .github/dependabot.yml, .github/FUNDING.yml
更新主页与仓库链接;新增 prettier/tsc 脚本并调整 preparelint-staged、pre-commit;升级开发依赖;新增 Prettier 忽略规则、Dependabot 配置与赞助配置。
CI 与预览工作流
.github/workflows/ci.yml, .github/workflows/codeql.yml, .github/workflows/react-doctor.yml, .github/workflows/surge-preview.yml
CI 改用 test-utoo.yml 并限制权限;CodeQL 保留触发条件并固定 Action 来源;新增 React Doctor 工作流与 Surge Preview 工作流。

文档更新

Layer / File(s) Summary
README 英文重写与中文新增
README.md, README.zh-CN.md
英文 README 重写为结构化文档并更新 API 与开发发布说明;新增中文 README,补充特性、安装、使用、API、本地开发、发布与许可证内容。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

  • react-component/dropdown#240:同样涉及 src/Dropdown.tsx 中的动画/弹层相关实现,与本 PR 的 animation 类型和 popupMotion 相关调整直接相连。

Suggested reviewers

  • zombieJ

Poem

🐇 小兔跳过代码坡,
docs-dist 亮闪闪地落。
旧门换新窗,预览随风过,
中英文档齐齐坐,
Dropdown 轻轻开合多欢乐。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了本次仓库配置、文档和 CI 统一标准化的主要变更。
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.
✨ 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-dropdown-preview-pr-247.surge.sh
📝 Commit8ee3fec
⏱️ Build time20.579s
📦 Size1.6 MB (no change) · 46 files
🪵 LogsView logs
📱 MobileScan to open preview on mobile

↩️ Previous: ⚡️ 8ee3fec · react-component-dropdown-preview-pr-247.surge.sh (open ↗) · 2026-06-29 06:26:33 UTC

🤖 Powered by surge-preview

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 8ee3fec.

@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.10%. Comparing base (99ae51a) to head (8ee3fec).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #247      +/-   ##
==========================================
+ Coverage   99.09%   99.10%   +0.01%     
==========================================
  Files           5        5              
  Lines         110      112       +2     
  Branches       34       34              
==========================================
+ Hits          109      111       +2     
  Misses          1        1              

☔ 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.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the project's documentation, funding configuration, and deployment settings (replacing the old configuration with vercel.json), while also adding new scripts to package.json. In the codebase, the animation prop type in Dropdown.tsx was simplified, and the component was refactored to wrap children that do not support refs in a span element. The review feedback highlights a critical issue in this refactoring: if the child is null, undefined, or a primitive value, accessing child.props directly will cause a runtime TypeError. It is recommended to safely check the child using React.isValidElement before accessing its properties.

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 src/Dropdown.tsx Outdated
@socket-security

socket-security Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​husky@​9.1.71001006280100
Addednpm/​glob@​13.0.6961009985100
Addednpm/​@​testing-library/​react@​15.0.710010010087100
Addednpm/​@​testing-library/​jest-dom@​6.9.110010010089100
Addednpm/​lint-staged@​16.4.010010010097100
Addednpm/​prettier@​3.9.1991009798100

View full report

@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: 6

🧹 Nitpick comments (2)
tsconfig.json (1)

18-23: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

.dumirc.ts 也纳入 tsc 覆盖范围。

这次 PR 同时改了 .dumirc.ts,但 include 这里只新增了 .fatherrc.ts。如果新增的类型检查脚本是为了覆盖工具链配置,Dumi 配置回归这里仍然不会被 tsc 提前拦住。

🤖 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 `@tsconfig.json` around lines 18 - 23, The tsconfig include list is missing the
new Dumi config file, so TypeScript coverage won’t catch regressions in that
config. Update the existing include array in tsconfig.json to add .dumirc.ts
alongside .fatherrc.ts, keeping the same pattern used for the other root-level
config files so tsc checks both toolchain configs.
.github/workflows/surge-preview.yml (1)

35-39: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

为预览构建补上显式 Node 版本。
这里没有 actions/setup-node,仓库也没有 .nvmrc / .node-version / .tool-versions / engines / packageManager 这类版本来源,npm install / npm run build 会直接跟随 runner 默认 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 35 - 39, The preview build
job is relying on the runner’s default Node version because there is no explicit
version source before the Build preview step. Add a dedicated Node setup step
using actions/setup-node in this workflow, choose a fixed version for the build,
and make sure the Build preview run block comes after that setup so npm install
and npm run build execute under the intended Node 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 @.dumirc.ts:
- Around line 13-15: The docs build output has been moved to docs-dist, but the
ignore rules still only cover the old .docs directory. Update the existing
.gitignore entry so the new outputPath used in .dumirc.ts is ignored as well,
keeping the generated docs artifacts from showing up as untracked files; make
sure the ignore list matches the current docs build target and its related
output directory naming.

In @.github/workflows/ci.yml:
- Around line 6-8: In the CI workflow job that calls the reusable
`react-component/rc-test` workflow, remove the blanket `secrets: inherit` and
switch to explicitly passing only the required secret inputs for that `uses`
job. Also add a minimal `permissions` block for the `CI` job so the reusable
workflow runs with the least privilege needed, using the existing `CI` job
definition as the place to tighten the configuration.

In `@README.md`:
- Around line 72-89: The README API table is out of sync with the actual
Dropdown typings and implementation. Update the documented props to match
`DropdownProps` in `src/Dropdown.tsx` and the related `TriggerProps` usage: fix
`onOverlayClick` to use the same event type as the callback implementation,
remove or document `defaultVisible` only if it is truly supported, and add the
missing `arrow` prop with its default value. Keep the table aligned with the
symbols `DropdownProps`, `onOverlayClick`, and `arrow` so the docs reflect the
real API.

In `@README.zh-CN.md`:
- Line 31: The README.zh-CN bullet is still in English, so update the translated
copy to keep the Chinese context consistent; change the “Built on
`@rc-component/trigger`” item in the README.zh-CN content to a Chinese phrasing
while preserving the package name, and verify the surrounding bullets in the
same section remain uniformly localized.
- Around line 72-89: API 表格中的多个属性名和说明翻译错误,需要统一修正为与英文文档一致:将“动画片”“扳机”“可见的”分别改回对应的
animation、trigger、visible,并把 openClassName、overlay、transitionName
等项里的“className称”改为“类名”或直接保留 className。同步检查 overlay、placement、getPopupContainer
等说明是否完整中文化,并在 README.zh-CN.md 中按英文 README 的定义修正 defaultVisible 和 onOverlayClick
的描述与类型展示。

In `@src/Dropdown.tsx`:
- Around line 150-160: The fallback branch in Dropdown’s children rendering is
attaching `childClassName` only to the wrapping `<span>`, so components that
don’t support `ref` but do consume `className` never receive the merged
open-state class. Update `childrenNode` in `Dropdown.tsx` so the `child` itself
gets the combined `className`/`openClassName` behavior in the
non-`supportRef(elementChild)` path, while keeping the wrapper only for ref
handling; use the existing `childClassName`, `triggerChildProps`, and
`supportRef` logic to preserve prior trigger styling.

---

Nitpick comments:
In @.github/workflows/surge-preview.yml:
- Around line 35-39: The preview build job is relying on the runner’s default
Node version because there is no explicit version source before the Build
preview step. Add a dedicated Node setup step using actions/setup-node in this
workflow, choose a fixed version for the build, and make sure the Build preview
run block comes after that setup so npm install and npm run build execute under
the intended Node runtime.

In `@tsconfig.json`:
- Around line 18-23: The tsconfig include list is missing the new Dumi config
file, so TypeScript coverage won’t catch regressions in that config. Update the
existing include array in tsconfig.json to add .dumirc.ts alongside
.fatherrc.ts, keeping the same pattern used for the other root-level config
files so tsc checks both toolchain configs.
🪄 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: 1564453b-e825-4e8e-92e8-cb6c5bc3bd5b

📥 Commits

Reviewing files that changed from the base of the PR and between d26d860 and 2027ffa.

📒 Files selected for processing (13)
  • .dumirc.ts
  • .github/FUNDING.yml
  • .github/workflows/ci.yml
  • .github/workflows/codeql.yml
  • .github/workflows/react-doctor.yml
  • .github/workflows/surge-preview.yml
  • README.md
  • README.zh-CN.md
  • now.json
  • package.json
  • src/Dropdown.tsx
  • tsconfig.json
  • vercel.json
💤 Files with no reviewable changes (1)
  • now.json

Comment thread .dumirc.ts
Comment thread .github/workflows/ci.yml Outdated
Comment thread README.md
Comment thread README.zh-CN.md Outdated
Comment thread README.zh-CN.md
Comment thread src/Dropdown.tsx Outdated
@afc163 afc163 merged commit a04ba08 into master Jun 29, 2026
14 checks passed
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