-
-
Notifications
You must be signed in to change notification settings - Fork 252
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: update dependencies and import paths to @rc-component packages dependencies #756
Conversation
""" Walkthrough本次提交主要对文档、示例、源码和测试文件进行了格式调整与依赖迁移。主要改动包括:更新 README 中兼容性表格格式及 API 描述;示例和源码文件中,将各模块的导入路径从旧包(如 Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (4)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎
|
There was a problem hiding this 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 (2)
src/utils/commonUtil.ts (2)
16-16
: 建议改进临时键的前缀命名当前使用的
tmp_key-
前缀较为简单,建议使用更具描述性的前缀以提高代码可读性。建议修改为:
- eventKey = `tmp_key-${[...keyPath, index].join('-')}`; + eventKey = `menu_item_key-${[...keyPath, index].join('-')}`;
21-23
: 建议增强开发环境警告信息当前的警告实现仅设置了
warnKey
标志,建议添加更详细的警告信息以帮助开发者快速定位问题。建议修改为:
if (process.env.NODE_ENV !== 'production' && emptyKey) { - cloneProps.warnKey = true; + cloneProps.warnKey = { + message: '菜单项缺少 key 或 eventKey 属性', + path: keyPath.join(' > '), + index + }; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (24)
README.md
(2 hunks)docs/examples/antd.tsx
(1 hunks)docs/examples/debug.tsx
(1 hunks)docs/examples/rtl-antd.tsx
(2 hunks)package.json
(1 hunks)src/Menu.tsx
(1 hunks)src/MenuItem.tsx
(1 hunks)src/MenuItemGroup.tsx
(1 hunks)src/SubMenu/InlineSubMenuList.tsx
(2 hunks)src/SubMenu/PopupTrigger.tsx
(1 hunks)src/SubMenu/index.tsx
(1 hunks)src/context/MenuContext.tsx
(1 hunks)src/hooks/useAccessibility.ts
(3 hunks)src/hooks/useKeyRecords.ts
(1 hunks)src/hooks/useUUID.ts
(1 hunks)src/utils/commonUtil.ts
(1 hunks)src/utils/motionUtil.ts
(1 hunks)src/utils/warnUtil.ts
(1 hunks)tests/Focus.spec.tsx
(1 hunks)tests/Keyboard.spec.tsx
(1 hunks)tests/Menu.spec.tsx
(3 hunks)tests/MenuItem.spec.tsx
(1 hunks)tests/Responsive.spec.tsx
(1 hunks)tests/SubMenu.spec.tsx
(1 hunks)
✅ Files skipped from review due to trivial changes (20)
- src/utils/warnUtil.ts
- src/utils/motionUtil.ts
- src/SubMenu/InlineSubMenuList.tsx
- src/MenuItemGroup.tsx
- src/SubMenu/index.tsx
- src/hooks/useKeyRecords.ts
- tests/Responsive.spec.tsx
- tests/SubMenu.spec.tsx
- tests/Focus.spec.tsx
- docs/examples/antd.tsx
- src/hooks/useUUID.ts
- tests/MenuItem.spec.tsx
- docs/examples/debug.tsx
- src/SubMenu/PopupTrigger.tsx
- src/context/MenuContext.tsx
- tests/Keyboard.spec.tsx
- src/MenuItem.tsx
- docs/examples/rtl-antd.tsx
- src/hooks/useAccessibility.ts
- src/Menu.tsx
🔇 Additional comments (9)
src/utils/commonUtil.ts (1)
1-1
: 导入路径更新符合预期!从
rc-util
迁移到@rc-component/util
的更改与 PR 的目标保持一致。tests/Menu.spec.tsx (3)
4-5
: 更新了依赖包的导入路径导入路径从 rc-util 更新为 @rc-component/util,这是一个正确的改动,与 package.json 中的依赖更新保持一致。
23-25
: 更新了 mock 模块的导入路径将 rc-motion 的 mock 更新为 @rc-component/motion,这个改动与依赖更新保持一致。
336-340
: 类型断言语法优化将类型断言的语法从
(x as unknown) as T
简化为x as unknown as T
,这是一个更简洁的写法。package.json (3)
40-40
: 更新了发布前脚本将发布前脚本从
np --yolo --no-publish
更新为rc-np
,这与新增的@rc-component/np
依赖相匹配。
47-50
: 更新了核心依赖包新增了以下 @rc-component 系列依赖:
- @rc-component/motion: ^1.1.4
- @rc-component/trigger: ^3.0.0
- @rc-component/util: ^1.0.0
这些更新与代码中的导入路径变更保持一致。
55-55
: 新增了发布工具依赖新增了
@rc-component/np
依赖,用于替代原有的np
包,这与发布脚本的更新相对应。README.md (2)
58-59
: 改进了兼容性表格的格式优化了表格分隔符的格式,提高了文档的可读性。
175-175
: 更新了 openAnimation 属性的文档将文档中的 rc-motion 引用更新为 @rc-component/motion,保持与依赖更新的一致性。
There was a problem hiding this 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)
README.md (1)
170-170
: API 描述更新确认:引用更新正确
第170行已将openAnimation
属性的描述中原先的 “rc-motion” 更新为 “@rc-component/motion”。建议进一步优化描述文本,例如更改为“在子菜单打开或关闭时应用动画效果;详细对象类型请参见 @rc-component/motion 文档。” 以增强语句流畅性和清晰度。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.prettierrc
(1 hunks)README.md
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- .prettierrc
🧰 Additional context used
🪛 LanguageTool
README.md
[style] ~7-~7: Using many exclamation marks might seem excessive (in this case: 4 exclamation marks for a text that’s 2227 characters long)
Context: ...u [![NPM version][npm-image]][npm-url] [![npm download][download-image]][download-url] [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![bundle size][bundlephobia-image]][bundl...
(EN_EXCESSIVE_EXCLAMATION)
🔇 Additional comments (1)
README.md (1)
7-7
: 徽章展示格式调整:确认单行显示徽章
目前第7行中将所有徽章放在了一行,这可以让 README 看起来更加紧凑。但请确认各个徽章之间有足够空白分隔以保证可读性。🧰 Tools
🪛 LanguageTool
[style] ~7-~7: Using many exclamation marks might seem excessive (in this case: 4 exclamation marks for a text that’s 2227 characters long)
Context: ...u [![NPM version][npm-image]][npm-url] [![npm download][download-image]][download-url] [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![bundle size][bundlephobia-image]][bundl...(EN_EXCESSIVE_EXCLAMATION)
不应该等 #745 先合并吗? |
一样的,两个合完再发。 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #756 +/- ##
=======================================
Coverage 99.59% 99.59%
=======================================
Files 27 27
Lines 738 738
Branches 202 202
=======================================
Hits 735 735
Misses 3 3 ☔ View full report in Codecov by Sentry. |
Summary by CodeRabbit