@visulima/pail 4.0.0-alpha.17 → 4.0.0-alpha.19
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 +55 -0
- package/dist/index.browser.d.ts +2 -3
- package/dist/index.server.d.ts +3 -2
- package/dist/index.server.js +22 -22
- package/dist/packem_shared/{PrettyReporter-C9D3lmF2.js → PrettyReporter-BBs3xkv_.js} +15 -15
- package/dist/packem_shared/{abstract-pretty-reporter-CHU4NOsN.js → abstract-pretty-reporter-DE6N5YR9.js} +16 -16
- package/dist/packem_shared/{types.d-C51XNfQz.d.ts → types.d-Cz9S7jZh.d.ts} +15 -8
- package/dist/packem_shared/{types.d-CM5ie2qm.d.ts → types.d-xxE3FOD3.d.ts} +8 -15
- package/dist/reporter/file/json-file-reporter.js +1 -1
- package/dist/reporter/json/index.browser.d.ts +1 -2
- package/dist/reporter/pretty/index.browser.d.ts +1 -2
- package/dist/reporter/pretty/index.d.ts +39 -42
- package/dist/reporter/pretty/index.js +1 -1
- package/dist/reporter/simple/simple-reporter.server.d.ts +4 -39
- package/dist/reporter/simple/simple-reporter.server.js +1 -1
- package/package.json +15 -17
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { LiteralUnion } from 'type-fest';
|
|
1
2
|
import { InteractiveManager } from '@visulima/interactive-manager';
|
|
2
|
-
import { D as DefaultLogTypes, L as
|
|
3
|
+
import { D as DefaultLogTypes, L as LoggerTypesConfig, f as ReadonlyMeta, d as LoggerTypesAwareReporter, I as InteractiveStreamReporter } from "../../packem_shared/types.d-Cz9S7jZh.js";
|
|
3
4
|
import '@visulima/colorize';
|
|
4
5
|
type ColorizeMethod = (value: string) => string;
|
|
5
6
|
type CodeFrameOptions = {
|
|
@@ -35,42 +36,6 @@ type Options$1 = Omit<CodeFrameOptions, "message | prefix"> & {
|
|
|
35
36
|
indentation: number | " ";
|
|
36
37
|
prefix: string;
|
|
37
38
|
};
|
|
38
|
-
/**
|
|
39
|
-
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
40
|
-
|
|
41
|
-
@category Type
|
|
42
|
-
*/
|
|
43
|
-
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
44
|
-
/**
|
|
45
|
-
Create a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
|
|
46
|
-
|
|
47
|
-
Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals.
|
|
48
|
-
|
|
49
|
-
This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore.
|
|
50
|
-
|
|
51
|
-
@example
|
|
52
|
-
```
|
|
53
|
-
import type {LiteralUnion} from 'type-fest';
|
|
54
|
-
|
|
55
|
-
// Before
|
|
56
|
-
|
|
57
|
-
type Pet = 'dog' | 'cat' | string;
|
|
58
|
-
|
|
59
|
-
const petWithoutAutocomplete: Pet = '';
|
|
60
|
-
// Start typing in your TypeScript-enabled IDE.
|
|
61
|
-
// You **will not** get auto-completion for `dog` and `cat` literals.
|
|
62
|
-
|
|
63
|
-
// After
|
|
64
|
-
|
|
65
|
-
type Pet2 = LiteralUnion<'dog' | 'cat', string>;
|
|
66
|
-
|
|
67
|
-
const petWithAutoComplete: Pet2 = '';
|
|
68
|
-
// You **will** get auto-completion for `dog` and `cat` literals.
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
@category Type
|
|
72
|
-
*/
|
|
73
|
-
type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
|
|
74
39
|
interface Options {
|
|
75
40
|
breakLength: number;
|
|
76
41
|
customInspect: boolean;
|
|
@@ -106,7 +71,7 @@ declare abstract class AbstractPrettyReporter<T extends string = string, L exten
|
|
|
106
71
|
/** Styling options for pretty formatting */
|
|
107
72
|
protected readonly styles: PrettyStyleOptions;
|
|
108
73
|
/** Logger type configurations for styling */
|
|
109
|
-
protected loggerTypes: LoggerTypesConfig<LiteralUnion
|
|
74
|
+
protected loggerTypes: LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>;
|
|
110
75
|
/**
|
|
111
76
|
* Creates a new AbstractPrettyReporter instance.
|
|
112
77
|
* @param options Styling options for pretty formatting
|
|
@@ -117,7 +82,7 @@ declare abstract class AbstractPrettyReporter<T extends string = string, L exten
|
|
|
117
82
|
* Sets the logger types configuration for styling.
|
|
118
83
|
* @param types Logger type configurations with colors and labels
|
|
119
84
|
*/
|
|
120
|
-
setLoggerTypes(types: LoggerTypesConfig<LiteralUnion
|
|
85
|
+
setLoggerTypes(types: LoggerTypesConfig<LiteralUnion<DefaultLogTypes, T>, L>): void;
|
|
121
86
|
/**
|
|
122
87
|
* Logs a message with pretty formatting.
|
|
123
88
|
* @param meta The log metadata to format and output
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var F=Object.defineProperty;var x=(o,e)=>F(o,"name",{value:e,configurable:!0});import{createRequire as V}from"node:module";import A from"@visulima/colorize";import{A as G,u as W,i as H,O as K,b as Q,s as Z,o as d,c as J,a as N,p as R,d as U,B as X,G as S}from"../../packem_shared/abstract-pretty-reporter-
|
|
1
|
+
var F=Object.defineProperty;var x=(o,e)=>F(o,"name",{value:e,configurable:!0});import{createRequire as V}from"node:module";import A from"@visulima/colorize";import{A as G,u as W,i as H,O as K,b as Q,s as Z,o as d,c as J,a as N,p as R,d as U,B as X,G as S}from"../../packem_shared/abstract-pretty-reporter-DE6N5YR9.js";const le=V(import.meta.url),Y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:z,stderr:D}=Y;var ee=Object.defineProperty,B=x((o,e)=>ee(o,"name",{value:e,configurable:!0}),"b");const{bgGrey:te,bold:I,cyan:se,green:re,greenBright:ie,grey:a,red:T,underline:k,white:ae}=A,oe=/[\\/]pail[\\/]dist/,_=B(o=>!oe.test(o),"pailFileFilter");class ue extends G{static{x(this,"SimpleReporter")}static{B(this,"SimpleReporter")}#t;#s;#r;#a=!1;#i;#e;constructor(e={}){const{error:n,inspect:p,...i}=e;super({uppercase:{label:!0,...i.uppercase},...i}),this.#i={...W,indent:void 0,...p},this.#e={...n,color:{fileLine:re,hint:se,marker:T,message:T,method:ie,title:T}},this.#t=z,this.#s=D}setStdout(e){this.#t=e}setStderr(e){this.#s=e}setInteractiveManager(e){this.#r=e}setIsInteractive(e){this.#a=e}log(e){const n=this.formatMessage(e),p=e.type.level,i=["error","trace","warn"].includes(p)?"stderr":"stdout",h=i==="stderr"?this.#s:this.#t;this.#a&&this.#r!==void 0&&h.isTTY?this.#r.update(i,n.split(`
|
|
2
2
|
`),0):H(`${n}
|
|
3
3
|
`,h)}formatMessage(e){const{columns:n}=K();let p=n;typeof this.styles.messageLength=="number"&&(p=this.styles.messageLength);const{badge:i,context:h,date:c,error:j,file:u,groups:g,label:m,message:f,prefix:y,repeated:M,scope:$,suffix:b,traceError:v,type:L}=e,{color:w}=this.loggerTypes[L.name],E=w?A[w]:ae,l=g.map(()=>" ").join(""),t=[];if(g.length>0&&t.push(`${l+a(`[${g.at(-1)??""}]`)} `),c&&t.push(`${a(this.styles.dateFormatter(typeof c=="string"?new Date(c):c))} `),i)t.push(I(E(i)));else{const s=Q(this.loggerTypes);s.length>0&&t.push(a(" ".repeat(s.length)))}const O=Z(this.loggerTypes),C=d(O);if(m){const s=d(m),r=Math.max(0,C-s);t.push(`${I(E(J(m,this.styles)))} `," ".repeat(r))}else t.push(" ".repeat(C+1));M&&t.push(`${te.white(`[${String(M)}x]`)} `),Array.isArray($)&&$.length>0&&t.push(`${a(`[${$.join(" > ")}]`)} `),y&&t.push(`${a(`[${this.styles.underline.prefix?k(y):y}]`)} `);const P=d(t.join(""));if(f!==N){const s=typeof f=="string"?f:R(f,this.#i);t.push(l+U(s,{trim:!1,width:p-3,wrapMode:X.STRICT_WIDTH}))}if(h){let s=!1;t.push(...h.map(r=>{if(r instanceof Error)return s=!0,`
|
|
4
4
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/pail",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.19",
|
|
4
4
|
"description": "Highly configurable Logger for Node.js, Edge and Browser.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -56,9 +56,7 @@
|
|
|
56
56
|
"winston"
|
|
57
57
|
],
|
|
58
58
|
"homepage": "https://visulima.com/packages/pail/",
|
|
59
|
-
"bugs":
|
|
60
|
-
"url": "https://github.com/visulima/visulima/issues"
|
|
61
|
-
},
|
|
59
|
+
"bugs": "https://github.com/visulima/visulima/issues",
|
|
62
60
|
"repository": {
|
|
63
61
|
"type": "git",
|
|
64
62
|
"url": "git+https://github.com/visulima/visulima.git",
|
|
@@ -84,11 +82,11 @@
|
|
|
84
82
|
"type": "module",
|
|
85
83
|
"exports": {
|
|
86
84
|
".": {
|
|
87
|
-
"browser": "./dist/index.browser.js",
|
|
88
85
|
"import": {
|
|
89
86
|
"types": "./dist/index.server.d.ts",
|
|
90
87
|
"default": "./dist/index.server.js"
|
|
91
|
-
}
|
|
88
|
+
},
|
|
89
|
+
"browser": "./dist/index.browser.js"
|
|
92
90
|
},
|
|
93
91
|
"./browser": {
|
|
94
92
|
"types": "./dist/index.browser.d.ts",
|
|
@@ -143,11 +141,11 @@
|
|
|
143
141
|
}
|
|
144
142
|
},
|
|
145
143
|
"./reporter/json": {
|
|
146
|
-
"browser": "./dist/reporter/json/index.browser.js",
|
|
147
144
|
"import": {
|
|
148
145
|
"types": "./dist/reporter/json/index.d.ts",
|
|
149
146
|
"default": "./dist/reporter/json/index.js"
|
|
150
|
-
}
|
|
147
|
+
},
|
|
148
|
+
"browser": "./dist/reporter/json/index.browser.js"
|
|
151
149
|
},
|
|
152
150
|
"./server/reporter/pretty": {
|
|
153
151
|
"import": {
|
|
@@ -162,11 +160,11 @@
|
|
|
162
160
|
}
|
|
163
161
|
},
|
|
164
162
|
"./reporter/pretty": {
|
|
165
|
-
"browser": "./dist/reporter/pretty/index.browser.js",
|
|
166
163
|
"import": {
|
|
167
164
|
"types": "./dist/reporter/pretty/index.d.ts",
|
|
168
165
|
"default": "./dist/reporter/pretty/index.js"
|
|
169
|
-
}
|
|
166
|
+
},
|
|
167
|
+
"browser": "./dist/reporter/pretty/index.browser.js"
|
|
170
168
|
},
|
|
171
169
|
"./reporter/simple": {
|
|
172
170
|
"types": "./dist/reporter/simple/simple-reporter.server.d.ts",
|
|
@@ -177,6 +175,10 @@
|
|
|
177
175
|
"default": "./dist/reporter/http/abstract-http-reporter.js"
|
|
178
176
|
},
|
|
179
177
|
"./reporter/http": {
|
|
178
|
+
"import": {
|
|
179
|
+
"types": "./dist/reporter/http/http-reporter.d.ts",
|
|
180
|
+
"default": "./dist/reporter/http/http-reporter.js"
|
|
181
|
+
},
|
|
180
182
|
"edge-light": {
|
|
181
183
|
"types": "./dist/reporter/http/http-reporter.edge-light.d.ts",
|
|
182
184
|
"default": "./dist/reporter/http/http-reporter.edge-light.js"
|
|
@@ -184,10 +186,6 @@
|
|
|
184
186
|
"browser": {
|
|
185
187
|
"types": "./dist/reporter/http/http-reporter.d.ts",
|
|
186
188
|
"default": "./dist/reporter/http/http-reporter.js"
|
|
187
|
-
},
|
|
188
|
-
"import": {
|
|
189
|
-
"types": "./dist/reporter/http/http-reporter.d.ts",
|
|
190
|
-
"default": "./dist/reporter/http/http-reporter.js"
|
|
191
189
|
}
|
|
192
190
|
},
|
|
193
191
|
"./object-tree": {
|
|
@@ -231,13 +229,13 @@
|
|
|
231
229
|
"LICENSE.md"
|
|
232
230
|
],
|
|
233
231
|
"dependencies": {
|
|
234
|
-
"@visulima/colorize": "2.0.0-alpha.
|
|
235
|
-
"@visulima/interactive-manager": "1.0.0-alpha.
|
|
232
|
+
"@visulima/colorize": "2.0.0-alpha.12",
|
|
233
|
+
"@visulima/interactive-manager": "1.0.0-alpha.3"
|
|
236
234
|
},
|
|
237
235
|
"peerDependencies": {
|
|
238
236
|
"@opentelemetry/api": "^1.9.1",
|
|
239
237
|
"@sveltejs/kit": ">=2.0",
|
|
240
|
-
"@visulima/redact": "3.0.0-alpha.
|
|
238
|
+
"@visulima/redact": "3.0.0-alpha.12",
|
|
241
239
|
"elysia": ">=1.0",
|
|
242
240
|
"express": ">=4.0",
|
|
243
241
|
"fastify": ">=4.0",
|