@rsbuild/core 1.4.14 → 1.4.15
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/compiled/rslog/index.d.ts +63 -69
- package/compiled/rslog/index.js +1 -0
- package/compiled/rslog/package.json +1 -1
- package/compiled/rspack-chain/package.json +1 -1
- package/dist/client/hmr.js +10 -9
- package/dist/index.cjs +664 -674
- package/dist/index.js +644 -654
- package/dist-types/cli/index.d.ts +1 -1
- package/dist-types/createContext.d.ts +2 -2
- package/dist-types/helpers/index.d.ts +2 -2
- package/dist-types/index.d.ts +1 -1
- package/dist-types/inspectConfig.d.ts +2 -2
- package/dist-types/provider/rspackConfig.d.ts +1 -1
- package/dist-types/restart.d.ts +1 -1
- package/dist-types/rspack-plugins/resource-hints/extractChunks.d.ts +2 -2
- package/dist-types/server/cliShortcuts.d.ts +2 -2
- package/dist-types/server/compilationManager.d.ts +7 -7
- package/dist-types/server/compilationMiddleware.d.ts +11 -11
- package/dist-types/server/devMiddlewares.d.ts +5 -6
- package/dist-types/server/environment.d.ts +2 -2
- package/dist-types/server/helper.d.ts +2 -2
- package/dist-types/server/hmrFallback.d.ts +1 -2
- package/dist-types/server/watchFiles.d.ts +2 -3
- package/dist-types/types/config.d.ts +8 -7
- package/dist-types/types/hooks.d.ts +3 -3
- package/dist-types/types/plugin.d.ts +4 -0
- package/dist-types/types/rsbuild.d.ts +6 -5
- package/package.json +8 -8
|
@@ -1,73 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare let
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
declare let logger: Logger;
|
|
55
|
-
|
|
56
|
-
declare type LogLevel = 'silent' | 'error' | 'warn' | 'info' | 'log' | 'verbose';
|
|
57
|
-
|
|
58
|
-
declare type LogMessage = unknown;
|
|
59
|
-
|
|
60
|
-
declare type LogMethods = keyof typeof LOG_TYPES;
|
|
61
|
-
|
|
62
|
-
declare interface LogType {
|
|
63
|
-
label?: string;
|
|
64
|
-
level: LogLevel;
|
|
65
|
-
color?: ColorFn;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
declare interface Options {
|
|
69
|
-
level?: LogLevel;
|
|
1
|
+
type ColorFn = (input: string | number | null | undefined) => string;
|
|
2
|
+
|
|
3
|
+
declare let LOG_TYPES: {
|
|
4
|
+
error: {
|
|
5
|
+
label: string;
|
|
6
|
+
level: "error";
|
|
7
|
+
color: ColorFn;
|
|
8
|
+
};
|
|
9
|
+
warn: {
|
|
10
|
+
label: string;
|
|
11
|
+
level: "warn";
|
|
12
|
+
color: ColorFn;
|
|
13
|
+
};
|
|
14
|
+
info: {
|
|
15
|
+
label: string;
|
|
16
|
+
level: "info";
|
|
17
|
+
color: ColorFn;
|
|
18
|
+
};
|
|
19
|
+
start: {
|
|
20
|
+
label: string;
|
|
21
|
+
level: "info";
|
|
22
|
+
color: ColorFn;
|
|
23
|
+
};
|
|
24
|
+
ready: {
|
|
25
|
+
label: string;
|
|
26
|
+
level: "info";
|
|
27
|
+
color: ColorFn;
|
|
28
|
+
};
|
|
29
|
+
success: {
|
|
30
|
+
label: string;
|
|
31
|
+
level: "info";
|
|
32
|
+
color: ColorFn;
|
|
33
|
+
};
|
|
34
|
+
log: {
|
|
35
|
+
level: "info";
|
|
36
|
+
};
|
|
37
|
+
debug: {
|
|
38
|
+
label: string;
|
|
39
|
+
level: "verbose";
|
|
40
|
+
color: ColorFn;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
type LogLevel = 'silent' | 'error' | 'warn' | 'info' | 'log' | 'verbose';
|
|
45
|
+
type LogMessage = unknown;
|
|
46
|
+
interface LogType {
|
|
47
|
+
label?: string;
|
|
48
|
+
level: LogLevel;
|
|
49
|
+
color?: ColorFn;
|
|
50
|
+
}
|
|
51
|
+
type LogFunction = (message?: LogMessage, ...args: any[]) => void;
|
|
52
|
+
interface Options {
|
|
53
|
+
level?: LogLevel;
|
|
70
54
|
}
|
|
55
|
+
type LogMethods = keyof typeof LOG_TYPES;
|
|
56
|
+
type Logger = Record<LogMethods, LogFunction> & {
|
|
57
|
+
greet: (message: string) => void;
|
|
58
|
+
level: LogLevel;
|
|
59
|
+
override: (customLogger: Partial<Record<LogMethods, LogFunction>>) => void;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
declare let createLogger: (options?: Options) => Logger;
|
|
63
|
+
|
|
64
|
+
declare let logger: Logger;
|
|
71
65
|
|
|
72
66
|
export { createLogger, logger };
|
|
73
67
|
export type { LogFunction, LogLevel, LogMessage, LogType, Logger, Options };
|
package/compiled/rslog/index.js
CHANGED
|
@@ -99,6 +99,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
99
99
|
if ('TEAMCITY_VERSION' in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
100
100
|
if ('truecolor' === env.COLORTERM) return 3;
|
|
101
101
|
if ('xterm-kitty' === env.TERM) return 3;
|
|
102
|
+
if ('xterm-ghostty' === env.TERM) return 3;
|
|
102
103
|
if ('TERM_PROGRAM' in env) {
|
|
103
104
|
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
104
105
|
switch(env.TERM_PROGRAM){
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"rslog","version":"1.2.
|
|
1
|
+
{"name":"rslog","version":"1.2.11","license":"MIT","types":"index.d.ts","type":"commonjs"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"rspack-chain","author":"rspack-contrib","version":"1.3.
|
|
1
|
+
{"name":"rspack-chain","author":"rspack-contrib","version":"1.3.2","license":"MIT","types":"types/index.d.ts","type":"commonjs"}
|
package/dist/client/hmr.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
const config = RSBUILD_CLIENT_CONFIG;
|
|
2
|
+
const serverHost = RSBUILD_SERVER_HOST;
|
|
3
|
+
const serverPort = RSBUILD_SERVER_PORT;
|
|
4
|
+
function formatURL(fallback) {
|
|
4
5
|
const { location } = self;
|
|
5
|
-
const hostname = config.host || location.hostname;
|
|
6
|
-
const port = config.port || location.port;
|
|
6
|
+
const hostname = (fallback ? serverHost : config.host) || location.hostname;
|
|
7
|
+
const port = (fallback ? serverPort : config.port) || location.port;
|
|
7
8
|
const protocol = config.protocol || ('https:' === location.protocol ? 'wss' : 'ws');
|
|
8
9
|
const pathname = config.path;
|
|
9
10
|
if ('undefined' != typeof URL) {
|
|
@@ -117,8 +118,8 @@ function onMessage(e) {
|
|
|
117
118
|
}
|
|
118
119
|
}
|
|
119
120
|
function onClose() {
|
|
120
|
-
if (reconnectCount >=
|
|
121
|
-
if (
|
|
121
|
+
if (reconnectCount >= config.reconnect) {
|
|
122
|
+
if (config.reconnect > 0) console.info('[HMR] connection failure after maximum reconnect limit exceeded.');
|
|
122
123
|
return;
|
|
123
124
|
}
|
|
124
125
|
console.info('[HMR] disconnected. Attempting to reconnect.');
|
|
@@ -128,7 +129,7 @@ function onClose() {
|
|
|
128
129
|
setTimeout(connect, 1000 * 1.5 ** reconnectCount);
|
|
129
130
|
}
|
|
130
131
|
function onError() {
|
|
131
|
-
if (formatURL(
|
|
132
|
+
if (formatURL() !== formatURL(true)) {
|
|
132
133
|
console.error('[HMR] WebSocket connection error, attempting direct fallback.');
|
|
133
134
|
removeListeners();
|
|
134
135
|
connection = null;
|
|
@@ -137,7 +138,7 @@ function onError() {
|
|
|
137
138
|
}
|
|
138
139
|
function connect() {
|
|
139
140
|
let fallback = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : false;
|
|
140
|
-
const socketUrl = formatURL(fallback
|
|
141
|
+
const socketUrl = formatURL(fallback);
|
|
141
142
|
connection = new WebSocket(socketUrl);
|
|
142
143
|
connection.addEventListener('open', onOpen);
|
|
143
144
|
connection.addEventListener('close', onClose);
|