Skip to content

Commit

Permalink
fix: 合并3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
irisSong committed Nov 4, 2024
2 parents ccd7ed7 + 6341c78 commit c3e4b2e
Show file tree
Hide file tree
Showing 293 changed files with 21,371 additions and 16,073 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
src/sites
src/packages/nutui.react.build.rn.ts
scripts
site_docs
coverage
Expand Down
81 changes: 51 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,48 @@ on:
push:
branches:
- next
- dev-harmony
- V3.0

pull_request:
branches:
- next
- dev-harmony
- V3.0

workflow_dispatch:

jobs:
label:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Determine label
id: determine_label
run: |
if [[ "${{ github.event.pull_request.base.ref }}" == "next" ]]; then
echo "label=2.x" >> $GITHUB_ENV
elif [[ "${{ github.event.pull_request.base.ref }}" == "V3.0" ]]; then
echo "label=3.x" >> $GITHUB_ENV
fi
- name: Add label to PR
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: ${{ env.label }}
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install pnpm
run: corepack enable pnpm
- name: Install pnpm
run: corepack enable pnpm

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
Expand All @@ -36,40 +56,40 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Install pnpm
run: corepack enable pnpm
- name: Install pnpm
run: corepack enable pnpm

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
- name: Install dependencies
run: pnpm install

- name: Run test
run: npm run test
- name: Run test
run: npm run test

- name: Upload coverage reports to Codecov
if: ${{ always() }}
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage reports to Codecov
if: ${{ always() }}
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install pnpm
run: corepack enable pnpm
- name: Install pnpm
run: corepack enable pnpm

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
Expand All @@ -84,4 +104,5 @@ jobs:
run: npm run build:site

- name: Build NutUI-React Taro H5 Demo
if: github.ref == 'refs/heads/next'
run: npm run build:taro:site
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ package-lock.json
/site_docs
/coverage
/packages/nutui-jdharmony
/packages/nutui-jdharmonycpp

# local env files
.env.local
Expand Down
9 changes: 0 additions & 9 deletions .npmrc

This file was deleted.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
**/*.eot
package.json
node_modules
src/packages/nutui.react.build.rn.ts
3 changes: 3 additions & 0 deletions .vite/deps_temp_67a06ddd/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
# v2.6.23

`2024-10-18`

- :sparkles: feat(calendar): support renderBottomButton props (#2645)
- :sparkles: feat(calendar): support deleteIcon props (#2644)
- :bug: fix(overlay): tour position offset in tour.taro (#2631)
- :bug: fix: import error (#2648)
- :bug: fix(dialog): remove defaultprops (#2639)

# v2.6.22

`2024-10-12`

- :sparkles: feat(popup): lockscroll 增加可选值 strict, 用于支持 iOS12 (#2629)
- :bug: fix(dialog): revert defaultprops
- :bug: fix(range): usememo (#2638)
- :bug: fix(backtop & menu): lint, code simplification, deprecated pageYOffset removed (#2633)
- :bug: fix: taro async warning in taro-h5 env (#2636)
- :bug: fix(range): refactor & lint fixed (#2637)
- :bug: fix(radio): lint fixed (#2635)
- :bug: fix(navbar): safearea displays abnormal when safeAreaInsetTop has been set true (#2632)
- :bug: fix: usecallback to fix render too many times, button,animatingnumbers,avatar,audio; and fix avatargroup when length > maxsize (#2628)
- 🏡 chore(demo): display bound dispatchSetState in demo8 of table demos (#2626)
- 📖 docs: swiper 可通过 css 的 touch-action 设置用户操作行为 (#2630)
- 📖 docs: 文档构建出现未闭合标签的错误提示

# v2.6.21

`2024-09-27`

- 🏡 chore: update dependency linguist-languages to be included within package (#2607)
- :sparkles: feat(Uploader): add support for deleteIcon prop customization (#2618)
- :bug: fix: 修改jd小程序高版本弹幕不滚动问题 (#2612)

# v2.6.20

`2024-09-20`
Expand Down
10 changes: 10 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from 'cypress'

export default defineConfig({
e2e: {
baseUrl: 'http://localhost:10086/#/',
specPattern: 'cypress/e2e/**/*.js',
},
viewportWidth: 414,
viewportHeight: 896,
})
67 changes: 67 additions & 0 deletions cypress/component/Actionsheet.cy.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import React from 'react'
import { mount } from 'cypress/react18'
import { ActionSheet } from '../../src/packages/actionsheet/actionsheet'

const menulist = [
{
name: '选项一',
description: '选项一的描述信息',
danger: true,
},
{
name: '选项二',
disabled: true,
},
{
name: '必填',
name1: '选项三',
},
]

it('props test options ', () => {
mount(
<ActionSheet
visible
title="弹层标题"
description="弹层描述信息"
cancelText="关闭弹层"
options={menulist}
/>
)
cy.get('.nut-actionsheet-list .nut-actionsheet-item').should('have.length', 3)
})

it('props test cancelText ', async () => {
mount(
<ActionSheet
visible
title="弹层标题"
description="弹层描述信息"
cancelText="关闭弹层"
options={menulist}
/>
)
cy.get('.nut-actionsheet-cancel').then(($el) => {
const el = cy.wrap($el)
el.should('have.text', '关闭弹层')
})
})

it('props test has value ', async () => {
mount(
<ActionSheet
visible
title="弹层标题"
description="弹层描述信息"
cancelText="关闭弹层"
options={menulist}
/>
)
cy.get('.nut-actionsheet-list .nut-actionsheet-item')
.eq(0)
.then(($el) => {
const el = cy.wrap($el)
el.should('have.text', '选项一选项一的描述信息')
el.should('have.class', 'danger')
})
})
6 changes: 6 additions & 0 deletions cypress/component/Button.cy.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react'
import { Button } from '../../src/packages/button/button'

it('playground', () => {
cy.mount(<Button type="primary">123</Button>)
})
37 changes: 37 additions & 0 deletions cypress/component/Cell.cy.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React from 'react'
import { Cell } from '../../src/packages/cell/cell.taro'
import { Switch } from '../../src/packages/switch/switch.taro'

it('prop title extra description test', () => {
cy.mount(
<Cell
data-testid="prop"
title="我是标题"
description="我是描述"
extra="描述文字"
/>
)
cy.get('.nut-cell-title').should('contain.text', '我是标题')
cy.get('.nut-cell-description').should('contain.text', '我是描述')
cy.get('.nut-cell-extra').should('contain.text', '描述文字')
})
it('prop ', () => {
cy.mount(<Cell title="URL 跳转" extra="https://m.jd.com/" />)
cy.get('.nut-cell-extra').should('be.visible')
})

it('emit click event', () => {
const testClick = () => {}
cy.mount(<Cell data-testid="emit-click" onClick={() => testClick()} />)
cy.get('[data-testid="emit-click"]').click().trigger('testClick')
})

it('slot default test', () => {
cy.mount(<Cell title={<div>自定义内容</div>} extra="描述文字" />)
cy.root().should('contain.html', '<div>自定义内容</div>')
})

it('slot extra', () => {
cy.mount(<Cell title="Switch" extra={<Switch defaultChecked />} />)
cy.get('.nut-switch').should('be.visible')
})
8 changes: 8 additions & 0 deletions cypress/e2e/index.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import './taro/base.cy'
import './taro/layout.cy'
import './taro/nav.cy'
import './taro/dentry.cy'

Cypress.on('uncaught:exception', (err, runnable) => {
return false
})
Loading

0 comments on commit c3e4b2e

Please sign in to comment.