Skip to content

chore: standardize repository config#699

Open
afc163 wants to merge 22 commits into
masterfrom
codex/standardize-rc-config
Open

chore: standardize repository config#699
afc163 wants to merge 22 commits into
masterfrom
codex/standardize-rc-config

Conversation

@afc163

@afc163 afc163 commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Redesign README with package badges, Ant Design ecosystem note, install/usage examples, API overview, development, and release guidance.
  • Standardize repository workflows around shared rc CI, React Doctor, pinned actions, CodeQL, Vercel preview, and Surge preview fallback.
  • Align dumi/father scripts, tsconfig, funding, and preview build configuration while removing legacy preview workflows.
  • Update pagination demos/tests from rc-select to @rc-component/select, including test helpers, API usage, and snapshots.

Verification

  • npm run prettier
  • npm run lint
  • npm run tsc
  • npm test -- --runInBand
  • npm run compile
  • npm run build
  • npx vercel build --yes

Refs ant-design/ant-design#58514

Summary by CodeRabbit

  • 新功能
    • GitHub Pages 部署自动匹配基础路径(分页场景路径更可靠)。
    • 新增/调整自动化工作流:测试、React Doctor、Surge 预览。
  • 文档
    • 重写并完善 README(含 API 属性表、示例与发布说明),新增 README.zh-CN。
  • 修复/改进
    • 更新示例与测试:样式/下拉宽度匹配行为对齐,并修正相关断言。
  • 构建与部署
    • 调整构建脚本与 dumi/Vercel 输出目录;更新忽略规则与格式化配置。

@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)
pagination Ready Ready Preview, Comment Jun 28, 2026 4:47am

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

本次修改更新了文档站点构建与部署配置,切换了示例和测试中的 Select 依赖,重写了 README 与首页文案,并新增或调整了多个 GitHub Actions 工作流和测试环境兜底。

Changes

站点与组件迁移

