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: bump @rc-component deps #631

Merged
merged 8 commits into from
Feb 25, 2025
Merged

chore: bump @rc-component deps #631

merged 8 commits into from
Feb 25, 2025

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Feb 25, 2025

Summary by CodeRabbit

  • 重构

    • 包名称已更新为新作用域(@rc-component/tree-select)并版本升级至 1.0.0,以及相关依赖已重新整合。
    • 组件的导入路径、样式及部分配置(例如将“dropdown”属性更名为“popup”)已调整,以符合新版规范。
    • TreeSelectContextProps 接口中的属性 dropdownMatchSelectWidth 已更名为 popupMatchSelectWidth
  • 测试

    • 测试代码同步更新,确保所有用例在新依赖和 API 下均能正常运行。
    • 测试用例中涉及的属性名称已更新,以反映新的命名约定。

Copy link

vercel bot commented Feb 25, 2025

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

Name Status Preview Comments Updated (UTC)
tree-select ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 25, 2025 9:28am

Copy link

coderabbitai bot commented Feb 25, 2025

Warning

Rate limit exceeded

@zombieJ has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 23 minutes and 47 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 305de55 and 15600ea.

📒 Files selected for processing (2)
  • src/OptionList.tsx (5 hunks)
  • src/TreeSelect.tsx (7 hunks)

Walkthrough

此次更改主要集中在更新各处的模块导入路径和包配置。所有文件中原先从 rc-selectrc-util 导入的模块均已修改为从新的命名空间 @rc-component/select@rc-component/util 导入。同时,包描述文件(package.json)中更新了包名、版本、依赖项及发布脚本,测试文件中也相应调整了变量命名和属性名称。这些改动均未改变现有组件的逻辑或行为,而是统一了模块结构和名称空间。

Changes

文件 更改说明
assets/select.less 修改样式导入路径:将 @import '~rc-select/assets/index'; 改为 @import '~@rc-component/select/assets/index';
examples/form.tsx 更新 Select 组件及样式导入路径:从 rc-selectrc-select/assets/index.less 改为 @rc-component/select 对应路径。
package.json 更改包名为 @rc-component/tree-select,版本从 5.27.0 升级为 1.0.0;发布脚本更新为 rc-np;依赖中删除 rc-select@babel/runtime,添加 @rc-component/select@rc-component/util,同时更新其他依赖及开发依赖。
src/... (OptionList.tsx, TreeSelect.tsx, useDataEntities.ts, legacyUtil.tsx, warningPropsUtil.ts) 各文件中更新导入语句:将涉及 rc-selectrc-util 的路径分别修改为 @rc-component/select@rc-component/util
tests/... (Select.SearchInput.spec.js, Select.maxCount.spec.tsx, Select.multiple.spec.js, Select.props.spec.js, Select.spec.tsx, Select.tree.spec.js, Select.warning.spec.js) 测试文件中更新相关导入(如 KeyCoderesetWarned 等),同时调整变量名称(如 treeData 改为 data)和属性名称(dropdownClassName/dropdownStyle 更新为 popupClassName/popupStyle)。

Possibly related PRs

Poem

我是一只跳跃的小兔子,
在代码森林中轻轻探步,
导入路径如花般绽放,
新包名映出朝阳光芒,
欢庆更新,代码梦随心飞 🐰✨


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 25, 2025

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

🧹 Nitpick comments (1)
README.md (1)

98-98: 考虑添加逗号以提高可读性

在 "treeNodes data Array, if set it then you need not to construct children TreeNode" 这句中,可以考虑在 "if set it" 之前添加一个逗号,以提高可读性。

-| treeData                | treeNodes data Array, if set it then you need not to construct children TreeNode. (value should be unique across the whole array)                                                   | array<{value,label,children, [disabled,selectable]}>                                                                                                                                                                           | []                                |
+| treeData                | treeNodes data Array, if set it, then you need not to construct children TreeNode. (value should be unique across the whole array)                                                   | array<{value,label,children, [disabled,selectable]}>                                                                                                                                                                           | []                                |
🧰 Tools
🪛 LanguageTool

[typographical] ~98-~98: Consider adding a comma.
Context: ... | treeNodes data Array, if set it then you need not to construct children Tree...

(IF_THEN_COMMA)


[grammar] ~98-~98: Did you mean “construct”?
Context: ...data Array, if set it then you need not to construct children TreeNode. (value should be uni...

(NEEDNT_TO_DO_AND_DONT_NEED_DO)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 587709a and 305de55.

⛔ Files ignored due to path filters (1)
  • tests/__snapshots__/Select.spec.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (12)
  • README.md (1 hunks)
  • examples/basic.tsx (4 hunks)
  • examples/custom-icons.tsx (2 hunks)
  • examples/filter.tsx (1 hunks)
  • examples/width.tsx (1 hunks)
  • now.json (0 hunks)
  • src/OptionList.tsx (3 hunks)
  • src/TreeSelect.tsx (7 hunks)
  • src/TreeSelectContext.ts (1 hunks)
  • tests/Select.props.spec.js (3 hunks)
  • tests/Select.spec.tsx (2 hunks)
  • tests/Select.warning.spec.js (1 hunks)
💤 Files with no reviewable changes (1)
  • now.json
✅ Files skipped from review due to trivial changes (1)
  • examples/custom-icons.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
  • tests/Select.spec.tsx
  • src/OptionList.tsx
  • tests/Select.props.spec.js
  • src/TreeSelect.tsx
🧰 Additional context used
🪛 LanguageTool
README.md

[typographical] ~98-~98: Consider adding a comma.
Context: ... | treeNodes data Array, if set it then you need not to construct children Tree...

(IF_THEN_COMMA)


[grammar] ~98-~98: Did you mean “construct”?
Context: ...data Array, if set it then you need not to construct children TreeNode. (value should be uni...

(NEEDNT_TO_DO_AND_DONT_NEED_DO)


[uncategorized] ~103-~103: It appears that a hyphen is missing (if ‘auto’ is not used in the context of ‘cars’).
Context: ...nt.body;} | | autoClearSearchValue | auto clear search input value when multiple select...

(AUTO_HYPHEN)

🪛 markdownlint-cli2 (0.17.2)
README.md

100-100: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)

