Skip to content

chore: standardize repository config#328

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

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

Conversation

@afc163

@afc163 afc163 commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Redesign README around @rc-component/segmented, including badges, install, usage, API, development, and release notes.
  • Standardize repository automation with test-utoo, CodeQL, React Doctor, Vercel, Surge fallback, Funding, and Dependabot.
  • Replace old rc-segmented demo imports with the scoped package alias and remove the legacy preview workflow.

Test Plan

  • npx prettier --check --ignore-unknown README.md .dumirc.ts tsconfig.json package.json .github/dependabot.yml .github/workflows/codeql.yml .github/workflows/react-component-ci.yml .github/workflows/react-doctor.yml .github/workflows/surge-preview.yml docs/index.md docs/demo/*.tsx vercel.json
  • npm run lint
  • npm run tsc
  • npm test -- --runInBand
  • npm run compile
  • npm run build
  • npx vercel build --yes

Summary by CodeRabbit

  • 新功能

    • 文档站与预览发布流程已更新,构建产物目录改为 docs-dist,在线预览与部署体验更稳定。
    • 项目主页与示例文档已切换为新的包名称与引用方式,便于直接使用。
  • 文档

    • 全面更新了 README,补充了更完整的用法、API 说明、开发命令和发布说明。
  • 维护

    • 增加了安全扫描、测试和辅助检查的自动化流程,提升项目质量与可维护性。

Refs ant-design/ant-design#58514

@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)
segmented Ready Ready Preview, Comment Jun 27, 2026 5:15am

@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

❌ Deploy failed

PR preview ❌ Failed ❌ Failed
🔗 Preview https://react-component-segmented-preview-pr-328.surge.sh (may be unavailable)
📝 Commit941413f
🪵 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-segmented-preview-pr-328.surge.sh
           size: 34 files, 1.6 MB

   Aborted - you do not have permission to publish to react-component-segmented-preview-pr-328.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 40 minutes and 34 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: 9d7e09df-0684-402a-9456-84e8e9f48ba5

📥 Commits

Reviewing files that changed from the base of the PR and between 4331968 and 75577f2.

📒 Files selected for processing (5)
  • .github/workflows/react-component-ci.yml
  • .github/workflows/surge-preview.yml
  • README.md
  • package.json
  • tsconfig.json

Walkthrough

文档构建输出改为 docs-dist,包别名切换到 @rc-component/segmented,示例与 README 也同步更新。仓库新增 CodeQL、CI、React Doctor、Surge Preview、Funding、Vercel 和忽略配置,并移除了旧的 main/preview 工作流。

Changes

文档构建与内容迁移

Layer / File(s) Summary
构建输出与路径别名
.dumirc.ts, package.json, tsconfig.json, .gitignore, vercel.json
dumi 输出目录、包别名、TypeScript 路径、部署脚本、忽略规则和 Vercel 输出都切换到 docs-dist@rc-component/segmented
示例导入切换
docs/demo/*.tsx, docs/index.md
各 demo 和首页标题把 rc-segmented 替换为 @rc-component/segmented,并调整了相关导入顺序。
README 入门内容
README.md
README 的头部、安装/使用示例和预览链接改写为新的包名与 JSX 用法。
README API 与发布说明
README.md
README 的属性表、类型说明、开发命令和 Release 章节更新为新的字段与发布流程说明。

仓库自动化与赞助信息

Layer / File(s) Summary
CI、分析和预览工作流
.github/workflows/codeql.yml, .github/workflows/react-component-ci.yml, .github/workflows/react-doctor.yml, .github/workflows/surge-preview.yml
新增 CodeQL、复用测试、React Doctor 和 Surge Preview 工作流,配置了触发条件、权限、并发与执行步骤,并替换了旧的 main/preview 工作流配置。
赞助配置
.github/FUNDING.yml
.github/FUNDING.yml 添加了 GitHub 和 Open Collective 的赞助入口。

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • zombieJ

Poem

我是一只小兔兔,蹦进新仓库,
docs-dist 发亮,@rc-component/segmented 也跳舞。
预览、CI、医生都来报到,
胡萝卜味的提交香喷喷,
月光下我继续跑 🐇

🚥 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
Title check ✅ Passed 标题准确概括了本次对仓库配置、CI 和文档配置的统一整理。
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.

@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 75577f2.

@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.39%. Comparing base (d628c9b) to head (75577f2).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #328   +/-   ##
=======================================
  Coverage   99.39%   99.39%           
=======================================
  Files           2        2           
  Lines         164      164           
  Branches       40       42    +2     
=======================================
  Hits          163      163           
  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
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 package name from rc-segmented to @rc-component/segmented, updating aliases, demo imports, and configuration files accordingly. It also updates the documentation, adds Vercel deployment configurations, and refines build scripts. The review feedback highlights potential TypeScript resolution issues in tsconfig.json: first, missing path mappings for the newly added subpath aliases (/es and /assets), and second, the risk of breaking type-checking for temporary files by removing .dumi/**/* from the include array.

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 tsconfig.json

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

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

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

