@visulima/pail 2.1.10 → 2.1.12

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 (43) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/LICENSE.md +122 -0
  3. package/README.md +41 -41
  4. package/dist/index.browser.cjs +1 -1
  5. package/dist/index.server.cjs +4 -4
  6. package/dist/index.server.mjs +4 -4
  7. package/dist/packem_shared/CallerProcessor-BBHkvRgS.mjs +1 -0
  8. package/dist/packem_shared/CallerProcessor-CLoY9R76.cjs +1 -0
  9. package/dist/packem_shared/{JsonFileReporter-CMXak2Df.cjs → JsonFileReporter-CLEMnuGI.cjs} +1 -1
  10. package/dist/packem_shared/JsonReporter-CiQkPCv4.cjs +2 -0
  11. package/dist/packem_shared/JsonReporter-CjvkrXUp.cjs +1 -0
  12. package/dist/packem_shared/PrettyReporter-1SleqVaI.mjs +13 -0
  13. package/dist/packem_shared/{PrettyReporter-oX3tQP4v.mjs → PrettyReporter-C_AJrNOj.mjs} +1 -1
  14. package/dist/packem_shared/PrettyReporter-CldK9UpN.cjs +13 -0
  15. package/dist/packem_shared/PrettyReporter-CuJWFD0k.cjs +5 -0
  16. package/dist/packem_shared/SimpleReporter-Cy_0ZeXQ.cjs +11 -0
  17. package/dist/packem_shared/SimpleReporter-DzUWU5Gu.mjs +11 -0
  18. package/dist/packem_shared/abstract-json-reporter-Z6bVrpPK.cjs +1 -0
  19. package/dist/packem_shared/{abstract-pretty-reporter-B14XYOWC.cjs → abstract-pretty-reporter-CZb4ET-0.cjs} +1 -1
  20. package/dist/packem_shared/{constants-BBH2bwRB.cjs → constants-BFrKdBPm.cjs} +1 -1
  21. package/dist/packem_shared/format-label-B0BaeOry.cjs +8 -0
  22. package/dist/packem_shared/format-label-ECls2QEw.mjs +8 -0
  23. package/dist/packem_shared/pail.browser-tTEE0Aky.cjs +1 -0
  24. package/dist/processor.server.cjs +1 -1
  25. package/dist/processor.server.mjs +1 -1
  26. package/dist/reporter.browser.cjs +1 -1
  27. package/dist/reporter.browser.mjs +1 -1
  28. package/dist/reporter.server.cjs +1 -1
  29. package/dist/reporter.server.mjs +1 -1
  30. package/package.json +19 -19
  31. package/dist/packem_shared/CallerProcessor-BSnSafz5.cjs +0 -1
  32. package/dist/packem_shared/CallerProcessor-BkGBDPIm.mjs +0 -1
  33. package/dist/packem_shared/JsonReporter-Be-Pmt7o.cjs +0 -1
  34. package/dist/packem_shared/JsonReporter-i0KfkPd7.cjs +0 -2
  35. package/dist/packem_shared/PrettyReporter-C9CiOb6F.cjs +0 -5
  36. package/dist/packem_shared/PrettyReporter-LK4KD_vd.mjs +0 -13
  37. package/dist/packem_shared/PrettyReporter-TmVtQa5X.cjs +0 -13
  38. package/dist/packem_shared/SimpleReporter-CbzX9MBa.cjs +0 -11
  39. package/dist/packem_shared/SimpleReporter-ghIIUjNT.mjs +0 -11
  40. package/dist/packem_shared/abstract-json-reporter-CjTo97r_.cjs +0 -1
  41. package/dist/packem_shared/format-label-mKzVo7-U.mjs +0 -8
  42. package/dist/packem_shared/format-label-v7wmniOZ.cjs +0 -8
  43. package/dist/packem_shared/pail.browser-BL-yRzuj.cjs +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,38 @@
