Skip to content

Conversation

@EmilyyyLiu
Copy link
Contributor

@EmilyyyLiu EmilyyyLiu commented Sep 28, 2025

迁移rc-upload 到 @rc-component 空间

Summary by CodeRabbit

  • 文档
    • 更新 README、站点标题与所有示例,示例与用法中的导入路径改为 @rc-component/upload;示例说明与用法文本进行了少量调整。
  • 重构
    • 构建配置与 TypeScript 路径别名从旧包名迁移至 @rc-component/upload,相关引用同步更新。
  • 杂务
    • 包名改为 @rc-component/upload 且版本重置为 1.0.0;发布脚本与依赖项调整;移除旧部署配置(now.json)。

@vercel
Copy link

vercel bot commented Sep 28, 2025

Someone is attempting to deploy a commit to the React Component Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Sep 28, 2025

Warning

Rate limit exceeded

@EmilyyyLiu has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 52 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 61ffe3c and 60bd5c5.

📒 Files selected for processing (4)
  • README.md (5 hunks)
  • src/AjaxUploader.tsx (1 hunks)
  • src/attr-accept.ts (1 hunks)
  • tests/uploader.spec.tsx (1 hunks)

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

该变更将包名与导入路径从 rc-upload 统一迁移为 @rc-component/upload,同步更新文档示例、README、Dumi/TS 路径别名与依赖;调整发布脚本与部分工具依赖;移除 now.json 部署配置。

Changes