Layer / File(s) Summary
站点构建配置
.dumirc.ts, package.json, tsconfig.json, vercel.json, .gitignore
GH_PAGES 驱动 base/publicPathbuild 脚本和 Vercel 输出目录改为 docs-dist,TypeScript include/exclude 与忽略项同步更新。
Select 依赖切换
package.json, docs/examples/utils/commonUtil.tsx, docs/examples/*.tsx, tests/*.tsx
rc-select 相关导入改为 @rc-component/selectsizeChangerRender 改用 popupMatchSelectWidth,相关测试断言改为读取新的内容节点。
文档正文刷新
docs/index.md, README.md, README.zh-CN.md
首页 hero、README 的介绍、示例、API、开发/发布说明和链接文案被重写为新内容。
测试运行时兜底
tests/setupAfterEnv.ts
新增 TestMessageChannel,并在缺少 MessageChannel 时注入到 globalThis

GitHub 自动化与仓库配置

Layer / File(s) Summary
仓库元数据
.github/FUNDING.yml, .github/dependabot.yml
资助账号改为 ant-design,Dependabot 的 npm 更新配置重写并保留原有调度与忽略规则。
CodeQL 与测试 CI
.github/workflows/codeql.yml, .github/workflows/react-component-ci.yml
CodeQL 改为固定提交哈希并关闭 checkout 凭据持久化;新增复用远程测试 workflow 的 CI 配置。
React Doctor 工作流
.github/workflows/react-doctor.yml
新增 React Doctor workflow,包含 push/master 与 PR 触发、权限控制、并发分组和固定版本检查步骤。
Surge 预览工作流
.github/workflows/surge-preview.yml
新增 PR 预览 workflow,按 PR 编号去重,在有 SURGE_TOKEN 时构建并发布 docs-dist,缺失时跳过。

Sequence Diagram(s)

sequenceDiagram
  participant PullRequest
  participant GitHubActions
  participant Checkout
  participant SurgePreview
  PullRequest->>GitHubActions: pull_request 触发
  GitHubActions->>Checkout: 检出代码并禁用凭据持久化
  GitHubActions->>GitHubActions: npm install
  GitHubActions->>GitHubActions: npm run build
  alt SURGE_TOKEN 非空
    GitHubActions->>SurgePreview: 发布 docs-dist 并设置状态
    SurgePreview->>GitHubActions: 返回预览结果
  else SURGE_TOKEN 为空
    GitHubActions->>GitHubActions: 输出跳过提示
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • zombieJ
  • MadCcc

Poem

我是一只小兔,蹦进新草地,
GH_PAGES 一开,路径换新衣。
Select 换枝叶,测试也相依,
预览云端起,文档亮晶晶。
啃口胡萝卜,代码跳得齐。

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题与本次仓库配置、文档和工作流标准化的主要变更一致,能概括这组改动。
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

❌ Deploy failed

PR preview ❌ Failed ❌ Failed
🔗 Preview https://react-component-pagination-preview-pr-699.surge.sh (may be unavailable)
📝 Commit519184e
🪵 LogsView logs
📋 Build log (last lines)
npm warn exec The following package was not found and will be installed: surge@0.27.4

   Running as afc163@gmail.com (Student)

        project: ./docs-dist
         domain: react-component-pagination-preview-pr-699.surge.sh
           size: 82 files, 1.8 MB

   Aborted - you do not have permission to publish to react-component-pagination-preview-pr-699.surge.sh

🤖 Powered by surge-preview

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

React Doctor found 7 new issues in 2 files · 7 warnings · score 49 / 100 (Critical) · 12 fixed · vs master

7 warnings

src/Pager.tsx

  • ⚠️ L58 Anchor used as a button anchor-is-valid
  • ⚠️ L72 Noninteractive element given interactive role no-noninteractive-element-to-interactive-role

src/Pagination.tsx

  • ⚠️ L253 Pure function rebuilt every render prefer-module-scope-pure-function
  • ⚠️ L477 Noninteractive element given interactive role no-noninteractive-element-to-interactive-role
  • ⚠️ L493 Noninteractive element given interactive role no-noninteractive-element-to-interactive-role
  • ⚠️ L575 Noninteractive element given interactive role no-noninteractive-element-to-interactive-role
  • ⚠️ L605 Noninteractive element given interactive role no-noninteractive-element-to-interactive-role

Reviewed by React Doctor for commit 519184e. See inline comments for fixes.

@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.58%. Comparing base (87c4ff3) to head (519184e).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #699      +/-   ##
==========================================
+ Coverage   99.06%   99.58%   +0.51%     
==========================================
  Files           3        4       +1     
  Lines         320      479     +159     
  Branches      146      239      +93     
==========================================
+ Hits          317      477     +160     
+ Misses          3        2       -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
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 migrates the repository from 'rc-select' to '@rc-component/select', updating dependency references, example files, tests, and snapshots accordingly. It also refactors the documentation, configures Vercel and GitHub Pages builds, and adds a 'MessageChannel' mock for the test environment. The review feedback suggests replacing 'setTimeout' with 'queueMicrotask' in the 'MessageChannel' mock to avoid potential issues when tests use Jest's fake timers.

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 tests/setupAfterEnv.ts Outdated

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

🤖 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/react-component-ci.yml:
- Around line 6-8: The reusable workflow reference in react-component-ci is too
permissive: it currently points to the moving main branch and inherits all
secrets. Update the workflow call in the CI definition to pin
react-component/rc-test/.github/workflows/test-utoo.yml to a specific commit
SHA, and replace secrets: inherit with only the explicitly required secrets from
that called workflow’s workflow_call contract. Use the test job in
react-component-ci and the called workflow’s declared inputs/secrets to locate
what needs to be narrowed.

In @.github/workflows/react-doctor.yml:
- Around line 20-27: The react-doctor workflow job is missing an explicit
timeout, so add a timeout setting directly on the react-doctor job to prevent
the runner from hanging if the external action stalls. Update the job definition
in the react-doctor workflow alongside the existing checkout and
millionco/react-doctor steps, and choose a reasonable timeout that fits the
job’s expected runtime.
- Around line 9-14: `react-doctor.yml` 里的 `permissions`
现在对所有事件都开放了过大的写权限;请按事件拆分或在作业级别收紧 `GITHUB_TOKEN`,让 `pull_request` 相关步骤仅保留真正需要的
`pull-requests: write`/`issues: write`,而 `push` 到 `master` 时只保留必需权限(如 `contents:
read` 和必要的 `statuses: write`)。重点检查该 workflow 中触发第三方 Action 的作业配置,确保这些写权限不会在
`push` 场景下默认下发。

In `@package.json`:
- Line 94: README.md 中关于 selectPrefixCls 的默认前缀文档仍写成 rc-select,和已迁移到
`@rc-component/select` 的实际默认值不一致;请在 README 的相关说明处同步更新为新包对应的默认值或实际配置,并保持与
package.json 中的 `@rc-component/select` 版本一致,避免误导用户。定位时请关注 selectPrefixCls、README
里的默认值描述以及 `@rc-component/select` 相关文档段落。

In `@tests/setupAfterEnv.ts`:
- Around line 9-12: The MessageChannel fallback in the test setup is scheduling
port2.postMessage callbacks with queueMicrotask, which runs as a microtask
instead of matching the native macrotask behavior; update the fallback inside
the MessageChannel shim in setupAfterEnv.ts to use a task-based scheduler such
as setTimeout(..., 0) so the MessagePort callback ordering better matches real
browser timing and avoids test-only sequencing issues.
🪄 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: 6cec4165-8314-4225-8e03-89fec5aecb95

📥 Commits

Reviewing files that changed from the base of the PR and between 87c4ff3 and 3268d6f.

⛔ Files ignored due to path filters (2)
  • tests/__snapshots__/demo.test.tsx.snap is excluded by !**/*.snap
  • tests/__snapshots__/options.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (25)
  • .dumirc.ts
  • .github/FUNDING.yml
  • .github/dependabot.yml
  • .github/workflows/codeql.yml
  • .github/workflows/main.yml
  • .github/workflows/react-component-ci.yml
  • .github/workflows/react-doctor.yml
  • .github/workflows/surge-preview.yml
  • .gitignore
  • README.md
  • docs/examples/controlled.tsx
  • docs/examples/jumper.tsx
  • docs/examples/jumperWithGoButton.tsx
  • docs/examples/locale.tsx
  • docs/examples/sizer.tsx
  • docs/examples/utils/commonUtil.tsx
  • docs/index.md
  • package.json
  • tests/commonUtil.tsx
  • tests/setupAfterEnv.ts
  • tests/simple.test.tsx
  • tests/sizer.test.tsx
  • tests/two-pagination.tsx
  • tsconfig.json
  • vercel.json
