@visulima/pail 2.1.31 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/LICENSE.md +910 -209
- package/README.md +216 -8
- package/dist/index.browser.d.ts +4 -4
- package/dist/index.browser.js +1 -0
- package/dist/index.server.d.ts +74 -8
- package/dist/index.server.js +5 -0
- package/dist/packem_shared/AbstractJsonReporter-UftN6CIL.js +1 -0
- package/dist/packem_shared/JsonReporter-Bb6YuCj2.js +2 -0
- package/dist/packem_shared/JsonReporter-Dl4m0xZe.js +1 -0
- package/dist/packem_shared/PrettyReporter-CGKSTI7X.js +5 -0
- package/dist/packem_shared/PrettyReporter-CREln5bH.js +12 -0
- package/dist/packem_shared/abstract-json-reporter-wUti0B3k.d.ts +22 -0
- package/dist/packem_shared/abstract-pretty-reporter-CUtSm20r.js +1 -0
- package/dist/packem_shared/abstract-pretty-reporter-MOYolfGR.d.ts +28 -0
- package/dist/packem_shared/{constants-BMS51p6Y.mjs → constants-DKfCaSUR.js} +1 -1
- package/dist/packem_shared/format-label-DqvZRRR6.js +33 -0
- package/dist/packem_shared/getBarChar-mKDZW32R.js +1 -0
- package/dist/packem_shared/index-D9hWq9ka.js +1 -0
- package/dist/packem_shared/index.d-BR1GjZri.d.ts +53 -0
- package/dist/packem_shared/index.d-oxZvg_y7.d.ts +20 -0
- package/dist/packem_shared/pail.browser-BmHoDvEA.js +19 -0
- package/dist/packem_shared/{pail.browser-CaPhlNua.d.ts → pail.browser-Bs2ng_Qj.d.ts} +12 -8
- package/dist/packem_shared/{types-CMdBdNgA.d.cts → types-RidvA4RN.d.ts} +2 -3
- package/dist/{processor.server.d.ts → processor/caller/caller-processor.d.ts} +2 -5
- package/dist/processor/caller/caller-processor.js +1 -0
- package/dist/processor/message-formatter-processor.d.ts +16 -0
- package/dist/processor/message-formatter-processor.js +1 -0
- package/dist/processor/redact-processor.d.ts +12 -0
- package/dist/processor/redact-processor.js +1 -0
- package/dist/reporter/file/json-file-reporter.d.ts +26 -0
- package/dist/{packem_shared/JsonFileReporter-raQZY3Ci.mjs → reporter/file/json-file-reporter.js} +1 -1
- package/dist/reporter/json/index.browser.d.ts +12 -0
- package/dist/reporter/json/index.browser.js +1 -0
- package/dist/reporter/json/index.d.ts +15 -0
- package/dist/reporter/json/index.js +1 -0
- package/dist/reporter/pretty/index.browser.d.ts +12 -0
- package/dist/reporter/pretty/index.browser.js +1 -0
- package/dist/reporter/pretty/index.d.ts +24 -0
- package/dist/reporter/pretty/index.js +1 -0
- package/dist/reporter/simple/simple-reporter.server.d.ts +23 -0
- package/dist/reporter/simple/simple-reporter.server.js +11 -0
- package/package.json +36 -124
- package/dist/index.browser.cjs +0 -1
- package/dist/index.browser.d.cts +0 -11
- package/dist/index.browser.d.mts +0 -11
- package/dist/index.browser.mjs +0 -1
- package/dist/index.server.cjs +0 -5
- package/dist/index.server.d.cts +0 -32
- package/dist/index.server.d.mts +0 -32
- package/dist/index.server.mjs +0 -5
- package/dist/packem_shared/CallerProcessor-DJnmMPMj.cjs +0 -1
- package/dist/packem_shared/CallerProcessor-mNkBei3j.mjs +0 -1
- package/dist/packem_shared/JsonFileReporter-B7cJWaL5.cjs +0 -2
- package/dist/packem_shared/JsonReporter-0IxBO0rl.mjs +0 -2
- package/dist/packem_shared/JsonReporter-CRzHu5q7.mjs +0 -1
- package/dist/packem_shared/JsonReporter-DZvKFDz6.cjs +0 -2
- package/dist/packem_shared/JsonReporter-U9kk2_gT.cjs +0 -1
- package/dist/packem_shared/MessageFormatterProcessor-D_s8r8ot.cjs +0 -1
- package/dist/packem_shared/MessageFormatterProcessor-rkvAy05-.mjs +0 -1
- package/dist/packem_shared/PrettyReporter-1aoZvU3r.mjs +0 -5
- package/dist/packem_shared/PrettyReporter-BSm1ACaz.cjs +0 -13
- package/dist/packem_shared/PrettyReporter-C0Qa7g8i.mjs +0 -13
- package/dist/packem_shared/PrettyReporter-CklpEjI1.cjs +0 -5
- package/dist/packem_shared/RedactProcessor-BBJysXaX.cjs +0 -1
- package/dist/packem_shared/RedactProcessor-CxKTN42V.mjs +0 -3
- package/dist/packem_shared/SimpleReporter-BajPeBDy.mjs +0 -11
- package/dist/packem_shared/SimpleReporter-DiFOEIps.cjs +0 -11
- package/dist/packem_shared/abstract-json-reporter-B_QC6gt7.mjs +0 -1
- package/dist/packem_shared/abstract-json-reporter-C1jqd5bO.cjs +0 -1
- package/dist/packem_shared/abstract-pretty-reporter-C2vDqWAQ.cjs +0 -1
- package/dist/packem_shared/abstract-pretty-reporter-C5UVAUaP.d.cts +0 -45
- package/dist/packem_shared/abstract-pretty-reporter-CDuO-IFk.d.ts +0 -45
- package/dist/packem_shared/abstract-pretty-reporter-CRcf4WZd.mjs +0 -1
- package/dist/packem_shared/abstract-pretty-reporter-Ckmv6CnU.d.mts +0 -45
- package/dist/packem_shared/constants-BFrKdBPm.cjs +0 -1
- package/dist/packem_shared/format-label-B496HVjo.mjs +0 -8
- package/dist/packem_shared/format-label-BkRisUmO.cjs +0 -8
- package/dist/packem_shared/get-longest-label-7LkwzzHo.cjs +0 -1
- package/dist/packem_shared/pail.browser-2KlA4DJS.d.cts +0 -60
- package/dist/packem_shared/pail.browser-B9eJPHAe.d.mts +0 -60
- package/dist/packem_shared/pail.browser-Di9_5Zcq.mjs +0 -1
- package/dist/packem_shared/pail.browser-vVxBu_Xl.cjs +0 -1
- package/dist/packem_shared/types-CMdBdNgA.d.mts +0 -123
- package/dist/packem_shared/types-CMdBdNgA.d.ts +0 -123
- package/dist/packem_shared/write-console-log-3G15muTS.cjs +0 -1
- package/dist/packem_shared/write-stream-Dl-usQqh.cjs +0 -1
- package/dist/processor.browser.cjs +0 -1
- package/dist/processor.browser.d.cts +0 -23
- package/dist/processor.browser.d.mts +0 -23
- package/dist/processor.browser.d.ts +0 -23
- package/dist/processor.browser.mjs +0 -1
- package/dist/processor.server.cjs +0 -1
- package/dist/processor.server.d.cts +0 -23
- package/dist/processor.server.d.mts +0 -23
- package/dist/processor.server.mjs +0 -1
- package/dist/reporter.browser.cjs +0 -1
- package/dist/reporter.browser.d.cts +0 -18
- package/dist/reporter.browser.d.mts +0 -18
- package/dist/reporter.browser.d.ts +0 -18
- package/dist/reporter.browser.mjs +0 -1
- package/dist/reporter.server.cjs +0 -1
- package/dist/reporter.server.d.cts +0 -69
- package/dist/reporter.server.d.mts +0 -69
- package/dist/reporter.server.d.ts +0 -69
- package/dist/reporter.server.mjs +0 -1
- /package/dist/packem_shared/{get-longest-label-B0NrI-o2.mjs → get-longest-label-B0NrI-o2.js} +0 -0
- /package/dist/packem_shared/{write-console-log-BP95fgQZ.mjs → write-console-log-based-on-level-BP95fgQZ.js} +0 -0
- /package/dist/packem_shared/{write-stream-CD8XFv1L.mjs → write-stream-CD8XFv1L.js} +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { O as Options$1, a as Options } from '../../packem_shared/index.d-BR1GjZri.js';
|
|
2
|
+
import { i as InteractiveStreamReporter, I as InteractiveManager, h as ReadonlyMeta } from '../../packem_shared/types-RidvA4RN.js';
|
|
3
|
+
import { P as PrettyStyleOptions, A as AbstractPrettyReporter } from '../../packem_shared/abstract-pretty-reporter-MOYolfGR.js';
|
|
4
|
+
import 'type-fest';
|
|
5
|
+
import '@visulima/colorize';
|
|
6
|
+
|
|
7
|
+
type SimpleReporterOptions = PrettyStyleOptions & {
|
|
8
|
+
error: Partial<Omit<Options$1, "color | prefix | indentation">>;
|
|
9
|
+
inspect: Partial<Options>;
|
|
10
|
+
};
|
|
11
|
+
declare class SimpleReporter<T extends string = string, L extends string = string> extends AbstractPrettyReporter<T, L> implements InteractiveStreamReporter<L> {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(options?: Partial<SimpleReporterOptions>);
|
|
14
|
+
setStdout(stdout_: NodeJS.WriteStream): void;
|
|
15
|
+
setStderr(stderr_: NodeJS.WriteStream): void;
|
|
16
|
+
setInteractiveManager(manager?: InteractiveManager): void;
|
|
17
|
+
setIsInteractive(interactive: boolean): void;
|
|
18
|
+
log(meta: ReadonlyMeta<L>): void;
|
|
19
|
+
protected formatMessage(data: ReadonlyMeta<L>): string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { SimpleReporter };
|
|
23
|
+
export type { SimpleReporterOptions };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var q=Object.defineProperty;var _=(a,e)=>q(a,"name",{value:e,configurable:!0});import{createRequire as F}from"node:module";import G,{red as x,greenBright as z,cyan as H,green as N,grey as o,bold as B,white as W,bgGrey as J,underline as R}from"@visulima/colorize";import{u as K,O as Q,o as d,n as U,a as I,i as X,B as Z,G as T}from"../../packem_shared/format-label-DqvZRRR6.js";import{E as ee}from"../../packem_shared/constants-DKfCaSUR.js";import{A as te,s as re}from"../../packem_shared/abstract-pretty-reporter-CUtSm20r.js";import{s as se}from"../../packem_shared/get-longest-label-B0NrI-o2.js";import{n as ie}from"../../packem_shared/write-stream-CD8XFv1L.js";const pe=F(import.meta.url),V=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process;const{stdout:Y,stderr:D}=V;var oe=Object.defineProperty,k=_((a,e)=>oe(a,"name",{value:e,configurable:!0}),"b");const j=k(a=>!/[\\/]pail[\\/]dist/.test(a),"pailFileFilter");class me extends te{static{_(this,"SimpleReporter")}static{k(this,"SimpleReporter")}#t;#r;#s;#o=!1;#i;#e;constructor(e={}){const{error:n,inspect:p,...i}=e;super({uppercase:{label:!0,...i.uppercase},...i}),this.#i={...K,indent:void 0,...p},this.#e={...n,color:{fileLine:N,hint:H,marker:x,message:x,method:z,title:x}},this.#t=Y,this.#r=D}setStdout(e){this.#t=e}setStderr(e){this.#r=e}setInteractiveManager(e){this.#s=e}setIsInteractive(e){this.#o=e}log(e){const n=this.formatMessage(e),p=e.type.level,i=["error","trace","warn"].includes(p)?"stderr":"stdout",h=i==="stderr"?this.#r:this.#t;this.#o&&this.#s!==void 0&&h.isTTY?this.#s.update(i,n.split(`
|
|
2
|
+
`),0):ie(`${n}
|
|
3
|
+
`,h)}formatMessage(e){const{columns:n}=Q();let p=n;typeof this.styles.messageLength=="number"&&(p=this.styles.messageLength);const{badge:i,context:h,date:u,error:v,file:c,groups:m,label:g,message:f,prefix:y,repeated:M,scope:$,suffix:b,traceError:S,type:A}=e,{color:w}=this.loggerTypes[A.name],E=w?G[w]:W,l=m.map(()=>" ").join(""),t=[];if(m.length>0&&t.push(`${l+o(`[${m.at(-1)}]`)} `),u&&t.push(`${o(this.styles.dateFormatter(typeof u=="string"?new Date(u):u))} `),i)t.push(B(E(i)));else{const r=re(this.loggerTypes);r.length>0&&t.push(o(" ".repeat(r.length)))}const L=se(this.loggerTypes),C=d(L);if(g){const r=d(g),s=Math.max(0,C-r);t.push(`${B(E(U(g,this.styles)))} `," ".repeat(s))}else t.push(" ".repeat(C+1));M&&t.push(`${J.white(`[${M}x]`)} `),Array.isArray($)&&$.length>0&&t.push(`${o(`[${$.join(" > ")}]`)} `),y&&t.push(`${o(`[${this.styles.underline.prefix?R(y):y}]`)} `);const O=d(t.join(""));if(f!==ee){const r=typeof f=="string"?f:I(f,this.#i);t.push(l+X(r,{trim:!1,width:p-3,wrapMode:Z.STRICT_WIDTH}))}if(h){let r=!1;t.push(...h.map(s=>{if(s instanceof Error)return r=!0,`
|
|
4
|
+
|
|
5
|
+
${T(s,{...this.#e,filterStacktrace:j,prefix:l})}`;if(typeof s=="object")return` ${I(s,this.#i)}`;const P=(r?`
|
|
6
|
+
|
|
7
|
+
`:" ")+s;return r=!1,P}))}if(v&&t.push(T(v,{...this.#e,filterStacktrace:j,prefix:l})),S&&t.push(`
|
|
8
|
+
|
|
9
|
+
${T(S,{...this.#e,filterStacktrace:j,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:l})}`),b&&t.push(` ${l}${o(this.styles.underline.suffix?R(b):b)}`),c){const r=c.name+(c.line?`:${c.line}`:""),s=Math.max(0,O-d("Caller: "));t.push(`
|
|
10
|
+
`,o("Caller: ")," ".repeat(s),r,`
|
|
11
|
+
`)}return t.join("")}}export{me as SimpleReporter};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/pail",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Highly configurable Logger for Node.js, Edge and Browser.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ansi",
|
|
@@ -84,140 +84,56 @@
|
|
|
84
84
|
"type": "module",
|
|
85
85
|
"exports": {
|
|
86
86
|
".": {
|
|
87
|
-
"browser": "./dist/index.browser.
|
|
87
|
+
"browser": "./dist/index.browser.js",
|
|
88
88
|
"import": {
|
|
89
|
-
"types": "./dist/index.server.d.
|
|
90
|
-
"default": "./dist/index.server.
|
|
91
|
-
},
|
|
92
|
-
"require": {
|
|
93
|
-
"types": "./dist/index.server.d.cts",
|
|
94
|
-
"default": "./dist/index.server.cjs"
|
|
89
|
+
"types": "./dist/index.server.d.ts",
|
|
90
|
+
"default": "./dist/index.server.js"
|
|
95
91
|
}
|
|
96
92
|
},
|
|
97
93
|
"./browser": {
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
"default": "./dist/index.browser.mjs"
|
|
101
|
-
},
|
|
102
|
-
"require": {
|
|
103
|
-
"types": "./dist/index.browser.d.cts",
|
|
104
|
-
"default": "./dist/index.browser.cjs"
|
|
105
|
-
}
|
|
94
|
+
"types": "./dist/index.browser.d.ts",
|
|
95
|
+
"default": "./dist/index.browser.js"
|
|
106
96
|
},
|
|
107
97
|
"./server": {
|
|
108
|
-
"
|
|
109
|
-
|
|
110
|
-
"default": "./dist/index.server.mjs"
|
|
111
|
-
},
|
|
112
|
-
"require": {
|
|
113
|
-
"types": "./dist/index.server.d.cts",
|
|
114
|
-
"default": "./dist/index.server.cjs"
|
|
115
|
-
}
|
|
98
|
+
"types": "./dist/index.server.d.ts",
|
|
99
|
+
"default": "./dist/index.server.js"
|
|
116
100
|
},
|
|
117
|
-
"./
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"types": "./dist/reporter.server.d.mts",
|
|
121
|
-
"default": "./dist/reporter.server.mjs"
|
|
122
|
-
},
|
|
123
|
-
"require": {
|
|
124
|
-
"types": "./dist/reporter.server.d.cts",
|
|
125
|
-
"default": "./dist/reporter.server.cjs"
|
|
126
|
-
}
|
|
101
|
+
"./processor/redact": {
|
|
102
|
+
"types": "./dist/processor/redact-processor.d.ts",
|
|
103
|
+
"default": "./dist/processor/redact-processor.js"
|
|
127
104
|
},
|
|
128
|
-
"./
|
|
129
|
-
"
|
|
130
|
-
|
|
131
|
-
"default": "./dist/reporter.server.mjs"
|
|
132
|
-
},
|
|
133
|
-
"require": {
|
|
134
|
-
"types": "./dist/reporter.server.d.cts",
|
|
135
|
-
"default": "./dist/reporter.server.cjs"
|
|
136
|
-
}
|
|
105
|
+
"./processor/message-formatter": {
|
|
106
|
+
"types": "./dist/processor/message-formatter-processor.d.ts",
|
|
107
|
+
"default": "./dist/processor/message-formatter-processor.js"
|
|
137
108
|
},
|
|
138
|
-
"./
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
"types": "./dist/reporter.browser.d.mts",
|
|
142
|
-
"default": "./dist/reporter.browser.mjs"
|
|
143
|
-
},
|
|
144
|
-
"require": {
|
|
145
|
-
"types": "./dist/reporter.browser.d.cts",
|
|
146
|
-
"default": "./dist/reporter.browser.cjs"
|
|
147
|
-
}
|
|
109
|
+
"./processor/caller": {
|
|
110
|
+
"types": "./dist/processor/caller/caller-processor.d.ts",
|
|
111
|
+
"default": "./dist/processor/caller/caller-processor.js"
|
|
148
112
|
},
|
|
149
|
-
"./
|
|
150
|
-
"
|
|
151
|
-
"
|
|
152
|
-
"types": "./dist/processor.server.d.mts",
|
|
153
|
-
"default": "./dist/processor.server.mjs"
|
|
154
|
-
},
|
|
155
|
-
"require": {
|
|
156
|
-
"types": "./dist/processor.server.d.cts",
|
|
157
|
-
"default": "./dist/processor.server.cjs"
|
|
158
|
-
}
|
|
113
|
+
"./reporter/file": {
|
|
114
|
+
"types": "./dist/reporter/file/json-file-reporter.d.ts",
|
|
115
|
+
"default": "./dist/reporter/file/json-file-reporter.js"
|
|
159
116
|
},
|
|
160
|
-
"./
|
|
117
|
+
"./reporter/json": {
|
|
118
|
+
"browser": "./dist/reporter/json/index.browser.js",
|
|
161
119
|
"import": {
|
|
162
|
-
"types": "./dist/
|
|
163
|
-
"default": "./dist/
|
|
164
|
-
},
|
|
165
|
-
"require": {
|
|
166
|
-
"types": "./dist/processor.server.d.cts",
|
|
167
|
-
"default": "./dist/processor.server.cjs"
|
|
120
|
+
"types": "./dist/reporter/json/index.d.ts",
|
|
121
|
+
"default": "./dist/reporter/json/index.js"
|
|
168
122
|
}
|
|
169
123
|
},
|
|
170
|
-
"./
|
|
171
|
-
"browser": "./dist/
|
|
124
|
+
"./reporter/pretty": {
|
|
125
|
+
"browser": "./dist/reporter/pretty/index.browser.js",
|
|
172
126
|
"import": {
|
|
173
|
-
"types": "./dist/
|
|
174
|
-
"default": "./dist/
|
|
175
|
-
},
|
|
176
|
-
"require": {
|
|
177
|
-
"types": "./dist/processor.browser.d.cts",
|
|
178
|
-
"default": "./dist/processor.browser.cjs"
|
|
127
|
+
"types": "./dist/reporter/pretty/index.d.ts",
|
|
128
|
+
"default": "./dist/reporter/pretty/index.js"
|
|
179
129
|
}
|
|
180
130
|
},
|
|
131
|
+
"./reporter/simple": {
|
|
132
|
+
"types": "./dist/reporter/simple/simple-reporter.server.d.ts",
|
|
133
|
+
"default": "./dist/reporter/simple/simple-reporter.server.js"
|
|
134
|
+
},
|
|
181
135
|
"./package.json": "./package.json"
|
|
182
136
|
},
|
|
183
|
-
"main": "dist/index.server.cjs",
|
|
184
|
-
"module": "dist/index.server.mjs",
|
|
185
|
-
"browser": "dist/index.browser.mjs",
|
|
186
|
-
"types": "dist/index.server.d.ts",
|
|
187
|
-
"typesVersions": {
|
|
188
|
-
">=5.0": {
|
|
189
|
-
".": [
|
|
190
|
-
"./dist/index.browser.d.ts",
|
|
191
|
-
"./dist/index.server.d.ts"
|
|
192
|
-
],
|
|
193
|
-
"browser": [
|
|
194
|
-
"./dist/index.browser.d.ts"
|
|
195
|
-
],
|
|
196
|
-
"server": [
|
|
197
|
-
"./dist/index.server.d.ts"
|
|
198
|
-
],
|
|
199
|
-
"reporter": [
|
|
200
|
-
"./dist/reporter.browser.d.ts",
|
|
201
|
-
"./dist/reporter.server.d.ts"
|
|
202
|
-
],
|
|
203
|
-
"browser/reporter": [
|
|
204
|
-
"./dist/reporter.browser.d.ts"
|
|
205
|
-
],
|
|
206
|
-
"server/reporter": [
|
|
207
|
-
"./dist/reporter.server.d.ts"
|
|
208
|
-
],
|
|
209
|
-
"processor": [
|
|
210
|
-
"./dist/processor.browser.d.ts",
|
|
211
|
-
"./dist/processor.server.d.ts"
|
|
212
|
-
],
|
|
213
|
-
"browser/processor": [
|
|
214
|
-
"./dist/processor.browser.d.ts"
|
|
215
|
-
],
|
|
216
|
-
"server/processor": [
|
|
217
|
-
"./dist/processor.server.d.ts"
|
|
218
|
-
]
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
137
|
"files": [
|
|
222
138
|
"dist/**",
|
|
223
139
|
"README.md",
|
|
@@ -225,16 +141,12 @@
|
|
|
225
141
|
"LICENSE.md"
|
|
226
142
|
],
|
|
227
143
|
"dependencies": {
|
|
228
|
-
"@visulima/colorize": "1.4.
|
|
229
|
-
"@visulima/error": "5.0.0",
|
|
230
|
-
"@visulima/fmt": "1.1.16",
|
|
231
|
-
"@visulima/inspector": "1.0.25",
|
|
232
|
-
"safe-stable-stringify": "^2.5.0",
|
|
144
|
+
"@visulima/colorize": "1.4.25",
|
|
233
145
|
"type-fest": "^5.1.0"
|
|
234
146
|
},
|
|
235
147
|
"peerDependencies": {
|
|
236
|
-
"@visulima/redact": "2.0.
|
|
237
|
-
"rotating-file-stream": "^3.
|
|
148
|
+
"@visulima/redact": "2.0.1",
|
|
149
|
+
"rotating-file-stream": "^3.2.7"
|
|
238
150
|
},
|
|
239
151
|
"peerDependenciesMeta": {
|
|
240
152
|
"@visulima/redact": {
|
|
@@ -245,7 +157,7 @@
|
|
|
245
157
|
}
|
|
246
158
|
},
|
|
247
159
|
"engines": {
|
|
248
|
-
"node": ">=
|
|
160
|
+
"node": ">=20.19 <=25.x"
|
|
249
161
|
},
|
|
250
162
|
"os": [
|
|
251
163
|
"darwin",
|
package/dist/index.browser.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var t=(e,r)=>o(e,"name",{value:r,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("./packem_shared/pail.browser-vVxBu_Xl.cjs"),i=require("./packem_shared/MessageFormatterProcessor-D_s8r8ot.cjs"),l=require("./packem_shared/JsonReporter-U9kk2_gT.cjs");var u=Object.defineProperty,c=t((e,r)=>u(e,"name",{value:r,configurable:!0}),"e");const a=c(e=>new s.P({processors:[new i],reporters:[new l],...e}),"createPail"),n=a();exports.createPail=a;exports.pail=n;
|
package/dist/index.browser.d.cts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { P as PailBrowserType } from './packem_shared/pail.browser-2KlA4DJS.cjs';
|
|
2
|
-
import { C as ConstructorOptions } from './packem_shared/types-CMdBdNgA.cjs';
|
|
3
|
-
export { a as DefaultLogTypes, D as DefaultLoggerTypes, E as ExtendedRfc5424LogLevels, L as LoggerConfiguration, b as LoggerFunction, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, P as Processor, R as Reporter, S as StreamAwareReporter } from './packem_shared/types-CMdBdNgA.cjs';
|
|
4
|
-
import 'safe-stable-stringify';
|
|
5
|
-
import 'type-fest';
|
|
6
|
-
import '@visulima/colorize';
|
|
7
|
-
|
|
8
|
-
declare const createPail: <T extends string = string, L extends string = string>(options?: ConstructorOptions<T, L>) => PailBrowserType<T, L>;
|
|
9
|
-
declare const pail: PailBrowserType<string, string>;
|
|
10
|
-
|
|
11
|
-
export { ConstructorOptions, PailBrowserType as Pail, createPail, pail };
|
package/dist/index.browser.d.mts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { P as PailBrowserType } from './packem_shared/pail.browser-B9eJPHAe.mjs';
|
|
2
|
-
import { C as ConstructorOptions } from './packem_shared/types-CMdBdNgA.mjs';
|
|
3
|
-
export { a as DefaultLogTypes, D as DefaultLoggerTypes, E as ExtendedRfc5424LogLevels, L as LoggerConfiguration, b as LoggerFunction, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, P as Processor, R as Reporter, S as StreamAwareReporter } from './packem_shared/types-CMdBdNgA.mjs';
|
|
4
|
-
import 'safe-stable-stringify';
|
|
5
|
-
import 'type-fest';
|
|
6
|
-
import '@visulima/colorize';
|
|
7
|
-
|
|
8
|
-
declare const createPail: <T extends string = string, L extends string = string>(options?: ConstructorOptions<T, L>) => PailBrowserType<T, L>;
|
|
9
|
-
declare const pail: PailBrowserType<string, string>;
|
|
10
|
-
|
|
11
|
-
export { ConstructorOptions, PailBrowserType as Pail, createPail, pail };
|
package/dist/index.browser.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var a=Object.defineProperty;var o=(r,e)=>a(r,"name",{value:e,configurable:!0});import{P as t}from"./packem_shared/pail.browser-Di9_5Zcq.mjs";import p from"./packem_shared/MessageFormatterProcessor-rkvAy05-.mjs";import i from"./packem_shared/JsonReporter-CRzHu5q7.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 p],reporters:[new i],...r}),"createPail"),w=s();export{s as createPail,w as pail};
|
package/dist/index.server.cjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";var L=Object.defineProperty;var n=(r,t)=>L(r,"name",{value:t,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("node:process"),v=require("./packem_shared/format-label-BkRisUmO.cjs"),$=require("node:string_decoder"),E=require("./packem_shared/pail.browser-vVxBu_Xl.cjs"),f=require("@visulima/inspector"),I=require("./packem_shared/constants-BFrKdBPm.cjs"),P=require("./packem_shared/write-stream-Dl-usQqh.cjs"),j=require("./packem_shared/MessageFormatterProcessor-D_s8r8ot.cjs"),x=require("./packem_shared/PrettyReporter-BSm1ACaz.cjs");var M=Object.defineProperty,O=n((r,t)=>M(r,"name",{value:t,configurable:!0}),"l");let B=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:d,rows:i}=v.O(),c=s>i?i-1:Math.max(0,Math.min(i-1,s)),u=this.lastLength-c,l=Math.max(u-i,this.outside);let o=e.reduce((_,b)=>[..._,v.T(b,d,{hard:!0,trim:!1,wordWrap:!0})],[]);i<=u?(a.erase(i),c<l&&(o=o.slice(l-c+1))):u&&a.erase(u),a.write(`${o.join(`
|
|
2
|
-
`)}
|
|
3
|
-
`),this.#s=l?l+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 R=Object.defineProperty,m=n((r,t)=>R(r,"name",{value:t,configurable:!0}),"t$1");const w="\x1B[2J",q="\x1B[2K",A=m((r=1)=>`${"\x1B["+r}A`,"cursorUp"),g=process.platform==="win32"?`${w}\x1B[0f`:`${w}\x1B[3J\x1B[H`,T="\x1B[?25l",N="\x1B[?25h",D=m(r=>{let t="";for(let e=0;e<r;e++)t+=q+(e<r-1?A():"");return r&&(t+="\x1B[G"),t},"eraseLines");var k=Object.defineProperty,G=n((r,t)=>k(r,"name",{value:t,configurable:!0}),"o$1");class p{static{n(this,"t")}static{G(this,"InteractiveStreamHook")}static DRAIN=!0;#t=new $.StringDecoder;#e=[];#r;#s;constructor(t){this.#r=t.write,this.#s=t}active(){this.write(T),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(),p.DRAIN}}erase(t){t>0&&this.write(D(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(N)}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 C=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:d}=t,i=[];if(a!==I.E){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 c=["error","trace","warn"].includes(d.level)?"stderr":"stdout",u=c==="stderr"?this.#e:this.#t,l=s.map(()=>" ").join("");this.#s&&this.#r!==void 0&&u.isTTY?this.#r.update(c,(l+i.join("")).split(`
|
|
5
|
-
`),0):P.n(l+i.join(""),u)}};var J=Object.defineProperty,U=n((r,t)=>J(r,"name",{value:t,configurable:!0}),"a$1");class F extends E.a{static{n(this,"v")}constructor(t){const{interactive:e,rawReporter:s,reporters:a,stderr:d,stdout:i,...c}=t;super(c),this.options=t,this.interactive=e??!1,this.stdout=i,this.stderr=d,this.interactive&&(this.interactiveManager=new B(new p(this.stdout),new p(this.stderr))),Array.isArray(a)&&this.registerReporters(a),this.rawReporter=this.extendReporter(t.rawReporter??new C)}static{U(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](String(s).trim())})}_restoreStream(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}}const K=F;var W=Object.defineProperty,y=n((r,t)=>W(r,"name",{value:t,configurable:!0}),"o");const Y=y(()=>h.env.NODE_ENV==="debug"||h.env.DEBUG!==void 0?"debug":h.env.NODE_ENV==="test"?"warning":"informational","_getDefaultLogLevel"),S=y(r=>{let t=Y();return h.env.PAIL_LOG_LEVEL!==void 0&&(t=h.env.PAIL_LOG_LEVEL),new K({logLevel:t,processors:[new j],reporters:[new x.PrettyReporter],stderr:h.stderr,stdout:h.stdout,...r})},"createPail"),z=S();exports.createPail=S;exports.pail=z;
|
package/dist/index.server.d.cts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { e as ServerConstructorOptions, I as InteractiveManager, R as Reporter, a as DefaultLogTypes, b as LoggerFunction, C as ConstructorOptions } from './packem_shared/types-CMdBdNgA.cjs';
|
|
2
|
-
export { D as DefaultLoggerTypes, E as ExtendedRfc5424LogLevels, L as LoggerConfiguration, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, P as Processor, S as StreamAwareReporter } from './packem_shared/types-CMdBdNgA.cjs';
|
|
3
|
-
import { a as PailBrowserImpl } from './packem_shared/pail.browser-2KlA4DJS.cjs';
|
|
4
|
-
import '@visulima/colorize';
|
|
5
|
-
import 'type-fest';
|
|
6
|
-
import 'safe-stable-stringify';
|
|
7
|
-
|
|
8
|
-
declare class PailServerImpl<T extends string = string, L extends string = string> extends PailBrowserImpl<T, L> {
|
|
9
|
-
readonly options: ServerConstructorOptions<T, L>;
|
|
10
|
-
protected readonly stdout: NodeJS.WriteStream;
|
|
11
|
-
protected readonly stderr: NodeJS.WriteStream;
|
|
12
|
-
protected interactiveManager: InteractiveManager | undefined;
|
|
13
|
-
protected readonly interactive: boolean;
|
|
14
|
-
constructor(options: ServerConstructorOptions<T, L>);
|
|
15
|
-
scope<N extends string = T>(...name: string[]): PailServerType<N, L>;
|
|
16
|
-
getInteractiveManager(): InteractiveManager | undefined;
|
|
17
|
-
wrapStd(): void;
|
|
18
|
-
restoreStd(): void;
|
|
19
|
-
wrapAll(): void;
|
|
20
|
-
restoreAll(): void;
|
|
21
|
-
clear(): void;
|
|
22
|
-
protected extendReporter(reporter: Reporter<L>): Reporter<L>;
|
|
23
|
-
private _wrapStream;
|
|
24
|
-
private _restoreStream;
|
|
25
|
-
}
|
|
26
|
-
type PailServerType<T extends string = string, L extends string = string> = (new <TC extends string = string, LC extends string = string>(options?: ServerConstructorOptions<TC, LC>) => PailServerType<TC, LC>) & PailServerImpl<T, L> & Record<DefaultLogTypes, LoggerFunction> & Record<T, LoggerFunction>;
|
|
27
|
-
|
|
28
|
-
declare const createPail: <T extends string = string, L extends string = string>(options?: ConstructorOptions<T, L>) => PailServerType<T, L>;
|
|
29
|
-
declare const pail: PailServerType<string, string>;
|
|
30
|
-
|
|
31
|
-
export { ConstructorOptions, DefaultLogTypes, LoggerFunction, Reporter, createPail, pail };
|
|
32
|
-
export type { PailServerType as Pail };
|
package/dist/index.server.d.mts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { e as ServerConstructorOptions, I as InteractiveManager, R as Reporter, a as DefaultLogTypes, b as LoggerFunction, C as ConstructorOptions } from './packem_shared/types-CMdBdNgA.mjs';
|
|
2
|
-
export { D as DefaultLoggerTypes, E as ExtendedRfc5424LogLevels, L as LoggerConfiguration, c as LoggerTypesAwareReporter, d as LoggerTypesConfig, P as Processor, S as StreamAwareReporter } from './packem_shared/types-CMdBdNgA.mjs';
|
|
3
|
-
import { a as PailBrowserImpl } from './packem_shared/pail.browser-B9eJPHAe.mjs';
|
|
4
|
-
import '@visulima/colorize';
|
|
5
|
-
import 'type-fest';
|
|
6
|
-
import 'safe-stable-stringify';
|
|
7
|
-
|
|
8
|
-
declare class PailServerImpl<T extends string = string, L extends string = string> extends PailBrowserImpl<T, L> {
|
|
9
|
-
readonly options: ServerConstructorOptions<T, L>;
|
|
10
|
-
protected readonly stdout: NodeJS.WriteStream;
|
|
11
|
-
protected readonly stderr: NodeJS.WriteStream;
|
|
12
|
-
protected interactiveManager: InteractiveManager | undefined;
|
|
13
|
-
protected readonly interactive: boolean;
|
|
14
|
-
constructor(options: ServerConstructorOptions<T, L>);
|
|
15
|
-
scope<N extends string = T>(...name: string[]): PailServerType<N, L>;
|
|
16
|
-
getInteractiveManager(): InteractiveManager | undefined;
|
|
17
|
-
wrapStd(): void;
|
|
18
|
-
restoreStd(): void;
|
|
19
|
-
wrapAll(): void;
|
|
20
|
-
restoreAll(): void;
|
|
21
|
-
clear(): void;
|
|
22
|
-
protected extendReporter(reporter: Reporter<L>): Reporter<L>;
|
|
23
|
-
private _wrapStream;
|
|
24
|
-
private _restoreStream;
|
|
25
|
-
}
|
|
26
|
-
type PailServerType<T extends string = string, L extends string = string> = (new <TC extends string = string, LC extends string = string>(options?: ServerConstructorOptions<TC, LC>) => PailServerType<TC, LC>) & PailServerImpl<T, L> & Record<DefaultLogTypes, LoggerFunction> & Record<T, LoggerFunction>;
|
|
27
|
-
|
|
28
|
-
declare const createPail: <T extends string = string, L extends string = string>(options?: ConstructorOptions<T, L>) => PailServerType<T, L>;
|
|
29
|
-
declare const pail: PailServerType<string, string>;
|
|
30
|
-
|
|
31
|
-
export { ConstructorOptions, DefaultLogTypes, LoggerFunction, Reporter, createPail, pail };
|
|
32
|
-
export type { PailServerType as Pail };
|
package/dist/index.server.mjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var E=Object.defineProperty;var o=(r,t)=>E(r,"name",{value:t,configurable:!0});import{createRequire as L}from"node:module";import{O as x,T as M}from"./packem_shared/format-label-B496HVjo.mjs";import{a as O}from"./packem_shared/pail.browser-Di9_5Zcq.mjs";import{inspect as v}from"@visulima/inspector";import{E as P}from"./packem_shared/constants-BMS51p6Y.mjs";import{n as R}from"./packem_shared/write-stream-CD8XFv1L.mjs";import T from"./packem_shared/MessageFormatterProcessor-rkvAy05-.mjs";import{PrettyReporter as A}from"./packem_shared/PrettyReporter-C0Qa7g8i.mjs";const $=L(import.meta.url),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,I=o(r=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[t,e]=l.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return l.getBuiltinModule(r)}return $(r)},"__cjs_getBuiltinModule"),{stdout:m,stderr:_,env:d}=l,{StringDecoder:B}=I("node:string_decoder");var N=Object.defineProperty,D=o((r,t)=>N(r,"name",{value:t,configurable:!0}),"l");let k=class{static{o(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}=x(),h=s>i?i-1:Math.max(0,Math.min(i-1,s)),c=this.lastLength-h,u=Math.max(c-i,this.outside);let n=e.reduce((b,j)=>[...b,M(j,p,{hard:!0,trim:!1,wordWrap:!0})],[]);i<=c?(a.erase(i),h<u&&(n=n.slice(u-h+1))):c&&a.erase(c),a.write(`${n.join(`
|
|
2
|
-
`)}
|
|
3
|
-
`),this.#s=u?u+n.length+1:n.length,this.#i=Math.max(this.lastLength-i,this.outside)}}_clear(t=!1){this.#e=t,this.#s=0,this.#i=0}};var G=Object.defineProperty,y=o((r,t)=>G(r,"name",{value:t,configurable:!0}),"t$1");const g="\x1B[2J",H="\x1B[2K",V=y((r=1)=>`${"\x1B["+r}A`,"cursorUp"),w=process.platform==="win32"?`${g}\x1B[0f`:`${g}\x1B[3J\x1B[H`,q="\x1B[?25l",Y="\x1B[?25h",C=y(r=>{let t="";for(let e=0;e<r;e++)t+=H+(e<r-1?V():"");return r&&(t+="\x1B[G"),t},"eraseLines");var J=Object.defineProperty,U=o((r,t)=>J(r,"name",{value:t,configurable:!0}),"o$1");class f{static{o(this,"t")}static{U(this,"InteractiveStreamHook")}static DRAIN=!0;#t=new B;#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(),f.DRAIN}}erase(t){t>0&&this.write(C(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(Y)}write(t){this.#r.apply(this.#s,[t])}}var K=Object.defineProperty,W=o((r,t)=>K(r,"name",{value:t,configurable:!0}),"c");let z=class{static{o(this,"v")}static{W(this,"RawReporter")}#t;#e;#r;#s=!1;#i;constructor(t={}){this.#t=m,this.#e=_,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){const n=typeof a=="string"?a:v(a,this.#i);i.push(n)}e&&i.push(...e.map(n=>typeof n=="object"?` ${v(n,this.#i)}`:` ${n}`));const h=["error","trace","warn"].includes(p.level)?"stderr":"stdout",c=h==="stderr"?this.#e:this.#t,u=s.map(()=>" ").join("");this.#s&&this.#r!==void 0&&c.isTTY?this.#r.update(h,(u+i.join("")).split(`
|
|
5
|
-
`),0):R(u+i.join(""),c)}};var F=Object.defineProperty,Q=o((r,t)=>F(r,"name",{value:t,configurable:!0}),"a$1");class X extends O{static{o(this,"v")}constructor(t){const{interactive:e,rawReporter:s,reporters:a,stderr:p,stdout:i,...h}=t;super(h),this.options=t,this.interactive=e??!1,this.stdout=i,this.stderr=p,this.interactive&&(this.interactiveManager=new k(new f(this.stdout),new f(this.stderr))),Array.isArray(a)&&this.registerReporters(a),this.rawReporter=this.extendReporter(t.rawReporter??new z)}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](String(s).trim())})}_restoreStream(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}}const Z=X;var tt=Object.defineProperty,S=o((r,t)=>tt(r,"name",{value:t,configurable:!0}),"o");const et=S(()=>d.NODE_ENV==="debug"||d.DEBUG!==void 0?"debug":d.NODE_ENV==="test"?"warning":"informational","_getDefaultLogLevel"),rt=S(r=>{let t=et();return d.PAIL_LOG_LEVEL!==void 0&&(t=d.PAIL_LOG_LEVEL),new Z({logLevel:t,processors:[new T],reporters:[new A],stderr:_,stdout:m,...r})},"createPail"),ft=rt();export{rt as createPail,ft as pail};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var u=Object.defineProperty;var n=(a,e)=>u(a,"name",{value:e,configurable:!0});var m=Object.defineProperty,c=n((a,e)=>m(a,"name",{value:e,configurable:!0}),"u");const o=c(()=>{const a=Error.prepareStackTrace;try{let e=[];Error.prepareStackTrace=(i,r)=>{const t=r.slice(1);return e=t,t};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 +0,0 @@
|
|
|
1
|
-
var u=Object.defineProperty;var n=(a,e)=>u(a,"name",{value:e,configurable:!0});var m=Object.defineProperty,c=n((a,e)=>m(a,"name",{value:e,configurable:!0}),"u");const o=c(()=>{const a=Error.prepareStackTrace;try{let e=[];Error.prepareStackTrace=(i,r)=>{const t=r.slice(1);return e=t,t};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};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var n=Object.defineProperty;var s=(e,t)=>n(e,"name",{value:t,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./abstract-json-reporter-C1jqd5bO.cjs");var h=Object.defineProperty,l=s((e,t)=>h(e,"name",{value:t,configurable:!0}),"e");class c{static{s(this,"n")}static{l(this,"SafeStreamHandler")}#t=!0;#e;#r;constructor(t,r){this.#e=t,this.#r=r}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.#r}. Write will be dropped: "${t}"`);return}this.#t=!1,this.#e.on("error",r=>{throw r}),this.#e.on("drain",()=>{this.#t=!0}),this.#e.on("finish",()=>{this.#t=!0}),this.#t=this.#e.write(t,()=>{})}}var u=Object.defineProperty,d=s((e,t)=>u(e,"name",{value:t,configurable:!0}),"r$1");class m{static{s(this,"o")}static{d(this,"RotatingFileStream")}#t;#e;#r;#s;#i;constructor(t,r=!1,i={}){if(this.#t=t,this.#e=r,this.#s=i,!this.#e){try{this.#i=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.#i(this.#t,i)}}write(t){let r=this.#r;this.#e&&(r=this.#i(this.#t,this.#s));const i=new c(r,this.#t);i.write(t),this.#e&&i.end()}end(){this.#r!==void 0&&this.#r.end()}}var f=Object.defineProperty,p=s((e,t)=>f(e,"name",{value:t,configurable:!0}),"r");class w extends o.A{static{s(this,"JsonFileReporter")}static{p(this,"JsonFileReporter")}stream;constructor(t){super();const{filePath:r,writeImmediately:i=!1,...a}=t;this.stream=new m(r,i,{compress:"gzip",interval:"1d",size:"10M",...a})}_log(t){this.stream.write(`${t}
|
|
2
|
-
`)}}exports.JsonFileReporter=w;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var i=Object.defineProperty;var s=(t,e)=>i(t,"name",{value:e,configurable:!0});import{createRequire as n}from"node:module";import{n as d}from"./write-stream-CD8XFv1L.mjs";import{A as l}from"./abstract-json-reporter-B_QC6gt7.mjs";const h=n(import.meta.url),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process;const{stdout:u,stderr:a}=c;var p=Object.defineProperty,f=s((t,e)=>p(t,"name",{value:e,configurable:!0}),"e");class j extends l{static{s(this,"d")}static{f(this,"JsonReporter")}#e;#t;constructor(e={}){super(e),this.#e=u,this.#t=a}setStdout(e){this.#e=e}setStderr(e){this.#t=e}_log(e,r){const o=["error","warn"].includes(r)?this.#t:this.#e;d(`${e}
|
|
2
|
-
`,o)}}export{j as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var s=Object.defineProperty;var t=(e,r)=>s(e,"name",{value:r,configurable:!0});import{t as a}from"./write-console-log-BP95fgQZ.mjs";import{A as p}from"./abstract-json-reporter-B_QC6gt7.mjs";var c=Object.defineProperty,n=t((e,r)=>c(e,"name",{value:r,configurable:!0}),"e");class l extends p{static{t(this,"p")}static{n(this,"JsonReporter")}constructor(r={}){super(r)}_log(r,o){a(o)(r)}}export{l as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var n=Object.defineProperty;var e=(r,t)=>n(r,"name",{value:t,configurable:!0});const s=require("node:process"),u=require("./write-stream-Dl-usQqh.cjs"),a=require("./abstract-json-reporter-C1jqd5bO.cjs");var c=Object.defineProperty,d=e((r,t)=>c(r,"name",{value:t,configurable:!0}),"e");class h extends a.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;u.n(`${t}
|
|
2
|
-
`,o)}}module.exports=h;
|
|
@@ -1 +0,0 @@
|
|
|
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-C1jqd5bO.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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var a=Object.defineProperty;var n=(o,t)=>a(o,"name",{value:t,configurable:!0});const c=require("@visulima/fmt");var u=Object.defineProperty,f=n((o,t)=>u(o,"name",{value:t,configurable:!0}),"o");class y{static{n(this,"p")}static{f(this,"MessageFormatterProcessor")}#t;#e;constructor(t={}){this.#e=t.formatters}setStringify(t){this.#t=t}process(t){const e=c.build({formatters:this.#e,stringify:f(s=>{const r=this.#t(s);return r===void 0?(console.warn(`Unable to stringify value of type ${typeof s}`,s),"undefined"):r},"stringify")});return t.message!==void 0&&(t.message=this._format(e,t.message,t.context??[])),t}_format(t,e,s=[]){if(typeof e=="string")return t(e,s);if(typeof e=="object"&&e!==null)for(const r in e){const i=e[r];(typeof i=="string"||Array.isArray(i)||typeof i=="object")&&(e[r]=this._format(t,i,s))}return e}}module.exports=y;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var n=Object.defineProperty;var a=(o,t)=>n(o,"name",{value:t,configurable:!0});import{build as c}from"@visulima/fmt";var u=Object.defineProperty,f=a((o,t)=>u(o,"name",{value:t,configurable:!0}),"o");class g{static{a(this,"p")}static{f(this,"MessageFormatterProcessor")}#t;#e;constructor(t={}){this.#e=t.formatters}setStringify(t){this.#t=t}process(t){const e=c({formatters:this.#e,stringify:f(r=>{const s=this.#t(r);return s===void 0?(console.warn(`Unable to stringify value of type ${typeof r}`,r),"undefined"):s},"stringify")});return t.message!==void 0&&(t.message=this._format(e,t.message,t.context??[])),t}_format(t,e,r=[]){if(typeof e=="string")return t(e,r);if(typeof e=="object"&&e!==null)for(const s in e){const i=e[s];(typeof i=="string"||Array.isArray(i)||typeof i=="object")&&(e[s]=this._format(t,i,r))}return e}}export{g as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var S=Object.defineProperty;var $=(h,i)=>S(h,"name",{value:i,configurable:!0});import B,{grey as o,white as j,underline as b,bold as E}from"@visulima/colorize/browser";import{format as r}from"@visulima/fmt";import{E as F}from"./constants-BMS51p6Y.mjs";import{A as O,s as R}from"./abstract-pretty-reporter-CRcf4WZd.mjs";import{s as Y}from"./get-longest-label-B0NrI-o2.mjs";import{t as k}from"./write-console-log-BP95fgQZ.mjs";var C=Object.defineProperty,D=$((h,i)=>C(h,"name",{value:i,configurable:!0}),"P");class K extends O{static{$(this,"F")}static{D(this,"PrettyReporter")}constructor(i={}){super({uppercase:{label:!0,...i.uppercase},...i})}log(i){const t=typeof globalThis.window<"u"&&typeof globalThis.document<"u",_=k(i.type.level),{badge:x,context:A,date:a,error:T,groups:f,label:g,message:v,prefix:y,repeated:u,scope:n,suffix:m,type:M}=i,{color:w}=this._loggerTypes[M.name],P=w?B[w]:j,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(x){const s=P(x);t?e.push(r(s[0],s.slice(1))):e.push([`${s[0]} `,...s.slice(1)])}else{const s=R(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 L=Y(this._loggerTypes);let d;if(u){const s=j(`[${u}x]`);d=t?r(s[0],s.slice(1)):[s[0],...s.slice(1)]}if(g){const s=P(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=L.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(L.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?b(y):y}] `);t?e.push(r(s[0],s.slice(1))):e.push([s[0],...s.slice(1)])}if(v!==F&&e.push(v),A&&e.push(...A),T&&e.push(T,`
|
|
2
|
-
|
|
3
|
-
`),m){const s=o(this._styles.underline.suffix?b(m):m);t?e.push(r(`
|
|
4
|
-
${s[0]}`,s.slice(1))):e.push([`
|
|
5
|
-
${s[0]}`,...s.slice(1)])}if(t)_(...e);else{let s="";const l=[],p=[];for(const c of e)Array.isArray(c)&&c.length>1&&c[0].includes("%c")?(s+=c[0],l.push(...c.slice(1))):p.push(c);_(`${s}%c`,...l,"",...p)}}_formatLabel(i){let t=this._styles.uppercase.label?i.toUpperCase():i;return t=this._styles.underline.label?b(t):t,this._styles.bold.label&&(t=E(t)),t}}export{K as default};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";var I=Object.defineProperty;var f=(s,r)=>I(s,"name",{value:r,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const P=require("node:process"),e=require("@visulima/colorize"),x=require("@visulima/error/error"),T=require("@visulima/inspector"),u=require("./format-label-BkRisUmO.cjs"),O=require("./constants-BFrKdBPm.cjs"),A=require("./abstract-pretty-reporter-C2vDqWAQ.cjs"),F=require("./get-longest-label-7LkwzzHo.cjs"),V=require("./write-stream-Dl-usQqh.cjs"),W=f(s=>s&&typeof s=="object"&&"default"in s?s.default:s,"_interopDefaultCompat"),D=W(e);var z=Object.defineProperty,C=f((s,r)=>z(s,"name",{value:r,configurable:!0}),"S");const E=C(s=>!/[\\/]pail[\\/]dist/.test(s),"pailFileFilter");class B extends A.A{static{f(this,"PrettyReporter")}static{C(this,"PrettyReporter")}#r;#t;#s;#o=!1;#i;#e;constructor(r={}){const{error:h,inspect:o,...a}=r;super({uppercase:{label:!0,...a.uppercase},...a}),this.#i={...u.u,...o},this.#e={...h,color:{fileLine:e.green,hint:e.cyan,marker:e.red,message:e.red,method:e.greenBright,title:e.red}},this.#r=P.stdout,this.#t=P.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:h}=u.O();let o=h;typeof this._styles.messageLength=="number"&&(o=this._styles.messageLength);const{badge:a,context:j,date:g,error:q,file:c,groups:y,label:m,message:d,prefix:$,repeated:v,scope:p,suffix:_,traceError:w,type:R}=r,{color:S}=this._loggerTypes[R.name],L=S?D[S]:e.white,l=y.map(()=>" ").join(""),t=[];if(y.length>0&&t.push(`${l+e.grey(`[${y.at(-1)}]`)} `),g&&t.push(`${e.grey(this._styles.dateFormatter(typeof g=="string"?new Date(g):g))} `),a)t.push(L(a));else{const i=A.s(this._loggerTypes);i.length>0&&t.push(`${e.grey(".".repeat(i.length))} `)}const M=F.s(this._loggerTypes);m?t.push(`${L(u.n(m,this._styles))} `,e.grey(".".repeat(M.length-u.m(m)))):t.push(e.grey(".".repeat(M.length+2))),v&&t.push(`${e.bgGrey.white(`[${v}x]`)} `),Array.isArray(p)&&p.length>0&&t.push(` ${e.grey(`[${p.join(" > ")}]`)} `),$&&t.push(`${e.grey(`${Array.isArray(p)&&p.length>0?". ":" "}[${this._styles.underline.prefix?e.underline($):$}]`)} `);const b=u.m(t.join(" "));if(c){const i=c.name+(c.line?`:${c.line}`:""),n=u.m(i);n+b+2>o?t.push(e.grey(` ${i}`)):t.push(e.grey(`${".".repeat(o-b-n-2)} ${i}`))}else t.push(e.grey(".".repeat(o-b-1)));if(t.length>0&&t.push(`
|
|
2
|
-
|
|
3
|
-
`),d!==O.E){const i=typeof d=="string"?d:T.inspect(d,this.#i);t.push(l+u.T(i,o-3,{hard:!0,trim:!1,wordWrap:!0}))}if(j){let i=!1;t.push(...j.map(n=>{if(n instanceof Error)return i=!0,`
|
|
4
|
-
|
|
5
|
-
${x.renderError(n,{...this.#e,filterStacktrace:E,prefix:l})}`;if(typeof n=="object")return` ${T.inspect(n,this.#i)}`;const k=(i?`
|
|
6
|
-
|
|
7
|
-
`:" ")+n;return i=!1,k}))}return q&&t.push(x.renderError(q,{...this.#e,filterStacktrace:E,prefix:l})),w&&t.push(`
|
|
8
|
-
|
|
9
|
-
${x.renderError(w,{...this.#e,filterStacktrace:E,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:l})}`),_&&t.push(`
|
|
10
|
-
`,l+e.grey(this._styles.underline.suffix?e.underline(_):_)),`${t.join("")}
|
|
11
|
-
`}_log(r,h){const o=["error","trace","warn"].includes(h)?"stderr":"stdout",a=o==="stderr"?this.#t:this.#r;this.#o&&this.#s!==void 0&&a.isTTY?this.#s.update(o,r.split(`
|
|
12
|
-
`),0):V.n(`${r}
|
|
13
|
-
`,a)}}exports.PrettyReporter=B;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
var I=Object.defineProperty;var $=(a,e)=>I(a,"name",{value:e,configurable:!0});import{createRequire as O}from"node:module";import Y,{red as b,greenBright as W,cyan as z,green as D,grey as s,white as G,bgGrey as N,underline as R}from"@visulima/colorize";import{renderError as j}from"@visulima/error/error";import{inspect as L}from"@visulima/inspector";import{u as H,O as J,n as K,m as x,T as Q}from"./format-label-B496HVjo.mjs";import{E as U}from"./constants-BMS51p6Y.mjs";import{A as X,s as Z}from"./abstract-pretty-reporter-CRcf4WZd.mjs";import{s as ee}from"./get-longest-label-B0NrI-o2.mjs";import{n as te}from"./write-stream-CD8XFv1L.mjs";const oe=O(import.meta.url),q=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process;const{stdout:F,stderr:V}=q;var re=Object.defineProperty,k=$((a,e)=>re(a,"name",{value:e,configurable:!0}),"S");const v=k(a=>!/[\\/]pail[\\/]dist/.test(a),"pailFileFilter");class ge extends X{static{$(this,"PrettyReporter")}static{k(this,"PrettyReporter")}#t;#r;#s;#o=!1;#i;#e;constructor(e={}){const{error:h,inspect:i,...o}=e;super({uppercase:{label:!0,...o.uppercase},...o}),this.#i={...H,...i},this.#e={...h,color:{fileLine:D,hint:z,marker:b,message:b,method:W,title:b}},this.#t=F,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:o,context:E,date:u,error:T,file:c,groups:g,label:d,message:f,prefix:m,repeated:M,scope:l,suffix:y,traceError:w,type:B}=e,{color:A}=this._loggerTypes[B.name],P=A?Y[A]:G,p=g.map(()=>" ").join(""),t=[];if(g.length>0&&t.push(`${p+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=Z(this._loggerTypes);r.length>0&&t.push(`${s(".".repeat(r.length))} `)}const S=ee(this._loggerTypes);d?t.push(`${P(K(d,this._styles))} `,s(".".repeat(S.length-x(d)))):t.push(s(".".repeat(S.length+2))),M&&t.push(`${N.white(`[${M}x]`)} `),Array.isArray(l)&&l.length>0&&t.push(` ${s(`[${l.join(" > ")}]`)} `),m&&t.push(`${s(`${Array.isArray(l)&&l.length>0?". ":" "}[${this._styles.underline.prefix?R(m):m}]`)} `);const _=x(t.join(" "));if(c){const r=c.name+(c.line?`:${c.line}`:""),n=x(r);n+_+2>i?t.push(s(` ${r}`)):t.push(s(`${".".repeat(i-_-n-2)} ${r}`))}else t.push(s(".".repeat(i-_-1)));if(t.length>0&&t.push(`
|
|
2
|
-
|
|
3
|
-
`),f!==U){const r=typeof f=="string"?f:L(f,this.#i);t.push(p+Q(r,i-3,{hard:!0,trim:!1,wordWrap:!0}))}if(E){let r=!1;t.push(...E.map(n=>{if(n instanceof Error)return r=!0,`
|
|
4
|
-
|
|
5
|
-
${j(n,{...this.#e,filterStacktrace:v,prefix:p})}`;if(typeof n=="object")return` ${L(n,this.#i)}`;const C=(r?`
|
|
6
|
-
|
|
7
|
-
`:" ")+n;return r=!1,C}))}return T&&t.push(j(T,{...this.#e,filterStacktrace:v,prefix:p})),w&&t.push(`
|
|
8
|
-
|
|
9
|
-
${j(w,{...this.#e,filterStacktrace:v,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:p})}`),y&&t.push(`
|
|
10
|
-
`,p+s(this._styles.underline.suffix?R(y):y)),`${t.join("")}
|
|
11
|
-
`}_log(e,h){const i=["error","trace","warn"].includes(h)?"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):te(`${e}
|
|
13
|
-
`,o)}}export{ge as PrettyReporter};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";var P=Object.defineProperty;var f=(n,i)=>P(n,"name",{value:i,configurable:!0});const l=require("@visulima/colorize/browser"),o=require("@visulima/fmt"),C=require("./constants-BFrKdBPm.cjs"),T=require("./abstract-pretty-reporter-C2vDqWAQ.cjs"),D=require("./get-longest-label-7LkwzzHo.cjs"),F=require("./write-console-log-3G15muTS.cjs"),R=f(n=>n&&typeof n=="object"&&"default"in n?n.default:n,"_interopDefaultCompat"),S=R(l);var k=Object.defineProperty,B=f((n,i)=>k(n,"name",{value:i,configurable:!0}),"P");class E extends T.A{static{f(this,"F")}static{B(this,"PrettyReporter")}constructor(i={}){super({uppercase:{label:!0,...i.uppercase},...i})}log(i){const t=typeof globalThis.window<"u"&&typeof globalThis.document<"u",_=F.t(i.type.level),{badge:$,context:x,date:p,error:w,groups:g,label:y,message:A,prefix:d,repeated:h,scope:u,suffix:m,type:j}=i,{color:q}=this._loggerTypes[j.name],v=q?S[q]: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(p){const e=l.grey(this._styles.dateFormatter(typeof p=="string"?new Date(p):p));t?s.push(o.format(e[0],e.slice(1))):s.push([`${e[0]} `,...e.slice(1)])}if($){const e=v($);t?s.push(o.format(e[0],e.slice(1))):s.push([`${e[0]} `,...e.slice(1)])}else{const e=T.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 L=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=L.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(L.length+1));t?s.push(o.format(e[0],e.slice(1))):s.push([e[0],...e.slice(1)])}if(Array.isArray(u)&&u.length>0){const e=l.grey(`[${u.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(u)&&u.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(A!==C.E&&s.push(A),x&&s.push(...x),w&&s.push(w,`
|
|
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=E;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var e=(t,r)=>o(t,"name",{value:r,configurable:!0});var n=Object.defineProperty,u=e((t,r)=>n(t,"name",{value:r,configurable:!0}),"r");class h{static{e(this,"n")}static{u(this,"RedactProcessor")}#r;constructor(r,s){try{const{redact:a,standardRules:c}=require("@visulima/redact");this.#r=i=>a(i,r||c,s)}catch{throw new Error("The '@visulima/redact' package is missing. Make sure to install the '@visulima/redact' package.")}}process(r){return r.message=this.#r(r.message),r.context=this.#r(r.context),r.error=this.#r(r.error),r}}module.exports=h;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
|
|
2
|
-
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
3
|
-
var o=Object.defineProperty;var e=(t,r)=>o(t,"name",{value:r,configurable:!0});var n=Object.defineProperty,u=e((t,r)=>n(t,"name",{value:r,configurable:!0}),"r");class l{static{e(this,"n")}static{u(this,"RedactProcessor")}#r;constructor(r,s){try{const{redact:a,standardRules:c}=require("@visulima/redact");this.#r=i=>a(i,r||c,s)}catch{throw new Error("The '@visulima/redact' package is missing. Make sure to install the '@visulima/redact' package.")}}process(r){return r.message=this.#r(r.message),r.context=this.#r(r.context),r.error=this.#r(r.error),r}}export{l as default};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var q=Object.defineProperty;var y=(n,e)=>q(n,"name",{value:e,configurable:!0});import{createRequire as F}from"node:module";import W,{red as $,greenBright as z,cyan as D,green as G,grey as o,bold as C,white as N,bgGrey as H,underline as R}from"@visulima/colorize";import{renderError as b}from"@visulima/error";import{inspect as k}from"@visulima/inspector";import{u as J,O as K,n as Q,m as L,T as U}from"./format-label-B496HVjo.mjs";import{E as X}from"./constants-BMS51p6Y.mjs";import{A as Z,s as ee}from"./abstract-pretty-reporter-CRcf4WZd.mjs";import{s as te}from"./get-longest-label-B0NrI-o2.mjs";import{n as re}from"./write-stream-CD8XFv1L.mjs";const ne=F(import.meta.url),I=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process;const{stdout:V,stderr:Y}=I;var se=Object.defineProperty,A=y((n,e)=>se(n,"name",{value:e,configurable:!0}),"L");const j=A(n=>!/[\\/]pail[\\/]dist/.test(n),"pailFileFilter");class me extends Z{static{y(this,"SimpleReporter")}static{A(this,"SimpleReporter")}#t;#r;#s;#o=!1;#i;#e;constructor(e={}){const{error:p,inspect:i,...s}=e;super({uppercase:{label:!0,...s.uppercase},...s}),this.#i={...J,indent:void 0,...i},this.#e={...p,color:{fileLine:G,hint:D,marker:$,message:$,method:z,title:$}},this.#t=V,this.#r=Y}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:p}=K();let i=p;typeof this._styles.messageLength=="number"&&(i=this._styles.messageLength);const{badge:s,context:v,date:h,error:x,file:u,groups:f,label:d,message:c,prefix:m,repeated:E,scope:g,suffix:_,traceError:T,type:B}=e,{color:M}=this._loggerTypes[B.name],w=M?W[M]:N,a=f.map(()=>" ").join(""),t=[];if(f.length>0&&t.push(`${a+o(`[${f.at(-1)}]`)} `),h&&t.push(`${o(this._styles.dateFormatter(typeof h=="string"?new Date(h):h))} `),s)t.push(C(w(s)));else{const r=ee(this._loggerTypes);r.length>0&&t.push(o(" ".repeat(r.length)))}const S=te(this._loggerTypes);d?t.push(`${C(w(Q(d,this._styles)))} `," ".repeat(S.length-L(d))):t.push(" ".repeat(S.length+1)),E&&t.push(`${H.white(`[${E}x]`)} `),Array.isArray(g)&&g.length>0&&t.push(`${o(`[${g.join(" > ")}]`)} `),m&&t.push(`${o(`[${this._styles.underline.prefix?R(m):m}]`)} `);const O=L(t.join(""));if(c!==X){const r=typeof c=="string"?c:k(c,this.#i);t.push(a+U(r,i-3,{hard:!0,trim:!1,wordWrap:!0}))}if(v){let r=!1;t.push(...v.map(l=>{if(l instanceof Error)return r=!0,`
|
|
2
|
-
|
|
3
|
-
${b(l,{...this.#e,filterStacktrace:j,prefix:a})}`;if(typeof l=="object")return` ${k(l,this.#i)}`;const P=(r?`
|
|
4
|
-
|
|
5
|
-
`:" ")+l;return r=!1,P}))}if(x&&t.push(b(x,{...this.#e,filterStacktrace:j,prefix:a})),T&&t.push(`
|
|
6
|
-
|
|
7
|
-
${b(T,{...this.#e,filterStacktrace:j,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:a})}`),_&&t.push(` ${a}${o(this._styles.underline.suffix?R(_):_)}`),u){const r=u.name+(u.line?`:${u.line}`:"");t.push(`
|
|
8
|
-
`,o("Caller: ")," ".repeat(O-8),r,`
|
|
9
|
-
`)}return t.join("")}_log(e,p){const i=["error","trace","warn"].includes(p)?"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):re(`${e}
|
|
11
|
-
`,s)}}export{me as SimpleReporter};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";var F=Object.defineProperty;var g=(s,e)=>F(s,"name",{value:e,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const L=require("node:process"),r=require("@visulima/colorize"),b=require("@visulima/error"),M=require("@visulima/inspector"),l=require("./format-label-BkRisUmO.cjs"),I=require("./constants-BFrKdBPm.cjs"),T=require("./abstract-pretty-reporter-C2vDqWAQ.cjs"),P=require("./get-longest-label-7LkwzzHo.cjs"),V=require("./write-stream-Dl-usQqh.cjs"),W=g(s=>s&&typeof s=="object"&&"default"in s?s.default:s,"_interopDefaultCompat"),D=W(r);var z=Object.defineProperty,k=g((s,e)=>z(s,"name",{value:e,configurable:!0}),"L");const v=k(s=>!/[\\/]pail[\\/]dist/.test(s),"pailFileFilter");class B extends T.A{static{g(this,"SimpleReporter")}static{k(this,"SimpleReporter")}#r;#t;#s;#o=!1;#i;#e;constructor(e={}){const{error:u,inspect:n,...o}=e;super({uppercase:{label:!0,...o.uppercase},...o}),this.#i={...l.u,indent:void 0,...n},this.#e={...u,color:{fileLine:r.green,hint:r.cyan,marker:r.red,message:r.red,method:r.greenBright,title:r.red}},this.#r=L.stdout,this.#t=L.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:u}=l.O();let n=u;typeof this._styles.messageLength=="number"&&(n=this._styles.messageLength);const{badge:o,context:x,date:p,error:E,file:c,groups:f,label:y,message:d,prefix:m,repeated:S,scope:_,suffix:$,traceError:j,type:R}=e,{color:q}=this._loggerTypes[R.name],w=q?D[q]:r.white,a=f.map(()=>" ").join(""),t=[];if(f.length>0&&t.push(`${a+r.grey(`[${f.at(-1)}]`)} `),p&&t.push(`${r.grey(this._styles.dateFormatter(typeof p=="string"?new Date(p):p))} `),o)t.push(r.bold(w(o)));else{const i=T.s(this._loggerTypes);i.length>0&&t.push(r.grey(" ".repeat(i.length)))}const C=P.s(this._loggerTypes);y?t.push(`${r.bold(w(l.n(y,this._styles)))} `," ".repeat(C.length-l.m(y))):t.push(" ".repeat(C.length+1)),S&&t.push(`${r.bgGrey.white(`[${S}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!==I.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(x){let i=!1;t.push(...x.map(h=>{if(h instanceof Error)return i=!0,`
|
|
2
|
-
|
|
3
|
-
${b.renderError(h,{...this.#e,filterStacktrace:v,prefix:a})}`;if(typeof h=="object")return` ${M.inspect(h,this.#i)}`;const A=(i?`
|
|
4
|
-
|
|
5
|
-
`:" ")+h;return i=!1,A}))}if(E&&t.push(b.renderError(E,{...this.#e,filterStacktrace:v,prefix:a})),j&&t.push(`
|
|
6
|
-
|
|
7
|
-
${b.renderError(j,{...this.#e,filterStacktrace:v,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:a})}`),$&&t.push(` ${a}${r.grey(this._styles.underline.suffix?r.underline($):$)}`),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,u){const n=["error","trace","warn"].includes(u)?"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=B;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var g=Object.defineProperty;var n=(o,r)=>g(o,"name",{value:r,configurable:!0});import{serializeError as f}from"@visulima/error/error";import{E as p}from"./constants-BMS51p6Y.mjs";var h=Object.defineProperty,u=n((o,r)=>h(o,"name",{value:r,configurable:!0}),"p");class v{static{n(this,"AbstractJsonReporter")}static{u(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:m,...e}=r;if(e.label&&(e.label=e.label.trim()),t&&(e.file=`${t.name}:${t.line}${t.column?`:${t.column}`:""}`),c===p?e.message=void 0:e.message=c,l&&(e.error=f(l,this.errorOptions)),a){const i=[];for(const s of a)s!==p&&(s instanceof Error?i.push(f(s,this.errorOptions)):i.push(s));e.context=i}this._log(this.stringify(e),m.level)}}export{v as A};
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var s=(t,e)=>o(t,"name",{value:e,configurable:!0});const n=require("./constants-BFrKdBPm.cjs");var g=Object.defineProperty,c=s((t,e)=>g(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 u=Object.defineProperty,l=s((t,e)=>u(t,"name",{value:e,configurable:!0}),"o");const p=l(t=>[t.getHours(),t.getMinutes(),t.getSeconds()].map(e=>String(e).padStart(2,"0")).join(":"),"dateFormatter");class f{static{s(this,"AbstractPrettyReporter")}static{l(this,"AbstractPrettyReporter")}_styles;_loggerTypes;constructor(e){this._styles={bold:{label:!1},dateFormatter:p,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...e},this._loggerTypes=n.L}setLoggerTypes(e){this._loggerTypes=e}}exports.A=f;exports.s=i;
|