@tarojs/taro 3.7.0-canary.3 → 3.7.0-canary.5
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 +5 -5
- package/types/api/device/clipboard.d.ts +14 -14
- package/types/api/device/screen.d.ts +1 -1
- package/types/compile/config/h5.d.ts +4 -1
- package/types/compile/config/mini.d.ts +4 -1
- package/types/compile/config/plugin.d.ts +34 -0
- package/types/compile/config/util.d.ts +2 -0
- package/types/compile/viteCompilerContext.d.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/taro",
|
|
3
|
-
"version": "3.7.0-canary.
|
|
3
|
+
"version": "3.7.0-canary.5",
|
|
4
4
|
"description": "Taro framework",
|
|
5
5
|
"homepage": "https://github.com/nervjs/taro/tree/master/packages/taro#readme",
|
|
6
6
|
"main": "index.js",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"author": "O2Team",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@tarojs/
|
|
25
|
-
"@tarojs/
|
|
24
|
+
"@tarojs/runtime": "3.7.0-canary.5",
|
|
25
|
+
"@tarojs/api": "3.7.0-canary.5"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@tarojs/helper": "3.7.0-canary.
|
|
29
|
-
"@tarojs/shared": "3.7.0-canary.
|
|
28
|
+
"@tarojs/helper": "3.7.0-canary.5",
|
|
29
|
+
"@tarojs/shared": "3.7.0-canary.5"
|
|
30
30
|
},
|
|
31
31
|
"peerDependenciesMeta": {
|
|
32
32
|
"@types/react": {
|
|
@@ -43,7 +43,7 @@ declare module '../../index' {
|
|
|
43
43
|
|
|
44
44
|
interface TaroStatic {
|
|
45
45
|
/** 设置系统剪贴板的内容。调用成功后,会弹出 toast 提示"内容已复制",持续 1.5s
|
|
46
|
-
* @supported weapp, swan, jd, qq, h5, rn
|
|
46
|
+
* @supported weapp, swan, jd, qq, tt, h5, rn
|
|
47
47
|
* @h5 部分实现
|
|
48
48
|
* @example
|
|
49
49
|
* ```tsx
|
|
@@ -63,19 +63,19 @@ declare module '../../index' {
|
|
|
63
63
|
setClipboardData(option: setClipboardData.Option): Promise<setClipboardData.Promised>
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
66
|
+
* 获取系统剪贴板内容
|
|
67
|
+
* @supported weapp, swan, jd, qq, tt, h5, rn
|
|
68
|
+
* @h5 部分实现
|
|
69
|
+
* @example
|
|
70
|
+
* ```tsx
|
|
71
|
+
* Taro.getClipboardData({
|
|
72
|
+
* success: function (res){
|
|
73
|
+
* console.log(res.data)
|
|
74
|
+
* }
|
|
75
|
+
* })
|
|
76
|
+
* ```
|
|
77
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/clipboard/wx.getClipboardData.html
|
|
78
|
+
*/
|
|
79
79
|
getClipboardData(res?: getClipboardData.Option): Promise<getClipboardData.Promised>
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -179,7 +179,7 @@ declare module '../../index' {
|
|
|
179
179
|
|
|
180
180
|
/** 取消用户录屏事件的监听函数
|
|
181
181
|
* @supported weapp
|
|
182
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offScreenRecordingStateChanged.html
|
|
182
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offScreenRecordingStateChanged.html
|
|
183
183
|
*/
|
|
184
184
|
offScreenRecordingStateChanged(
|
|
185
185
|
/** 用户录屏事件的监听函数 */
|
|
@@ -4,7 +4,7 @@ import type webpackDevServer from 'webpack-dev-server'
|
|
|
4
4
|
import type HtmlWebpackPlugin from 'html-webpack-plugin'
|
|
5
5
|
import type { IOption, IPostcssOption, IUrlLoaderOption } from './util'
|
|
6
6
|
import type { OutputOptions as RollupOutputOptions } from 'rollup'
|
|
7
|
-
import type { CompilerTypes, CompilerWebpackTypes } from '../compiler'
|
|
7
|
+
import type { Compiler, CompilerTypes, CompilerWebpackTypes } from '../compiler'
|
|
8
8
|
|
|
9
9
|
export interface IH5RouterConfig {
|
|
10
10
|
/** 配置路由模式 */
|
|
@@ -120,4 +120,7 @@ export interface IH5Config <T extends CompilerTypes = CompilerWebpackTypes> {
|
|
|
120
120
|
}
|
|
121
121
|
/** 生成的代码是否要兼容旧版浏览器,值为 true 时,会去读取 package.json 的 browserslist 字段。只在 vite 编译模式下有效 */
|
|
122
122
|
legacy?: T extends 'vite' ? boolean : undefined
|
|
123
|
+
|
|
124
|
+
/** 使用的编译工具。可选值:webpack4、webpack5、vite */
|
|
125
|
+
compiler?: Compiler<T>
|
|
123
126
|
}
|
|
@@ -2,7 +2,7 @@ import type Webpack from 'webpack'
|
|
|
2
2
|
import type Chain from 'webpack-chain'
|
|
3
3
|
import type { IOption, IPostcssOption, IUrlLoaderOption } from './util'
|
|
4
4
|
import type { OutputOptions as RollupOutputOptions } from 'rollup'
|
|
5
|
-
import type { CompilerTypes, CompilerWebpackTypes } from '../compiler'
|
|
5
|
+
import type { Compiler, CompilerTypes, CompilerWebpackTypes } from '../compiler'
|
|
6
6
|
|
|
7
7
|
interface Runtime {
|
|
8
8
|
enableInnerHTML?: boolean
|
|
@@ -112,6 +112,9 @@ export interface IMiniAppConfig<T extends CompilerTypes = CompilerWebpackTypes>
|
|
|
112
112
|
|
|
113
113
|
/** 插件内部使用 */
|
|
114
114
|
runtime?: Runtime
|
|
115
|
+
|
|
116
|
+
/** 使用的编译工具。可选值:webpack4、webpack5、vite */
|
|
117
|
+
compiler?: Compiler<T>
|
|
115
118
|
}
|
|
116
119
|
|
|
117
120
|
export interface IMiniFilesConfig {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { CustomPluginOptions, ResolvedId, ResolveIdResult } from 'rollup'
|
|
2
|
+
|
|
3
|
+
interface IRollupPluginResolveIdOptions {
|
|
4
|
+
assertions?: Record<string, string>
|
|
5
|
+
custom?: CustomPluginOptions
|
|
6
|
+
isEntry?: boolean
|
|
7
|
+
skipSelf?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type TRollupResolveMethod = (
|
|
11
|
+
source: string,
|
|
12
|
+
importer?: string,
|
|
13
|
+
options?: IRollupPluginResolveIdOptions
|
|
14
|
+
) => Promise<ResolvedId | null>
|
|
15
|
+
|
|
16
|
+
export interface ILoaderMeta {
|
|
17
|
+
importFrameworkStatement: string
|
|
18
|
+
importFrameworkName: string
|
|
19
|
+
creator: string
|
|
20
|
+
creatorLocation: string
|
|
21
|
+
extraImportForWeb: string
|
|
22
|
+
execBeforeCreateWebApp: string
|
|
23
|
+
frameworkArgs: string
|
|
24
|
+
isNeedRawLoader?: boolean
|
|
25
|
+
mockAppStatement: string
|
|
26
|
+
modifyConfig?: (config: Record<string, any>, source: string) => void
|
|
27
|
+
modifyResolveId?: (res: {
|
|
28
|
+
source?: string
|
|
29
|
+
importer?: string
|
|
30
|
+
options?: IRollupPluginResolveIdOptions
|
|
31
|
+
name?: string
|
|
32
|
+
resolve: TRollupResolveMethod
|
|
33
|
+
}) => Promise<ResolveIdResult> | ResolveIdResult
|
|
34
|
+
}
|
|
@@ -94,6 +94,8 @@ export type IPostcssOption<T = 'h5' | 'mini'> = T extends 'h5'
|
|
|
94
94
|
? IBasePostcssOption & { url?: PostcssOption.url }
|
|
95
95
|
: IBasePostcssOption
|
|
96
96
|
|
|
97
|
+
export type Config = ViteConfig | WebpackConfig
|
|
98
|
+
|
|
97
99
|
export interface ICopyOptions {
|
|
98
100
|
patterns: {
|
|
99
101
|
from: string
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import type { RecursiveTemplate, UnRecursiveTemplate } from '@tarojs/shared/dist/template'
|
|
2
|
+
import type { PluginContext } from 'rollup'
|
|
1
3
|
import type { AppConfig, PageConfig } from '../index'
|
|
2
4
|
import type { IMiniFilesConfig, IH5Config, IMiniAppConfig } from './config'
|
|
3
5
|
import type { IProjectConfig } from './config/project'
|
|
4
|
-
import type {
|
|
5
|
-
import { IComponentConfig } from "./hooks"
|
|
6
|
-
|
|
7
|
-
import type { RecursiveTemplate, UnRecursiveTemplate } from '@tarojs/shared/dist/template'
|
|
6
|
+
import type { IComponentConfig } from './hooks'
|
|
8
7
|
|
|
9
8
|
export interface ViteNativeCompMeta {
|
|
10
9
|
name: string
|
|
@@ -91,6 +90,7 @@ export interface ViteCompilerContext<T> {
|
|
|
91
90
|
frameworkExts: string[]
|
|
92
91
|
app: ViteAppMeta
|
|
93
92
|
pages: VitePageMeta[]
|
|
93
|
+
components?: VitePageMeta[]
|
|
94
94
|
loaderMeta: any
|
|
95
95
|
logger
|
|
96
96
|
filesConfig: IMiniFilesConfig
|