-
Notifications
You must be signed in to change notification settings - Fork 280
chore: 升级icon库 #3330
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: 升级icon库 #3330
Conversation
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (17)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the Walkthrough将 package.json 中的依赖版本更新为 beta:@nutui/icons-react 升至 ^3.0.2-beta.5,@nutui/icons-react-taro 升至 ^3.0.2-beta.2。无其他文件和导出/公开 API 变更。 Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (1)
package.json
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build
- GitHub Check: test
"@nutui/icons-react": "^3.0.2-beta.5", | ||
"@nutui/icons-react-taro": "^3.0.2-beta.2", |
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.
💡 Verification agent
🧩 Analysis chain
升级到 beta OK,但建议固定预发布版本并补充验证项
- 目前使用的 caret 范围
^3.0.2-beta.*
在 npm 语义下可能在 CI/发布时解析到更新的 beta/stable 3.x,带来不可预期变更(尤其图标重命名/导出路径调整这类细小变更)。在 beta 阶段建议固定精确版本,或改用 ~ 以降低漂移风险。 - PR 描述里补充“升级动机/变更影响”更利于后续追溯:是否包含新图标、修复渲染问题、或 tree-shaking 调整等。
可以考虑如下微调(保持可回滚与可复现):
- "@nutui/icons-react": "^3.0.2-beta.5",
- "@nutui/icons-react-taro": "^3.0.2-beta.2",
+ "@nutui/icons-react": "3.0.2-beta.5",
+ "@nutui/icons-react-taro": "3.0.2-beta.2",
建议核对与冒烟:
- 核对是否存在破坏性变更:图标命名/命名导出是否一致、导入路径是否变更(例如是否仍然
import { Xxx } from '@nutui/icons-react'
/@nutui/icons-react-taro'
)、是否有移除的图标。 - 在 H5 与 Taro demo 中各做一次图标相关组件(Icon、Button+Icon 等)的冒烟。
可用以下脚本快速罗列代码库中对两个包的实际导入位置,辅助评估影响面(在仓库根目录执行):
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Direct imports from @nutui/icons-react =="
rg -nP -C2 --type=ts --type=tsx $'from\\s+[\'"]@nutui/icons-react[\'"]|require\\([\'"]@nutui/icons-react[\'"]\\)'
echo
echo "== Direct imports from @nutui/icons-react-taro =="
rg -nP -C2 --type=ts --type=tsx $'from\\s+[\'"]@nutui/icons-react-taro[\'"]|require\\([\'"]@nutui/icons-react-taro[\'"]\\)'
echo
echo "== Deep path imports (potentially breaking across versions) =="
rg -nP -C2 --type=ts --type=tsx $'@nutui/(icons-react|icons-react-taro)/'
Length of output: 266
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Search for any mention of @nutui/icons-react =="
rg -n -S "@nutui/icons-react" || true
echo
echo "== Direct import/require of @nutui/icons-react =="
rg -n -S "from\s+['\"]@nutui/icons-react['\"]|require\(['\"]@nutui/icons-react['\"]\)" || true
echo
echo "== Search for any mention of @nutui/icons-react-taro =="
rg -n -S "@nutui/icons-react-taro" || true
echo
echo "== Direct import/require of @nutui/icons-react-taro =="
rg -n -S "from\s+['\"]@nutui/icons-react-taro['\"]|require\(['\"]@nutui/icons-react-taro['\"]\)" || true
echo
echo "== Deep path imports under @nutui/(icons-react|icons-react-taro)/ =="
rg -n -S "@nutui/(icons-react|icons-react-taro)/" || true
Length of output: 93026
请固定 @nutui/icons-react / @nutui/icons-react-taro 的预发布版本并补充兼容验证
原因简述:package.json 仍使用 caret(^3.0.2-beta.*),仓库中有大量直接从这两个包导入(见下),存在安装时解析到不同 beta/3.x 版本导致导出/命名/路径变更的风险。pnpm-lock.yaml 当前已解析为 3.0.2-beta.5 / 3.0.2-beta.2,但为了可回滚与可复现,建议在 package.json 固定精确版本并在 PR 描述里说明变更动机与影响。
需要改动(最小变更建议):
- "@nutui/icons-react": "^3.0.2-beta.5",
- "@nutui/icons-react-taro": "^3.0.2-beta.2",
+ "@nutui/icons-react": "3.0.2-beta.5",
+ "@nutui/icons-react-taro": "3.0.2-beta.2",
需要关注 / 验证的代码位置(示例):
- package.json(lines 111-112)
- pnpm-lock.yaml(已包含 @nutui/[email protected] 与 @nutui/[email protected])
- 打包脚本:scripts/build.mjs (≈ line 384), scripts/build-taro.mjs (≈ line 500) — 注意这些脚本会修改 packageJson.dependencies
- 代表性直接导入(需逐项核对命名导出与路径):
- src/packages/uploader/uploader.tsx
- src/packages/uploader/uploader.taro.tsx
- src/packages/icon/demo.tsx (含 '@nutui/icons-react/dist/style_iconfont.css')
- src/packages/tabs/tabs.tsx / src/packages/tabs/tabs.taro.tsx
- src/packages/toast/Notification.tsx / src/packages/toast/toast.taro.tsx
- src/packages/tabbar/demos/h5/demo1.tsx / src/packages/tabbar/demos/taro/demo1.tsx
- 以及大量 demo/test 文件(见仓库搜索结果)
建议的最小验证清单(冒烟):
- 核对命名导出是否 unchanged(eg. import { Xxx } from '@nutui/icons-react' 仍有效)
- 核对导入路径(包括 style_iconfont.css 或 dist 下的类型声明路径)是否未变
- 在 H5 与 Taro 的若干 demo 中分别验证:Icon、Button+Icon、IconFont、Uploader 等(示例文件见上)
- 运行相关单元/快照测试(tests 引用较多 icons),确保没有断裂
如需,我可以把仓库中引用该包的文件列表导出成清单,或把 build 脚本附近的具体行贴出来供进一步评审。
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"@nutui/icons-react": "^3.0.2-beta.5", | |
"@nutui/icons-react-taro": "^3.0.2-beta.2", | |
"@nutui/icons-react": "3.0.2-beta.5", | |
"@nutui/icons-react-taro": "3.0.2-beta.2", |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat_v3.x #3330 +/- ##
=============================================
- Coverage 88.13% 88.13% -0.01%
=============================================
Files 290 291 +1
Lines 19113 19140 +27
Branches 2960 2971 +11
=============================================
+ Hits 16846 16869 +23
- Misses 2262 2266 +4
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit