@mogzol/webpackbar 7.1.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/LICENSE +21 -0
- package/README.md +223 -0
- package/dist/rspack.cjs +39 -0
- package/dist/rspack.d.cts +12 -0
- package/dist/rspack.d.mts +12 -0
- package/dist/rspack.d.ts +12 -0
- package/dist/rspack.mjs +33 -0
- package/dist/shared/webpackbar.07fec22c.mjs +1815 -0
- package/dist/shared/webpackbar.28dc8790.d.cts +124 -0
- package/dist/shared/webpackbar.28dc8790.d.mts +124 -0
- package/dist/shared/webpackbar.28dc8790.d.ts +124 -0
- package/dist/shared/webpackbar.67d03d0b.cjs +1825 -0
- package/dist/webpack.cjs +42 -0
- package/dist/webpack.d.cts +2 -0
- package/dist/webpack.d.mts +2 -0
- package/dist/webpack.d.ts +2 -0
- package/dist/webpack.mjs +36 -0
- package/package.json +93 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import webpack, { Stats } from 'webpack';
|
|
2
|
+
|
|
3
|
+
type ReporterContextFunc<T = any> = (context: WebpackBarProgressPlugin, opts: T) => void;
|
|
4
|
+
interface State {
|
|
5
|
+
start: [number, number] | null;
|
|
6
|
+
progress: number;
|
|
7
|
+
done: boolean;
|
|
8
|
+
message: string;
|
|
9
|
+
details: string[];
|
|
10
|
+
request: null | {
|
|
11
|
+
file: null | string;
|
|
12
|
+
loaders: string[];
|
|
13
|
+
};
|
|
14
|
+
hasErrors: boolean;
|
|
15
|
+
color: string;
|
|
16
|
+
name: string;
|
|
17
|
+
}
|
|
18
|
+
interface Reporter {
|
|
19
|
+
/**
|
|
20
|
+
* Called when (re)compile is started
|
|
21
|
+
*/
|
|
22
|
+
start?: ReporterContextFunc;
|
|
23
|
+
/**
|
|
24
|
+
* Called when a file changed on watch mode
|
|
25
|
+
*/
|
|
26
|
+
change?: ReporterContextFunc<{
|
|
27
|
+
shortPath: string;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Called after each progress update
|
|
31
|
+
*/
|
|
32
|
+
update?: ReporterContextFunc;
|
|
33
|
+
/**
|
|
34
|
+
* Called when compile finished
|
|
35
|
+
*/
|
|
36
|
+
done?: ReporterContextFunc<{
|
|
37
|
+
stats: Stats;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Called when build progress updated
|
|
41
|
+
*/
|
|
42
|
+
progress?: ReporterContextFunc;
|
|
43
|
+
/**
|
|
44
|
+
* Called when _all_ compiles finished
|
|
45
|
+
*/
|
|
46
|
+
allDone?: ReporterContextFunc;
|
|
47
|
+
beforeAllDone?: ReporterContextFunc;
|
|
48
|
+
afterAllDone?: ReporterContextFunc;
|
|
49
|
+
}
|
|
50
|
+
type ReporterOpts = {
|
|
51
|
+
reporter: Reporter | string;
|
|
52
|
+
options?: any;
|
|
53
|
+
};
|
|
54
|
+
type ReporterInput = string | [Reporter | string, any?] | ReporterOpts;
|
|
55
|
+
interface WebpackBarOptions {
|
|
56
|
+
/**
|
|
57
|
+
* Display name
|
|
58
|
+
* @default 'webpack'
|
|
59
|
+
*/
|
|
60
|
+
name?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Color output of the progress bar
|
|
63
|
+
* @default 'green'
|
|
64
|
+
*/
|
|
65
|
+
color?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Enable profiler
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
profile?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Enable bars reporter
|
|
73
|
+
* Defaults to 'true' when not in CI or testing mod
|
|
74
|
+
* @default true
|
|
75
|
+
*/
|
|
76
|
+
fancy?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Keep the bar at the bottom of the terminal until build is finished.
|
|
79
|
+
* Messages logged during the build will appear above the bar.
|
|
80
|
+
* Only applies when the fancy reporter is used.
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
keepOnBottom?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Enable a simple log reporter (only start and end)
|
|
86
|
+
* Defaults to 'true' when running in minimal environments
|
|
87
|
+
* @default true
|
|
88
|
+
*/
|
|
89
|
+
basic?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Register a custom reporter
|
|
92
|
+
*/
|
|
93
|
+
reporter?: ReporterInput;
|
|
94
|
+
/**
|
|
95
|
+
* Register an Array of your custom reporters.
|
|
96
|
+
* @default ['basic'] | ['fancy']
|
|
97
|
+
*/
|
|
98
|
+
reporters?: ReporterInput[];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
declare class WebpackBar {
|
|
102
|
+
private options;
|
|
103
|
+
private reporters;
|
|
104
|
+
constructor(options?: WebpackBarOptions);
|
|
105
|
+
callReporters(fn: any, payload?: {}): void;
|
|
106
|
+
get hasRunning(): boolean;
|
|
107
|
+
get hasErrors(): boolean;
|
|
108
|
+
get statesArray(): any[];
|
|
109
|
+
get states(): {
|
|
110
|
+
[key: string]: State;
|
|
111
|
+
};
|
|
112
|
+
get state(): State;
|
|
113
|
+
_ensureState(): void;
|
|
114
|
+
apply(compiler: any): void;
|
|
115
|
+
updateProgress(percent?: number, message?: string, details?: any[]): void;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
declare class WebpackBarProgressPlugin extends webpack.ProgressPlugin {
|
|
119
|
+
webpackbar: WebpackBar;
|
|
120
|
+
constructor(options?: WebpackBarOptions);
|
|
121
|
+
apply(compiler: any): void;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export { type Reporter as R, type State as S, WebpackBar as W, type WebpackBarOptions as a, WebpackBarProgressPlugin as b };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import webpack, { Stats } from 'webpack';
|
|
2
|
+
|
|
3
|
+
type ReporterContextFunc<T = any> = (context: WebpackBarProgressPlugin, opts: T) => void;
|
|
4
|
+
interface State {
|
|
5
|
+
start: [number, number] | null;
|
|
6
|
+
progress: number;
|
|
7
|
+
done: boolean;
|
|
8
|
+
message: string;
|
|
9
|
+
details: string[];
|
|
10
|
+
request: null | {
|
|
11
|
+
file: null | string;
|
|
12
|
+
loaders: string[];
|
|
13
|
+
};
|
|
14
|
+
hasErrors: boolean;
|
|
15
|
+
color: string;
|
|
16
|
+
name: string;
|
|
17
|
+
}
|
|
18
|
+
interface Reporter {
|
|
19
|
+
/**
|
|
20
|
+
* Called when (re)compile is started
|
|
21
|
+
*/
|
|
22
|
+
start?: ReporterContextFunc;
|
|
23
|
+
/**
|
|
24
|
+
* Called when a file changed on watch mode
|
|
25
|
+
*/
|
|
26
|
+
change?: ReporterContextFunc<{
|
|
27
|
+
shortPath: string;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Called after each progress update
|
|
31
|
+
*/
|
|
32
|
+
update?: ReporterContextFunc;
|
|
33
|
+
/**
|
|
34
|
+
* Called when compile finished
|
|
35
|
+
*/
|
|
36
|
+
done?: ReporterContextFunc<{
|
|
37
|
+
stats: Stats;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Called when build progress updated
|
|
41
|
+
*/
|
|
42
|
+
progress?: ReporterContextFunc;
|
|
43
|
+
/**
|
|
44
|
+
* Called when _all_ compiles finished
|
|
45
|
+
*/
|
|
46
|
+
allDone?: ReporterContextFunc;
|
|
47
|
+
beforeAllDone?: ReporterContextFunc;
|
|
48
|
+
afterAllDone?: ReporterContextFunc;
|
|
49
|
+
}
|
|
50
|
+
type ReporterOpts = {
|
|
51
|
+
reporter: Reporter | string;
|
|
52
|
+
options?: any;
|
|
53
|
+
};
|
|
54
|
+
type ReporterInput = string | [Reporter | string, any?] | ReporterOpts;
|
|
55
|
+
interface WebpackBarOptions {
|
|
56
|
+
/**
|
|
57
|
+
* Display name
|
|
58
|
+
* @default 'webpack'
|
|
59
|
+
*/
|
|
60
|
+
name?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Color output of the progress bar
|
|
63
|
+
* @default 'green'
|
|
64
|
+
*/
|
|
65
|
+
color?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Enable profiler
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
profile?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Enable bars reporter
|
|
73
|
+
* Defaults to 'true' when not in CI or testing mod
|
|
74
|
+
* @default true
|
|
75
|
+
*/
|
|
76
|
+
fancy?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Keep the bar at the bottom of the terminal until build is finished.
|
|
79
|
+
* Messages logged during the build will appear above the bar.
|
|
80
|
+
* Only applies when the fancy reporter is used.
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
keepOnBottom?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Enable a simple log reporter (only start and end)
|
|
86
|
+
* Defaults to 'true' when running in minimal environments
|
|
87
|
+
* @default true
|
|
88
|
+
*/
|
|
89
|
+
basic?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Register a custom reporter
|
|
92
|
+
*/
|
|
93
|
+
reporter?: ReporterInput;
|
|
94
|
+
/**
|
|
95
|
+
* Register an Array of your custom reporters.
|
|
96
|
+
* @default ['basic'] | ['fancy']
|
|
97
|
+
*/
|
|
98
|
+
reporters?: ReporterInput[];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
declare class WebpackBar {
|
|
102
|
+
private options;
|
|
103
|
+
private reporters;
|
|
104
|
+
constructor(options?: WebpackBarOptions);
|
|
105
|
+
callReporters(fn: any, payload?: {}): void;
|
|
106
|
+
get hasRunning(): boolean;
|
|
107
|
+
get hasErrors(): boolean;
|
|
108
|
+
get statesArray(): any[];
|
|
109
|
+
get states(): {
|
|
110
|
+
[key: string]: State;
|
|
111
|
+
};
|
|
112
|
+
get state(): State;
|
|
113
|
+
_ensureState(): void;
|
|
114
|
+
apply(compiler: any): void;
|
|
115
|
+
updateProgress(percent?: number, message?: string, details?: any[]): void;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
declare class WebpackBarProgressPlugin extends webpack.ProgressPlugin {
|
|
119
|
+
webpackbar: WebpackBar;
|
|
120
|
+
constructor(options?: WebpackBarOptions);
|
|
121
|
+
apply(compiler: any): void;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export { type Reporter as R, type State as S, WebpackBar as W, type WebpackBarOptions as a, WebpackBarProgressPlugin as b };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import webpack, { Stats } from 'webpack';
|
|
2
|
+
|
|
3
|
+
type ReporterContextFunc<T = any> = (context: WebpackBarProgressPlugin, opts: T) => void;
|
|
4
|
+
interface State {
|
|
5
|
+
start: [number, number] | null;
|
|
6
|
+
progress: number;
|
|
7
|
+
done: boolean;
|
|
8
|
+
message: string;
|
|
9
|
+
details: string[];
|
|
10
|
+
request: null | {
|
|
11
|
+
file: null | string;
|
|
12
|
+
loaders: string[];
|
|
13
|
+
};
|
|
14
|
+
hasErrors: boolean;
|
|
15
|
+
color: string;
|
|
16
|
+
name: string;
|
|
17
|
+
}
|
|
18
|
+
interface Reporter {
|
|
19
|
+
/**
|
|
20
|
+
* Called when (re)compile is started
|
|
21
|
+
*/
|
|
22
|
+
start?: ReporterContextFunc;
|
|
23
|
+
/**
|
|
24
|
+
* Called when a file changed on watch mode
|
|
25
|
+
*/
|
|
26
|
+
change?: ReporterContextFunc<{
|
|
27
|
+
shortPath: string;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Called after each progress update
|
|
31
|
+
*/
|
|
32
|
+
update?: ReporterContextFunc;
|
|
33
|
+
/**
|
|
34
|
+
* Called when compile finished
|
|
35
|
+
*/
|
|
36
|
+
done?: ReporterContextFunc<{
|
|
37
|
+
stats: Stats;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Called when build progress updated
|
|
41
|
+
*/
|
|
42
|
+
progress?: ReporterContextFunc;
|
|
43
|
+
/**
|
|
44
|
+
* Called when _all_ compiles finished
|
|
45
|
+
*/
|
|
46
|
+
allDone?: ReporterContextFunc;
|
|
47
|
+
beforeAllDone?: ReporterContextFunc;
|
|
48
|
+
afterAllDone?: ReporterContextFunc;
|
|
49
|
+
}
|
|
50
|
+
type ReporterOpts = {
|
|
51
|
+
reporter: Reporter | string;
|
|
52
|
+
options?: any;
|
|
53
|
+
};
|
|
54
|
+
type ReporterInput = string | [Reporter | string, any?] | ReporterOpts;
|
|
55
|
+
interface WebpackBarOptions {
|
|
56
|
+
/**
|
|
57
|
+
* Display name
|
|
58
|
+
* @default 'webpack'
|
|
59
|
+
*/
|
|
60
|
+
name?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Color output of the progress bar
|
|
63
|
+
* @default 'green'
|
|
64
|
+
*/
|
|
65
|
+
color?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Enable profiler
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
profile?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Enable bars reporter
|
|
73
|
+
* Defaults to 'true' when not in CI or testing mod
|
|
74
|
+
* @default true
|
|
75
|
+
*/
|
|
76
|
+
fancy?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Keep the bar at the bottom of the terminal until build is finished.
|
|
79
|
+
* Messages logged during the build will appear above the bar.
|
|
80
|
+
* Only applies when the fancy reporter is used.
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
keepOnBottom?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Enable a simple log reporter (only start and end)
|
|
86
|
+
* Defaults to 'true' when running in minimal environments
|
|
87
|
+
* @default true
|
|
88
|
+
*/
|
|
89
|
+
basic?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Register a custom reporter
|
|
92
|
+
*/
|
|
93
|
+
reporter?: ReporterInput;
|
|
94
|
+
/**
|
|
95
|
+
* Register an Array of your custom reporters.
|
|
96
|
+
* @default ['basic'] | ['fancy']
|
|
97
|
+
*/
|
|
98
|
+
reporters?: ReporterInput[];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
declare class WebpackBar {
|
|
102
|
+
private options;
|
|
103
|
+
private reporters;
|
|
104
|
+
constructor(options?: WebpackBarOptions);
|
|
105
|
+
callReporters(fn: any, payload?: {}): void;
|
|
106
|
+
get hasRunning(): boolean;
|
|
107
|
+
get hasErrors(): boolean;
|
|
108
|
+
get statesArray(): any[];
|
|
109
|
+
get states(): {
|
|
110
|
+
[key: string]: State;
|
|
111
|
+
};
|
|
112
|
+
get state(): State;
|
|
113
|
+
_ensureState(): void;
|
|
114
|
+
apply(compiler: any): void;
|
|
115
|
+
updateProgress(percent?: number, message?: string, details?: any[]): void;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
declare class WebpackBarProgressPlugin extends webpack.ProgressPlugin {
|
|
119
|
+
webpackbar: WebpackBar;
|
|
120
|
+
constructor(options?: WebpackBarOptions);
|
|
121
|
+
apply(compiler: any): void;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export { type Reporter as R, type State as S, WebpackBar as W, type WebpackBarOptions as a, WebpackBarProgressPlugin as b };
|