1
+ ## @visulima/pail [2.1.12](https://github.com/visulima/visulima/compare/@visulima/pail@2.1.11...@visulima/pail@2.1.12) (2024-12-12)
2
+
3
+ ### Bug Fixes
4
+
5
+ * allow node v23 ([8ca929a](https://github.com/visulima/visulima/commit/8ca929af311ce8036cbbfde68b6db05381b860a5))
6
+ * allowed node 23, updated dev dependencies ([f99d34e](https://github.com/visulima/visulima/commit/f99d34e01f6b13be8586a1b5d37dc8b8df0a5817))
7
+ * updated packem to v1.8.2 ([23f869b](https://github.com/visulima/visulima/commit/23f869b4120856cc97e2bffa6d508e2ae30420ea))
8
+ * updated packem to v1.9.2 ([47bdc2d](https://github.com/visulima/visulima/commit/47bdc2dfaeca4e7014dbe7772eae2fdf8c8b35bb))
9
+
10
+ ### Styles
11
+
12
+ * cs fixes ([46d31e0](https://github.com/visulima/visulima/commit/46d31e082e1865262bf380859c14fabd28ff456d))
13
+
14
+ ### Miscellaneous Chores
15
+
16
+ * updated dev dependencies ([a916944](https://github.com/visulima/visulima/commit/a916944b888bb34c34b0c54328b38d29e4399857))
17
+
18
+
19
+ ### Dependencies
20
+
21
+ * **@visulima/colorize:** upgraded to 1.4.13
22
+ * **@visulima/error:** upgraded to 4.4.8
23
+ * **@visulima/fmt:** upgraded to 1.1.12
24
+ * **@visulima/inspector:** upgraded to 1.0.13
25
+ * **@visulima/redact:** upgraded to 1.0.10
26
+
27
+ ## @visulima/pail [2.1.11](https://github.com/visulima/visulima/compare/@visulima/pail@2.1.10...@visulima/pail@2.1.11) (2024-10-05)
28
+
29
+
30
+ ### Dependencies
31
+
32
+ * **@visulima/colorize:** upgraded to 1.4.12
33
+ * **@visulima/error:** upgraded to 4.4.7
34
+ * **@visulima/inspector:** upgraded to 1.0.12
35
+
1
36
  ## @visulima/pail [2.1.10](https://github.com/visulima/visulima/compare/@visulima/pail@2.1.9...@visulima/pail@2.1.10) (2024-10-05)
2
37
 
3
38
  ### Bug Fixes
package/LICENSE.md CHANGED
@@ -203,4 +203,126 @@ License: (MIT OR CC0-1.0)
203
203
  By: Sindre Sorhus
204
204
  Repository: sindresorhus/type-fest
205
205
 
206
+ > Creative Commons Legal Code
207
+ >
208
+ > CC0 1.0 Universal
209
+ >
210
+ > CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
211
+ > LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
212
+ > ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
213
+ > INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
214
+ > REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
215
+ > PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
216
+ > THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
217
+ > HEREUNDER.
218
+ >
219
+ > Statement of Purpose
220
+ >
221
+ > The laws of most jurisdictions throughout the world automatically confer
222
+ > exclusive Copyright and Related Rights (defined below) upon the creator
223
+ > and subsequent owner(s) (each and all, an "owner") of an original work of
224
+ > authorship and/or a database (each, a "Work").
225
+ >
226
+ > Certain owners wish to permanently relinquish those rights to a Work for
227
+ > the purpose of contributing to a commons of creative, cultural and
228
+ > scientific works ("Commons") that the public can reliably and without fear
229
+ > of later claims of infringement build upon, modify, incorporate in other
230
+ > works, reuse and redistribute as freely as possible in any form whatsoever
231
+ > and for any purposes, including without limitation commercial purposes.
232
+ > These owners may contribute to the Commons to promote the ideal of a free
233
+ > culture and the further production of creative, cultural and scientific
234
+ > works, or to gain reputation or greater distribution for their Work in
235
+ > part through the use and efforts of others.
236
+ >
237
+ > For these and/or other purposes and motivations, and without any
238
+ > expectation of additional consideration or compensation, the person
239
+ > associating CC0 with a Work (the "Affirmer"), to the extent that he or she
240
+ > is an owner of Copyright and Related Rights in the Work, voluntarily
241
+ > elects to apply CC0 to the Work and publicly distribute the Work under its
242
+ > terms, with knowledge of his or her Copyright and Related Rights in the
243
+ > Work and the meaning and intended legal effect of CC0 on those rights.
244
+ >
245
+ > 1. Copyright and Related Rights. A Work made available under CC0 may be
246
+ > protected by copyright and related or neighboring rights ("Copyright and
247
+ > Related Rights"). Copyright and Related Rights include, but are not
248
+ > limited to, the following:
249
+ >
250
+ > i. the right to reproduce, adapt, distribute, perform, display,
251
+ > communicate, and translate a Work;
252
+ > ii. moral rights retained by the original author(s) and/or performer(s);
253
+ > iii. publicity and privacy rights pertaining to a person's image or
254
+ > likeness depicted in a Work;
255
+ > iv. rights protecting against unfair competition in regards to a Work,
256
+ > subject to the limitations in paragraph 4(a), below;
257
+ > v. rights protecting the extraction, dissemination, use and reuse of data
258
+ > in a Work;
259
+ > vi. database rights (such as those arising under Directive 96/9/EC of the
260
+ > European Parliament and of the Council of 11 March 1996 on the legal
261
+ > protection of databases, and under any national implementation
262
+ > thereof, including any amended or successor version of such
263
+ > directive); and
264
+ > vii. other similar, equivalent or corresponding rights throughout the
265
+ > world based on applicable law or treaty, and any national
266
+ > implementations thereof.
267
+ >
268
+ > 2. Waiver. To the greatest extent permitted by, but not in contravention
269
+ > of, applicable law, Affirmer hereby overtly, fully, permanently,
270
+ > irrevocably and unconditionally waives, abandons, and surrenders all of
271
+ > Affirmer's Copyright and Related Rights and associated claims and causes
272
+ > of action, whether now known or unknown (including existing as well as
273
+ > future claims and causes of action), in the Work (i) in all territories
274
+ > worldwide, (ii) for the maximum duration provided by applicable law or
275
+ > treaty (including future time extensions), (iii) in any current or future
276
+ > medium and for any number of copies, and (iv) for any purpose whatsoever,
277
+ > including without limitation commercial, advertising or promotional
278
+ > purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
279
+ > member of the public at large and to the detriment of Affirmer's heirs and
280
+ > successors, fully intending that such Waiver shall not be subject to
281
+ > revocation, rescission, cancellation, termination, or any other legal or
282
+ > equitable action to disrupt the quiet enjoyment of the Work by the public
283
+ > as contemplated by Affirmer's express Statement of Purpose.
284
+ >
285
+ > 3. Public License Fallback. Should any part of the Waiver for any reason
286
+ > be judged legally invalid or ineffective under applicable law, then the
287
+ > Waiver shall be preserved to the maximum extent permitted taking into
288
+ > account Affirmer's express Statement of Purpose. In addition, to the
289
+ > extent the Waiver is so judged Affirmer hereby grants to each affected
290
+ > person a royalty-free, non transferable, non sublicensable, non exclusive,
291
+ > irrevocable and unconditional license to exercise Affirmer's Copyright and
292
+ > Related Rights in the Work (i) in all territories worldwide, (ii) for the
293
+ > maximum duration provided by applicable law or treaty (including future
294
+ > time extensions), (iii) in any current or future medium and for any number
295
+ > of copies, and (iv) for any purpose whatsoever, including without
296
+ > limitation commercial, advertising or promotional purposes (the
297
+ > "License"). The License shall be deemed effective as of the date CC0 was
298
+ > applied by Affirmer to the Work. Should any part of the License for any
299
+ > reason be judged legally invalid or ineffective under applicable law, such
300
+ > partial invalidity or ineffectiveness shall not invalidate the remainder
301
+ > of the License, and in such case Affirmer hereby affirms that he or she
302
+ > will not (i) exercise any of his or her remaining Copyright and Related
303
+ > Rights in the Work or (ii) assert any associated claims and causes of
304
+ > action with respect to the Work, in either case contrary to Affirmer's
305
+ > express Statement of Purpose.
306
+ >
307
+ > 4. Limitations and Disclaimers.
308
+ >
309
+ > a. No trademark or patent rights held by Affirmer are waived, abandoned,
310
+ > surrendered, licensed or otherwise affected by this document.
311
+ > b. Affirmer offers the Work as-is and makes no representations or
312
+ > warranties of any kind concerning the Work, express, implied,
313
+ > statutory or otherwise, including without limitation warranties of
314
+ > title, merchantability, fitness for a particular purpose, non
315
+ > infringement, or the absence of latent or other defects, accuracy, or
316
+ > the present or absence of errors, whether or not discoverable, all to
317
+ > the greatest extent permissible under applicable law.
318
+ > c. Affirmer disclaims responsibility for clearing rights of other persons
319
+ > that may apply to the Work or any use thereof, including without
320
+ > limitation any person's Copyright and Related Rights in the Work.
321
+ > Further, Affirmer disclaims responsibility for obtaining any necessary
322
+ > consents, permissions or other rights required for any use of the
323
+ > Work.
324
+ > d. Affirmer understands and acknowledges that Creative Commons is not a
325
+ > party to this document and has no duty or obligation with respect to
326
+ > this CC0 or use of the Work.
327
+
206
328
  <!-- /TYPE_DEPENDENCIES -->
package/README.md CHANGED
@@ -36,27 +36,27 @@
36
36
 
37
37
  ## Why Pail?
38
38
 
39
- - Easy to use
40
- - Hackable to the core
41
- - Integrated timers
42
- - Custom pluggable processors and reporters
43
- - TypeScript support
44
- - Interactive and regular modes
45
- - Secrets & sensitive information filtering
46
- - Filename, date and timestamp support
47
- - Scoped loggers and timers
48
- - Scaled logging levels mechanism
49
- - String interpolation support
50
- - Object and error interpolation
51
- - Stack trace and pretty errors
52
- - Simple and minimal syntax
53
- - Spam prevention by throttling logs
54
- - [Browser](./__assets__/header-browser.png) and [Server](./__assets__/header-server.png) support
55
- - Redirect console and stdout/stderr to pail and easily restore redirect.
56
- - `Pretty` or `JSON` output
57
- - CJS & ESM with tree shaking support
58
- - Supports circular structures
59
- - Fast and powerful, see the [benchmarks](__bench__/README.md)
39
+ - Easy to use
40
+ - Hackable to the core
41
+ - Integrated timers
42
+ - Custom pluggable processors and reporters
43
+ - TypeScript support
44
+ - Interactive and regular modes
45
+ - Secrets & sensitive information filtering
46
+ - Filename, date and timestamp support
47
+ - Scoped loggers and timers
48
+ - Scaled logging levels mechanism
49
+ - String interpolation support
50
+ - Object and error interpolation
51
+ - Stack trace and pretty errors
52
+ - Simple and minimal syntax
53
+ - Spam prevention by throttling logs
54
+ - [Browser](./__assets__/header-browser.png) and [Server](./__assets__/header-server.png) support
55
+ - Redirect console and stdout/stderr to pail and easily restore redirect.
56
+ - `Pretty` or `JSON` output
57
+ - CJS & ESM with tree shaking support
58
+ - Supports circular structures
59
+ - Fast and powerful, see the [benchmarks](__bench__/README.md)
60
60
 
61
61
  ## Install
62
62
 
@@ -81,23 +81,23 @@ pnpm add @visulima/pail
81
81
 
82
82
  Pail supports the logging levels described by [RFC 5424][rfc-5424].
83
83
 
84
- - `DEBUG`: Detailed debug information.
84
+ - `DEBUG`: Detailed debug information.
85
85
 
86
- - `INFO`: Interesting events. Examples: User logs in, SQL logs.
86
+ - `INFO`: Interesting events. Examples: User logs in, SQL logs.
87
87
 
88
- - `NOTICE`: Normal but significant events.
88
+ - `NOTICE`: Normal but significant events.
89
89
 
90
- - `TRACE`: Very detailed and fine-grained informational events.
90
+ - `TRACE`: Very detailed and fine-grained informational events.
91
91
 
92
- - `WARNING`: Exceptional occurrences that are not errors. Examples: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.
92
+ - `WARNING`: Exceptional occurrences that are not errors. Examples: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.
93
93
 
94
- - `ERROR`: Runtime errors that do not require immediate action but should typically be logged and monitored.
94
+ - `ERROR`: Runtime errors that do not require immediate action but should typically be logged and monitored.
95
95
 
96
- - `CRITICAL`: Critical conditions. Example: Application component unavailable, unexpected exception.
96
+ - `CRITICAL`: Critical conditions. Example: Application component unavailable, unexpected exception.
97
97
 
98
- - `ALERT`: Action must be taken immediately. Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.
98
+ - `ALERT`: Action must be taken immediately. Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.
99
99
 
100
- - `EMERGENCY`: Emergency: system is unusable.
100
+ - `EMERGENCY`: Emergency: system is unusable.
101
101
 
102
102
  ### Reporters
103
103
 
@@ -119,13 +119,13 @@ A processor can be added to a logger directly (and is subsequently applied to lo
119
119
 
120
120
  `pail` comes with a few built-in processors:
121
121
 
122
- - `CallerProcessor` - adds the caller information to the log message
123
- - The Meta Object is extended with a file name, line number and column number
124
- - `RedactProcessor` - redacts sensitive information from the log message
122
+ - `CallerProcessor` - adds the caller information to the log message
123
+ - The Meta Object is extended with a file name, line number and column number
124
+ - `RedactProcessor` - redacts sensitive information from the log message
125
125
  > The redact processor needs the "@visulima/redact" package to work.
126
126
  > Use `npm install @visulima/redact`, `pnpm add @visulima/redact` or `yarn add @visulima/redact` to install it.
127
- - `MessageFormatterProcessor` - formats the log message (Util.format-like unescaped string formatting utility) [@visulima/fmt][fmt]
128
- - `ErrorProcessor` - serializes the error with cause object to a std error object that can be serialized.
127
+ - `MessageFormatterProcessor` - formats the log message (Util.format-like unescaped string formatting utility) [@visulima/fmt][fmt]
128
+ - `ErrorProcessor` - serializes the error with cause object to a std error object that can be serialized.
129
129
 
130
130
  ## Usage
131
131
 
@@ -397,17 +397,17 @@ If you would like to help take a look at the [list of issues](https://github.com
397
397
 
398
398
  ## Credits
399
399
 
400
- - [Daniel Bannert](https://github.com/prisis)
401
- - [All Contributors](https://github.com/visulima/visulima/graphs/contributors)
400
+ - [Daniel Bannert](https://github.com/prisis)
401
+ - [All Contributors](https://github.com/visulima/visulima/graphs/contributors)
402
402
 
403
403
  ## About
404
404
 
405
405
  ### Related Projects
406
406
 
407
- - [pino](https://github.com/pinojs/pino) - 🌲 super fast, all natural json logger
408
- - [winston](https://github.com/winstonjs/winston) - A logger for just about everything.
409
- - [signale](https://github.com/klaudiosinani/signale) - Highly configurable logging utility
410
- - [consola](https://github.com/unjs/consola) - 🐨 Elegant Console Logger for Node.js and Browser
407
+ - [pino](https://github.com/pinojs/pino) - 🌲 super fast, all natural json logger
408
+ - [winston](https://github.com/winstonjs/winston) - A logger for just about everything.
409
+ - [signale](https://github.com/klaudiosinani/signale) - Highly configurable logging utility
410
+ - [consola](https://github.com/unjs/consola) - 🐨 Elegant Console Logger for Node.js and Browser
411
411
 
412
412
  ## License
413
413
 
@@ -1 +1 @@
1
- "use strict";var a=Object.defineProperty;var o=(e,r)=>a(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./packem_shared/pail.browser-BL-yRzuj.cjs"),i=require("./packem_shared/MessageFormatterProcessor-CCRIUIdT.cjs"),c=require("./packem_shared/JsonReporter-Be-Pmt7o.cjs");var n=Object.defineProperty,l=o((e,r)=>n(e,"name",{value:r,configurable:!0}),"e");const t=l(e=>new s.PailBrowser({processors:[new i],reporters:[new c],...e}),"createPail"),p=t();exports.createPail=t;exports.pail=p;
1
+ "use strict";var o=Object.defineProperty;var a=(e,r)=>o(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./packem_shared/pail.browser-tTEE0Aky.cjs"),s=require("./packem_shared/MessageFormatterProcessor-CCRIUIdT.cjs"),c=require("./packem_shared/JsonReporter-CjvkrXUp.cjs");var l=Object.defineProperty,n=a((e,r)=>l(e,"name",{value:r,configurable:!0}),"e");const t=n(e=>new i.P({processors:[new s],reporters:[new c],...e}),"createPail"),p=t();exports.createPail=t;exports.pail=p;
@@ -1,5 +1,5 @@
1
- "use strict";var P=Object.defineProperty;var n=(r,t)=>P(r,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("node:process"),w=require("./packem_shared/format-label-v7wmniOZ.cjs"),E=require("node:string_decoder"),I=require("./packem_shared/pail.browser-BL-yRzuj.cjs"),f=require("@visulima/inspector"),$=require("./packem_shared/constants-BBH2bwRB.cjs"),M=require("./packem_shared/write-stream-Bgxqp0HI.cjs"),j=require("./packem_shared/MessageFormatterProcessor-CCRIUIdT.cjs"),O=require("./packem_shared/PrettyReporter-TmVtQa5X.cjs");var R=Object.defineProperty,A=n((r,t)=>R(r,"name",{value:t,configurable:!0}),"l$1");let q=class{static{n(this,"v")}static{A(this,"InteractiveManager")}#t;#e=!1;#r=!1;#s=0;#i=0;constructor(t,e){this.#t={stderr:e,stdout:t}}get lastLength(){return this.#s}get outside(){return this.#i}get isHooked(){return this.#e}get isSuspended(){return this.#r}erase(t,e=this.#s){if(this.#t[t]===void 0)throw new TypeError(`Stream "${t}" is not available`);this.#t[t].erase(e)}hook(){return this.#e||(Object.values(this.#t).forEach(t=>t.active()),this._clear(!0)),this.#e}resume(t,e){this.#r&&(this.#r=!1,e&&this.erase(t,e),this.#s=0,Object.values(this.#t).forEach(s=>s.active()))}suspend(t,e=!0){this.#r||(this.#r=!0,e&&this.erase(t),Object.values(this.#t).forEach(s=>s.renew()))}unhook(t=!0){return this.#e&&(Object.values(this.#t).forEach(e=>e.inactive(t)),this._clear()),!this.#e}update(t,e,s=0){if(e.length>0){if(this.#t[t]===void 0)throw new TypeError(`Stream "${t}" is not available`);const a=this.#t[t],{columns:p,rows:i}=w.terminalSize(),u=s>i?i-1:Math.max(0,Math.min(i-1,s)),l=this.lastLength-u,d=Math.max(l-i,this.outside);let o=e.reduce((b,L)=>[...b,w.wrapAnsi(L,p,{hard:!0,trim:!1,wordWrap:!0})],[]);i<=l?(a.erase(i),u<d&&(o=o.slice(d-u+1))):l&&a.erase(l),a.write(o.join(`
1
+ "use strict";var E=Object.defineProperty;var n=(r,t)=>E(r,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("node:process"),f=require("./packem_shared/format-label-B0BaeOry.cjs"),$=require("node:string_decoder"),I=require("./packem_shared/pail.browser-tTEE0Aky.cjs"),g=require("@visulima/inspector"),P=require("./packem_shared/constants-BFrKdBPm.cjs"),j=require("./packem_shared/write-stream-Bgxqp0HI.cjs"),O=require("./packem_shared/MessageFormatterProcessor-CCRIUIdT.cjs"),M=require("./packem_shared/PrettyReporter-CldK9UpN.cjs");var R=Object.defineProperty,q=n((r,t)=>R(r,"name",{value:t,configurable:!0}),"l$1");let A=class{static{n(this,"v")}static{q(this,"InteractiveManager")}#t;#e=!1;#r=!1;#s=0;#i=0;constructor(t,e){this.#t={stderr:e,stdout:t}}get lastLength(){return this.#s}get outside(){return this.#i}get isHooked(){return this.#e}get isSuspended(){return this.#r}erase(t,e=this.#s){if(this.#t[t]===void 0)throw new TypeError(`Stream "${t}" is not available`);this.#t[t].erase(e)}hook(){return this.#e||(Object.values(this.#t).forEach(t=>t.active()),this._clear(!0)),this.#e}resume(t,e){this.#r&&(this.#r=!1,e&&this.erase(t,e),this.#s=0,Object.values(this.#t).forEach(s=>s.active()))}suspend(t,e=!0){this.#r||(this.#r=!0,e&&this.erase(t),Object.values(this.#t).forEach(s=>s.renew()))}unhook(t=!0){return this.#e&&(Object.values(this.#t).forEach(e=>e.inactive(t)),this._clear()),!this.#e}update(t,e,s=0){if(e.length>0){if(this.#t[t]===void 0)throw new TypeError(`Stream "${t}" is not available`);const a=this.#t[t],{columns:p,rows:i}=f.O(),u=s>i?i-1:Math.max(0,Math.min(i-1,s)),l=this.lastLength-u,d=Math.max(l-i,this.outside);let o=e.reduce((b,L)=>[...b,f.T(L,p,{hard:!0,trim:!1,wordWrap:!0})],[]);i<=l?(a.erase(i),u<d&&(o=o.slice(d-u+1))):l&&a.erase(l),a.write(o.join(`
2
2
  `)+`
3
- `),this.#s=d?d+o.length+1:o.length,this.#i=Math.max(this.lastLength-i,this.outside)}}_clear(t=!1){this.#e=t,this.#s=0,this.#i=0}};var T=Object.defineProperty,y=n((r,t)=>T(r,"name",{value:t,configurable:!0}),"n$1");const c="\x1B[",g=c+"2J",x=c+"2K",N=c+"G",D=y((r=1)=>c+r+"A","cursorUp"),m=process.platform==="win32"?`${g}${c}0f`:`${g}${c}3J${c}H`,B=c+"?25l",k=c+"?25h",G=y(r=>{let t="";for(let e=0;e<r;e++)t+=x+(e<r-1?D():"");return r&&(t+=N),t},"eraseLines");var H=Object.defineProperty,V=n((r,t)=>H(r,"name",{value:t,configurable:!0}),"s$1");class v{static{n(this,"t")}static{V(this,"InteractiveStreamHook")}static DRAIN=!0;#t=new E.StringDecoder;#e=[];#r;#s;constructor(t){this.#r=t.write,this.#s=t}active(){this.write(B),this.#s.write=(t,...e)=>{const s=e.at(-1);return this.#e.push(this.#t.write(typeof t=="string"?Buffer.from(t,typeof e[0]=="string"?e[0]:void 0):Buffer.from(t))),typeof s=="function"&&s(),v.DRAIN}}erase(t){t>0&&this.write(G(t+1))}inactive(t=!1){this.#e.length>0&&(t&&this.write(`
4
- `),this.#e.forEach(e=>{this.write(e)}),this.#e=[]),this.renew()}renew(){this.#s.write=this.#r,this.write(k)}write(t){this.#r.apply(this.#s,[t])}}var Y=Object.defineProperty,C=n((r,t)=>Y(r,"name",{value:t,configurable:!0}),"c");let J=class{static{n(this,"v")}static{C(this,"RawReporter")}#t;#e;#r;#s=!1;#i;constructor(t={}){this.#t=h.stdout,this.#e=h.stderr,this.#i=t}setStdout(t){this.#t=t}setStderr(t){this.#e=t}setInteractiveManager(t){this.#r=t}setIsInteractive(t){this.#s=t}log(t){const{context:e,groups:s,message:a,type:p}=t,i=[];if(a!==$.EMPTY_SYMBOL){const o=typeof a=="string"?a:f.inspect(a,this.#i);i.push(o)}e&&i.push(...e.map(o=>typeof o=="object"?" "+f.inspect(o,this.#i):" "+o));const u=["error","trace","warn"].includes(p.level)?"stderr":"stdout",l=u==="stderr"?this.#e:this.#t,d=s.map(()=>" ").join("");this.#s&&this.#r!==void 0&&l.isTTY?this.#r.update(u,(d+i.join("")).split(`
5
- `),0):M.n(d+i.join(""),l)}};var U=Object.defineProperty,z=n((r,t)=>U(r,"name",{value:t,configurable:!0}),"a$1");class F extends I.PailBrowserImpl{static{n(this,"v")}constructor(t){const{interactive:e,rawReporter:s,reporters:a,stderr:p,stdout:i,...u}=t;super(u),this.options=t,this.interactive=e??!1,this.stdout=i,this.stderr=p,this.interactive&&(this.interactiveManager=new q(new v(this.stdout),new v(this.stderr))),Array.isArray(a)&&this.registerReporters(a),this.rawReporter=this.extendReporter(t.rawReporter??new J)}static{z(this,"PailServerImpl")}stdout;stderr;interactiveManager;interactive;scope(...t){if(t.length===0)throw new Error("No scope name was defined.");return this.scopeName=t.flat(),this}getInteractiveManager(){return this.interactiveManager}wrapStd(){this._wrapStream(this.stdout,"log"),this._wrapStream(this.stderr,"log")}restoreStd(){this._restoreStream(this.stdout),this._restoreStream(this.stderr)}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}clear(){this.stdout.write(m),this.stderr.write(m)}extendReporter(t){return typeof t.setStdout=="function"&&t.setStdout(this.stdout),typeof t.setStderr=="function"&&t.setStderr(this.stderr),typeof t.setLoggerTypes=="function"&&t.setLoggerTypes(this.types),typeof t.setStringify=="function"&&t.setStringify(this.stringify),typeof t.setIsInteractive=="function"&&t.setIsInteractive(this.interactive),this.interactive&&typeof t.setInteractiveManager=="function"&&t.setInteractiveManager(this.interactiveManager),t}_wrapStream(t,e){t&&(t.__write||(t.__write=t.write),t.write=s=>{this[e].log(String(s).trim())})}_restoreStream(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}}const K=F;var W=Object.defineProperty,S=n((r,t)=>W(r,"name",{value:t,configurable:!0}),"o");const Q=S(()=>h.env.NODE_ENV==="debug"||h.env.DEBUG!==void 0?"debug":h.env.NODE_ENV==="test"?"warning":"informational","_getDefaultLogLevel"),_=S(r=>{let t=Q();return h.env.PAIL_LOG_LEVEL!==void 0&&(t=h.env.PAIL_LOG_LEVEL),new K({logLevel:t,processors:[new j],reporters:[new O.PrettyReporter],stderr:h.stderr,stdout:h.stdout,...r})},"createPail"),X=_();exports.createPail=_;exports.pail=X;
3
+ `),this.#s=d?d+o.length+1:o.length,this.#i=Math.max(this.lastLength-i,this.outside)}}_clear(t=!1){this.#e=t,this.#s=0,this.#i=0}};var T=Object.defineProperty,y=n((r,t)=>T(r,"name",{value:t,configurable:!0}),"n$1");const c="\x1B[",w=c+"2J",x=c+"2K",N=c+"G",D=y((r=1)=>c+r+"A","cursorUp"),m=process.platform==="win32"?`${w}${c}0f`:`${w}${c}3J${c}H`,k=c+"?25l",B=c+"?25h",G=y(r=>{let t="";for(let e=0;e<r;e++)t+=x+(e<r-1?D():"");return r&&(t+=N),t},"eraseLines");var H=Object.defineProperty,V=n((r,t)=>H(r,"name",{value:t,configurable:!0}),"s$1");class v{static{n(this,"t")}static{V(this,"InteractiveStreamHook")}static DRAIN=!0;#t=new $.StringDecoder;#e=[];#r;#s;constructor(t){this.#r=t.write,this.#s=t}active(){this.write(k),this.#s.write=(t,...e)=>{const s=e.at(-1);return this.#e.push(this.#t.write(typeof t=="string"?Buffer.from(t,typeof e[0]=="string"?e[0]:void 0):Buffer.from(t))),typeof s=="function"&&s(),v.DRAIN}}erase(t){t>0&&this.write(G(t+1))}inactive(t=!1){this.#e.length>0&&(t&&this.write(`
4
+ `),this.#e.forEach(e=>{this.write(e)}),this.#e=[]),this.renew()}renew(){this.#s.write=this.#r,this.write(B)}write(t){this.#r.apply(this.#s,[t])}}var C=Object.defineProperty,J=n((r,t)=>C(r,"name",{value:t,configurable:!0}),"c");let U=class{static{n(this,"v")}static{J(this,"RawReporter")}#t;#e;#r;#s=!1;#i;constructor(t={}){this.#t=h.stdout,this.#e=h.stderr,this.#i=t}setStdout(t){this.#t=t}setStderr(t){this.#e=t}setInteractiveManager(t){this.#r=t}setIsInteractive(t){this.#s=t}log(t){const{context:e,groups:s,message:a,type:p}=t,i=[];if(a!==P.E){const o=typeof a=="string"?a:g.inspect(a,this.#i);i.push(o)}e&&i.push(...e.map(o=>typeof o=="object"?" "+g.inspect(o,this.#i):" "+o));const u=["error","trace","warn"].includes(p.level)?"stderr":"stdout",l=u==="stderr"?this.#e:this.#t,d=s.map(()=>" ").join("");this.#s&&this.#r!==void 0&&l.isTTY?this.#r.update(u,(d+i.join("")).split(`
5
+ `),0):j.n(d+i.join(""),l)}};var F=Object.defineProperty,K=n((r,t)=>F(r,"name",{value:t,configurable:!0}),"a$1");class W extends I.a{static{n(this,"v")}constructor(t){const{interactive:e,rawReporter:s,reporters:a,stderr:p,stdout:i,...u}=t;super(u),this.options=t,this.interactive=e??!1,this.stdout=i,this.stderr=p,this.interactive&&(this.interactiveManager=new A(new v(this.stdout),new v(this.stderr))),Array.isArray(a)&&this.registerReporters(a),this.rawReporter=this.extendReporter(t.rawReporter??new U)}static{K(this,"PailServerImpl")}stdout;stderr;interactiveManager;interactive;scope(...t){if(t.length===0)throw new Error("No scope name was defined.");return this.scopeName=t.flat(),this}getInteractiveManager(){return this.interactiveManager}wrapStd(){this._wrapStream(this.stdout,"log"),this._wrapStream(this.stderr,"log")}restoreStd(){this._restoreStream(this.stdout),this._restoreStream(this.stderr)}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}clear(){this.stdout.write(m),this.stderr.write(m)}extendReporter(t){return typeof t.setStdout=="function"&&t.setStdout(this.stdout),typeof t.setStderr=="function"&&t.setStderr(this.stderr),typeof t.setLoggerTypes=="function"&&t.setLoggerTypes(this.types),typeof t.setStringify=="function"&&t.setStringify(this.stringify),typeof t.setIsInteractive=="function"&&t.setIsInteractive(this.interactive),this.interactive&&typeof t.setInteractiveManager=="function"&&t.setInteractiveManager(this.interactiveManager),t}_wrapStream(t,e){t&&(t.__write||(t.__write=t.write),t.write=s=>{this[e].log(String(s).trim())})}_restoreStream(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}}const Y=W;var z=Object.defineProperty,S=n((r,t)=>z(r,"name",{value:t,configurable:!0}),"o");const Q=S(()=>h.env.NODE_ENV==="debug"||h.env.DEBUG!==void 0?"debug":h.env.NODE_ENV==="test"?"warning":"informational","_getDefaultLogLevel"),_=S(r=>{let t=Q();return h.env.PAIL_LOG_LEVEL!==void 0&&(t=h.env.PAIL_LOG_LEVEL),new Y({logLevel:t,processors:[new O],reporters:[new M.PrettyReporter],stderr:h.stderr,stdout:h.stdout,...r})},"createPail"),X=_();exports.createPail=_;exports.pail=X;
@@ -1,5 +1,5 @@
1
- var L=Object.defineProperty;var n=(r,t)=>L(r,"name",{value:t,configurable:!0});import{stdout as m,stderr as y,env as d}from"node:process";import{t as I,w as $}from"./packem_shared/format-label-mKzVo7-U.mjs";import{StringDecoder as j}from"node:string_decoder";import{a as M}from"./packem_shared/pail.browser-D7k9K5zt.mjs";import{inspect as v}from"@visulima/inspector";import{E as O}from"./packem_shared/constants-BMS51p6Y.mjs";import{n as P}from"./packem_shared/write-stream-C17GXSxA.mjs";import R from"./packem_shared/MessageFormatterProcessor-D_XajTuK.mjs";import{PrettyReporter as A}from"./packem_shared/PrettyReporter-LK4KD_vd.mjs";var x=Object.defineProperty,N=n((r,t)=>x(r,"name",{value:t,configurable:!0}),"l$1");let T=class{static{n(this,"v")}static{N(this,"InteractiveManager")}#t;#e=!1;#r=!1;#s=0;#i=0;constructor(t,e){this.#t={stderr:e,stdout:t}}get lastLength(){return this.#s}get outside(){return this.#i}get isHooked(){return this.#e}get isSuspended(){return this.#r}erase(t,e=this.#s){if(this.#t[t]===void 0)throw new TypeError(`Stream "${t}" is not available`);this.#t[t].erase(e)}hook(){return this.#e||(Object.values(this.#t).forEach(t=>t.active()),this._clear(!0)),this.#e}resume(t,e){this.#r&&(this.#r=!1,e&&this.erase(t,e),this.#s=0,Object.values(this.#t).forEach(s=>s.active()))}suspend(t,e=!0){this.#r||(this.#r=!0,e&&this.erase(t),Object.values(this.#t).forEach(s=>s.renew()))}unhook(t=!0){return this.#e&&(Object.values(this.#t).forEach(e=>e.inactive(t)),this._clear()),!this.#e}update(t,e,s=0){if(e.length>0){if(this.#t[t]===void 0)throw new TypeError(`Stream "${t}" is not available`);const a=this.#t[t],{columns:u,rows:i}=I(),c=s>i?i-1:Math.max(0,Math.min(i-1,s)),l=this.lastLength-c,p=Math.max(l-i,this.outside);let o=e.reduce((b,E)=>[...b,$(E,u,{hard:!0,trim:!1,wordWrap:!0})],[]);i<=l?(a.erase(i),c<p&&(o=o.slice(p-c+1))):l&&a.erase(l),a.write(o.join(`
1
+ var L=Object.defineProperty;var n=(r,t)=>L(r,"name",{value:t,configurable:!0});import{stdout as m,stderr as y,env as d}from"node:process";import{O as I,T as $}from"./packem_shared/format-label-ECls2QEw.mjs";import{StringDecoder as O}from"node:string_decoder";import{a as j}from"./packem_shared/pail.browser-D7k9K5zt.mjs";import{inspect as v}from"@visulima/inspector";import{E as M}from"./packem_shared/constants-BMS51p6Y.mjs";import{n as P}from"./packem_shared/write-stream-C17GXSxA.mjs";import R from"./packem_shared/MessageFormatterProcessor-D_XajTuK.mjs";import{PrettyReporter as x}from"./packem_shared/PrettyReporter-1SleqVaI.mjs";var A=Object.defineProperty,T=n((r,t)=>A(r,"name",{value:t,configurable:!0}),"l$1");let N=class{static{n(this,"v")}static{T(this,"InteractiveManager")}#t;#e=!1;#r=!1;#s=0;#i=0;constructor(t,e){this.#t={stderr:e,stdout:t}}get lastLength(){return this.#s}get outside(){return this.#i}get isHooked(){return this.#e}get isSuspended(){return this.#r}erase(t,e=this.#s){if(this.#t[t]===void 0)throw new TypeError(`Stream "${t}" is not available`);this.#t[t].erase(e)}hook(){return this.#e||(Object.values(this.#t).forEach(t=>t.active()),this._clear(!0)),this.#e}resume(t,e){this.#r&&(this.#r=!1,e&&this.erase(t,e),this.#s=0,Object.values(this.#t).forEach(s=>s.active()))}suspend(t,e=!0){this.#r||(this.#r=!0,e&&this.erase(t),Object.values(this.#t).forEach(s=>s.renew()))}unhook(t=!0){return this.#e&&(Object.values(this.#t).forEach(e=>e.inactive(t)),this._clear()),!this.#e}update(t,e,s=0){if(e.length>0){if(this.#t[t]===void 0)throw new TypeError(`Stream "${t}" is not available`);const a=this.#t[t],{columns:p,rows:i}=I(),c=s>i?i-1:Math.max(0,Math.min(i-1,s)),l=this.lastLength-c,u=Math.max(l-i,this.outside);let o=e.reduce((b,E)=>[...b,$(E,p,{hard:!0,trim:!1,wordWrap:!0})],[]);i<=l?(a.erase(i),c<u&&(o=o.slice(u-c+1))):l&&a.erase(l),a.write(o.join(`
2
2
  `)+`
3
- `),this.#s=p?p+o.length+1:o.length,this.#i=Math.max(this.lastLength-i,this.outside)}}_clear(t=!1){this.#e=t,this.#s=0,this.#i=0}};var D=Object.defineProperty,S=n((r,t)=>D(r,"name",{value:t,configurable:!0}),"n$1");const h="\x1B[",w=h+"2J",B=h+"2K",k=h+"G",G=S((r=1)=>h+r+"A","cursorUp"),g=process.platform==="win32"?`${w}${h}0f`:`${w}${h}3J${h}H`,H=h+"?25l",V=h+"?25h",Y=S(r=>{let t="";for(let e=0;e<r;e++)t+=B+(e<r-1?G():"");return r&&(t+=k),t},"eraseLines");var C=Object.defineProperty,J=n((r,t)=>C(r,"name",{value:t,configurable:!0}),"s$1");class f{static{n(this,"t")}static{J(this,"InteractiveStreamHook")}static DRAIN=!0;#t=new j;#e=[];#r;#s;constructor(t){this.#r=t.write,this.#s=t}active(){this.write(H),this.#s.write=(t,...e)=>{const s=e.at(-1);return this.#e.push(this.#t.write(typeof t=="string"?Buffer.from(t,typeof e[0]=="string"?e[0]:void 0):Buffer.from(t))),typeof s=="function"&&s(),f.DRAIN}}erase(t){t>0&&this.write(Y(t+1))}inactive(t=!1){this.#e.length>0&&(t&&this.write(`
4
- `),this.#e.forEach(e=>{this.write(e)}),this.#e=[]),this.renew()}renew(){this.#s.write=this.#r,this.write(V)}write(t){this.#r.apply(this.#s,[t])}}var U=Object.defineProperty,z=n((r,t)=>U(r,"name",{value:t,configurable:!0}),"c");let K=class{static{n(this,"v")}static{z(this,"RawReporter")}#t;#e;#r;#s=!1;#i;constructor(t={}){this.#t=m,this.#e=y,this.#i=t}setStdout(t){this.#t=t}setStderr(t){this.#e=t}setInteractiveManager(t){this.#r=t}setIsInteractive(t){this.#s=t}log(t){const{context:e,groups:s,message:a,type:u}=t,i=[];if(a!==O){const o=typeof a=="string"?a:v(a,this.#i);i.push(o)}e&&i.push(...e.map(o=>typeof o=="object"?" "+v(o,this.#i):" "+o));const c=["error","trace","warn"].includes(u.level)?"stderr":"stdout",l=c==="stderr"?this.#e:this.#t,p=s.map(()=>" ").join("");this.#s&&this.#r!==void 0&&l.isTTY?this.#r.update(c,(p+i.join("")).split(`
5
- `),0):P(p+i.join(""),l)}};var W=Object.defineProperty,q=n((r,t)=>W(r,"name",{value:t,configurable:!0}),"a$1");class F extends M{static{n(this,"v")}constructor(t){const{interactive:e,rawReporter:s,reporters:a,stderr:u,stdout:i,...c}=t;super(c),this.options=t,this.interactive=e??!1,this.stdout=i,this.stderr=u,this.interactive&&(this.interactiveManager=new T(new f(this.stdout),new f(this.stderr))),Array.isArray(a)&&this.registerReporters(a),this.rawReporter=this.extendReporter(t.rawReporter??new K)}static{q(this,"PailServerImpl")}stdout;stderr;interactiveManager;interactive;scope(...t){if(t.length===0)throw new Error("No scope name was defined.");return this.scopeName=t.flat(),this}getInteractiveManager(){return this.interactiveManager}wrapStd(){this._wrapStream(this.stdout,"log"),this._wrapStream(this.stderr,"log")}restoreStd(){this._restoreStream(this.stdout),this._restoreStream(this.stderr)}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}clear(){this.stdout.write(g),this.stderr.write(g)}extendReporter(t){return typeof t.setStdout=="function"&&t.setStdout(this.stdout),typeof t.setStderr=="function"&&t.setStderr(this.stderr),typeof t.setLoggerTypes=="function"&&t.setLoggerTypes(this.types),typeof t.setStringify=="function"&&t.setStringify(this.stringify),typeof t.setIsInteractive=="function"&&t.setIsInteractive(this.interactive),this.interactive&&typeof t.setInteractiveManager=="function"&&t.setInteractiveManager(this.interactiveManager),t}_wrapStream(t,e){t&&(t.__write||(t.__write=t.write),t.write=s=>{this[e].log(String(s).trim())})}_restoreStream(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}}const Q=F;var X=Object.defineProperty,_=n((r,t)=>X(r,"name",{value:t,configurable:!0}),"o");const Z=_(()=>d.NODE_ENV==="debug"||d.DEBUG!==void 0?"debug":d.NODE_ENV==="test"?"warning":"informational","_getDefaultLogLevel"),tt=_(r=>{let t=Z();return d.PAIL_LOG_LEVEL!==void 0&&(t=d.PAIL_LOG_LEVEL),new Q({logLevel:t,processors:[new R],reporters:[new A],stderr:y,stdout:m,...r})},"createPail"),dt=tt();export{tt as createPail,dt as pail};
3
+ `),this.#s=u?u+o.length+1:o.length,this.#i=Math.max(this.lastLength-i,this.outside)}}_clear(t=!1){this.#e=t,this.#s=0,this.#i=0}};var D=Object.defineProperty,S=n((r,t)=>D(r,"name",{value:t,configurable:!0}),"n$1");const h="\x1B[",w=h+"2J",B=h+"2K",k=h+"G",G=S((r=1)=>h+r+"A","cursorUp"),g=process.platform==="win32"?`${w}${h}0f`:`${w}${h}3J${h}H`,H=h+"?25l",V=h+"?25h",Y=S(r=>{let t="";for(let e=0;e<r;e++)t+=B+(e<r-1?G():"");return r&&(t+=k),t},"eraseLines");var C=Object.defineProperty,J=n((r,t)=>C(r,"name",{value:t,configurable:!0}),"s$1");class f{static{n(this,"t")}static{J(this,"InteractiveStreamHook")}static DRAIN=!0;#t=new O;#e=[];#r;#s;constructor(t){this.#r=t.write,this.#s=t}active(){this.write(H),this.#s.write=(t,...e)=>{const s=e.at(-1);return this.#e.push(this.#t.write(typeof t=="string"?Buffer.from(t,typeof e[0]=="string"?e[0]:void 0):Buffer.from(t))),typeof s=="function"&&s(),f.DRAIN}}erase(t){t>0&&this.write(Y(t+1))}inactive(t=!1){this.#e.length>0&&(t&&this.write(`
4
+ `),this.#e.forEach(e=>{this.write(e)}),this.#e=[]),this.renew()}renew(){this.#s.write=this.#r,this.write(V)}write(t){this.#r.apply(this.#s,[t])}}var U=Object.defineProperty,K=n((r,t)=>U(r,"name",{value:t,configurable:!0}),"c");let W=class{static{n(this,"v")}static{K(this,"RawReporter")}#t;#e;#r;#s=!1;#i;constructor(t={}){this.#t=m,this.#e=y,this.#i=t}setStdout(t){this.#t=t}setStderr(t){this.#e=t}setInteractiveManager(t){this.#r=t}setIsInteractive(t){this.#s=t}log(t){const{context:e,groups:s,message:a,type:p}=t,i=[];if(a!==M){const o=typeof a=="string"?a:v(a,this.#i);i.push(o)}e&&i.push(...e.map(o=>typeof o=="object"?" "+v(o,this.#i):" "+o));const c=["error","trace","warn"].includes(p.level)?"stderr":"stdout",l=c==="stderr"?this.#e:this.#t,u=s.map(()=>" ").join("");this.#s&&this.#r!==void 0&&l.isTTY?this.#r.update(c,(u+i.join("")).split(`
5
+ `),0):P(u+i.join(""),l)}};var q=Object.defineProperty,z=n((r,t)=>q(r,"name",{value:t,configurable:!0}),"a$1");class F extends j{static{n(this,"v")}constructor(t){const{interactive:e,rawReporter:s,reporters:a,stderr:p,stdout:i,...c}=t;super(c),this.options=t,this.interactive=e??!1,this.stdout=i,this.stderr=p,this.interactive&&(this.interactiveManager=new N(new f(this.stdout),new f(this.stderr))),Array.isArray(a)&&this.registerReporters(a),this.rawReporter=this.extendReporter(t.rawReporter??new W)}static{z(this,"PailServerImpl")}stdout;stderr;interactiveManager;interactive;scope(...t){if(t.length===0)throw new Error("No scope name was defined.");return this.scopeName=t.flat(),this}getInteractiveManager(){return this.interactiveManager}wrapStd(){this._wrapStream(this.stdout,"log"),this._wrapStream(this.stderr,"log")}restoreStd(){this._restoreStream(this.stdout),this._restoreStream(this.stderr)}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}clear(){this.stdout.write(g),this.stderr.write(g)}extendReporter(t){return typeof t.setStdout=="function"&&t.setStdout(this.stdout),typeof t.setStderr=="function"&&t.setStderr(this.stderr),typeof t.setLoggerTypes=="function"&&t.setLoggerTypes(this.types),typeof t.setStringify=="function"&&t.setStringify(this.stringify),typeof t.setIsInteractive=="function"&&t.setIsInteractive(this.interactive),this.interactive&&typeof t.setInteractiveManager=="function"&&t.setInteractiveManager(this.interactiveManager),t}_wrapStream(t,e){t&&(t.__write||(t.__write=t.write),t.write=s=>{this[e].log(String(s).trim())})}_restoreStream(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}}const Q=F;var X=Object.defineProperty,_=n((r,t)=>X(r,"name",{value:t,configurable:!0}),"o");const Z=_(()=>d.NODE_ENV==="debug"||d.DEBUG!==void 0?"debug":d.NODE_ENV==="test"?"warning":"informational","_getDefaultLogLevel"),tt=_(r=>{let t=Z();return d.PAIL_LOG_LEVEL!==void 0&&(t=d.PAIL_LOG_LEVEL),new Q({logLevel:t,processors:[new R],reporters:[new x],stderr:y,stdout:m,...r})},"createPail"),dt=tt();export{tt as createPail,dt as pail};
@@ -0,0 +1 @@
1
+ var t=Object.defineProperty;var n=(a,e)=>t(a,"name",{value:e,configurable:!0});var u=Object.defineProperty,c=n((a,e)=>u(a,"name",{value:e,configurable:!0}),"u");const o=c(()=>{const a=Error.prepareStackTrace;try{let e=[];Error.prepareStackTrace=(i,r)=>{const m=r.slice(1);return e=m,m};const l=e.reduce((i,r)=>(r.isNative()||r.getFileName()?.includes("pail/dist")||i.push({columnNumber:r.getColumnNumber(),fileName:r.getFileName(),lineNumber:r.getLineNumber()}),i),[])[0];return l?{columnNumber:l.columnNumber??void 0,fileName:l.fileName,lineNumber:l.lineNumber??void 0}:{fileName:"anonymous",lineNumber:void 0}}finally{Error.prepareStackTrace=a}},"getCallerFilename");var s=Object.defineProperty,N=n((a,e)=>s(a,"name",{value:e,configurable:!0}),"r");class f{static{n(this,"a")}static{N(this,"CallerProcessor")}process(e){const{columnNumber:l,fileName:i,lineNumber:r}=o();return e.file={column:l,line:r,name:i},e}}export{f as default};
@@ -0,0 +1 @@
1
+ "use strict";var t=Object.defineProperty;var n=(a,e)=>t(a,"name",{value:e,configurable:!0});var u=Object.defineProperty,c=n((a,e)=>u(a,"name",{value:e,configurable:!0}),"u");const o=c(()=>{const a=Error.prepareStackTrace;try{let e=[];Error.prepareStackTrace=(i,r)=>{const m=r.slice(1);return e=m,m};const l=e.reduce((i,r)=>(r.isNative()||r.getFileName()?.includes("pail/dist")||i.push({columnNumber:r.getColumnNumber(),fileName:r.getFileName(),lineNumber:r.getLineNumber()}),i),[])[0];return l?{columnNumber:l.columnNumber??void 0,fileName:l.fileName,lineNumber:l.lineNumber??void 0}:{fileName:"anonymous",lineNumber:void 0}}finally{Error.prepareStackTrace=a}},"getCallerFilename");var s=Object.defineProperty,N=n((a,e)=>s(a,"name",{value:e,configurable:!0}),"r");class b{static{n(this,"a")}static{N(this,"CallerProcessor")}process(e){const{columnNumber:l,fileName:i,lineNumber:r}=o();return e.file={column:l,line:r,name:i},e}}module.exports=b;
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var s=(e,t)=>n(e,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./abstract-json-reporter-CjTo97r_.cjs");var h=Object.defineProperty,c=s((e,t)=>h(e,"name",{value:t,configurable:!0}),"e");class l{static{s(this,"n")}static{c(this,"SafeStreamHandler")}#t=!0;#e;#i;constructor(t,i){this.#e=t,this.#i=i}write(t){this.writeStream(t)}end(...t){this.#e.end(...t)}get isReady(){return this.#t}writeStream(t){if(!this.#t){console.warn("Stream busy: "+this.#i+'. Write will be dropped: "'+t+'"');return}this.#t=!1,this.#e.on("error",i=>{throw i}),this.#e.on("drain",()=>{this.#t=!0}),this.#e.on("finish",()=>{this.#t=!0}),this.#t=this.#e.write(t,()=>{})}}var d=Object.defineProperty,m=s((e,t)=>d(e,"name",{value:t,configurable:!0}),"r$1");class u{static{s(this,"o")}static{m(this,"RotatingFileStream")}#t;#e;#i;#s;#r;constructor(t,i=!1,r={}){if(this.#t=t,this.#e=i,this.#s=r,!this.#e){try{this.#r=require("rotating-file-stream").createStream}catch{throw new Error("The 'rotating-file-stream' package is missing. Make sure to install the 'rotating-file-stream' package.")}this.#i=this.#r(this.#t,r)}}write(t){let i=this.#i;this.#e&&(i=this.#r(this.#t,this.#s));const r=new l(i,this.#t);r.write(t),this.#e&&r.end()}end(){this.#i!==void 0&&this.#i.end()}}var p=Object.defineProperty,w=s((e,t)=>p(e,"name",{value:t,configurable:!0}),"r");class f extends o.AbstractJsonReporter{static{s(this,"JsonFileReporter")}static{w(this,"JsonFileReporter")}stream;constructor(t){super();const{filePath:i,writeImmediately:r=!1,...a}=t;this.stream=new u(i,r,{compress:"gzip",interval:"1d",size:"10M",...a})}_log(t){this.stream.write(t+`
1
+ "use strict";var n=Object.defineProperty;var s=(e,t)=>n(e,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./abstract-json-reporter-Z6bVrpPK.cjs");var h=Object.defineProperty,c=s((e,t)=>h(e,"name",{value:t,configurable:!0}),"e");class l{static{s(this,"n")}static{c(this,"SafeStreamHandler")}#t=!0;#e;#i;constructor(t,i){this.#e=t,this.#i=i}write(t){this.writeStream(t)}end(...t){this.#e.end(...t)}get isReady(){return this.#t}writeStream(t){if(!this.#t){console.warn("Stream busy: "+this.#i+'. Write will be dropped: "'+t+'"');return}this.#t=!1,this.#e.on("error",i=>{throw i}),this.#e.on("drain",()=>{this.#t=!0}),this.#e.on("finish",()=>{this.#t=!0}),this.#t=this.#e.write(t,()=>{})}}var d=Object.defineProperty,m=s((e,t)=>d(e,"name",{value:t,configurable:!0}),"r$1");class u{static{s(this,"o")}static{m(this,"RotatingFileStream")}#t;#e;#i;#s;#r;constructor(t,i=!1,r={}){if(this.#t=t,this.#e=i,this.#s=r,!this.#e){try{this.#r=require("rotating-file-stream").createStream}catch{throw new Error("The 'rotating-file-stream' package is missing. Make sure to install the 'rotating-file-stream' package.")}this.#i=this.#r(this.#t,r)}}write(t){let i=this.#i;this.#e&&(i=this.#r(this.#t,this.#s));const r=new l(i,this.#t);r.write(t),this.#e&&r.end()}end(){this.#i!==void 0&&this.#i.end()}}var p=Object.defineProperty,w=s((e,t)=>p(e,"name",{value:t,configurable:!0}),"r");class f extends o.A{static{s(this,"JsonFileReporter")}static{w(this,"JsonFileReporter")}stream;constructor(t){super();const{filePath:i,writeImmediately:r=!1,...a}=t;this.stream=new u(i,r,{compress:"gzip",interval:"1d",size:"10M",...a})}_log(t){this.stream.write(t+`
2
2
  `)}}exports.JsonFileReporter=f;
@@ -0,0 +1,2 @@
1
+ "use strict";var n=Object.defineProperty;var e=(r,t)=>n(r,"name",{value:t,configurable:!0});const s=require("node:process"),a=require("./write-stream-Bgxqp0HI.cjs"),c=require("./abstract-json-reporter-Z6bVrpPK.cjs");var u=Object.defineProperty,d=e((r,t)=>u(r,"name",{value:t,configurable:!0}),"e");class h extends c.A{static{e(this,"d")}static{d(this,"JsonReporter")}#t;#r;constructor(t={}){super(t),this.#t=s.stdout,this.#r=s.stderr}setStdout(t){this.#t=t}setStderr(t){this.#r=t}_log(t,i){const o=["error","warn"].includes(i)?this.#r:this.#t;a.n(t+`
2
+ `,o)}}module.exports=h;
@@ -0,0 +1 @@
1
+ "use strict";var o=Object.defineProperty;var t=(r,e)=>o(r,"name",{value:e,configurable:!0});const a=require("./write-console-log-3G15muTS.cjs"),c=require("./abstract-json-reporter-Z6bVrpPK.cjs");var n=Object.defineProperty,i=t((r,e)=>n(r,"name",{value:e,configurable:!0}),"e");class u extends c.A{static{t(this,"p")}static{i(this,"JsonReporter")}constructor(e={}){super(e)}_log(e,s){a.t(s)(e)}}module.exports=u;
@@ -0,0 +1,13 @@
1
+ var R=Object.defineProperty;var x=(a,e)=>R(a,"name",{value:e,configurable:!0});import{stdout as B,stderr as F}from"node:process";import V,{green as Y,cyan as D,red as E,greenBright as G,grey as s,bgGrey as W,underline as k,white as q}from"@visulima/colorize";import{renderError as b}from"@visulima/error/error";import{inspect as L}from"@visulima/inspector";import{u as z,O as H,n as J,m as w,T as K}from"./format-label-ECls2QEw.mjs";import{E as N}from"./constants-BMS51p6Y.mjs";import{A as Q,s as U}from"./abstract-pretty-reporter-DgXRHEj-.mjs";import{s as X}from"./get-longest-label-4ISUsE2q.mjs";import{n as Z}from"./write-stream-C17GXSxA.mjs";var ee=Object.defineProperty,O=x((a,e)=>ee(a,"name",{value:e,configurable:!0}),"S");const T=O(a=>!/[\\/]pail[\\/]dist/.test(a),"pailFileFilter");class ue extends Q{static{x(this,"PrettyReporter")}static{O(this,"PrettyReporter")}#t;#r;#s;#o=!1;#i;#e;constructor(e={}){const{error:n,inspect:i,...o}=e;super({uppercase:{label:!0,...o.uppercase},...o}),this.#i={...z,...i},this.#e={...n,color:{fileLine:Y,hint:D,marker:E,message:E,method:G,title:E}},this.#t=B,this.#r=F}setStdout(e){this.#t=e}setStderr(e){this.#r=e}setInteractiveManager(e){this.#s=e}setIsInteractive(e){this.#o=e}log(e){this._log(this._formatMessage(e),e.type.level)}_formatMessage(e){const{columns:n}=H();let i=n;typeof this._styles.messageLength=="number"&&(i=this._styles.messageLength);const{badge:o,context:j,date:u,error:v,file:c,groups:g,label:m,message:f,prefix:d,repeated:A,scope:l,suffix:y,traceError:M,type:C}=e,{color:S}=this._loggerTypes[C.name],P=S?V[S]:q,h=g.map(()=>" ").join(""),t=[];if(g.length>0&&t.push(h+s("["+g.at(-1)+"]")+" "),u&&t.push(s(this._styles.dateFormatter(typeof u=="string"?new Date(u):u))+" "),o)t.push(P(o));else{const r=U(this._loggerTypes);r.length>0&&t.push(s(".".repeat(r.length))+" ")}const $=X(this._loggerTypes);m?t.push(P(J(m,this._styles))+" ",s(".".repeat($.length-w(m)))):t.push(s(".".repeat($.length+2))),A&&t.push(W.white("["+A+"x]")+" "),Array.isArray(l)&&l.length>0&&t.push(" "+s("["+l.join(" > ")+"]")+" "),d&&t.push(s((Array.isArray(l)&&l.length>0?". ":" ")+"["+(this._styles.underline.prefix?k(d):d)+"]")+" ");const _=w(t.join(" "));if(c){const r=c.name+(c.line?":"+c.line:""),p=w(r);p+_+2>i?t.push(s(" "+r)):t.push(s(".".repeat(i-_-p-2)+" "+r))}else t.push(s(".".repeat(i-_-1)));if(t.length>0&&t.push(`
2
+
3
+ `),f!==N){const r=typeof f=="string"?f:L(f,this.#i);t.push(h+K(r,i-3,{hard:!0,trim:!1,wordWrap:!0}))}if(j){let r=!1;t.push(...j.map(p=>{if(p instanceof Error)return r=!0,`
4
+
5
+ `+b(p,{...this.#e,filterStacktrace:T,prefix:h});if(typeof p=="object")return" "+L(p,this.#i);const I=(r?`
6
+
7
+ `:" ")+p;return r=!1,I}))}return v&&t.push(b(v,{...this.#e,filterStacktrace:T,prefix:h})),M&&t.push(`
8
+
9
+ `+b(M,{...this.#e,filterStacktrace:T,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:h})),y&&t.push(`
10
+ `,h+s(this._styles.underline.suffix?k(y):y)),t.join("")+`
11
+ `}_log(e,n){const i=["error","trace","warn"].includes(n)?"stderr":"stdout",o=i==="stderr"?this.#r:this.#t;this.#o&&this.#s!==void 0&&o.isTTY?this.#s.update(i,e.split(`
12
+ `),0):Z(e+`
13
+ `,o)}}export{ue as PrettyReporter};
@@ -1,4 +1,4 @@
1
- var S=Object.defineProperty;var b=(h,i)=>S(h,"name",{value:i,configurable:!0});import Y,{white as M,grey as o,underline as _,bold as $}from"@visulima/colorize/browser";import{format as r}from"@visulima/fmt";import{E}from"./constants-BMS51p6Y.mjs";import{A as O,s as k}from"./abstract-pretty-reporter-DgXRHEj-.mjs";import{s as B}from"./get-longest-label-4ISUsE2q.mjs";import{t as C}from"./write-console-log-BP95fgQZ.mjs";var D=Object.defineProperty,F=b((h,i)=>D(h,"name",{value:i,configurable:!0}),"A");class K extends O{static{b(this,"Y")}static{F(this,"PrettyReporter")}constructor(i={}){super({uppercase:{label:!0,...i.uppercase},...i})}log(i){const t=typeof window<"u"&&typeof window.document<"u",x=C(i.type.level),{badge:A,context:w,date:a,error:v,groups:f,label:g,message:P,prefix:y,repeated:u,scope:n,suffix:m,type:R}=i,{color:T}=this._loggerTypes[R.name],L=T?Y[T]:M,e=[];if(t&&f.length>0){const s=f.map(()=>" ").join(""),l=o("["+f.at(-1)+"]");e.push(r(s+l[0],l.slice(1)))}if(a){const s=o(this._styles.dateFormatter(typeof a=="string"?new Date(a):a));t?e.push(r(s[0],s.slice(1))):e.push([s[0]+" ",...s.slice(1)])}if(A){const s=L(A);t?e.push(r(s[0],s.slice(1))):e.push([s[0]+" ",...s.slice(1)])}else{const s=k(this._loggerTypes);if(s.length>0){const l=o(".".repeat(s.length));t?e.push(r(l[0]+" ",l.slice(1))):e.push([l[0]+" ",...l.slice(1)])}}const j=B(this._loggerTypes);let d;if(u){const s=M("["+u+"x]");d=t?r(s[0],s.slice(1)):[s[0],...s.slice(1)]}if(g){const s=L(this._formatLabel(g));t?e.push(r(s[0],s.slice(1))):e.push([s[0],...s.slice(1)]),d&&e.push(d);let l=j.length-g.length;if(u?l-=String(u).length+3:l+=1,l>0){const p=o(".".repeat(l));t?e.push(r(p[0],p.slice(1))):e.push([" "+p[0],...p.slice(1)])}}else{const s=o(".".repeat(j.length+1));t?e.push(r(s[0],s.slice(1))):e.push([s[0],...s.slice(1)])}if(Array.isArray(n)&&n.length>0){const s=o("["+n.join(" > ")+"]");t?e.push(r(s[0],s.slice(1))):e.push([s[0],...s.slice(1)])}if(y){const s=o((Array.isArray(n)&&n.length>0?". ":" ")+"["+(this._styles.underline.prefix?_(y):y)+"] ");t?e.push(r(s[0],s.slice(1))):e.push([s[0],...s.slice(1)])}if(P!==E&&e.push(P),w&&e.push(...w),v&&e.push(v,`
1
+ var S=Object.defineProperty;var b=(h,i)=>S(h,"name",{value:i,configurable:!0});import Y,{grey as o,white as M,underline as _,bold as $}from"@visulima/colorize/browser";import{format as r}from"@visulima/fmt";import{E}from"./constants-BMS51p6Y.mjs";import{A as O,s as k}from"./abstract-pretty-reporter-DgXRHEj-.mjs";import{s as B}from"./get-longest-label-4ISUsE2q.mjs";import{t as C}from"./write-console-log-BP95fgQZ.mjs";var D=Object.defineProperty,F=b((h,i)=>D(h,"name",{value:i,configurable:!0}),"A");class K extends O{static{b(this,"Y")}static{F(this,"PrettyReporter")}constructor(i={}){super({uppercase:{label:!0,...i.uppercase},...i})}log(i){const t=typeof window<"u"&&typeof window.document<"u",x=C(i.type.level),{badge:A,context:w,date:a,error:v,groups:f,label:g,message:P,prefix:y,repeated:u,scope:n,suffix:m,type:R}=i,{color:T}=this._loggerTypes[R.name],L=T?Y[T]:M,e=[];if(t&&f.length>0){const s=f.map(()=>" ").join(""),l=o("["+f.at(-1)+"]");e.push(r(s+l[0],l.slice(1)))}if(a){const s=o(this._styles.dateFormatter(typeof a=="string"?new Date(a):a));t?e.push(r(s[0],s.slice(1))):e.push([s[0]+" ",...s.slice(1)])}if(A){const s=L(A);t?e.push(r(s[0],s.slice(1))):e.push([s[0]+" ",...s.slice(1)])}else{const s=k(this._loggerTypes);if(s.length>0){const l=o(".".repeat(s.length));t?e.push(r(l[0]+" ",l.slice(1))):e.push([l[0]+" ",...l.slice(1)])}}const j=B(this._loggerTypes);let d;if(u){const s=M("["+u+"x]");d=t?r(s[0],s.slice(1)):[s[0],...s.slice(1)]}if(g){const s=L(this._formatLabel(g));t?e.push(r(s[0],s.slice(1))):e.push([s[0],...s.slice(1)]),d&&e.push(d);let l=j.length-g.length;if(u?l-=String(u).length+3:l+=1,l>0){const p=o(".".repeat(l));t?e.push(r(p[0],p.slice(1))):e.push([" "+p[0],...p.slice(1)])}}else{const s=o(".".repeat(j.length+1));t?e.push(r(s[0],s.slice(1))):e.push([s[0],...s.slice(1)])}if(Array.isArray(n)&&n.length>0){const s=o("["+n.join(" > ")+"]");t?e.push(r(s[0],s.slice(1))):e.push([s[0],...s.slice(1)])}if(y){const s=o((Array.isArray(n)&&n.length>0?". ":" ")+"["+(this._styles.underline.prefix?_(y):y)+"] ");t?e.push(r(s[0],s.slice(1))):e.push([s[0],...s.slice(1)])}if(P!==E&&e.push(P),w&&e.push(...w),v&&e.push(v,`
2
2
 
3
3
  `),m){const s=o(this._styles.underline.suffix?_(m):m);t?e.push(r(`
4
4
  `+s[0],s.slice(1))):e.push([`
@@ -0,0 +1,13 @@
1
+ "use strict";var O=Object.defineProperty;var y=(s,r)=>O(s,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("node:process"),e=require("@visulima/colorize"),x=require("@visulima/error/error"),M=require("@visulima/inspector"),h=require("./format-label-B0BaeOry.cjs"),B=require("./constants-BFrKdBPm.cjs"),k=require("./abstract-pretty-reporter-CZb4ET-0.cjs"),F=require("./get-longest-label-DXpzhu5N.cjs"),V=require("./write-stream-Bgxqp0HI.cjs"),D=y(s=>s&&typeof s=="object"&&"default"in s?s.default:s,"_interopDefaultCompat"),G=D(e);var W=Object.defineProperty,C=y((s,r)=>W(s,"name",{value:r,configurable:!0}),"S");const j=C(s=>!/[\\/]pail[\\/]dist/.test(s),"pailFileFilter");class Y extends k.A{static{y(this,"PrettyReporter")}static{C(this,"PrettyReporter")}#r;#t;#s;#o=!1;#i;#e;constructor(r={}){const{error:l,inspect:o,...n}=r;super({uppercase:{label:!0,...n.uppercase},...n}),this.#i={...h.u,...o},this.#e={...l,color:{fileLine:e.green,hint:e.cyan,marker:e.red,message:e.red,method:e.greenBright,title:e.red}},this.#r=A.stdout,this.#t=A.stderr}setStdout(r){this.#r=r}setStderr(r){this.#t=r}setInteractiveManager(r){this.#s=r}setIsInteractive(r){this.#o=r}log(r){this._log(this._formatMessage(r),r.type.level)}_formatMessage(r){const{columns:l}=h.O();let o=l;typeof this._styles.messageLength=="number"&&(o=this._styles.messageLength);const{badge:n,context:q,date:g,error:w,file:c,groups:f,label:m,message:d,prefix:_,repeated:S,scope:u,suffix:b,traceError:v,type:R}=r,{color:T}=this._loggerTypes[R.name],L=T?G[T]:e.white,p=f.map(()=>" ").join(""),t=[];if(f.length>0&&t.push(p+e.grey("["+f.at(-1)+"]")+" "),g&&t.push(e.grey(this._styles.dateFormatter(typeof g=="string"?new Date(g):g))+" "),n)t.push(L(n));else{const i=k.s(this._loggerTypes);i.length>0&&t.push(e.grey(".".repeat(i.length))+" ")}const P=F.s(this._loggerTypes);m?t.push(L(h.n(m,this._styles))+" ",e.grey(".".repeat(P.length-h.m(m)))):t.push(e.grey(".".repeat(P.length+2))),S&&t.push(e.bgGrey.white("["+S+"x]")+" "),Array.isArray(u)&&u.length>0&&t.push(" "+e.grey("["+u.join(" > ")+"]")+" "),_&&t.push(e.grey((Array.isArray(u)&&u.length>0?". ":" ")+"["+(this._styles.underline.prefix?e.underline(_):_)+"]")+" ");const E=h.m(t.join(" "));if(c){const i=c.name+(c.line?":"+c.line:""),a=h.m(i);a+E+2>o?t.push(e.grey(" "+i)):t.push(e.grey(".".repeat(o-E-a-2)+" "+i))}else t.push(e.grey(".".repeat(o-E-1)));if(t.length>0&&t.push(`
2
+
3
+ `),d!==B.E){const i=typeof d=="string"?d:M.inspect(d,this.#i);t.push(p+h.T(i,o-3,{hard:!0,trim:!1,wordWrap:!0}))}if(q){let i=!1;t.push(...q.map(a=>{if(a instanceof Error)return i=!0,`
4
+
5
+ `+x.renderError(a,{...this.#e,filterStacktrace:j,prefix:p});if(typeof a=="object")return" "+M.inspect(a,this.#i);const I=(i?`
6
+
7
+ `:" ")+a;return i=!1,I}))}return w&&t.push(x.renderError(w,{...this.#e,filterStacktrace:j,prefix:p})),v&&t.push(`
8
+
9
+ `+x.renderError(v,{...this.#e,filterStacktrace:j,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:p})),b&&t.push(`
10
+ `,p+e.grey(this._styles.underline.suffix?e.underline(b):b)),t.join("")+`
11
+ `}_log(r,l){const o=["error","trace","warn"].includes(l)?"stderr":"stdout",n=o==="stderr"?this.#t:this.#r;this.#o&&this.#s!==void 0&&n.isTTY?this.#s.update(o,r.split(`
12
+ `),0):V.n(r+`
13
+ `,n)}}exports.PrettyReporter=Y;
@@ -0,0 +1,5 @@
1
+ "use strict";var T=Object.defineProperty;var f=(n,i)=>T(n,"name",{value:i,configurable:!0});const l=require("@visulima/colorize/browser"),o=require("@visulima/fmt"),C=require("./constants-BFrKdBPm.cjs"),P=require("./abstract-pretty-reporter-CZb4ET-0.cjs"),D=require("./get-longest-label-DXpzhu5N.cjs"),S=require("./write-console-log-3G15muTS.cjs"),k=f(n=>n&&typeof n=="object"&&"default"in n?n.default:n,"_interopDefaultCompat"),E=k(l);var F=Object.defineProperty,M=f((n,i)=>F(n,"name",{value:i,configurable:!0}),"A");class O extends P.A{static{f(this,"Y")}static{M(this,"PrettyReporter")}constructor(i={}){super({uppercase:{label:!0,...i.uppercase},...i})}log(i){const t=typeof window<"u"&&typeof window.document<"u",_=S.t(i.type.level),{badge:x,context:w,date:u,error:A,groups:g,label:y,message:q,prefix:d,repeated:h,scope:p,suffix:m,type:R}=i,{color:L}=this._loggerTypes[R.name],v=L?E[L]:l.white,s=[];if(t&&g.length>0){const e=g.map(()=>" ").join(""),r=l.grey("["+g.at(-1)+"]");s.push(o.format(e+r[0],r.slice(1)))}if(u){const e=l.grey(this._styles.dateFormatter(typeof u=="string"?new Date(u):u));t?s.push(o.format(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}if(x){const e=v(x);t?s.push(o.format(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}else{const e=P.s(this._loggerTypes);if(e.length>0){const r=l.grey(".".repeat(e.length));t?s.push(o.format(r[0]+" ",r.slice(1))):s.push([r[0]+" ",...r.slice(1)])}}const j=D.s(this._loggerTypes);let b;if(h){const e=l.white("["+h+"x]");b=t?o.format(e[0],e.slice(1)):[e[0],...e.slice(1)]}if(y){const e=v(this._formatLabel(y));t?s.push(o.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)]),b&&s.push(b);let r=j.length-y.length;if(h?r-=String(h).length+3:r+=1,r>0){const c=l.grey(".".repeat(r));t?s.push(o.format(c[0],c.slice(1))):s.push([" "+c[0],...c.slice(1)])}}else{const e=l.grey(".".repeat(j.length+1));t?s.push(o.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(Array.isArray(p)&&p.length>0){const e=l.grey("["+p.join(" > ")+"]");t?s.push(o.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(d){const e=l.grey((Array.isArray(p)&&p.length>0?". ":" ")+"["+(this._styles.underline.prefix?l.underline(d):d)+"] ");t?s.push(o.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(q!==C.E&&s.push(q),w&&s.push(...w),A&&s.push(A,`
2
+
3
+ `),m){const e=l.grey(this._styles.underline.suffix?l.underline(m):m);t?s.push(o.format(`
4
+ `+e[0],e.slice(1))):s.push([`
5
+ `+e[0],...e.slice(1)])}if(t)_(...s);else{let e="";const r=[],c=[];for(const a of s)Array.isArray(a)&&a.length>1&&a[0].includes("%c")?(e+=a[0],r.push(...a.slice(1))):c.push(a);_(e+"%c",...r,"",...c)}}_formatLabel(i){let t=this._styles.uppercase.label?i.toUpperCase():i;return t=this._styles.underline.label?l.underline(t):t,this._styles.bold.label&&(t=l.bold(t)),t}}module.exports=O;
@@ -0,0 +1,11 @@
1
+ "use strict";var B=Object.defineProperty;var g=(s,e)=>B(s,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("node:process"),r=require("@visulima/colorize"),x=require("@visulima/error"),M=require("@visulima/inspector"),l=require("./format-label-B0BaeOry.cjs"),F=require("./constants-BFrKdBPm.cjs"),k=require("./abstract-pretty-reporter-CZb4ET-0.cjs"),P=require("./get-longest-label-DXpzhu5N.cjs"),V=require("./write-stream-Bgxqp0HI.cjs"),D=g(s=>s&&typeof s=="object"&&"default"in s?s.default:s,"_interopDefaultCompat"),W=D(r);var z=Object.defineProperty,R=g((s,e)=>z(s,"name",{value:e,configurable:!0}),"L");const E=R(s=>!/[\\/]pail[\\/]dist/.test(s),"pailFileFilter");class G extends k.A{static{g(this,"SimpleReporter")}static{R(this,"SimpleReporter")}#r;#t;#s;#o=!1;#i;#e;constructor(e={}){const{error:h,inspect:n,...o}=e;super({uppercase:{label:!0,...o.uppercase},...o}),this.#i={...l.u,indent:void 0,...n},this.#e={...h,color:{fileLine:r.green,hint:r.cyan,marker:r.red,message:r.red,method:r.greenBright,title:r.red}},this.#r=C.stdout,this.#t=C.stderr}setStdout(e){this.#r=e}setStderr(e){this.#t=e}setInteractiveManager(e){this.#s=e}setIsInteractive(e){this.#o=e}log(e){this._log(this._formatMessage(e),e.type.level)}_formatMessage(e){const{columns:h}=l.O();let n=h;typeof this._styles.messageLength=="number"&&(n=this._styles.messageLength);const{badge:o,context:S,date:u,error:v,file:c,groups:f,label:y,message:d,prefix:m,repeated:j,scope:_,suffix:b,traceError:q,type:I}=e,{color:w}=this._loggerTypes[I.name],L=w?W[w]:r.white,a=f.map(()=>" ").join(""),t=[];if(f.length>0&&t.push(a+r.grey("["+f.at(-1)+"]")+" "),u&&t.push(r.grey(this._styles.dateFormatter(typeof u=="string"?new Date(u):u))+" "),o)t.push(r.bold(L(o)));else{const i=k.s(this._loggerTypes);i.length>0&&t.push(r.grey(" ".repeat(i.length)))}const T=P.s(this._loggerTypes);y?t.push(r.bold(L(l.n(y,this._styles)))+" "," ".repeat(T.length-l.m(y))):t.push(" ".repeat(T.length+1)),j&&t.push(r.bgGrey.white("["+j+"x]")+" "),Array.isArray(_)&&_.length>0&&t.push(r.grey("["+_.join(" > ")+"]")+" "),m&&t.push(r.grey("["+(this._styles.underline.prefix?r.underline(m):m)+"]")+" ");const O=l.m(t.join(""));if(d!==F.E){const i=typeof d=="string"?d:M.inspect(d,this.#i);t.push(a+l.T(i,n-3,{hard:!0,trim:!1,wordWrap:!0}))}if(S){let i=!1;t.push(...S.map(p=>{if(p instanceof Error)return i=!0,`
2
+
3
+ `+x.renderError(p,{...this.#e,filterStacktrace:E,prefix:a});if(typeof p=="object")return" "+M.inspect(p,this.#i);const A=(i?`
4
+
5
+ `:" ")+p;return i=!1,A}))}if(v&&t.push(x.renderError(v,{...this.#e,filterStacktrace:E,prefix:a})),q&&t.push(`
6
+
7
+ `+x.renderError(q,{...this.#e,filterStacktrace:E,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:a})),b&&t.push(" "+a+r.grey(this._styles.underline.suffix?r.underline(b):b)),c){const i=c.name+(c.line?":"+c.line:"");t.push(`
8
+ `,r.grey("Caller: ")," ".repeat(O-8),i,`
9
+ `)}return t.join("")}_log(e,h){const n=["error","trace","warn"].includes(h)?"stderr":"stdout",o=n==="stderr"?this.#t:this.#r;this.#o&&this.#s!==void 0&&o.isTTY?this.#s.update(n,e.split(`
10
+ `),0):V.n(e+`
11
+ `,o)}}exports.SimpleReporter=G;
@@ -0,0 +1,11 @@
1
+ var F=Object.defineProperty;var _=(n,e)=>F(n,"name",{value:e,configurable:!0});import{stdout as P,stderr as V}from"node:process";import Y,{green as W,cyan as z,red as x,greenBright as D,grey as o,bold as k,bgGrey as G,underline as C,white as q}from"@visulima/colorize";import{renderError as b}from"@visulima/error";import{inspect as L}from"@visulima/inspector";import{u as H,O as J,n as K,m as A,T as N}from"./format-label-ECls2QEw.mjs";import{E as Q}from"./constants-BMS51p6Y.mjs";import{A as U,s as X}from"./abstract-pretty-reporter-DgXRHEj-.mjs";import{s as Z}from"./get-longest-label-4ISUsE2q.mjs";import{n as ee}from"./write-stream-C17GXSxA.mjs";var te=Object.defineProperty,I=_((n,e)=>te(n,"name",{value:e,configurable:!0}),"L");const E=I(n=>!/[\\/]pail[\\/]dist/.test(n),"pailFileFilter");class ue extends U{static{_(this,"SimpleReporter")}static{I(this,"SimpleReporter")}#t;#r;#s;#o=!1;#i;#e;constructor(e={}){const{error:h,inspect:i,...s}=e;super({uppercase:{label:!0,...s.uppercase},...s}),this.#i={...H,indent:void 0,...i},this.#e={...h,color:{fileLine:W,hint:z,marker:x,message:x,method:D,title:x}},this.#t=P,this.#r=V}setStdout(e){this.#t=e}setStderr(e){this.#r=e}setInteractiveManager(e){this.#s=e}setIsInteractive(e){this.#o=e}log(e){this._log(this._formatMessage(e),e.type.level)}_formatMessage(e){const{columns:h}=J();let i=h;typeof this._styles.messageLength=="number"&&(i=this._styles.messageLength);const{badge:s,context:v,date:l,error:w,file:c,groups:f,label:m,message:u,prefix:d,repeated:S,scope:g,suffix:y,traceError:j,type:O}=e,{color:M}=this._loggerTypes[O.name],T=M?Y[M]:q,a=f.map(()=>" ").join(""),t=[];if(f.length>0&&t.push(a+o("["+f.at(-1)+"]")+" "),l&&t.push(o(this._styles.dateFormatter(typeof l=="string"?new Date(l):l))+" "),s)t.push(k(T(s)));else{const r=X(this._loggerTypes);r.length>0&&t.push(o(" ".repeat(r.length)))}const $=Z(this._loggerTypes);m?t.push(k(T(K(m,this._styles)))+" "," ".repeat($.length-A(m))):t.push(" ".repeat($.length+1)),S&&t.push(G.white("["+S+"x]")+" "),Array.isArray(g)&&g.length>0&&t.push(o("["+g.join(" > ")+"]")+" "),d&&t.push(o("["+(this._styles.underline.prefix?C(d):d)+"]")+" ");const R=A(t.join(""));if(u!==Q){const r=typeof u=="string"?u:L(u,this.#i);t.push(a+N(r,i-3,{hard:!0,trim:!1,wordWrap:!0}))}if(v){let r=!1;t.push(...v.map(p=>{if(p instanceof Error)return r=!0,`
2
+
3
+ `+b(p,{...this.#e,filterStacktrace:E,prefix:a});if(typeof p=="object")return" "+L(p,this.#i);const B=(r?`
4
+
5
+ `:" ")+p;return r=!1,B}))}if(w&&t.push(b(w,{...this.#e,filterStacktrace:E,prefix:a})),j&&t.push(`
6
+
7
+ `+b(j,{...this.#e,filterStacktrace:E,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:a})),y&&t.push(" "+a+o(this._styles.underline.suffix?C(y):y)),c){const r=c.name+(c.line?":"+c.line:"");t.push(`
8
+ `,o("Caller: ")," ".repeat(R-8),r,`
9
+ `)}return t.join("")}_log(e,h){const i=["error","trace","warn"].includes(h)?"stderr":"stdout",s=i==="stderr"?this.#r:this.#t;this.#o&&this.#s!==void 0&&s.isTTY?this.#s.update(i,e.split(`
10
+ `),0):ee(e+`
11
+ `,s)}}export{ue as SimpleReporter};
@@ -0,0 +1 @@
1
+ "use strict";var u=Object.defineProperty;var n=(s,r)=>u(s,"name",{value:r,configurable:!0});const f=require("@visulima/error/error"),g=require("./constants-BFrKdBPm.cjs");var h=Object.defineProperty,m=n((s,r)=>h(s,"name",{value:r,configurable:!0}),"p");class b{static{n(this,"AbstractJsonReporter")}static{m(this,"AbstractJsonReporter")}stringify;errorOptions;constructor(r={}){this.errorOptions=r.error??{}}setStringify(r){this.stringify=r}log(r){const{context:a,error:l,file:t,message:c,type:p,...e}=r;if(e.label&&(e.label=e.label.trim()),t&&(e.file=t.name+":"+t.line+(t.column?":"+t.column:"")),c===g.E?e.message=void 0:e.message=c,l&&(e.error=f.serializeError(l,this.errorOptions)),a){const i=[];for(const o of a)o!==g.E&&(o instanceof Error?i.push(f.serializeError(o,this.errorOptions)):i.push(o));e.context=i}this._log(this.stringify(e),p.level)}}exports.A=b;
@@ -1 +1 @@
1
- "use strict";var n=Object.defineProperty;var s=(t,e)=>n(t,"name",{value:e,configurable:!0});const c=require("./constants-BBH2bwRB.cjs");var g=Object.defineProperty,l=s((t,e)=>g(t,"name",{value:e,configurable:!0}),"r$1");const i=l(t=>{const e=Object.keys(t).map(r=>t[r].badge??"");return e.length===0?"":e.reduce((r,a)=>r.length>a.length?r:a)},"getLongestBadge");var p=Object.defineProperty,o=s((t,e)=>p(t,"name",{value:e,configurable:!0}),"o");const u=o(t=>[t.getHours(),t.getMinutes(),t.getSeconds()].map(e=>String(e).padStart(2,"0")).join(":"),"dateFormatter");class b{static{s(this,"AbstractPrettyReporter")}static{o(this,"AbstractPrettyReporter")}_styles;_loggerTypes;constructor(e){this._styles={bold:{label:!1},dateFormatter:u,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...e},this._loggerTypes=c.LOG_TYPES}setLoggerTypes(e){this._loggerTypes=e}}exports.AbstractPrettyReporter=b;exports.s=i;
1
+ "use strict";var n=Object.defineProperty;var s=(t,e)=>n(t,"name",{value:e,configurable:!0});const g=require("./constants-BFrKdBPm.cjs");var l=Object.defineProperty,c=s((t,e)=>l(t,"name",{value:e,configurable:!0}),"r$1");const i=c(t=>{const e=Object.keys(t).map(r=>t[r].badge??"");return e.length===0?"":e.reduce((r,a)=>r.length>a.length?r:a)},"getLongestBadge");var p=Object.defineProperty,o=s((t,e)=>p(t,"name",{value:e,configurable:!0}),"o");const u=o(t=>[t.getHours(),t.getMinutes(),t.getSeconds()].map(e=>String(e).padStart(2,"0")).join(":"),"dateFormatter");class b{static{s(this,"AbstractPrettyReporter")}static{o(this,"AbstractPrettyReporter")}_styles;_loggerTypes;constructor(e){this._styles={bold:{label:!1},dateFormatter:u,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...e},this._loggerTypes=g.L}setLoggerTypes(e){this._loggerTypes=e}}exports.A=b;exports.s=i;
@@ -1 +1 @@
1
- "use strict";const l={alert:7,critical:6,debug:1,emergency:8,error:5,informational:2,notice:3,trace:2,warning:4},e={alert:{color:"red",label:"alert",logLevel:"alert"},await:{color:"blue",label:"awaiting",logLevel:"informational"},complete:{color:"cyan",label:"complete",logLevel:"informational"},critical:{color:"redBright",label:"critical",logLevel:"critical"},debug:{color:"gray",label:"debug",logLevel:"debug"},emergency:{color:"redBright",label:"emergency",logLevel:"emergency"},error:{color:"red",label:"error",logLevel:"error"},info:{color:"blueBright",label:"info",logLevel:"informational"},log:{label:"",logLevel:"informational"},notice:{color:"magentaBright",label:"notice",logLevel:"notice"},pending:{color:"magenta",label:"pending",logLevel:"informational"},start:{color:"greenBright",label:"start",logLevel:"informational"},stop:{color:"red",label:"stop",logLevel:"informational"},success:{color:"green",label:"success",logLevel:"informational"},trace:{color:"cyanBright",label:"trace",logLevel:"trace"},wait:{color:"blue",label:"waiting",logLevel:"informational"},warn:{color:"yellow",label:"warning",logLevel:"warning"},watch:{color:"yellowBright",label:"watching",logLevel:"informational"}},o=Symbol("EMPTY");exports.EMPTY_SYMBOL=o;exports.EXTENDED_RFC_5424_LOG_LEVELS=l;exports.LOG_TYPES=e;
1
+ "use strict";const l={alert:7,critical:6,debug:1,emergency:8,error:5,informational:2,notice:3,trace:2,warning:4},e={alert:{color:"red",label:"alert",logLevel:"alert"},await:{color:"blue",label:"awaiting",logLevel:"informational"},complete:{color:"cyan",label:"complete",logLevel:"informational"},critical:{color:"redBright",label:"critical",logLevel:"critical"},debug:{color:"gray",label:"debug",logLevel:"debug"},emergency:{color:"redBright",label:"emergency",logLevel:"emergency"},error:{color:"red",label:"error",logLevel:"error"},info:{color:"blueBright",label:"info",logLevel:"informational"},log:{label:"",logLevel:"informational"},notice:{color:"magentaBright",label:"notice",logLevel:"notice"},pending:{color:"magenta",label:"pending",logLevel:"informational"},start:{color:"greenBright",label:"start",logLevel:"informational"},stop:{color:"red",label:"stop",logLevel:"informational"},success:{color:"green",label:"success",logLevel:"informational"},trace:{color:"cyanBright",label:"trace",logLevel:"trace"},wait:{color:"blue",label:"waiting",logLevel:"informational"},warn:{color:"yellow",label:"warning",logLevel:"warning"},watch:{color:"yellowBright",label:"watching",logLevel:"informational"}},o=Symbol("EMPTY");exports.E=o;exports.L=e;exports.a=l;