Skip to content

chore: standardize repository setup#299

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

chore: standardize repository setup#299
afc163 wants to merge 15 commits into
masterfrom
codex/standardize-rc-config

Conversation

@afc163

@afc163 afc163 commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Redesign README with scoped package name, badges, install command, usage, API, development, release, and Ant Design ecosystem branding.
  • Switch the shared test workflow to react-component/rc-test/.github/workflows/test-utoo.yml@main.
  • Add React Doctor, Vercel, Surge fallback preview, optional Cloudflare Pages preview, Funding, and pinned action versions.
  • Normalize repository scripts for tsc, Prettier, and Husky.

Verification

npm install
npx prettier --write README.md package.json vercel.json .github/FUNDING.yml .github/workflows/*.yml
npm run lint
npm run tsc
npm test -- --runInBand
npm run compile
npm run build

Summary by CodeRabbit

  • 新功能

    • 新增 GitHub Sponsors / Open Collective 赞助配置入口。
    • 新增 “React Doctor” 与 “Surge Preview” 自动化工作流,支持拉取请求时的诊断与预览。
    • 增加 Vercel 部署配置,实现自动构建并输出 dist
  • 文档

    • 更新 README(英文):品牌与徽标链接体系、Highlights、Install/Usage/Examples、API 与 Ref 文档全面调整。
    • 新增中文 README,补充安装使用、参数与 Ref 接口说明。
  • 维护

    • 更新代码质量/格式化与校验脚本,并对 CI(含 CodeQL)进行动作版本与配置规范化。

Refs ant-design/ant-design#58514

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

❌ Deploy failed

PR preview ❌ Failed ❌ Failed
🔗 Preview https://react-component-checkbox-preview-pr-299.surge.sh (may be unavailable)
📝 Commit044ae19
🪵 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-checkbox-preview-pr-299.surge.sh
           size: 27 files, 1.5 MB

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

🤖 Powered by surge-preview

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

More reviews will be available in 18 minutes and 25 seconds. Learn how PR review limits work.

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

⌛ How to resolve this issue?

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

🚦 How do rate 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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6518f284-edfc-4ce1-836b-792babfa3664

📥 Commits

Reviewing files that changed from the base of the PR and between c1df5f8 and 044ae19.

📒 Files selected for processing (7)
  • .dumirc.ts
  • .github/workflows/surge-preview.yml
  • README.md
  • README.zh-CN.md
  • package.json
  • tsconfig.json
  • vercel.json

Walkthrough

更新了 README、脚本和中文文档,新增资助与预览部署配置,并调整了 CodeQL、复用测试、React Doctor 和 Surge preview 工作流。

Changes

仓库文档与自动化

Layer / File(s) Summary
品牌与 README 入口
.github/FUNDING.yml, README.md, README.zh-CN.md
新增资助配置,并将 README 顶部标题、徽标和中文文档切换到 @rc-component/checkbox
README 主体内容
README.md
重写 Highlights、Install、Usage、Examples 和 API 章节,并新增 Ref 表格。
README 维护说明
README.md
更新 Development、Release 和 License 段落。
脚本与 lint-staged 调整
package.json
调整 prepareprettiertsclint-staged 命令。

CI 检查与预览部署

Layer / File(s) Summary
CodeQL 与复用测试工作流
.github/workflows/codeql.yml, .github/workflows/main.yml
CodeQL action 版本被固定,复用测试工作流切换到 test-utoo.yml
React Doctor 工作流
.github/workflows/react-doctor.yml
新增 PR 和 master push 触发的 React Doctor 工作流,包含权限、并发和动作调用。
预览部署配置
.github/workflows/surge-preview.yml, vercel.json
新增 Surge preview 工作流的条件执行与跳过分支,并添加 Vercel 构建配置。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

我是一只小兔,跳过 README 的草地,
徽标亮晶晶,像胡萝卜在招手。
工作流排整齐,预览窗轻轻开,
脚本换新装,仓库闻起来很香。
🐇✨

🚥 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 标题简洁且与本次仓库配置标准化、工作流和文档更新的主要变更一致。
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.

@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 100.00%. Comparing base (8678193) to head (044ae19).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #299   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           30        30           
  Branches         5         5           
=========================================
  Hits            30        30           

☔ 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 updates the repository configuration and documentation to align with the @rc-component/checkbox package. Key changes include adding a funding configuration, updating the README with modern examples and API tables, adding a Vercel deployment configuration, and adjusting scripts in package.json (such as switching from bunx to standard tsc and adding --ignore-unknown to Prettier). The reviewer suggested simplifying the lint-staged Prettier command for TypeScript files by removing the redundant --parser=typescript flag, which is already automatically inferred by Prettier.

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 package.json 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: 1

🧹 Nitpick comments (1)
package.json (1)

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

--ignore-unknown 与显式 --parser=typescript 的组合说明。

Line 45-46 中,*.ts?(x) 的 Prettier 命令同时使用了 --parser=typescript--ignore-unknown。由于已显式指定解析器,--ignore-unknown 对该匹配模式实际上不会生效(Prettier 已知如何处理),但也不会产生副作用。如果目的是统一配置风格,可以保留;若想精简,可移除该模式下的 --ignore-unknown

🤖 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 `@package.json` around lines 42 - 46, The `*.ts?(x)` Prettier task in
package.json redundantly combines `--parser=typescript` with `--ignore-unknown`;
since the parser is already explicit, simplify that matcher by removing the
unnecessary `--ignore-unknown` flag while keeping the TypeScript parser command
intact. Update the `*.ts?(x)` entry only, leaving the other glob patterns
unchanged.
🤖 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/main.yml:
- Around line 5-6: The reusable workflow call in the main GitHub Actions config
is using an unpinned ref and inheriting all secrets, which should be tightened.
Update the workflow reference to a specific commit SHA instead of `@main`, and
replace secrets: inherit with an explicit secret mapping that passes only
CODECOV_TOKEN to the reused workflow. Use the existing workflow call entry to
locate and adjust this external reuse configuration.

---

Nitpick comments:
In `@package.json`:
- Around line 42-46: The `*.ts?(x)` Prettier task in package.json redundantly
combines `--parser=typescript` with `--ignore-unknown`; since the parser is
already explicit, simplify that matcher by removing the unnecessary
`--ignore-unknown` flag while keeping the TypeScript parser command intact.
Update the `*.ts?(x)` entry only, leaving the other glob patterns 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: 0a42061e-32d7-4f8a-9f4c-ecbf0b7342b2

📥 Commits

Reviewing files that changed from the base of the PR and between 8678193 and 0a06399.

📒 Files selected for processing (9)
  • .github/FUNDING.yml
  • .github/workflows/cloudflare-pages-preview.yml
  • .github/workflows/codeql.yml
  • .github/workflows/main.yml
  • .github/workflows/react-doctor.yml
  • .github/workflows/surge-preview.yml
  • README.md
  • package.json
  • vercel.json

Comment thread .github/workflows/main.yml
@afc163

afc163 commented Jun 26, 2026

Copy link
Copy Markdown
Member Author

AI review follow-up:

  • Applied Gemini suggestion by removing the redundant explicit TypeScript parser from the lint-staged Prettier command.
  • Kept react-component/rc-test/.github/workflows/test-utoo.yml@main intentionally because this standardization tracks the shared rc-test workflow on main.
  • Did not replace secrets: inherit with an explicit CODECOV_TOKEN mapping because the called test-utoo.yml currently does not declare named workflow_call secrets; that should be changed in rc-test first if we want to tighten it globally.

@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/surge-preview.yml:
- Around line 36-38: The “Skip Surge preview” step still has an incorrect
conditional and needs the same fix applied to the `if` expression used by that
step. Update the `Skip Surge preview` job step so it checks the Surge token
condition consistently with the workflow’s secret handling, and ensure the `if`
on the `Skip Surge preview` step is corrected together with the surrounding
preview logic.
- Around line 36-38: The “Skip Surge preview” workflow step is still using the
invalid secrets context in its if condition; update the step’s condition to use
the correct context pattern consistent with the rest of the workflow. Make the
same change in the Skip Surge preview step so the secret check is evaluated
without directly referencing secrets in the if expression.
- Around line 21-35: The step-level conditions in the surge-preview workflow are
using the invalid secrets context, so fix the Build preview step and the
afc163/surge-preview action to stop referencing secrets.SURGE_TOKEN directly in
their if clauses. Move SURGE_TOKEN to a job-level env and update the if checks
to use env.SURGE_TOKEN instead, keeping the existing build and surge-preview
configuration intact.
- Around line 21-35: The step-level condition in the workflow is using the
unsupported secrets context, which breaks validation for the Build preview and
surge-preview steps. Move SURGE_TOKEN to a job-level env so both the build step
and the afc163/surge-preview action can read it, then change the existing if
conditions to check the env context instead of secrets. Use the Build preview
step and afc163/surge-preview action as the places to update.

In `@README.zh-CN.md`:
- Around line 80-102: Checkbox 和 Ref 的 API 表格里把英文标识符误翻成了中文,需在 README.zh-CN.md
的相关表格中把 `风格` 改回 `style`、`价值` 改回 `value`、`模糊` 改回 `blur`、`重点` 改回
`focus`,并顺手统一这些条目的描述排版与空格;同时把“本机输入属性”改为“原生输入属性”,确保表格里的参数名与 `Checkbox`、`Ref` 里真实的
API 名称一致。
🪄 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: d89e8c11-4d1e-4576-90a5-bcf0c058fda1

📥 Commits

Reviewing files that changed from the base of the PR and between 67028d6 and c1df5f8.

📒 Files selected for processing (3)
  • .github/workflows/surge-preview.yml
  • README.md
  • README.zh-CN.md
✅ Files skipped from review due to trivial changes (1)
  • README.md

Comment thread .github/workflows/surge-preview.yml
Comment thread .github/workflows/surge-preview.yml
Comment thread README.zh-CN.md
@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/​husky@​9.0.5 ⏵ 9.1.7100 +110062 +480 +2100
Addednpm/​@​testing-library/​react@​15.0.710010010087100
Addednpm/​eslint-plugin-unicorn@​56.0.18810010095100
Addednpm/​lint-staged@​16.4.010010010097100

View full report

@socket-security

socket-security Bot commented Jun 27, 2026

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm eslint-plugin-unicorn is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: package.jsonnpm/eslint-plugin-unicorn@56.0.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/eslint-plugin-unicorn@56.0.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

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