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

chore(release): publish 3.2.0-canary.2 #8214

Merged
merged 22 commits into from
Dec 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d8878a0
fix: remove useless console
LaxusJie Dec 2, 2020
bc53f4b
fix(rn-transformer): app入口公共样式部分页面不生效
yechunxi Dec 3, 2020
d902c3f
fix(router-rn): api 返回msg不一致问题
yechunxi Dec 3, 2020
4574f9e
fix(babel-preset-taro): babel配置增加两个默认装饰器插件
zhiqingchen Dec 3, 2020
f8434e1
chore(taro-rn-runner): change react native to taro react native
zhiqingchen Dec 3, 2020
6acc232
chore(taro-router-rn): move getOpenerEventChannel
zhiqingchen Dec 4, 2020
e35a1c1
chore(taro-router-rn): disable getOpenerEventChannel
zhiqingchen Dec 4, 2020
f162394
Merge pull request #1 from zhiqingchen/feat/react-native
yechunxi Dec 4, 2020
a0d446f
chore(taro-router-rn): update readme
zhiqingchen Dec 4, 2020
3ff68b6
feat(babel-preset-taro): 增加对脚本省略拓展跨端支持
shinken008 Dec 4, 2020
d8ce74c
fix(rn-transformer): 入口配置文件不带后缀
yechunxi Dec 5, 2020
d868b31
feat(taro-rn): 增加指令-p支持
LaxusJie Dec 5, 2020
9344254
feat(taro-rn): 增加指令--reset-cache支持
LaxusJie Dec 5, 2020
df171bc
fix(router-rn): eslint error
yechunxi Dec 5, 2020
3d45909
fix(rn-transformer): 入口jsx 解析error
yechunxi Dec 5, 2020
2d566fc
fix(babel-preset-taro): rm useless proposal-class-properties from rn …
zhiqingchen Dec 5, 2020
74c794d
fix(taro-rn-runner): 处理metro.config中resetCache不生效问题
LaxusJie Dec 5, 2020
fa83580
fix(rn-transformer): fix入口文件公共样式问题
yechunxi Dec 6, 2020
1bc774c
chore: update yarn lock
zhiqingchen Dec 7, 2020
c4a5174
chore(release): publish 3.2.0-canary.2
zhiqingchen Dec 7, 2020
33927a9
fix(rn-transformer): windows上样式不生效问题
yechunxi Dec 7, 2020
12c4f4e
chore(release): publish 3.2.0-canary.2
shinken008 Dec 7, 2020
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
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
"license": "MIT"
}
},
"version": "3.2.0-canary.1",
"version": "3.2.0-canary.2",
"npmClient": "yarn"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-plugin-transform-react-jsx-to-rn-stylesheet",
"version": "3.2.0-canary.1",
"version": "3.2.0-canary.2",
"description": "Transform stylesheet selector to style in JSX Elements.",
"license": "MIT",
"main": "dist/index.js",
Expand All @@ -24,6 +24,6 @@
},
"dependencies": {
"camelize": "^1.0.0",
"taro-css-to-react-native": "3.2.0-canary.1"
"taro-css-to-react-native": "3.2.0-canary.2"
}
}
2 changes: 1 addition & 1 deletion packages/babel-plugin-transform-taroapi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-plugin-transform-taroapi",
"version": "3.2.0-canary.1",
"version": "3.2.0-canary.2",
"main": "dist/index.js",
"scripts": {
"build": "tsc"
Expand Down
12 changes: 6 additions & 6 deletions packages/babel-preset-taro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-preset-taro",
"version": "3.2.0-canary.1",
"version": "3.2.0-canary.2",
"description": "> TODO: description",
"author": "yuche <i@yuche.me>",
"homepage": "https://github.com/nervjs/taro/tree/master/packages/babel-preset-taro#readme",
Expand Down Expand Up @@ -34,15 +34,15 @@
"@babel/preset-react": "7.10.4",
"@babel/preset-typescript": "7.10.4",
"@babel/runtime": "^7.11.2",
"@tarojs/helper": "3.2.0-canary.1",
"@tarojs/taro-h5": "3.2.0-canary.1",
"@tarojs/helper": "3.2.0-canary.2",
"@tarojs/taro-h5": "3.2.0-canary.2",
"babel-plugin-dynamic-import-node": "^2.3.3",
"babel-plugin-global-define": "^1.0.3",
"babel-plugin-module-resolver": "^3.2.0",
"babel-plugin-rn-platform-specific-extensions": "^0.3.0",
"babel-plugin-rn-platform-specific-extensions": "^1.0.0",
"babel-plugin-transform-imports": "^2.0.0",
"babel-plugin-transform-react-jsx-to-rn-stylesheet": "3.2.0-canary.1",
"babel-plugin-transform-taroapi": "3.2.0-canary.1",
"babel-plugin-transform-react-jsx-to-rn-stylesheet": "3.2.0-canary.2",
"babel-plugin-transform-taroapi": "3.2.0-canary.2",
"core-js": "^3.6.5",
"metro-react-native-babel-preset": "^0.63.0"
}
Expand Down
20 changes: 18 additions & 2 deletions packages/babel-preset-taro/rn/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const reactNativeBabelPreset = require('metro-react-native-babel-preset')
const helper = require('@tarojs/helper')
const { merge } = require('lodash')
const fs = require('fs')
const path = require('path')
/**
*
* 获取项目级配置
Expand All @@ -29,7 +30,6 @@ function getRNConfig () {
if (config.rn) {
rnConfig = config.rn
} else {
console.warn('缺少RN基本配置')
rnConfig = {}
}
return rnConfig
Expand Down Expand Up @@ -117,6 +117,10 @@ function getAlias () {
const nativeApis = require('./nativeApis')

module.exports = (_, options = {}) => {
const {
decoratorsBeforeExport,
decoratorsLegacy
} = options
if (options.framework && options.framework !== 'react') {
throw new Error(`Value "${options.framework}" of option "framework" is not supported for React-Native`)
}
Expand All @@ -128,11 +132,16 @@ module.exports = (_, options = {}) => {
const presets = []
const plugins = []
const extensions = [].concat(helper.JS_EXT, helper.TS_EXT, helper.CSS_EXT)
const omitExtensions = options.ts ? ['.tsx', '.ts', '.jsx', '.js'] : ['.jsx', '.js', '.tsx', '.ts']
const entryFilePath = 'node_modules/metro/src/node-haste/DependencyGraph/assets/empty-module.js'
const projectRoot = process.cwd()
presets.push(reactNativeBabelPreset(_, options))
plugins.push(
require('babel-plugin-transform-react-jsx-to-rn-stylesheet'),
[require('babel-plugin-rn-platform-specific-extensions'), {
extensions: extensions
extensions: extensions,
omitExtensions: omitExtensions,
include: [{ [path.resolve(projectRoot, entryFilePath)]: path.resolve(projectRoot, 'index.js') }]
}],
[require('babel-plugin-transform-imports'), {
'^@tarojs/components(-rn)?$': {
Expand All @@ -155,6 +164,13 @@ module.exports = (_, options = {}) => {
}]
)

// 添加一个默认 plugin, 与小程序/h5保持一致. todo: 3.1后采用拓展的方式
plugins.push(
[require('@babel/plugin-proposal-decorators'), {
decoratorsBeforeExport,
legacy: decoratorsLegacy !== false
}]
)
return {
presets,
plugins
Expand Down
8 changes: 4 additions & 4 deletions packages/babel-preset-taro/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1059,10 +1059,10 @@ babel-plugin-module-resolver@^3.2.0:
reselect "^3.0.1"
resolve "^1.4.0"

babel-plugin-rn-platform-specific-extensions@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/babel-plugin-rn-platform-specific-extensions/-/babel-plugin-rn-platform-specific-extensions-0.3.0.tgz#83ff1bd88ff096b6bbd64f2224d92a20ecdd5d4f"
integrity sha512-JuZwgjRGWKcewc8/pRSpHMUzbpNkuJvxeC8SaOd5bIflmZu4wngKM2VqnMLBv09/ycuUJh5/F/m/QgSrjgIX5w==
babel-plugin-rn-platform-specific-extensions@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/babel-plugin-rn-platform-specific-extensions/-/babel-plugin-rn-platform-specific-extensions-1.0.0.tgz#1beb0dd1f2c76b2725b93839e51cf7dd0e56ea9c"
integrity sha512-uGyJqSIqylHrUjHLA/g31JcWrgVf8nhbi8ZR7XBVLoOiNPO5wMce4pa/grSS/LFBcsiENJbFsNaSt1CZCSzUdg==
dependencies:
"@babel/template" "^7.2.2"
core-js "2"
Expand Down
2 changes: 1 addition & 1 deletion packages/css-to-react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "taro-css-to-react-native",
"description": "Convert CSS text to a React Native stylesheet object",
"version": "3.2.0-canary.1",
"version": "3.2.0-canary.2",
"main": "dist/index.js",
"license": "MIT",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-taro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-taro",
"version": "3.2.0-canary.1",
"version": "3.2.0-canary.2",
"description": "Taro specific linting rules for ESLint",
"main": "index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-taro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-taro",
"version": "3.2.0-canary.1",
"version": "3.2.0-canary.2",
"description": "Taro specific linting plugin for ESLint",
"main": "index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-plugin-constparse/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postcss-plugin-constparse",
"version": "3.2.0-canary.1",
"version": "3.2.0-canary.2",
"description": "parse constants defined in config",
"main": "index.js",
"author": "Simba",
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-pxtransform/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postcss-pxtransform",
"version": "3.2.0-canary.1",
"version": "3.2.0-canary.2",
"description": "PostCSS plugin px 转小程序 rpx及h5 rem 单位",
"keywords": [
"postcss",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/shared",
"version": "3.2.0-canary.1",
"version": "3.2.0-canary.2",
"description": "> TODO: description",
"author": "yuche <i@yuche.me>",
"homepage": "https://github.com/nervjs/taro/tree/master/packages/shared#readme",
Expand Down
2 changes: 1 addition & 1 deletion packages/stylelint-config-taro-rn/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stylelint-config-taro-rn",
"version": "3.2.0-canary.1",
"version": "3.2.0-canary.2",
"description": "Shareable stylelint config for React Native CSS modules",
"main": "index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/stylelint-taro-rn/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "stylelint-taro-rn",
"description": "A collection of React Native specific rules for stylelint",
"version": "3.2.0-canary.1",
"version": "3.2.0-canary.2",
"main": "dist/index.js",
"files": [
"dist",
Expand Down
4 changes: 2 additions & 2 deletions packages/taro-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/api",
"version": "3.2.0-canary.1",
"version": "3.2.0-canary.2",
"description": "Taro common API",
"author": "yuche <i@yuche.me>",
"homepage": "https://github.com/nervjs/taro/tree/master/packages/api#readme",
Expand Down Expand Up @@ -29,6 +29,6 @@
"url": "https://github.com/NervJS/taro/issues"
},
"dependencies": {
"@tarojs/runtime": "3.2.0-canary.1"
"@tarojs/runtime": "3.2.0-canary.2"
}
}
22 changes: 11 additions & 11 deletions packages/taro-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/cli",
"version": "3.2.0-canary.1",
"version": "3.2.0-canary.2",
"description": "cli tool for taro",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -44,11 +44,11 @@
"license": "MIT",
"dependencies": {
"@hapi/joi": "17.1.1",
"@tarojs/helper": "3.2.0-canary.1",
"@tarojs/service": "3.2.0-canary.1",
"@tarojs/shared": "3.2.0-canary.1",
"@tarojs/taro": "3.2.0-canary.1",
"@tarojs/taroize": "3.2.0-canary.1",
"@tarojs/helper": "3.2.0-canary.2",
"@tarojs/service": "3.2.0-canary.2",
"@tarojs/shared": "3.2.0-canary.2",
"@tarojs/taro": "3.2.0-canary.2",
"@tarojs/taroize": "3.2.0-canary.2",
"@tarojs/transformer-wx": "^2.0.4",
"@types/request": "^2.48.1",
"@typescript-eslint/parser": "^2.0.0",
Expand Down Expand Up @@ -76,11 +76,11 @@
"ejs": "^2.6.1",
"envinfo": "^6.0.1",
"eslint": "^6.1.0",
"eslint-config-taro": "3.2.0-canary.1",
"eslint-config-taro": "3.2.0-canary.2",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-react-hooks": "^1.6.1",
"eslint-plugin-taro": "3.2.0-canary.1",
"eslint-plugin-taro": "3.2.0-canary.2",
"eslint-plugin-vue": "^6.2.2",
"fbjs": "^1.0.0",
"find-yarn-workspace-root": "1.2.1",
Expand All @@ -103,7 +103,7 @@
"postcss-modules-resolve-imports": "^1.3.0",
"postcss-modules-scope": "^1.1.0",
"postcss-modules-values": "^1.3.0",
"postcss-pxtransform": "3.2.0-canary.1",
"postcss-pxtransform": "3.2.0-canary.2",
"postcss-reporter": "^6.0.1",
"postcss-taro-unit-transform": "1.2.15",
"postcss-url": "^7.3.2",
Expand All @@ -124,7 +124,7 @@
"xxhashjs": "^0.2.2"
},
"devDependencies": {
"@tarojs/mini-runner": "3.2.0-canary.1",
"@tarojs/webpack-runner": "3.2.0-canary.1"
"@tarojs/mini-runner": "3.2.0-canary.2",
"@tarojs/webpack-runner": "3.2.0-canary.2"
}
}
7 changes: 5 additions & 2 deletions packages/taro-cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export default class CLI {
const args = minimist(process.argv.slice(2), {
alias: {
version: ['v'],
help: ['h']
help: ['h'],
port: ['p'],
resetCache: ['reset-cache']
},
boolean: ['version', 'help']
})
Expand All @@ -49,7 +51,8 @@ export default class CLI {
page: args.page,
component: args.component,
plugin: args.plugin,
isHelp: args.h
isHelp: args.h,
resetCache: !!args.resetCache
})
break
}
Expand Down
9 changes: 6 additions & 3 deletions packages/taro-cli/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export default function build (kernel: Kernel, {
component,
envHasBeenSet = false,
plugin,
isHelp
isHelp,
resetCache
}: {
platform: string,
isWatch: boolean,
Expand All @@ -25,7 +26,8 @@ export default function build (kernel: Kernel, {
component?: string
envHasBeenSet?: boolean
plugin?: string | boolean
isHelp?: boolean
isHelp?: boolean,
resetCache?: boolean
}) {
if (plugin) {
if (typeof plugin === 'boolean') {
Expand Down Expand Up @@ -62,7 +64,8 @@ export default function build (kernel: Kernel, {
component,
envHasBeenSet,
plugin,
isHelp
isHelp,
resetCache
}
})
}
6 changes: 4 additions & 2 deletions packages/taro-cli/src/presets/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ export default (ctx: IPluginContext) => {
'--ui': 'Build Taro UI library',
'--ui-index [uiIndexPath]': 'Index file for build Taro UI library',
'--plugin [typeName]': 'Build Taro plugin project, weapp',
'--port [port]': 'Specified port',
'--release': 'Release quickapp'
'-p, --port [port]': 'Specified port',
'--release': 'Release quickapp',
'--platform': 'Specific React-Native build target: android / ios, android is default value',
'--reset-cache': 'Clear transform cache just for React-Native'
},
async fn (opts) {
const { platform, config } = opts
Expand Down
3 changes: 2 additions & 1 deletion packages/taro-cli/src/presets/platforms/rn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default (ctx: IPluginContext) => {
useConfigName: 'rn',
async fn ({ config }) {
const { appPath, nodeModulesPath } = ctx.paths
const { deviceType, port } = ctx.runOpts
const { deviceType, port, resetCache } = ctx.runOpts
const { npm } = ctx.helper
printDevelopmentTip('rn')

Expand All @@ -67,6 +67,7 @@ export default (ctx: IPluginContext) => {
nodeModulesPath,
deviceType,
port,
resetCache,
buildAdapter: config.platform,
globalObject: 'global' // TODO: 是否可以去掉?
}
Expand Down
4 changes: 2 additions & 2 deletions packages/taro-components-rn/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/components-rn",
"version": "3.2.0-canary.1",
"version": "3.2.0-canary.2",
"description": "多端解决方案基础组件(RN)",
"main": "./dist/index.js",
"scripts": {
Expand Down Expand Up @@ -48,7 +48,7 @@
"utility-types": "^3.4.1"
},
"devDependencies": {
"@tarojs/components": "3.2.0-canary.1",
"@tarojs/components": "3.2.0-canary.2",
"@types/react-native": "^0.63.33",
"@types/sinon": "^9.0.8",
"cpy-cli": "^3.1.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/taro-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/components",
"version": "3.2.0-canary.1",
"version": "3.2.0-canary.2",
"description": "",
"main:h5": "src/index.js",
"main": "dist/index.js",
Expand Down Expand Up @@ -38,7 +38,7 @@
"license": "MIT",
"dependencies": {
"@stencil/core": "~1.8.1",
"@tarojs/taro": "3.2.0-canary.1",
"@tarojs/taro": "3.2.0-canary.2",
"better-scroll": "^1.14.1",
"classnames": "^2.2.5",
"intersection-observer": "^0.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-extend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/extend",
"version": "3.2.0-canary.1",
"version": "3.2.0-canary.2",
"description": "Taro extend functionality",
"author": "yuche <i@yuche.me>",
"homepage": "https://github.com/nervjs/taro/tree/master/packages/taro-extend#readme",
Expand Down
Loading