@we-debug/gulp-tool 0.31.5 → 0.32.0
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 +19 -0
- package/dist/plugin.d.ts +3 -3
- package/dist/types.d.ts +7 -7
- package/package.json +2 -2
- package/src/plugin.ts +4 -4
- package/src/types.ts +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.32.0](https://github.com/dlhandsome/we-debug/compare/v0.31.18...v0.32.0) (2024-06-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @we-debug/gulp-tool
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.31.6](https://github.com/dlhandsome/we-debug/compare/v0.31.5...v0.31.6) (2024-01-17)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **gulp-tool:** fixed typo ([7eb90c3](https://github.com/dlhandsome/we-debug/commit/7eb90c31376cc27bcbbccdee6c273058256549a7))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.31.5](https://github.com/dlhandsome/we-debug/compare/v0.31.4...v0.31.5) (2024-01-16)
|
|
7
26
|
|
|
8
27
|
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRegistration,
|
|
1
|
+
import { IRegistration, ICompilerPluginOption, IPlugin, ICompilerPluginPackageOption, Meta } from './types';
|
|
2
2
|
import File from 'vinyl';
|
|
3
3
|
declare class Plugin implements IPlugin {
|
|
4
4
|
lifecycles: IRegistration[];
|
|
@@ -6,8 +6,8 @@ declare class Plugin implements IPlugin {
|
|
|
6
6
|
getLifecycles(): IRegistration[];
|
|
7
7
|
register(options: IRegistration): void;
|
|
8
8
|
execLifecycle(lifetime: keyof IRegistration, file: File): void;
|
|
9
|
-
loadPlugin(pkg:
|
|
10
|
-
initPlugin(packges:
|
|
9
|
+
loadPlugin(pkg: ICompilerPluginPackageOption): any;
|
|
10
|
+
initPlugin(packges: ICompilerPluginOption[], meta: Meta): void;
|
|
11
11
|
}
|
|
12
12
|
declare const _default: Plugin;
|
|
13
13
|
export default _default;
|
package/dist/types.d.ts
CHANGED
|
@@ -36,13 +36,13 @@ export interface IPlugin<T extends IAnyObject = IAnyObject> {
|
|
|
36
36
|
register(options: IRegistration): void;
|
|
37
37
|
getLifecycles(): IRegistration[];
|
|
38
38
|
execLifecycle(lifetime: keyof IRegistration, file: File): void;
|
|
39
|
-
loadPlugin(pkg: string |
|
|
40
|
-
initPlugin(packges:
|
|
39
|
+
loadPlugin(pkg: string | ICompilerPluginPackage): void;
|
|
40
|
+
initPlugin(packges: ICompilerPluginOption<T>[], meta: Meta): void;
|
|
41
41
|
}
|
|
42
|
-
export type
|
|
43
|
-
export type
|
|
44
|
-
export interface
|
|
45
|
-
package:
|
|
42
|
+
export type ICompilerPluginPackage<T extends IAnyObject = IAnyObject> = (register: IPlugin, options: T) => void;
|
|
43
|
+
export type ICompilerPluginPackageOption<T extends IAnyObject = IAnyObject> = string | ICompilerPluginPackage<T>;
|
|
44
|
+
export interface ICompilerPluginOption<T extends IAnyObject = IAnyObject> {
|
|
45
|
+
package: ICompilerPluginPackageOption<T>;
|
|
46
46
|
options: T;
|
|
47
47
|
}
|
|
48
48
|
export interface ICompilerOption<T extends IAnyObject = IAnyObject> {
|
|
@@ -52,5 +52,5 @@ export interface ICompilerOption<T extends IAnyObject = IAnyObject> {
|
|
|
52
52
|
compName?: string;
|
|
53
53
|
compPath?: string;
|
|
54
54
|
entryFile?: string;
|
|
55
|
-
plugins?:
|
|
55
|
+
plugins?: ICompilerPluginOption<T>[];
|
|
56
56
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@we-debug/gulp-tool",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
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": "f5cb28acb9cecc2463c6f1a9307646274f3aafee"
|
|
36
36
|
}
|
package/src/plugin.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import PluginError from 'plugin-error';
|
|
2
2
|
import {
|
|
3
3
|
IRegistration,
|
|
4
|
-
|
|
4
|
+
ICompilerPluginOption,
|
|
5
5
|
IPlugin,
|
|
6
|
-
|
|
6
|
+
ICompilerPluginPackageOption,
|
|
7
7
|
Meta
|
|
8
8
|
} from './types';
|
|
9
9
|
import File from 'vinyl';
|
|
@@ -35,7 +35,7 @@ class Plugin implements IPlugin {
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
loadPlugin(pkg:
|
|
38
|
+
loadPlugin(pkg: ICompilerPluginPackageOption) {
|
|
39
39
|
if (typeof pkg === 'string') {
|
|
40
40
|
return require(pkg);
|
|
41
41
|
}
|
|
@@ -45,7 +45,7 @@ class Plugin implements IPlugin {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
initPlugin(packges:
|
|
48
|
+
initPlugin(packges: ICompilerPluginOption[], meta: Meta) {
|
|
49
49
|
this.meta = meta;
|
|
50
50
|
|
|
51
51
|
packges.map(p => {
|
package/src/types.ts
CHANGED
|
@@ -58,23 +58,23 @@ export interface IPlugin<T extends IAnyObject = IAnyObject> {
|
|
|
58
58
|
/** 执行插件生命周期钩子声明 */
|
|
59
59
|
execLifecycle(lifetime: keyof IRegistration, file: File): void;
|
|
60
60
|
/** 加载插件 */
|
|
61
|
-
loadPlugin(pkg: string |
|
|
61
|
+
loadPlugin(pkg: string | ICompilerPluginPackage): void;
|
|
62
62
|
/** 初始化插件列表 */
|
|
63
|
-
initPlugin(packges:
|
|
63
|
+
initPlugin(packges: ICompilerPluginOption<T>[], meta: Meta): void;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
export type
|
|
66
|
+
export type ICompilerPluginPackage<T extends IAnyObject = IAnyObject> = (register: IPlugin, options: T) => void;
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* 插件
|
|
70
70
|
*/
|
|
71
|
-
export type
|
|
71
|
+
export type ICompilerPluginPackageOption<T extends IAnyObject = IAnyObject> = string | ICompilerPluginPackage<T>;
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* 插件参数
|
|
75
75
|
*/
|
|
76
|
-
export interface
|
|
77
|
-
package:
|
|
76
|
+
export interface ICompilerPluginOption<T extends IAnyObject = IAnyObject> {
|
|
77
|
+
package: ICompilerPluginPackageOption<T>;
|
|
78
78
|
options: T;
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -89,5 +89,5 @@ export interface ICompilerOption<T extends IAnyObject = IAnyObject> {
|
|
|
89
89
|
compName?: string;
|
|
90
90
|
compPath?: string;
|
|
91
91
|
entryFile?: string;
|
|
92
|
-
plugins?:
|
|
92
|
+
plugins?: ICompilerPluginOption<T>[];
|
|
93
93
|
}
|