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.
Files changed (2) hide show
  1. package/dist/index.js +10 -0
  2. 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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zova-cli-set-front",
3
- "version": "1.2.37",
4
- "gitHead": "da650d644d8851a92a8da4babaebfef74c9e8a5d",
3
+ "version": "1.2.38",
4
+ "gitHead": "6162f8e212146d3e5f98145fcf43adc52912694e",
5
5
  "description": "zova cli-set-front",
6
6
  "keywords": [
7
7
  "framework",