Skip to content
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/3.2.0 #1697

Merged
merged 18 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
"^UNSAFE_"
]
}
]
],
"@typescript-eslint/ban-ts-comment": "off"
},
"settings": {
"import/ignore": [
Expand Down
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Issues 是用来提交 Bug 或 Feature 相关的内容,一个 Bug Issue 应该

## 开发环境

请确保您的 Node 版本是 8.0+,并且 Taro 升级到最新版
请确保您的 Node 版本是 16.x,并且 Taro 升级到最新版

```bash
git clone [email protected]:NervJS/taro-ui.git
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/deploy-tcb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish root to TCB
on:
check_suite:
types: [completed]
push:
branches:
- next
schedule:
- cron: "0 21 * * *"

env:
CI: true
jobs:
publish:
name: Publish Docs to TCB
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 8

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- run: pnpm start

- name: Build taro-ui
run: pnpm run build:ui

- name: Build taro-ui-docs
run: pnpm run build:doc

- name: Deploy static to Tencent CloudBase
id: deployStatic
uses: TencentCloudBase/[email protected]
with:
secretId: ${{ secrets.TCB_SECRET_ID }}
secretKey: ${{ secrets.TCB_SECRET_KEY }}
envId: ${{ secrets.TCB_TARO_UI_ENV_ID }}
staticSrcPath: packages/taro-ui-docs/dist
44 changes: 44 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Node CI

on:
push:
branches:
- next
- feat/**
pull_request:
branches:
- next

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
build:

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 8

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- run: pnpm start

- name: build
run: pnpm build

- name: build
run: pnpm build:demo
52 changes: 46 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ on:
# When Release Pull Request is merged
push:
branches:
- next
- 'chore/**'
- 'feat/**'
pull_request:
branches:
- next
Expand All @@ -13,12 +14,13 @@ env:
CI: true
jobs:
publish:
permissions:
contents: write # to create tags and refs
actions: write # to cancel running workflow (andymckay/cancel-action)
issues: write # to create comment

name: publish
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [16.x]

steps:
# Setup
Expand Down Expand Up @@ -51,12 +53,31 @@ jobs:
- name: Show commit message
run : echo "$commitmsg"

- name: Commit message compliance verification
if: startsWith( env.COMMIT_MESSAGE , 'chore(release):' ) != true
uses: andymckay/[email protected]

- name: Publish push tag verification
if: github.event_name == 'push' && contains( env.COMMIT_MESSAGE , '--tag=' ) != true
uses: andymckay/[email protected]

# Get & check npm publish
- name: Get publish params
if: github.event_name == 'push'
run: |
PUBLISH_PARAMS=`echo $COMMIT_MESSAGE | grep -oE "^chore\(release\): publish \S*\s(.*)" | cut -d " " -f 4-`
echo "PUBLISH_PARAMS=${PUBLISH_PARAMS}" >> $GITHUB_ENV

- name: Show publish params
if: github.event_name == 'push'
run: echo "Publish pushing provide parameter [$PUBLISH_PARAMS]."

# Define ${CURRENT_VERSION}
- name: Set Current Version
if: startsWith( env.commitmsg , 'chore(release):' )
shell: bash -ex {0}
run: |
CURRENT_VERSION=$(node -p 'require("./lerna.json").version')
CURRENT_VERSION=$(node -p 'require("./packages/taro-ui/package.json").version')
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV

# Check git tag
Expand All @@ -76,6 +97,12 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# ------------------ If git tag already exists, skip -------------

- name: Git tag verification
if: steps.tag_check.outputs.exists_tag == false
uses: andymckay/[email protected]

# Bootstrap project
- name: Cache pnpm modules
uses: actions/cache@v3
Expand Down Expand Up @@ -139,3 +166,16 @@ jobs:
${{ github.event.pull_request.body }}
draft: false
prerelease: false

# Create PR page comment when event is PR
- uses: actions/github-script@v6
if: github.event.pull_request.merged == true
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'https://github.com/${{ github.repository }}/releases/tag/v${{ env.CURRENT_VERSION }} is released 🎉'
})
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Taro 是由 [凹凸实验室](https://aotu.io) 倾力打造的多端开发解决

## 相关链接

- [Taro UI 使用文档](https://taro-ui.jd.com)
- [Taro UI 使用文档](https://taro-ui.taro.zone)
- [Taro UI 官方示例](https://github.com/NervJS/taro-ui-demo)
- [Taro](https://taro.jd.com/)
- [Taro 物料市场](https://taro-ext.jd.com)
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
},
"license": "MIT",
"scripts": {
"start": "pnpm install --shamefully-hoist",
"preinstall": "npx only-allow pnpm",
"build": "pnpm -r run build",
"build:ui": "pnpm --filter=taro-ui build",
"build:demo": "pnpm --filter=taro-ui-demo build:h5",
"build:doc": "pnpm run build:demo && pnpm --filter=taro-ui-docs build",
"clean": " rimraf **/dist && rimraf **/node_modules",
"prepare": "husky install"
},
Expand Down
42 changes: 33 additions & 9 deletions packages/taro-ui-demo-rn/src/pages/view/timeline/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import './index.scss'

export default class TimelinePage extends React.Component {
public config: Taro.PageConfig = {
navigationBarTitleText: 'Taro UI',
navigationBarTitleText: 'Taro UI'
}

public render(): JSX.Element {
Expand All @@ -26,7 +26,7 @@ export default class TimelinePage extends React.Component {
{ title: '刷牙洗脸' },
{ title: '吃早餐' },
{ title: '上班' },
{ title: '睡觉' },
{ title: '睡觉' }
]}
></AtTimeline>
</View>
Expand All @@ -43,7 +43,7 @@ export default class TimelinePage extends React.Component {
{ title: '刷牙洗脸' },
{ title: '吃早餐', color: 'green' },
{ title: '上班', color: 'red' },
{ title: '睡觉', color: 'yellow' },
{ title: '睡觉', color: 'yellow' }
]}
></AtTimeline>
</View>
Expand All @@ -60,7 +60,7 @@ export default class TimelinePage extends React.Component {
{ title: '刷牙洗脸', icon: 'check-circle' },
{ title: '吃早餐', icon: 'clock' },
{ title: '上班', icon: 'clock' },
{ title: '睡觉', icon: 'clock' },
{ title: '睡觉', icon: 'clock' }
]}
></AtTimeline>
</View>
Expand All @@ -78,7 +78,7 @@ export default class TimelinePage extends React.Component {
{ title: '刷牙洗脸' },
{ title: '吃早餐' },
{ title: '上班' },
{ title: '睡觉' },
{ title: '睡觉' }
]}
></AtTimeline>
</View>
Expand All @@ -96,24 +96,48 @@ export default class TimelinePage extends React.Component {
{
title: '刷牙洗脸',
content: ['大概8:00'],
icon: 'check-circle',
icon: 'check-circle'
},
{
title: '吃早餐',
content: ['牛奶+面包', '餐后记得吃药'],
icon: 'clock',
icon: 'clock'
},
{
title: '上班',
content: ['查看邮件', '写PPT', '发送PPT给领导'],
icon: 'clock',
icon: 'clock'
},
{ title: '睡觉', content: ['不超过23:00'], icon: 'clock' },
{ title: '睡觉', content: ['不超过23:00'], icon: 'clock' }
]}
></AtTimeline>
</View>
</View>
</View>

{/* 点击节点事件 */}
<View className='panel'>
<View className='panel__title'>点击节点</View>
<View className='panel__content'>
<View className='example-item'>
<AtTimeline
pending
items={[
{ title: '刷牙洗脸' },
{ title: '吃早餐' },
{ title: '上班' },
{ title: '睡觉' }
]}
onClickItem={index => {
Taro.showToast({
title: `点击了第 ${index} 个节点`,
icon: 'none'
})
}}
></AtTimeline>
</View>
</View>
</View>
</View>
</View>
)
Expand Down
21 changes: 20 additions & 1 deletion packages/taro-ui-demo/src/pages/layout/card/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { AtCard, AtIcon } from 'taro-ui'
import { AtButton, AtCard, AtIcon } from 'taro-ui'
import { View } from '@tarojs/components'
import Taro from '@tarojs/taro'
import DocsHeader from '../../components/doc-header'
Expand Down Expand Up @@ -117,6 +117,25 @@ export default class CardPage extends React.Component {
这也是内容区 可以随意定义功能
</AtCard>
</View>
<View className='example-item'>
<AtCard
note='小Tips'
extra={
<AtButton size='small' type='primary'>
提交
</AtButton>
}
extraStyle={{
fontSize: '12px',
maxWidth: '200px',
color: '#6190e8'
}}
title='这是个标题'
thumb='http://img10.360buyimg.com/jdphoto/s72x72_jfs/t5872/209/5240187906/2872/8fa98cd/595c3b2aN4155b931.png'
>
这也是内容区 可以随意定义功能
</AtCard>
</View>
</View>
</View>

Expand Down
21 changes: 20 additions & 1 deletion packages/taro-ui-demo/src/pages/layout/list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,26 @@ export default class ListPage extends React.Component {
</View>
</View>
</View>

{/* 自定义图标 */}
<View className='panel'>
<View className='panel__title'>
支持自定义图标(不能与thumb同时存在)
</View>
<View className='panel__content no-padding'>
<View className='example-item'>
<AtList>
<AtListItem
title='标题文字'
note='描述信息'
arrow='right'
iconInfo={{ size: 25, color: '#78A4FA', value: 'calendar' }}
thumb='http://img12.360buyimg.com/jdphoto/s72x72_jfs/t10660/330/203667368/1672/801735d7/59c85643N31e68303.png'
icon={<View className='at-icon at-icon-bookmark' />}
/>
</AtList>
</View>
</View>
</View>
{/* 无边框 */}
<View className='panel'>
<View className='panel__title'>无边框</View>
Expand Down
Loading
Loading