补齐 paths 里的子路径映射。

Line 19-23 现在只映射了根包,但 .dumirc.ts Line 18-20 已经同时支持了 @rc-component/segmented/es@rc-component/segmented/assets。这样会让 dumi 能解析、而 tsc/IDE 不能解析这些子路径,配置出现分叉。

建议补齐映射
   "paths": {
     "`@/`*": ["src/*"],
     "@@/*": [".dumi/tmp/*"],
-    "`@rc-component/segmented`": ["src/index.tsx"]
+    "`@rc-component/segmented`": ["src/index.tsx"],
+    "`@rc-component/segmented/es/`*": ["src/*"],
+    "`@rc-component/segmented/assets/`*": ["assets/*"]
   }
🤖 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 16 - 23, The tsconfig paths mapping is incomplete
for the package subpaths used elsewhere, so tsc and IDE resolution diverge from
dumi. Update the paths section in tsconfig.json to include the same subpath
aliases already supported in .dumirc.ts for `@rc-component/segmented/es` and
`@rc-component/segmented/assets`, alongside the existing `@rc-component/segmented`
entry, so all tooling resolves the package consistently.
.github/workflows/surge-preview.yml (1)

35-35: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

建议使用 npm ci 以保证可复现的依赖安装。

预览构建属于 CI 流程,npm ci 会严格依据 lockfile 安装,更稳定可复现。

🤖 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 at line 35, Replace the dependency
installation step in the Surge preview workflow from npm install to npm ci so
the CI build uses the lockfile and remains reproducible; update the install
command in the workflow job that runs the preview build.
🤖 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-doctor.yml:
- Around line 6-7: `react-doctor.yml` already restricts `push` to `master`, but
`react-component-ci.yml` still runs on every `push`, so align the workflow
trigger strategy by updating `on` in `react-component-ci.yml` to explicitly
filter `push` to the intended default branch, or leave it unchanged only if
full-branch execution is intentional. Use the workflow trigger block in
`react-component-ci.yml` as the primary place to make this consistency decision.

In `@README.md`:
- Around line 55-67: The README props table currently shows `options` with a
default value of `[]`, but `SegmentedProps` in `src/index.tsx` defines `options`
as required, so update the documentation entry for `options` to remove the
default and make it clear it must be provided.

---

Nitpick comments:
In @.github/workflows/surge-preview.yml:
- Line 35: Replace the dependency installation step in the Surge preview
workflow from npm install to npm ci so the CI build uses the lockfile and
remains reproducible; update the install command in the workflow job that runs
the preview build.

In `@tsconfig.json`:
- Around line 16-23: The tsconfig paths mapping is incomplete for the package
subpaths used elsewhere, so tsc and IDE resolution diverge from dumi. Update the
paths section in tsconfig.json to include the same subpath aliases already
supported in .dumirc.ts for `@rc-component/segmented/es` and
`@rc-component/segmented/assets`, alongside the existing `@rc-component/segmented`
entry, so all tooling resolves the package consistently.
🪄 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: de7695f9-ac33-4e01-9692-b3059caa2e2c

📥 Commits

Reviewing files that changed from the base of the PR and between d628c9b and 4331968.

📒 Files selected for processing (22)
  • .dumirc.ts
  • .github/FUNDING.yml
  • .github/workflows/codeql.yml
  • .github/workflows/main.yml
  • .github/workflows/preview.yml
  • .github/workflows/react-component-ci.yml
  • .github/workflows/react-doctor.yml
  • .github/workflows/surge-preview.yml
  • .gitignore
  • README.md
  • docs/demo/basic.tsx
  • docs/demo/controlled.tsx
  • docs/demo/custom-render.tsx
  • docs/demo/dynamic.tsx
  • docs/demo/html-title.tsx
  • docs/demo/name.tsx
  • docs/demo/refs.tsx
  • docs/demo/rtl.tsx
  • docs/index.md
  • package.json
  • tsconfig.json
  • vercel.json
💤 Files with no reviewable changes (2)
  • .github/workflows/main.yml
  • .github/workflows/preview.yml

Comment thread .github/workflows/react-doctor.yml
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

@socket-security

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/​cross-env@​7.0.310010010082100
Addednpm/​gh-pages@​6.3.09910010082100

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