Skip to content

fix: test#812

Merged
zombieJ merged 1 commit intoreact-component:masterfrom
aojunhao123:fix-ci
Apr 9, 2025
Merged

fix: test#812
zombieJ merged 1 commit intoreact-component:masterfrom
aojunhao123:fix-ci

Conversation

@aojunhao123
Copy link
Contributor

@aojunhao123 aojunhao123 commented Apr 8, 2025

Summary by CodeRabbit

  • Chores
    • 更新了忽略规则,调整了对部分锁定文件的处理,优化了版本控制配置。
  • Refactor
    • 统一并优化了内部分模块的引用路径,使代码结构更简洁、一致且易于维护。
  • Tests
    • 调整并简化了测试配置和工具引用,确保测试环境与更新后的依赖保持一致。

@vercel
Copy link

vercel bot commented Apr 8, 2025

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

Name Status Preview Comments Updated (UTC)
tabs ❌ Failed (Inspect) Apr 8, 2025 3:31pm

@coderabbitai
Copy link

coderabbitai bot commented Apr 8, 2025

Walkthrough

本次变更主要集中在更新各模块的导入路径,从原来的 rc-utilrc-resize-observer 修改为 @rc-component 命名空间;同时在 .gitignore 中新增忽略项 bun.lock,以及在 jest.config.js 中扩展了编译模块并简化了箭头函数语法。测试文件中也同步调整了导入路径,部分无效注释被清理。整体变更不影响功能,仅做代码路径更新和语法优化。

Changes

文件/文件组 变更摘要
.gitignore 新增忽略项 bun.lock,保留 bun.lockb
jest.config.js compileModules 数组中添加 @rc-component/resize-observer 模块;简化了 forEach 箭头函数语法。
src/TabNavList/OperationNode.tsx
src/TabNavList/index.tsx
src/Tabs.tsx
src/hooks/useAnimateConfig.ts
src/hooks/useIndicator.ts
src/hooks/useUpdate.ts
更新导入路径,从 rc-utilrc-resize-observer 改为 @rc-component 命名空间;同时 src/TabNavList/index.tsx 中移除了 ESLint 指令。
测试文件:
tests/common/util.tsx
tests/index.test.tsx
tests/mobile.test.tsx
tests/operation-overflow.test.tsx
tests/overflow.test.tsx
tests/rtl.test.tsx
更新测试文件中的导入路径(如 spyElementPrototypesKeyCodeisMobile 等),同时清除部分无效的注释代码。

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.

src/TabNavList/OperationNode.tsx

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+fabric@4.0.1_jest@29.7.0_@types+node@22.14.0__postcss@8.5.3/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.

jest.config.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+fabric@4.0.1_jest@29.7.0_@types+node@22.14.0__postcss@8.5.3/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.

src/Tabs.tsx

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+fabric@4.0.1_jest@29.7.0_@types+node@22.14.0__postcss@8.5.3/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.

  • 10 others

📜 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 db242f1 and b105c17.

📒 Files selected for processing (14)
  • .gitignore (1 hunks)
  • jest.config.js (1 hunks)
  • src/TabNavList/OperationNode.tsx (1 hunks)
  • src/TabNavList/index.tsx (1 hunks)
  • src/Tabs.tsx (1 hunks)
  • src/hooks/useAnimateConfig.ts (1 hunks)
  • src/hooks/useIndicator.ts (1 hunks)
  • src/hooks/useUpdate.ts (1 hunks)
  • tests/common/util.tsx (1 hunks)
  • tests/index.test.tsx (1 hunks)
  • tests/mobile.test.tsx (1 hunks)
  • tests/operation-overflow.test.tsx (1 hunks)
  • tests/overflow.test.tsx (1 hunks)
  • tests/rtl.test.tsx (1 hunks)
🔇 Additional comments (15)
src/hooks/useIndicator.ts (1)

1-1: 导入路径更新正确

导入路径从 rc-util/lib/raf 更新为 @rc-component/util/lib/raf,符合依赖包命名空间迁移的要求。

src/hooks/useAnimateConfig.ts (1)

1-1: 导入路径更新正确

导入路径从 rc-util/lib/warning 更新为 @rc-component/util/lib/warning,符合依赖包命名空间迁移的要求。

src/hooks/useUpdate.ts (1)

