Skip to content

Commit c0eea7d

Browse files
committed
Merge branch 'dev-harmony' into feat/pulltorefresh-standard
# Conflicts: # packages/nutui-taro-demo-rn/scripts/taro/adapted.js # packages/nutui-taro-demo-rn/src/app.config.ts # src/utils/use-touch.ts
2 parents 263eba9 + 830366d commit c0eea7d

File tree

783 files changed

+28890
-24877
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

783 files changed

+28890
-24877
lines changed

.github/workflows/sync-h5.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,21 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
18-
- run: npm i fs-extra --force
19-
- run: node scripts/copy-docs-h5-or-taro.js
18+
19+
- name: Install pnpm
20+
run: corepack enable pnpm
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: '18'
25+
cache: 'pnpm'
26+
27+
- name: Install dependencies
28+
run: pnpm install
29+
30+
- name: Generate doc files
31+
run: node scripts/copy-docs-h5-or-taro.js
32+
2033
- name : Sync
2134
uses : JamesIves/[email protected]
2235
with :

.github/workflows/sync-migrate.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,21 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4
19-
- run: npm i fs-extra --force
20-
- run: node scripts/copy-migrate-from-v1.js
19+
20+
- name: Install pnpm
21+
run: corepack enable pnpm
22+
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: '18'
26+
cache: 'pnpm'
27+
28+
- name: Install dependencies
29+
run: pnpm install
30+
31+
- name: Copy migrate from v1
32+
run: node scripts/copy-migrate-from-v1.js
33+
2134
- name : Sync
2235
uses : JamesIves/[email protected]
2336
with :

.github/workflows/sync-taro.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,21 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
18-
- run: npm i fs-extra --force
19-
- run: node scripts/copy-docs-h5-or-taro.js taro
18+
19+
- name: Install pnpm
20+
run: corepack enable pnpm
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: '18'
25+
cache: 'pnpm'
26+
27+
- name: Install dependencies
28+
run: pnpm install
29+
30+
- name: Generate doc files
31+
run: node scripts/copy-docs-h5-or-taro.js taro
32+
2033
- name : Sync
2134
uses : JamesIves/[email protected]
2235
with :

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ strict-peer-dependencies=false
66
@jdtaro:registry=http://registry.m.jd.com/
77
@test:registry=http://registry.m.jd.com/
88
@jmfe:registry=http://registry.m.jd.com/
9+
@dongdesign:registry=http://registry.m.jd.com/