Cohort / File(s) Change Summary
包与依赖元数据
package.json
将包名改为 @rc-component/upload,版本变更为 1.0.0;prepublishOnly 改为 rc-np;移除 np@babel/runtime,添加/替换为 @rc-component/* 相关依赖(如 @rc-component/util)。
Dumi / 项目别名配置
.dumirc, tsconfig.json
将别名 rc-upload / rc-upload/es 替换为 @rc-component/upload / @rc-component/upload/es(指向 src);重排/精简 TS paths 与 include 格式。
文档与示例导入路径
docs/examples/*
docs/examples/asyncAction.tsx, .../beforeUpload.tsx, .../customRequest.tsx, .../directoryUpload.tsx, .../drag.tsx, .../dragDirectory.tsx, .../paste.tsx, .../pasteDirectory.tsx, .../simple.tsx
所有示例将 import ... from 'rc-upload' 更新为 import ... from '@rc-component/upload';代码逻辑未变。
顶层文档与站点元信息
README.md, docs/index.md
README 标题、徽章、npm 链接与示例中的包名更新为 @rc-component/upload;docs 首页 title 同步更新,少量排版/文案微调。
源码依赖路径调整
src/AjaxUploader.tsx, src/attr-accept.ts
将对 rc-util 的导入替换为 @rc-component/util(例如 pickAttrswarning 的导入路径变更),不改动业务逻辑。
测试调整
tests/uploader.spec.tsx
将测试中对 warning 工具的导入路径从 rc-util 替换为 @rc-component/util,测试逻辑不变。
部署配置移除
now.json
删除 Now 部署配置内容(文件内容被移除)。

Sequence Diagram(s)

(未生成 — 变更仅为包名/导入/配置迁移,控制流无显著变化)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • zombieJ

Poem

我把旧名换新衣,跳过草丛去晒太阳,
导入路径排成行,示例文档齐步忙。
小包换上新徽章,发布脚本轻声响,
云端配置风中散,胡萝卜香更香。 🐰✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed 标题使用了常见的 chore 前缀,并准确描述了将包迁移到 @rc-component 命名空间这一主变更,简洁且清晰地传达了本次 PR 的核心意图。
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

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 and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @EmilyyyLiu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request undertakes a comprehensive migration of the rc-upload package to the @rc-component namespace. The changes encompass updating the package's identifier, adjusting all relevant import statements and aliases across the codebase, and modifying build and publishing processes to integrate seamlessly with the new organizational structure. This ensures that the project adheres to the @rc-component naming conventions and leverages its associated tooling, while also bumping the package version to 1.0.0 to signify this significant change.

Highlights

  • Package Namespace Migration: The primary change involves migrating the rc-upload package to the @rc-component/upload namespace, affecting package naming, import paths, and internal aliases.
  • Configuration and Dependency Updates: Build configurations (.dumirc, tsconfig.json), publishing scripts (package.json), and dependencies (e.g., rc-util to @rc-component/util) have been updated to reflect the new namespace and align with the @rc-component ecosystem.
  • Documentation and Examples Alignment: All documentation and code examples have been updated to use the new @rc-component/upload import paths, ensuring consistency with the migrated package.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@socket-security
Copy link

socket-security bot commented Sep 28, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​rc-component/​np@​1.0.4701006684100
Updated@​rc-component/​father-plugin@​1.1.0 ⏵ 2.1.382 +310077 +187100
Added@​rc-component/​util@​1.3.010010010090100

View full report

@codecov
Copy link

codecov bot commented Sep 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.03%. Comparing base (c1ecf49) to head (60bd5c5).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #662   +/-   ##
=======================================
  Coverage   89.03%   89.03%           
=======================================
  Files           6        6           
  Lines         301      301           
  Branches       78       82    +4     
=======================================
  Hits          268      268           
  Misses         33       33           

☔ View full report in Codecov by Sentry.
📢 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.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

本次 PR 主要将 rc-upload 迁移到 @rc-component 命名空间下,并更新了相关依赖。整体代码变更方向正确,但在 README.md 文件中,部分链接和标题仍指向旧的包名,建议进行修正以保证文档的准确性。

@yoyo837
Copy link
Member

yoyo837 commented Sep 28, 2025

直接在这个里面classNames换clsx?

Copy link

@coderabbitai coderabbitai bot left a comment

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)
package.json (4)

20-22: 补充 types 字段,提升 TS 消费者体验

father 会输出声明文件,但未显式声明 types。建议指向 ES 入口的 d.ts。

   "main": "./lib/index",
   "module": "./es/index",
+  "types": "./es/index.d.ts",

32-32: 移除遗留的 now 构建脚本

now.json 已删除,now-build 脚本可一并移除,避免混淆。

-    "now-build": "npm run docs:build",

33-33: 发布流程小提示

prepublishOnly 里使用 rc-np 已对齐组织内规范。若仓库启用 CI 自动发布,建议在 README/CONTRIBUTING 中注明发布方式与需要的 NPM Token 权限,降低维护成本。


40-42: 关于 classnamesclsx 的迁移建议

本 PR 目前只需保留对 classnames 的依赖,后续另起 PR 全量切换至官方 clsx 包;若决定本次合并一并升级,请将 src/AjaxUploader.tsx 第 2 行

-import clsx from 'classnames';
+import clsx from 'clsx';

替换并验证行为一致。

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c1ecf49 and 61ffe3c.

📒 Files selected for processing (15)
  • .dumirc (1 hunks)
  • README.md (5 hunks)
  • docs/examples/asyncAction.tsx (1 hunks)
  • docs/examples/beforeUpload.tsx (1 hunks)
  • docs/examples/customRequest.tsx (1 hunks)
  • docs/examples/directoryUpload.tsx (1 hunks)
  • docs/examples/drag.tsx (1 hunks)
  • docs/examples/dragDirectory.tsx (1 hunks)
  • docs/examples/paste.tsx (1 hunks)
  • docs/examples/pasteDirectory.tsx (1 hunks)
  • docs/examples/simple.tsx (1 hunks)
  • docs/index.md (1 hunks)
  • now.json (0 hunks)
  • package.json (2 hunks)
  • tsconfig.json (1 hunks)
💤 Files with no reviewable changes (1)
  • now.json
🔇 Additional comments (12)
docs/examples/directoryUpload.tsx (1)

4-4: 导入路径更新👍
顺利切换到 @rc-component 上传组件命名空间,此处示例可继续正常运行。

docs/examples/pasteDirectory.tsx (1)

3-3: 导入重命名已对齐
示例同步指向新包,保持与仓库其余部分一致,无需额外改动。

docs/examples/drag.tsx (1)

3-3: 导入路径迁移确认
这里的替换与整体迁移策略一致,示例逻辑不受影响。

docs/examples/simple.tsx (1)

3-3: 类型与组件导入同步良好
UploadUploadProps 一并指向新命名空间,类型推断依旧可用。

docs/examples/dragDirectory.tsx (1)

3-3: 导入替换完成
示例中的组件来源已成功对接 @rc-component/upload,与其他文件保持一致。

docs/examples/asyncAction.tsx (1)

3-3: 导入路径更新 OK

异步 action 示例仅变更路径,无行为改动。与 tsconfig/dumi alias 一致即可。

docs/examples/beforeUpload.tsx (1)

4-4: 示例导入路径已切换至 @rc-component/upload
所有示例均已更新,无“rc-upload”导入残留。请本地运行 dumi 文档以验证示例编译通过。

tsconfig.json (1)

11-13: alias 已同步更新 .dumirc 配置中未发现 rc-upload,已全部替换为 @rc-component/upload,无需额外修改。

docs/examples/paste.tsx (1)

3-3: 无遗留 rc-upload 模块导入

已使用 ripgrep 验证仓库内所有 .js/.jsx/.ts/.tsx 文件,不存在 from 'rc-upload'require('rc-upload') 的引用,可安心合并。

.dumirc (1)

6-7: 命名空间别名更新合理
Line 6-7 的 alias 已和新的包名保持一致,示例与文档依赖能够顺利解析到源码路径,符合本次迁移目标。

docs/index.md (1)

1-3: 文档标题同步正确
Line 2 的标题更新与包名迁移保持一致,可确保 dumi 站点展示的新名称。

docs/examples/customRequest.tsx (1)

4-4: 示例组件引用已更新
Line 4 的导入路径已经切换到新命名空间,示例可直接复用无需额外改动。

@socket-security
Copy link

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
buffer-okam@4.9.2 has Obfuscated code.

Confidence: 0.96

Location: Package overview

From: ?npm/buffer-okam@4.9.2

ℹ 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/buffer-okam@4.9.2. 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.

Warn High
buffer@4.9.2 has Obfuscated code.

Confidence: 0.96

Location: Package overview

From: ?npm/buffer@4.9.2

ℹ 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/buffer@4.9.2. 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

@zombieJ zombieJ merged commit 2e160a2 into react-component:master Sep 28, 2025
6 of 7 checks passed
@EmilyyyLiu EmilyyyLiu deleted the migrate-rcComponent branch September 28, 2025 08:19
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.

3 participants