@visulima/pail 4.0.0-alpha.4 → 4.0.0-alpha.6

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.
Files changed (31) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/LICENSE.md +4 -4
  3. package/dist/index.browser.js +1488 -2
  4. package/dist/index.server.js +2656 -12
  5. package/dist/interactive/index.js +2 -2
  6. package/dist/packem_shared/AbstractJsonReporter-DWRpTtGw.js +204 -0
  7. package/dist/packem_shared/{InteractiveManager-CbE7d1kY.js → InteractiveManager-Cd6A14ZK.js} +1 -1
  8. package/dist/packem_shared/{interactive-stream-hook-DG4BtN12.js → InteractiveStreamHook-ePIURL_U.js} +1 -9
  9. package/dist/packem_shared/{JsonReporter-VzgyLEYz.js → JsonReporter-BV5lMnJX.js} +1 -1
  10. package/dist/packem_shared/{PrettyReporter-DySIXBjQ.js → PrettyReporter-BYL3NrdA.js} +49 -4
  11. package/dist/packem_shared/{format-label-De49vNPd.js → PrettyReporter-BjXCFQlo.js} +268 -3
  12. package/dist/packem_shared/Spinner-DIdVcfWq.js +2183 -0
  13. package/dist/packem_shared/abstract-pretty-reporter-jU8WL_6c.js +2602 -0
  14. package/dist/packem_shared/constants-B1RjD_ps.js +99 -0
  15. package/dist/packem_shared/getBarChar-BWj1UrH3.js +404 -0
  16. package/dist/packem_shared/{index-BomQ3E6J.js → index-DnkF86LQ.js} +9 -1
  17. package/dist/packem_shared/{index-EZ_WSQZS.js → index-frijFf5m.js} +120 -14
  18. package/dist/processor/message-formatter-processor.js +648 -1
  19. package/dist/reporter/file/json-file-reporter.js +1 -1
  20. package/dist/reporter/http/abstract-http-reporter.js +1 -1
  21. package/dist/reporter/json/index.js +2 -2
  22. package/dist/reporter/pretty/index.browser.js +1 -1
  23. package/dist/reporter/pretty/index.js +1 -1
  24. package/dist/reporter/simple/simple-reporter.server.js +2 -7
  25. package/dist/spinner.js +34 -1
  26. package/package.json +4 -4
  27. package/dist/packem_shared/InteractiveStreamHook-DiSubbJ1.js +0 -21
  28. package/dist/packem_shared/PrettyReporter-C2wVB7yu.js +0 -222
  29. package/dist/packem_shared/abstract-pretty-reporter-Di_sdm2r.js +0 -50
  30. package/dist/packem_shared/get-longest-label-C9PWeyKq.js +0 -9
  31. package/dist/packem_shared/pail.browser-u2CSR_af.js +0 -1427
