zova-cli-set-front 1.2.37 → 1.2.38
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/dist/index.js +10 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -373,6 +373,8 @@ import type { TypePagePathSchema } from 'zova-module-a-router';
|
|
|
373
373
|
export type { IPagePathRecord } from 'zova-module-a-router';
|
|
374
374
|
import type { IActionRecord, TypeActionOptions } from 'zova-module-a-action';
|
|
375
375
|
export type { IActionRecord } from 'zova-module-a-action';
|
|
376
|
+
import type { IVonaComponentRecord, TypeComponentOptions } from 'zova-module-a-bean';
|
|
377
|
+
export type { IVonaComponentRecord } from 'zova-module-a-bean';
|
|
376
378
|
export type {
|
|
377
379
|
IResourceComponentActionBulkRecord,
|
|
378
380
|
IResourceComponentActionRowRecord,
|
|
@@ -426,9 +428,17 @@ export type {
|
|
|
426
428
|
} else if (fse.existsSync(dirStartOpenapi)) {
|
|
427
429
|
content += `import 'zova-module-start-openapi';\n`;
|
|
428
430
|
}
|
|
431
|
+
// actions
|
|
429
432
|
content += `export function Action<K extends keyof IActionRecord>(options: TypeActionOptions<K>) {
|
|
433
|
+
if(!options.name) throw new Error('should specify the action name');
|
|
430
434
|
return options.name.replace(':','.action.');
|
|
431
435
|
}
|
|
436
|
+
`;
|
|
437
|
+
// components
|
|
438
|
+
content += `export function Component<K extends keyof IVonaComponentRecord>(options: TypeComponentOptions<K>) {
|
|
439
|
+
if (!options.name) throw new Error('should specify the component name');
|
|
440
|
+
return options.name;
|
|
441
|
+
}
|
|
432
442
|
`;
|
|
433
443
|
return content;
|
|
434
444
|
}
|
package/package.json
CHANGED