@we-debug/gulp-tool 0.31.4 → 0.31.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/CHANGELOG.md +12 -0
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.js +3 -1
- package/dist/types.d.ts +13 -10
- package/package.json +2 -2
- package/src/plugin.ts +6 -4
- package/src/types.ts +12 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.31.5](https://github.com/dlhandsome/we-debug/compare/v0.31.4...v0.31.5) (2024-01-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* fixed type ([ca4ad26](https://github.com/dlhandsome/we-debug/commit/ca4ad26a6b8e208a6597aca0b1ce5661ac8d502b))
|
|
12
|
+
* **gulp-tool:** fixed type ([5b9f2f0](https://github.com/dlhandsome/we-debug/commit/5b9f2f0bb93c2340e0f0871c509706c06a79673e))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
## [0.31.4](https://github.com/dlhandsome/we-debug/compare/v0.31.3...v0.31.4) (2024-01-16)
|
|
7
19
|
|
|
8
20
|
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { IRegistration, IPackageOption,
|
|
1
|
+
import { IRegistration, IPackageOption, IPlugin, PackageParam, Meta } from './types';
|
|
2
2
|
import File from 'vinyl';
|
|
3
3
|
declare class Plugin implements IPlugin {
|
|
4
4
|
lifecycles: IRegistration[];
|
|
5
|
-
meta:
|
|
5
|
+
meta: Meta;
|
|
6
6
|
getLifecycles(): IRegistration[];
|
|
7
7
|
register(options: IRegistration): void;
|
|
8
8
|
execLifecycle(lifetime: keyof IRegistration, file: File): void;
|
|
9
9
|
loadPlugin(pkg: PackageParam): any;
|
|
10
|
-
initPlugin(packges: IPackageOption[], meta:
|
|
10
|
+
initPlugin(packges: IPackageOption[], meta: Meta): void;
|
|
11
11
|
}
|
|
12
12
|
declare const _default: Plugin;
|
|
13
13
|
export default _default;
|
package/dist/plugin.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -27,27 +27,30 @@ export interface IRegistration {
|
|
|
27
27
|
afterInsertScript?: ProcessDefine;
|
|
28
28
|
}
|
|
29
29
|
export type FilterOption = string | Function | RegExp;
|
|
30
|
-
export
|
|
30
|
+
export type Meta<T extends IAnyObject = IAnyObject> = ICompilerOption<T> & {
|
|
31
|
+
pages: string[];
|
|
32
|
+
};
|
|
33
|
+
export interface IPlugin<T extends IAnyObject = IAnyObject> {
|
|
31
34
|
lifecycles: IRegistration[];
|
|
32
|
-
meta:
|
|
35
|
+
meta: Meta<T>;
|
|
33
36
|
register(options: IRegistration): void;
|
|
34
37
|
getLifecycles(): IRegistration[];
|
|
35
38
|
execLifecycle(lifetime: keyof IRegistration, file: File): void;
|
|
36
39
|
loadPlugin(pkg: string | PackageFunc): void;
|
|
37
|
-
initPlugin(packges: IPackageOption[], meta:
|
|
40
|
+
initPlugin(packges: IPackageOption<T>[], meta: Meta): void;
|
|
38
41
|
}
|
|
39
|
-
export type PackageFunc = (register: IPlugin, options:
|
|
40
|
-
export type PackageParam = string | PackageFunc
|
|
41
|
-
export interface IPackageOption {
|
|
42
|
-
package: PackageParam
|
|
43
|
-
options:
|
|
42
|
+
export type PackageFunc<T extends IAnyObject = IAnyObject> = (register: IPlugin, options: T) => void;
|
|
43
|
+
export type PackageParam<T extends IAnyObject = IAnyObject> = string | PackageFunc<T>;
|
|
44
|
+
export interface IPackageOption<T extends IAnyObject = IAnyObject> {
|
|
45
|
+
package: PackageParam<T>;
|
|
46
|
+
options: T;
|
|
44
47
|
}
|
|
45
|
-
export interface ICompilerOption {
|
|
48
|
+
export interface ICompilerOption<T extends IAnyObject = IAnyObject> {
|
|
46
49
|
baseDir?: string;
|
|
47
50
|
wxml?: string;
|
|
48
51
|
filter?: FilterOption;
|
|
49
52
|
compName?: string;
|
|
50
53
|
compPath?: string;
|
|
51
54
|
entryFile?: string;
|
|
52
|
-
plugins?: IPackageOption[];
|
|
55
|
+
plugins?: IPackageOption<T>[];
|
|
53
56
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@we-debug/gulp-tool",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.5",
|
|
4
4
|
"description": "we-debug, gulp",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/types.d.ts",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"readme": "ERROR: No README data found!",
|
|
33
33
|
"_id": "@we-debug/gulp-tool@0.1.3",
|
|
34
34
|
"_commitid": "f35f53c",
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "a5199e6454c210e0c9f5f1f8aac4b64ef4335379"
|
|
36
36
|
}
|
package/src/plugin.ts
CHANGED
|
@@ -2,9 +2,9 @@ import PluginError from 'plugin-error';
|
|
|
2
2
|
import {
|
|
3
3
|
IRegistration,
|
|
4
4
|
IPackageOption,
|
|
5
|
-
IAnyObject,
|
|
6
5
|
IPlugin,
|
|
7
|
-
PackageParam
|
|
6
|
+
PackageParam,
|
|
7
|
+
Meta
|
|
8
8
|
} from './types';
|
|
9
9
|
import File from 'vinyl';
|
|
10
10
|
|
|
@@ -14,7 +14,9 @@ class Plugin implements IPlugin {
|
|
|
14
14
|
/** 子插件生命周期 */
|
|
15
15
|
lifecycles: IRegistration[] = [];
|
|
16
16
|
/** 插件元信息 */
|
|
17
|
-
meta:
|
|
17
|
+
meta: Meta = {
|
|
18
|
+
pages: []
|
|
19
|
+
};
|
|
18
20
|
|
|
19
21
|
getLifecycles() {
|
|
20
22
|
return this.lifecycles;
|
|
@@ -43,7 +45,7 @@ class Plugin implements IPlugin {
|
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
47
|
|
|
46
|
-
initPlugin(packges: IPackageOption[], meta:
|
|
48
|
+
initPlugin(packges: IPackageOption[], meta: Meta) {
|
|
47
49
|
this.meta = meta;
|
|
48
50
|
|
|
49
51
|
packges.map(p => {
|
package/src/types.ts
CHANGED
|
@@ -44,11 +44,13 @@ export interface IRegistration {
|
|
|
44
44
|
|
|
45
45
|
export type FilterOption = string | Function | RegExp;
|
|
46
46
|
|
|
47
|
-
export
|
|
47
|
+
export type Meta<T extends IAnyObject = IAnyObject> = ICompilerOption<T> & { pages: string[] };
|
|
48
|
+
|
|
49
|
+
export interface IPlugin<T extends IAnyObject = IAnyObject> {
|
|
48
50
|
/** 插件生命周期钩子声明 */
|
|
49
51
|
lifecycles: IRegistration[];
|
|
50
52
|
/** 插件元信息 */
|
|
51
|
-
meta:
|
|
53
|
+
meta: Meta<T>;
|
|
52
54
|
/** 注册插件 */
|
|
53
55
|
register(options: IRegistration): void;
|
|
54
56
|
/** 获取插件生命周期钩子声明 */
|
|
@@ -58,28 +60,28 @@ export interface IPlugin {
|
|
|
58
60
|
/** 加载插件 */
|
|
59
61
|
loadPlugin(pkg: string | PackageFunc): void;
|
|
60
62
|
/** 初始化插件列表 */
|
|
61
|
-
initPlugin(packges: IPackageOption[], meta:
|
|
63
|
+
initPlugin(packges: IPackageOption<T>[], meta: Meta): void;
|
|
62
64
|
}
|
|
63
65
|
|
|
64
|
-
export type PackageFunc = (register: IPlugin, options:
|
|
66
|
+
export type PackageFunc<T extends IAnyObject = IAnyObject> = (register: IPlugin, options: T) => void;
|
|
65
67
|
|
|
66
68
|
/**
|
|
67
69
|
* 插件
|
|
68
70
|
*/
|
|
69
|
-
export type PackageParam = string | PackageFunc
|
|
71
|
+
export type PackageParam<T extends IAnyObject = IAnyObject> = string | PackageFunc<T>;
|
|
70
72
|
|
|
71
73
|
/**
|
|
72
74
|
* 插件参数
|
|
73
75
|
*/
|
|
74
|
-
export interface IPackageOption {
|
|
75
|
-
package: PackageParam
|
|
76
|
-
options:
|
|
76
|
+
export interface IPackageOption<T extends IAnyObject = IAnyObject> {
|
|
77
|
+
package: PackageParam<T>;
|
|
78
|
+
options: T;
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
/**
|
|
80
82
|
* 编译函数入口参数
|
|
81
83
|
*/
|
|
82
|
-
export interface ICompilerOption {
|
|
84
|
+
export interface ICompilerOption<T extends IAnyObject = IAnyObject> {
|
|
83
85
|
/** */
|
|
84
86
|
baseDir?: string;
|
|
85
87
|
wxml?: string;
|
|
@@ -87,5 +89,5 @@ export interface ICompilerOption {
|
|
|
87
89
|
compName?: string;
|
|
88
90
|
compPath?: string;
|
|
89
91
|
entryFile?: string;
|
|
90
|
-
plugins?: IPackageOption[];
|
|
92
|
+
plugins?: IPackageOption<T>[];
|
|
91
93
|
}
|