Skip to content

chore: standardize repository config - #734

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

chore: standardize repository config#734
afc163 merged 39 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)
input-number Ready Ready Preview, Comment Jun 29, 2026 6:28am

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

✅ Preview is ready!

PR preview ✅ Ready ✅ Ready
🔗 Preview https://react-component-input-number-preview-pr-734.surge.sh
📝 Commit5bd2ec9
⏱️ Build time19.695s
📦 Size1.6 MB (no change) · 42 files
🪵 LogsView logs
📱 MobileScan to open preview on mobile

↩️ Previous: ⚡️ 5bd2ec9 · react-component-input-number-preview-pr-734.surge.sh (open ↗) · 2026-06-29 06:28:01 UTC

🤖 Powered by surge-preview

@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: a25d290d-a3cb-4880-9b8d-27add5d787e1

📥 Commits

Reviewing files that changed from the base of the PR and between 9ec5458 and 5bd2ec9.

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

Walkthrough

该 PR 将 README 整体重写并新增中文版文档,更新了 Vercel 部署配置、dumi 路径变量、tsconfig include 字段及 package.json 脚本,新增了 Surge 预览与 React Doctor GitHub Actions 工作流,并对 CodeQL、CI 工作流权限和 Dependabot 计划进行了调整。

Changes

仓库文档与自动化更新

Layer / File(s) Summary
仓库与构建工具配置
.github/FUNDING.yml, .gitignore, vercel.json, .prettierignore, .dumirc.ts, tsconfig.json, package.json, LICENSE, tests/util/wrapper.ts
资助配置精简为 GitHub/Open Collective;新增 Vercel 部署配置与 .vercel 忽略规则;Prettier 忽略文件填充;dumi 引入基于 GH_PAGES 环境变量的路径变量;tsconfig 新增顶层 include;package.json 新增 build/tsc/docs:build:gh-pages 脚本并更新依赖;customRender 补充显式返回类型注解。
README 与中文文档重写
README.md, README.zh-CN.md
英文 README 标题区重排并新增 Highlights、API 表从 HTML 改为 Markdown、新增 Ref 与 Release 章节;同步新增覆盖全部章节的中文版文档。
Surge 预览工作流
.github/workflows/surge-preview.yml
新增 PR 触发的 Surge 预览工作流,含顶层与作业级并发控制、Surge token 条件开关步骤,以及通过 afc163/surge-preview 部署 docs-dist
CI 工作流调整
.github/workflows/react-doctor.yml, .github/workflows/codeql.yml, .github/workflows/react-component-ci.yml, .github/dependabot.yml
新增 React Doctor 工作流;CodeQL action 版本固定为提交哈希并添加 persist-credentials: false;react-component-ci 新增顶层 permissions 并修正 secrets: inherit 层级;Dependabot 调整为每周计划并新增 github-actions 监控。

估算代码审查工作量

🎯 3 (Moderate) | ⏱️ ~20 minutes

可能相关的 PR

  • react-component/input-number#670:同样修改了 .github/workflows/react-component-ci.yml 中可复用工作流调用结构,与本 PR 调整 secrets: inherit 层级相关。

建议的审查者

  • zombieJ

Poem

🐇 小兔子跳跳跳,
文档换新颜今朝,
Surge 预览添来了,
CI 权限更严格,
README 中英双语好!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
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.

@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 95.78%. Comparing base (3276fb2) to head (5bd2ec9).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #734   +/-   ##
=======================================
  Coverage   95.78%   95.78%           
=======================================
  Files           6        6           
  Lines         332      332           
  Branches       92       92           
=======================================
  Hits          318      318           
  Misses         14       14           

☔ 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 cleans up the repository configuration and documentation, including updating the funding configuration, adding Vercel deployment settings, and modernizing the README. Feedback on these changes suggests adding an "exclude" field to "tsconfig.json" to prevent compilation issues, removing a redundant "now-build" script from "package.json", and replacing the internal "ValueType" reference in the README with "number | string" for better clarity.

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 tsconfig.json Outdated
Comment thread package.json Outdated
Comment thread README.md 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: 3

🧹 Nitpick comments (4)
README.md (3)

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

修正连字符使用。

"read-only" 作为复合形容词修饰 "input",需要添加连字符。

- | readOnly | `boolean` | `false` | Mark the input as read only. |
+ | readOnly | `boolean` | `false` | Mark the input as read-only. |
🤖 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 94, The README wording for the readOnly property uses
“read only” without a hyphen; update the description to use the correct compound
adjective “read-only” when describing the input, keeping the rest of the table
entry unchanged.

Source: Linters/SAST tools


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

修正连字符使用。

复合形容词 "string-based" 修饰名词 "value flows",需要添加连字符。

- - TypeScript generic value typing for number and string based value flows.
+ - TypeScript generic value typing for number and string-based value flows.
🤖 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 29, The README wording uses “string based” without the
needed hyphen for a compound modifier; update the affected text to use
“string-based” consistently. Locate the sentence in the README that describes
TypeScript generic value typing and adjust the phrasing so the compound
adjective is hyphenated correctly.

Source: Linters/SAST tools


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

修正连字符使用。

"high-precision" 作为复合形容词修饰 "decimals",需要添加连字符。

- | stringMode | `boolean` | `false` | Keep values as strings for high precision decimals. |
+ | stringMode | `boolean` | `false` | Keep values as strings for high-precision decimals. |
🤖 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 96, The README entry for stringMode uses “high precision
decimals” without the needed hyphen; update the wording to “high-precision
decimals” in the table description. Locate the stringMode description in
README.md and keep the rest of the text unchanged.