🔇 Additional comments (13)
examples/width.tsx (1)

7-7: 属性名称更新正确

dropdownMatchSelectWidth 更新为 popupMatchSelectWidth 与 PR 中的其他文件变更保持一致,这反映了组件 API 命名的统一更新。

examples/filter.tsx (1)

85-85: 样式属性名称更新正确

dropdownStyle 更新为 popupStyle 与整个代码库中的命名约定更新一致,保持了 API 的一致性。

src/TreeSelectContext.ts (1)

8-8: 接口属性名称更新正确

TreeSelectContextProps 接口中的 dropdownMatchSelectWidth 属性更新为 popupMatchSelectWidth,类型保持不变(boolean | number)。这一更改与其他文件中的命名更新保持一致。

tests/Select.warning.spec.js (1)

3-3: 依赖路径更新正确

resetWarned 的导入路径从 rc-util/lib/warning 更新为 @rc-component/util/lib/warning,这与此 PR 的目标(更新 @rc-component 依赖)一致。

README.md (4)

64-64: 命名更新从 dropdownMatchSelectWidthpopupMatchSelectWidth

属性名从 dropdownMatchSelectWidth 更新为 popupMatchSelectWidth,保持了与代码库中其他地方的命名一致性。


65-66: 下拉框类名和样式的默认值更新

dropdownClassName 的默认值从 - 更新为 ''(空字符串),dropdownStyle 的默认值从 - 更新为 {}(空对象),这更明确地表示了这些属性的默认值。


67-67: onDropdownVisibleChange 更新为 onPopupVisibleChange

属性名从 onDropdownVisibleChange 更新为 onPopupVisibleChange,并明确了默认值为 () => { return true; },使其与代码库中的其他更改保持一致。


108-108: virtual 属性添加了明确的默认值

virtual 属性的默认值从 - 更新为明确的 false,这使得文档更加清晰。

examples/basic.tsx (5)

127-135: 方法名从 onDropdownVisibleChange 重命名为 onPopupVisibleChange

方法名已从 onDropdownVisibleChange 更新为 onPopupVisibleChange,与整个代码库中的命名约定保持一致。功能保持不变。


208-213: 事件处理函数属性名更新为 onPopupVisibleChange

在 TreeSelect 组件中,事件处理函数属性从 onDropdownVisibleChange 更新为 onPopupVisibleChange,保持了与组件 API 的一致性。


262-265: 属性名从 dropdownAlign 更新为 popupAlign

配置对象属性名从 dropdownAlign 更新为 popupAlign,保持了与其他类似属性重命名的一致性。


266-266: 使用更新后的 onPopupVisibleChange 方法

TreeSelect 组件中的属性引用已更新为 onPopupVisibleChange,指向类中重命名后的方法。


330-330: 样式属性从 dropdownStyle 更新为 popupStyle

TreeSelect 组件中的样式属性从 dropdownStyle 更新为 popupStyle,保持了命名一致性。

| treeNodeLabelProp | which prop value of treeNode will render as content of select | String | 'title' |
| treeData | treeNodes data Array, if set it then you need not to construct children TreeNode. (value should be unique across the whole array) | array<{value,label,children, [disabled,selectable]}> | [] |
| treeDataSimpleMode | enable simple mode of treeData.(treeData should be like this: [{id:1, pId:0, value:'1', label:"test1",...},...], `pId` is parent node's id) | bool/object{id:'id', pId:'pId', rootPId:null} | false |
| treeTitleRender | Custom render nodes | (nodeData: OptionType) => ReactNode |
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

表格列计数不一致

此行的列数(3)与预期的列数(4)不一致,可能会导致表格格式不正确。检查是否缺少了某个单元格。


🏁 Script executed:

#!/bin/bash
# 检查表格的列计数
cat README.md | grep -A 5 "| treeTitleRender" | tr -d '\n' | grep -o "|" | wc -l

Length of output: 85


存在表格列数缺失

经过验证,README.md 中第 100 行对应的表格记录确实只包含 3 个单元格,而整个表格应保持 4 个单元格的一致性。这可能导致 Markdown 格式显示异常。建议检查该行及表格头部定义,并补充缺失的单元格以确保格式正确。

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

100-100: Table column count
Expected: 4; Actual: 3; Too few cells, row will be missing data

(MD056, table-column-count)

Copy link

codecov bot commented Feb 25, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.83%. Comparing base (23990f1) to head (15600ea).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/TreeSelect.tsx 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##            master     #631      +/-   ##
===========================================
- Coverage   100.00%   99.83%   -0.17%     
===========================================
  Files           16       16              
  Lines          598      593       -5     
  Branches       174      186      +12     
===========================================
- Hits           598      592       -6     
- Misses           0        1       +1     

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

@zombieJ zombieJ merged commit 9ffd1f0 into master Feb 25, 2025
10 of 12 checks passed
@zombieJ zombieJ deleted the bump-deps branch February 25, 2025 09:29
@coderabbitai coderabbitai bot mentioned this pull request Mar 4, 2025
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