Skip to content

Commit

Permalink
merge React native (jd-opensource#1500)
Browse files Browse the repository at this point in the history
* 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 (jd-opensource#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 (jd-opensource#1427)

* fix(input): 增加 maxLength 支持跟文档保持一致

* fix(sass): sass / 使用 math.div 替代

* chore(release): publish 3.1.0-beta.3

* feat: scss carry out warning (jd-opensource#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]>
  • Loading branch information
7 people authored Aug 6, 2022
1 parent 750c758 commit 0b14946
Show file tree
Hide file tree
Showing 487 changed files with 64,689 additions and 12,410 deletions.
10 changes: 8 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@typescript-eslint/member-delimiter-style": [
"off"
],
"import/no-named-as-default": "off",
"class-methods-use-this": "off",
"prefer-rest-params": "off",
"react/jsx-filename-extension": [
Expand Down Expand Up @@ -77,6 +78,7 @@
]
},
"settings": {
"import/ignore": ["react-native"],
"react": {
"version": "detect"
}
Expand Down Expand Up @@ -176,7 +178,9 @@
{
"files": [
"packages/taro-ui-demo/**/*.ts",
"packages/taro-ui-demo/**/*.tsx"
"packages/taro-ui-demo/**/*.tsx",
"packages/taro-ui-demo-rn/**/*.ts",
"packages/taro-ui-demo-rn/**/*.tsx"
],
"extends": [
"taro/react"
Expand All @@ -185,7 +189,9 @@
{
"files": [
"packages/taro-ui-demo/config/*.js",
"packages/taro-ui-demo/babel.config.js"
"packages/taro-ui-demo/babel.config.js",
"packages/taro-ui-demo-rn/**/*.ts",
"packages/taro-ui-demo-rn/**/*.tsx"
],
"rules": {
"import/no-commonjs": "off"
Expand Down
130 changes: 130 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: publish
on:
# When Release Pull Request is merged
push:
branches:
- react-native
pull_request:
branches:
- react-native
types: [closed]

env:
CI: true
jobs:
publish:
name: publish
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [14.x]

steps:
# Setup
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'
- name: Git Identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Log meta
- name : GITHUB CONTEXT
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

# Get commit message
- name: Get commit message
run: |
COMMIT_MESSAGE=$(git log --format=%B -n 1)
echo "commitmsg=${COMMIT_MESSAGE}" >> $GITHUB_ENV
- name: Show commit message
run : echo "$commitmsg"

# 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')
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
# Check git tag
- name: Tag Check
if: startsWith( env.commitmsg , 'chore(release):' )
id: tag_check
shell: bash -ex {0}
run: |
GET_API_URL="https://api.github.com/repos/${GITHUB_REPOSITORY}/git/ref/tags/v${CURRENT_VERSION}"
http_status_code=$(curl -LI $GET_API_URL -o /dev/null -w '%{http_code}\n' -s \
-H "Authorization: token ${GITHUB_TOKEN}")
if [ "$http_status_code" -ne "404" ] ; then
echo "::set-output name=exists_tag::true"
else
echo "::set-output name=exists_tag::false"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Bootstrap project
- name: install
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
run: yarn
- name: bootstrap
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
run: yarn run bootstrap
- name: build
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
run: yarn build

# Git stash
- name: Drop current changes
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
run: |
git add .
git stash
# Create git tag
- name: Create Git Tag
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false'
uses: azu/action-package-version-to-git-tag@v1
with:
version: ${{ env.CURRENT_VERSION }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_repo: ${{ github.repository }}
git_commit_sha: ${{ github.sha }}
git_tag_prefix: "v"

# Publish
- name: npm publish
if: steps.tag_check.outputs.exists_tag == 'false' && startsWith( env.commitmsg , 'chore(release):' )
run: yarn lerna publish from-package --yes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# Create relase when event is PR
- name: Create Release
id: create_release
if: startsWith( env.commitmsg , 'chore(release):' ) && steps.tag_check.outputs.exists_tag == 'false' && github.event.pull_request.merged == true
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.CURRENT_VERSION }}
# Copy Pull Request's tile and body to Release Note
release_name: ${{ github.event.pull_request.title }}
body: |
${{ github.event.pull_request.body }}
draft: false
prerelease: false
50 changes: 50 additions & 0 deletions .github/workflows/rn-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
push:
tags: [ v* ]
workflow_dispatch:

jobs:
taro_release_job:
runs-on: ubuntu-latest
name: Taro Bundle Release
steps:
- name: Checkout Project
uses: actions/checkout@v2
- name: Cache node_modules Folder
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/node_modules
key: ${{ runner.os }}-node_modules
restore-keys: ${{ runner.os }}-node_modules
- name: Get Yarn Cache Directory Path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v2
env:
cache-name: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: |
yarn
- name: Lerna Bootstrap
run: |
yarn bootstrap
- name: Release Taro React Native bundle
uses: zhiqingchen/taro-react-native-release@v1
with:
workingdirectory: ./packages/taro-ui-demo-rn
token: ${{ secrets.GITHUB_TOKEN }}
appname: Taro-UI-Demo
logo: https://pic5.58cdn.com.cn/nowater/fangfe/n_v25a185c1657984016926f26af591912c4.jpg
- name: Upload Qr Image
uses: actions/upload-artifact@v2
with:
name: bundle-qr-code
path: |
packages/taro-ui-demo-rn/release/qrcode/ios.png
packages/taro-ui-demo-rn/release/qrcode/android.png
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ stats.html

# Test files
coverage

# taro rn release
!packages/taro-ui-demo-rn/release/**
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
## 特性

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

## 关于 Taro

Expand Down
33 changes: 33 additions & 0 deletions RN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Taro UI For RN


### 开发


####
注意 React Native 版本需要保持一致
##### 自定义安装壳子
下载官方壳应用(NervJS/taro-native-shell)[https://github.com/NervJS/taro-native-shell] 选择与 taro-ui react-native 版本一致的分支

##### 使用发布商店 App 壳子
<img src="https://tva1.sinaimg.cn/large/008i3skNgy1gvzhk2732kj30fu0u0aax.jpg" width="300px" />

```
# 组件库与 demo 连接,lerna 对 packages 进行 symlink
lerna bootstrap
```

#### 组件开发
```
cd packages/taro-ui/rn
```

#### 发布
rn 源码发布

#### DEMO 启动
```
cd packages/taro-ui-demo-rn
yarn dev:rn
```
demo 适配开发,更改组件 style 样式,需要更改一下 packages/taro-ui-demo-rn/src/app.scss 触发一下样式重编。
9 changes: 5 additions & 4 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"packages": [
"packages/taro-ui"
"packages/taro-ui",
"packages/taro-ui-demo",
"packages/taro-ui-demo-rn"
],
"command": {
"publish": {
Expand All @@ -11,7 +13,6 @@
"license": "MIT"
}
},
"version": "3.0.0-alpha.10",
"npmClient": "yarn",
"useWorkspaces": true
"version": "3.1.0-beta.3",
"npmClient": "yarn"
}
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
"url": "[email protected]:nervjs/taro-ui.git"
},
"license": "MIT",
"workspaces": {
"packages": [
"packages/*"
]
},
"scripts": {
"bootstrap": "lerna bootstrap",
"build": "lerna run build",
Expand All @@ -25,6 +20,7 @@
"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"eslint-config-taro": "~3.0.2",
"@typescript-eslint/eslint-plugin": "^2.26.0",
"@typescript-eslint/parser": "^2.26.0",
"conventional-changelog-cli": "^2.0.31",
Expand Down
8 changes: 8 additions & 0 deletions packages/taro-ui-demo-rn/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 3.0.1 (2020-04-18)

**Note:** Version bump only for package taro-ui-demo
13 changes: 13 additions & 0 deletions packages/taro-ui-demo-rn/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// babel-preset-taro 更多选项和默认值:
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
module.exports = {
presets: [
[
'taro',
{
framework: 'react',
ts: true
}
]
]
}
8 changes: 8 additions & 0 deletions packages/taro-ui-demo-rn/config/dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
env: {
NODE_ENV: '"development"'
},
defineConstants: {},
weapp: {},
h5: {}
}
Loading

0 comments on commit 0b14946

Please sign in to comment.