@@ -1,4 +1,651 @@
1
- import { b as build } from '../packem_shared/index-BomQ3E6J.js';
1
+ const colorKeywords = /* @__PURE__ */ new Map([
2
+ ["aliceblue", "#f0f8ff"],
3
+ ["antiquewhite", "#faebd7"],
4
+ ["aqua", "#00ffff"],
5
+ ["aquamarine", "#7fffd4"],
6
+ ["azure", "#f0ffff"],
7
+ ["beige", "#f5f5dc"],
8
+ ["bisque", "#ffe4c4"],
9
+ ["black", "#000000"],
10
+ ["blanchedalmond", "#ffebcd"],
11
+ ["blue", "#0000ff"],
12
+ ["blueviolet", "#8a2be2"],
13
+ ["brown", "#a52a2a"],
14
+ ["burlywood", "#deb887"],
15
+ ["cadetblue", "#5f9ea0"],
16
+ ["chartreuse", "#7fff00"],
17
+ ["chocolate", "#d2691e"],
18
+ ["coral", "#ff7f50"],
19
+ ["cornflowerblue", "#6495ed"],
20
+ ["cornsilk", "#fff8dc"],
21
+ ["crimson", "#dc143c"],
22
+ ["cyan", "#00ffff"],
23
+ ["darkblue", "#00008b"],
24
+ ["darkcyan", "#008b8b"],
25
+ ["darkgoldenrod", "#b8860b"],
26
+ ["darkgray", "#a9a9a9"],
27
+ ["darkgreen", "#006400"],
28
+ ["darkgrey", "#a9a9a9"],
29
+ ["darkkhaki", "#bdb76b"],
30
+ ["darkmagenta", "#8b008b"],
31
+ ["darkolivegreen", "#556b2f"],
32
+ ["darkorange", "#ff8c00"],
33
+ ["darkorchid", "#9932cc"],
34
+ ["darkred", "#8b0000"],
35
+ ["darksalmon", "#e9967a"],
36
+ ["darkseagreen", "#8fbc8f"],
37
+ ["darkslateblue", "#483d8b"],
38
+ ["darkslategray", "#2f4f4f"],
39
+ ["darkslategrey", "#2f4f4f"],
40
+ ["darkturquoise", "#00ced1"],
41
+ ["darkviolet", "#9400d3"],
42
+ ["deeppink", "#ff1493"],
43
+ ["deepskyblue", "#00bfff"],
44
+ ["dimgray", "#696969"],
45
+ ["dimgrey", "#696969"],
46
+ ["dodgerblue", "#1e90ff"],
47
+ ["firebrick", "#b22222"],
48
+ ["floralwhite", "#fffaf0"],
49
+ ["forestgreen", "#228b22"],
50
+ ["fuchsia", "#ff00ff"],
51
+ ["gainsboro", "#dcdcdc"],
52
+ ["ghostwhite", "#f8f8ff"],
53
+ ["gold", "#ffd700"],
54
+ ["goldenrod", "#daa520"],
55
+ ["gray", "#808080"],
56
+ ["green", "#008000"],
57
+ ["greenyellow", "#adff2f"],
58
+ ["grey", "#808080"],
59
+ ["honeydew", "#f0fff0"],
60
+ ["hotpink", "#ff69b4"],
61
+ ["indianred", "#cd5c5c"],
62
+ ["indigo", "#4b0082"],
63
+ ["ivory", "#fffff0"],
64
+ ["khaki", "#f0e68c"],
65
+ ["lavender", "#e6e6fa"],
66
+ ["lavenderblush", "#fff0f5"],
67
+ ["lawngreen", "#7cfc00"],
68
+ ["lemonchiffon", "#fffacd"],
69
+ ["lightblue", "#add8e6"],
70
+ ["lightcoral", "#f08080"],
71
+ ["lightcyan", "#e0ffff"],
72
+ ["lightgoldenrodyellow", "#fafad2"],
73
+ ["lightgray", "#d3d3d3"],
74
+ ["lightgreen", "#90ee90"],
75
+ ["lightgrey", "#d3d3d3"],
76
+ ["lightpink", "#ffb6c1"],
77
+ ["lightsalmon", "#ffa07a"],
78
+ ["lightseagreen", "#20b2aa"],
79
+ ["lightskyblue", "#87cefa"],
80
+ ["lightslategray", "#778899"],
81
+ ["lightslategrey", "#778899"],
82
+ ["lightsteelblue", "#b0c4de"],
83
+ ["lightyellow", "#ffffe0"],
84
+ ["lime", "#00ff00"],
85
+ ["limegreen", "#32cd32"],
86
+ ["linen", "#faf0e6"],
87
+ ["magenta", "#ff00ff"],
88
+ ["maroon", "#800000"],
89
+ ["mediumaquamarine", "#66cdaa"],
90
+ ["mediumblue", "#0000cd"],
91
+ ["mediumorchid", "#ba55d3"],
92
+ ["mediumpurple", "#9370db"],
93
+ ["mediumseagreen", "#3cb371"],
94
+ ["mediumslateblue", "#7b68ee"],
95
+ ["mediumspringgreen", "#00fa9a"],
96
+ ["mediumturquoise", "#48d1cc"],
97
+ ["mediumvioletred", "#c71585"],
98
+ ["midnightblue", "#191970"],
99
+ ["mintcream", "#f5fffa"],
100
+ ["mistyrose", "#ffe4e1"],
101
+ ["moccasin", "#ffe4b5"],
102
+ ["navajowhite", "#ffdead"],
103
+ ["navy", "#000080"],
104
+ ["oldlace", "#fdf5e6"],
105
+ ["olive", "#808000"],
106
+ ["olivedrab", "#6b8e23"],
107
+ ["orange", "#ffa500"],
108
+ ["orangered", "#ff4500"],
109
+ ["orchid", "#da70d6"],
110
+ ["palegoldenrod", "#eee8aa"],
111
+ ["palegreen", "#98fb98"],
112
+ ["paleturquoise", "#afeeee"],
113
+ ["palevioletred", "#db7093"],
114
+ ["papayawhip", "#ffefd5"],
115
+ ["peachpuff", "#ffdab9"],
116
+ ["peru", "#cd853f"],
117
+ ["pink", "#ffc0cb"],
118
+ ["plum", "#dda0dd"],
119
+ ["powderblue", "#b0e0e6"],
120
+ ["purple", "#800080"],
121
+ ["rebeccapurple", "#663399"],
122
+ ["red", "#ff0000"],
123
+ ["rosybrown", "#bc8f8f"],
124
+ ["royalblue", "#4169e1"],
125
+ ["saddlebrown", "#8b4513"],
126
+ ["salmon", "#fa8072"],
127
+ ["sandybrown", "#f4a460"],
128
+ ["seagreen", "#2e8b57"],
129
+ ["seashell", "#fff5ee"],
130
+ ["sienna", "#a0522d"],
131
+ ["silver", "#c0c0c0"],
132
+ ["skyblue", "#87ceeb"],
133
+ ["slateblue", "#6a5acd"],
134
+ ["slategray", "#708090"],
135
+ ["slategrey", "#708090"],
136
+ ["snow", "#fffafa"],
137
+ ["springgreen", "#00ff7f"],
138
+ ["steelblue", "#4682b4"],
139
+ ["tan", "#d2b48c"],
140
+ ["teal", "#008080"],
141
+ ["thistle", "#d8bfd8"],
142
+ ["tomato", "#ff6347"],
143
+ ["turquoise", "#40e0d0"],
144
+ ["violet", "#ee82ee"],
145
+ ["wheat", "#f5deb3"],
146
+ ["white", "#ffffff"],
147
+ ["whitesmoke", "#f5f5f5"],
148
+ ["yellow", "#ffff00"],
149
+ ["yellowgreen", "#9acd32"]
150
+ ]);
151
+ const HASH_PATTERN = /^#([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})?$/i;
152
+ const SMALL_HASH_PATTERN = /^#([\dA-F])([\dA-F])([\dA-F])([\dA-F])?$/i;
153
+ const RGB_PATTERN = /^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/;
154
+ const HSL_PATTERN = /^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/;
155
+ const getDefaultCss = () => {
156
+ return {
157
+ __proto__: null,
158
+ backgroundColor: null,
159
+ color: null,
160
+ fontStyle: null,
161
+ fontWeight: null,
162
+ textDecorationColor: null,
163
+ textDecorationLine: []
164
+ };
165
+ };
166
+ const SPACE_PATTERN = /\s+/g;
167
+ const parseCssColor = (colorString) => {
168
+ if (colorKeywords.has(colorString)) {
169
+ colorString = colorKeywords.get(colorString);
170
+ }
171
+ const hashMatch = HASH_PATTERN.exec(colorString);
172
+ if (hashMatch) {
173
+ return [Number.parseInt(hashMatch[1], 16), Number.parseInt(hashMatch[2], 16), Number.parseInt(hashMatch[3], 16)];
174
+ }
175
+ const smallHashMatch = SMALL_HASH_PATTERN.exec(colorString);
176
+ if (smallHashMatch) {
177
+ return [
178
+ Number.parseInt(`${smallHashMatch[1]}${smallHashMatch[1]}`, 16),
179
+ Number.parseInt(`${smallHashMatch[2]}${smallHashMatch[2]}`, 16),
180
+ Number.parseInt(`${smallHashMatch[3]}${smallHashMatch[3]}`, 16)
181
+ ];
182
+ }
183
+ const rgbMatch = RGB_PATTERN.exec(colorString);
184
+ if (rgbMatch) {
185
+ return [
186
+ Math.round(Math.max(0, Math.min(255, Number(rgbMatch[1])))),
187
+ Math.round(Math.max(0, Math.min(255, Number(rgbMatch[2])))),
188
+ Math.round(Math.max(0, Math.min(255, Number(rgbMatch[3]))))
189
+ ];
190
+ }
191
+ const hslMatch = HSL_PATTERN.exec(colorString);
192
+ if (hslMatch) {
193
+ let h = Number(hslMatch[1]) % 360;
194
+ if (h < 0) {
195
+ h += 360;
196
+ }
197
+ const s = Math.max(0, Math.min(100, Number(hslMatch[2]))) / 100;
198
+ const l = Math.max(0, Math.min(100, Number(hslMatch[3]))) / 100;
199
+ const c = (1 - Math.abs(2 * l - 1)) * s;
200
+ const x = c * (1 - Math.abs(h / 60 % 2 - 1));
201
+ const m = l - c / 2;
202
+ let r_;
203
+ let g_;
204
+ let b_;
205
+ if (h < 60) {
206
+ ({ 0: r_, 1: g_, 2: b_ } = [c, x, 0]);
207
+ } else if (h < 120) {
208
+ ({ 0: r_, 1: g_, 2: b_ } = [x, c, 0]);
209
+ } else if (h < 180) {
210
+ ({ 0: r_, 1: g_, 2: b_ } = [0, c, x]);
211
+ } else if (h < 240) {
212
+ ({ 0: r_, 1: g_, 2: b_ } = [0, x, c]);
213
+ } else if (h < 300) {
214
+ ({ 0: r_, 1: g_, 2: b_ } = [x, 0, c]);
215
+ } else {
216
+ ({ 0: r_, 1: g_, 2: b_ } = [c, 0, x]);
217
+ }
218
+ return [Math.round((r_ + m) * 255), Math.round((g_ + m) * 255), Math.round((b_ + m) * 255)];
219
+ }
220
+ return null;
221
+ };
222
+ const colorEquals = (color1, color2) => color1?.[0] === color2?.[0] && color1?.[1] === color2?.[1] && color1?.[2] === color2?.[2];
223
+ const parseCss = (cssString) => {
224
+ const css = getDefaultCss();
225
+ const rawEntries = [];
226
+ let inValue = false;
227
+ let currentKey = null;
228
+ let parenthesesDepth = 0;
229
+ let currentPart = "";
230
+ for (const c of cssString) {
231
+ if (c === "(") {
232
+ parenthesesDepth++;
233
+ } else if (parenthesesDepth > 0) {
234
+ if (c === ")") {
235
+ parenthesesDepth--;
236
+ }
237
+ } else if (inValue) {
238
+ if (c === ";") {
239
+ const value = currentPart.trim();
240
+ if (value !== "") {
241
+ rawEntries.push([currentKey, value]);
242
+ }
243
+ currentKey = null;
244
+ currentPart = "";
245
+ inValue = false;
246
+ continue;
247
+ }
248
+ } else if (c === ":") {
249
+ currentKey = currentPart.trim();
250
+ currentPart = "";
251
+ inValue = true;
252
+ continue;
253
+ }
254
+ currentPart += c;
255
+ }
256
+ if (inValue && parenthesesDepth === 0) {
257
+ const value = currentPart.trim();
258
+ if (value !== "") {
259
+ rawEntries.push([currentKey, value]);
260
+ }
261
+ currentKey = null;
262
+ currentPart = "";
263
+ }
264
+ for (const { 0: key, 1: value } of rawEntries) {
265
+ switch (key) {
266
+ case "background-color": {
267
+ if (value != void 0) {
268
+ css.backgroundColor = value;
269
+ }
270
+ break;
271
+ }
272
+ case "color": {
273
+ if (value != void 0) {
274
+ css.color = value;
275
+ }
276
+ break;
277
+ }
278
+ case "font-style": {
279
+ if (["italic", "oblique", "oblique 14deg"].includes(value)) {
280
+ css.fontStyle = "italic";
281
+ }
282
+ break;
283
+ }
284
+ case "font-weight": {
285
+ if (value === "bold") {
286
+ css.fontWeight = value;
287
+ }
288
+ break;
289
+ }
290
+ case "text-decoration": {
291
+ css.textDecorationColor = null;
292
+ css.textDecorationLine = [];
293
+ const arguments_ = value.split(SPACE_PATTERN);
294
+ for (const argument of arguments_) {
295
+ const maybeColor = parseCssColor(argument);
296
+ if (maybeColor != void 0) {
297
+ css.textDecorationColor = maybeColor;
298
+ } else if (["line-through", "overline", "underline"].includes(argument)) {
299
+ css.textDecorationLine.push(argument);
300
+ }
301
+ }
302
+ break;
303
+ }
304
+ case "text-decoration-color": {
305
+ const color = parseCssColor(value);
306
+ if (color != void 0) {
307
+ css.textDecorationColor = color;
308
+ }
309
+ break;
310
+ }
311
+ case "text-decoration-line": {
312
+ css.textDecorationLine = [];
313
+ const lineTypes = value.split(SPACE_PATTERN);
314
+ for (const lineType of lineTypes) {
315
+ if (["line-through", "overline", "underline"].includes(lineType)) {
316
+ css.textDecorationLine.push(lineType);
317
+ }
318
+ }
319
+ break;
320
+ }
321
+ }
322
+ }
323
+ return css;
324
+ };
325
+ const cssToAnsi = (css, previousCss = null) => {
326
+ previousCss = previousCss ?? getDefaultCss();
327
+ let ansi = "";
328
+ if (!colorEquals(css.backgroundColor, previousCss.backgroundColor)) {
329
+ if (css.backgroundColor == void 0) {
330
+ ansi += "\x1B[49m";
331
+ } else {
332
+ switch (css.backgroundColor) {
333
+ case "black": {
334
+ ansi += "\x1B[40m";
335
+ break;
336
+ }
337
+ case "blue": {
338
+ ansi += "\x1B[44m";
339
+ break;
340
+ }
341
+ case "cyan": {
342
+ ansi += "\x1B[46m";
343
+ break;
344
+ }
345
+ case "green": {
346
+ ansi += "\x1B[42m";
347
+ break;
348
+ }
349
+ case "magenta": {
350
+ ansi += "\x1B[45m";
351
+ break;
352
+ }
353
+ case "red": {
354
+ ansi += "\x1B[41m";
355
+ break;
356
+ }
357
+ case "white": {
358
+ ansi += "\x1B[47m";
359
+ break;
360
+ }
361
+ case "yellow": {
362
+ ansi += "\x1B[43m";
363
+ break;
364
+ }
365
+ default: {
366
+ if (Array.isArray(css.backgroundColor)) {
367
+ const { 0: r, 1: g, 2: b } = css.backgroundColor;
368
+ ansi += `\x1B[48;2;${r};${g};${b}m`;
369
+ } else {
370
+ const parsed = parseCssColor(css.backgroundColor);
371
+ if (parsed === null) {
372
+ ansi += "\x1B[49m";
373
+ } else {
374
+ const { 0: r, 1: g, 2: b } = parsed;
375
+ ansi += `\x1B[48;2;${r};${g};${b}m`;
376
+ }
377
+ }
378
+ }
379
+ }
380
+ }
381
+ }
382
+ if (!colorEquals(css.color, previousCss.color)) {
383
+ if (css.color == void 0) {
384
+ ansi += "\x1B[39m";
385
+ } else {
386
+ switch (css.color) {
387
+ case "black": {
388
+ ansi += "\x1B[30m";
389
+ break;
390
+ }
391
+ case "blue": {
392
+ ansi += "\x1B[34m";
393
+ break;
394
+ }
395
+ case "cyan": {
396
+ ansi += "\x1B[36m";
397
+ break;
398
+ }
399
+ case "green": {
400
+ ansi += "\x1B[32m";
401
+ break;
402
+ }
403
+ case "magenta": {
404
+ ansi += "\x1B[35m";
405
+ break;
406
+ }
407
+ case "red": {
408
+ ansi += "\x1B[31m";
409
+ break;
410
+ }
411
+ case "white": {
412
+ ansi += "\x1B[37m";
413
+ break;
414
+ }
415
+ case "yellow": {
416
+ ansi += "\x1B[33m";
417
+ break;
418
+ }
419
+ default: {
420
+ if (Array.isArray(css.color)) {
421
+ const { 0: r, 1: g, 2: b } = css.color;
422
+ ansi += `\x1B[38;2;${r};${g};${b}m`;
423
+ } else {
424
+ const parsed = parseCssColor(css.color);
425
+ if (parsed === null) {
426
+ ansi += "\x1B[39m";
427
+ } else {
428
+ const { 0: r, 1: g, 2: b } = parsed;
429
+ ansi += `\x1B[38;2;${r};${g};${b}m`;
430
+ }
431
+ }
432
+ }
433
+ }
434
+ }
435
+ }
436
+ if (css.fontWeight !== previousCss.fontWeight) {
437
+ ansi += css.fontWeight === "bold" ? "\x1B[1m" : "\x1B[22m";
438
+ }
439
+ if (css.fontStyle !== previousCss.fontStyle) {
440
+ ansi += css.fontStyle === "italic" ? "\x1B[3m" : "\x1B[23m";
441
+ }
442
+ if (!colorEquals(css.textDecorationColor, previousCss.textDecorationColor)) {
443
+ if (css.textDecorationColor == void 0) {
444
+ ansi += "\x1B[59m";
445
+ } else {
446
+ const { 0: r, 1: g, 2: b } = css.textDecorationColor;
447
+ ansi += `\x1B[58;2;${r};${g};${b}m`;
448
+ }
449
+ }
450
+ if (css.textDecorationLine.includes("line-through") !== previousCss.textDecorationLine.includes("line-through")) {
451
+ ansi += css.textDecorationLine.includes("line-through") ? "\x1B[9m" : "\x1B[29m";
452
+ }
453
+ if (css.textDecorationLine.includes("overline") !== previousCss.textDecorationLine.includes("overline")) {
454
+ ansi += css.textDecorationLine.includes("overline") ? "\x1B[53m" : "\x1B[55m";
455
+ }
456
+ if (css.textDecorationLine.includes("underline") !== previousCss.textDecorationLine.includes("underline")) {
457
+ ansi += css.textDecorationLine.includes("underline") ? "\x1B[4m" : "\x1B[24m";
458
+ }
459
+ return ansi;
460
+ };
461
+ const tryStringify = (o) => {
462
+ try {
463
+ return JSON.stringify(o);
464
+ } catch {
465
+ return '"[Circular]"';
466
+ }
467
+ };
468
+ const CHAR_PERCENT = "%".codePointAt(0);
469
+ const CHAR_s = "s".codePointAt(0);
470
+ const CHAR_d = "d".codePointAt(0);
471
+ const CHAR_f = "f".codePointAt(0);
472
+ const CHAR_i = "i".codePointAt(0);
473
+ const CHAR_O = "O".codePointAt(0);
474
+ const CHAR_o = "o".codePointAt(0);
475
+ const CHAR_j = "j".codePointAt(0);
476
+ const CHAR_c = "c".codePointAt(0);
477
+ const format = (fmt, arguments_ = [], options = {}) => {
478
+ if (typeof fmt !== "string" && typeof fmt !== "object" || fmt === null) {
479
+ throw new TypeError(`fmt must be a string or object, got ${fmt === null ? "null" : typeof fmt}`);
480
+ }
481
+ const stringify = options.stringify ?? tryStringify;
482
+ const offset = 1;
483
+ if (typeof fmt === "object") {
484
+ const argumentsLength = arguments_.length + offset;
485
+ if (argumentsLength === 1) {
486
+ return "{}";
487
+ }
488
+ const objects = Array.from({ length: argumentsLength });
489
+ objects[0] = stringify(fmt);
490
+ for (let index = 1; index < argumentsLength; index++) {
491
+ objects[index] = stringify(arguments_[index - offset]);
492
+ }
493
+ return objects.join(" ");
494
+ }
495
+ if (arguments_.length === 0) {
496
+ return fmt;
497
+ }
498
+ let result = "";
499
+ let a = 1 - offset;
500
+ let lastPosition = -1;
501
+ let usedStyle = false;
502
+ let previousCss = null;
503
+ for (let index = 0; index < fmt.length; ) {
504
+ if (fmt.codePointAt(index) === CHAR_PERCENT && index + 1 < fmt.length) {
505
+ lastPosition = lastPosition > -1 ? lastPosition : 0;
506
+ const c = fmt.codePointAt(index + 1);
507
+ if (c === void 0) {
508
+ ++a;
509
+ break;
510
+ }
511
+ switch (c) {
512
+ case CHAR_c: {
513
+ if (globalThis.window === void 0) {
514
+ const css = parseCss(arguments_[a]);
515
+ if (lastPosition < index) {
516
+ result += fmt.slice(lastPosition, index);
517
+ }
518
+ result += cssToAnsi(css, previousCss);
519
+ if (result !== "") {
520
+ usedStyle = true;
521
+ previousCss = css;
522
+ }
523
+ }
524
+ lastPosition = index + 2;
525
+ index++;
526
+ break;
527
+ }
528
+ case CHAR_d:
529
+ case CHAR_f: {
530
+ if (a >= arguments_.length || arguments_[a] == void 0) {
531
+ break;
532
+ }
533
+ if (lastPosition < index) {
534
+ result += fmt.slice(lastPosition, index);
535
+ }
536
+ result += Number(arguments_[a]).toString();
537
+ lastPosition = index + 2;
538
+ index++;
539
+ break;
540
+ }
541
+ case CHAR_i: {
542
+ if (a >= arguments_.length || arguments_[a] == void 0) {
543
+ break;
544
+ }
545
+ if (lastPosition < index) {
546
+ result += fmt.slice(lastPosition, index);
547
+ }
548
+ result += Math.floor(Number(arguments_[a])).toString();
549
+ lastPosition = index + 2;
550
+ index++;
551
+ break;
552
+ }
553
+ case CHAR_j:
554
+ case CHAR_O:
555
+ case CHAR_o: {
556
+ if (a >= arguments_.length || arguments_[a] === void 0) {
557
+ break;
558
+ }
559
+ if (lastPosition < index) {
560
+ result += fmt.slice(lastPosition, index);
561
+ }
562
+ const temporaryArgument = arguments_[a];
563
+ const type = typeof temporaryArgument;
564
+ if (type === "string") {
565
+ result += `'${temporaryArgument}'`;
566
+ lastPosition = index + 2;
567
+ break;
568
+ }
569
+ if (type === "function") {
570
+ result += temporaryArgument.name ? `[Function: ${temporaryArgument.name}]` : "[Function: <anonymous>]";
571
+ lastPosition = index + 2;
572
+ break;
573
+ }
574
+ result += stringify(temporaryArgument);
575
+ lastPosition = index + 2;
576
+ index++;
577
+ break;
578
+ }
579
+ case CHAR_PERCENT: {
580
+ if (lastPosition < index) {
581
+ result += fmt.slice(lastPosition, index);
582
+ }
583
+ result += "%";
584
+ lastPosition = index + 2;
585
+ index++;
586
+ a--;
587
+ break;
588
+ }
589
+ case CHAR_s: {
590
+ if (a >= arguments_.length) {
591
+ break;
592
+ }
593
+ if (lastPosition < index) {
594
+ result += fmt.slice(lastPosition, index);
595
+ }
596
+ result += typeof arguments_[a] === "object" ? stringify(arguments_[a]) : String(arguments_[a]);
597
+ lastPosition = index + 2;
598
+ index++;
599
+ break;
600
+ }
601
+ default: {
602
+ if (typeof options.formatters?.[c] === "function") {
603
+ if (lastPosition < index) {
604
+ result += fmt.slice(lastPosition, index);
605
+ }
606
+ result += options.formatters[c](arguments_[a]);
607
+ lastPosition = index + 2;
608
+ index++;
609
+ }
610
+ }
611
+ }
612
+ ++a;
613
+ }
614
+ ++index;
615
+ }
616
+ if (lastPosition === -1) {
617
+ return fmt;
618
+ }
619
+ if (lastPosition < fmt.length) {
620
+ result += fmt.slice(lastPosition);
621
+ }
622
+ if (usedStyle) {
623
+ result += "\x1B[0m";
624
+ }
625
+ return result;
626
+ };
627
+ const build = (options = {}) => {
628
+ const formatters = {};
629
+ if (typeof options.formatters === "object") {
630
+ Object.entries(options.formatters).forEach(([key, formatterFunction]) => {
631
+ if (key.length === 0) {
632
+ throw new Error(`Formatter %${key} has no characters`);
633
+ }
634
+ if (key.length > 1) {
635
+ throw new Error(`Formatter %${key} has more than one character`);
636
+ }
637
+ if (typeof formatterFunction !== "function") {
638
+ throw new TypeError(`Formatter for %${key} is not a function`);
639
+ }
640
+ const c = key.codePointAt(0);
641
+ if (c === void 0) {
642
+ throw new Error(`${key}.codePointAt(0) failed to return a value, please report this issue`);
643
+ }
644
+ formatters[c] = formatterFunction;
645
+ });
646
+ }
647
+ return (f, arguments_ = [], formatOptions = {}) => format(f, arguments_, { ...formatOptions, formatters });
648
+ };
2
649
 