💤 Files with no reviewable changes (1)
  • .github/workflows/main.yml

Comment thread .github/workflows/react-component-ci.yml
Comment thread .github/workflows/react-doctor.yml
Comment thread .github/workflows/react-doctor.yml
Comment thread package.json
Comment thread tests/setupAfterEnv.ts
@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: 1

🤖 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/surge-preview.yml:
- Around line 19-41: Move SURGE_TOKEN to a job-level env and stop reading
secrets directly inside the if conditions in the preview workflow. Update the
conditional checks in the workflow steps to use env.SURGE_TOKEN instead of
secrets.SURGE_TOKEN, and keep the existing build/surge steps gated by that
env-based condition so the workflow validates correctly. Locate the logic in the
preview job where actions/checkout, Build preview, afc163/surge-preview, and
Skip Surge preview are defined.
🪄 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: 0aa1b7c5-ff0d-4aa4-b424-0b04613364fc

📥 Commits

Reviewing files that changed from the base of the PR and between faccd96 and e4526e7.

📒 Files selected for processing (3)
  • .github/workflows/react-doctor.yml
  • .github/workflows/surge-preview.yml
  • README.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/react-doctor.yml
  • README.md

Comment thread .github/workflows/surge-preview.yml 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
Updatednpm/​@​types/​jest@​30.0.0 ⏵ 29.5.14100 +110077 +180100
Addednpm/​cross-env@​10.1.010010010082100
Addednpm/​@​testing-library/​react@​15.0.710010010087100
Addednpm/​lint-staged@​16.4.010010010097100
Addednpm/​@​rc-component/​select@​1.9.09810010098100

View full report

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