@rsbuild/core 1.4.14 → 1.4.16
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/launch-editor-middleware/index.js +18 -15
- package/compiled/launch-editor-middleware/package.json +1 -1
- 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 +9 -9
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
|
|
3
|
+
377: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
4
4
|
const path = __nccwpck_require__(928);
|
|
5
|
-
const launch = __nccwpck_require__(
|
|
5
|
+
const launch = __nccwpck_require__(719);
|
|
6
6
|
module.exports = (specifiedEditor, srcRoot, onErrorCallback) => {
|
|
7
7
|
if (typeof specifiedEditor === "function") {
|
|
8
8
|
onErrorCallback = specifiedEditor;
|
|
@@ -16,7 +16,10 @@
|
|
|
16
16
|
return function launchEditorMiddleware(req, res) {
|
|
17
17
|
let url;
|
|
18
18
|
try {
|
|
19
|
-
|
|
19
|
+
const fullUrl = req.url.startsWith("http")
|
|
20
|
+
? req.url
|
|
21
|
+
: `http://localhost${req.url}`;
|
|
22
|
+
url = new URL(fullUrl);
|
|
20
23
|
} catch (_err) {
|
|
21
24
|
res.statusCode = 500;
|
|
22
25
|
res.end(`launch-editor-middleware: invalid URL.`);
|
|
@@ -38,7 +41,7 @@
|
|
|
38
41
|
};
|
|
39
42
|
};
|
|
40
43
|
},
|
|
41
|
-
|
|
44
|
+
218: (module) => {
|
|
42
45
|
module.exports = {
|
|
43
46
|
atom: "atom",
|
|
44
47
|
Brackets: "brackets",
|
|
@@ -68,7 +71,7 @@
|
|
|
68
71
|
zed: "zed",
|
|
69
72
|
};
|
|
70
73
|
},
|
|
71
|
-
|
|
74
|
+
193: (module) => {
|
|
72
75
|
module.exports = {
|
|
73
76
|
"/Applications/Atom.app/Contents/MacOS/Atom": "atom",
|
|
74
77
|
"/Applications/Atom Beta.app/Contents/MacOS/Atom Beta":
|
|
@@ -116,7 +119,7 @@
|
|
|
116
119
|
"/Applications/Zed.app/Contents/MacOS/zed": "zed",
|
|
117
120
|
};
|
|
118
121
|
},
|
|
119
|
-
|
|
122
|
+
361: (module) => {
|
|
120
123
|
module.exports = [
|
|
121
124
|
"Brackets.exe",
|
|
122
125
|
"Code.exe",
|
|
@@ -145,7 +148,7 @@
|
|
|
145
148
|
"trae.exe",
|
|
146
149
|
];
|
|
147
150
|
},
|
|
148
|
-
|
|
151
|
+
421: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
149
152
|
const path = __nccwpck_require__(928);
|
|
150
153
|
module.exports = function getArgumentsForPosition(
|
|
151
154
|
editor,
|
|
@@ -217,13 +220,13 @@
|
|
|
217
220
|
return [fileName];
|
|
218
221
|
};
|
|
219
222
|
},
|
|
220
|
-
|
|
223
|
+
346: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
221
224
|
const path = __nccwpck_require__(928);
|
|
222
225
|
const shellQuote = __nccwpck_require__(710);
|
|
223
226
|
const childProcess = __nccwpck_require__(317);
|
|
224
|
-
const COMMON_EDITORS_MACOS = __nccwpck_require__(
|
|
225
|
-
const COMMON_EDITORS_LINUX = __nccwpck_require__(
|
|
226
|
-
const COMMON_EDITORS_WIN = __nccwpck_require__(
|
|
227
|
+
const COMMON_EDITORS_MACOS = __nccwpck_require__(193);
|
|
228
|
+
const COMMON_EDITORS_LINUX = __nccwpck_require__(218);
|
|
229
|
+
const COMMON_EDITORS_WIN = __nccwpck_require__(361);
|
|
227
230
|
module.exports = function guessEditor(specifiedEditor) {
|
|
228
231
|
if (specifiedEditor) {
|
|
229
232
|
return shellQuote.parse(specifiedEditor);
|
|
@@ -303,14 +306,14 @@
|
|
|
303
306
|
return [null];
|
|
304
307
|
};
|
|
305
308
|
},
|
|
306
|
-
|
|
309
|
+
719: (module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
307
310
|
const fs = __nccwpck_require__(896);
|
|
308
311
|
const os = __nccwpck_require__(857);
|
|
309
312
|
const path = __nccwpck_require__(928);
|
|
310
313
|
const colors = __nccwpck_require__(717);
|
|
311
314
|
const childProcess = __nccwpck_require__(317);
|
|
312
|
-
const guessEditor = __nccwpck_require__(
|
|
313
|
-
const getArgumentsForPosition = __nccwpck_require__(
|
|
315
|
+
const guessEditor = __nccwpck_require__(346);
|
|
316
|
+
const getArgumentsForPosition = __nccwpck_require__(421);
|
|
314
317
|
function wrapErrorCallback(cb) {
|
|
315
318
|
return (fileName, errorMessage) => {
|
|
316
319
|
console.log();
|
|
@@ -710,6 +713,6 @@
|
|
|
710
713
|
}
|
|
711
714
|
if (typeof __nccwpck_require__ !== "undefined")
|
|
712
715
|
__nccwpck_require__.ab = __dirname + "/";
|
|
713
|
-
var __webpack_exports__ = __nccwpck_require__(
|
|
716
|
+
var __webpack_exports__ = __nccwpck_require__(377);
|
|
714
717
|
module.exports = __webpack_exports__;
|
|
715
718
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"launch-editor-middleware","author":"Evan You","version":"2.11.
|
|
1
|
+
{"name":"launch-editor-middleware","author":"Evan You","version":"2.11.1","license":"MIT","types":"index.d.ts","type":"commonjs"}
|
|
@@ -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);
|