3
650
  class MessageFormatterProcessor {
4
651
  /** Custom stringify function for object serialization */
@@ -1,4 +1,4 @@
1
- import { AbstractJsonReporter } from '../../packem_shared/AbstractJsonReporter-BaZ33PlE.js';
1
+ import { AbstractJsonReporter } from '../../packem_shared/AbstractJsonReporter-DWRpTtGw.js';
2
2
 
3
3
  class SafeStreamHandler {
4
4
  #ready = true;
@@ -20,7 +20,7 @@ const __cjs_getBuiltinModule = (module) => {
20
20
  const {
21
21
  Buffer
22
22
  } = __cjs_getBuiltinModule("node:buffer");
23
- import { AbstractJsonReporter } from '../../packem_shared/AbstractJsonReporter-BaZ33PlE.js';
23
+ import { AbstractJsonReporter } from '../../packem_shared/AbstractJsonReporter-DWRpTtGw.js';
24
24
  const {
25
25
  gzipSync
26
26
  } = __cjs_getBuiltinModule("node:zlib");
@@ -1,2 +1,2 @@
1
- export { AbstractJsonReporter } from '../../packem_shared/AbstractJsonReporter-BaZ33PlE.js';
2
- export { default as JsonReporter } from '../../packem_shared/JsonReporter-VzgyLEYz.js';
1
+ export { AbstractJsonReporter } from '../../packem_shared/AbstractJsonReporter-DWRpTtGw.js';
2
+ export { default as JsonReporter } from '../../packem_shared/JsonReporter-BV5lMnJX.js';
@@ -1 +1 @@
1
- export { default as PrettyReporter } from '../../packem_shared/PrettyReporter-DySIXBjQ.js';
1
+ export { default as PrettyReporter } from '../../packem_shared/PrettyReporter-BYL3NrdA.js';
@@ -1 +1 @@
1
- export { PrettyReporter } from '../../packem_shared/PrettyReporter-C2wVB7yu.js';
1
+ export { PrettyReporter } from '../../packem_shared/PrettyReporter-BjXCFQlo.js';
@@ -8,13 +8,8 @@ const {
8
8
  stdout,
9
9
  stderr
10
10
  } = __cjs_getProcess;
11
- import colorize, { red, greenBright, cyan, green, grey, bold, white, bgGrey, underline } from '@visulima/colorize';
12
- import { d as defaultInspectorConfig, f as formatLabel, i as inspect, r as renderError } from '../../packem_shared/format-label-De49vNPd.js';
13
- import { t as terminalSize, g as getStringWidth, w as wordWrap, W as WrapMode } from '../../packem_shared/index-EZ_WSQZS.js';
14
- import { E as EMPTY_SYMBOL } from '../../packem_shared/constants-omsTHUWB.js';
15
- import { A as AbstractPrettyReporter, g as getLongestBadge } from '../../packem_shared/abstract-pretty-reporter-Di_sdm2r.js';
16
- import { g as getLongestLabel } from '../../packem_shared/get-longest-label-C9PWeyKq.js';
17
- import { w as writeStream } from '../../packem_shared/write-stream-BG8fhcs3.js';
11
+ import colorize, { red, greenBright, cyan, green, grey, bold, bgGrey, underline, white } from '@visulima/colorize';
12
+ import { A as AbstractPrettyReporter, d as defaultInspectorConfig, b as writeStream, t as terminalSize, c as getLongestBadge, g as getLongestLabel, e as getStringWidth, f as formatLabel, a as EMPTY_SYMBOL, i as inspect, w as wordWrap, r as renderError, W as WrapMode } from '../../packem_shared/abstract-pretty-reporter-jU8WL_6c.js';
18
13
 
19
14
  const pailFileFilter = (line) => !/[\\/]pail[\\/]dist/.test(line);
20
15
  class SimpleReporter extends AbstractPrettyReporter {