Skip to content

Commit f478704

Browse files
committed
Merge branch '3.0' into 3.0-searchbar
2 parents 07665ae + 80c507d commit f478704

File tree

222 files changed

+18128
-8659
lines changed

Some content is hidden

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

222 files changed

+18128
-8659
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
src/sites
2+
src/packages/nutui.react.build.rn.ts
23
scripts
34
site_docs
45
coverage

.github/workflows/ci.yml

Lines changed: 57 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,9 @@ on:
44
push:
55
branches:
66
- next
7-
- dev-harmony
8-
- 3.0
9-
10-
pull_request:
11-
branches:
12-
- next
13-
- dev-harmony
14-
- 3.0
15-
7+
- V3.0
8+
pull_request_target:
9+
types: [opened, synchronize, reopened]
1610
workflow_dispatch:
1711

1812
jobs:
@@ -21,13 +15,13 @@ jobs:
2115
steps:
2216
- uses: actions/checkout@v4
2317

24-
- name: Install pnpm
25-
run: corepack enable pnpm
18+
- name: Install pnpm
19+
run: corepack enable pnpm
2620

27-
- uses: actions/setup-node@v4
28-
with:
29-
node-version: '20'
30-
cache: 'pnpm'
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: '20'
24+
cache: 'pnpm'
3125

3226
- name: Install dependencies
3327
run: pnpm install
@@ -38,40 +32,40 @@ jobs:
3832
test:
3933
runs-on: ubuntu-latest
4034
steps:
41-
- uses: actions/checkout@v4
35+
- uses: actions/checkout@v4
4236

43-
- name: Install pnpm
44-
run: corepack enable pnpm
37+
- name: Install pnpm
38+
run: corepack enable pnpm
4539

46-
- uses: actions/setup-node@v4
47-
with:
48-
node-version: '20'
49-
cache: 'pnpm'
40+
- uses: actions/setup-node@v4
41+
with:
42+
node-version: '20'
43+
cache: 'pnpm'
5044

51-
- name: Install dependencies
52-
run: pnpm install
45+
- name: Install dependencies
46+
run: pnpm install
5347

54-
- name: Run test
55-
run: npm run test
48+
- name: Run test
49+
run: npm run test
5650

57-
- name: Upload coverage reports to Codecov
58-
if: ${{ always() }}
59-
uses: codecov/codecov-action@v4
60-
env:
61-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
51+
- name: Upload coverage reports to Codecov
52+
if: ${{ always() }}
53+
uses: codecov/codecov-action@v4
54+
env:
55+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6256

6357
build:
6458
runs-on: ubuntu-latest
6559
steps:
6660
- uses: actions/checkout@v4
6761

68-
- name: Install pnpm
69-
run: corepack enable pnpm
62+
- name: Install pnpm
63+
run: corepack enable pnpm
7064

71-
- uses: actions/setup-node@v4
72-
with:
73-
node-version: '20'
74-
cache: 'pnpm'
65+
- uses: actions/setup-node@v4
66+
with:
67+
node-version: '20'
68+
cache: 'pnpm'
7569

7670
- name: Install dependencies
7771
run: pnpm install
@@ -86,4 +80,30 @@ jobs:
8680
run: npm run build:site
8781

8882
- name: Build NutUI-React Taro H5 Demo
83+
if: github.ref == 'refs/heads/next'
8984
run: npm run build:taro:site
85+
add-label:
86+
runs-on: ubuntu-latest
87+
88+
steps:
89+
- name: Check out repository
90+
uses: actions/checkout@v4
91+
92+
- name: Determine label based on target branch
93+
id: determine-label
94+
run: |
95+
echo "${{github.event_name}}"
96+
if [[ "${{ github.event.pull_request.base.ref }}" == "next" ]]; then
97+
echo "label=2.x" >> $GITHUB_ENV
98+
elif [[ "${{ github.event.pull_request.base.ref }}" == "V3.0" ]]; then
99+
echo "label=3.x" >> $GITHUB_ENV
100+
else
101+
echo "label=" >> $GITHUB_ENV
102+
fi
103+
104+
- name: Add label to Pull Request
105+
if: env.label != ''
106+
uses: actions-ecosystem/action-add-labels@v1
107+
with:
108+
github_token: ${{ secrets.GITHUB_TOKEN }}
109+
labels: ${{ env.label }}

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
**/*.eot
77
package.json
88
node_modules
9+
src/packages/nutui.react.build.rn.ts

.vite/deps_temp_67a06ddd/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# v2.6.23
2+
3+
`2024-10-18`
4+
5+
- :sparkles: feat(calendar): support renderBottomButton props (#2645)
6+
- :sparkles: feat(calendar): support deleteIcon props (#2644)
7+
- :bug: fix(overlay): tour position offset in tour.taro (#2631)
8+
- :bug: fix: import error (#2648)
9+
- :bug: fix(dialog): remove defaultprops (#2639)
10+
111
# v2.6.22
212

313
`2024-10-12`

cypress.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from 'cypress'
2+
3+
export default defineConfig({
4+
e2e: {
5+
baseUrl: 'http://localhost:10086/#/',
6+
specPattern: 'cypress/e2e/**/*.js',
7+
},
8+
viewportWidth: 414,
9+
viewportHeight: 896,
10+
})

