chore: standardize repository maintenance#62
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 23 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
Walkthrough本次变更新增并更新了多个 GitHub Actions 工作流(CodeQL、React Doctor、Surge Preview、测试复用)、新增 FUNDING.yml 与扩展 dependabot.yml、新增 vercel.json 并移除 now.json、重写 README 文档并新增中文版,同时升级 ESLint Flat 配置、TypeScript 配置、package.json 依赖,并修正若干类型注解。 ChangesCI/CD 与部署配置
估计代码审查工作量: 3(中等)| ~25 分钟 文档重写与构建/类型配置升级
估计代码审查工作量: 3(中等)| ~25 分钟 Sequence Diagram(s)sequenceDiagram
participant PR as Pull Request
participant Workflow as SurgePreviewWorkflow
participant Build as npmBuild
participant Surge as SurgeService
PR->>Workflow: 触发 pull_request 事件
Workflow->>Workflow: 检查 SURGE_TOKEN 是否存在
Workflow->>Build: ut install / npm run build
Build->>Surge: 部署 docs-dist 目录
Surge-->>PR: 返回预览链接状态
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates repository configuration, documentation, and dependencies. It adds GitHub Funding and Dependabot configurations, significantly improves the English and Chinese README files with usage examples and API tables, updates the Vercel deployment configuration, and introduces new scripts in package.json. Feedback is provided to add an exclude block in tsconfig.json to prevent type-checking compiled output directories, and to deduplicate the lint:tsc script in package.json by referencing the newly added tsc script.
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.
✅ Preview is ready!
↩️ Previous: ⚡️ 🤖 Powered by surge-preview |
|||||||||||||||
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #62 +/- ##
==========================================
- Coverage 97.20% 97.04% -0.17%
==========================================
Files 7 7
Lines 215 338 +123
Branches 78 98 +20
==========================================
+ Hits 209 328 +119
- Misses 6 10 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Deployment failed with the following error: Learn More: https://vercel.com/react-component?upgradeToPro=build-rate-limit |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (9)
README.md (1)
46-53: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAPI 表格过于精简,缺少关键属性。
当前仅列出
data、renderItem、renderRest,但maxCount(控制溢出行为的核心属性)和itemKey(列表渲染标识)等常用属性缺失。建议补充maxCount与itemKey,或增加指向完整 TypeScript 类型定义的链接,以便用户了解完整接口。| Prop | Description | | ------------ | -------------------------------- | | `data` | Items rendered by Overflow. | | `renderItem` | Render a visible item. | | `renderRest` | Render collapsed overflow items. | +| `maxCount` | Maximum visible items, or `responsive`/`invalidate`. | +| `itemKey` | Unique key for items. |🤖 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` around lines 46 - 53, The API table in README is incomplete for the Overflow component: it lists only data, renderItem, and renderRest, but omits key props like maxCount and itemKey. Update the API section to include these commonly used props and their descriptions, or add a clear reference to the full TypeScript type definition for the Overflow component so users can find the complete interface. Use the Overflow API table and its prop names as the place to extend the documentation.README.zh-CN.md (1)
46-78: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win中文翻译整体准确,结构与英文版保持一致。请同步应用对 README.md 提出的 API 表格补充与
ut install修正。# 本地开发 ```bash -ut install +npm install npm start npm test npm run lint以及 API 表格补充:
| 名称 | 说明 | | ------------ | ----------------------- | | `data` | Overflow 渲染的数据项。 | | `renderItem` | 渲染可见项。 | | `renderRest` | 渲染折叠后的溢出项。 | +| `maxCount` | 最大可见项数,或 `responsive`/`invalidate`。 | +| `itemKey` | 数据项的唯一标识。 |🤖 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.zh-CN.md` around lines 46 - 78, 同步更新 README.zh-CN.md,使其与 README.md 的 API 表格和本地开发命令保持一致:在“API”表格中补充英文版新增的字段说明,并将“本地开发”中的 ut install 修正为 npm install。重点检查 README.zh-CN.md 的“API”和“本地开发”小节,确保术语、表格内容和命令列表与英文版一致。.github/workflows/surge-preview.yml (2)
40-46: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value冗余的 env 转发。
SURGE_TOKEN已通过env设置,再通过${{ env.SURGE_TOKEN }}转发给surge_token输入,其实可以直接引用${{ secrets.SURGE_TOKEN }},省去中间的env块。🤖 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 40 - 46, The surge-preview workflow step is redundantly forwarding SURGE_TOKEN through env before passing it to afc163/surge-preview. Update the step to reference the secret directly in the with.surge_token input, and remove the unnecessary env.SURGE_TOKEN indirection while keeping the existing github_token and if condition intact.
35-49: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win构建步骤可能重复执行。
「Build preview」步骤已通过
ut install && npm run build完成构建,但调用afc163/surge-preview时未传入build参数。该 action 的build输入默认值为npm install\nnpm run build,因此会在 action 内部再次执行一次标准 npm 构建,导致构建重复执行,且内部构建使用npm install而非ut install,可能与 utoo 安装的依赖产生不一致。建议显式传入空的
build参数(或等效的 no-op 命令)以跳过 action 内置的默认构建。建议修复
- uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec if: ${{ steps.surge-token.outputs.enabled == 'true' }} env: SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} with: surge_token: ${{ env.SURGE_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }} dist: docs-dist + build: echo "already built" failOnError: false setCommitStatus: false🤖 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 - 49, The Surge preview workflow is building twice because the separate “Build preview” step already runs ut install and npm run build, but afc163/surge-preview is still using its default internal build command. Update the surge-preview action invocation to explicitly disable its built-in build by setting the build input to an empty/no-op command, so the action only publishes the existing docs-dist output. Use the existing steps.surge-token.outputs.enabled gate and the afc163/surge-preview action block to locate the change..github/workflows/test.yml (1)
14-14: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win可复用工作流引用未固定版本。
该 PR 中其他 action 均已固定到具体 SHA(如
codeql.yml、surge-preview.yml、react-doctor.yml),但此处复用工作流引用了浮动的@main分支,上游变更会在无审查的情况下直接影响本仓库 CI,供应链风险与其他文件的固定策略不一致。建议固定到具体 tag 或 commit SHA。
🤖 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/test.yml at line 14, The reusable workflow reference in the test pipeline is using a floating branch instead of a pinned version, which is inconsistent with the other pinned actions. Update the workflow call in the test YAML to reference a specific immutable tag or commit SHA rather than `@main`, using the existing workflow identifier as the location to make the change.eslint.config.mjs (2)
22-37: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win规则过滤逻辑会静默丢弃规则,建议加日志提示。
normalizeConfig会静默剔除所有不在supportedTsRules中的@typescript-eslint/*规则(以及全部@babel/*规则)。如果.eslintrc.js中存在拼写错误的规则名或规则在新版本中被重命名/移除,这里会悄悄失效而不会有任何提示,后续排查会比较困难。♻️ 建议:过滤时输出警告
next.rules = Object.fromEntries( Object.entries(next.rules).filter(([ruleName]) => { if (ruleName.startsWith('`@babel/`')) { return false; } - return !ruleName.startsWith('`@typescript-eslint/`') || supportedTsRules.has(ruleName); + const keep = !ruleName.startsWith('`@typescript-eslint/`') || supportedTsRules.has(ruleName); + if (!keep) { + console.warn(`[eslint.config.mjs] Dropping unsupported rule: ${ruleName}`); + } + return keep; }), );🤖 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 `@eslint.config.mjs` around lines 22 - 37, normalizeConfig is silently dropping unsupported ESLint rules, so add a warning when filtering them out instead of removing them quietly. Update the rule filtering in normalizeConfig to detect each excluded `@babel/`* and unsupported `@typescript-eslint/`* entry and emit a concise log or warning that includes the rule name, while keeping the existing filtering behavior intact. Use normalizeConfig and supportedTsRules as the main touchpoints so the change is easy to locate.
55-63: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win全局关闭
@typescript-eslint/no-unused-vars会削弱未使用变量检测。
tsconfig.json中strict: false且未见noUnusedLocals/noUnusedParameters,配合此处关闭no-unused-vars,整个仓库将失去对未使用变量/参数的任何静态检测手段。建议至少保留该规则(或改用 TS 的noUnusedLocals)。🤖 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 `@eslint.config.mjs` around lines 55 - 63, The ESLint config currently disables `@typescript-eslint/no-unused-vars` globally, which removes unused variable and parameter detection across the repository. In eslint.config.mjs, keep this rule enabled or replace it with TypeScript’s noUnusedLocals/noUnusedParameters in tsconfig so unused declarations are still caught; locate the rule set in the exported config where the other `@typescript-eslint` rules are toggled.tests/wrapper.ts (1)
127-127: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win返回类型标注为
any,丢失了测试辅助函数的类型检查收益。
wrapper对象结构在函数体内是完全已知的(find、findItems、triggerResize、setProps等方法均有明确签名),标注为any会让所有测试文件失去对mount()返回值的类型检查与自动补全,且更容易掩盖测试中的拼写错误。建议提取一个具体的返回类型接口。♻️ 建议:定义显式返回类型
-export function mount(element: React.ReactElement): any { +export function mount(element: React.ReactElement) {移除显式
: any标注,让 TypeScript 从函数体推断出精确的返回类型(或提取一个Wrapperinterface 显式声明)。🤖 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 `@tests/wrapper.ts` at line 127, `mount()` 的返回值被显式标成 `any`,导致测试辅助对象(如 `find`、`findItems`、`triggerResize`、`setProps`)失去类型检查和补全。请在 `mount` 函数上移除 `: any`,或提取并使用一个明确的 `Wrapper` 返回类型接口,让 TypeScript 根据函数体推断出精确类型并保留测试代码的校验能力。tsconfig.json (1)
4-4: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift不要在
tsconfig.json:4继续关闭strict。 这会让项目升级到 TypeScript 6 后仍停留在旧的宽松检查模式,错过默认开启的更强类型约束;如果当前还有阻塞问题,建议拆成后续清理逐步打开strict/strictNullChecks。🤖 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` at line 4, 不要在 tsconfig 的配置中继续保留关闭 strict 的设置;将 tsconfig.json 里的 strict 恢复为开启状态,并在相关配置项中逐步补齐因严格模式暴露出来的问题,优先检查与类型边界相关的代码并按需分阶段打开 strictNullChecks 等更细粒度选项,确保项目升级后使用更严格的 TypeScript 检查。
🤖 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.md`:
- Around line 54-74: The Development setup command is misspelled in the README;
update the install step in both README.md and README.zh-CN.md from the incorrect
`ut install` to the actual package install command, and keep the rest of the
workflow commands unchanged.
---
Nitpick comments:
In @.github/workflows/surge-preview.yml:
- Around line 40-46: The surge-preview workflow step is redundantly forwarding
SURGE_TOKEN through env before passing it to afc163/surge-preview. Update the
step to reference the secret directly in the with.surge_token input, and remove
the unnecessary env.SURGE_TOKEN indirection while keeping the existing
github_token and if condition intact.
- Around line 35-49: The Surge preview workflow is building twice because the
separate “Build preview” step already runs ut install and npm run build, but
afc163/surge-preview is still using its default internal build command. Update
the surge-preview action invocation to explicitly disable its built-in build by
setting the build input to an empty/no-op command, so the action only publishes
the existing docs-dist output. Use the existing
steps.surge-token.outputs.enabled gate and the afc163/surge-preview action block
to locate the change.
In @.github/workflows/test.yml:
- Line 14: The reusable workflow reference in the test pipeline is using a
floating branch instead of a pinned version, which is inconsistent with the
other pinned actions. Update the workflow call in the test YAML to reference a
specific immutable tag or commit SHA rather than `@main`, using the existing
workflow identifier as the location to make the change.
In `@eslint.config.mjs`:
- Around line 22-37: normalizeConfig is silently dropping unsupported ESLint
rules, so add a warning when filtering them out instead of removing them
quietly. Update the rule filtering in normalizeConfig to detect each excluded
`@babel/`* and unsupported `@typescript-eslint/`* entry and emit a concise log or
warning that includes the rule name, while keeping the existing filtering
behavior intact. Use normalizeConfig and supportedTsRules as the main
touchpoints so the change is easy to locate.
- Around line 55-63: The ESLint config currently disables
`@typescript-eslint/no-unused-vars` globally, which removes unused variable and
parameter detection across the repository. In eslint.config.mjs, keep this rule
enabled or replace it with TypeScript’s noUnusedLocals/noUnusedParameters in
tsconfig so unused declarations are still caught; locate the rule set in the
exported config where the other `@typescript-eslint` rules are toggled.
In `@README.md`:
- Around line 46-53: The API table in README is incomplete for the Overflow
component: it lists only data, renderItem, and renderRest, but omits key props
like maxCount and itemKey. Update the API section to include these commonly used
props and their descriptions, or add a clear reference to the full TypeScript
type definition for the Overflow component so users can find the complete
interface. Use the Overflow API table and its prop names as the place to extend
the documentation.
In `@README.zh-CN.md`:
- Around line 46-78: 同步更新 README.zh-CN.md,使其与 README.md 的 API
表格和本地开发命令保持一致:在“API”表格中补充英文版新增的字段说明,并将“本地开发”中的 ut install 修正为 npm install。重点检查
README.zh-CN.md 的“API”和“本地开发”小节,确保术语、表格内容和命令列表与英文版一致。
In `@tests/wrapper.ts`:
- Line 127: `mount()` 的返回值被显式标成 `any`,导致测试辅助对象(如
`find`、`findItems`、`triggerResize`、`setProps`)失去类型检查和补全。请在 `mount` 函数上移除 `:
any`,或提取并使用一个明确的 `Wrapper` 返回类型接口,让 TypeScript 根据函数体推断出精确类型并保留测试代码的校验能力。
In `@tsconfig.json`:
- Line 4: 不要在 tsconfig 的配置中继续保留关闭 strict 的设置;将 tsconfig.json 里的 strict
恢复为开启状态,并在相关配置项中逐步补齐因严格模式暴露出来的问题,优先检查与类型边界相关的代码并按需分阶段打开 strictNullChecks
等更细粒度选项,确保项目升级后使用更严格的 TypeScript 检查。
🪄 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: 6cd2fcf1-3ee4-4f4b-8947-05de88d32563
⛔ Files ignored due to path filters (4)
tests/__snapshots__/index.spec.tsx.snapis excluded by!**/*.snaptests/__snapshots__/invalidate.spec.tsx.snapis excluded by!**/*.snaptests/__snapshots__/raw.spec.tsx.snapis excluded by!**/*.snaptests/__snapshots__/ssr.spec.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (17)
.github/FUNDING.yml.github/dependabot.yml.github/workflows/codeql.yml.github/workflows/react-doctor.yml.github/workflows/surge-preview.yml.github/workflows/test.ymlREADME.mdREADME.zh-CN.mdeslint.config.mjsexamples/fill-width.tsxglobal.d.tsnow.jsonpackage.jsonsrc/RawItem.tsxtests/wrapper.tstsconfig.jsonvercel.json
💤 Files with no reviewable changes (1)
- now.json
There was a problem hiding this comment.
Pull request overview
Standardizes this repository’s maintenance setup (docs, tooling, CI, previews, and release workflow) to align with the broader Ant Design / rc-component ecosystem conventions.
Changes:
- Refreshed English/Chinese READMEs with consistent branding, badges, usage, development, and release guidance.
- Modernized tooling/config: ESLint flat config, updated dependencies, TypeScript config adjustments, and small typing tweaks in code/tests.
- Aligned preview/CI automation: added reusable test workflow, Surge preview, React Doctor, Dependabot grouping, CodeQL updates, and Vercel config; removed legacy
now.json.
Reviewed changes
Copilot reviewed 20 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
vercel.json |
Adds Vercel build configuration targeting the docs build output. |
tsconfig.json |
Updates TS compiler options and include/exclude patterns (currently introduces a compile-breaking config issue). |
tests/wrapper.ts |
Adjusts mount typing in test utilities. |
tests/__snapshots__/ssr.spec.tsx.snap |
Updates Jest snapshot header URL. |
tests/__snapshots__/raw.spec.tsx.snap |
Updates Jest snapshot header URL. |
tests/__snapshots__/invalidate.spec.tsx.snap |
Updates Jest snapshot header URL. |
tests/__snapshots__/index.spec.tsx.snap |
Updates Jest snapshot header URL. |
src/RawItem.tsx |
Updates allowed intrinsic element key type for component. |
README.zh-CN.md |
Adds a new standardized Simplified Chinese README. |
README.md |
Rewrites README into the standardized format with examples and release info. |
package.json |
Updates description, scripts, and dependency/devDependency versions to current stack. |
now.json |
Removes legacy Now/Vercel configuration. |
global.d.ts |
Adds TypeScript module declaration for importing *.less. |
examples/fill-width.tsx |
Updates refs initialization to null and keeps example behavior. |
eslint.config.mjs |
Introduces ESLint v9 flat-config setup with TS/React/Jest rules. |
.github/workflows/test.yml |
Adds reusable unit test workflow wiring via rc-test. |
.github/workflows/surge-preview.yml |
Adds Surge-based PR preview workflow. |
.github/workflows/react-doctor.yml |
Adds React Doctor automation workflow. |
.github/workflows/codeql.yml |
Updates CodeQL workflow formatting, actions versions, and language matrix. |
.github/FUNDING.yml |
Adds GitHub Sponsors / OpenCollective funding metadata. |
.github/dependabot.yml |
Configures Dependabot updates with grouping for npm and GitHub Actions. |
.eslintrc.js |
Removes legacy ESLint config in favor of flat config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Summary
@rc-component/np; remove legacy Now configuration where present.Refs ant-design/ant-design#58514
Test
npm run lint\n-npm run tsc\n-npm run compile\n-npm test\n-npm run build\n-git diff --checkSummary by CodeRabbit
New Features
Documentation
Bug Fixes