Skip to content

Commit 0b14946

Browse files
shinken008qiuzizsuyj7suzhangranzhiqingchen
authored
merge React native (#1500)
* feat: support rn * feat: notice * feat: tag * feat: timeline * feat: list * feat: divider * feat: steps * chore: 调整项目部署,开发和发布流程 * chore(rn-demo): 软链里面组件支持全局样式 * feat(rn): article avatar badge 视图组件适配 * feat(rn): load-more 组件 * feat(rn): curtain 组件 * feat: countdown视图组件适配 * feat(rn): countdown 组件 * chore(rn): 样式打包 dist * feat(rn): 布局 -- flex 布局 * feat(rn): 布局 -- grid 布局 * feat(rn): 布局 -- layout 组件 pop * feat(rn): tab bar 组件 * feat(rn): tabs 组件 * feat(rn): segmented-control 组件 * chore(rn): 更新依赖 * feat(rn): pagination 组件 * feat(rn): drawer 组件 * feat(rn): modal 组件 * feat(rn): message 组件 * feat(rn): progress 组件 * feat: nav-bar组件 * feat(rn): picker 组件 * feat(rn): slider 组件 * feat(rn): progress 组件修改 * feat(rn): avatar 组件修改 feat(rn): avatar 组件修改 * feat(rn): textarea 组件 * chore: 更改用户文件引入 * feat(rn): range 组件 * chore: 引入 react-native-modal 库 && modal盖住toast情况后续taro toast使用 modal 重写 * feat(rn): action-sheet 组件 * feat: 增加字体图标资源 * chore(rn): 统一处理不兼容样式报错 * feat(rn): icon 组件适配 * feat(rn): align-right 不存在报错 && 兼容报错场景 * feat(rn): card 组件 && list 调整 icon * feat(rn): image picker * feat(rn): inputNumber 组件 * feat(rn): radio 组件 * feat(rn): checkbox 组件 * feat(rn): form 组件和 input 组件 * feat(rn): searchbar 组件无动画 * feat(rn): rate 组件 * feat(rn): icon 样式取样式设置 * feat(rn): navbar组件以及其他涉及到icon 的调整 * feat(rn): 弹窗重复点击问题及细节优化 * feat: add rn release action (#1) * feat: add release action * feat: remove yarn lock * feat: use v1 * feat(rn): icon 调整,message 适配,tab 滑动问题修复 * feat(rn): toast 组件以及其他小问题解决 * feat(rn): badge, input, progress, divider 优化 * feat(rn): line-height 以及细节调整 * feat(rn): 表单 border 调整 * feat(rn): 针对所有组件对比小程序进行组件优化 * chore(rn): 解决编译的报错问题 * feat(rn): 不支持组件 warning * chore: 增加 publish ci * chore: ci 报错问题 chore: ci 报错问题 chore: ci 报错问题 chore: 修改 ci chore: 修改 ci chore: 修改 ci chore(release): publish 3.0.0-alpha.11 chore(release): publish 3.0.0-alpha.11 chore(release): publish 3.0.0-alpha.11 chore(release): publish 3.0.0-alpha.11 * chore(release): publish 3.0.0-alpha.12 * fix: 恢复 src 代码 * chore(release): publish 3.1.0-beta.0 * fix(rn): 修复安卓机上存在的问题 * chore(release): publish 3.1.0-beta.1 * fix(rn): 修复安卓机上存在的问题 * chore(release): publish 3.1.0-beta.1 * fix(h5): 解决 h5 表单组件 onChange 时候取值失败 * chore: 修复 demo 本地开发调试问题 * chore(rn): 更新版本以及 RN 端统一api使用 * chore: 锁定 colors 版本 * chore(release): publish 3.1.0-beta.2 * chore(release): publish 3.1.0-beta.2 (#1427) * fix(input): 增加 maxLength 支持跟文档保持一致 * fix(sass): sass / 使用 math.div 替代 * chore(release): publish 3.1.0-beta.3 * feat: scss carry out warning (#1498) Co-authored-by: mobing <[email protected]> Co-authored-by: qiuz <[email protected]> Co-authored-by: suyj7 <[email protected]> Co-authored-by: suzhangran <[email protected]> Co-authored-by: tony chen <[email protected]> Co-authored-by: lc-s1992 <[email protected]> Co-authored-by: mobing <[email protected]>
1 parent 750c758 commit 0b14946

File tree

487 files changed

+64689
-12410
lines changed

Some content is hidden

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

487 files changed

+64689
-12410
lines changed

.eslintrc.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"@typescript-eslint/member-delimiter-style": [
4040
"off"
4141
],
42+
"import/no-named-as-default": "off",
4243
"class-methods-use-this": "off",
4344
"prefer-rest-params": "off",
4445
"react/jsx-filename-extension": [
@@ -77,6 +78,7 @@
7778
]
7879
},
7980
"settings": {
81+
"import/ignore": ["react-native"],
8082
"react": {
8183
"version": "detect"
8284
}
@@ -176,7 +178,9 @@
176178
{
177179
"files": [
178180
"packages/taro-ui-demo/**/*.ts",
179-
"packages/taro-ui-demo/**/*.tsx"
181+
"packages/taro-ui-demo/**/*.tsx",
182+
"packages/taro-ui-demo-rn/**/*.ts",
183+
"packages/taro-ui-demo-rn/**/*.tsx"
180184
],
181185
"extends": [
182186
"taro/react"
@@ -185,7 +189,9 @@
185189
{
186190
"files": [
187191
"packages/taro-ui-demo/config/*.js",
188-
"packages/taro-ui-demo/babel.config.js"
192+
"packages/taro-ui-demo/babel.config.js",
193+
"packages/taro-ui-demo-rn/**/*.ts",
194+
"packages/taro-ui-demo-rn/**/*.tsx"
189195
],
190196
"rules": {
191197
"import/no-commonjs": "off"

.github/workflows/publish.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: publish
2+
on:
3+
# When Release Pull Request is merged
4+
push:
5+
branches:
6+
- react-native
7+
pull_request:
8+
branches:
9+
- react-native
10+
types: [closed]
11+
12+
env:
13+
CI: true
14+
jobs:
15+
publish:
16+
name: publish
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
node-version: [14.x]
22+
23+
steps:
24+
# Setup
25+
- name: Checkout
26+
uses: actions/checkout@v2
27+
- name: Setup Node ${{ matrix.node_version }}
28+
uses: actions/setup-node@v1
29+
with:
30+
node-version: 14
31+
registry-url: 'https://registry.npmjs.org'
32+
- name: Git Identity
33+
run: |
34+
git config --global user.name 'github-actions[bot]'
35+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
36+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
40+
# Log meta
41+
- name : GITHUB CONTEXT
42+
env:
43+
GITHUB_CONTEXT: ${{ toJson(github) }}
44+
run: echo "$GITHUB_CONTEXT"
45+
46+
# Get commit message
47+
- name: Get commit message
48+
run: |
49+
COMMIT_MESSAGE=$(git log --format=%B -n 1)
50+
echo "commitmsg=${COMMIT_MESSAGE}" >> $GITHUB_ENV
51+
- name: Show commit message
52+
run : echo "$commitmsg"
53+
54+
# Define ${CURRENT_VERSION}
55+
- name: Set Current Version
56+
if: startsWith( env.commitmsg , 'chore(release):' )
57+
shell: bash -ex {0}
58+
run: |
59+
CURRENT_VERSION=$(node -p 'require("./lerna.json").version')
60+
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
61+
62+
# Check git tag
63+
- name: Tag Check
64+
if: startsWith( env.commitmsg , 'chore(release):' )
65+
id: tag_check
66+
shell: bash -ex {0}
67+
run: |
68+
GET_API_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/git/ref/tags/v${CURRENT_VERSION}"
69+
http_status_code=$(curl -LI $GET_API_URL -o /dev/null -w '%{http_code}\n' -s \
70+
-H "Authorization: token ${GITHUB_TOKEN}")
71+
if [ "$http_status_code" -ne "404" ] ; then
72+
echo "::set-output name=exists_tag::true"
73+
else
74+
echo "::set-output name=exists_tag::false"
75+
fi
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
79+
# Bootstrap project
80+
- name: install
81+
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
82+
run: yarn
83+
- name: bootstrap
84+
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
85+
run: yarn run bootstrap
86+
- name: build
87+
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
88+
run: yarn build
89+
90+
# Git stash
91+
- name: Drop current changes
92+
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
93+
run: |
94+
git add .
95+
git stash
96+
97+
# Create git tag
98+
- name: Create Git Tag
99+
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
100+
uses: azu/action-package-version-to-git-tag@v1
101+
with:
102+
version: ${{ env.CURRENT_VERSION }}
103+
github_token: ${{ secrets.GITHUB_TOKEN }}
104+
github_repo: ${{ github.repository }}
105+
git_commit_sha: ${{ github.sha }}
106+
git_tag_prefix: "v"
107+
108+
# Publish
109+
- name: npm publish
110+
if: steps.tag_check.outputs.exists_tag == 'false' && startsWith( env.commitmsg , 'chore(release):' )
111+
run: yarn lerna publish from-package --yes
112+
env:
113+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
115+
116+
# Create relase when event is PR
117+
- name: Create Release
118+
id: create_release
119+
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false' && github.event.pull_request.merged == true
120+
uses: actions/create-release@v1
121+
env:
122+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123+
with:
124+
tag_name: v${{ env.CURRENT_VERSION }}
125+
# Copy Pull Request's tile and body to Release Note
126+
release_name: ${{ github.event.pull_request.title }}
127+
body: |
128+
${{ github.event.pull_request.body }}
129+
draft: false
130+
prerelease: false

.github/workflows/rn-release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
on:
2+
push:
3+
tags: [ v* ]
4+
workflow_dispatch:
5+
6+
jobs:
7+
taro_release_job:
8+
runs-on: ubuntu-latest
9+
name: Taro Bundle Release
10+
steps:
11+
- name: Checkout Project
12+
uses: actions/checkout@v2
13+
- name: Cache node_modules Folder
14+
uses: actions/cache@v2
15+
with:
16+
path: ${{ github.workspace }}/node_modules
17+
key: ${{ runner.os }}-node_modules
18+
restore-keys: ${{ runner.os }}-node_modules
19+
- name: Get Yarn Cache Directory Path
20+
id: yarn-cache-dir-path
21+
run: echo "::set-output name=dir::$(yarn cache dir)"
22+
- name: Cache Yarn
23+
uses: actions/cache@v2
24+
env:
25+
cache-name: yarn-cache
26+
with:
27+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
28+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
29+
restore-keys: |
30+
${{ runner.os }}-yarn-
31+
- name: Install Dependencies
32+
run: |
33+
yarn
34+
- name: Lerna Bootstrap
35+
run: |
36+
yarn bootstrap
37+
- name: Release Taro React Native bundle
38+
uses: zhiqingchen/taro-react-native-release@v1
39+
with:
40+
workingdirectory: ./packages/taro-ui-demo-rn
41+
token: ${{ secrets.GITHUB_TOKEN }}
42+
appname: Taro-UI-Demo
43+
logo: https://pic5.58cdn.com.cn/nowater/fangfe/n_v25a185c1657984016926f26af591912c4.jpg
44+
- name: Upload Qr Image
45+
uses: actions/upload-artifact@v2
46+
with:
47+
name: bundle-qr-code
48+
path: |
49+
packages/taro-ui-demo-rn/release/qrcode/ios.png
50+
packages/taro-ui-demo-rn/release/qrcode/android.png

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ stats.html
2828

2929
# Test files
3030
coverage
31+
32+
# taro rn release
33+
!packages/taro-ui-demo-rn/release/**

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
## 特性
1010

1111
- 基于 `Taro` 开发 UI 组件
12-
- 一套组件可以在 `微信小程序``支付宝小程序``百度小程序``H5` 多端适配运行(`ReactNative` 端暂不支持)
13-
- 提供友好的 API,可灵活的使用组件
12+
- 一套组件可以在 `微信小程序``支付宝小程序``百度小程序``H5``ReactNative` 多端适配运行
13+
- 提供友好的 API,可灵活的使用组件
1414

1515
## 关于 Taro
1616

RN.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Taro UI For RN
2+
3+
4+
### 开发
5+
6+
7+
####
8+
注意 React Native 版本需要保持一致
9+
##### 自定义安装壳子
10+
下载官方壳应用(NervJS/taro-native-shell)[https://github.com/NervJS/taro-native-shell] 选择与 taro-ui react-native 版本一致的分支
11+
12+
##### 使用发布商店 App 壳子
13+
<img src="https://tva1.sinaimg.cn/large/008i3skNgy1gvzhk2732kj30fu0u0aax.jpg" width="300px" />
14+
15+
```
16+
# 组件库与 demo 连接,lerna 对 packages 进行 symlink
17+
lerna bootstrap
18+
```
19+
20+
#### 组件开发
21+
```
22+
cd packages/taro-ui/rn
23+
```
24+
25+
#### 发布
26+
rn 源码发布
27+
28+
#### DEMO 启动
29+
```
30+
cd packages/taro-ui-demo-rn
31+
yarn dev:rn
32+
```
33+
demo 适配开发,更改组件 style 样式,需要更改一下 packages/taro-ui-demo-rn/src/app.scss 触发一下样式重编。

lerna.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"packages": [
3-
"packages/taro-ui"
3+
"packages/taro-ui",
4+
"packages/taro-ui-demo",
5+
"packages/taro-ui-demo-rn"
46
],
57
"command": {
68
"publish": {
@@ -11,7 +13,6 @@
1113
"license": "MIT"
1214
}
1315
},
14-
"version": "3.0.0-alpha.10",
15-
"npmClient": "yarn",
16-
"useWorkspaces": true
16+
"version": "3.1.0-beta.3",
17+
"npmClient": "yarn"
1718
}

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
"url": "[email protected]:nervjs/taro-ui.git"
1010
},
1111
"license": "MIT",
12-
"workspaces": {
13-
"packages": [
14-
"packages/*"
15-
]
16-
},
1712
"scripts": {
1813
"bootstrap": "lerna bootstrap",
1914
"build": "lerna run build",
@@ -25,6 +20,7 @@
2520
"devDependencies": {
2621
"@commitlint/cli": "^8.3.5",
2722
"@commitlint/config-conventional": "^8.3.4",
23+
"eslint-config-taro": "~3.0.2",
2824
"@typescript-eslint/eslint-plugin": "^2.26.0",
2925
"@typescript-eslint/parser": "^2.26.0",
3026
"conventional-changelog-cli": "^2.0.31",

packages/taro-ui-demo-rn/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5+
6+
## 3.0.1 (2020-04-18)
7+
8+
**Note:** Version bump only for package taro-ui-demo
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// babel-preset-taro 更多选项和默认值:
2+
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
3+
module.exports = {
4+
presets: [
5+
[
6+
'taro',
7+
{
8+
framework: 'react',
9+
ts: true
10+
}
11+
]
12+
]
13+
}

0 commit comments

Comments
 (0)