vona-module-a-printtip 5.0.25 → 5.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/LICENSE +0 -0
- package/dist/.metadata/index.d.ts +1 -0
- package/dist/.metadata/index.d.ts.map +1 -0
- package/dist/.metadata/this.d.ts +1 -0
- package/dist/.metadata/this.d.ts.map +1 -0
- package/dist/bean/hmr.metaPrintTip.d.ts +1 -0
- package/dist/bean/hmr.metaPrintTip.d.ts.map +1 -0
- package/dist/bean/startup.printTip.d.ts +1 -0
- package/dist/bean/startup.printTip.d.ts.map +1 -0
- package/dist/config/config.d.ts +1 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -23
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/printTip.d.ts +1 -0
- package/dist/types/printTip.d.ts.map +1 -0
- package/package.json +27 -22
- package/src/.metadata/index.ts +88 -0
- package/src/.metadata/this.ts +2 -0
- package/src/bean/hmr.metaPrintTip.ts +12 -0
- package/src/bean/startup.printTip.ts +49 -0
- package/src/config/config.ts +7 -0
- package/src/index.ts +3 -0
- package/src/types/index.ts +1 -0
- package/src/types/printTip.ts +20 -0
package/LICENSE
CHANGED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/.metadata/index.ts"],"names":[],"mappings":"AACA,qBAAqB;AACrB,cAAc,6BAA6B,CAAC;AAE5C,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,QAAQ,uBAAuB,CAAC;IAEnC,UAAiB,cAAc;QAC7B,qBAAqB,EAAE,wBAAwB,CAAC;KACjD;CAGJ;AACD,OAAO,QAAQ,wBAAwB,CAAC;IAEhC,UAAiB,eAAe;KAG/B;IAEC,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sourceRoot":"","sources":["../../src/.metadata/this.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,eAAe,CAAC;AAC3C,OAAO,EAAE,oBAAoB,IAAI,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmr.metaPrintTip.d.ts","sourceRoot":"","sources":["../../src/bean/hmr.metaPrintTip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,MAAM,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAGhC,qBACa,eAAgB,SAAQ,QAAS,YAAW,UAAU;IAC3D,MAAM,CAAC,YAAY,EAAE,yBAAyB;CAGrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"startup.printTip.d.ts","sourceRoot":"","sources":["../../src/bean/startup.printTip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAQhC,qBAOa,eAAgB,SAAQ,QAAS,YAAW,eAAe;IAChE,OAAO;IAOP,MAAM;CAsBb"}
|
package/dist/config/config.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAE5C,wBAAgB,MAAM,CAAC,IAAI,EAAE,eAAe;;EAI3C"}
|
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,13 @@
|
|
|
1
1
|
import { BeanInfo, BeanBase, BeanScopeBase } from 'vona';
|
|
2
|
+
import { __decorate } from 'tslib';
|
|
2
3
|
import chalk from 'chalk';
|
|
3
4
|
import { Startup } from 'vona-module-a-startup';
|
|
4
|
-
import { Hmr } from 'vona-module-a-
|
|
5
|
+
import { Hmr } from 'vona-module-a-hmrbase';
|
|
5
6
|
import { Scope } from 'vona-module-a-bean';
|
|
6
7
|
|
|
7
|
-
var _dec$2, _dec2$2, _class$2;
|
|
8
8
|
const __tipBegin = '=================== tip: begin ===================';
|
|
9
9
|
const __tipEnd = '=================== tip: end =====================';
|
|
10
|
-
let StartupPrintTip =
|
|
11
|
-
instance: true,
|
|
12
|
-
debounce: true,
|
|
13
|
-
after: true,
|
|
14
|
-
meta: {
|
|
15
|
-
mode: 'dev'
|
|
16
|
-
},
|
|
17
|
-
dependencies: 'a-runtime:runtime'
|
|
18
|
-
}), _dec2$2 = BeanInfo({
|
|
19
|
-
module: "a-printtip"
|
|
20
|
-
}), _dec$2(_class$2 = _dec2$2(_class$2 = class StartupPrintTip extends BeanBase {
|
|
10
|
+
let StartupPrintTip = class StartupPrintTip extends BeanBase {
|
|
21
11
|
async execute() {
|
|
22
12
|
if (this.app.meta.env.LOGGER_DUMMY === 'true') return;
|
|
23
13
|
setTimeout(async () => {
|
|
@@ -44,16 +34,27 @@ let StartupPrintTip = (_dec$2 = Startup({
|
|
|
44
34
|
const text = `\n${chalk.yellow(__tipBegin)}\n${message}\n${chalk.yellow(__tipEnd)}`;
|
|
45
35
|
this.$logger.silly(text);
|
|
46
36
|
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
};
|
|
38
|
+
StartupPrintTip = __decorate([Startup({
|
|
39
|
+
instance: true,
|
|
40
|
+
debounce: true,
|
|
41
|
+
after: true,
|
|
42
|
+
meta: {
|
|
43
|
+
mode: 'dev'
|
|
44
|
+
},
|
|
45
|
+
dependencies: 'a-runtime:runtime'
|
|
46
|
+
}), BeanInfo({
|
|
51
47
|
module: "a-printtip"
|
|
52
|
-
}),
|
|
48
|
+
})], StartupPrintTip);
|
|
49
|
+
|
|
50
|
+
let HmrMetaPrintTip = class HmrMetaPrintTip extends BeanBase {
|
|
53
51
|
async reload(_beanOptions) {
|
|
54
52
|
await this.bean.instance.reloadWorker('');
|
|
55
53
|
}
|
|
56
|
-
}
|
|
54
|
+
};
|
|
55
|
+
HmrMetaPrintTip = __decorate([Hmr(), BeanInfo({
|
|
56
|
+
module: "a-printtip"
|
|
57
|
+
})], HmrMetaPrintTip);
|
|
57
58
|
|
|
58
59
|
function config(_app) {
|
|
59
60
|
return {
|
|
@@ -61,11 +62,11 @@ function config(_app) {
|
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
let ScopeModuleAPrinttip = class ScopeModuleAPrinttip extends BeanScopeBase {};
|
|
66
|
+
ScopeModuleAPrinttip = __decorate([Scope(), BeanInfo({
|
|
66
67
|
module: "a-printtip"
|
|
67
|
-
}),
|
|
68
|
-
|
|
68
|
+
})], ScopeModuleAPrinttip);
|
|
69
69
|
/** scope: end */
|
|
70
70
|
|
|
71
71
|
export { HmrMetaPrintTip, ScopeModuleAPrinttip, StartupPrintTip, config };
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/bean/startup.printTip.ts","../src/bean/hmr.metaPrintTip.ts","../src/config/config.ts","../src/.metadata/index.ts"],"sourcesContent":[null,null,null,null],"names":["__tipBegin","__tipEnd","StartupPrintTip","BeanBase","execute","app","meta","env","LOGGER_DUMMY","setTimeout","_print","scope","config","delay","outputs","onions","bean","onion","getOnionsEnabledOfMeta","beanInstance","_getBean","beanOptions","beanFullName","res","item","Array","isArray","push","module","message","map","output","chalk","gray","magenta","title","cyan","join","text","yellow","$logger","silly","__decorate","Startup","instance","debounce","after","mode","dependencies","__z_BeanInfo","HmrMetaPrintTip","reload","_beanOptions","reloadWorker","Hmr","_app","ScopeModuleAPrinttip","BeanScopeBase","Scope"],"mappings":";;;;;;;AAQA,MAAMA,UAAU,GAAG,oDAAoD;AACvE,MAAMC,QAAQ,GAAG,oDAAoD;AAS9D,IAAMC,eAAe,GAArB,MAAMA,eAAgB,SAAQC,QAAQ,CAAA;EAC3C,MAAMC,OAAOA,GAAA;IACX,IAAI,IAAI,CAACC,GAAG,CAACC,IAAI,CAACC,GAAG,CAACC,YAAY,KAAK,MAAM,EAAE;AAC/CC,IAAAA,UAAU,CAAC,YAAW;AACpB,MAAA,MAAM,IAAI,CAACC,MAAM,EAAE;IACrB,CAAC,EAAE,IAAI,CAACC,KAAK,CAACC,MAAM,CAACC,KAAK,CAAC;AAC7B,EAAA;EAEA,MAAMH,MAAMA,GAAA;AACV;IACA,MAAMI,OAAO,GAA6B,EAAE;AAC5C,IAAA,MAAMC,MAAM,GAAG,IAAI,CAACC,IAAI,CAACC,KAAK,CAACX,IAAI,CAACY,sBAAsB,CAAC,IAAI,EAAE,UAAU,CAAC;AAC5E,IAAA,KAAK,MAAMD,KAAK,IAAIF,MAAM,EAAE;AAC1B,MAAA,MAAMI,YAAY,GAAG,IAAI,CAACH,IAAI,CAACI,QAAQ,CAAuBH,KAAK,CAACI,WAAW,CAACC,YAAmB,CAAC;AACpG,MAAA,MAAMC,GAAG,GAAG,MAAMJ,YAAY,CAACf,OAAO,EAAE;MACxC,IAAI,CAACmB,GAAG,EAAE;AACV,MAAA,KAAK,MAAMC,IAAI,IAAIC,KAAK,CAACC,OAAO,CAACH,GAAG,CAAC,GAAGA,GAAG,GAAG,CAACA,GAAG,CAAC,EAAE;QACnDT,OAAO,CAACa,IAAI,CAAC;AACX,UAAA,GAAGH,IAAI;AACPI,UAAAA,MAAM,EAAEX,KAAK,CAACI,WAAW,CAAC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AE,EAAAL,QAAA,CAAA;EAAArB,MAAA,EAAA;AAAA,CAAA,CAAA,CACO,EAAAsB,eAAe,CAI3B;;ACTK,SAAUtC,MAAMA,CAAC2C,IAAqB,EAAA;EAC1C,OAAO;AACL1C,IAAAA,KAAK,EAAE;GACR;AACH;;ACwDO,IAAM2C,oBAAoB,GAA1B,MAAMA,oBAAqB,SAAQC,aAAa,CAAA;AAA1CD,oBAAoB,GAAAd,UAAA,CAAA,CADhCgB,KAAK,EAAE,EAAAT,QAAA,CAAA;EAAArB,MAAA,EAAA;AAAA,CAAA,CAAA,CACK,EAAA4B,oBAAoB,CAAyB;AAyB1D;;;;"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
package/dist/types/printTip.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"printTip.d.ts","sourceRoot":"","sources":["../../src/types/printTip.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAuB,SAAQ,iBAAiB;IAC/D,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,GAAG,iBAAiB,EAAE,GAAG,SAAS,CAAC;AAEzF,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,OAAO,CAAC,sBAAsB,CAAC,CAAC;CAChD;AAED,OAAO,QAAQ,oBAAoB,CAAC;IAClC,UAAiB,eAAe;QAC9B,QAAQ,EAAE,KAAK,CAAC;KACjB;CACF"}
|
package/package.json
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-printtip",
|
|
3
|
-
"
|
|
4
|
-
"version": "5.0.25",
|
|
5
|
-
"title": "a-printtip",
|
|
6
|
-
"vonaModule": {
|
|
7
|
-
"dependencies": {},
|
|
8
|
-
"metas": {
|
|
9
|
-
"printTip": {
|
|
10
|
-
"boilerplate": "boilerplate"
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
},
|
|
3
|
+
"version": "5.1.2",
|
|
14
4
|
"description": "",
|
|
15
|
-
"author": "",
|
|
16
5
|
"keywords": [
|
|
17
6
|
"Vona Module"
|
|
18
7
|
],
|
|
8
|
+
"author": "",
|
|
9
|
+
"files": [
|
|
10
|
+
"assets",
|
|
11
|
+
"cli",
|
|
12
|
+
"dist",
|
|
13
|
+
"src"
|
|
14
|
+
],
|
|
15
|
+
"type": "module",
|
|
19
16
|
"exports": {
|
|
20
17
|
".": {
|
|
21
18
|
"types": [
|
|
@@ -26,17 +23,25 @@
|
|
|
26
23
|
},
|
|
27
24
|
"./package.json": "./package.json"
|
|
28
25
|
},
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
26
|
+
"scripts": {
|
|
27
|
+
"clean": "rimraf dist tsconfig.build.tsbuildinfo",
|
|
28
|
+
"tsc:publish": "npm run clean && vona :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
29
|
+
"prepublishOnly": "npm run tsc:publish",
|
|
30
|
+
"prepack": "clean-package",
|
|
31
|
+
"postpack": "clean-package restore && npm run clean"
|
|
32
|
+
},
|
|
34
33
|
"devDependencies": {
|
|
35
34
|
"clean-package": "^2.2.0",
|
|
36
35
|
"rimraf": "^6.0.1"
|
|
37
36
|
},
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
"title": "a-printtip",
|
|
38
|
+
"vonaModule": {
|
|
39
|
+
"dependencies": {},
|
|
40
|
+
"metas": {
|
|
41
|
+
"printTip": {
|
|
42
|
+
"boilerplate": "boilerplate"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d"
|
|
47
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// eslint-disable
|
|
2
|
+
/** startup: begin */
|
|
3
|
+
export * from '../bean/startup.printTip.ts';
|
|
4
|
+
|
|
5
|
+
import { type IDecoratorStartupOptions } from 'vona-module-a-startup';
|
|
6
|
+
declare module 'vona-module-a-startup' {
|
|
7
|
+
|
|
8
|
+
export interface IStartupRecord {
|
|
9
|
+
'a-printtip:printTip': IDecoratorStartupOptions;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
declare module 'vona-module-a-printtip' {
|
|
15
|
+
|
|
16
|
+
export interface StartupPrintTip {
|
|
17
|
+
/** @internal */
|
|
18
|
+
get scope(): ScopeModuleAPrinttip;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface StartupPrintTip {
|
|
22
|
+
get $beanFullName(): 'a-printtip.startup.printTip';
|
|
23
|
+
get $onionName(): 'a-printtip:printTip';
|
|
24
|
+
get $onionOptions(): IDecoratorStartupOptions;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/** startup: end */
|
|
28
|
+
/** hmr: begin */
|
|
29
|
+
export * from '../bean/hmr.metaPrintTip.ts';
|
|
30
|
+
|
|
31
|
+
import 'vona';
|
|
32
|
+
declare module 'vona' {
|
|
33
|
+
|
|
34
|
+
export interface IHmrRecord {
|
|
35
|
+
'a-printtip:metaPrintTip': never;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
declare module 'vona-module-a-printtip' {
|
|
41
|
+
|
|
42
|
+
export interface HmrMetaPrintTip {
|
|
43
|
+
/** @internal */
|
|
44
|
+
get scope(): ScopeModuleAPrinttip;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface HmrMetaPrintTip {
|
|
48
|
+
get $beanFullName(): 'a-printtip.hmr.metaPrintTip';
|
|
49
|
+
get $onionName(): 'a-printtip:metaPrintTip';
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** hmr: end */
|
|
54
|
+
/** config: begin */
|
|
55
|
+
export * from '../config/config.ts';
|
|
56
|
+
import type { config } from '../config/config.ts';
|
|
57
|
+
/** config: end */
|
|
58
|
+
/** scope: begin */
|
|
59
|
+
import { BeanScopeBase, type BeanScopeUtil, type TypeModuleConfig } from 'vona';
|
|
60
|
+
import { Scope } from 'vona-module-a-bean';
|
|
61
|
+
|
|
62
|
+
@Scope()
|
|
63
|
+
export class ScopeModuleAPrinttip extends BeanScopeBase {}
|
|
64
|
+
|
|
65
|
+
export interface ScopeModuleAPrinttip {
|
|
66
|
+
util: BeanScopeUtil;
|
|
67
|
+
config: TypeModuleConfig<typeof config>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
import 'vona';
|
|
71
|
+
declare module 'vona' {
|
|
72
|
+
export interface IBeanScopeRecord {
|
|
73
|
+
'a-printtip': ScopeModuleAPrinttip;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface IBeanScopeContainer {
|
|
77
|
+
printtip: ScopeModuleAPrinttip;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface IBeanScopeConfig {
|
|
81
|
+
'a-printtip': ReturnType<typeof config>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
/** scope: end */
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IDecoratorBeanOptionsBase } from 'vona';
|
|
2
|
+
import type { IHmrReload } from 'vona-module-a-hmr';
|
|
3
|
+
|
|
4
|
+
import { BeanBase } from 'vona';
|
|
5
|
+
import { Hmr } from 'vona-module-a-hmrbase';
|
|
6
|
+
|
|
7
|
+
@Hmr()
|
|
8
|
+
export class HmrMetaPrintTip extends BeanBase implements IHmrReload {
|
|
9
|
+
async reload(_beanOptions: IDecoratorBeanOptionsBase) {
|
|
10
|
+
await this.bean.instance.reloadWorker('');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { IStartupExecute } from 'vona-module-a-startup';
|
|
2
|
+
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { BeanBase } from 'vona';
|
|
5
|
+
import { Startup } from 'vona-module-a-startup';
|
|
6
|
+
|
|
7
|
+
import type { IMetaPrintTipExecute, IMetaPrintTipInfoInner } from '../types/printTip.ts';
|
|
8
|
+
|
|
9
|
+
const __tipBegin = '=================== tip: begin ===================';
|
|
10
|
+
const __tipEnd = '=================== tip: end =====================';
|
|
11
|
+
|
|
12
|
+
@Startup({
|
|
13
|
+
instance: true,
|
|
14
|
+
debounce: true,
|
|
15
|
+
after: true,
|
|
16
|
+
meta: { mode: 'dev' },
|
|
17
|
+
dependencies: 'a-runtime:runtime',
|
|
18
|
+
})
|
|
19
|
+
export class StartupPrintTip extends BeanBase implements IStartupExecute {
|
|
20
|
+
async execute() {
|
|
21
|
+
if (this.app.meta.env.LOGGER_DUMMY === 'true') return;
|
|
22
|
+
setTimeout(async () => {
|
|
23
|
+
await this._print();
|
|
24
|
+
}, this.scope.config.delay);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async _print() {
|
|
28
|
+
//
|
|
29
|
+
const outputs: IMetaPrintTipInfoInner[] = [];
|
|
30
|
+
const onions = this.bean.onion.meta.getOnionsEnabledOfMeta(true, 'printTip');
|
|
31
|
+
for (const onion of onions) {
|
|
32
|
+
const beanInstance = this.bean._getBean<IMetaPrintTipExecute>(onion.beanOptions.beanFullName as any);
|
|
33
|
+
const res = await beanInstance.execute();
|
|
34
|
+
if (!res) continue;
|
|
35
|
+
for (const item of Array.isArray(res) ? res : [res]) {
|
|
36
|
+
outputs.push({
|
|
37
|
+
...item,
|
|
38
|
+
module: onion.beanOptions.module,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//
|
|
43
|
+
const message = outputs
|
|
44
|
+
.map(output => `${chalk.gray(`[${output.module}]`)} ${chalk.magenta(output.title)}: ${chalk.cyan(output.message)}`)
|
|
45
|
+
.join('\n');
|
|
46
|
+
const text = `\n${chalk.yellow(__tipBegin)}\n${message}\n${chalk.yellow(__tipEnd)}`;
|
|
47
|
+
this.$logger.silly(text);
|
|
48
|
+
}
|
|
49
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './printTip.ts';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface IMetaPrintTipInfo {
|
|
2
|
+
title: string;
|
|
3
|
+
message: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface IMetaPrintTipInfoInner extends IMetaPrintTipInfo {
|
|
7
|
+
module: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type TypeMetaPrintTipResult = IMetaPrintTipInfo | IMetaPrintTipInfo[] | undefined;
|
|
11
|
+
|
|
12
|
+
export interface IMetaPrintTipExecute {
|
|
13
|
+
execute: () => Promise<TypeMetaPrintTipResult>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare module 'vona-module-a-meta' {
|
|
17
|
+
export interface IMetaNameRecord {
|
|
18
|
+
printTip: never;
|
|
19
|
+
}
|
|
20
|
+
}
|