@meshflow/logger 0.1.0 → 0.1.2

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 CHANGED
@@ -16,26 +16,35 @@ interface LoggerInternalEvents {
16
16
  };
17
17
  'node:intercept': {
18
18
  path: string;
19
- reason: string;
19
+ type: number;
20
20
  detail?: any;
21
21
  };
22
22
  'node:release': {
23
23
  path: string;
24
- reason: string;
24
+ type: number;
25
+ detail?: any;
25
26
  };
26
27
  'node:stagnate': {
27
28
  path: string;
28
- reason: string;
29
+ type: number;
29
30
  };
30
31
  'node:processing': {
31
32
  path: string;
32
33
  };
33
34
  'flow:wait': {
34
- reason: string;
35
+ type: number;
36
+ detail?: any;
35
37
  };
36
38
  'flow:fire': {
37
39
  path: string;
38
- reason: string;
40
+ type: number;
41
+ detail?: any;
42
+ };
43
+ 'flow:success': {
44
+ duration: string;
45
+ };
46
+ 'flow:end': {
47
+ type: number;
39
48
  };
40
49
  }
41
50
  type LoggerEventName = keyof LoggerInternalEvents;
package/index.d.ts CHANGED
@@ -16,26 +16,35 @@ interface LoggerInternalEvents {
16
16
  };
17
17
  'node:intercept': {
18
18
  path: string;
19
- reason: string;
19
+ type: number;
20
20
  detail?: any;
21
21
  };
22
22
  'node:release': {
23
23
  path: string;
24
- reason: string;
24
+ type: number;
25
+ detail?: any;
25
26
  };
26
27
  'node:stagnate': {
27
28
  path: string;
28
- reason: string;
29
+ type: number;
29
30
  };
30
31
  'node:processing': {
31
32
  path: string;
32
33
  };
33
34
  'flow:wait': {
34
- reason: string;
35
+ type: number;
36
+ detail?: any;
35
37
  };
36
38
  'flow:fire': {
37
39
  path: string;
38
- reason: string;
40
+ type: number;
41
+ detail?: any;
42
+ };
43
+ 'flow:success': {
44
+ duration: string;
45
+ };
46
+ 'flow:end': {
47
+ type: number;
39
48
  };
40
49
  }
41
50
  type LoggerEventName = keyof LoggerInternalEvents;
