-
Notifications
You must be signed in to change notification settings - Fork 262
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
feat(replace icon): 替换jmapp icon #2672
Conversation
滚动不可为负值,负值会导致在不需要滚动的时候,tab位置发生不可预知的顺序变化。
修复格式问题
修改格式问题
feat: 增加icon替换插件
This reverts commit 9ce77c4.
Warning Rate limit exceeded@jqroom has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 37 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. Walkthrough该拉取请求对多个配置文件进行了修改,主要是 Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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 (
|
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: 4
🧹 Outside diff range and nitpick comments (3)
.npmrc (2)
1-2
: 注意:请避免使用注释掉的配置
建议删除注释掉的registry配置,以避免混淆。保留多个registry配置可能会导致维护困难,建议只保留正在使用的配置。
-# registry=http://registry.m.jd.com/
registry=https://registry.npmjs.org/
Line range hint 13-14
: 建议:删除多余的空行
文件末尾存在多个空行,建议只保留一个空行。
engine-strict=true
strict-peer-dependencies=false
-
-
+
packages/nutui-taro-demo/babel.config.js (1)
3-4
: 建议为 projectID 添加默认值
为了避免环境变量未定义时可能出现的问题,建议添加一个默认值:
-const projectID = process.env.VITE_APP_PROJECT_ID
+const projectID = process.env.VITE_APP_PROJECT_ID || ''
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
- .npmrc (1 hunks)
- package.json (2 hunks)
- packages/nutui-taro-demo/.npmrc (1 hunks)
- packages/nutui-taro-demo/babel.config.js (2 hunks)
- packages/nutui-taro-demo/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
- packages/nutui-taro-demo/.npmrc
🔇 Additional comments (2)
.npmrc (1)
Line range hint 1-14
: 验证:确认registry可访问性
请确认所有配置的registry都是可访问的,特别是在CI/CD环境中。建议添加相关文档说明这些registry的用途和访问要求。
packages/nutui-taro-demo/package.json (1)
48-48
: 新增依赖包审查
依赖包的添加符合PR的目标。建议:
- 确认是否已在不同环境(weapp、h5等)下测试过图标替换功能
- 验证与现有的
@nutui
相关依赖的兼容性
✅ Verification successful
新增的 @nutui/replace-icons 版本与现有依赖兼容
经过验证,@nutui/[email protected] 与项目中其他 @nutui 相关依赖的版本兼容:
- @nutui/icons-react 和 @nutui/icons-react-taro 均为 ^1.0.5
- @nutui/touch-emulator 也使用了相同的主版本 ^1.0.0
此版本选择合理且安全。
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查其他@nutui包的版本兼容性
echo "检查其他@nutui包的版本:"
rg '"@nutui/[^"]+": "[^"]+"' -g 'package.json'
Length of output: 1252
.npmrc
Outdated
@jdreact:registry=http://registry.m.jd.com/ | ||
@jdtaro:registry=http://registry.m.jd.com/ | ||
@test:registry=http://registry.m.jd.com/ | ||
@ohos:registry=https://repo.harmonyos.com/npm/ | ||
@jd:registry=http://registry.m.jd.com/ | ||
@dongdesign:registry=http://registry.m.jd.com/ | ||
@nutui:registry=http://registry.m.jd.com/ |
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.
安全警告:避免使用不安全的HTTP协议
当前配置中使用了不安全的HTTP协议来访问npm registry。这可能会使包下载过程容易受到中间人攻击。建议将所有registry URL更改为HTTPS。
建议修改如下:
-@jdreact:registry=http://registry.m.jd.com/
-@jdtaro:registry=http://registry.m.jd.com/
-@test:registry=http://registry.m.jd.com/
+@jdreact:registry=https://registry.m.jd.com/
+@jdtaro:registry=https://registry.m.jd.com/
+@test:registry=https://registry.m.jd.com/
@ohos:registry=https://repo.harmonyos.com/npm/
-@jd:registry=http://registry.m.jd.com/
-@dongdesign:registry=http://registry.m.jd.com/
-@nutui:registry=http://registry.m.jd.com/
+@jd:registry=https://registry.m.jd.com/
+@dongdesign:registry=https://registry.m.jd.com/
+@nutui:registry=https://registry.m.jd.com/
📝 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.
@jdreact:registry=http://registry.m.jd.com/ | |
@jdtaro:registry=http://registry.m.jd.com/ | |
@test:registry=http://registry.m.jd.com/ | |
@ohos:registry=https://repo.harmonyos.com/npm/ | |
@jd:registry=http://registry.m.jd.com/ | |
@dongdesign:registry=http://registry.m.jd.com/ | |
@nutui:registry=http://registry.m.jd.com/ | |
@jdreact:registry=https://registry.m.jd.com/ | |
@jdtaro:registry=https://registry.m.jd.com/ | |
@test:registry=https://registry.m.jd.com/ | |
@ohos:registry=https://repo.harmonyos.com/npm/ | |
@jd:registry=https://registry.m.jd.com/ | |
@dongdesign:registry=https://registry.m.jd.com/ | |
@nutui:registry=https://registry.m.jd.com/ |
projectID === 'jmapp' && [ | ||
replaceIcons({ | ||
sourceLibrary: ['@nutui/icons-react-taro', '@nutui/icons-react'], | ||
targetLibrary: '@nutui/jdesign-icons-react-taro', | ||
}), | ||
], | ||
].filter(Boolean), |
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.
💡 Codebase verification
缺少必要的图标依赖项,需要添加相关依赖
检查结果显示,当前项目中缺少以下必要的依赖项:
@nutui/icons-react-taro
@nutui/icons-react
@nutui/jdesign-icons-react-taro
虽然 @nutui/replace-icons
已经安装(版本1.0.0),但是其他用于图标替换的依赖项都未安装。这些依赖项对于图标替换功能的正常运行是必需的。
建议在 package.json 中添加这些缺失的依赖项。
🔗 Analysis chain
配置结构合理,建议验证依赖项
配置结构清晰,使用 filter(Boolean) 处理条件插件的方式很好。
请运行以下脚本验证相关依赖是否正确安装:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 验证所需依赖是否在 package.json 中定义
# 检查替换图标相关的依赖
jq -r '.dependencies | select(
has("@nutui/replace-icons") and
has("@nutui/icons-react-taro") and
has("@nutui/icons-react") and
has("@nutui/jdesign-icons-react-taro")
)' packages/nutui-taro-demo/package.json
Length of output: 217
Script:
#!/bin/bash
# 让我们分别检查每个依赖项
echo "检查 package.json 中的依赖项:"
jq '.dependencies | {
"@nutui/replace-icons": .["@nutui/replace-icons"],
"@nutui/icons-react-taro": .["@nutui/icons-react-taro"],
"@nutui/icons-react": .["@nutui/icons-react"],
"@nutui/jdesign-icons-react-taro": .["@nutui/jdesign-icons-react-taro"]
}' packages/nutui-taro-demo/package.json
echo -e "\n检查 devDependencies 中的依赖项:"
jq '.devDependencies | {
"@nutui/replace-icons": .["@nutui/replace-icons"],
"@nutui/icons-react-taro": .["@nutui/icons-react-taro"],
"@nutui/icons-react": .["@nutui/icons-react"],
"@nutui/jdesign-icons-react-taro": .["@nutui/jdesign-icons-react-taro"]
}' packages/nutui-taro-demo/package.json
# 检查是否有相关的导入语句
echo -e "\n检查相关导入语句:"
rg -l "@nutui/(replace-icons|icons-react-taro|icons-react|jdesign-icons-react-taro)"
Length of output: 13533
@@ -184,6 +184,7 @@ | |||
"postcss-rtlcss": "^5.1.0", | |||
"postcss-scss": "^4.0.9", | |||
"prettier": "^3.2.5", | |||
"prettier-markdown-table": "^1.0.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.
建议:将 prettier-markdown-table 移回 devDependencies
prettier-markdown-table
是一个用于格式化 Markdown 表格的开发工具,不应该放在 dependencies
中。这个包只在开发过程中使用,不会在生产环境中被使用。
建议按照以下方式修改:
{
"dependencies": {
- "prettier-markdown-table": "^1.0.2"
},
"devDependencies": {
+ "prettier-markdown-table": "^1.0.2"
}
}
📝 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.
"prettier-markdown-table": "^1.0.2", |
@@ -97,6 +97,7 @@ | |||
"@babel/runtime": "^7.23.9", | |||
"@nutui/icons-react": "^1.0.5", | |||
"@nutui/icons-react-taro": "^1.0.5", | |||
"@nutui/jdesign-icons-react-taro": "1.0.6-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.
💡 Codebase verification
建议谨慎评估依赖版本选择
从 package.json 中可以看到项目已经在使用 @nutui/icons-react
和 @nutui/icons-react-taro
的稳定版本(1.0.5)。新添加的 @nutui/[email protected]
是测试版本,建议:
- 考虑继续使用现有的稳定版本图标库
- 或等待
@nutui/jdesign-icons-react-taro
发布正式版本后再引入 - 如果必须使用测试版,请确保进行充分的兼容性测试
🔗 Analysis chain
注意:使用测试版依赖可能存在风险
新添加的依赖 @nutui/jdesign-icons-react-taro
当前使用的是测试版本 (1.0.6-beta.2)。在生产环境中使用测试版本可能会带来不稳定性。建议:
- 等待正式版本发布后再升级
- 或者在使用前进行充分的测试验证
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# 检查是否有正式版本可用
npm view @nutui/jdesign-icons-react-taro versions
Length of output: 700
Script:
#!/bin/bash
# Check if the package is used in the codebase and how it's used
rg -l "@nutui/jdesign-icons-react-taro" --type js --type jsx --type ts --type tsx
# Check if there are any other icon-related packages in package.json
rg "\"@.*icon.*\":" package.json
Length of output: 274
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
新功能
nutui-taro-demo
包添加了新的.npmrc
配置文件,支持多种注册表设置。@nutui/nutui-taro-demo
项目中添加了@nutui/replace-icons
依赖。依赖更新
@nutui/nutui-react-taro
项目中添加了@nutui/jdesign-icons-react-taro
依赖。prettier-markdown-table
依赖的管理方式。配置修改
replaceIcons
插件的功能。