vona-cli-set-api 1.0.228 → 1.0.232
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/cli/templates/create/project/basic/boilerplate/.vscode/vona.code-snippets +99 -5
- package/cli/templates/create/project/basic/boilerplate/package.original.json +1 -1
- package/cli/templates/init/error/boilerplate/config/errors.ts +1 -1
- package/dist/lib/bean/toolsMetadata/generateConfig.d.ts +1 -1
- package/dist/lib/bean/toolsMetadata/generateConfig.js +1 -1
- package/dist/lib/bean/toolsMetadata/generateScope.js +7 -1
- package/package.json +2 -2
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"scope": "typescript,typescriptreact",
|
|
20
20
|
"prefix": "aopinit",
|
|
21
21
|
"body": [
|
|
22
|
-
"protected __init__
|
|
23
|
-
"
|
|
22
|
+
"protected __init__: AopActionInit<BeanClassSome> = (_args, next, _receiver) => {",
|
|
23
|
+
" next();",
|
|
24
24
|
" $0",
|
|
25
25
|
"}"
|
|
26
26
|
],
|
|
@@ -30,24 +30,118 @@
|
|
|
30
30
|
"scope": "typescript,typescriptreact",
|
|
31
31
|
"prefix": "aopdispose",
|
|
32
32
|
"body": [
|
|
33
|
-
"protected async
|
|
34
|
-
" await next();",
|
|
33
|
+
"protected __dispose__: AopActionDispose<BeanClassSome> = async (_args, next, _receiver) => {",
|
|
35
34
|
" $0",
|
|
35
|
+
" await next();",
|
|
36
36
|
"}"
|
|
37
37
|
],
|
|
38
38
|
"description": "aop.__dispose__"
|
|
39
39
|
},
|
|
40
|
+
"aop.__get__": {
|
|
41
|
+
"scope": "typescript,typescriptreact",
|
|
42
|
+
"prefix": "aopget",
|
|
43
|
+
"body": [
|
|
44
|
+
"protected __get__(prop: string, next: NextSync) {",
|
|
45
|
+
" const value = next();",
|
|
46
|
+
" return value;",
|
|
47
|
+
"}"
|
|
48
|
+
],
|
|
49
|
+
"description": "aop.__get__"
|
|
50
|
+
},
|
|
51
|
+
"aop.__set__": {
|
|
52
|
+
"scope": "typescript,typescriptreact",
|
|
53
|
+
"prefix": "aopset",
|
|
54
|
+
"body": [
|
|
55
|
+
"protected __set__(prop: string, value: any, next: NextSync): boolean {",
|
|
56
|
+
" return next(value);",
|
|
57
|
+
"}"
|
|
58
|
+
],
|
|
59
|
+
"description": "aop.__set__"
|
|
60
|
+
},
|
|
61
|
+
"aop.getter": {
|
|
62
|
+
"scope": "typescript,typescriptreact",
|
|
63
|
+
"prefix": "aopgetter",
|
|
64
|
+
"body": [
|
|
65
|
+
"protected __get_xxx__: AopActionGetter<BeanClassSome, 'xxx'> = function (next, _receiver) {",
|
|
66
|
+
" const value = next();",
|
|
67
|
+
" return value;",
|
|
68
|
+
"}"
|
|
69
|
+
],
|
|
70
|
+
"description": "aop.getter"
|
|
71
|
+
},
|
|
72
|
+
"aop.setter": {
|
|
73
|
+
"scope": "typescript,typescriptreact",
|
|
74
|
+
"prefix": "aopsetter",
|
|
75
|
+
"body": [
|
|
76
|
+
"protected __set_xxx__: AopActionSetter<BeanClassSome, 'xxx'> = function (value, next, _receiver) {",
|
|
77
|
+
" return next(value);",
|
|
78
|
+
"}"
|
|
79
|
+
],
|
|
80
|
+
"description": "aop.setter"
|
|
81
|
+
},
|
|
40
82
|
"aop.action": {
|
|
41
83
|
"scope": "typescript,typescriptreact",
|
|
42
84
|
"prefix": "aopaction",
|
|
43
85
|
"body": [
|
|
44
|
-
"
|
|
86
|
+
"action: AopAction<BeanClassSome, 'action'> = async (_args, next, _receiver) => {",
|
|
45
87
|
" $0",
|
|
46
88
|
" return await next();",
|
|
47
89
|
"}"
|
|
48
90
|
],
|
|
49
91
|
"description": "aop.action"
|
|
50
92
|
},
|
|
93
|
+
"aop.actionsync": {
|
|
94
|
+
"scope": "typescript,typescriptreact",
|
|
95
|
+
"prefix": "aopactionsync",
|
|
96
|
+
"body": [
|
|
97
|
+
"action: AopAction<BeanClassSome, 'action'> = (_args, next, _receiver) => {",
|
|
98
|
+
" $0",
|
|
99
|
+
" return next();",
|
|
100
|
+
"}"
|
|
101
|
+
],
|
|
102
|
+
"description": "aop.actionsync"
|
|
103
|
+
},
|
|
104
|
+
"aopmethod.get": {
|
|
105
|
+
"scope": "typescript,typescriptreact",
|
|
106
|
+
"prefix": "aopmethodget",
|
|
107
|
+
"body": [
|
|
108
|
+
"get(_options: IDecoratorAopMethodOptions, next: NextSync, _receiver: any, _prop: string) {",
|
|
109
|
+
" return next();",
|
|
110
|
+
"}"
|
|
111
|
+
],
|
|
112
|
+
"description": "aopmethod.get"
|
|
113
|
+
},
|
|
114
|
+
"aopmethod.set": {
|
|
115
|
+
"scope": "typescript,typescriptreact",
|
|
116
|
+
"prefix": "aopmethodset",
|
|
117
|
+
"body": [
|
|
118
|
+
"set(_options: IDecoratorAopMethodOptions, value: any, next: NextSync, _receiver: any, _prop: string): boolean {",
|
|
119
|
+
" return next(value);",
|
|
120
|
+
"}"
|
|
121
|
+
],
|
|
122
|
+
"description": "aopmethod.set"
|
|
123
|
+
},
|
|
124
|
+
"aopmagic.get": {
|
|
125
|
+
"scope": "typescript,typescriptreact",
|
|
126
|
+
"prefix": "aopmagicget",
|
|
127
|
+
"body": [
|
|
128
|
+
"protected __get__(prop: string) {",
|
|
129
|
+
" $0",
|
|
130
|
+
"}"
|
|
131
|
+
],
|
|
132
|
+
"description": "aopmagic.get"
|
|
133
|
+
},
|
|
134
|
+
"aopmagic.set": {
|
|
135
|
+
"scope": "typescript,typescriptreact",
|
|
136
|
+
"prefix": "aopmagicset",
|
|
137
|
+
"body": [
|
|
138
|
+
"protected __set__(prop: string, value: any): boolean {",
|
|
139
|
+
" $0",
|
|
140
|
+
" return false;",
|
|
141
|
+
"}"
|
|
142
|
+
],
|
|
143
|
+
"description": "aopmagic.set"
|
|
144
|
+
},
|
|
51
145
|
"record.flavor": {
|
|
52
146
|
"scope": "typescript,typescriptreact",
|
|
53
147
|
"prefix": "recordflavor",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const errors = {} as const;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare function generateConfig(modulePath: string): Promise<"" | "/** config: begin */\nexport * from '../config/config.ts';\nimport type { config } from '../config/config.ts';\n/** config: end */\n">;
|
|
2
2
|
export declare function generateConstant(modulePath: string): Promise<"" | "/** constant: begin */\nexport * from '../config/constants.ts';\nimport { constants } from '../config/constants.ts';\n/** constant: end */\n">;
|
|
3
3
|
export declare function generateLocale(modulePath: string): Promise<string>;
|
|
4
|
-
export declare function generateError(modulePath: string): Promise<"" | "/** error: begin */\nexport * from '../config/errors.ts';\nimport type {
|
|
4
|
+
export declare function generateError(modulePath: string): Promise<"" | "/** error: begin */\nexport * from '../config/errors.ts';\nimport type { errors } from '../config/errors.ts';\n/** error: end */\n">;
|
|
@@ -55,7 +55,7 @@ export async function generateError(modulePath) {
|
|
|
55
55
|
// combine
|
|
56
56
|
const content = `/** error: begin */
|
|
57
57
|
export * from '../config/errors.ts';
|
|
58
|
-
import type {
|
|
58
|
+
import type { errors } from '../config/errors.ts';
|
|
59
59
|
/** error: end */
|
|
60
60
|
`;
|
|
61
61
|
return content;
|
|
@@ -17,7 +17,7 @@ export async function generateScope(moduleName, relativeNameCapitalize, scopeRes
|
|
|
17
17
|
}
|
|
18
18
|
if (options.errors) {
|
|
19
19
|
contentImports.push('type TypeModuleErrors');
|
|
20
|
-
contentRecords.push('error: TypeModuleErrors<typeof
|
|
20
|
+
contentRecords.push('error: TypeModuleErrors<typeof errors>;');
|
|
21
21
|
}
|
|
22
22
|
if (options.locales) {
|
|
23
23
|
contentImports.push('type TypeModuleLocales');
|
|
@@ -65,6 +65,12 @@ declare module 'vona' {
|
|
|
65
65
|
'${moduleName}': (typeof locales)[TypeLocaleBase];
|
|
66
66
|
}`
|
|
67
67
|
: ''}
|
|
68
|
+
|
|
69
|
+
${options.errors
|
|
70
|
+
? `export interface IBeanScopeErrors {
|
|
71
|
+
'${moduleName}': typeof errors;
|
|
72
|
+
}`
|
|
73
|
+
: ''}
|
|
68
74
|
}
|
|
69
75
|
${options.locales
|
|
70
76
|
? `\nexport function $locale<K extends keyof (typeof locales)[TypeLocaleBase]>(key: K): \`${moduleName}::\${K}\` {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-cli-set-api",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.232",
|
|
5
5
|
"description": "vona cli-set-api",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"ts-node": "^10.9.2",
|
|
62
62
|
"urllib": "^4.6.11",
|
|
63
63
|
"uuid": "^11.1.0",
|
|
64
|
-
"vona-core": "^5.0.
|
|
64
|
+
"vona-core": "^5.0.62",
|
|
65
65
|
"why-is-node-running": "^3.2.2",
|
|
66
66
|
"yargs-parser": "^21.1.1"
|
|
67
67
|
},
|