@visulima/pail 1.4.4 → 2.0.0

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 (40) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE.md +21 -0
  3. package/dist/index.browser.cjs +1 -1
  4. package/dist/index.browser.mjs +1 -1
  5. package/dist/index.server.cjs +4 -4
  6. package/dist/index.server.mjs +4 -4
  7. package/dist/processor.browser.cjs +1 -1
  8. package/dist/processor.browser.mjs +1 -1
  9. package/dist/processor.server.cjs +1 -1
  10. package/dist/processor.server.d.cts +1 -27
  11. package/dist/processor.server.d.mts +1 -27
  12. package/dist/processor.server.d.ts +1 -27
  13. package/dist/processor.server.mjs +1 -1
  14. package/dist/reporter.browser.cjs +2 -2
  15. package/dist/reporter.browser.d.cts +1 -1
  16. package/dist/reporter.browser.d.mts +1 -1
  17. package/dist/reporter.browser.d.ts +1 -1
  18. package/dist/reporter.browser.mjs +2 -2
  19. package/dist/reporter.server.cjs +10 -10
  20. package/dist/reporter.server.d.cts +20 -27
  21. package/dist/reporter.server.d.mts +20 -27
  22. package/dist/reporter.server.d.ts +20 -27
  23. package/dist/reporter.server.mjs +11 -11
  24. package/dist/shared/pail.B78_c-y4.cjs +1 -0
  25. package/dist/shared/pail.BPOgzkG1.mjs +20 -0
  26. package/dist/shared/pail.Bbo15e5K.mjs +1 -0
  27. package/dist/shared/{pail.nEbRCLhY.mjs → pail.Bj_SDK4w.mjs} +1 -1
  28. package/dist/shared/pail.DHp7NF7R.cjs +1 -0
  29. package/dist/shared/pail.DM_CW0V1.mjs +1 -0
  30. package/dist/shared/pail.akgEzola.cjs +20 -0
  31. package/dist/shared/{pail.B85Cx0UJ.cjs → pail.rUW_oLpx.cjs} +1 -1
  32. package/package.json +3 -3
  33. package/dist/shared/pail.C0epjAht.cjs +0 -1
  34. package/dist/shared/pail.CMrKHGku.cjs +0 -20
  35. package/dist/shared/pail.CNxJnpWG.mjs +0 -1
  36. package/dist/shared/pail.D0U9y4qH.cjs +0 -1
  37. package/dist/shared/pail.D32En-g3.mjs +0 -20
  38. package/dist/shared/pail.oMoeTQZX.cjs +0 -1
  39. package/dist/shared/pail.uFyi02gk.mjs +0 -1
  40. package/dist/shared/pail.xIXzgCNy.mjs +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## @visulima/pail [2.0.0](https://github.com/visulima/visulima/compare/@visulima/pail@1.4.4...@visulima/pail@2.0.0) (2024-07-09)
