Skip to content

Conversation

@aojunhao123
Copy link
Contributor

@aojunhao123 aojunhao123 commented Feb 26, 2025

QQ_1740544205255

Summary by CodeRabbit

  • Chores

    • 更新包名称、版本号及发布脚本,切换至新的命名空间,调整依赖及工具模块。
  • Refactor

    • 统一重构各处模块导入路径和类型声明,提升代码一致性和结构清晰度。
  • Tests

    • 更新测试文件中的模块引用,确保测试环境与整体改动保持同步。

@vercel
Copy link

vercel bot commented Feb 26, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drawer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 26, 2025 9:11am

@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2025

"""

Walkthrough

本次变更主要涉及更新多个文件中模块的导入路径,将之前指向 rc-drawerrc-utilrc-motion 的路径更新为新的作用域包 @rc-component/drawer@rc-component/util@rc-component/motion。此外,修改了 package.json 中的包名、版本号、发布脚本以及依赖配置,同时在 tsconfig.json 和模块声明中同步更新了相关路径映射。

Changes

文件 变更摘要
docs/examples/*.tsx 更新所有示例文件中 Drawer 组件及其类型的导入路径,从 rc-drawer 改为 @rc-component/drawer
package.json 修改包名为 @rc-component/drawer,版本重置为 1.0.0,更新发布脚本及依赖配置(移除旧依赖,添加新依赖)。
src/Drawer.tsx, DrawerPanel.tsx, DrawerPopup.tsx, util.ts 更新核心组件和工具函数的导入路径,由 rc-utilrc-motion 替换为 @rc-component/util@rc-component/motion
tests/index.spec.tsx, motion.spec.tsx, ssr.spec.tsx 更新测试文件中相关模块的导入路径与 mock,实现从 rc-util/rc-motion@rc-component/util/@rc-component/motion 的过渡。
tsconfig.json, typings/custom.d.ts 更新路径映射和模块声明,将旧路径(如 rc-drawerrc-util)替换为新的 @rc-component/drawer@rc-component/util

Possibly related PRs

Suggested reviewers

  • zombieJ

Poem

我是一只跳跃的小兔,
代码林间逐梦不停步,
导入路径换个新装束,
依赖更新意气风发,
版本焕然一新露锋芒,
愿软件世界春光明媚,快快前行!
"""

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

tests/ssr.spec.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

Error: Cannot read config file: /.eslintrc.js
Error: Cannot find module '@umijs/fabric/dist/eslint'
Require stack:

  • /.eslintrc.js
  • /node_modules/.pnpm/@eslint[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli-engine/cli-engine.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/eslint.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/index.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli.js
  • /node_modules/.pnpm/[email protected]/node_modules/eslint/bin/eslint.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1248:15)
    at Function.resolve (node:internal/modules/helpers:145:19)
    at Object. (/.eslintrc.js:2:21)
    at Module._compile (node:internal/modules/cjs/loader:1546:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)
    at Module._load (node:internal/modules/cjs/loader:1127:12)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e91f361 and f4d1a31.

📒 Files selected for processing (3)
  • now.json (0 hunks)
  • package.json (3 hunks)
  • tests/ssr.spec.tsx (2 hunks)
💤 Files with no reviewable changes (1)
  • now.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/ssr.spec.tsx
🔇 Additional comments (6)
package.json (6)

2-3: 包名称和版本更新
包名已从 "rc-drawer" 迁移至新的命名空间 "@rc-component/drawer",同时版本号重置为 "1.0.0"。请确保所有相关文档和模块调用都已同步更新。


39-39: 更新 prepublishOnly 脚本命令
将原先的 npm run compile && np --no-cleanup --yolo --no-publish 修改为 npm run compile && rc-np。请确认新使用的 rc-np 发布工具在当前项目中已正确安装并配置。


46-49: 依赖项迁移调整
dependencies 部分移除了旧的依赖,并引入了新的依赖项:@rc-component/motion@rc-component/portal@rc-component/util,同时保留了 classnames。请确保这些新版依赖的版本与项目代码兼容,并测试其功能。


60-61: 更新 React 类型定义
已将 @types/react@types/react-dom 升级至 ^19.0.0,确保与新版 React 的类型兼容。这对 TypeScript 项目来说是个积极调整。


75-76: 升级 React 和 ReactDOM
devDependencies 中,将 reactreact-dom 更新到了 ^19.0.0。请注意与项目其它部分的依赖兼容性,并建议运行完整的测试套件以验证无缝集成。


82-83: 调整 peerDependencies 要求
peerDependencies 中的 reactreact-dom 的最低版本要求改为 >=18.0.0,确保支持新版 React 的用户能够使用该组件。


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@socket-security
Copy link

socket-security bot commented Feb 26, 2025

New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@rc-component/[email protected] 🔁 npm/@rc-component/[email protected] None +4 121 kB zombiej
npm/@rc-component/[email protected] None 0 27.2 kB afc163, madccc, peachscript, ...1 more
npm/@types/[email protected] None 0 20.8 kB types
npm/@types/[email protected] None +1 2.05 MB types

🚮 Removed packages: npm/[email protected]

View full report↗︎

@codecov
Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (4080d9e) to head (f4d1a31).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #480   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          146       146           
  Branches        54        54           
=========================================
  Hits           146       146           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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: 0

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

39-39: 更新 prepublishOnly 脚本
脚本修改为 "npm run compile && rc-np",请验证 rc-np 工具在发布流程中的行为与之前的 np 工具保持一致,确保发布流程不受影响。

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 78ae1ba and 08dd820.

📒 Files selected for processing (3)
  • package.json (3 hunks)
  • src/Drawer.tsx (2 hunks)
  • src/DrawerPopup.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/Drawer.tsx
  • src/DrawerPopup.tsx
🔇 Additional comments (5)
package.json (5)

2-3: 更新包名称与版本信息
包名称已正确更新为 @rc-component/drawer,版本号也重置为 1.0.0。请确保所有引用此包的文档和依赖项也做相应更新。


46-49: 更新依赖项到新命名空间
将依赖项迁移到新的命名空间,包括 @rc-component/motion@rc-component/portal@rc-component/util,同时新增了 classnames。需要确认这些依赖版本满足项目需求并与其他模块兼容。


53-61: 更新开发依赖与类型定义
在 devDependencies 中已将 np 替换为 @rc-component/np 并更新了 @types/react@types/react-dom^19.0.0。这有助于保持与 React 19 相关的类型和工具链一致,请确认后续开发和 CI 流程正常运行。


75-76: 更新 React 与 React-Dom 开发版本
开发依赖中的 reactreact-dom 已更新为 ^19.0.0。虽然 peerDependencies 中要求版本为 >=18.0.0,但此处建议检查项目的兼容性和用户的使用情况,确保不会因版本差异产生潜在问题。


82-83: 审核 peerDependencies 设置
peerDependencies 中的 reactreact-dom 已更新为 >=18.0.0,与开发依赖的更新版本基本匹配。请确认用户在安装时能正确获取所需版本,防止版本冲突问题。

@afc163 afc163 changed the title chore: migrate to @rc-component namespace and update dependencies refactor: migrate to @rc-component namespace and update dependencies Feb 26, 2025
@zombieJ zombieJ self-assigned this Feb 26, 2025
@vercel
Copy link

vercel bot commented Feb 26, 2025

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

A member of the Team first needs to authorize it.

@zombieJ zombieJ merged commit 5b54804 into react-component:master Feb 26, 2025
9 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Aug 15, 2025
17 tasks
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.

2 participants