@tarojs/taro 4.0.0-beta.93 → 4.0.0-beta.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +36 -20
- package/types/api/base/env.d.ts +1 -1
- package/types/api/network/request.d.ts +1 -1
- package/types/api/swan/pay.d.ts +4 -4
- package/types/compile/compiler.d.ts +4 -2
- package/types/compile/config/h5.d.ts +1 -1
- package/types/compile/config/index.d.ts +1 -0
- package/types/compile/config/mini.d.ts +1 -1
- package/types/compile/config/project.d.ts +8 -8
- package/types/compile/config/rn.d.ts +21 -0
- package/types/compile/viteCompilerContext.d.ts +2 -1
- package/types/index.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/taro",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.95",
|
|
4
4
|
"description": "Taro framework",
|
|
5
|
-
"
|
|
5
|
+
"author": "O2Team",
|
|
6
|
+
"license": "MIT",
|
|
6
7
|
"main": "index.js",
|
|
7
8
|
"typings": "types/index.d.ts",
|
|
8
9
|
"files": [
|
|
@@ -18,45 +19,60 @@
|
|
|
18
19
|
"keywords": [
|
|
19
20
|
"taro"
|
|
20
21
|
],
|
|
21
|
-
"
|
|
22
|
-
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">= 18"
|
|
24
|
+
},
|
|
23
25
|
"dependencies": {
|
|
24
|
-
"@
|
|
26
|
+
"@types/postcss-url": "^10.0.4",
|
|
27
|
+
"@tarojs/api": "4.0.0-beta.95",
|
|
28
|
+
"@tarojs/runtime": "4.0.0-beta.95"
|
|
25
29
|
},
|
|
26
30
|
"devDependencies": {
|
|
27
|
-
"@
|
|
28
|
-
"
|
|
29
|
-
"
|
|
31
|
+
"@types/react": "^18.3.1",
|
|
32
|
+
"html-webpack-plugin": "^5.6.0",
|
|
33
|
+
"postcss": "^8.4.38",
|
|
34
|
+
"webpack": "5.91.0",
|
|
35
|
+
"webpack-chain": "^6.5.1",
|
|
36
|
+
"webpack-dev-server": "^4.15.2",
|
|
37
|
+
"rollup": "^3.29.4",
|
|
38
|
+
"@tarojs/components": "4.0.0-beta.95",
|
|
39
|
+
"@tarojs/helper": "4.0.0-beta.95",
|
|
40
|
+
"@tarojs/shared": "4.0.0-beta.95"
|
|
30
41
|
},
|
|
31
42
|
"peerDependencies": {
|
|
32
|
-
"@
|
|
33
|
-
"
|
|
34
|
-
"
|
|
43
|
+
"@types/react": "^18",
|
|
44
|
+
"html-webpack-plugin": "^5",
|
|
45
|
+
"rollup": "^3",
|
|
46
|
+
"postcss": "^8",
|
|
47
|
+
"vue": "^3",
|
|
48
|
+
"webpack": "^5",
|
|
49
|
+
"webpack-chain": "^6",
|
|
50
|
+
"webpack-dev-server": "^4",
|
|
51
|
+
"@tarojs/helper": "4.0.0-beta.95",
|
|
52
|
+
"@tarojs/components": "4.0.0-beta.95",
|
|
53
|
+
"@tarojs/shared": "4.0.0-beta.95"
|
|
35
54
|
},
|
|
36
55
|
"peerDependenciesMeta": {
|
|
37
56
|
"@types/react": {
|
|
38
57
|
"optional": true
|
|
39
58
|
},
|
|
40
|
-
"
|
|
59
|
+
"html-webpack-plugin": {
|
|
41
60
|
"optional": true
|
|
42
61
|
},
|
|
43
|
-
"
|
|
62
|
+
"rollup": {
|
|
44
63
|
"optional": true
|
|
45
64
|
},
|
|
46
|
-
"
|
|
65
|
+
"vue": {
|
|
47
66
|
"optional": true
|
|
48
67
|
},
|
|
49
|
-
"
|
|
68
|
+
"webpack": {
|
|
50
69
|
"optional": true
|
|
51
70
|
},
|
|
52
|
-
"
|
|
71
|
+
"webpack-chain": {
|
|
53
72
|
"optional": true
|
|
54
73
|
},
|
|
55
|
-
"
|
|
74
|
+
"webpack-dev-server": {
|
|
56
75
|
"optional": true
|
|
57
76
|
}
|
|
58
|
-
},
|
|
59
|
-
"scripts": {
|
|
60
|
-
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
61
77
|
}
|
|
62
78
|
}
|
package/types/api/base/env.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ declare module '../../index' {
|
|
|
9
9
|
env: {
|
|
10
10
|
[key: string]: string | undefined
|
|
11
11
|
/** 框架 */
|
|
12
|
-
FRAMEWORK: 'react' | 'preact' | 'solid' | '
|
|
12
|
+
FRAMEWORK: 'react' | 'preact' | 'solid' | 'vue3'
|
|
13
13
|
/** Taro 环境变量 */
|
|
14
14
|
TARO_ENV: 'weapp' | 'h5' | 'rn' | 'swan' | 'alipay' | 'tt' | 'qq' | 'jd' | 'quickapp'
|
|
15
15
|
/** 文件系统中的用户目录路径 (本地路径) */
|
|
@@ -78,7 +78,7 @@ declare module '../../index' {
|
|
|
78
78
|
/** 接口调用失败的回调函数 */
|
|
79
79
|
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
80
80
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
81
|
-
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
81
|
+
complete?: (res: Partial<SuccessCallbackResult> & TaroGeneral.CallbackResult) => void
|
|
82
82
|
/** 设置是否使用 jsonp 方式获取数据
|
|
83
83
|
* @default false
|
|
84
84
|
* @supported h5
|
package/types/api/swan/pay.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Interface } from 'readline'
|
|
1
|
+
import { Interface } from 'node:readline'
|
|
2
2
|
import Taro from '../../index'
|
|
3
3
|
|
|
4
4
|
declare module '../../index' {
|
|
@@ -117,12 +117,12 @@ declare module '../../index' {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
interface TaroStatic {
|
|
120
|
-
/**
|
|
120
|
+
/**
|
|
121
121
|
* 1)百度收银台,聚合了主流的百度钱包、微信、支付宝、网银等多种支付渠道,方便开发者一站式快速接入多种支付渠道,让百度用户能在智能小程序场景下,直接完成支付、交易闭环,提升用户支付体验的同时,提高智能小程序的订单转化率。
|
|
122
122
|
* 2)上述支付渠道在 C 端收银台有两种展示方式,开发者可以选择其中一种实现。
|
|
123
123
|
* 方式一:将支付渠道内嵌在小程序提单页面中,实现方式参考文档[inline-payment-panel内嵌支付组件](https://smartprogram.baidu.com/docs/develop/component/inline_payment_panel/)。
|
|
124
124
|
* 方式二:在用户确认订单后,调起收银台半屏面板承载支付渠道,实现方式参考文档调起[百度收银台](https://smartprogram.baidu.com/docs/develop/function/tune_up_2.0/#%E7%99%BE%E5%BA%A6%E6%94%B6%E9%93%B6%E5%8F%B0%E6%8E%A5%E5%8F%A32-0-%E8%AF%B4%E6%98%8E)。
|
|
125
|
-
*
|
|
125
|
+
*
|
|
126
126
|
* Web 态说明:为了保证用户交易行为全流程闭环体验,在 Web 态下调用该方法会做打开百度 App 对应小程序页面的降级处理。
|
|
127
127
|
* @supported swan
|
|
128
128
|
* @see https://smartprogram.baidu.com/docs/develop/api/open/payment_swan-requestPolymerPayment/
|
|
@@ -136,4 +136,4 @@ declare module '../../index' {
|
|
|
136
136
|
*/
|
|
137
137
|
getOptimalPriceInfo(option: getOptimalPriceInfo.Option): void
|
|
138
138
|
}
|
|
139
|
-
}
|
|
139
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { swc } from '@tarojs/helper'
|
|
2
2
|
import type Webpack from 'webpack'
|
|
3
3
|
|
|
4
|
-
export type
|
|
4
|
+
export type CompilerViteTypes = 'vite'
|
|
5
5
|
|
|
6
|
-
export type CompilerWebpackTypes = 'webpack5'
|
|
6
|
+
export type CompilerWebpackTypes = 'webpack5'
|
|
7
|
+
|
|
8
|
+
export type CompilerTypes = CompilerWebpackTypes | CompilerViteTypes
|
|
7
9
|
|
|
8
10
|
interface IPrebundle {
|
|
9
11
|
enable?: boolean
|
|
@@ -124,6 +124,6 @@ export interface IH5Config <T extends CompilerTypes = CompilerWebpackTypes> {
|
|
|
124
124
|
/** 生成的代码是否要兼容旧版浏览器,值为 true 时,会去读取 package.json 的 browserslist 字段。只在 vite 编译模式下有效 */
|
|
125
125
|
legacy?: T extends 'vite' ? boolean : undefined
|
|
126
126
|
|
|
127
|
-
/** 使用的编译工具。可选值:
|
|
127
|
+
/** 使用的编译工具。可选值:webpack5、vite */
|
|
128
128
|
compiler?: Compiler<T>
|
|
129
129
|
}
|
|
@@ -116,7 +116,7 @@ export interface IProjectBaseConfig {
|
|
|
116
116
|
jsMinimizer?: 'terser' | 'esbuild'
|
|
117
117
|
|
|
118
118
|
/** 配置 CSS 压缩工具 (默认 csso) */
|
|
119
|
-
cssMinimizer?: 'csso' | 'esbuild' | '
|
|
119
|
+
cssMinimizer?: 'csso' | 'esbuild' | 'lightningcss'
|
|
120
120
|
|
|
121
121
|
/** 配置 csso 工具以压缩 CSS 代码 */
|
|
122
122
|
csso?: TogglableOptions
|
|
@@ -140,11 +140,11 @@ export interface IProjectBaseConfig {
|
|
|
140
140
|
/** 模板循环次数 */
|
|
141
141
|
baseLevel?: number
|
|
142
142
|
|
|
143
|
-
/** 使用的开发框架。可选值:react、preact、
|
|
144
|
-
framework?: 'react' | 'preact' | 'solid' | '
|
|
143
|
+
/** 使用的开发框架。可选值:react、preact、vue3 */
|
|
144
|
+
framework?: 'react' | 'preact' | 'solid' | 'vue3'
|
|
145
145
|
frameworkExts?: string[]
|
|
146
146
|
|
|
147
|
-
/** 使用的编译工具。可选值:
|
|
147
|
+
/** 使用的编译工具。可选值:webpack5 */
|
|
148
148
|
compiler?: Compiler
|
|
149
149
|
|
|
150
150
|
/** Webpack5 持久化缓存配置。具体配置请参考 [WebpackConfig.cache](https://webpack.js.org/configuration/cache/#cache) */
|
|
@@ -277,7 +277,7 @@ export interface IProjectConfig<T extends CompilerTypes = CompilerWebpackTypes>
|
|
|
277
277
|
jsMinimizer?: 'terser' | 'esbuild'
|
|
278
278
|
|
|
279
279
|
/** 配置 CSS 压缩工具 (默认 csso) */
|
|
280
|
-
cssMinimizer?: 'csso' | 'esbuild' | '
|
|
280
|
+
cssMinimizer?: 'csso' | 'esbuild' | 'lightningcss'
|
|
281
281
|
|
|
282
282
|
/** 配置 csso 工具以压缩 CSS 代码 */
|
|
283
283
|
csso?: TogglableOptions
|
|
@@ -296,8 +296,8 @@ export interface IProjectConfig<T extends CompilerTypes = CompilerWebpackTypes>
|
|
|
296
296
|
/** 一个 preset 是一系列 Taro 插件的集合,配置语法同 plugins */
|
|
297
297
|
presets?: PluginItem[]
|
|
298
298
|
|
|
299
|
-
/** 使用的开发框架。可选值:react、preact、
|
|
300
|
-
framework?: 'react' | 'preact' | 'solid' | '
|
|
299
|
+
/** 使用的开发框架。可选值:react、preact、solid、vue3 */
|
|
300
|
+
framework?: 'react' | 'preact' | 'solid' | 'vue3'
|
|
301
301
|
|
|
302
302
|
/** Webpack5 持久化缓存配置。具体配置请参考 [WebpackConfig.cache](https://webpack.js.org/configuration/cache/#cache) */
|
|
303
303
|
cache?: ICache
|
|
@@ -305,7 +305,7 @@ export interface IProjectConfig<T extends CompilerTypes = CompilerWebpackTypes>
|
|
|
305
305
|
/** 控制 Taro 编译日志的输出方式 */
|
|
306
306
|
logger?: ILogger
|
|
307
307
|
|
|
308
|
-
/** 使用的编译工具。可选值:
|
|
308
|
+
/** 使用的编译工具。可选值:webpack5、vite */
|
|
309
309
|
compiler?: Compiler<T>
|
|
310
310
|
|
|
311
311
|
/** 专属于 H5 的配置 */
|
|
@@ -2,6 +2,7 @@ import type Webpack from 'webpack'
|
|
|
2
2
|
import type Chain from 'webpack-chain'
|
|
3
3
|
import type webpackDevServer from 'webpack-dev-server'
|
|
4
4
|
import type HtmlWebpackPlugin from 'html-webpack-plugin'
|
|
5
|
+
import type { RollupOptions } from 'rollup'
|
|
5
6
|
import type { IOption, IPostcssOption } from './util'
|
|
6
7
|
|
|
7
8
|
export interface IRNConfig {
|
|
@@ -61,4 +62,24 @@ export interface IRNConfig {
|
|
|
61
62
|
|
|
62
63
|
/** 设计稿尺寸换算规则 */
|
|
63
64
|
deviceRatio?: TaroGeneral.TDeviceRatio
|
|
65
|
+
|
|
66
|
+
/** 原生组件编译配置 */
|
|
67
|
+
nativeComponents?: {
|
|
68
|
+
/**
|
|
69
|
+
* 外部依赖
|
|
70
|
+
*/
|
|
71
|
+
external?: Array<string | RegExp> | ((arr: Array<string | RegExp>) => Array<string | RegExp>)
|
|
72
|
+
/**
|
|
73
|
+
* 设置外部依赖,如果返回 string, 则将该值作为 external, 我们默认将 node_modules 路径下的文件设置为外部依赖
|
|
74
|
+
*/
|
|
75
|
+
exteranlResolve?: (importee: string, importer: string) => string
|
|
76
|
+
/**
|
|
77
|
+
* 组件输出路径,默认值为 'dist'
|
|
78
|
+
*/
|
|
79
|
+
output?: string
|
|
80
|
+
/**
|
|
81
|
+
* 修改 Rollup 打包配置
|
|
82
|
+
*/
|
|
83
|
+
modifyRollupConfig?: (config: RollupOptions, innerPlugins: { taroResolver: typeof taroResolver, styleTransformer: typeof styleTransformer }) => RollupOptions
|
|
84
|
+
}
|
|
64
85
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { RecursiveTemplate, UnRecursiveTemplate } from '@tarojs/shared/dist/template'
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import type { PluginContext } from 'rollup'
|
|
4
4
|
import type { IMiniFilesConfig, IH5Config, IHarmonyConfig, IMiniAppConfig } from './config'
|
|
5
5
|
import type { IProjectConfig } from './config/project'
|
|
6
6
|
import type { IComponentConfig } from './hooks'
|
|
7
7
|
import type { IFileType } from './index'
|
|
8
|
+
import type { AppConfig, PageConfig } from '../index'
|
|
8
9
|
|
|
9
10
|
export interface ViteNativeCompMeta {
|
|
10
11
|
name: string
|
package/types/index.d.ts
CHANGED