Skip to content

Commit

Permalink
feat(replace icon): 替换jmapp icon (#2672)
Browse files Browse the repository at this point in the history
* Update infiniteloading.taro.tsx

* Update infiniteloading.tsx

* fix(tabs.taro.tsx): 解决在不需要滚动的时候,切换tab产生tab位置错乱的问题

滚动不可为负值,负值会导致在不需要滚动的时候,tab位置发生不可预知的顺序变化。

* fix(tabs.taro.tsx): 解决页面元素不需要滚动时,切换tab,tab顺序发生不可预知的变化的问题

* Update tabs.taro.tsx

修复格式问题

* Update tabs.taro.tsx

修改格式问题

* feat: 增加 demo 场景

* feat: 增加icon替换插件

* feat: 增加sourceLibrary参数配置

* feat: 增加lock file

* feat: 修改包路径

* Revert "feat: 增加 demo 场景"

This reverts commit 9ce77c4.

* feat(babel.config.js): 只替换jmapp

* feat(npmrc): 修改npm源

* feat: 同步pnpm lock

* feat: 调整版本号@nutui/replace-icons

* feat: 移除子目录的npmrc
  • Loading branch information
jqroom authored Oct 29, 2024
1 parent c0b757c commit 61f6431
Show file tree
Hide file tree
Showing 5 changed files with 5,191 additions and 3,127 deletions.
1 change: 1 addition & 0 deletions .npmrc
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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -184,6 +184,7 @@
"postcss-rtlcss": "^5.1.0",
"postcss-scss": "^4.0.9",
"prettier": "^3.2.5",
"prettier-markdown-table": "^1.0.2",
"react": "^18.2.0",
"react-color": "^2.19.3",
"react-dom": "^18.2.0",
Expand Down
11 changes: 10 additions & 1 deletion packages/nutui-taro-demo/babel.config.js
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: [
[
Expand All @@ -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),
}
2 changes: 1 addition & 1 deletion packages/nutui-taro-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"author": "",
"dependencies": {
"@babel/runtime": "^7.23.9",
"@nutui/replace-icons": "^1.0.0",
"@nutui/touch-emulator": "^1.0.0",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
"@tarojs/components": "3.6.22",
Expand All @@ -68,7 +69,6 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-refresh": "^0.14.0"

},
"devDependencies": {
"@babel/core": "^7.23.9",
Expand Down
Loading

0 comments on commit 61f6431

Please sign in to comment.