@tarojs/taro 3.7.0-alpha.14 → 3.7.0-alpha.16
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/taro",
|
|
3
|
-
"version": "3.7.0-alpha.
|
|
3
|
+
"version": "3.7.0-alpha.16",
|
|
4
4
|
"description": "Taro framework",
|
|
5
5
|
"homepage": "https://github.com/nervjs/taro/tree/master/packages/taro#readme",
|
|
6
6
|
"main": "index.js",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"author": "O2Team",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@tarojs/api": "3.7.0-alpha.
|
|
25
|
-
"@tarojs/runtime": "3.7.0-alpha.
|
|
24
|
+
"@tarojs/api": "3.7.0-alpha.16",
|
|
25
|
+
"@tarojs/runtime": "3.7.0-alpha.16"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@tarojs/helper": "3.7.0-alpha.
|
|
28
|
+
"@tarojs/helper": "3.7.0-alpha.16"
|
|
29
29
|
},
|
|
30
30
|
"peerDependenciesMeta": {
|
|
31
31
|
"@types/react": {
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { AppConfig, PageConfig } from "../index"
|
|
2
|
+
import type { IMiniFilesConfig, IH5Config, IMiniAppConfig } from "./config"
|
|
3
|
+
import type { IProjectBaseConfig } from './config/project'
|
|
4
|
+
import type { PluginContext } from "rollup"
|
|
5
|
+
|
|
6
|
+
export interface ViteNativeCompMeta {
|
|
7
|
+
name: string
|
|
8
|
+
scriptPath: string
|
|
9
|
+
configPath: string
|
|
10
|
+
config: PageConfig
|
|
11
|
+
isNative: true
|
|
12
|
+
templatePath: string
|
|
13
|
+
cssPath?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ViteFileType {
|
|
17
|
+
config: string
|
|
18
|
+
script: string
|
|
19
|
+
templ: string
|
|
20
|
+
style: string
|
|
21
|
+
xs?: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ViteAppMeta {
|
|
25
|
+
name: string
|
|
26
|
+
scriptPath: string
|
|
27
|
+
configPath: string
|
|
28
|
+
config: AppConfig
|
|
29
|
+
isNative: false
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface VitePageMeta {
|
|
33
|
+
name: string
|
|
34
|
+
scriptPath: string
|
|
35
|
+
configPath: string
|
|
36
|
+
config: PageConfig
|
|
37
|
+
isNative: boolean
|
|
38
|
+
templatePath?: string
|
|
39
|
+
cssPath?: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
export interface ViteH5BuildConfig extends CommonBuildConfig, IH5Config {
|
|
44
|
+
entryFileName?: string
|
|
45
|
+
runtimePath?: string | string[]
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface CommonBuildConfig extends IProjectBaseConfig {
|
|
49
|
+
entry: {
|
|
50
|
+
app: string | string[]
|
|
51
|
+
}
|
|
52
|
+
mode: 'production' | 'development' | 'none'
|
|
53
|
+
buildAdapter: string // weapp | swan | alipay | tt | qq | jd | h5
|
|
54
|
+
platformType: string // mini | web
|
|
55
|
+
/** special mode */
|
|
56
|
+
isBuildNativeComp?: boolean
|
|
57
|
+
/** hooks */
|
|
58
|
+
onCompilerMake: (compilation) => Promise<any>
|
|
59
|
+
onParseCreateElement: (nodeName, componentConfig) => Promise<any>
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
export interface ViteMiniBuildConfig extends CommonBuildConfig, IMiniAppConfig {
|
|
64
|
+
isBuildPlugin: boolean
|
|
65
|
+
isSupportRecursive: boolean
|
|
66
|
+
isSupportXS: boolean
|
|
67
|
+
nodeModulesPath: string
|
|
68
|
+
fileType: ViteFileType
|
|
69
|
+
globalObject: string
|
|
70
|
+
template: RecursiveTemplate | UnRecursiveTemplate
|
|
71
|
+
runtimePath?: string | string[]
|
|
72
|
+
taroComponentsPath?: string
|
|
73
|
+
blended?: boolean
|
|
74
|
+
hot?: boolean
|
|
75
|
+
injectOptions?: {
|
|
76
|
+
include?: Record<string, string | string[]>
|
|
77
|
+
exclude?: string[]
|
|
78
|
+
}
|
|
79
|
+
/** hooks */
|
|
80
|
+
modifyComponentConfig: (componentConfig: IComponentConfig, config: Partial<ViteMiniBuildConfig>) => Promise<any>
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface ViteCompilerContext<T> {
|
|
84
|
+
cwd: string
|
|
85
|
+
sourceDir: string
|
|
86
|
+
taroConfig: T
|
|
87
|
+
frameworkExts: string[]
|
|
88
|
+
app: ViteAppMeta
|
|
89
|
+
pages: VitePageMeta[]
|
|
90
|
+
loaderMeta: any
|
|
91
|
+
logger
|
|
92
|
+
filesConfig: IMiniFilesConfig
|
|
93
|
+
configFileList: string[]
|
|
94
|
+
compilePage: (pageName: string) => VitePageMeta
|
|
95
|
+
watchConfigFile: (rollupCtx: PluginContext) => void
|
|
96
|
+
getAppScriptPath: () => string
|
|
97
|
+
getApp: () => ViteAppMeta
|
|
98
|
+
getPages: () => VitePageMeta[]
|
|
99
|
+
isApp: (id: string) => boolean
|
|
100
|
+
isPage: (id: string) => boolean
|
|
101
|
+
isNativePageORComponent: (templatePath: string) => boolean
|
|
102
|
+
getPageById: (id: string) => VitePageMeta| undefined
|
|
103
|
+
getConfigFilePath: (filePath: string) => string
|
|
104
|
+
getTargetFilePath: (filePath: string, targetExtName: string) => string
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface ViteH5CompilerContext extends ViteCompilerContext<ViteH5BuildConfig> {
|
|
108
|
+
routerMeta: {
|
|
109
|
+
routerCreator: string
|
|
110
|
+
getRoutesConfig: (pageName?: string) => string
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface ViteMiniCompilerContext extends ViteCompilerContext<ViteMiniBuildConfig> {
|
|
115
|
+
fileType: ViteFileType
|
|
116
|
+
commonChunks: string[]
|
|
117
|
+
nativeComponents : Map<string, ViteNativeCompMeta>
|
|
118
|
+
getCommonChunks: () => string[]
|
|
119
|
+
collectNativeComponents: (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) => void
|
|
120
|
+
getScriptPath: (filePath: string) => string
|
|
121
|
+
getTemplatePath: (filePath: string) => string
|
|
122
|
+
getStylePath: (filePath: string) => string
|
|
123
|
+
getConfigPath: (filePath: string) => string
|
|
124
|
+
}
|