vona-cli-set-api 1.0.226 → 1.0.230

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.
@@ -19,8 +19,8 @@
19
19
  "scope": "typescript,typescriptreact",
20
20
  "prefix": "aopinit",
21
21
  "body": [
22
- "protected __init__(_args: Parameters<any>, next: Function, _receiver: any) {",
23
- " await next();",
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 __dispose__(_args: [], next: Function, _receiver: any) {",
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
- "async action(_args: Parameters<any>, next: Function, _receiver: any) {",
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",
@@ -45,7 +45,7 @@
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "vona": "^5.0.134"
48
+ "vona": "^5.0.136"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@cabloy/lint": "^5.0.16",
@@ -2,6 +2,7 @@ import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import { BeanCliBase } from '@cabloy/cli';
4
4
  import { getOnionMetasMeta, getOnionScenesMeta } from '@cabloy/module-info';
5
+ import { toUpperCaseFirstChar } from '@cabloy/word-utils';
5
6
  import { __ThisSetName__ } from "../this.js";
6
7
  export class CliCreateBean extends BeanCliBase {
7
8
  async execute() {
@@ -52,13 +53,14 @@ export class CliCreateBean extends BeanCliBase {
52
53
  // tools.metadata
53
54
  await this.helper.invokeCli([':tools:metadata', moduleName], { cwd: argv.projectPath });
54
55
  }
55
- _getBoilerplatesOrSnippets(type, customPath) {
56
+ _getBoilerplatesOrSnippets(type, custom) {
57
+ const type2 = custom ? `${type}${toUpperCaseFirstChar(custom)}` : type;
56
58
  const result = {};
57
59
  // scenes
58
60
  const onionScenesMeta = getOnionScenesMeta(this.modulesMeta.modules);
59
61
  for (const sceneName in onionScenesMeta) {
60
62
  const onionSceneMeta = onionScenesMeta[sceneName];
61
- const scenePath = customPath || onionSceneMeta[type];
63
+ const scenePath = onionSceneMeta[type2];
62
64
  if (scenePath) {
63
65
  result[sceneName] = path.join(onionSceneMeta.module.root, scenePath);
64
66
  }
@@ -67,7 +69,7 @@ export class CliCreateBean extends BeanCliBase {
67
69
  const onionMetasMeta = getOnionMetasMeta(this.modulesMeta.modules);
68
70
  for (const sceneName in onionMetasMeta) {
69
71
  const onionMetaMeta = onionMetasMeta[sceneName];
70
- const scenePath = customPath || onionMetaMeta[type];
72
+ const scenePath = onionMetaMeta[type2];
71
73
  if (scenePath) {
72
74
  result[`meta:${sceneName}`] = path.join(onionMetaMeta.module.root, scenePath);
73
75
  }
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.226",
4
+ "version": "1.0.230",
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.60",
64
+ "vona-core": "^5.0.61",
65
65
  "why-is-node-running": "^3.2.2",
66
66
  "yargs-parser": "^21.1.1"
67
67
  },