package/index.js CHANGED
@@ -1 +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});
1
+ "use strict";var a=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var p=(o,t)=>{for(var n in t)a(o,n,{get:t[n],enumerable:!0})},u=(o,t,n,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of d(t))!g.call(o,r)&&r!==n&&a(o,r,{get:()=>t[r],enumerable:!(e=l(t,r))||e.enumerable});return o};var f=o=>u(a({},"__esModule",{value:!0}),o);var x={};p(x,{useLogger:()=>h});module.exports=f(x);var i={1:o=>` \u4E0A\u6E38${o.path} \u503C\u53D8\u4E86`,2:o=>`\u4E0A\u6E38 ${o.path} \u5B8C\u6210(\u7A7F\u900F)`,3:o=>`\u6C34\u4F4D\u63A8\u8FDB\u81F3 L${o.level}\uFF0C\u91CA\u653E\u6682\u5B58\u8282\u70B9`,4:o=>`\u8D2A\u5A6A\u63A8\u8FDB${o.path}`},b={1:()=>"\u4EE4\u724C\u8FC7\u671F\uFF0C\u4E22\u5F03\u65E7\u4EFB\u52A1\u8BA1\u7B97\u7ED3\u679C",2:()=>"\u5DF2\u8BA1\u7B97\u5B8C\u6210",3:()=>"\u8282\u70B9\u6B63\u5728\u88AB\u8BA1\u7B97,\u5FFD\u7565\u672C\u6B21\u91CD\u590D\u4FE1\u53F7",3.1:()=>"\u8282\u70B9\u6B63\u5728\u961F\u5217\u4E2D,\u5FFD\u7565\u672C\u6B21\u91CD\u590D\u4FE1\u53F7",4:o=>`\u5C42\u7EA7\u8FC7\u9AD8(L${o.targetLevel}>L${o.currentLevel})\uFF0C\u9000\u56DE\u6682\u5B58\u533A\u7B49\u5F85\u4E0A\u6E38(\u4F59${o.pendingParentsCount})`,5:o=>`\u4E0A\u6E38\u5DF2\u6E05,\u6682\u65F6\u6263\u62BC\uFF0C\u7B49\u5F85\u6C34\u4F4D (L${o.currentLevel} \u2794 L${o.targetLevel})`,6:()=>"\u4E0A\u6E38\u9759\u9ED8\uFF0C\u94FE\u8DEF\u6536\u655B",7:()=>"\u80CC\u538B\u62E6\u622A"},y={1:o=>`\u8C03\u5EA6\u6302\u8D77\uFF1A\u5C1A\u6709 ${o.nums} \u4E2A\u5F02\u6B65\u4EFB\u52A1\u5728\u9014...`,2:()=>"\u5E76\u53D1\u8FBE\u5230\u4E0A\u9650\uFF0C\u6682\u505C\u53D1\u8F66"},E={1:o=>`\u5F52\u822A\uFF0C\u6D3B\u8DC3\u533A: ${o.active}\u4E2A\u4EFB\u52A1, \u7F13\u51B2\u533A: ${o.pending}\u4E2A\u4EFB\u52A1,\u6302\u8D77\u533A:${o.blocked}\u4E2A\u4EFB\u52A1.`},$={1:()=>"\u4E0A\u6E38\u9759\u9ED8\uFF0C\u5019\u8865\u6302\u8D77"},L={1:()=>"\u6700\u7EC8\u5F52\u822A\uFF01\u6240\u6709\u4EFB\u52A1\u5DF2\u6E05\u7A7A\uFF0C\u91CD\u542F\u8C03\u5EA6\u68C0\u67E5\u6536\u5C3E\u3002"},h=()=>({apply:t=>{let n=(e,r)=>t.on(e,r);n("node:start",({path:e})=>{console.log(`%c\u{1F680} [Start] %c${e}`,"color: #58b9ff; font-weight: bold","color: #e0e0e0")}),n("node:success",({path:e})=>{console.log(`%c\u2705 [Success] %c${e}`,"color: #67C23A; font-weight: bold","color: #e0e0e0")}),n("node:bucket:success",({path:e,key:r,value:c})=>{console.log(` %c\u2514\u2500 %c[${e}] %c${r} %c\u2794`,"color: #717171","color: #58b9ff","color: #e0e0e0; font-weight: bold","color: #909399",c)}),n("node:processing",({path:e})=>{console.log(`%c\u{1F6F0}\uFE0F [Processing] %c${e}`,"color: #00bcd4","color: #909399")}),n("node:error",({path:e,error:r})=>{console.log(`%c\u274C [Error] %c${e}`,"background: #F56C6C; color: #fff; padding: 2px 4px","color: #F56C6C",r)}),n("node:release",({path:e,type:r,detail:c})=>{let s=i[r](c);console.log(`%c\u{1F30A} [Release] %c${s} %c\u2794 %c${e}`,"color: #F56C6C; font-weight: bold","color: #909399","color: #717171","color: #58b9ff; font-weight: bold")}),n("node:intercept",({path:e,type:r,detail:c})=>{let s=b[r](c);console.log(`%c\u{1F6D1} [Intercept] %c${e} | ${s}`,"background: #FFF7E8; color: #E6A23C; padding: 2px 4px","color: #E6A23C")}),n("node:stagnate",({path:e,type:r})=>{let c=$[r]();console.log(`%c\u{1F9CA} [Stagnate] %c${c} %c\u2794 %c${e}`,"color: #909399; font-weight: bold","color: #909399","color: #717171","color: #e0e0e0")}),n("flow:wait",({type:e,detail:r})=>{let c=y[e](r);console.log(`%c \u{1F4A4} [Wait] %c ${c} `,"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; ")}),n("flow:fire",({path:e,type:r,detail:c})=>{let s=E[r](c);console.log(`%c\u{1F525} [Fire] %c ${e} ${s} `,"background: #ff9800; color: #000; font-weight: bold; border-radius: 2px 0 0 2px;","background: #444; color: #ff9800; border-radius: 0 2px 2px 0;")}),n("flow:end",({type:e})=>{let r=L[e]();console.log(`%c ${r} `,"background: #ff9800; color: #000; font-weight: bold; border-radius: 2px 0 0 2px;")}),n("flow:success",({duration:e})=>{console.log(`%c\u{1F389} [Flow Success] ${e} \u26A1 `,"color: #fff; background: #2e7d32; padding: 2px 4px; border-radius: 4px 0 0 4px;")})}});0&&(module.exports={useLogger});
package/index.mjs CHANGED
@@ -1 +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};
1
+ var a={1:e=>` \u4E0A\u6E38${e.path} \u503C\u53D8\u4E86`,2:e=>`\u4E0A\u6E38 ${e.path} \u5B8C\u6210(\u7A7F\u900F)`,3:e=>`\u6C34\u4F4D\u63A8\u8FDB\u81F3 L${e.level}\uFF0C\u91CA\u653E\u6682\u5B58\u8282\u70B9`,4:e=>`\u8D2A\u5A6A\u63A8\u8FDB${e.path}`},l={1:()=>"\u4EE4\u724C\u8FC7\u671F\uFF0C\u4E22\u5F03\u65E7\u4EFB\u52A1\u8BA1\u7B97\u7ED3\u679C",2:()=>"\u5DF2\u8BA1\u7B97\u5B8C\u6210",3:()=>"\u8282\u70B9\u6B63\u5728\u88AB\u8BA1\u7B97,\u5FFD\u7565\u672C\u6B21\u91CD\u590D\u4FE1\u53F7",3.1:()=>"\u8282\u70B9\u6B63\u5728\u961F\u5217\u4E2D,\u5FFD\u7565\u672C\u6B21\u91CD\u590D\u4FE1\u53F7",4:e=>`\u5C42\u7EA7\u8FC7\u9AD8(L${e.targetLevel}>L${e.currentLevel})\uFF0C\u9000\u56DE\u6682\u5B58\u533A\u7B49\u5F85\u4E0A\u6E38(\u4F59${e.pendingParentsCount})`,5:e=>`\u4E0A\u6E38\u5DF2\u6E05,\u6682\u65F6\u6263\u62BC\uFF0C\u7B49\u5F85\u6C34\u4F4D (L${e.currentLevel} \u2794 L${e.targetLevel})`,6:()=>"\u4E0A\u6E38\u9759\u9ED8\uFF0C\u94FE\u8DEF\u6536\u655B",7:()=>"\u80CC\u538B\u62E6\u622A"},d={1:e=>`\u8C03\u5EA6\u6302\u8D77\uFF1A\u5C1A\u6709 ${e.nums} \u4E2A\u5F02\u6B65\u4EFB\u52A1\u5728\u9014...`,2:()=>"\u5E76\u53D1\u8FBE\u5230\u4E0A\u9650\uFF0C\u6682\u505C\u53D1\u8F66"},g={1:e=>`\u5F52\u822A\uFF0C\u6D3B\u8DC3\u533A: ${e.active}\u4E2A\u4EFB\u52A1, \u7F13\u51B2\u533A: ${e.pending}\u4E2A\u4EFB\u52A1,\u6302\u8D77\u533A:${e.blocked}\u4E2A\u4EFB\u52A1.`},p={1:()=>"\u4E0A\u6E38\u9759\u9ED8\uFF0C\u5019\u8865\u6302\u8D77"},u={1:()=>"\u6700\u7EC8\u5F52\u822A\uFF01\u6240\u6709\u4EFB\u52A1\u5DF2\u6E05\u7A7A\uFF0C\u91CD\u542F\u8C03\u5EA6\u68C0\u67E5\u6536\u5C3E\u3002"},f=()=>({apply:s=>{let n=(o,r)=>s.on(o,r);n("node:start",({path:o})=>{console.log(`%c\u{1F680} [Start] %c${o}`,"color: #58b9ff; font-weight: bold","color: #e0e0e0")}),n("node:success",({path:o})=>{console.log(`%c\u2705 [Success] %c${o}`,"color: #67C23A; font-weight: bold","color: #e0e0e0")}),n("node:bucket:success",({path:o,key:r,value:t})=>{console.log(` %c\u2514\u2500 %c[${o}] %c${r} %c\u2794`,"color: #717171","color: #58b9ff","color: #e0e0e0; font-weight: bold","color: #909399",t)}),n("node:processing",({path:o})=>{console.log(`%c\u{1F6F0}\uFE0F [Processing] %c${o}`,"color: #00bcd4","color: #909399")}),n("node:error",({path:o,error:r})=>{console.log(`%c\u274C [Error] %c${o}`,"background: #F56C6C; color: #fff; padding: 2px 4px","color: #F56C6C",r)}),n("node:release",({path:o,type:r,detail:t})=>{let c=a[r](t);console.log(`%c\u{1F30A} [Release] %c${c} %c\u2794 %c${o}`,"color: #F56C6C; font-weight: bold","color: #909399","color: #717171","color: #58b9ff; font-weight: bold")}),n("node:intercept",({path:o,type:r,detail:t})=>{let c=l[r](t);console.log(`%c\u{1F6D1} [Intercept] %c${o} | ${c}`,"background: #FFF7E8; color: #E6A23C; padding: 2px 4px","color: #E6A23C")}),n("node:stagnate",({path:o,type:r})=>{let t=p[r]();console.log(`%c\u{1F9CA} [Stagnate] %c${t} %c\u2794 %c${o}`,"color: #909399; font-weight: bold","color: #909399","color: #717171","color: #e0e0e0")}),n("flow:wait",({type:o,detail:r})=>{let t=d[o](r);console.log(`%c \u{1F4A4} [Wait] %c ${t} `,"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; ")}),n("flow:fire",({path:o,type:r,detail:t})=>{let c=g[r](t);console.log(`%c\u{1F525} [Fire] %c ${o} ${c} `,"background: #ff9800; color: #000; font-weight: bold; border-radius: 2px 0 0 2px;","background: #444; color: #ff9800; border-radius: 0 2px 2px 0;")}),n("flow:end",({type:o})=>{let r=u[o]();console.log(`%c ${r} `,"background: #ff9800; color: #000; font-weight: bold; border-radius: 2px 0 0 2px;")}),n("flow:success",({duration:o})=>{console.log(`%c\u{1F389} [Flow Success] ${o} \u26A1 `,"color: #fff; background: #2e7d32; padding: 2px 4px; border-radius: 4px 0 0 4px;")})}});export{f as useLogger};
package/package.json CHANGED
@@ -1,16 +1,27 @@
1
1
  {
2
2
  "name": "@meshflow/logger",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "The official logger plugin for MeshFlow",
5
5
  "main": "./lib-dist/index.js",
6
6
  "module": "./lib-dist/index.mjs",
7
7
  "types": "./lib-dist/index.d.ts",
8
-
8
+ "author": "nzy",
9
9
  "peerDependencies": {
10
- "@meshflow/core": ">=0.1.3"
10
+ "@meshflow/core": ">=0.1.6"
11
11
  },
12
12
  "publishConfig": {
13
13
  "access": "public",
14
14
  "registry": "https://registry.npmjs.org/"
15
- }
15
+ },
16
+ "license": "MIT",
17
+ "keywords": [
18
+ "form",
19
+ "form-engine",
20
+ "logic-engine",
21
+ "topology",
22
+ "async-linkage",
23
+ "watermark",
24
+ "dag",
25
+ "reactive"
26
+ ]
16
27
  }