-
Notifications
You must be signed in to change notification settings - Fork 267
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
Changes from all commits
e488ef3
bab59d4
783598d
4cae5eb
f134285
978ef72
12d1ef9
ff328a4
5b38d72
9ce77c4
d55d011
d234438
19e3d77
7da214f
a61eaff
e87eef0
15d3cc5
1a02395
1ebe2f4
3b0458f
8fa2d97
292ae79
40d8c1d
c069154
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
registry=https://registry.npmjs.org/ | ||
engine-strict=true | ||
strict-peer-dependencies=false | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -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", | ||||
"@nutui/touch-emulator": "^1.0.0", | ||||
"@react-spring/web": "~9.6.1", | ||||
"@use-gesture/react": "10.2.20", | ||||
|
@@ -118,7 +119,6 @@ | |||
"@commitlint/cli": "^19.0.3", | ||||
"@commitlint/config-conventional": "^19.0.3", | ||||
"@loadable/component": "^5.16.3", | ||||
"prettier-markdown-table": "^1.0.2", | ||||
"@mdx-js/mdx": "^3.0.1", | ||||
"@mdx-js/react": "^3.0.1", | ||||
"@mdx-js/rollup": "^3.0.1", | ||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. 建议:将 prettier-markdown-table 移回 devDependencies
建议按照以下方式修改: {
"dependencies": {
- "prettier-markdown-table": "^1.0.2"
},
"devDependencies": {
+ "prettier-markdown-table": "^1.0.2"
}
} 📝 Committable suggestion
Suggested change
|
||||
"react": "^18.2.0", | ||||
"react-color": "^2.19.3", | ||||
"react-dom": "^18.2.0", | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
// babel-preset-taro 更多选项和默认值: | ||
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md | ||
const replaceIcons = require('@nutui/replace-icons') | ||
const projectID = process.env.VITE_APP_PROJECT_ID | ||
|
||
module.exports = { | ||
presets: [ | ||
[ | ||
|
@@ -12,5 +15,11 @@ module.exports = { | |
], | ||
plugins: [ | ||
['@babel/plugin-transform-typescript', { allowDeclareFields: true }], | ||
], | ||
projectID === 'jmapp' && [ | ||
replaceIcons({ | ||
sourceLibrary: ['@nutui/icons-react-taro', '@nutui/icons-react'], | ||
targetLibrary: '@nutui/jdesign-icons-react-taro', | ||
}), | ||
], | ||
].filter(Boolean), | ||
Comment on lines
+18
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification 缺少必要的图标依赖项,需要添加相关依赖 检查结果显示,当前项目中缺少以下必要的依赖项:
虽然 建议在 package.json 中添加这些缺失的依赖项。 🔗 Analysis chain配置结构合理,建议验证依赖项 配置结构清晰,使用 filter(Boolean) 处理条件插件的方式很好。 请运行以下脚本验证相关依赖是否正确安装: 🏁 Scripts executedThe 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 |
||
} |
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/jdesign-icons-react-taro@1.0.6-beta.2
是测试版本,建议:@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:
Length of output: 700
Script:
Length of output: 274