Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use rc-component/util #917

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

chore: use rc-component/util #917

wants to merge 2 commits into from

Conversation

li-jia-nan
Copy link
Member

@li-jia-nan li-jia-nan commented Jan 21, 2025

Summary by CodeRabbit

  • 依赖更新

    • rc-motionrc-util 迁移到 @rc-component/motion@rc-component/util
    • 更新了多个文件中的导入路径,包括测试和源代码文件
  • 项目配置

    • 更新了 package.json 中的依赖项
    • 修改了 .gitignore 文件的忽略规则
  • 测试和文档

    • 相关测试文件和示例文档已同步更新导入路径

这些更改主要涉及库依赖的重构和路径调整,不会对组件的核心功能产生显著影响。

Copy link

vercel bot commented Jan 21, 2025

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

Name Status Preview Comments Updated (UTC)
tree ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 21, 2025 11:29pm

Copy link

coderabbitai bot commented Jan 21, 2025

概述

演练

此次拉取请求主要涉及从 rc-utilrc-motion 库迁移到 @rc-component/util@rc-component/motion 库。更改包括更新多个文件中的导入语句,将依赖项从旧的库路径更改为新的作用域包路径。这些更改不会显著改变代码的功能,主要是依赖项和导入路径的重构。

变更

文件 变更摘要
.gitignore 添加 pnpm-lock.yaml,排除特定目录
package.json 更新依赖项,移除 rc-motionrc-util,添加 @rc-component/motion@rc-component/util
src/*tests/* 更新导入路径,从 rc-util/librc-motion 迁移到 @rc-component/util/lib@rc-component/motion

可能相关的 PR

建议的审阅者

  • MadCcc
  • afc163

诗歌

🐰 代码迁移,兔子欢跳
库名变换,依赖重构
路径更新,功能如初
轻松优雅,兔子微笑
开源世界,精彩无限 🌈


📜 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 c157a57 and fd1205b.

📒 Files selected for processing (16)
  • .gitignore (2 hunks)
  • docs/examples/animation.jsx (1 hunks)
  • package.json (1 hunks)
  • src/MotionTreeNode.tsx (1 hunks)
  • src/NodeList.tsx (1 hunks)
  • src/Tree.tsx (1 hunks)
  • src/TreeNode.tsx (1 hunks)
  • src/useUnmount.ts (1 hunks)
  • src/util.tsx (1 hunks)
  • src/utils/conductUtil.ts (1 hunks)
  • src/utils/treeUtil.ts (1 hunks)
  • tests/Accessibility.spec.tsx (1 hunks)
  • tests/Tree.spec.tsx (1 hunks)
  • tests/TreeDraggable.spec.tsx (1 hunks)
  • tests/TreeMotion.spec.tsx (1 hunks)
  • tests/TreeProps.spec.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (13)
  • src/useUnmount.ts
  • src/MotionTreeNode.tsx
  • src/utils/conductUtil.ts
  • tests/Accessibility.spec.tsx
  • src/NodeList.tsx
  • tests/TreeMotion.spec.tsx
  • tests/TreeProps.spec.tsx
  • src/TreeNode.tsx
  • src/util.tsx
  • tests/TreeDraggable.spec.tsx
  • tests/Tree.spec.tsx
  • src/Tree.tsx
  • src/utils/treeUtil.ts
🔇 Additional comments (4)
docs/examples/animation.jsx (1)

2-2: 导入语句更新正确!

rc-motion 迁移到 @rc-component/motion 的更改符合预期。

.gitignore (1)

25-25: Git 忽略规则更新合理!

  • 添加 pnpm-lock.yaml 符合包管理最佳实践
  • 保留 tests/__mocks__/@rc-component/util/lib 目录对于测试新依赖项是必要的

Also applies to: 36-36

package.json (2)

52-58: 依赖项更新看起来合理!

成功将 rc-motionrc-util 替换为 @rc-component/motion@rc-component/util


54-55: 建议验证新包的兼容性

请确保新的依赖包 @rc-component/motion@^1.0.0@rc-component/util@^1.2.0 与现有代码完全兼容。

运行以下脚本来验证导入的兼容性:

✅ Verification successful

新包依赖迁移已完成且兼容性良好

代码库中已完全迁移到新的 @rc-component 包:

  • src/MotionTreeNode.tsx 正确使用了 @rc-component/motion@rc-component/util
  • docs/examples/animation.jsx 中也更新了相应的导入

未发现任何遗留的旧包引用,迁移完整且一致。

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 检查是否所有的 rc-motion 和 rc-util 导入都已更新
rg -l 'from\s+['"'"'"]rc-(motion|util)' 

# 检查新包的导出是否与旧包一致
ast-grep --pattern 'import { $_ } from "@rc-component/motion"'
ast-grep --pattern 'import { $_ } from "@rc-component/util"'

Length of output: 168


Script:

#!/bin/bash
# 搜索旧包的引用
echo "=== 查找旧包引用 ==="
rg "from 'rc-motion'" -l
rg "from 'rc-util'" -l

# 搜索新包的引用
echo -e "\n=== 查找新包引用 ==="
rg "from '@rc-component/motion'" -l
rg "from '@rc-component/util'" -l

# 检查具体的导入内容
echo -e "\n=== 检查具体导入内容 ==="
rg "from '(rc-motion|rc-util|@rc-component/motion|@rc-component/util)'" -A 1

Length of output: 722

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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. (Beta)
  • @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.

Copy link

socket-security bot commented Jan 21, 2025

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

Package New capabilities Transitives Size Publisher
npm/@rc-component/[email protected] None 0 87.5 kB zombiej
npm/@rc-component/[email protected] environment +1 202 kB zombiej
npm/[email protected] 🔁 npm/[email protected] Transitive: environment +50 9.81 MB aaronabramov, jeysal, jsonp, ...6 more
npm/[email protected] Transitive: environment, filesystem, shell +26 6.21 MB sindresorhus
npm/[email protected] environment, filesystem Transitive: eval, shell, unsafe +65 10.3 MB eslintbot
npm/[email protected] Transitive: environment, eval, filesystem, network, shell, unsafe +232 546 MB yifankakaxi
npm/[email protected] filesystem, shell Transitive: environment +24 848 kB tschaub
npm/[email protected] 🔁 npm/[email protected] None +3 528 kB isaacs
npm/[email protected] None 0 4.04 kB typicode
npm/[email protected] 🔁 npm/[email protected] Transitive: environment +2 2.95 MB cloudhead, lukeapage, matthew-dean, ...2 more
npm/[email protected] Transitive: environment, filesystem, shell +13 546 kB okonet
npm/[email protected] Transitive: environment, filesystem, shell +27 2.13 MB sindresorhus
npm/[email protected] None 0 7.83 MB prettier-bot
npm/[email protected] environment +3 451 kB afc163
npm/[email protected] environment, filesystem Transitive: eval, shell, unsafe +64 13.9 MB afc163
npm/[email protected] Transitive: environment +2 323 kB zombiej
npm/[email protected] Transitive: environment +3 517 kB zombiej
npm/[email protected] environment +2 414 kB zombiej
npm/[email protected] 🔁 npm/[email protected] None 0 0 B
npm/[email protected] None 0 0 B
npm/[email protected] None 0 22.7 MB typescript-bot

View full report↗︎

Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.84%. Comparing base (c157a57) to head (fd1205b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #917   +/-   ##
=======================================
  Coverage   99.84%   99.84%           
=======================================
  Files          14       14           
  Lines        1275     1275           
  Branches      383      392    +9     
=======================================
  Hits         1273     1273           
  Misses          2        2           

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

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