@meshflow/logger 0.1.0 → 0.1.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/index.d.mts CHANGED
@@ -16,26 +16,32 @@ 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;
39
45
  };
40
46
  }
41
47
  type LoggerEventName = keyof LoggerInternalEvents;
package/index.d.ts CHANGED
@@ -16,26 +16,32 @@ 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;
39
45
  };
40
46
  }
41
47
  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=(e,t)=>{for(var r in t)a(e,r,{get:t[r],enumerable:!0})},i=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of d(t))!g.call(e,n)&&n!==r&&a(e,n,{get:()=>t[n],enumerable:!(o=l(t,n))||o.enumerable});return e};var u=e=>i(a({},"__esModule",{value:!0}),e);var x={};p(x,{useLogger:()=>h});module.exports=u(x);var f={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`},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\u961F\u5217\u6216\u88AB\u8BA1\u7B97,\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})`},y={1:e=>`\u8C03\u5EA6\u6302\u8D77\uFF1A\u5C1A\u6709 ${e.nums} \u4E2A\u5F02\u6B65\u4EFB\u52A1\u5728\u9014...`},E={1:e=>`\u5F52\u822A\uFF0C\u5269\u4F59 ${e.remaining} \u4E2A\u4EFB\u52A1\u5728\u9014\uFF0C\u7CFB\u7EDF\u4FDD\u6301\u5F85\u673A\u3002`,2:e=>"\u6700\u7EC8\u5F52\u822A\uFF01\u6240\u6709\u4EFB\u52A1\u5DF2\u6E05\u7A7A\uFF0C\u91CD\u542F\u8C03\u5EA6\u68C0\u67E5\u6536\u5C3E\u3002"},$={1:()=>"\u4E0A\u6E38\u9759\u9ED8\uFF0C\u5019\u8865\u6302\u8D77"},h=()=>({apply:t=>{let r=(o,n)=>t.on(o,n);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:n,value:c})=>{console.log(` %c\u2514\u2500 %c[${o}] %c${n} %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:n})=>{console.log(`%c\u274C [Error] %c${o}`,"background: #F56C6C; color: #fff; padding: 2px 4px","color: #F56C6C",n)}),r("node:release",({path:o,type:n,detail:c})=>{let s=f[n](c);console.log(`%c\u{1F30A} [Release] %c${s} %c\u2794 %c${o}`,"color: #F56C6C; font-weight: bold","color: #909399","color: #717171","color: #58b9ff; font-weight: bold")}),r("node:intercept",({path:o,type:n,detail:c})=>{let s=b[n](c);console.log(`%c\u{1F6D1} [Intercept] %c${o} | ${s}`,"background: #FFF7E8; color: #E6A23C; padding: 2px 4px","color: #E6A23C")}),r("node:stagnate",({path:o,type:n})=>{let c=$[n]();console.log(`%c\u{1F9CA} [Stagnate] %c${c} %c\u2794 %c${o}`,"color: #909399; font-weight: bold","color: #909399","color: #717171","color: #e0e0e0")}),r("flow:wait",({type:o,detail:n})=>{let c=y[o](n);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; ")}),r("flow:fire",({path:o,type:n,detail:c})=>{let s=E[n](c);console.log(`%c\u{1F525} [Fire] %c ${o} ${s} `,"background: #ff9800; color: #000; font-weight: bold; border-radius: 2px 0 0 2px;","background: #444; color: #ff9800; border-radius: 0 2px 2px 0;")}),r("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;")})}});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`},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\u961F\u5217\u6216\u88AB\u8BA1\u7B97,\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})`},d={1:e=>`\u8C03\u5EA6\u6302\u8D77\uFF1A\u5C1A\u6709 ${e.nums} \u4E2A\u5F02\u6B65\u4EFB\u52A1\u5728\u9014...`},g={1:e=>`\u5F52\u822A\uFF0C\u5269\u4F59 ${e.remaining} \u4E2A\u4EFB\u52A1\u5728\u9014\uFF0C\u7CFB\u7EDF\u4FDD\u6301\u5F85\u673A\u3002`,2:e=>"\u6700\u7EC8\u5F52\u822A\uFF01\u6240\u6709\u4EFB\u52A1\u5DF2\u6E05\u7A7A\uFF0C\u91CD\u542F\u8C03\u5EA6\u68C0\u67E5\u6536\u5C3E\u3002"},p={1:()=>"\u4E0A\u6E38\u9759\u9ED8\uFF0C\u5019\u8865\u6302\u8D77"},i=()=>({apply:s=>{let r=(o,n)=>s.on(o,n);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:n,value:t})=>{console.log(` %c\u2514\u2500 %c[${o}] %c${n} %c\u2794`,"color: #717171","color: #58b9ff","color: #e0e0e0; font-weight: bold","color: #909399",t)}),r("node:processing",({path:o})=>{console.log(`%c\u{1F6F0}\uFE0F [Processing] %c${o}`,"color: #00bcd4","color: #909399")}),r("node:error",({path:o,error:n})=>{console.log(`%c\u274C [Error] %c${o}`,"background: #F56C6C; color: #fff; padding: 2px 4px","color: #F56C6C",n)}),r("node:release",({path:o,type:n,detail:t})=>{let c=a[n](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")}),r("node:intercept",({path:o,type:n,detail:t})=>{let c=l[n](t);console.log(`%c\u{1F6D1} [Intercept] %c${o} | ${c}`,"background: #FFF7E8; color: #E6A23C; padding: 2px 4px","color: #E6A23C")}),r("node:stagnate",({path:o,type:n})=>{let t=p[n]();console.log(`%c\u{1F9CA} [Stagnate] %c${t} %c\u2794 %c${o}`,"color: #909399; font-weight: bold","color: #909399","color: #717171","color: #e0e0e0")}),r("flow:wait",({type:o,detail:n})=>{let t=d[o](n);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; ")}),r("flow:fire",({path:o,type:n,detail:t})=>{let c=g[n](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;")}),r("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{i 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.1",
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
10
  "@meshflow/core": ">=0.1.3"
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
  }