Source: Linters/SAST tools

.github/workflows/react-doctor.yml (1)

9-13: 🔒 Security & Privacy | 🔵 Trivial

收紧 push 事件下的非必要写权限。

该工作流同时响应 pull_requestpush。经核实,millionco/react-doctor Action 仅在 pull_request 事件下执行需要 pull-requests: writeissues: write 的操作(如发布评论);在 push 事件下,这些步骤会自动跳过,仅保留 statuses: write 用于发布提交状态。

当前在顶层定义 pull-requests: writeissues: write 会导致在 push 事件(如推送到主分支)时 GITHUB_TOKEN 拥有不必要的宽泛写权限,违反最小权限原则。建议移除工作流级别的这两项写权限,仅在需要 PR 操作的 Job 或 PR 触发条件下通过作业级权限覆盖来声明。

建议修改
# 移除顶层多余的写权限
permissions:
  contents: read
  statuses: write

jobs:
  react-doctor:
    runs-on: ubuntu-latest
    if: github.event_name == 'pull_request' || github.event_name == 'push'
    permissions:
      # PR 场景才需要的权限(仅在 PR 事件有效)
      pull-requests: write
      issues: write
      # 全局保持的最小权限已在 workflow 级定义,此处可省略或明确
    steps:
      # ...

或更简单地,若 Job 级权限未显式声明 PR 相关权限,push 事件下将仅使用工作流级的 statuses: write,从而自然实现权限缩减。

🤖 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 - 13, The workflow-level
permissions are too broad for the mixed pull_request/push trigger. Update the
react-doctor workflow so pull-requests: write and issues: write are not granted
at the top level; keep only the minimal global permissions needed for push
status reporting, and move any PR-only write permissions to the react-doctor job
or PR-specific scope. This change should be applied in the workflow permissions
block while preserving the existing pull_request and push behavior.
🤖 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 17-41: The Cloudflare credentials are scoped too broadly in this
workflow, exposing them to untrusted build steps like npm install and npm run
build. Move CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID out of the job-level
env and into the Deploy preview step only, keeping the earlier
skip/install/build steps free of any Cloudflare secrets. Use the existing
cloudflare/wrangler-action step and the CLOUDFLARE_PAGES_PROJECT/env checks to
preserve the current behavior while limiting secret access.

In @.github/workflows/surge-preview.yml:
- Around line 19-36: The surge preview workflow is running untrusted PR build
commands while `SURGE_TOKEN` is available, which can expose the secret. Split
the logic in the workflow so `npm install` and `npm run build` happen in a
separate step or job that does not have `SURGE_TOKEN`, then run the
`afc163/surge-preview` deployment only after the `docs-dist` artifact is
produced and with the token injected just for that deploy step. If
`afc163/surge-preview` cannot disable its internal `build` behavior, replace it
with a separated deployment job or direct Surge CLI publish flow.

In `@README.md`:
- Line 122: The public API is missing the InputFocusOptions type even though
InputNumberRef.focus uses it, so users cannot reference the parameter type from
the package entrypoint. Update the package’s main type exports in src/index.ts
to explicitly re-export InputFocusOptions alongside InputNumberProps, ValueType,
and InputNumberRef, and ensure the README type signature stays aligned with the
exported API.

---

Nitpick comments:
In @.github/workflows/react-doctor.yml:
- Around line 9-13: The workflow-level permissions are too broad for the mixed
pull_request/push trigger. Update the react-doctor workflow so pull-requests:
write and issues: write are not granted at the top level; keep only the minimal
global permissions needed for push status reporting, and move any PR-only write
permissions to the react-doctor job or PR-specific scope. This change should be
applied in the workflow permissions block while preserving the existing
pull_request and push behavior.

In `@README.md`:
- Line 94: The README wording for the readOnly property uses “read only” without
a hyphen; update the description to use the correct compound adjective
“read-only” when describing the input, keeping the rest of the table entry
unchanged.
- Line 29: The README wording uses “string based” without the needed hyphen for
a compound modifier; update the affected text to use “string-based”
consistently. Locate the sentence in the README that describes TypeScript
generic value typing and adjust the phrasing so the compound adjective is
hyphenated correctly.
- Line 96: The README entry for stringMode uses “high precision decimals”
without the needed hyphen; update the wording to “high-precision decimals” in
the table description. Locate the stringMode description in README.md and keep
the rest of the text unchanged.
🪄 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: 94228eb2-3d27-4086-adf6-85bf363165f2

📥 Commits

Reviewing files that changed from the base of the PR and between 3276fb2 and 71b8c55.

📒 Files selected for processing (11)
  • .github/FUNDING.yml
  • .github/workflows/cloudflare-pages-preview.yml
  • .github/workflows/codeql.yml
  • .github/workflows/react-component-ci.yml
  • .github/workflows/react-doctor.yml
  • .github/workflows/surge-preview.yml
  • .gitignore
  • README.md
  • package.json
  • tsconfig.json
  • vercel.json

Comment thread .github/workflows/cloudflare-pages-preview.yml Outdated
Comment thread .github/workflows/surge-preview.yml Outdated
Comment thread README.md
@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

@afc163
afc163 merged commit 168879c into master Jun 29, 2026
13 checks passed
@afc163
afc163 deleted the codex/standardize-rc-config branch June 29, 2026 07:03
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