@tarojs/service 3.7.0-alpha.2 → 3.7.0-alpha.22
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/dist/Config.js +50 -19
- package/dist/Config.js.map +1 -1
- package/dist/Kernel.js +67 -24
- package/dist/Kernel.js.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/platform-plugin-base/mini.js +21 -4
- package/dist/platform-plugin-base/mini.js.map +1 -1
- package/dist/platform-plugin-base/platform.js +2 -2
- package/dist/platform-plugin-base/platform.js.map +1 -1
- package/dist/platform-plugin-base/web.js +8 -2
- package/dist/platform-plugin-base/web.js.map +1 -1
- package/dist/utils/index.js +25 -8
- package/dist/utils/index.js.map +1 -1
- package/package.json +9 -7
- package/src/Config.ts +37 -9
- package/src/Kernel.ts +79 -24
- package/src/index.ts +3 -2
- package/src/platform-plugin-base/mini.ts +31 -9
- package/src/platform-plugin-base/platform.ts +3 -3
- package/src/platform-plugin-base/web.ts +8 -3
- package/src/utils/index.ts +24 -8
- package/src/utils/types.ts +14 -5
- package/types/Config.d.ts +9 -1
- package/types/Kernel.d.ts +12 -4
- package/types/index.d.ts +3 -1
- package/types/platform-plugin-base/mini.d.ts +1 -8
- package/types/platform-plugin-base/platform.d.ts +1 -1
- package/types/utils/index.d.ts +2 -2
- package/types/utils/types.d.ts +19 -8
package/types/utils/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type helper from '@tarojs/helper';
|
|
2
|
-
import type
|
|
3
|
-
import type {
|
|
2
|
+
import type runnerUtils from '@tarojs/runner-utils';
|
|
3
|
+
import type { IMiniFilesConfig, IProjectConfig } from '@tarojs/taro/types/compile';
|
|
4
|
+
import type { IModifyChainData } from '@tarojs/taro/types/compile/hooks';
|
|
4
5
|
import type joi from 'joi';
|
|
5
6
|
import type Webpack from 'webpack';
|
|
6
7
|
import type Chain from 'webpack-chain';
|
|
@@ -27,8 +28,8 @@ export interface IPaths {
|
|
|
27
28
|
*/
|
|
28
29
|
nodeModulesPath: string;
|
|
29
30
|
}
|
|
30
|
-
export
|
|
31
|
-
export
|
|
31
|
+
export type Func = (...args: any[]) => any;
|
|
32
|
+
export type IPluginsObject = Record<string, Record<any, any> | null>;
|
|
32
33
|
export interface IPlugin {
|
|
33
34
|
id: string;
|
|
34
35
|
path: string;
|
|
@@ -36,7 +37,7 @@ export interface IPlugin {
|
|
|
36
37
|
type: PluginType;
|
|
37
38
|
apply: Func;
|
|
38
39
|
}
|
|
39
|
-
export
|
|
40
|
+
export type IPreset = IPlugin;
|
|
40
41
|
export interface IHook {
|
|
41
42
|
name: string;
|
|
42
43
|
plugin?: string;
|
|
@@ -81,6 +82,10 @@ export declare interface IPluginContext {
|
|
|
81
82
|
* 为包 @tarojs/helper 的快捷使用方式,包含其所有 API
|
|
82
83
|
*/
|
|
83
84
|
helper: typeof helper;
|
|
85
|
+
/**
|
|
86
|
+
* 为包 @tarojs/runner-utils 的快捷使用方式,包含其所有 API
|
|
87
|
+
*/
|
|
88
|
+
runnerUtils: typeof runnerUtils;
|
|
84
89
|
/**
|
|
85
90
|
* 项目配置
|
|
86
91
|
*/
|
|
@@ -142,14 +147,14 @@ export declare interface IPluginContext {
|
|
|
142
147
|
modifyWebpackChain: (fn: (args: {
|
|
143
148
|
chain: Chain;
|
|
144
149
|
webpack: typeof Webpack;
|
|
145
|
-
data?:
|
|
150
|
+
data?: IModifyChainData;
|
|
146
151
|
}) => void) => void;
|
|
147
152
|
/**
|
|
148
153
|
* 编译中修改 vite 配置
|
|
149
154
|
*/
|
|
150
155
|
modifyViteConfig: (fn: (args: {
|
|
151
156
|
viteConfig: any;
|
|
152
|
-
|
|
157
|
+
data?: IModifyChainData;
|
|
153
158
|
}) => void) => void;
|
|
154
159
|
/**
|
|
155
160
|
* 修改编译后的结果
|
|
@@ -162,7 +167,13 @@ export declare interface IPluginContext {
|
|
|
162
167
|
* 修改编译过程中的页面组件配置
|
|
163
168
|
*/
|
|
164
169
|
modifyMiniConfigs: (fn: (args: {
|
|
165
|
-
configMap:
|
|
170
|
+
configMap: IMiniFilesConfig;
|
|
171
|
+
}) => void) => void;
|
|
172
|
+
/**
|
|
173
|
+
* 修改 Taro 编译配置
|
|
174
|
+
*/
|
|
175
|
+
modifyRunnerOpts: (fn: (args: {
|
|
176
|
+
opts: any;
|
|
166
177
|
}) => void) => void;
|
|
167
178
|
[key: string]: any;
|
|
168
179
|
}
|