CHANGELOG.md

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,68 @@
1+
# v2.6.14
2+
`2024-07-19`
3+
4+
5+
* :sparkles: feat(menuitem): 新增css类名,增强自定义样式能力 (#2443) @Alex-huxiyang
6+
* :sparkles: feat(empty): add css variable nutui-empty-background-color (#2451) @Alex-huxiyang
7+
* :sparkles: feat(infiniteLoading): 继承 scrollView 的 props 类型 (#2441) @oasis-cloud
8+
* :bug: fix(cascader): 初始化设置value未成功选中 (#2435) @Alex-huxiyang
9+
* :bug: fix(swiper): display abnormal when dir = 'rtl' (#2454) @Alex-huxiyang
10+
* :bug: fix(form): 兼容校验时机 (#2437) @Alex-huxiyang
11+
* :bug: fix(form): 在FromInstance增加validateFields方法的定义 (#2450) @jinjl
12+
13+
14+
# v2.6.13
15+
`2024-07-12`
16+
17+
18+
* :sparkles: feat: tabs滚动条兼容火狐浏览器 (#2431) @JoanneXu6677
19+
* :sparkles: feat(drag): add the ability to support onDrag, onDragStart, onDragEnd callbacks (#2418) @Alex-huxiyang
20+
* :bug: fix(formItem): validateTrigger无法正确触发校验 (#2433) @Alex-huxiyang
21+
* :bug: fix: 日历组件滚动到顶部时 出现空白问题 (#2409) @522109452
22+
* :bug: fix(imagepreview): 无法在预期情景正确关闭图片的异常 (#2421) @Alex-huxiyang
23+
24+
25+
# v2.6.12
26+
`2024-07-05`
27+
28+
29+
* :sparkles: feat: add pagination whether to show pages in imagepreview (#2411) @xiaoyatong
30+
* :bug: fix(uploader): pre-upload pmage preview bug (#2416) @Alex-huxiyang
31+
* :bug: fix(taro-form-demo): 点击演示demo表单内的重置会触发提交表单事件bug修复 (#2415) @Skedush
32+
* :bug: fix(form): validator 中的 value 类型更新为 any (#2406) @oasis-cloud
33+
* :bug: fix(uploader): 京东小程序中可上传时可选择图片和视频 (#2410) @xueshufive
34+
* :bug: fix(avatarcropper): 报错 (#2364) @Alex-huxiyang
35+
* :bug: fix(form): setFields未触发校验 (#2400) @Alex-huxiyang
36+
37+
38+
# v2.6.11
39+
`2024-06-28`
40+
41+
42+
* :sparkles: feat(table): table新增自定义行 (#2390) @zanyuki-jd
43+
* :bug: fix(fixednav): 可拖拽元素样式缺失 (#2391) @oasis-cloud
44+
45+
46+
# v2.6.10
47+
`2024-06-21`
48+
49+
50+
* 🏡 chore: 文档未来规范 (#2373) @Alex-huxiyang
51+
* 🤖 ci: 统一使用 pnpm @oasis-cloud
52+
* :sparkles: feat(tabpane): 增添修改tabpane背景色的主题变量 (#2366) @Alex-huxiyang
53+
* :bug: fix(tabs): 修复tabs异步设置titles滚动失效(#2351) (#2369) @ShuchenEason
54+
* :bug: fix: umd 中替换环境变量 (#2368) @oasis-cloud
55+
56+
57+
# v2.6.9
58+
`2024-06-14`
59+
60+
61+
* :sparkles: feat(form): footer 容器增加 className (#2345) @oasis-cloud
62+
* :bug: fix: 解决Drag组件拖拽后会在原地留一个遮挡元素问题+解决weapp/taro-h5多个demo拖拽位置不正确问题 (#2330) @irisSong
63+
* :bug: fix(searchbar): 修复 clear 时未触发 change 的问题 (#2262) @eiinu
64+
65+
166
# v2.6.8
267
`2024-05-31`
368

@@ -37,12 +102,12 @@
37102
`2024-05-17`
38103

39104

40-
*🏡 chore(image): 官网taro的demo显示与h5不一致 (#2244) @Alex.huxiyang
105+
*🏡 chore(image): 官网taro的demo显示与h5不一致 (#2244) @Alex-huxiyang
41106
* :bug: fix(circleprogress): update demo (#2260) @Eiinu
42107
* :bug: fix: 移除 defaultProps(2) (#2254) @Eiinu
43-
* :bug: fix: 关于checkbox&tabs的doc与demo修改 (#2253) @Alex.huxiyang
44-
* :bug: fix(table): 修复部分由于场景下width未生效导致的一些问题 (#2241) @Alex.huxiyang
45-
* :bug: fix(menu): 选项文字很多时右侧箭头展示异常 (#2252) @Alex.huxiyang
108+
* :bug: fix: 关于checkbox&tabs的doc与demo修改 (#2253) @Alex-huxiyang
109+
* :bug: fix(table): 修复部分由于场景下width未生效导致的一些问题 (#2241) @Alex-huxiyang
110+
* :bug: fix(menu): 选项文字很多时右侧箭头展示异常 (#2252) @Alex-huxiyang
46111
* :bug: fix(input): 修复特殊场景下自动清除失效问题 (#2240) @Eiinu
47112

48113

gulpfile.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,42 @@ const postcss = require('gulp-postcss')
44
const rename = require('gulp-rename')
55
const cssvariables = require('postcss-css-variables')
66
const insert = require('gulp-insert')
7+
const config = require('./src/config.json')
78

8-
const argvs = process.argv.splice(4)[0]?.split('/') || []
9-
9+
const adaptedNameArray = []
10+
// eslint-disable-next-line array-callback-return
11+
config.nav.map((item) => {
12+
item.packages.forEach((element) => {
13+
const { name, version } = element
14+
if (version !== '3.0.0') return // 未适配不导出
15+
adaptedNameArray.push(name.toLowerCase())
16+
})
17+
})
18+
const argvs = process.argv.splice(4)[0]?.split('/') || adaptedNameArray
1019
console.log(argvs, 'argvs')
11-
20+
// 监视频率 https://www.martin-brennan.com/gulp-watch-high-cpu-usage/
21+
const interval = { interval: 500 }
22+
// 监视文件变化
1223
gulp.task('watch', function () {
1324
argvs.forEach((argv) => {
1425
gulp.watch(
1526
`src/packages/${argv}/demos/taro/*`,
27+
interval,
1628
gulp.series(`${argv}copyDemo`)
1729
)
1830
gulp.watch(
1931
`src/packages/${argv}/*.scss`,
32+
interval,
2033
gulp.series(`${argv}sass`, `${argv}copyCss`)
2134
)
2235
gulp.watch(
2336
`src/packages/${argv}/demo.taro.tsx`,
37+
interval,
2438
gulp.series(`${argv}copyTaroDemo`)
2539
)
2640
gulp.watch(
2741
`src/packages/${argv}/${argv}.taro.tsx`,
42+
interval,
2843
gulp.series(`${argv}copyTaro`)
2944
)
3045
})
@@ -33,13 +48,13 @@ gulp.task('watch', function () {
3348
argvs.map((argv) => {
3449
watchTasks.push(...[`${argv}sass`, `${argv}copyCss`])
3550
})
36-
console.log(watchTasks.join(','), 'watchTasks')
3751
gulp.watch(
3852
[
3953
`src/styles/variables.scss`,
4054
'src/styles/mixins/text-ellipsis.scss',
4155
'src/styles/theme-default.scss',
4256
],
57+
interval,
4358
gulp.series(watchTasks)
4459
)
4560
})
169 KB
Binary file not shown.

package.json

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "@test/nutui-react-taro",
3-
"version": "3.0.0-alpha.0",
2+
"name": "@dongdesign/components",
3+
"version": "1.0.1",
44
"style": "dist/style.css",
55
"main": "dist/nutui.react.umd.js",
66
"module": "dist/es/packages/nutui.react.build.js",
@@ -42,7 +42,7 @@
4242
],
4343
"publishConfig": {
4444
"access": "public",
45-
"registry": "https://registry.npmjs.org/"
45+
"registry": "http://registry.m.jd.com/"
4646
},
4747
"scripts": {
4848
"add": "node scripts/create-component-mode.js && npm run prepare",
@@ -60,13 +60,16 @@
6060
"dev:theme": "npm run generate:themes-dev && npm run checked && vite --force --config vite.config.theme.ts",
6161
"dev:taro:weapp": "pnpm --dir ./packages/nutui-taro-demo dev:weapp",
6262
"dev:taro:jd": "pnpm --dir ./packages/nutui-taro-demo dev:jd",
63+
"build:taro:jd": "pnpm --dir ./packages/nutui-taro-demo build:jd",
6364
"dev:taro:h5": "pnpm --dir ./packages/nutui-taro-demo dev:h5",
6465
"dev:taro:h5:jmapp": "pnpm --dir ./packages/nutui-taro-demo dev:h5:jmapp",
6566
"dev:taro:alipay": "pnpm --dir ./packages/nutui-taro-demo dev:alipay",
6667
"dev:taro:harmony": "pnpm --dir ./packages/nutui-taro-demo dev:harmony",
6768
"dev:taro:jdharmony": "pnpm --dir ./packages/nutui-taro-demo dev:jdharmony",
69+
"dev:taro:jdhybrid": "pnpm --dir ./packages/nutui-taro-demo-rn dev:jdhybrid",
6870
"rn:copy": "node ./scripts/rn/copy-file.js",
69-
"dev:taro:rn": "pnpm --dir ./packages/nutui-taro-demo-rn dev:jdrn & pnpm run gulp:watch",
71+
"dev:taro:jdrn": "pnpm run rn:copy && pnpm --dir ./packages/nutui-taro-demo-rn dev:jdrn & pnpm run gulp:watch",
72+
"dev:taro:rn:dark": "THEME=dark pnpm dev:taro:rn",
7073
"gulp:watch": "gulp watch --environment",
7174
"dev:taro:weapp:jmapp": "pnpm --dir ./packages/nutui-taro-demo && npm run dev:weapp:jmapp",
7275
"test": "vitest --coverage",
@@ -105,21 +108,27 @@
105108
"react-transition-group": "^4.4.5"
106109
},
107110
"devDependencies": {
111+
"@babel/plugin-proposal-class-properties": "^7.18.6",
108112
"@commitlint/cli": "^19.0.3",
109113
"@commitlint/config-conventional": "^19.0.3",
110114
"@loadable/component": "^5.16.3",
111115
"@mdx-js/mdx": "^3.0.1",
112116
"@mdx-js/react": "^3.0.1",
113117
"@mdx-js/rollup": "^3.0.1",
114118
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
119+
"@rollup/plugin-babel": "^6.0.4",
120+
"@rollup/plugin-commonjs": "^26.0.1",
121+
"@rollup/plugin-node-resolve": "15.2.3",
122+
"@rollup/plugin-typescript": "^11.1.6",
115123
"@swc/core": "^1.4.8",
116-
"@tarojs/components": "4.0.0-beta.90",
117-
"@tarojs/plugin-platform-alipay": "4.0.0-beta.90",
118-
"@tarojs/plugin-platform-weapp": "4.0.0-beta.90",
119-
"@tarojs/react": "4.0.0-beta.90",
120-
"@tarojs/taro": "4.0.0-beta.90",
124+
"@tarojs/components": "^4.0.0-alpha.34",
125+
"@tarojs/plugin-platform-alipay": "^4.0.0-alpha.34",
126+
"@tarojs/plugin-platform-weapp": "^4.0.0-alpha.34",
127+
"@tarojs/react": "^4.0.0-alpha.34",
128+
"@tarojs/taro": "^4.0.0-alpha.34",
121129
"@testing-library/jest-dom": "^6.4.2",
122-
"@testing-library/react": "^15.0.4",
130+
"@testing-library/react": "^16.0.0",
131+
"@types/fs-extra": "^11.0.4",
123132
"@types/loadable__component": "^5.13.8",
124133
"@types/lodash.isequal": "^4.5.8",
125134
"@types/lodash.kebabcase": "^4.1.9",
@@ -148,7 +157,7 @@
148157
"eslint-plugin-prettier": "^5.1.3",
149158
"eslint-plugin-react": "^7.33.2",
150159
"eslint-plugin-react-hooks": "^4.6.0",
151-
"eslint-plugin-unused-imports": "^3.1.0",
160+
"eslint-plugin-unused-imports": "^4.0.0",
152161
"fs-extra": "^11.2.0",
153162
"glob": "^10.3.10",
154163
"gulp": "^5.0.0",
@@ -157,7 +166,7 @@
157166
"gulp-rename": "^2.0.0",
158167
"gulp-replace": "^1.1.4",
159168
"gulp-sass": "^5.1.0",
160-
"happy-dom": "^13.9.0",
169+
"happy-dom": "^14.2.0",
161170
"highlight.js": "^11.9.0",
162171
"husky": "^9.0.11",
163172
"inquirer": "^8.2.6",

packages/nutui-codemod/README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
一组帮助你升级到 NutUI React 2.x 的 codemod 脚本集合,基于 [jscodeshift](https://github.com/facebook/jscodeshift) 构建。
44

55
## 安装和使用
6-
在运行 codemod 脚本钱,请先提交你本地代码的修改。
6+
在运行 codemod 脚本前,请先提交你本地代码的修改。
77

88
### 针对 @nutui/nutui-react 的升级可采用下面的脚本
99
```shell
@@ -82,3 +82,27 @@ const App = () => {
8282
export default App
8383

8484
```
85+
86+
`package-name-migration`
87+
- 包名替换
88+
89+
```shell
90+
# 使用 npx 直接运行
91+
npx -p @nutui/nutui-react-codemod nutui-react-codemod src -taro -internal
92+
93+
# 或者使用 pnpm 直接运行
94+
pnpm --package=@nutui/nutui-react-codemod dlx nutui-react-codemod src -taro -internal
95+
```
96+
97+
```diff
98+
- import { Button, Collapse } from "@nutui/nutui-react-taro";
99+
- import { Cell } from '@nutui/nutui-react-taro/dist/components/cell/index';
100+
- import '@nutui/nutui-react-taro/dist/components/cell/index';
101+
- import "@nutui/nutui-react-taro/dist/style.css";
102+
- import NutUI from "@nutui/nutui-react-taro";
103+
+ import { Button, Collapse } from "@dongdesign/components";
104+
+ import { Cell } from "@dongdesign/components/dist/components/cell/index";
105+
+ import "@dongdesign/components/dist/components/cell/index";
106+
+ import "@dongdesign/components/dist/style.css";
107+
+ import NutUI from "@dongdesign/components";
108+
```

packages/nutui-codemod/bin/cli.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const transformers = [
1111
'icon-migration',
1212
'props-changed-migration',
1313
]
14+
process.argv.indexOf('-internal') > -1 &&
15+
transformers.push('package-name-migration')
1416
const transformersDir = path.join(__dirname, '../transforms')
1517
const ignoreConfig = path.join(__dirname, './codemod.ignore')
1618

0 commit comments

Comments
 (0)