zova-cli-set-front 1.2.79 → 1.2.84
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.
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { IComponentOptions } from 'zova';
|
|
2
|
+
import type {
|
|
3
|
+
IJsxRenderContextDetails,
|
|
4
|
+
IResourceDetailsActionBulkOptionsBase,
|
|
5
|
+
} from 'zova-module-a-openapi';
|
|
6
|
+
|
|
7
|
+
import { BeanControllerBase, Use } from 'zova';
|
|
8
|
+
import { Controller } from 'zova-module-a-bean';
|
|
9
|
+
|
|
10
|
+
declare module 'zova-module-a-openapi' {
|
|
11
|
+
export interface IResourceDetailsActionBulkRecord {
|
|
12
|
+
'<%=argv.module%>:<%=argv.nameMeta.full%>'?: Controller<%=argv.nameMeta.fullCapitalize%>Props;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface Controller<%=argv.nameMeta.fullCapitalize%>Props extends IResourceDetailsActionBulkOptionsBase {}
|
|
17
|
+
|
|
18
|
+
@Controller()
|
|
19
|
+
export class Controller<%=argv.nameMeta.fullCapitalize%> extends BeanControllerBase {
|
|
20
|
+
static $propsDefault = {};
|
|
21
|
+
static $componentOptions: IComponentOptions = { inheritAttrs: false, deepExtendDefault: true };
|
|
22
|
+
|
|
23
|
+
@Use({ injectionScope: 'host' })
|
|
24
|
+
$$renderContext: IJsxRenderContextDetails;
|
|
25
|
+
|
|
26
|
+
protected async __init__() {}
|
|
27
|
+
|
|
28
|
+
protected render() {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -4,17 +4,20 @@ import type {
|
|
|
4
4
|
IResourceFormFieldRecord,
|
|
5
5
|
IResourceTableCellRecord,
|
|
6
6
|
IResourceTableActionRowRecord,
|
|
7
|
+
IResourceDetailsActionRowRecord,
|
|
7
8
|
IResourceFormActionRowRecord,
|
|
8
9
|
IResourceTableActionBulkRecord,
|
|
9
10
|
IResourceDetailsActionBulkRecord,
|
|
10
11
|
IResourceBlockRecord,
|
|
11
12
|
TypeFormSchemaScene,
|
|
12
13
|
IResourceRenderTableActionRowOptionsAction,
|
|
14
|
+
IResourceRenderDetailsActionRowOptionsAction,
|
|
13
15
|
IResourceRenderFormActionRowOptionsAction,
|
|
14
16
|
IResourceRenderTableActionBulkOptionsAction,
|
|
15
17
|
IResourceRenderDetailsActionBulkOptionsAction,
|
|
16
18
|
IResourceRenderBlockOptionsBlock,
|
|
17
19
|
IResourceTableActionRowOptionsBase,
|
|
20
|
+
IResourceDetailsActionRowOptionsBase,
|
|
18
21
|
IResourceFormActionRowOptionsBase,
|
|
19
22
|
IResourceTableActionBulkOptionsBase,
|
|
20
23
|
IResourceDetailsActionBulkOptionsBase,
|
|
@@ -44,9 +47,9 @@ export function schemaRenderFieldJsx<T extends z.ZodType>(
|
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
export function schemaRenderCell<
|
|
47
|
-
K extends keyof (IResourceTableCellRecord & IResourceTableActionRowRecord),
|
|
50
|
+
K extends keyof (IResourceTableCellRecord & IResourceTableActionRowRecord & IResourceDetailsActionRowRecord),
|
|
48
51
|
T extends z.ZodType,
|
|
49
|
-
>(render: K, options?: (IResourceTableCellRecord & IResourceTableActionRowRecord)[K]) {
|
|
52
|
+
>(render: K, options?: (IResourceTableCellRecord & IResourceTableActionRowRecord & IResourceDetailsActionRowRecord)[K]) {
|
|
50
53
|
return function (schema: T): T {
|
|
51
54
|
const options2 = options !== undefined ? { render, columnProps: options } : { render };
|
|
52
55
|
return _generalSchemaRest(schema, options2, 'table');
|
|
@@ -85,6 +88,25 @@ export function schemaRenderTableActionRowJsx(
|
|
|
85
88
|
return { render: renderComponentJsx, options };
|
|
86
89
|
}
|
|
87
90
|
|
|
91
|
+
export function schemaRenderDetailsActionRow<K extends keyof IResourceDetailsActionRowRecord>(
|
|
92
|
+
render: K,
|
|
93
|
+
options?: IResourceDetailsActionRowRecord[K],
|
|
94
|
+
): IResourceRenderDetailsActionRowOptionsAction {
|
|
95
|
+
const pos = render.toString().indexOf(':action');
|
|
96
|
+
const name =
|
|
97
|
+
pos > -1
|
|
98
|
+
? _toLowerCaseFirstChar(render.toString().substring(pos + ':action'.length))
|
|
99
|
+
: undefined;
|
|
100
|
+
return { $$typeof: 'zova-jsx:actionRow', name, render, options };
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function schemaRenderDetailsActionRowJsx(
|
|
104
|
+
renderComponentJsx: TypeRenderComponentJsx,
|
|
105
|
+
options?: Pick<IResourceDetailsActionRowOptionsBase, 'permission'>,
|
|
106
|
+
) {
|
|
107
|
+
return { render: renderComponentJsx, options };
|
|
108
|
+
}
|
|
109
|
+
|
|
88
110
|
export function schemaRenderFormActionRow<K extends keyof IResourceFormActionRowRecord>(
|
|
89
111
|
render: K,
|
|
90
112
|
options?: IResourceFormActionRowRecord[K],
|
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
schemaRenderCellJsx,
|
|
6
6
|
schemaRenderDetailsActionBulk,
|
|
7
7
|
schemaRenderDetailsActionBulkJsx,
|
|
8
|
+
schemaRenderDetailsActionRow,
|
|
9
|
+
schemaRenderDetailsActionRowJsx,
|
|
8
10
|
schemaRenderField,
|
|
9
11
|
schemaRenderFieldJsx,
|
|
10
12
|
schemaRenderFormActionRow,
|
|
@@ -38,6 +40,8 @@ export const ZovaRender = {
|
|
|
38
40
|
cellJsx: schemaRenderCellJsx,
|
|
39
41
|
tableActionRow: schemaRenderTableActionRow,
|
|
40
42
|
tableActionRowJsx: schemaRenderTableActionRowJsx,
|
|
43
|
+
detailsActionRow: schemaRenderDetailsActionRow,
|
|
44
|
+
detailsActionRowJsx: schemaRenderDetailsActionRowJsx,
|
|
41
45
|
formActionRow: schemaRenderFormActionRow,
|
|
42
46
|
formActionRowJsx: schemaRenderFormActionRowJsx,
|
|
43
47
|
tableActionBulk: schemaRenderTableActionBulk,
|
package/dist/index.js
CHANGED
|
@@ -454,12 +454,8 @@ class CliCreateBean extends BeanCliBase {
|
|
|
454
454
|
await super.execute();
|
|
455
455
|
// module name/info
|
|
456
456
|
const moduleName = argv.module;
|
|
457
|
-
argv.moduleInfo = this.helper.
|
|
458
|
-
|
|
459
|
-
const _module = this.helper.findModule(moduleName);
|
|
460
|
-
if (!_module) {
|
|
461
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
462
|
-
}
|
|
457
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
458
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
463
459
|
// target dir
|
|
464
460
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
465
461
|
// scene name
|
|
@@ -568,12 +564,8 @@ class CliCreateComponentBase extends BeanCliBase {
|
|
|
568
564
|
await super.execute();
|
|
569
565
|
// module name/info
|
|
570
566
|
const moduleName = argv.module;
|
|
571
|
-
argv.moduleInfo = this.helper.
|
|
572
|
-
|
|
573
|
-
const _module = this.helper.findModule(moduleName);
|
|
574
|
-
if (!_module) {
|
|
575
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
576
|
-
}
|
|
567
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
568
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
577
569
|
// target dir
|
|
578
570
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
579
571
|
// componentName
|
|
@@ -630,12 +622,8 @@ class CliCreateMock extends BeanCliBase {
|
|
|
630
622
|
await super.execute();
|
|
631
623
|
// module name/info
|
|
632
624
|
const moduleName = argv.module;
|
|
633
|
-
argv.moduleInfo = this.helper.
|
|
634
|
-
|
|
635
|
-
const _module = this.helper.findModule(moduleName);
|
|
636
|
-
if (!_module) {
|
|
637
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
638
|
-
}
|
|
625
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
626
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
639
627
|
// target dir
|
|
640
628
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
641
629
|
// mockName
|
|
@@ -669,12 +657,9 @@ class CliCreateModule extends BeanCliBase {
|
|
|
669
657
|
// suite name/info
|
|
670
658
|
const suiteName = argv.suite;
|
|
671
659
|
if (suiteName) {
|
|
672
|
-
argv.suiteInfo = this.helper.
|
|
660
|
+
argv.suiteInfo = this.helper.parseSuiteInfoCanonical(suiteName);
|
|
673
661
|
// check if exists
|
|
674
|
-
argv._suite = this.helper.
|
|
675
|
-
if (!argv._suite) {
|
|
676
|
-
throw new Error(`suite does not exist: ${suiteName}`);
|
|
677
|
-
}
|
|
662
|
+
argv._suite = this.helper.findSuiteCanonical(suiteName);
|
|
678
663
|
}
|
|
679
664
|
// nameMeta
|
|
680
665
|
const nameMeta = this.helper.parseNameMeta(argv.name);
|
|
@@ -682,7 +667,7 @@ class CliCreateModule extends BeanCliBase {
|
|
|
682
667
|
argv.name = nameMeta.short;
|
|
683
668
|
// module name/info
|
|
684
669
|
const moduleName = argv.name;
|
|
685
|
-
argv.moduleInfo = this.helper.
|
|
670
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
686
671
|
argv.relativeNameCapitalize = this.helper.stringToCapitalize(argv.moduleInfo.relativeName, '-');
|
|
687
672
|
// check if exists
|
|
688
673
|
const _module = this.helper.findModule(moduleName);
|
|
@@ -750,12 +735,8 @@ class CliCreatePageBase extends BeanCliBase {
|
|
|
750
735
|
await super.execute();
|
|
751
736
|
// module name/info
|
|
752
737
|
const moduleName = argv.module;
|
|
753
|
-
argv.moduleInfo = this.helper.
|
|
754
|
-
|
|
755
|
-
const _module = this.helper.findModule(moduleName);
|
|
756
|
-
if (!_module) {
|
|
757
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
758
|
-
}
|
|
738
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
739
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
759
740
|
// target dir
|
|
760
741
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
761
742
|
// pageName
|
|
@@ -841,7 +822,7 @@ class CliCreateSuite extends BeanCliBase {
|
|
|
841
822
|
argv.name = nameMeta.short;
|
|
842
823
|
// suite name/info
|
|
843
824
|
const suiteName = argv.name;
|
|
844
|
-
argv.suiteInfo = this.helper.
|
|
825
|
+
argv.suiteInfo = this.helper.parseSuiteInfoCanonical(suiteName);
|
|
845
826
|
// check if exists
|
|
846
827
|
const _suite = this.helper.findSuite(suiteName);
|
|
847
828
|
if (_suite) {
|
|
@@ -998,12 +979,8 @@ class CliInitAsset extends BeanCliBase {
|
|
|
998
979
|
await super.execute();
|
|
999
980
|
// module name/info
|
|
1000
981
|
const moduleName = argv.module;
|
|
1001
|
-
argv.moduleInfo = this.helper.
|
|
1002
|
-
|
|
1003
|
-
const _module = this.helper.findModule(moduleName);
|
|
1004
|
-
if (!_module) {
|
|
1005
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
1006
|
-
}
|
|
982
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
983
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
1007
984
|
// target dir
|
|
1008
985
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
1009
986
|
// scene
|
|
@@ -1027,12 +1004,8 @@ class CliInitConfig extends BeanCliBase {
|
|
|
1027
1004
|
// module name/info
|
|
1028
1005
|
const moduleName = argv._[0];
|
|
1029
1006
|
if (!moduleName) return;
|
|
1030
|
-
argv.moduleInfo = this.helper.
|
|
1031
|
-
|
|
1032
|
-
const _module = this.helper.findModule(moduleName);
|
|
1033
|
-
if (!_module) {
|
|
1034
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
1035
|
-
}
|
|
1007
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
1008
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
1036
1009
|
// target dir
|
|
1037
1010
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
1038
1011
|
const configFile = path.join(targetDir, 'src/config/config.ts');
|
|
@@ -1065,12 +1038,8 @@ class CliInitConstant extends BeanCliBase {
|
|
|
1065
1038
|
// module name/info
|
|
1066
1039
|
const moduleName = argv._[0];
|
|
1067
1040
|
if (!moduleName) return;
|
|
1068
|
-
argv.moduleInfo = this.helper.
|
|
1069
|
-
|
|
1070
|
-
const _module = this.helper.findModule(moduleName);
|
|
1071
|
-
if (!_module) {
|
|
1072
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
1073
|
-
}
|
|
1041
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
1042
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
1074
1043
|
// target dir
|
|
1075
1044
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
1076
1045
|
const constantFile = path.join(targetDir, 'src/config/constants.ts');
|
|
@@ -1103,12 +1072,8 @@ class CliInitError extends BeanCliBase {
|
|
|
1103
1072
|
// module name/info
|
|
1104
1073
|
const moduleName = argv._[0];
|
|
1105
1074
|
if (!moduleName) return;
|
|
1106
|
-
argv.moduleInfo = this.helper.
|
|
1107
|
-
|
|
1108
|
-
const _module = this.helper.findModule(moduleName);
|
|
1109
|
-
if (!_module) {
|
|
1110
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
1111
|
-
}
|
|
1075
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
1076
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
1112
1077
|
// target dir
|
|
1113
1078
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
1114
1079
|
const errorFile = path.join(targetDir, 'src/config/errors.ts');
|
|
@@ -1152,12 +1117,8 @@ class CliInitIcon extends BeanCliBase {
|
|
|
1152
1117
|
// module name/info
|
|
1153
1118
|
const moduleName = argv._[0];
|
|
1154
1119
|
if (!moduleName) return;
|
|
1155
|
-
argv.moduleInfo = this.helper.
|
|
1156
|
-
|
|
1157
|
-
const _module = this.helper.findModule(moduleName);
|
|
1158
|
-
if (!_module) {
|
|
1159
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
1160
|
-
}
|
|
1120
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
1121
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
1161
1122
|
// target dir
|
|
1162
1123
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
1163
1124
|
const iconDir = path.join(targetDir, 'icons');
|
|
@@ -1201,12 +1162,8 @@ class CliInitLib extends BeanCliBase {
|
|
|
1201
1162
|
// module name/info
|
|
1202
1163
|
const moduleName = argv._[0];
|
|
1203
1164
|
if (!moduleName) return;
|
|
1204
|
-
argv.moduleInfo = this.helper.
|
|
1205
|
-
|
|
1206
|
-
const _module = this.helper.findModule(moduleName);
|
|
1207
|
-
if (!_module) {
|
|
1208
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
1209
|
-
}
|
|
1165
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
1166
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
1210
1167
|
// target dir
|
|
1211
1168
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
1212
1169
|
const mainFile = path.join(targetDir, 'src/lib/index.ts');
|
|
@@ -1239,12 +1196,8 @@ class CliInitLocale extends BeanCliBase {
|
|
|
1239
1196
|
// module name/info
|
|
1240
1197
|
const moduleName = argv._[0];
|
|
1241
1198
|
if (!moduleName) return;
|
|
1242
|
-
argv.moduleInfo = this.helper.
|
|
1243
|
-
|
|
1244
|
-
const _module = this.helper.findModule(moduleName);
|
|
1245
|
-
if (!_module) {
|
|
1246
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
1247
|
-
}
|
|
1199
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
1200
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
1248
1201
|
// target dir
|
|
1249
1202
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
1250
1203
|
const localeFile = path.join(targetDir, 'src/config/locale');
|
|
@@ -1277,12 +1230,8 @@ class CliInitMain extends BeanCliBase {
|
|
|
1277
1230
|
// module name/info
|
|
1278
1231
|
const moduleName = argv._[0];
|
|
1279
1232
|
if (!moduleName) return;
|
|
1280
|
-
argv.moduleInfo = this.helper.
|
|
1281
|
-
|
|
1282
|
-
const _module = this.helper.findModule(moduleName);
|
|
1283
|
-
if (!_module) {
|
|
1284
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
1285
|
-
}
|
|
1233
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
1234
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
1286
1235
|
// target dir
|
|
1287
1236
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
1288
1237
|
const mainFile = path.join(targetDir, 'src/main.ts');
|
|
@@ -1315,12 +1264,8 @@ class CliInitMainSys extends BeanCliBase {
|
|
|
1315
1264
|
// module name/info
|
|
1316
1265
|
const moduleName = argv._[0];
|
|
1317
1266
|
if (!moduleName) return;
|
|
1318
|
-
argv.moduleInfo = this.helper.
|
|
1319
|
-
|
|
1320
|
-
const _module = this.helper.findModule(moduleName);
|
|
1321
|
-
if (!_module) {
|
|
1322
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
1323
|
-
}
|
|
1267
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
1268
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
1324
1269
|
// target dir
|
|
1325
1270
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
1326
1271
|
const mainFile = path.join(targetDir, 'src/mainSys.ts');
|
|
@@ -1353,12 +1298,8 @@ class CliInitMonkey extends BeanCliBase {
|
|
|
1353
1298
|
// module name/info
|
|
1354
1299
|
const moduleName = argv._[0];
|
|
1355
1300
|
if (!moduleName) return;
|
|
1356
|
-
argv.moduleInfo = this.helper.
|
|
1357
|
-
|
|
1358
|
-
const _module = this.helper.findModule(moduleName);
|
|
1359
|
-
if (!_module) {
|
|
1360
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
1361
|
-
}
|
|
1301
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
1302
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
1362
1303
|
// target dir
|
|
1363
1304
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
1364
1305
|
const monkeyFile = path.join(targetDir, 'src/monkey.ts');
|
|
@@ -1415,12 +1356,8 @@ class CliInitMonkeySys extends BeanCliBase {
|
|
|
1415
1356
|
// module name/info
|
|
1416
1357
|
const moduleName = argv._[0];
|
|
1417
1358
|
if (!moduleName) return;
|
|
1418
|
-
argv.moduleInfo = this.helper.
|
|
1419
|
-
|
|
1420
|
-
const _module = this.helper.findModule(moduleName);
|
|
1421
|
-
if (!_module) {
|
|
1422
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
1423
|
-
}
|
|
1359
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
1360
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
1424
1361
|
// target dir
|
|
1425
1362
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
1426
1363
|
const monkeyFile = path.join(targetDir, 'src/monkeySys.ts');
|
|
@@ -1500,12 +1437,8 @@ class CliInitTypes extends BeanCliBase {
|
|
|
1500
1437
|
// module name/info
|
|
1501
1438
|
const moduleName = argv._[0];
|
|
1502
1439
|
if (!moduleName) return;
|
|
1503
|
-
argv.moduleInfo = this.helper.
|
|
1504
|
-
|
|
1505
|
-
const _module = this.helper.findModule(moduleName);
|
|
1506
|
-
if (!_module) {
|
|
1507
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
1508
|
-
}
|
|
1440
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
1441
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
1509
1442
|
// target dir
|
|
1510
1443
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
1511
1444
|
const mainFile = path.join(targetDir, 'src/types/index.ts');
|
|
@@ -1556,10 +1489,7 @@ class CliOpenapiConfig extends BeanCliBase {
|
|
|
1556
1489
|
}
|
|
1557
1490
|
async _generateModuleConfig(moduleName) {
|
|
1558
1491
|
// check if exists
|
|
1559
|
-
const _module = this.helper.
|
|
1560
|
-
if (!_module) {
|
|
1561
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
1562
|
-
}
|
|
1492
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
1563
1493
|
// target dir
|
|
1564
1494
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
1565
1495
|
const configFile = path.join(targetDir, 'cli/openapi.config.ts');
|
|
@@ -1612,8 +1542,8 @@ class CliOpenapiGenerate extends BeanCliBase {
|
|
|
1612
1542
|
text: moduleName
|
|
1613
1543
|
});
|
|
1614
1544
|
// generate res
|
|
1615
|
-
const moduleInfo = this.helper.
|
|
1616
|
-
const module = this.helper.
|
|
1545
|
+
const moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
1546
|
+
const module = this.helper.findModuleCanonical(moduleName);
|
|
1617
1547
|
await this._generateOpenapi(total, openapiTypescript, config, moduleInfo, module, __caches);
|
|
1618
1548
|
}
|
|
1619
1549
|
}
|
|
@@ -2087,12 +2017,8 @@ class CliRefactorAnotherRender extends BeanCliBase {
|
|
|
2087
2017
|
await super.execute();
|
|
2088
2018
|
// module name/info
|
|
2089
2019
|
const moduleName = argv.module;
|
|
2090
|
-
argv.moduleInfo = this.helper.
|
|
2091
|
-
|
|
2092
|
-
const _module = this.helper.findModule(moduleName);
|
|
2093
|
-
if (!_module) {
|
|
2094
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
2095
|
-
}
|
|
2020
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
2021
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
2096
2022
|
// target dir
|
|
2097
2023
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
2098
2024
|
// componentName
|
|
@@ -2142,12 +2068,8 @@ class CliRefactorAnotherStyle extends BeanCliBase {
|
|
|
2142
2068
|
await super.execute();
|
|
2143
2069
|
// module name/info
|
|
2144
2070
|
const moduleName = argv.module;
|
|
2145
|
-
argv.moduleInfo = this.helper.
|
|
2146
|
-
|
|
2147
|
-
const _module = this.helper.findModule(moduleName);
|
|
2148
|
-
if (!_module) {
|
|
2149
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
2150
|
-
}
|
|
2071
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
2072
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
2151
2073
|
// target dir
|
|
2152
2074
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
2153
2075
|
// componentName
|
|
@@ -2198,12 +2120,8 @@ class CliRefactorComponentGeneric extends BeanCliBase {
|
|
|
2198
2120
|
await super.execute();
|
|
2199
2121
|
// module name/info
|
|
2200
2122
|
const moduleName = argv.module;
|
|
2201
|
-
argv.moduleInfo = this.helper.
|
|
2202
|
-
|
|
2203
|
-
const _module = this.helper.findModule(moduleName);
|
|
2204
|
-
if (!_module) {
|
|
2205
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
2206
|
-
}
|
|
2123
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
2124
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
2207
2125
|
// target dir
|
|
2208
2126
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
2209
2127
|
// componentName
|
|
@@ -2242,12 +2160,8 @@ class CliRefactorComponentModel extends BeanCliBase {
|
|
|
2242
2160
|
await super.execute();
|
|
2243
2161
|
// module name/info
|
|
2244
2162
|
const moduleName = argv.module;
|
|
2245
|
-
argv.moduleInfo = this.helper.
|
|
2246
|
-
|
|
2247
|
-
const _module = this.helper.findModule(moduleName);
|
|
2248
|
-
if (!_module) {
|
|
2249
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
2250
|
-
}
|
|
2163
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
2164
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
2251
2165
|
// target dir
|
|
2252
2166
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
2253
2167
|
// componentName
|
|
@@ -2294,12 +2208,8 @@ class CliRefactorComponentProps extends BeanCliBase {
|
|
|
2294
2208
|
await super.execute();
|
|
2295
2209
|
// module name/info
|
|
2296
2210
|
const moduleName = argv.module;
|
|
2297
|
-
argv.moduleInfo = this.helper.
|
|
2298
|
-
|
|
2299
|
-
const _module = this.helper.findModule(moduleName);
|
|
2300
|
-
if (!_module) {
|
|
2301
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
2302
|
-
}
|
|
2211
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
2212
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
2303
2213
|
// target dir
|
|
2304
2214
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
2305
2215
|
// componentName
|
|
@@ -2338,12 +2248,8 @@ class CliRefactorFirstRender extends BeanCliBase {
|
|
|
2338
2248
|
await super.execute();
|
|
2339
2249
|
// module name/info
|
|
2340
2250
|
const moduleName = argv.module;
|
|
2341
|
-
argv.moduleInfo = this.helper.
|
|
2342
|
-
|
|
2343
|
-
const _module = this.helper.findModule(moduleName);
|
|
2344
|
-
if (!_module) {
|
|
2345
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
2346
|
-
}
|
|
2251
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
2252
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
2347
2253
|
// target dir
|
|
2348
2254
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
2349
2255
|
// componentName
|
|
@@ -2395,12 +2301,8 @@ class CliRefactorFirstStyle extends BeanCliBase {
|
|
|
2395
2301
|
await super.execute();
|
|
2396
2302
|
// module name/info
|
|
2397
2303
|
const moduleName = argv.module;
|
|
2398
|
-
argv.moduleInfo = this.helper.
|
|
2399
|
-
|
|
2400
|
-
const _module = this.helper.findModule(moduleName);
|
|
2401
|
-
if (!_module) {
|
|
2402
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
2403
|
-
}
|
|
2304
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
2305
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
2404
2306
|
// target dir
|
|
2405
2307
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
2406
2308
|
// componentName
|
|
@@ -2452,12 +2354,8 @@ class CliRefactorPageParams extends BeanCliBase {
|
|
|
2452
2354
|
await super.execute();
|
|
2453
2355
|
// module name/info
|
|
2454
2356
|
const moduleName = argv.module;
|
|
2455
|
-
argv.moduleInfo = this.helper.
|
|
2456
|
-
|
|
2457
|
-
const _module = this.helper.findModule(moduleName);
|
|
2458
|
-
if (!_module) {
|
|
2459
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
2460
|
-
}
|
|
2357
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
2358
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
2461
2359
|
// target dir
|
|
2462
2360
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
2463
2361
|
// pageName
|
|
@@ -2496,12 +2394,8 @@ class CliRefactorPageQuery extends BeanCliBase {
|
|
|
2496
2394
|
await super.execute();
|
|
2497
2395
|
// module name/info
|
|
2498
2396
|
const moduleName = argv.module;
|
|
2499
|
-
argv.moduleInfo = this.helper.
|
|
2500
|
-
|
|
2501
|
-
const _module = this.helper.findModule(moduleName);
|
|
2502
|
-
if (!_module) {
|
|
2503
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
2504
|
-
}
|
|
2397
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
2398
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
2505
2399
|
// target dir
|
|
2506
2400
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
2507
2401
|
// pageName
|
|
@@ -2540,12 +2434,8 @@ class CliRefactorRenameComponent extends BeanCliBase {
|
|
|
2540
2434
|
await super.execute();
|
|
2541
2435
|
// module name/info
|
|
2542
2436
|
const moduleName = argv.module;
|
|
2543
|
-
argv.moduleInfo = this.helper.
|
|
2544
|
-
|
|
2545
|
-
const _module = this.helper.findModule(moduleName);
|
|
2546
|
-
if (!_module) {
|
|
2547
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
2548
|
-
}
|
|
2437
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
2438
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
2549
2439
|
// target dir
|
|
2550
2440
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
2551
2441
|
// componentName
|
|
@@ -3346,8 +3236,7 @@ class CliToolsMetadata extends BeanCliBase {
|
|
|
3346
3236
|
}
|
|
3347
3237
|
}
|
|
3348
3238
|
async _generateMetadata(moduleName, force) {
|
|
3349
|
-
const module = this.helper.
|
|
3350
|
-
if (!module) throw new Error(`module not found: ${moduleName}`);
|
|
3239
|
+
const module = this.helper.findModuleCanonical(moduleName);
|
|
3351
3240
|
const modulePath = module.root;
|
|
3352
3241
|
const metaDir = path.join(modulePath, 'src/.metadata');
|
|
3353
3242
|
const metaIndexFile = path.join(metaDir, 'index.ts');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-cli-set-front",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "1.2.84",
|
|
4
|
+
"gitHead": "ae3d4871534ad17e465e5b8f8789e13b80583344",
|
|
5
5
|
"description": "zova cli-set-front",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"framework",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@babel/plugin-proposal-decorators": "^7.29.0",
|
|
37
37
|
"@babel/plugin-transform-class-properties": "^7.28.6",
|
|
38
38
|
"@babel/plugin-transform-typescript": "^7.28.6",
|
|
39
|
-
"@cabloy/cli": "^3.1.
|
|
39
|
+
"@cabloy/cli": "^3.1.23",
|
|
40
40
|
"@cabloy/extend": "^3.2.8",
|
|
41
41
|
"@cabloy/module-info": "^2.0.0",
|
|
42
42
|
"@cabloy/openapi-typescript": "^7.9.2",
|