@meshflow/logger 0.1.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.
- package/index.d.mts +48 -0
- package/index.d.ts +48 -0
- package/index.js +1 -0
- package/index.mjs +1 -0
- package/package.json +16 -0
package/index.d.mts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
interface LoggerInternalEvents {
|
|
2
|
+
'node:start': {
|
|
3
|
+
path: string;
|
|
4
|
+
};
|
|
5
|
+
'node:success': {
|
|
6
|
+
path: string;
|
|
7
|
+
};
|
|
8
|
+
'node:bucket:success': {
|
|
9
|
+
path: string;
|
|
10
|
+
key: string;
|
|
11
|
+
value: any;
|
|
12
|
+
};
|
|
13
|
+
'node:error': {
|
|
14
|
+
path: string;
|
|
15
|
+
error: any;
|
|
16
|
+
};
|
|
17
|
+
'node:intercept': {
|
|
18
|
+
path: string;
|
|
19
|
+
reason: string;
|
|
20
|
+
detail?: any;
|
|
21
|
+
};
|
|
22
|
+
'node:release': {
|
|
23
|
+
path: string;
|
|
24
|
+
reason: string;
|
|
25
|
+
};
|
|
26
|
+
'node:stagnate': {
|
|
27
|
+
path: string;
|
|
28
|
+
reason: string;
|
|
29
|
+
};
|
|
30
|
+
'node:processing': {
|
|
31
|
+
path: string;
|
|
32
|
+
};
|
|
33
|
+
'flow:wait': {
|
|
34
|
+
reason: string;
|
|
35
|
+
};
|
|
36
|
+
'flow:fire': {
|
|
37
|
+
path: string;
|
|
38
|
+
reason: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
type LoggerEventName = keyof LoggerInternalEvents;
|
|
42
|
+
declare const useLogger: () => {
|
|
43
|
+
apply: (api: {
|
|
44
|
+
on: (event: LoggerEventName, cb: (data: any) => void) => void;
|
|
45
|
+
}) => void;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { useLogger };
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
interface LoggerInternalEvents {
|
|
2
|
+
'node:start': {
|
|
3
|
+
path: string;
|
|
4
|
+
};
|
|
5
|
+
'node:success': {
|
|
6
|
+
path: string;
|
|
7
|
+
};
|
|
8
|
+
'node:bucket:success': {
|
|
9
|
+
path: string;
|
|
10
|
+
key: string;
|
|
11
|
+
value: any;
|
|
12
|
+
};
|
|
13
|
+
'node:error': {
|
|
14
|
+
path: string;
|
|
15
|
+
error: any;
|
|
16
|
+
};
|
|
17
|
+
'node:intercept': {
|
|
18
|
+
path: string;
|
|
19
|
+
reason: string;
|
|
20
|
+
detail?: any;
|
|
21
|
+
};
|
|
22
|
+
'node:release': {
|
|
23
|
+
path: string;
|
|
24
|
+
reason: string;
|
|
25
|
+
};
|
|
26
|
+
'node:stagnate': {
|
|
27
|
+
path: string;
|
|
28
|
+
reason: string;
|
|
29
|
+
};
|
|
30
|
+
'node:processing': {
|
|
31
|
+
path: string;
|
|
32
|
+
};
|
|
33
|
+
'flow:wait': {
|
|
34
|
+
reason: string;
|
|
35
|
+
};
|
|
36
|
+
'flow:fire': {
|
|
37
|
+
path: string;
|
|
38
|
+
reason: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
type LoggerEventName = keyof LoggerInternalEvents;
|
|
42
|
+
declare const useLogger: () => {
|
|
43
|
+
apply: (api: {
|
|
44
|
+
on: (event: LoggerEventName, cb: (data: any) => void) => void;
|
|
45
|
+
}) => void;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { useLogger };
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var d=(c,n)=>{for(var r in n)t(c,r,{get:n[r],enumerable:!0})},i=(c,n,r,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of g(n))!a.call(c,e)&&e!==r&&t(c,e,{get:()=>n[e],enumerable:!(o=l(n,e))||o.enumerable});return c};var p=c=>i(t({},"__esModule",{value:!0}),c);var b={};d(b,{useLogger:()=>f});module.exports=p(b);var f=()=>({apply:n=>{let r=(o,e)=>n.on(o,e);r("node:start",({path:o})=>{console.log(`%c\u{1F680} [Start] %c${o}`,"color: #58b9ff; font-weight: bold","color: #e0e0e0")}),r("node:success",({path:o})=>{console.log(`%c\u2705 [Success] %c${o}`,"color: #67C23A; font-weight: bold","color: #e0e0e0")}),r("node:bucket:success",({path:o,key:e,value:s})=>{console.log(` %c\u2514\u2500 %c[${o}] %c${e} %c\u2794`,"color: #717171","color: #58b9ff","color: #e0e0e0; font-weight: bold","color: #909399",s)}),r("node:processing",({path:o})=>{console.log(`%c\u{1F6F0}\uFE0F [Processing] %c${o}`,"color: #00bcd4","color: #909399")}),r("node:error",({path:o,error:e})=>{console.log(`%c\u274C [Error] %c${o}`,"background: #F56C6C; color: #fff; padding: 2px 4px","color: #F56C6C",e)}),r("node:release",({path:o,reason:e})=>{console.log(`%c\u{1F525} [Release] %c${e} %c\u2794 %c${o}`,"color: #F56C6C; font-weight: bold","color: #909399","color: #717171","color: #58b9ff; font-weight: bold")}),r("node:intercept",({path:o,reason:e})=>{console.log(`%c\u{1F6D1} [Intercept] %c${o} | ${e}`,"background: #FFF7E8; color: #E6A23C; padding: 2px 4px","color: #E6A23C")}),r("node:stagnate",({path:o,reason:e})=>{console.log(`%c\u{1F9CA} [Stagnate] %c${e} %c\u2794 %c${o}`,"color: #909399; font-weight: bold","color: #909399","color: #717171","color: #e0e0e0")}),r("flow:wait",({reason:o})=>{console.log(`%c \u{1F4A4} [Wait] %c ${o} `,"background: #444; font-weight: bold; border-radius: 4px 0 0 4px; border: 1px solid #555; border-right: none;","background: #222; border-radius: 0 4px 4px 0; border: 1px solid #555; ")}),r("flow:fire",({path:o,reason:e})=>{console.log(`%c\u{1F525} [Fire] %c ${o} ${e} `,"background: #ff9800; color: #000; font-weight: bold; border-radius: 2px 0 0 2px;","background: #444; color: #ff9800; border-radius: 0 2px 2px 0;")})}});0&&(module.exports={useLogger});
|
package/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=()=>({apply:n=>{let r=(o,e)=>n.on(o,e);r("node:start",({path:o})=>{console.log(`%c\u{1F680} [Start] %c${o}`,"color: #58b9ff; font-weight: bold","color: #e0e0e0")}),r("node:success",({path:o})=>{console.log(`%c\u2705 [Success] %c${o}`,"color: #67C23A; font-weight: bold","color: #e0e0e0")}),r("node:bucket:success",({path:o,key:e,value:c})=>{console.log(` %c\u2514\u2500 %c[${o}] %c${e} %c\u2794`,"color: #717171","color: #58b9ff","color: #e0e0e0; font-weight: bold","color: #909399",c)}),r("node:processing",({path:o})=>{console.log(`%c\u{1F6F0}\uFE0F [Processing] %c${o}`,"color: #00bcd4","color: #909399")}),r("node:error",({path:o,error:e})=>{console.log(`%c\u274C [Error] %c${o}`,"background: #F56C6C; color: #fff; padding: 2px 4px","color: #F56C6C",e)}),r("node:release",({path:o,reason:e})=>{console.log(`%c\u{1F525} [Release] %c${e} %c\u2794 %c${o}`,"color: #F56C6C; font-weight: bold","color: #909399","color: #717171","color: #58b9ff; font-weight: bold")}),r("node:intercept",({path:o,reason:e})=>{console.log(`%c\u{1F6D1} [Intercept] %c${o} | ${e}`,"background: #FFF7E8; color: #E6A23C; padding: 2px 4px","color: #E6A23C")}),r("node:stagnate",({path:o,reason:e})=>{console.log(`%c\u{1F9CA} [Stagnate] %c${e} %c\u2794 %c${o}`,"color: #909399; font-weight: bold","color: #909399","color: #717171","color: #e0e0e0")}),r("flow:wait",({reason:o})=>{console.log(`%c \u{1F4A4} [Wait] %c ${o} `,"background: #444; font-weight: bold; border-radius: 4px 0 0 4px; border: 1px solid #555; border-right: none;","background: #222; border-radius: 0 4px 4px 0; border: 1px solid #555; ")}),r("flow:fire",({path:o,reason:e})=>{console.log(`%c\u{1F525} [Fire] %c ${o} ${e} `,"background: #ff9800; color: #000; font-weight: bold; border-radius: 2px 0 0 2px;","background: #444; color: #ff9800; border-radius: 0 2px 2px 0;")})}});export{s as useLogger};
|
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@meshflow/logger",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The official logger plugin for MeshFlow",
|
|
5
|
+
"main": "./lib-dist/index.js",
|
|
6
|
+
"module": "./lib-dist/index.mjs",
|
|
7
|
+
"types": "./lib-dist/index.d.ts",
|
|
8
|
+
|
|
9
|
+
"peerDependencies": {
|
|
10
|
+
"@meshflow/core": ">=0.1.3"
|
|
11
|
+
},
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public",
|
|
14
|
+
"registry": "https://registry.npmjs.org/"
|
|
15
|
+
}
|
|
16
|
+
}
|