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(deps): update RC component dependencies #514

Merged
merged 3 commits into from
Feb 18, 2025

Conversation

aojunhao123
Copy link
Contributor

@aojunhao123 aojunhao123 commented Feb 18, 2025

Summary by CodeRabbit

  • Chores
    • 更新了项目的依赖项,替换了一部分旧组件,引入了更新的依赖,进一步提升了系统的稳定性与兼容性,为后续的功能扩展打下坚实基础。
    • 添加了对 .vscode 文件夹的忽略规则。

Copy link

coderabbitai bot commented Feb 18, 2025

Walkthrough

在 @rc-component/trigger 包的 package.json 文件中,对依赖项进行了调整。修改内容包括移除旧依赖(@babel/runtime、classnames、rc-motion、rc-resize-observer、rc-util)以及添加新依赖(@rc-component/motion、@rc-component/resize-observer、@rc-component/util)。此外,.gitignore 文件中新增了对 .vscode 的忽略条目。多个示例文件中的 Trigger 组件导入路径也进行了更新,反映了包结构的变化。整体更改主要集中在依赖项和导入路径的更新,无其他业务逻辑或流程相关修改。

Changes

文件 更改说明
package.json 移除:@babel/runtime@^7.23.2, classnames@^2.3.2, rc-motion@^2.0.0, rc-resize-observer@^1.3.1, rc-util@^5.44.0
添加:@rc-component/motion@^1.1.4, @rc-component/resize-observer@^1.0.0, @rc-component/util@^1.2.1
.gitignore 新增:.vscode
docs/examples/*.tsx 导入路径更新:从 'rc-trigger' 改为 '@rc-component/trigger'(在多个示例文件中)
src/Popup/Mask.tsx 导入路径更新:从 'rc-motion' 改为 '@rc-component/motion'
src/Popup/index.tsx 导入路径更新:从 'rc-motion' 和 'rc-util' 改为 '@rc-component'(多个导入)
src/TriggerWrapper.tsx 导入路径更新:从 'rc-util/lib/ref' 改为 '@rc-component/util/lib/ref'
src/hooks/*.ts 导入路径更新:从 'rc-util' 改为 '@rc-component/util'(多个导入)
src/index.tsx 导入路径更新:从 'rc-motion' 和 'rc-util' 改为 '@rc-component'(多个导入),并移除 TriggerProps 接口中的 getDocument 属性
src/interface.ts 导入路径更新:从 'rc-motion' 改为 '@rc-component/motion'
tests/*.test.jsx 导入路径更新:从 'rc-util/lib/test/domHook' 和 'rc-resize-observer' 改为 '@rc-component/util/lib/test/domHook' 和 '@rc-component/resize-observer'(多个测试文件)
tsconfig.json 路径映射更新:从 "rc-trigger" 改为 "@rc-component/trigger"

Suggested reviewers

  • zombieJ
  • afc163

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/setup.js

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-react".

(The package "eslint-plugin-react" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-react@latest --save-dev

The plugin "eslint-plugin-react" was referenced from the config file in ".eslintrc.js » /node_modules/.pnpm/@umijs[email protected][email protected]/node_modules/@umijs/fabric/dist/eslint.js".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.

✨ 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 Feb 18, 2025

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

Package New capabilities Transitives Size Publisher
npm/@rc-component/[email protected] None 0 88.8 kB zombiej
npm/@rc-component/[email protected] environment 0 33.4 kB zombiej
npm/@rc-component/[email protected] environment +1 202 kB zombiej

🚮 Removed packages: npm/[email protected]

View full report↗︎

Copy link

codecov bot commented Feb 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.71%. Comparing base (f6e5e85) to head (52a1c1e).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #514   +/-   ##
=======================================
  Coverage   97.71%   97.71%           
=======================================
  Files          13       13           
  Lines         788      788           
  Branches      231      235    +4     
=======================================
  Hits          770      770           
  Misses         18       18           

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

@@ -64,15 +64,14 @@
"typescript": "^5.1.6"
},
"dependencies": {
"@babel/runtime": "^7.23.2",
"@rc-component/motion": "^1.1.4",
Copy link
Member

Choose a reason for hiding this comment

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

依赖变了,代码里也要变的~

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)
tests/setup.js (1)

4-10: ResizeObserver 模拟实现看起来不错!

模拟实现包含了 ResizeObserver 所需的所有必要方法(observe、unobserve 和 disconnect),这对于测试环境来说是足够的。

不过建议添加一些注释来说明这个模拟实现的用途。

建议添加如下注释:

+// 为测试环境模拟 ResizeObserver 接口
+// 由于 jsdom 环境中不存在 ResizeObserver,
+// 我们需要提供一个基础实现来避免测试报错
 global.ResizeObserver = jest.fn(() => {
     return {
         observe() { },
         unobserve() { },
         disconnect() { },
     };
 });
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f1730f9 and 52a1c1e.

📒 Files selected for processing (1)
  • tests/setup.js (1 hunks)

@zombieJ zombieJ merged commit b1a3dd3 into react-component:master Feb 18, 2025
9 checks passed
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