Skip to content

Commit

Permalink
Merge branch 'main' into feat-tt-payment-channel-select-cmp
Browse files Browse the repository at this point in the history
  • Loading branch information
ChelesteWang authored Dec 18, 2024
2 parents eede12d + 7121844 commit 6186e42
Show file tree
Hide file tree
Showing 111 changed files with 727 additions and 245 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-rust-binding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
node-version: [18.x]
settings:
- host: macos-12
- host: macos-13
target: x86_64-apple-darwin
build: |
pnpm build:binding:release
Expand All @@ -35,7 +35,7 @@ jobs:
target: x86_64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: set -e && pnpm build:binding:release && strip crates/native_binding/*.node
- host: macos-12
- host: macos-13
target: aarch64-apple-darwin
build: |
pnpm build:binding:release --target aarch64-apple-darwin
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ jobs:
fail-fast: false
matrix:
node-version: [18.x, 20.x]
host: [macos-12, windows-latest, ubuntu-latest]
host: [macos-13, windows-latest, ubuntu-latest]
include:
- host: macos-12
- host: macos-13
target: x86_64-apple-darwin
- host: windows-latest
target: x86_64-pc-windows-msvc
Expand All @@ -49,11 +49,11 @@ jobs:
target: x86_64-unknown-linux-musl
exclude:
- node-version: 18.x
host: macos-12
host: macos-13
- node-version: 18.x
host: windows-latest
- node-version: 20.x
host: macos-12
host: macos-13
- node-version: 20.x
host: windows-latest

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Taro 1/2 迁移至 Taro 3,请阅读[《Taro 版本升级权威指南》](https
| [taroify](https://github.com/mallfoundry/taroify) | https://taroify.gitee.io/taroify.com/introduce/ | 轻量、可靠的小程序端 Taro 组件库(Vant 的 Taro 版本) | React | Taro 3 |
| [@antmjs/vantui](https://github.com/AntmJS/vantui) | https://antmjs.github.io/vantui/#/home | 基于有赞 VantWeapp 开发的同时支持 Taro 和 React 的 UI 库 | React | Taro 3 |
| [Tard](https://github.com/jd-antelope/tard) | https://tard-ui.selling.cn/ | 一套基于 Taro 框架开发的多端 React UI 组件库 | React | Taro 3 |
| [duxui](https://github.com/duxapp/duxui) | https://duxapp.cn/docs/duxui/start/ | 一套能同时兼容小程序、React Native、鸿蒙、H5的移动端ui组件库| React | Taro 4 |

## 项目状态

Expand Down
2 changes: 1 addition & 1 deletion crates/native_binding/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/binding",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "Node binding for taro",
"main": "binding.js",
"typings": "binding.d.ts",
Expand Down
70 changes: 68 additions & 2 deletions crates/swc_plugin_define_config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use swc_core::{

struct DefineConfigVisitor {
fn_name: Option<Ident>,
imp_name: Option<Ident>,
}

impl VisitMut for DefineConfigVisitor {
Expand All @@ -20,6 +21,8 @@ impl VisitMut for DefineConfigVisitor {
if let Expr::Ident(ident) = &**expr {
if ident.sym == "defineAppConfig" || ident.sym == "definePageConfig" {
self.fn_name = Some(ident.clone());
} else if ident.sym == "importNativeComponent" {
self.imp_name = Some(ident.clone());
}
}
}
Expand All @@ -30,9 +33,12 @@ pub struct TransformVisitor;

impl VisitMut for TransformVisitor {
fn visit_mut_module_items(&mut self, items: &mut Vec<ModuleItem>) {
let mut folder = DefineConfigVisitor { fn_name: None };
let mut folder = DefineConfigVisitor {
fn_name: None,
imp_name: None,
};

let is_found = items.iter_mut().any(|item| {
let mut is_found = items.iter_mut().any(|item| {
item.visit_mut_with(&mut folder);
folder.fn_name.is_some()
});
Expand Down Expand Up @@ -64,6 +70,66 @@ impl VisitMut for TransformVisitor {
ModuleItem::Stmt(Stmt::Decl(Decl::Fn(func.into_fn_decl(fn_name)))),
);
}

is_found = items.iter_mut().any(|item| {
item.visit_mut_with(&mut folder);
folder.imp_name.is_some()
});

if is_found {
let imp_name = folder.imp_name.take().unwrap();
let func = Function {
span,
decorators: Default::default(),
params: vec![
// path 参数,默认值为空字符串
Param {
span,
decorators: Default::default(),
pat: Pat::Assign(AssignPat {
span,
left: Box::new(Pat::Ident(quote_ident!("path").into())),
right: Box::new(Expr::Lit(Lit::Str("".into()))),
}),
},
// name 参数,默认值为空字符串
Param {
span,
decorators: Default::default(),
pat: Pat::Assign(AssignPat {
span,
left: Box::new(Pat::Ident(quote_ident!("name").into())),
right: Box::new(Expr::Lit(Lit::Str("".into()))),
}),
},
// exportName 参数,默认值为 'default'
Param {
span,
decorators: Default::default(),
pat: Pat::Assign(AssignPat {
span,
left: Box::new(Pat::Ident(quote_ident!("exportName").into())),
right: Box::new(Expr::Lit(Lit::Str("default".into()))),
}),
},
],
body: Some(BlockStmt {
span,
stmts: vec![Stmt::Return(ReturnStmt {
span,
arg: Some(Box::new(quote_ident!("name").into())),
})],
}),
is_async: false,
is_generator: false,
type_params: None,
return_type: None,
};
prepend_stmt(
items,
ModuleItem::Stmt(Stmt::Decl(Decl::Fn(func.into_fn_decl(imp_name)))),
);
}
}
}

Expand Down
4 changes: 1 addition & 3 deletions examples/swiper-effect/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
"jsx": "react-jsx",
"allowJs": true,
"resolveJsonModule": true,
"typeRoots": [
"node_modules/@types"
],
"typeRoots": ["node_modules/@types"],
"paths": {
// TS5090 leading './'
"@/*": ["./src/*"]
Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tarojs/binding-darwin-arm64",
"description": "Native binding for taro",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tarojs/binding-darwin-x64",
"description": "Native binding for taro",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tarojs/binding-linux-x64-gnu",
"description": "Native binding for taro",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-x64-musl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/binding-linux-x64-musl",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/win32-x64-msvc/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tarojs/binding-win32-x64-msvc",
"description": "Native binding for taro",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"os": [
"win32"
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "taro",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "开放式跨端跨框架开发解决方案",
"homepage": "https://github.com/NervJS/taro#readme",
"author": "O2Team",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-plugin-transform-react-jsx-to-rn-stylesheet",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "Transform stylesheet selector to style in JSX Elements.",
"author": "O2Team",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin-transform-solid-jsx/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "babel-plugin-transform-solid-jsx",
"description": "A JSX to DOM plugin that wraps expressions for fine grained change detection",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
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": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"author": "O2Team",
"license": "MIT",
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion 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": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "Taro babel preset",
"author": "O2Team",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/create-app",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "create taro app with one command",
"author": "O2Team",
"license": "MIT",
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": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"author": "O2Team",
"license": "MIT",
"main": "dist/index.js",
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": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "Taro specific linting rules for ESLint",
"author": "O2Team",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-helper/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jest-taro-helper",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "jest helper for taro",
"private": true,
"author": "O2Team",
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-html-transform/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postcss-html-transform",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "transform html tag name selector",
"author": "O2Team",
"license": "MIT",
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": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "parse constants defined in config",
"author": "O2Team",
"license": "MIT",
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": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "PostCSS plugin px 转小程序 rpx及h5 rem 单位",
"author": "O2Team",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-unit-transform/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postcss-taro-unit-transform",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "小程序单位转换",
"author": "O2Team",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/rollup-plugin-copy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rollup-plugin-copy",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "rollup-plugin-copy for taro",
"private": true,
"author": "O2Team",
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": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "Taro utils internal use.",
"author": "O2Team",
"license": "MIT",
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": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "Shareable stylelint config for React Native CSS modules",
"author": "O2Team",
"license": "MIT",
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,6 +1,6 @@
{
"name": "stylelint-taro-rn",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "A collection of React Native specific rules for stylelint",
"author": "O2Team",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/stylelint-taro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stylelint-taro",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "Taro stylelint 规则集合",
"author": "O2Team",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/api",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "Taro common API",
"author": "O2Team",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-cli-convertor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/cli-convertor",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "cli tool for taro-convert",
"author": "O2Team",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/cli",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "cli tool for taro",
"author": "O2Team",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components-advanced/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/components-advanced",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "",
"author": "O2Team",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components-library-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/components-library-react",
"version": "4.0.8-beta.1",
"version": "4.0.9-beta.2",
"description": "Taro 组件库 React 版本库",
"private": true,
"author": "O2Team",
Expand Down
Loading

0 comments on commit 6186e42

Please sign in to comment.