Skip to content

Commit

Permalink
Merge branch 'main' into fix/h5
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKonka authored Sep 16, 2024
2 parents f1f42ad + 1ed101a commit c26ada8
Show file tree
Hide file tree
Showing 127 changed files with 1,663 additions and 697 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@ jobs:
run: pnpm test
env:
CI: true
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

# 以下 coverage 流程通过 artifact 拆分文件作为单独 job 上传时间损耗过长,因此在在 node test 后直接继续执行
- name: Upload [taro-cli] coverage to Codecov
uses: codecov/codecov-action@v4
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.4",
"version": "4.0.5",
"description": "Node binding for taro",
"main": "binding.js",
"typings": "binding.d.ts",
Expand Down
13 changes: 6 additions & 7 deletions examples/mini-program-example/src/pages/index/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,20 @@ export default function Index() {
</Button>
<Button
onClick={()=>{
nativeApi.harmonyNavigateTo({
indexHtmlPath: '/spa/new/index.html',
taroPath: 'pages/performance/index/index'
Taro.navigateTo({
url: 'pages/harmony-hybrid/mix-router/home/index'
})
}}>
多实例(多SPA跳转):性能列表页
多实例及混合路由测试页
</Button>
<Button
onClick={()=>{
nativeApi.harmonyNavigateTo({
nativeApi.navigateToTaroHybrid({
indexHtmlPath: '/spa/new/index.html',
taroPath: 'pages/api/index/index'
taroPath: '/pages/index/index'
})
}}>
单实例(单SPA):接口列表页
单实例(单SPA):首页
</Button>
</View>
)
Expand Down
13 changes: 7 additions & 6 deletions examples/mini-program-example/src/util/nativeApi.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// @ts-ignore
const decorator = window.MethodChannel && window.MethodChannel.jsBridgeMode({ isAsync: false, autoRelease: true }) || (target => target)
const sync = window.MethodChannel && window.MethodChannel.jsBridgeMode({ isAsync: false, autoRelease: true }) || (target => target)

// @proxyClassSign('')
class NativeApi {
// @ts-ignore
@decorator
harmonyNavigateTo(options: any) {
return options
}
@sync
navigateToTaroHybrid(_options: any) {}


@sync
navigateToNative(_options: any){}
}

const nativeApi = new NativeApi()
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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"os": [
"win32"
],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "taro",
"version": "4.0.4",
"version": "4.0.5",
"description": "开放式跨端跨框架开发解决方案",
"homepage": "https://github.com/NervJS/taro#readme",
"author": "O2Team",
Expand Down Expand Up @@ -29,7 +29,7 @@
"lint:style": "stylelint ./packages/**/*.{css,scss}",
"format": "prettier --write --cache .",
"format:check": "prettier --check --cache .",
"test": "pnpm --if-present -r --aggregate-output --filter=./packages/* test:ci",
"test": "pnpm --if-present -r --aggregate-output --filter=./packages/* --filter=./tests test:ci",
"test:binding": "pnpm --filter @tarojs/binding run test",
"updateSnapshot": "pnpm --if-present -r --aggregate-output --filter=./tests --filter=./packages/* updateSnapshot",
"version": "run-s version:*",
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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"description": "cli tool for taro",
"author": "O2Team",
"license": "MIT",
Expand Down
3 changes: 2 additions & 1 deletion packages/taro-cli/templates/default/_gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ deploy_versions/
.rn_temp/
node_modules/
.DS_Store
.swc
.swc
*.local
3 changes: 3 additions & 0 deletions packages/taro-cli/templates/default/template_creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const handler = {
'/types/vue.d.ts' (err, { framework, typescript }) {
return ['Vue3'].includes(framework) && !!typescript
},
'/types/solid.d.ts' (err, { framework, typescript }) {
return ['Solid'].includes(framework) && !!typescript
},
'/src/pages/index/index.jsx' (err, { pageDir = '', pageName = '', subPkg = '' }) {
return {
setPageName: normalizePath(path.join(PAGES_ENTRY, pageDir, pageName, 'index.jsx')),
Expand Down
5 changes: 3 additions & 2 deletions packages/taro-cli/templates/default/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
"strictNullChecks": true,
"sourceMap": true,
"rootDir": ".",
"jsx": "{{#if (includes "Vue3" s=framework)}}preserve{{else}}react-jsx{{/if}}",{{#if (eq framework "Preact") }}
"jsx": "{{#if (includes "Vue3" s=framework)}}preserve{{else if (eq framework 'Solid')}}preserve{{else}}react-jsx{{/if}}",{{#if (eq framework "Preact") }}
"skipLibCheck": true,{{/if}}
"allowJs": true,
"allowJs": true,{{#if (eq framework "Solid")}}
"jsxImportSource": "solid-js",{{/if}}
"resolveJsonModule": true,
"typeRoots": [
"node_modules/@types"
Expand Down
3 changes: 3 additions & 0 deletions packages/taro-cli/templates/default/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ declare namespace NodeJS {
{{#if (includes "Vue3" s=framework)}}
declare module '@tarojs/components' {
export * from '@tarojs/components/types/index.vue3'
}{{else if (includes "Solid" s=framework)}}
declare module '@tarojs/components' {
export * from '@tarojs/components/types/index.solid'
}{{/if}}
12 changes: 12 additions & 0 deletions packages/taro-cli/templates/default/types/solid.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export { }

declare module 'solid-js' {
namespace JSX {
interface Directives {
/** Note:如果需要定义自定义指令的类型,可以在这里做
* 参考官网文档https://docs.solidjs.com/reference/jsx-attributes/use
* model: [() => any, (v: any) => any]
*/
}
}
}
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.4",
"version": "4.0.5",
"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.4",
"version": "4.0.5",
"description": "Taro 组件库 React 版本库",
"private": true,
"author": "O2Team",
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components-library-solid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/components-library-solid",
"version": "4.0.4",
"version": "4.0.5",
"description": "Taro 组件库 Solid 版本库",
"private": true,
"main": "index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-components-library-vue3/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/components-library-vue3",
"version": "4.0.4",
"version": "4.0.5",
"description": "Taro 组件库 Vue3 版本库",
"private": true,
"author": "O2Team",
Expand Down
4 changes: 2 additions & 2 deletions packages/taro-components-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/components-react",
"version": "4.0.4",
"version": "4.0.5",
"description": "",
"main:h5": "dist/index.js",
"main": "dist/index.js",
Expand Down Expand Up @@ -37,7 +37,7 @@
"@tarojs/components": "workspace:*",
"@babel/runtime": "^7.24.4",
"classnames": "^2.2.5",
"swiper": "6.8.0",
"swiper": "11.1.0",
"tslib": "^2.6.2"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit c26ada8

Please sign in to comment.