cypress/component/Actionsheet.cy.jsx

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import React from 'react'
2+
import { mount } from 'cypress/react18'
3+
import { ActionSheet } from '../../src/packages/actionsheet/actionsheet'
4+
5+
const menulist = [
6+
{
7+
name: '选项一',
8+
description: '选项一的描述信息',
9+
danger: true,
10+
},
11+
{
12+
name: '选项二',
13+
disabled: true,
14+
},
15+
{
16+
name: '必填',
17+
name1: '选项三',
18+
},
19+
]
20+
21+
it('props test options ', () => {
22+
mount(
23+
<ActionSheet
24+
visible
25+
title="弹层标题"
26+
description="弹层描述信息"
27+
cancelText="关闭弹层"
28+
options={menulist}
29+
/>
30+
)
31+
cy.get('.nut-actionsheet-list .nut-actionsheet-item').should('have.length', 3)
32+
})
33+
34+
it('props test cancelText ', async () => {
35+
mount(
36+
<ActionSheet
37+
visible
38+
title="弹层标题"
39+
description="弹层描述信息"
40+
cancelText="关闭弹层"
41+
options={menulist}
42+
/>
43+
)
44+
cy.get('.nut-actionsheet-cancel').then(($el) => {
45+
const el = cy.wrap($el)
46+
el.should('have.text', '关闭弹层')
47+
})
48+
})
49+
50+
it('props test has value ', async () => {
51+
mount(
52+
<ActionSheet
53+
visible
54+
title="弹层标题"
55+
description="弹层描述信息"
56+
cancelText="关闭弹层"
57+
options={menulist}
58+
/>
59+
)
60+
cy.get('.nut-actionsheet-list .nut-actionsheet-item')
61+
.eq(0)
62+
.then(($el) => {
63+
const el = cy.wrap($el)
64+
el.should('have.text', '选项一选项一的描述信息')
65+
el.should('have.class', 'danger')
66+
})
67+
})

cypress/component/Button.cy.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import React from 'react'
2+
import { Button } from '../../src/packages/button/button'
3+
4+
it('playground', () => {
5+
cy.mount(<Button type="primary">123</Button>)
6+
})

cypress/component/Cell.cy.jsx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import React from 'react'
2+
import { Cell } from '../../src/packages/cell/cell.taro'
3+
import { Switch } from '../../src/packages/switch/switch.taro'
4+
5+
it('prop title extra description test', () => {
6+
cy.mount(
7+
<Cell
8+
data-testid="prop"
9+
title="我是标题"
10+
description="我是描述"
11+
extra="描述文字"
12+
/>
13+
)
14+
cy.get('.nut-cell-title').should('contain.text', '我是标题')
15+
cy.get('.nut-cell-description').should('contain.text', '我是描述')
16+
cy.get('.nut-cell-extra').should('contain.text', '描述文字')
17+
})
18+
it('prop ', () => {
19+
cy.mount(<Cell title="URL 跳转" extra="https://m.jd.com/" />)
20+
cy.get('.nut-cell-extra').should('be.visible')
21+
})
22+
23+
it('emit click event', () => {
24+
const testClick = () => {}
25+
cy.mount(<Cell data-testid="emit-click" onClick={() => testClick()} />)
26+
cy.get('[data-testid="emit-click"]').click().trigger('testClick')
27+
})
28+
29+
it('slot default test', () => {
30+
cy.mount(<Cell title={<div>自定义内容</div>} extra="描述文字" />)
31+
cy.root().should('contain.html', '<div>自定义内容</div>')
32+
})
33+
34+
it('slot extra', () => {
35+
cy.mount(<Cell title="Switch" extra={<Switch defaultChecked />} />)
36+
cy.get('.nut-switch').should('be.visible')
37+
})

cypress/e2e/index.cy.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import './taro/base.cy'
2+
import './taro/layout.cy'
3+
import './taro/nav.cy'
4+
import './taro/dentry.cy'
5+
6+
Cypress.on('uncaught:exception', (err, runnable) => {
7+
return false
8+
})

0 commit comments

Comments
 (0)