@rsbuild/core 1.6.10 → 1.6.11
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/memfs/index.js +123 -121
- package/compiled/memfs/package.json +1 -1
- package/compiled/rslog/index.js +12 -9
- package/compiled/rslog/package.json +1 -1
- package/compiled/webpack-merge/index.d.ts +31 -0
- package/compiled/webpack-merge/index.js +1200 -0
- package/compiled/webpack-merge/license +20 -0
- package/compiled/webpack-merge/package.json +1 -0
- package/dist/131.js +71 -742
- package/dist/131.js.LICENSE.txt +0 -21
- package/dist/136.mjs +1 -1
- package/dist/index.cjs +71 -754
- package/dist/index.cjs.LICENSE.txt +0 -21
- package/dist/rslib-runtime.js +1 -1
- package/dist-types/constants.d.ts +1 -0
- package/dist-types/helpers/vendors.d.ts +1 -0
- package/dist-types/server/socketServer.d.ts +4 -0
- package/package.json +3 -3
package/compiled/rslog/index.js
CHANGED
|
@@ -24,8 +24,8 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
createLogger: ()=>createLogger,
|
|
28
|
+
logger: ()=>src_logger
|
|
29
29
|
});
|
|
30
30
|
const external_node_process_namespaceObject = require("node:process");
|
|
31
31
|
const external_node_os_namespaceObject = require("node:os");
|
|
@@ -132,9 +132,10 @@ const supportsColor = {
|
|
|
132
132
|
};
|
|
133
133
|
const supports_color = supportsColor;
|
|
134
134
|
const colorLevel = supports_color.stdout ? supports_color.stdout.level : 0;
|
|
135
|
-
let errorStackRegExp = /at\
|
|
136
|
-
let anonymousErrorStackRegExp = /at\
|
|
137
|
-
let
|
|
135
|
+
let errorStackRegExp = /at [^\r\n]{0,200}:\d+:\d+[\s\)]*$/;
|
|
136
|
+
let anonymousErrorStackRegExp = /at [^\r\n]{0,200}\(<anonymous>\)$/;
|
|
137
|
+
let indexErrorStackRegExp = /at [^\r\n]{0,200}\(index\s\d+\)$/;
|
|
138
|
+
let isErrorStackMessage = (message)=>errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message) || indexErrorStackRegExp.test(message);
|
|
138
139
|
let formatter = (open, close, replace = open)=>colorLevel >= 2 ? (input)=>{
|
|
139
140
|
let string = '' + input;
|
|
140
141
|
let index = string.indexOf(close, open.length);
|
|
@@ -246,9 +247,10 @@ const normalizeErrorMessage = (err)=>{
|
|
|
246
247
|
let createLogger = (options = {})=>{
|
|
247
248
|
let maxLevel = options.level || 'info';
|
|
248
249
|
let log = (type, message, ...args)=>{
|
|
249
|
-
if (LOG_LEVEL[LOG_TYPES[type].level] > LOG_LEVEL[maxLevel]) return;
|
|
250
|
-
if (null == message) return console.log();
|
|
251
250
|
let logType = LOG_TYPES[type];
|
|
251
|
+
const { level } = logType;
|
|
252
|
+
if (LOG_LEVEL[level] > LOG_LEVEL[maxLevel]) return;
|
|
253
|
+
if (null == message) return console.log();
|
|
252
254
|
let label = '';
|
|
253
255
|
let text = '';
|
|
254
256
|
if ('label' in logType) {
|
|
@@ -262,11 +264,12 @@ let createLogger = (options = {})=>{
|
|
|
262
264
|
text += yellow('\n [cause]: ');
|
|
263
265
|
text += cause instanceof Error ? normalizeErrorMessage(cause) : String(cause);
|
|
264
266
|
}
|
|
265
|
-
} else if ('error' ===
|
|
267
|
+
} else if ('error' === level && 'string' == typeof message) {
|
|
266
268
|
let lines = message.split('\n');
|
|
267
269
|
text = lines.map((line)=>isErrorStackMessage(line) ? gray(line) : line).join('\n');
|
|
268
270
|
} else text = `${message}`;
|
|
269
|
-
|
|
271
|
+
const method = 'error' === level || 'warn' === level ? level : 'log';
|
|
272
|
+
console[method](label.length ? `${label} ${text}` : text, ...args);
|
|
270
273
|
};
|
|
271
274
|
let logger = {
|
|
272
275
|
greet: (message)=>log('log', gradient(message))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"rslog","version":"1.3.
|
|
1
|
+
{"name":"rslog","version":"1.3.2","license":"MIT","types":"index.d.ts","type":"commonjs"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare function mergeUnique(key: string, uniques: string[], getter: (a: object) => string): (a: [], b: [], k: string) => false | any[];
|
|
2
|
+
|
|
3
|
+
type Key = string;
|
|
4
|
+
type Customize = (a: any, b: any, key: Key) => any;
|
|
5
|
+
interface ICustomizeOptions {
|
|
6
|
+
customizeArray?: Customize;
|
|
7
|
+
customizeObject?: Customize;
|
|
8
|
+
}
|
|
9
|
+
declare enum CustomizeRule {
|
|
10
|
+
Match = "match",
|
|
11
|
+
Merge = "merge",
|
|
12
|
+
Append = "append",
|
|
13
|
+
Prepend = "prepend",
|
|
14
|
+
Replace = "replace"
|
|
15
|
+
}
|
|
16
|
+
type CustomizeRuleString = "match" | "merge" | "append" | "prepend" | "replace";
|
|
17
|
+
|
|
18
|
+
declare function merge<Configuration extends object>(firstConfiguration: Configuration | Configuration[], ...configurations: Configuration[]): Configuration;
|
|
19
|
+
declare function mergeWithCustomize<Configuration extends object>(options: ICustomizeOptions): (firstConfiguration: Configuration | Configuration[], ...configurations: Configuration[]) => Configuration;
|
|
20
|
+
declare function customizeArray(rules: {
|
|
21
|
+
[s: string]: CustomizeRule | CustomizeRuleString;
|
|
22
|
+
}): (a: any, b: any, key: Key) => any;
|
|
23
|
+
type Rules = {
|
|
24
|
+
[s: string]: CustomizeRule | CustomizeRuleString | Rules;
|
|
25
|
+
};
|
|
26
|
+
declare function mergeWithRules(rules: Rules): (firstConfiguration: object | object[], ...configurations: object[]) => object;
|
|
27
|
+
declare function customizeObject(rules: {
|
|
28
|
+
[s: string]: CustomizeRule | CustomizeRuleString;
|
|
29
|
+
}): (a: any, b: any, key: Key) => any;
|
|
30
|
+
|
|
31
|
+
export { CustomizeRule, customizeArray, customizeObject, merge as default, merge, mergeWithCustomize, mergeWithRules, mergeUnique as unique };
|