1-1: 导入路径更新正确

导入路径从 rc-util/lib/hooks/useLayoutEffect 更新为 @rc-component/util/lib/hooks/useLayoutEffect,符合依赖包命名空间迁移的要求。

src/TabNavList/OperationNode.tsx (1)

4-4: 导入路径更新正确

导入路径从 rc-util/lib/KeyCode 更新为 @rc-component/util/lib/KeyCode,符合依赖包命名空间迁移的要求。

tests/rtl.test.tsx (1)

2-2: 导入路径更新,符合新的命名空间风格

代码已经更新了spyElementPrototypes的导入路径,从rc-util/lib/test/domHook更改为@rc-component/util/lib/test/domHook,这是一个正确的变更,与项目中其他文件的路径更新保持一致。

.gitignore (1)

44-44: 增加了对bun.lock文件的忽略

添加bun.lock.gitignore是合理的,这确保了与Bun包管理器相关的锁文件不会被提交到代码库中,与其他包管理器的锁文件(如yarn.lockpackage-lock.jsonpnpm-lock.yaml)处理方式一致。

tests/index.test.tsx (1)

3-3: 导入路径更新,符合新的命名空间风格

代码已经更新了spyElementPrototypes的导入路径,从rc-util/lib/test/domHook更改为@rc-component/util/lib/test/domHook,这是一个正确的变更,与项目中其他文件的路径更新保持一致。

jest.config.js (2)

11-11: 添加了新模块到编译列表

@rc-component/resize-observer添加到compileModules数组中是合理的,这样可以确保在测试过程中该模块会被正确编译,与整个代码库从rc-resize-observer@rc-component/resize-observer的迁移保持一致。


17-18: 箭头函数语法优化

代码优化了箭头函数的语法,移除了单个参数周围的括号,使代码更加简洁,同时保持了功能的一致性。这是符合现代JavaScript风格的良好实践。

src/Tabs.tsx (1)

3-4: 更新导入路径:使用新命名空间
这里将 useMergedStateisMobile 的导入路径从旧的 rc-util 修改为新的 @rc-component/util 命名空间。请确认新路径下的模块存在并且接口保持兼容。

tests/operation-overflow.test.tsx (1)

3-3: 更新测试工具导入:调整 spyElementPrototypes 路径
spyElementPrototypes 的导入路径从 rc-util/lib/test/domHook 更新为 @rc-component/util/lib/test/domHook,与其他测试文件保持一致。

tests/overflow.test.tsx (1)

2-3: 更新 KeyCode 和 spyElementPrototypes 导入路径
KeyCodespyElementPrototypes 的导入路径分别更新为 @rc-component/util/lib/KeyCode@rc-component/util/lib/test/domHook。请确认新导入路径资源有效且与现有逻辑保持兼容。

src/TabNavList/index.tsx (1)

2-4: 更新导入路径:统一模块来源
修改了 ResizeObserveruseEventuseComposeRef 的导入路径,分别更新为 @rc-component/resize-observer@rc-component/util/lib/hooks/useEvent@rc-component/util/lib/ref。此修改仅涉及模块引用来源的调整,不影响组件功能。

tests/mobile.test.tsx (1)

9-9: 更新 isMobile 模块的模拟路径
isMobile 的模拟从旧路径调整为 @rc-component/util/lib/isMobile,确保测试环境正确模拟移动设备状态。请确认该改动后所有相关测试依旧表现正常。

tests/common/util.tsx (1)

3-4: 更新导入路径 - 符合最新命名空间要求
你已将原先从 rc-resize-observer 导入的模块更新为 @rc-component/resize-observer 命名空间,这符合目前的项目标准。请确保项目中其它相关模块和测试配置(如 jest 配置中的 compileModules)也同步更新以避免路径不匹配的问题。

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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 plan to trigger planning for file edits and PR creation.
  • @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.

@codecov
Copy link

codecov bot commented Apr 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.96%. Comparing base (db242f1) to head (b105c17).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #812   +/-   ##
=======================================
  Coverage   98.96%   98.96%           
=======================================
  Files          18       18           
  Lines         772      772           
  Branches      220      227    +7     
=======================================
  Hits          764      764           
  Misses          8        8           

☔ 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.

@zombieJ zombieJ merged commit c50337e into react-component:master Apr 9, 2025
8 of 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