2
+
3
+ ### ⚠ BREAKING CHANGES
4
+
5
+ * removed abstract-file-reporter - the new base is now the AbstractJsonReporter, removed ErrorProcessor - was replaced with @visulima/error
6
+ Signed-off-by: prisis <d.bannert@anolilab.de>
7
+
8
+ ### Features
9
+
10
+ * switched error serialize to @visulima/error, export type for reporter options ([a761356](https://github.com/visulima/visulima/commit/a761356a9215a8dc72a1477d5b0a493c73aa7b88))
11
+
1
12
  ## @visulima/pail [1.4.4](https://github.com/visulima/visulima/compare/@visulima/pail@1.4.3...@visulima/pail@1.4.4) (2024-07-09)
2
13
 
3
14
  ### Bug Fixes
package/LICENSE.md CHANGED
@@ -66,6 +66,27 @@ License: MIT
66
66
  By: Mathias Bynens
67
67
  Repository: https://github.com/mathiasbynens/emoji-regex.git
68
68
 
69
+ > Copyright Mathias Bynens <https://mathiasbynens.be/>
70
+ >
71
+ > Permission is hereby granted, free of charge, to any person obtaining
72
+ > a copy of this software and associated documentation files (the
73
+ > "Software"), to deal in the Software without restriction, including
74
+ > without limitation the rights to use, copy, modify, merge, publish,
75
+ > distribute, sublicense, and/or sell copies of the Software, and to
76
+ > permit persons to whom the Software is furnished to do so, subject to
77
+ > the following conditions:
78
+ >
79
+ > The above copyright notice and this permission notice shall be
80
+ > included in all copies or substantial portions of the Software.
81
+ >
82
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
83
+ > EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
84
+ > MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
85
+ > NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
86
+ > LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
87
+ > OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
88
+ > WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
89
+
69
90
  ---------------------------------------
70
91
 
71
92
  ## get-east-asian-width
@@ -1 +1 @@
1
- "use strict";var t=Object.defineProperty;var o=(e,r)=>t(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./shared/pail.CqyBdtm7.cjs"),i=require("./shared/pail.C0epjAht.cjs"),n=require("./shared/pail.B85Cx0UJ.cjs"),c=require("./shared/pail.oMoeTQZX.cjs");var l=Object.defineProperty,u=o((e,r)=>l(e,"name",{value:r,configurable:!0}),"e");const s=u(e=>new a.PailBrowser({processors:[new n.g,...typeof window<"u"?[new i.L]:[]],reporters:[new c.n],...e}),"createPail"),w=s();exports.createPail=s;exports.pail=w;
1
+ "use strict";var t=Object.defineProperty;var o=(e,r)=>t(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./shared/pail.CqyBdtm7.cjs"),i=require("./shared/pail.rUW_oLpx.cjs"),c=require("./shared/pail.B78_c-y4.cjs");var n=Object.defineProperty,l=o((e,r)=>n(e,"name",{value:r,configurable:!0}),"e");const a=l(e=>new s.PailBrowser({processors:[new i.L],reporters:[new c.i],...e}),"createPail"),u=a();exports.createPail=a;exports.pail=u;
@@ -1 +1 @@
1
- var t=Object.defineProperty;var o=(r,e)=>t(r,"name",{value:e,configurable:!0});import{P as a}from"./shared/pail.Bk25qk8U.mjs";import{L as i}from"./shared/pail.CNxJnpWG.mjs";import{g as n}from"./shared/pail.nEbRCLhY.mjs";import{n as p}from"./shared/pail.xIXzgCNy.mjs";var m=Object.defineProperty,f=o((r,e)=>m(r,"name",{value:e,configurable:!0}),"e");const s=f(r=>new a({processors:[new n,...typeof window<"u"?[new i]:[]],reporters:[new p],...r}),"createPail"),v=s();export{s as createPail,v as pail};
1
+ var a=Object.defineProperty;var o=(r,e)=>a(r,"name",{value:e,configurable:!0});import{P as t}from"./shared/pail.Bk25qk8U.mjs";import{L as i}from"./shared/pail.Bj_SDK4w.mjs";import{i as p}from"./shared/pail.DM_CW0V1.mjs";var m=Object.defineProperty,n=o((r,e)=>m(r,"name",{value:e,configurable:!0}),"e");const s=n(r=>new t({processors:[new i],reporters:[new p],...r}),"createPail"),w=s();export{s as createPail,w as pail};
@@ -1,5 +1,5 @@
1
- "use strict";var I=Object.defineProperty;var n=(r,t)=>I(r,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("node:process"),v=require("./shared/pail.CMrKHGku.cjs"),P=require("node:string_decoder"),$=require("./shared/pail.CqyBdtm7.cjs"),g=require("@visulima/inspector"),j=require("./shared/pail.BjvkVeLq.cjs"),M=require("./shared/pail.C0epjAht.cjs"),O=require("./shared/pail.B85Cx0UJ.cjs");var A=Object.defineProperty,R=n((r,t)=>A(r,"name",{value:t,configurable:!0}),"l$1");let T=class{static{n(this,"v")}static{R(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}=v.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((L,E)=>[...L,v.wrapAnsi(E,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"),v=require("./shared/pail.akgEzola.cjs"),I=require("node:string_decoder"),P=require("./shared/pail.CqyBdtm7.cjs"),w=require("@visulima/inspector"),$=require("./shared/pail.BjvkVeLq.cjs"),j=require("./shared/pail.rUW_oLpx.cjs");var M=Object.defineProperty,O=n((r,t)=>M(r,"name",{value:t,configurable:!0}),"l$1");let R=class{static{n(this,"v")}static{O(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}=v.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,v.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(`
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 q=Object.defineProperty,y=n((r,t)=>q(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"),f=process.platform==="win32"?`${w}${c}0f`:`${w}${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");let m=class S{static{n(this,"t")}static{V(this,"InteractiveStreamHook")}static DRAIN=!0;#t=new P.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(),S.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!==j.EMPTY_SYMBOL){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):v.n(d+i.join(""),l)}};var U=Object.defineProperty,z=n((r,t)=>U(r,"name",{value:t,configurable:!0}),"a");class F extends $.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 T(new m(this.stdout),new m(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(f),this.stderr.write(f)}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,_=n((r,t)=>W(r,"name",{value:t,configurable:!0}),"t");const Q=_(()=>h.env.NODE_ENV==="debug"||h.env.DEBUG!==void 0?"debug":h.env.NODE_ENV==="test"?"warning":"informational","_getDefaultLogLevel"),b=_(r=>{let t=Q();return h.env.PAIL_LOG_LEVEL!==void 0&&(t=h.env.PAIL_LOG_LEVEL),new K({logLevel:t,processors:[new O.g,new M.L],reporters:[new v.a],stderr:h.stderr,stdout:h.stdout,...r})},"createPail"),X=b();exports.createPail=b;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 A=Object.defineProperty,y=n((r,t)=>A(r,"name",{value:t,configurable:!0}),"n$1");const c="\x1B[",f=c+"2J",T=c+"2K",x=c+"G",N=y((r=1)=>c+r+"A","cursorUp"),m=process.platform==="win32"?`${f}${c}0f`:`${f}${c}3J${c}H`,q=c+"?25l",D=c+"?25h",B=y(r=>{let t="";for(let e=0;e<r;e++)t+=T+(e<r-1?N():"");return r&&(t+=x),t},"eraseLines");var k=Object.defineProperty,G=n((r,t)=>k(r,"name",{value:t,configurable:!0}),"s$1");class g{static{n(this,"t")}static{G(this,"InteractiveStreamHook")}static DRAIN=!0;#t=new I.StringDecoder;#e=[];#r;#s;constructor(t){this.#r=t.write,this.#s=t}active(){this.write(q),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(),g.DRAIN}}erase(t){t>0&&this.write(B(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(D)}write(t){this.#r.apply(this.#s,[t])}}var H=Object.defineProperty,V=n((r,t)=>H(r,"name",{value:t,configurable:!0}),"c");let Y=class{static{n(this,"v")}static{V(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:w.inspect(a,this.#i);i.push(o)}e&&i.push(...e.map(o=>typeof o=="object"?" "+w.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):v.n(d+i.join(""),l)}};var C=Object.defineProperty,J=n((r,t)=>C(r,"name",{value:t,configurable:!0}),"a$1");class U extends P.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 R(new g(this.stdout),new g(this.stderr))),Array.isArray(a)&&this.registerReporters(a),this.rawReporter=this.extendReporter(t.rawReporter??new Y)}static{J(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 z=U;var F=Object.defineProperty,S=n((r,t)=>F(r,"name",{value:t,configurable:!0}),"o");const K=S(()=>h.env.NODE_ENV==="debug"||h.env.DEBUG!==void 0?"debug":h.env.NODE_ENV==="test"?"warning":"informational","_getDefaultLogLevel"),_=S(r=>{let t=K();return h.env.PAIL_LOG_LEVEL!==void 0&&(t=h.env.PAIL_LOG_LEVEL),new z({logLevel:t,processors:[new j.L],reporters:[new v.PrettyReporter],stderr:h.stderr,stdout:h.stdout,...r})},"createPail"),W=_();exports.createPail=_;exports.pail=W;
@@ -1,5 +1,5 @@
1
- var I=Object.defineProperty;var n=(r,t)=>I(r,"name",{value:t,configurable:!0});import{stdout as m,stderr as S,env as d}from"node:process";import{t as $,w as j,n as M,a as O}from"./shared/pail.D32En-g3.mjs";import{StringDecoder as P}from"node:string_decoder";import{a as A}from"./shared/pail.Bk25qk8U.mjs";import{inspect as f}from"@visulima/inspector";import{E as R}from"./shared/pail.C1VNf0a-.mjs";import{L as x}from"./shared/pail.CNxJnpWG.mjs";import{g as N}from"./shared/pail.nEbRCLhY.mjs";var T=Object.defineProperty,D=n((r,t)=>T(r,"name",{value:t,configurable:!0}),"l$1");let B=class{static{n(this,"v")}static{D(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}=$(),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((L,E)=>[...L,j(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(`
1
+ var E=Object.defineProperty;var n=(r,t)=>E(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 $,n as P,P as j}from"./shared/pail.BPOgzkG1.mjs";import{StringDecoder as M}from"node:string_decoder";import{a as O}from"./shared/pail.Bk25qk8U.mjs";import{inspect as f}from"@visulima/inspector";import{E as R}from"./shared/pail.C1VNf0a-.mjs";import{L as A}from"./shared/pail.Bj_SDK4w.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: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,L)=>[...b,$(L,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=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 k=Object.defineProperty,y=n((r,t)=>k(r,"name",{value:t,configurable:!0}),"n$1");const h="\x1B[",v=h+"2J",G=h+"2K",H=h+"G",V=y((r=1)=>h+r+"A","cursorUp"),w=process.platform==="win32"?`${v}${h}0f`:`${v}${h}3J${h}H`,Y=h+"?25l",C=h+"?25h",J=y(r=>{let t="";for(let e=0;e<r;e++)t+=G+(e<r-1?V():"");return r&&(t+=H),t},"eraseLines");var U=Object.defineProperty,z=n((r,t)=>U(r,"name",{value:t,configurable:!0}),"s$1");let g=class _{static{n(this,"t")}static{z(this,"InteractiveStreamHook")}static DRAIN=!0;#t=new P;#e=[];#r;#s;constructor(t){this.#r=t.write,this.#s=t}active(){this.write(Y),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(),_.DRAIN}}erase(t){t>0&&this.write(J(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(C)}write(t){this.#r.apply(this.#s,[t])}};var K=Object.defineProperty,W=n((r,t)=>K(r,"name",{value:t,configurable:!0}),"c");let q=class{static{n(this,"v")}static{W(this,"RawReporter")}#t;#e;#r;#s=!1;#i;constructor(t={}){this.#t=m,this.#e=S,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!==R){const o=typeof a=="string"?a:f(a,this.#i);i.push(o)}e&&i.push(...e.map(o=>typeof o=="object"?" "+f(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):M(u+i.join(""),l)}};var F=Object.defineProperty,Q=n((r,t)=>F(r,"name",{value:t,configurable:!0}),"a");class X extends A{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 B(new g(this.stdout),new g(this.stderr))),Array.isArray(a)&&this.registerReporters(a),this.rawReporter=this.extendReporter(t.rawReporter??new q)}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(w),this.stderr.write(w)}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 Z=X;var tt=Object.defineProperty,b=n((r,t)=>tt(r,"name",{value:t,configurable:!0}),"t");const et=b(()=>d.NODE_ENV==="debug"||d.DEBUG!==void 0?"debug":d.NODE_ENV==="test"?"warning":"informational","_getDefaultLogLevel"),rt=b(r=>{let t=et();return d.PAIL_LOG_LEVEL!==void 0&&(t=d.PAIL_LOG_LEVEL),new Z({logLevel:t,processors:[new N,new x],reporters:[new O],stderr:S,stdout:m,...r})},"createPail"),ft=rt();export{rt as createPail,ft 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 v{static{n(this,"t")}static{J(this,"InteractiveStreamHook")}static DRAIN=!0;#t=new M;#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(),v.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:p}=t,i=[];if(a!==R){const o=typeof a=="string"?a:f(a,this.#i);i.push(o)}e&&i.push(...e.map(o=>typeof o=="object"?" "+f(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 W=Object.defineProperty,q=n((r,t)=>W(r,"name",{value:t,configurable:!0}),"a$1");class F extends O{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 T(new v(this.stdout),new v(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 A],reporters:[new j],stderr:y,stdout:m,...r})},"createPail"),ut=tt();export{tt as createPail,ut as pail};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/pail.B85Cx0UJ.cjs"),r=require("./shared/pail.zsOZqsvh.cjs");exports.MessageFormatterProcessor=e.g;exports.RedactProcessor=r.n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/pail.rUW_oLpx.cjs"),r=require("./shared/pail.zsOZqsvh.cjs");exports.MessageFormatterProcessor=e.L;exports.RedactProcessor=r.n;
@@ -1 +1 @@
1
- import{g as e}from"./shared/pail.nEbRCLhY.mjs";import{n as a}from"./shared/pail._czpAR0Z.mjs";export{e as MessageFormatterProcessor,a as RedactProcessor};
1
+ import{L as e}from"./shared/pail.Bj_SDK4w.mjs";import{n as a}from"./shared/pail._czpAR0Z.mjs";export{e as MessageFormatterProcessor,a as RedactProcessor};
@@ -1 +1 @@
1
- "use strict";var l=Object.defineProperty;var t=(o,e)=>l(o,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./shared/pail.C0epjAht.cjs"),i=require("./shared/pail.B85Cx0UJ.cjs"),m=require("./shared/pail.zsOZqsvh.cjs");var u=Object.defineProperty,N=t((o,e)=>u(o,"name",{value:e,configurable:!0}),"u");const b=N(()=>{const o=Error.prepareStackTrace;try{let e=[];Error.prepareStackTrace=(s,r)=>{const c=r.slice(1);return e=c,c},new Error().stack;const a=e.reduce((s,r)=>(r.isNative()||r.getFileName()?.includes("pail/dist")||s.push({columnNumber:r.getColumnNumber(),fileName:r.getFileName(),lineNumber:r.getLineNumber()}),s),[])[0];return a?{columnNumber:a.columnNumber??void 0,fileName:a.fileName,lineNumber:a.lineNumber??void 0}:{fileName:"anonymous",lineNumber:void 0}}finally{Error.prepareStackTrace=o}},"getCallerFilename");var d=Object.defineProperty,f=t((o,e)=>d(o,"name",{value:e,configurable:!0}),"r");class g{static{t(this,"a")}static{f(this,"CallerProcessor")}process(e){const{columnNumber:a,fileName:s,lineNumber:r}=b();return e.file={column:a,line:r,name:s},e}}const p=g;exports.ErrorProcessor=n.L;exports.MessageFormatterProcessor=i.g;exports.RedactProcessor=m.n;exports.CallerProcessor=p;
1
+ "use strict";var n=Object.defineProperty;var l=(a,e)=>n(a,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./shared/pail.rUW_oLpx.cjs"),i=require("./shared/pail.zsOZqsvh.cjs");var m=Object.defineProperty,u=l((a,e)=>m(a,"name",{value:e,configurable:!0}),"u");const N=u(()=>{const a=Error.prepareStackTrace;try{let e=[];Error.prepareStackTrace=(t,r)=>{const c=r.slice(1);return e=c,c},new Error().stack;const o=e.reduce((t,r)=>(r.isNative()||r.getFileName()?.includes("pail/dist")||t.push({columnNumber:r.getColumnNumber(),fileName:r.getFileName(),lineNumber:r.getLineNumber()}),t),[])[0];return o?{columnNumber:o.columnNumber??void 0,fileName:o.fileName,lineNumber:o.lineNumber??void 0}:{fileName:"anonymous",lineNumber:void 0}}finally{Error.prepareStackTrace=a}},"getCallerFilename");var b=Object.defineProperty,d=l((a,e)=>b(a,"name",{value:e,configurable:!0}),"r");class f{static{l(this,"a")}static{d(this,"CallerProcessor")}process(e){const{columnNumber:o,fileName:t,lineNumber:r}=N();return e.file={column:o,line:r,name:t},e}}const p=f;exports.MessageFormatterProcessor=s.L;exports.RedactProcessor=i.n;exports.CallerProcessor=p;
@@ -19,30 +19,4 @@ declare class CallerProcessor<L extends string = string> implements Processor<L>
19
19
  process(meta: Meta<L>): Meta<L>;
20
20
  }
21
21
 
22
- type SerializedError<ErrorType = Error> = Record<PropertyKey, unknown> & {
23
- aggregateErrors?: SerializedError<ErrorType>[];
24
- cause?: unknown;
25
- code?: string;
26
- message: string;
27
- name: string;
28
- raw?: ErrorType;
29
- stack?: string;
30
- };
31
-
32
- declare global {
33
- namespace VisulimaPail {
34
- interface CustomMeta<L> {
35
- error: SerializedError | undefined;
36
- }
37
- }
38
- }
39
- declare class ErrorProcessor<L extends string = string> implements Processor<L> {
40
- private readonly _options;
41
- constructor(options?: {
42
- maxDepth?: number;
43
- useToJSON?: boolean;
44
- });
45
- process(meta: Meta<L>): Meta<L>;
46
- }
47
-
48
- export { CallerProcessor, ErrorProcessor };
22
+ export { CallerProcessor };
@@ -19,30 +19,4 @@ declare class CallerProcessor<L extends string = string> implements Processor<L>
19
19
  process(meta: Meta<L>): Meta<L>;
20
20
  }
21
21
 
22
- type SerializedError<ErrorType = Error> = Record<PropertyKey, unknown> & {
23
- aggregateErrors?: SerializedError<ErrorType>[];
24
- cause?: unknown;
25
- code?: string;
26
- message: string;
27
- name: string;
28
- raw?: ErrorType;
29
- stack?: string;
30
- };
31
-
32
- declare global {
33
- namespace VisulimaPail {
34
- interface CustomMeta<L> {
35
- error: SerializedError | undefined;
36
- }
37
- }
38
- }
39
- declare class ErrorProcessor<L extends string = string> implements Processor<L> {
40
- private readonly _options;
41
- constructor(options?: {
42
- maxDepth?: number;
43
- useToJSON?: boolean;
44
- });
45
- process(meta: Meta<L>): Meta<L>;
46
- }
47
-
48
- export { CallerProcessor, ErrorProcessor };
22
+ export { CallerProcessor };
@@ -19,30 +19,4 @@ declare class CallerProcessor<L extends string = string> implements Processor<L>
19
19
  process(meta: Meta<L>): Meta<L>;
20
20
  }
21
21
 
22
- type SerializedError<ErrorType = Error> = Record<PropertyKey, unknown> & {
23
- aggregateErrors?: SerializedError<ErrorType>[];
24
- cause?: unknown;
25
- code?: string;
26
- message: string;
27
- name: string;
28
- raw?: ErrorType;
29
- stack?: string;
30
- };
31
-
32
- declare global {
33
- namespace VisulimaPail {
34
- interface CustomMeta<L> {
35
- error: SerializedError | undefined;
36
- }
37
- }
38
- }
39
- declare class ErrorProcessor<L extends string = string> implements Processor<L> {
40
- private readonly _options;
41
- constructor(options?: {
42
- maxDepth?: number;
43
- useToJSON?: boolean;
44
- });
45
- process(meta: Meta<L>): Meta<L>;
46
- }
47
-
48
- export { CallerProcessor, ErrorProcessor };
22
+ export { CallerProcessor };
@@ -1 +1 @@
1
- var s=Object.defineProperty;var t=(a,e)=>s(a,"name",{value:e,configurable:!0});import{L as g}from"./shared/pail.CNxJnpWG.mjs";import{g as y}from"./shared/pail.nEbRCLhY.mjs";import{n as k}from"./shared/pail._czpAR0Z.mjs";var m=Object.defineProperty,c=t((a,e)=>m(a,"name",{value:e,configurable:!0}),"u");const i=c(()=>{const a=Error.prepareStackTrace;try{let e=[];Error.prepareStackTrace=(l,r)=>{const n=r.slice(1);return e=n,n},new Error().stack;const o=e.reduce((l,r)=>(r.isNative()||r.getFileName()?.includes("pail/dist")||l.push({columnNumber:r.getColumnNumber(),fileName:r.getFileName(),lineNumber:r.getLineNumber()}),l),[])[0];return o?{columnNumber:o.columnNumber??void 0,fileName:o.fileName,lineNumber:o.lineNumber??void 0}:{fileName:"anonymous",lineNumber:void 0}}finally{Error.prepareStackTrace=a}},"getCallerFilename");var u=Object.defineProperty,N=t((a,e)=>u(a,"name",{value:e,configurable:!0}),"r");class b{static{t(this,"a")}static{N(this,"CallerProcessor")}process(e){const{columnNumber:o,fileName:l,lineNumber:r}=i();return e.file={column:o,line:r,name:l},e}}const f=b;export{f as CallerProcessor,g as ErrorProcessor,y as MessageFormatterProcessor,k as RedactProcessor};
1
+ var i=Object.defineProperty;var n=(a,e)=>i(a,"name",{value:e,configurable:!0});import{L as g}from"./shared/pail.Bj_SDK4w.mjs";import{n as y}from"./shared/pail._czpAR0Z.mjs";var m=Object.defineProperty,c=n((a,e)=>m(a,"name",{value:e,configurable:!0}),"u");const s=c(()=>{const a=Error.prepareStackTrace;try{let e=[];Error.prepareStackTrace=(o,r)=>{const t=r.slice(1);return e=t,t},new Error().stack;const l=e.reduce((o,r)=>(r.isNative()||r.getFileName()?.includes("pail/dist")||o.push({columnNumber:r.getColumnNumber(),fileName:r.getFileName(),lineNumber:r.getLineNumber()}),o),[])[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 u=Object.defineProperty,N=n((a,e)=>u(a,"name",{value:e,configurable:!0}),"r");class b{static{n(this,"a")}static{N(this,"CallerProcessor")}process(e){const{columnNumber:l,fileName:o,lineNumber:r}=s();return e.file={column:l,line:r,name:o},e}}const f=b;export{f as CallerProcessor,g as MessageFormatterProcessor,y as RedactProcessor};
@@ -1,5 +1,5 @@
1
- "use strict";var S=Object.defineProperty;var f=(n,l)=>S(n,"name",{value:l,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./shared/pail.oMoeTQZX.cjs"),o=require("@visulima/colorize/browser"),i=require("@visulima/fmt"),q=require("./shared/pail.BjvkVeLq.cjs"),v=require("./shared/pail.BtheZKQt.cjs"),Y=require("./shared/pail.3G15muTS.cjs"),C=f(n=>n&&typeof n=="object"&&"default"in n?n.default:n,"_interopDefaultCompat"),O=C(o);var D=Object.defineProperty,k=f((n,l)=>D(n,"name",{value:l,configurable:!0}),"A");class B extends v.AbstractPrettyReporter{static{f(this,"Y")}static{k(this,"PrettyReporter")}constructor(l={}){super({uppercase:{label:!0,...l.uppercase},...l})}log(l){const t=typeof window<"u"&&typeof window.document<"u",_=Y.t(l.type.level),{badge:w,context:x,date:u,error:A,groups:g,label:y,message:P,prefix:d,repeated:h,scope:a,suffix:m,type:T}=l,{color:L}=this._loggerTypes[T.name],R=L?O[L]:o.white,s=[];if(t&&g.length>0){const e=g.map(()=>" ").join(""),r=o.grey("["+g.at(-1)+"]");s.push(i.format(e+r[0],r.slice(1)))}if(u){const e=o.grey(this._styles.dateFormatter(typeof u=="string"?new Date(u):u));t?s.push(i.format(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}if(w){const e=R(w);t?s.push(i.format(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}else{const e=v.s(this._loggerTypes);if(e.length>0){const r=o.grey(".".repeat(e.length));t?s.push(i.format(r[0]+" ",r.slice(1))):s.push([r[0]+" ",...r.slice(1)])}}const j=q.s(this._loggerTypes);let b;if(h){const e=o.white("["+h+"x]");b=t?i.format(e[0],e.slice(1)):[e[0],...e.slice(1)]}if(y){const e=R(this._formatLabel(y));t?s.push(i.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=o.grey(".".repeat(r));t?s.push(i.format(c[0],c.slice(1))):s.push([" "+c[0],...c.slice(1)])}}else{const e=o.grey(".".repeat(j.length+1));t?s.push(i.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(Array.isArray(a)&&a.length>0){const e=o.grey("["+a.join(" > ")+"]");t?s.push(i.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(d){const e=o.grey((Array.isArray(a)&&a.length>0?". ":" ")+"["+(this._styles.underline.prefix?o.underline(d):d)+"] ");t?s.push(i.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(P!==q.EMPTY_SYMBOL&&s.push(P),x&&s.push(...x),A&&s.push(A,`
1
+ "use strict";var S=Object.defineProperty;var f=(n,l)=>S(n,"name",{value:l,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./shared/pail.B78_c-y4.cjs"),o=require("@visulima/colorize/browser"),i=require("@visulima/fmt"),q=require("./shared/pail.BjvkVeLq.cjs"),v=require("./shared/pail.BtheZKQt.cjs"),Y=require("./shared/pail.3G15muTS.cjs"),C=f(n=>n&&typeof n=="object"&&"default"in n?n.default:n,"_interopDefaultCompat"),O=C(o);var D=Object.defineProperty,k=f((n,l)=>D(n,"name",{value:l,configurable:!0}),"A");class B extends v.AbstractPrettyReporter{static{f(this,"Y")}static{k(this,"PrettyReporter")}constructor(l={}){super({uppercase:{label:!0,...l.uppercase},...l})}log(l){const t=typeof window<"u"&&typeof window.document<"u",_=Y.t(l.type.level),{badge:w,context:x,date:u,error:A,groups:g,label:y,message:P,prefix:d,repeated:h,scope:a,suffix:m,type:T}=l,{color:L}=this._loggerTypes[T.name],R=L?O[L]:o.white,s=[];if(t&&g.length>0){const e=g.map(()=>" ").join(""),r=o.grey("["+g.at(-1)+"]");s.push(i.format(e+r[0],r.slice(1)))}if(u){const e=o.grey(this._styles.dateFormatter(typeof u=="string"?new Date(u):u));t?s.push(i.format(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}if(w){const e=R(w);t?s.push(i.format(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}else{const e=v.s(this._loggerTypes);if(e.length>0){const r=o.grey(".".repeat(e.length));t?s.push(i.format(r[0]+" ",r.slice(1))):s.push([r[0]+" ",...r.slice(1)])}}const j=q.s(this._loggerTypes);let b;if(h){const e=o.white("["+h+"x]");b=t?i.format(e[0],e.slice(1)):[e[0],...e.slice(1)]}if(y){const e=R(this._formatLabel(y));t?s.push(i.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=o.grey(".".repeat(r));t?s.push(i.format(c[0],c.slice(1))):s.push([" "+c[0],...c.slice(1)])}}else{const e=o.grey(".".repeat(j.length+1));t?s.push(i.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(Array.isArray(a)&&a.length>0){const e=o.grey("["+a.join(" > ")+"]");t?s.push(i.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(d){const e=o.grey((Array.isArray(a)&&a.length>0?". ":" ")+"["+(this._styles.underline.prefix?o.underline(d):d)+"] ");t?s.push(i.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(P!==q.EMPTY_SYMBOL&&s.push(P),x&&s.push(...x),A&&s.push(A,`
2
2
 
3
3
  `),m){const e=o.grey(this._styles.underline.suffix?o.underline(m):m);t?s.push(i.format(`
4
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 p of s)Array.isArray(p)&&p.length>1&&p[0].includes("%c")?(e+=p[0],r.push(...p.slice(1))):c.push(p);_(e+"%c",...r,"",...c)}}_formatLabel(l){let t=this._styles.uppercase.label?l.toUpperCase():l;return t=this._styles.underline.label?o.underline(t):t,this._styles.bold.label&&(t=o.bold(t)),t}}const E=B;exports.JsonReporter=M.n;exports.PrettyReporter=E;
5
+ `+e[0],...e.slice(1)])}if(t)_(...s);else{let e="";const r=[],c=[];for(const p of s)Array.isArray(p)&&p.length>1&&p[0].includes("%c")?(e+=p[0],r.push(...p.slice(1))):c.push(p);_(e+"%c",...r,"",...c)}}_formatLabel(l){let t=this._styles.uppercase.label?l.toUpperCase():l;return t=this._styles.underline.label?o.underline(t):t,this._styles.bold.label&&(t=o.bold(t)),t}}const E=B;exports.JsonReporter=M.i;exports.PrettyReporter=E;
@@ -14,4 +14,4 @@ declare class PrettyReporter<T extends string = string, L extends string = strin
14
14
  private _formatLabel;
15
15
  }
16
16
 
17
- export { JsonReporter, PrettyReporter };
17
+ export { JsonReporter, PrettyReporter, PrettyStyleOptions };
@@ -14,4 +14,4 @@ declare class PrettyReporter<T extends string = string, L extends string = strin
14
14
  private _formatLabel;
15
15
  }
16
16
 
17
- export { JsonReporter, PrettyReporter };
17
+ export { JsonReporter, PrettyReporter, PrettyStyleOptions };
@@ -14,4 +14,4 @@ declare class PrettyReporter<T extends string = string, L extends string = strin
14
14
  private _formatLabel;
15
15
  }
16
16
 
17
- export { JsonReporter, PrettyReporter };
17
+ export { JsonReporter, PrettyReporter, PrettyStyleOptions };
@@ -1,5 +1,5 @@
1
- var j=Object.defineProperty;var b=(h,r)=>j(h,"name",{value:r,configurable:!0});import{n as V}from"./shared/pail.xIXzgCNy.mjs";import M,{white as Y,grey as o,underline as _,bold as S}from"@visulima/colorize/browser";import{format as i}from"@visulima/fmt";import{s as E,E as O}from"./shared/pail.C1VNf0a-.mjs";import{A as k,s as B}from"./shared/pail.CeGWBihI.mjs";import{t as C}from"./shared/pail.BP95fgQZ.mjs";var D=Object.defineProperty,F=b((h,r)=>D(h,"name",{value:r,configurable:!0}),"A");class J extends k{static{b(this,"Y")}static{F(this,"PrettyReporter")}constructor(r={}){super({uppercase:{label:!0,...r.uppercase},...r})}log(r){const t=typeof window<"u"&&typeof window.document<"u",x=C(r.type.level),{badge:A,context:w,date:a,error:P,groups:f,label:y,message:v,prefix:g,repeated:u,scope:c,suffix:m,type:$}=r,{color:R}=this._loggerTypes[$.name],T=R?M[R]:Y,s=[];if(t&&f.length>0){const e=f.map(()=>" ").join(""),l=o("["+f.at(-1)+"]");s.push(i(e+l[0],l.slice(1)))}if(a){const e=o(this._styles.dateFormatter(typeof a=="string"?new Date(a):a));t?s.push(i(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}if(A){const e=T(A);t?s.push(i(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}else{const e=B(this._loggerTypes);if(e.length>0){const l=o(".".repeat(e.length));t?s.push(i(l[0]+" ",l.slice(1))):s.push([l[0]+" ",...l.slice(1)])}}const L=E(this._loggerTypes);let d;if(u){const e=Y("["+u+"x]");d=t?i(e[0],e.slice(1)):[e[0],...e.slice(1)]}if(y){const e=T(this._formatLabel(y));t?s.push(i(e[0],e.slice(1))):s.push([e[0],...e.slice(1)]),d&&s.push(d);let l=L.length-y.length;if(u?l-=String(u).length+3:l+=1,l>0){const p=o(".".repeat(l));t?s.push(i(p[0],p.slice(1))):s.push([" "+p[0],...p.slice(1)])}}else{const e=o(".".repeat(L.length+1));t?s.push(i(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(Array.isArray(c)&&c.length>0){const e=o("["+c.join(" > ")+"]");t?s.push(i(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(g){const e=o((Array.isArray(c)&&c.length>0?". ":" ")+"["+(this._styles.underline.prefix?_(g):g)+"] ");t?s.push(i(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(v!==O&&s.push(v),w&&s.push(...w),P&&s.push(P,`
1
+ var j=Object.defineProperty;var b=(h,r)=>j(h,"name",{value:r,configurable:!0});import{i as V}from"./shared/pail.DM_CW0V1.mjs";import M,{white as Y,grey as o,underline as _,bold as S}from"@visulima/colorize/browser";import{format as i}from"@visulima/fmt";import{s as E,E as O}from"./shared/pail.C1VNf0a-.mjs";import{A as k,s as B}from"./shared/pail.CeGWBihI.mjs";import{t as C}from"./shared/pail.BP95fgQZ.mjs";var D=Object.defineProperty,F=b((h,r)=>D(h,"name",{value:r,configurable:!0}),"A");class J extends k{static{b(this,"Y")}static{F(this,"PrettyReporter")}constructor(r={}){super({uppercase:{label:!0,...r.uppercase},...r})}log(r){const t=typeof window<"u"&&typeof window.document<"u",x=C(r.type.level),{badge:A,context:w,date:a,error:P,groups:f,label:y,message:v,prefix:g,repeated:u,scope:n,suffix:m,type:$}=r,{color:R}=this._loggerTypes[$.name],T=R?M[R]:Y,s=[];if(t&&f.length>0){const e=f.map(()=>" ").join(""),l=o("["+f.at(-1)+"]");s.push(i(e+l[0],l.slice(1)))}if(a){const e=o(this._styles.dateFormatter(typeof a=="string"?new Date(a):a));t?s.push(i(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}if(A){const e=T(A);t?s.push(i(e[0],e.slice(1))):s.push([e[0]+" ",...e.slice(1)])}else{const e=B(this._loggerTypes);if(e.length>0){const l=o(".".repeat(e.length));t?s.push(i(l[0]+" ",l.slice(1))):s.push([l[0]+" ",...l.slice(1)])}}const L=E(this._loggerTypes);let d;if(u){const e=Y("["+u+"x]");d=t?i(e[0],e.slice(1)):[e[0],...e.slice(1)]}if(y){const e=T(this._formatLabel(y));t?s.push(i(e[0],e.slice(1))):s.push([e[0],...e.slice(1)]),d&&s.push(d);let l=L.length-y.length;if(u?l-=String(u).length+3:l+=1,l>0){const p=o(".".repeat(l));t?s.push(i(p[0],p.slice(1))):s.push([" "+p[0],...p.slice(1)])}}else{const e=o(".".repeat(L.length+1));t?s.push(i(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(Array.isArray(n)&&n.length>0){const e=o("["+n.join(" > ")+"]");t?s.push(i(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(g){const e=o((Array.isArray(n)&&n.length>0?". ":" ")+"["+(this._styles.underline.prefix?_(g):g)+"] ");t?s.push(i(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(v!==O&&s.push(v),w&&s.push(...w),P&&s.push(P,`
2
2
 
3
3
  `),m){const e=o(this._styles.underline.suffix?_(m):m);t?s.push(i(`
4
4
  `+e[0],e.slice(1))):s.push([`
5
- `+e[0],...e.slice(1)])}if(t)x(...s);else{let e="";const l=[],p=[];for(const n of s)Array.isArray(n)&&n.length>1&&n[0].includes("%c")?(e+=n[0],l.push(...n.slice(1))):p.push(n);x(e+"%c",...l,"",...p)}}_formatLabel(r){let t=this._styles.uppercase.label?r.toUpperCase():r;return t=this._styles.underline.label?_(t):t,this._styles.bold.label&&(t=S(t)),t}}const K=J;export{V as JsonReporter,K as PrettyReporter};
5
+ `+e[0],...e.slice(1)])}if(t)x(...s);else{let e="";const l=[],p=[];for(const c of s)Array.isArray(c)&&c.length>1&&c[0].includes("%c")?(e+=c[0],l.push(...c.slice(1))):p.push(c);x(e+"%c",...l,"",...p)}}_formatLabel(r){let t=this._styles.uppercase.label?r.toUpperCase():r;return t=this._styles.underline.label?_(t):t,this._styles.bold.label&&(t=S(t)),t}}const K=J;export{V as JsonReporter,K as PrettyReporter};
@@ -1,13 +1,13 @@
1
- "use strict";var B=Object.defineProperty;var a=(t,e)=>B(t,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("./shared/pail.BjvkVeLq.cjs"),m=require("node:process"),c=require("./shared/pail.CMrKHGku.cjs"),I=require("./shared/pail.D0U9y4qH.cjs"),i=require("@visulima/colorize"),S=require("@visulima/error"),O=require("@visulima/inspector"),q=require("./shared/pail.BtheZKQt.cjs"),J=a(t=>t&&typeof t=="object"&&"default"in t?t.default:t,"_interopDefaultCompat"),Y=J(i);var z=Object.defineProperty,V=a((t,e)=>z(t,"name",{value:e,configurable:!0}),"e");class W{static{a(this,"n")}static{V(this,"SafeStreamHandler")}#e=!0;#t;#r;constructor(e,r){this.#t=e,this.#r=r}write(e){this.writeStream(e)}end(...e){this.#t.end(...e)}get isReady(){return this.#e}writeStream(e){if(!this.#e){console.warn("Stream busy: "+this.#r+'. Write will be dropped: "'+e+'"');return}this.#e=!1,this.#t.on("error",r=>{throw r}),this.#t.on("drain",()=>{this.#e=!0}),this.#t.on("finish",()=>{this.#e=!0}),this.#e=this.#t.write(e,()=>{})}}var D=Object.defineProperty,G=a((t,e)=>D(t,"name",{value:e,configurable:!0}),"r$3");class H{static{a(this,"o")}static{G(this,"RotatingFileStream")}#e;#t;#r;#i;#s;constructor(e,r=!1,s={}){if(this.#e=e,this.#t=r,this.#i=s,!this.#t){try{this.#s=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.#r=this.#s(this.#e,s)}}write(e){let r=this.#r;this.#t&&(r=this.#s(this.#e,this.#i));const s=new W(r,this.#e);s.write(e),this.#t&&s.end()}end(){this.#r!==void 0&&this.#r.end()}}var K=Object.defineProperty,N=a((t,e)=>K(t,"name",{value:e,configurable:!0}),"r$2");class F{static{a(this,"AbstractFileReporter")}static{N(this,"AbstractFileReporter")}stream;constructor(e){const{filePath:r,writeImmediately:s=!1,...o}=e;this.stream=new H(r,s,o)}log(e){this.stream.write(this._formatMessage(e)+`
2
- `)}}var Q=Object.defineProperty,U=a((t,e)=>Q(t,"name",{value:e,configurable:!0}),"r$1");class X extends F{static{a(this,"f")}static{U(this,"JsonFileReporter")}#e;constructor(e){super({compress:"gzip",interval:"1d",size:"10M",...e})}setStringify(e){this.#e=e}_formatMessage(e){const{file:r,message:s,type:o,...h}=e;return h.label&&(h.label=h.label.trim()),r&&(h.file=r.name+":"+r.line+(r.column?":"+r.column:"")),s===j.EMPTY_SYMBOL?h.message=void 0:h.message=s,this.#e(h)}}const Z=X;var ee=Object.defineProperty,te=a((t,e)=>ee(t,"name",{value:e,configurable:!0}),"r");class re extends I.f{static{a(this,"a")}static{te(this,"JsonReporter")}#e;#t;constructor(){super(),this.#e=m.stdout,this.#t=m.stderr}setStdout(e){this.#e=e}setStderr(e){this.#t=e}_log(e,r){const s=["error","warn"].includes(r)?this.#t:this.#e;c.n(e+`
3
- `,s)}}const se=re;var ie=Object.defineProperty,T=a((t,e)=>ie(t,"name",{value:e,configurable:!0}),"L");const R=T(t=>!/[\\/]pail[\\/]dist/.test(t),"pailFileFilter");class ne extends q.AbstractPrettyReporter{static{a(this,"ee")}static{T(this,"SimpleReporter")}#e;#t;#r;#i=!1;#s;#n;constructor(e={}){const{error:r,inspect:s,...o}=e;super({uppercase:{label:!0,...o.uppercase},...o}),this.#s={...c.u,indent:void 0,...s},this.#n={...r,color:{fileLine:i.green,hint:i.cyan,marker:i.red,message:i.red,method:i.greenBright,title:i.red}},this.#e=m.stdout,this.#t=m.stderr}setStdout(e){this.#e=e}setStderr(e){this.#t=e}setInteractiveManager(e){this.#r=e}setIsInteractive(e){this.#i=e}log(e){this._log(this._formatMessage(e),e.type.level)}_formatMessage(e){const{columns:r}=c.terminalSize();let s=r;typeof this._styles.messageLength=="number"&&(s=this._styles.messageLength);const{badge:o,context:h,date:d,error:M,file:g,groups:y,label:b,message:f,prefix:v,repeated:x,scope:w,suffix:_,traceError:E,type:k}=e,{color:P}=this._loggerTypes[k.name],$=P?Y[P]:i.white,p=y.map(()=>" ").join(""),n=[];if(y.length>0&&n.push(p+i.grey("["+y.at(-1)+"]")+" "),d&&n.push(i.grey(this._styles.dateFormatter(typeof d=="string"?new Date(d):d))+" "),o)n.push(i.bold($(o)));else{const l=q.s(this._loggerTypes);l.length>0&&n.push(i.grey(" ".repeat(l.length)))}const L=j.s(this._loggerTypes);b?n.push(i.bold($(c.n$1(b,this._styles)))+" "," ".repeat(L.length-c.stringLength(b))):n.push(" ".repeat(L.length+1)),x&&n.push(i.bgGrey.white("["+x+"x]")+" "),Array.isArray(w)&&w.length>0&&n.push(i.grey("["+w.join(" > ")+"]")+" "),v&&n.push(i.grey("["+(this._styles.underline.prefix?i.underline(v):v)+"]")+" ");const A=c.stringLength(n.join(""));if(f!==j.EMPTY_SYMBOL){const l=typeof f=="string"?f:O.inspect(f,this.#s);n.push(p+c.wrapAnsi(l,s-3,{hard:!0,trim:!1,wordWrap:!0}))}if(h){let l=!1;n.push(...h.map(u=>{if(u instanceof Error)return l=!0,`
1
+ "use strict";var I=Object.defineProperty;var o=(t,e)=>I(t,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./shared/pail.DHp7NF7R.cjs"),f=require("node:process"),l=require("./shared/pail.akgEzola.cjs"),r=require("@visulima/colorize"),S=require("@visulima/error"),L=require("@visulima/inspector"),k=require("./shared/pail.BjvkVeLq.cjs"),O=require("./shared/pail.BtheZKQt.cjs"),z=o(t=>t&&typeof t=="object"&&"default"in t?t.default:t,"_interopDefaultCompat"),A=z(r);var B=Object.defineProperty,V=o((t,e)=>B(t,"name",{value:e,configurable:!0}),"e");class W{static{o(this,"n")}static{V(this,"SafeStreamHandler")}#e=!0;#t;#r;constructor(e,s){this.#t=e,this.#r=s}write(e){this.writeStream(e)}end(...e){this.#t.end(...e)}get isReady(){return this.#e}writeStream(e){if(!this.#e){console.warn("Stream busy: "+this.#r+'. Write will be dropped: "'+e+'"');return}this.#e=!1,this.#t.on("error",s=>{throw s}),this.#t.on("drain",()=>{this.#e=!0}),this.#t.on("finish",()=>{this.#e=!0}),this.#e=this.#t.write(e,()=>{})}}var Y=Object.defineProperty,D=o((t,e)=>Y(t,"name",{value:e,configurable:!0}),"r$2");class G{static{o(this,"o")}static{D(this,"RotatingFileStream")}#e;#t;#r;#i;#s;constructor(e,s=!1,i={}){if(this.#e=e,this.#t=s,this.#i=i,!this.#t){try{this.#s=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.#r=this.#s(this.#e,i)}}write(e){let s=this.#r;this.#t&&(s=this.#s(this.#e,this.#i));const i=new W(s,this.#e);i.write(e),this.#t&&i.end()}end(){this.#r!==void 0&&this.#r.end()}}var H=Object.defineProperty,K=o((t,e)=>H(t,"name",{value:e,configurable:!0}),"r$1");class N extends T.p{static{o(this,"JsonFileReporter")}static{K(this,"JsonFileReporter")}stream;constructor(e){super();const{filePath:s,writeImmediately:i=!1,...a}=e;this.stream=new G(s,i,{compress:"gzip",interval:"1d",size:"10M",...a})}_log(e){this.stream.write(e+`
2
+ `)}}var Q=Object.defineProperty,U=o((t,e)=>Q(t,"name",{value:e,configurable:!0}),"r");class X extends T.p{static{o(this,"a")}static{U(this,"JsonReporter")}#e;#t;constructor(){super(),this.#e=f.stdout,this.#t=f.stderr}setStdout(e){this.#e=e}setStderr(e){this.#t=e}_log(e,s){const i=["error","warn"].includes(s)?this.#t:this.#e;l.n(e+`
3
+ `,i)}}const Z=X;var ee=Object.defineProperty,F=o((t,e)=>ee(t,"name",{value:e,configurable:!0}),"L");const _=F(t=>!/[\\/]pail[\\/]dist/.test(t),"pailFileFilter");class te extends O.AbstractPrettyReporter{static{o(this,"SimpleReporter")}static{F(this,"SimpleReporter")}#e;#t;#r;#i=!1;#s;#n;constructor(e={}){const{error:s,inspect:i,...a}=e;super({uppercase:{label:!0,...a.uppercase},...a}),this.#s={...l.u,indent:void 0,...i},this.#n={...s,color:{fileLine:r.green,hint:r.cyan,marker:r.red,message:r.red,method:r.greenBright,title:r.red}},this.#e=f.stdout,this.#t=f.stderr}setStdout(e){this.#e=e}setStderr(e){this.#t=e}setInteractiveManager(e){this.#r=e}setIsInteractive(e){this.#i=e}log(e){this._log(this._formatMessage(e),e.type.level)}_formatMessage(e){const{columns:s}=l.terminalSize();let i=s;typeof this._styles.messageLength=="number"&&(i=this._styles.messageLength);const{badge:a,context:R,date:u,error:j,file:d,groups:y,label:m,message:g,prefix:b,repeated:x,scope:v,suffix:w,traceError:E,type:C}=e,{color:P}=this._loggerTypes[C.name],M=P?A[P]:r.white,c=y.map(()=>" ").join(""),n=[];if(y.length>0&&n.push(c+r.grey("["+y.at(-1)+"]")+" "),u&&n.push(r.grey(this._styles.dateFormatter(typeof u=="string"?new Date(u):u))+" "),a)n.push(r.bold(M(a)));else{const h=O.s(this._loggerTypes);h.length>0&&n.push(r.grey(" ".repeat(h.length)))}const q=k.s(this._loggerTypes);m?n.push(r.bold(M(l.n$1(m,this._styles)))+" "," ".repeat(q.length-l.stringLength(m))):n.push(" ".repeat(q.length+1)),x&&n.push(r.bgGrey.white("["+x+"x]")+" "),Array.isArray(v)&&v.length>0&&n.push(r.grey("["+v.join(" > ")+"]")+" "),b&&n.push(r.grey("["+(this._styles.underline.prefix?r.underline(b):b)+"]")+" ");const J=l.stringLength(n.join(""));if(g!==k.EMPTY_SYMBOL){const h=typeof g=="string"?g:L.inspect(g,this.#s);n.push(c+l.wrapAnsi(h,i-3,{hard:!0,trim:!1,wordWrap:!0}))}if(R){let h=!1;n.push(...R.map(p=>{if(p instanceof Error)return h=!0,`
4
4
 
5
- `+S.renderError(u,{...this.#n,filterStacktrace:R,prefix:p});if(typeof u=="object")return" "+O.inspect(u,this.#s);const C=(l?`
5
+ `+S.renderError(p,{...this.#n,filterStacktrace:_,prefix:c});if(typeof p=="object")return" "+L.inspect(p,this.#s);const $=(h?`
6
6
 
7
- `:" ")+u;return l=!1,C}))}if(M&&n.push(S.renderError(M,{...this.#n,filterStacktrace:R,prefix:p})),E&&n.push(`
7
+ `:" ")+p;return h=!1,$}))}if(j&&n.push(S.renderError(j,{...this.#n,filterStacktrace:_,prefix:c})),E&&n.push(`
8
8
 
9
- `+S.renderError(E,{...this.#n,filterStacktrace:R,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:p})),_&&n.push(" "+p+i.grey(this._styles.underline.suffix?i.underline(_):_)),g){const l=g.name+(g.line?":"+g.line:"");n.push(`
10
- `,i.grey("Caller: ")," ".repeat(A-8),l,`
11
- `)}return n.join("")}_log(e,r){const s=["error","trace","warn"].includes(r)?"stderr":"stdout",o=s==="stderr"?this.#t:this.#e;this.#i&&this.#r!==void 0&&o.isTTY?this.#r.update(s,e.split(`
12
- `),0):c.n(e+`
13
- `,o)}}const ae=ne;exports.PrettyReporter=c.a;exports.AbstractFileReporter=F;exports.JsonFileReporter=Z;exports.JsonReporter=se;exports.SimpleReporter=ae;
9
+ `+S.renderError(E,{...this.#n,filterStacktrace:_,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:c})),w&&n.push(" "+c+r.grey(this._styles.underline.suffix?r.underline(w):w)),d){const h=d.name+(d.line?":"+d.line:"");n.push(`
10
+ `,r.grey("Caller: ")," ".repeat(J-8),h,`
11
+ `)}return n.join("")}_log(e,s){const i=["error","trace","warn"].includes(s)?"stderr":"stdout",a=i==="stderr"?this.#t:this.#e;this.#i&&this.#r!==void 0&&a.isTTY?this.#r.update(i,e.split(`
12
+ `),0):l.n(e+`
13
+ `,a)}}exports.PrettyReporter=l.PrettyReporter;exports.JsonFileReporter=N;exports.JsonReporter=Z;exports.SimpleReporter=te;
@@ -1,34 +1,27 @@
1
- import { Options as Options$1 } from 'rotating-file-stream';
2
- import { R as Reporter, g as ReadonlyMeta, S as StreamAwareReporter, e as LiteralUnion, E as ExtendedRfc5424LogLevels, i as InteractiveStreamReporter, I as InteractiveManager } from './shared/pail.BGWAKixQ.cjs';
3
- import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.Cmk6qgN4.cjs';
4
- import { RenderErrorOptions } from '@visulima/error';
5
- import { Options as Options$2 } from '@visulima/inspector';
6
- import '@visulima/colorize';
1
+ import { Options } from 'rotating-file-stream';
2
+ import { A as AbstractJsonReporter, P as PrettyStyleOptions, a as AbstractPrettyReporter } from './shared/pail.Cmk6qgN4.cjs';
3
+ import { S as StreamAwareReporter, e as LiteralUnion, E as ExtendedRfc5424LogLevels, i as InteractiveStreamReporter, I as InteractiveManager, g as ReadonlyMeta } from './shared/pail.BGWAKixQ.cjs';
4
+ import { RenderErrorOptions } from '@visulima/error/error';
5
+ import { Options as Options$1 } from '@visulima/inspector';
6
+ import { RenderErrorOptions as RenderErrorOptions$1 } from '@visulima/error';
7
7
  import 'safe-stable-stringify';
8
+ import '@visulima/colorize';
8
9
 
9
10
  declare class RotatingFileStream {
10
11
  #private;
11
- constructor(filePath: string, writeImmediately?: boolean, options?: Options$1);
12
+ constructor(filePath: string, writeImmediately?: boolean, options?: Options);
12
13
  write(message: string): void;
13
14
  end(): void;
14
15
  }
15
16
 
16
- type Options = Options$1 & {
17
+ type FileReporterOptions = Options & {
17
18
  filePath: string;
18
19
  writeImmediately?: boolean;
19
20
  };
20
- declare abstract class AbstractFileReporter<L extends string = string> implements Reporter<L> {
21
+ declare class JsonFileReporter<L extends string = string> extends AbstractJsonReporter<L> {
21
22
  protected stream: RotatingFileStream;
22
- protected constructor(options: Options);
23
- log(meta: ReadonlyMeta<L>): void;
24
- protected abstract _formatMessage(data: ReadonlyMeta<L>): string;
25
- }
26
-
27
- declare class JsonFileReporter<L extends string = string> extends AbstractFileReporter<L> {
28
- #private;
29
- constructor(options: Options);
30
- setStringify(function_: any): void;
31
- protected _formatMessage(meta: ReadonlyMeta<L>): string;
23
+ constructor(options: FileReporterOptions);
24
+ protected _log(message: string): void;
32
25
  }
33
26
 
34
27
  declare class JsonReporter<L extends string = string> extends AbstractJsonReporter<L> implements StreamAwareReporter<L> {
@@ -39,13 +32,13 @@ declare class JsonReporter<L extends string = string> extends AbstractJsonReport
39
32
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
40
33
  }
41
34
 
42
- type PrettyReporterOptions$1 = PrettyStyleOptions & {
35
+ type PrettyReporterOptions = PrettyStyleOptions & {
43
36
  error: Omit<RenderErrorOptions, "color | prefix | indentation">;
44
- inspect: Options$2;
37
+ inspect: Options$1;
45
38
  };
46
39
  declare class PrettyReporter<T extends string = string, L extends string = string> extends AbstractPrettyReporter<T, L> implements InteractiveStreamReporter<L> {
47
40
  #private;
48
- constructor(options?: Partial<PrettyReporterOptions$1>);
41
+ constructor(options?: Partial<PrettyReporterOptions>);
49
42
  setStdout(stdout_: NodeJS.WriteStream): void;
50
43
  setStderr(stderr_: NodeJS.WriteStream): void;
51
44
  setInteractiveManager(manager?: InteractiveManager): void;
@@ -55,13 +48,13 @@ declare class PrettyReporter<T extends string = string, L extends string = strin
55
48
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
56
49
  }
57
50
 
58
- type PrettyReporterOptions = PrettyStyleOptions & {
59
- error: Omit<RenderErrorOptions, "color | prefix | indentation">;
60
- inspect: Options$2;
51
+ type SimpleReporterOptions = PrettyStyleOptions & {
52
+ error: Omit<RenderErrorOptions$1, "color | prefix | indentation">;
53
+ inspect: Options$1;
61
54
  };
62
55
  declare class SimpleReporter<T extends string = string, L extends string = string> extends AbstractPrettyReporter<T, L> implements InteractiveStreamReporter<L> {
63
56
  #private;
64
- constructor(options?: Partial<PrettyReporterOptions>);
57
+ constructor(options?: Partial<SimpleReporterOptions>);
65
58
  setStdout(stdout_: NodeJS.WriteStream): void;
66
59
  setStderr(stderr_: NodeJS.WriteStream): void;
67
60
  setInteractiveManager(manager?: InteractiveManager): void;
@@ -71,4 +64,4 @@ declare class SimpleReporter<T extends string = string, L extends string = strin
71
64
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
72
65
  }
73
66
 
74
- export { AbstractFileReporter, type Options as AbstractFileReporterOptions, JsonFileReporter, JsonReporter, PrettyReporter, SimpleReporter };
67
+ export { type FileReporterOptions, JsonFileReporter, JsonReporter, PrettyReporter, type PrettyReporterOptions, SimpleReporter, type SimpleReporterOptions };
@@ -1,34 +1,27 @@
1
- import { Options as Options$1 } from 'rotating-file-stream';
2
- import { R as Reporter, g as ReadonlyMeta, S as StreamAwareReporter, e as LiteralUnion, E as ExtendedRfc5424LogLevels, i as InteractiveStreamReporter, I as InteractiveManager } from './shared/pail.BGWAKixQ.mjs';
3
- import { A as AbstractJsonReporter, a as AbstractPrettyReporter, P as PrettyStyleOptions } from './shared/pail.BD_y_CiZ.mjs';
4
- import { RenderErrorOptions } from '@visulima/error';
5
- import { Options as Options$2 } from '@visulima/inspector';
6
- import '@visulima/colorize';
1
+ import { Options } from 'rotating-file-stream';
2
+ import { A as AbstractJsonReporter, P as PrettyStyleOptions, a as AbstractPrettyReporter } from './shared/pail.BD_y_CiZ.mjs';
3
+ import { S as StreamAwareReporter, e as LiteralUnion, E as ExtendedRfc5424LogLevels, i as InteractiveStreamReporter, I as InteractiveManager, g as ReadonlyMeta } from './shared/pail.BGWAKixQ.mjs';
4
+ import { RenderErrorOptions } from '@visulima/error/error';
5
+ import { Options as Options$1 } from '@visulima/inspector';
6
+ import { RenderErrorOptions as RenderErrorOptions$1 } from '@visulima/error';
7
7
  import 'safe-stable-stringify';
8
+ import '@visulima/colorize';
8
9
 
9
10
  declare class RotatingFileStream {
10
11
  #private;
11
- constructor(filePath: string, writeImmediately?: boolean, options?: Options$1);
12
+ constructor(filePath: string, writeImmediately?: boolean, options?: Options);
12
13
  write(message: string): void;
13
14
  end(): void;
14
15
  }
15
16
 
16
- type Options = Options$1 & {
17
+ type FileReporterOptions = Options & {
17
18
  filePath: string;
18
19
  writeImmediately?: boolean;
19
20
  };
20
- declare abstract class AbstractFileReporter<L extends string = string> implements Reporter<L> {
21
+ declare class JsonFileReporter<L extends string = string> extends AbstractJsonReporter<L> {
21
22
  protected stream: RotatingFileStream;
22
- protected constructor(options: Options);
23
- log(meta: ReadonlyMeta<L>): void;
24
- protected abstract _formatMessage(data: ReadonlyMeta<L>): string;
25
- }
26
-
27
- declare class JsonFileReporter<L extends string = string> extends AbstractFileReporter<L> {
28
- #private;
29
- constructor(options: Options);
30
- setStringify(function_: any): void;
31
- protected _formatMessage(meta: ReadonlyMeta<L>): string;
23
+ constructor(options: FileReporterOptions);
24
+ protected _log(message: string): void;
32
25
  }
33
26
 
34
27
  declare class JsonReporter<L extends string = string> extends AbstractJsonReporter<L> implements StreamAwareReporter<L> {
@@ -39,13 +32,13 @@ declare class JsonReporter<L extends string = string> extends AbstractJsonReport
39
32
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
40
33
  }
41
34
 
42
- type PrettyReporterOptions$1 = PrettyStyleOptions & {
35
+ type PrettyReporterOptions = PrettyStyleOptions & {
43
36
  error: Omit<RenderErrorOptions, "color | prefix | indentation">;
44
- inspect: Options$2;
37
+ inspect: Options$1;
45
38
  };
46
39
  declare class PrettyReporter<T extends string = string, L extends string = string> extends AbstractPrettyReporter<T, L> implements InteractiveStreamReporter<L> {
47
40
  #private;
48
- constructor(options?: Partial<PrettyReporterOptions$1>);
41
+ constructor(options?: Partial<PrettyReporterOptions>);
49
42
  setStdout(stdout_: NodeJS.WriteStream): void;
50
43
  setStderr(stderr_: NodeJS.WriteStream): void;
51
44
  setInteractiveManager(manager?: InteractiveManager): void;
@@ -55,13 +48,13 @@ declare class PrettyReporter<T extends string = string, L extends string = strin
55
48
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
56
49
  }
57
50
 
58
- type PrettyReporterOptions = PrettyStyleOptions & {
59
- error: Omit<RenderErrorOptions, "color | prefix | indentation">;
60
- inspect: Options$2;
51
+ type SimpleReporterOptions = PrettyStyleOptions & {
52
+ error: Omit<RenderErrorOptions$1, "color | prefix | indentation">;
53
+ inspect: Options$1;
61
54
  };
62
55
  declare class SimpleReporter<T extends string = string, L extends string = string> extends AbstractPrettyReporter<T, L> implements InteractiveStreamReporter<L> {
63
56
  #private;
64
- constructor(options?: Partial<PrettyReporterOptions>);
57
+ constructor(options?: Partial<SimpleReporterOptions>);
65
58
  setStdout(stdout_: NodeJS.WriteStream): void;
66
59
  setStderr(stderr_: NodeJS.WriteStream): void;
67
60
  setInteractiveManager(manager?: InteractiveManager): void;
@@ -71,4 +64,4 @@ declare class SimpleReporter<T extends string = string, L extends string = strin
71
64
  protected _log(message: string, logLevel: LiteralUnion<ExtendedRfc5424LogLevels, L>): void;
72
65
  }
73
66
 
74
- export { AbstractFileReporter, type Options as AbstractFileReporterOptions, JsonFileReporter, JsonReporter, PrettyReporter, SimpleReporter };
67
+ export { type FileReporterOptions, JsonFileReporter, JsonReporter, PrettyReporter, type PrettyReporterOptions, SimpleReporter, type SimpleReporterOptions };