vona-cli-set-api 1.1.130 → 1.1.132

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.
@@ -4,7 +4,7 @@ import { $makeMetadata } from 'vona-module-a-openapiutils';
4
4
  import { $Dto } from 'vona-module-a-orm';
5
5
  import { Dto } from 'vona-module-a-web';
6
6
  import { Model<%=argv.detailResourceNameCapitalize%> } from '<%=argv.detailPackageName%>';
7
- import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
7
+ import { ZovaRender } from '<%=argv.restAdminNpm%>';
8
8
 
9
9
  export interface IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%> extends IDecoratorDtoOptions {}
10
10
 
@@ -3,14 +3,14 @@ import type { IDecoratorDtoOptions } from 'vona-module-a-web';
3
3
  import { $Dto } from 'vona-module-a-orm';
4
4
  import { Dto } from 'vona-module-a-web';
5
5
  import { Model<%=argv.detailResourceNameCapitalize%> } from '<%=argv.detailPackageName%>';
6
- import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
6
+ import { ZovaRender } from '<%=argv.restAdminNpm%>';
7
7
 
8
8
  import { Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%> } from './<%=argv.detailDtoBaseName%>.tsx';
9
9
 
10
10
  export interface IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoMutateName)%> extends IDecoratorDtoOptions {}
11
11
 
12
12
  @Dto<IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoMutateName)%>>({
13
- blocks: [ZovaRender.block('basic-details:blockForm')],
13
+ blocks: [ZovaRender.block('<%=argv.detailsModuleName%>:blockForm')],
14
14
  })
15
15
  export class Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoMutateName)%> extends $Dto.mutate(() => Model<%=argv.detailResourceNameCapitalize%>, {
16
16
  dtoClass: Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%>,
@@ -4,7 +4,7 @@ import { $makeMetadata, Api, v } from 'vona-module-a-openapiutils';
4
4
  import { $Dto } from 'vona-module-a-orm';
5
5
  import { Dto } from 'vona-module-a-web';
6
6
  import { Model<%=argv.detailResourceNameCapitalize%> } from '<%=argv.detailPackageName%>';
7
- import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
7
+ import { ZovaRender } from '<%=argv.restAdminNpm%>';
8
8
 
9
9
  import { $locale } from '../.metadata/locales.ts';
10
10
  import { Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%> } from './<%=argv.detailDtoBaseName%>.tsx';
@@ -13,23 +13,23 @@ export interface IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoRes
13
13
 
14
14
  @Dto<IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoResItemName)%>>({
15
15
  blocks: [
16
- ZovaRender.block('basic-details:blockDetails', {
16
+ ZovaRender.block('<%=argv.detailsModuleName%>:blockDetails', {
17
17
  blocks: [
18
- ZovaRender.block('basic-details:blockToolbarBulk', {
18
+ ZovaRender.block('<%=argv.detailsModuleName%>:blockToolbarBulk', {
19
19
  actions: [
20
- ZovaRender.detailsActionBulk('basic-details:actionCreate', {
20
+ ZovaRender.detailsActionBulk('<%=argv.detailsModuleName%>:actionCreate', {
21
21
  dialogOptions: { title: $locale('Add<%=argv.detailDialogTitleCapitalize%>') },
22
22
  permission: { formScene: ['create', 'edit'] },
23
23
  }),
24
24
  ],
25
25
  }),
26
- ZovaRender.block('basic-details:blockTable'),
26
+ ZovaRender.block('<%=argv.detailsModuleName%>:blockTable'),
27
27
  ],
28
28
  }),
29
29
  ],
30
30
  fields: {
31
31
  name: $makeMetadata(
32
- ZovaRender.cell('basic-details:actionView', {
32
+ ZovaRender.cell('<%=argv.detailsModuleName%>:actionView', {
33
33
  dialogOptions: { title: $locale('View<%=argv.detailDialogTitleCapitalize%>') },
34
34
  }),
35
35
  ),
@@ -38,19 +38,19 @@ export interface IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoRes
38
38
  export class Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoResItemName)%> extends $Dto.get(() => Model<%=argv.detailResourceNameCapitalize%>, {
39
39
  dtoClass: Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%>,
40
40
  }) {
41
- @Api.field(v.title('#'), ZovaRender.order(1, 'core'), ZovaRender.cell('basic-details:lineNumber'))
41
+ @Api.field(v.title('#'), ZovaRender.order(1, 'core'), ZovaRender.cell('<%=argv.detailsModuleName%>:lineNumber'))
42
42
  _lineNumber?: number;
43
43
 
44
44
  @Api.field(
45
45
  v.title($locale('Operations')),
46
46
  ZovaRender.order(1, 'max'),
47
- ZovaRender.cell('basic-details:actionOperationsRow', {
47
+ ZovaRender.cell('<%=argv.detailsModuleName%>:actionOperationsRow', {
48
48
  actions: [
49
- ZovaRender.detailsActionRow('basic-details:actionUpdate', {
49
+ ZovaRender.detailsActionRow('<%=argv.detailsModuleName%>:actionUpdate', {
50
50
  dialogOptions: { title: $locale('Edit<%=argv.detailDialogTitleCapitalize%>') },
51
51
  permission: { formScene: ['create', 'edit'] },
52
52
  }),
53
- ZovaRender.detailsActionRow('basic-details:actionDelete', {
53
+ ZovaRender.detailsActionRow('<%=argv.detailsModuleName%>:actionDelete', {
54
54
  permission: { formScene: ['create', 'edit'] },
55
55
  }),
56
56
  ],
@@ -3,14 +3,14 @@ import type { IDecoratorDtoOptions } from 'vona-module-a-web';
3
3
  import { $Dto } from 'vona-module-a-orm';
4
4
  import { Dto } from 'vona-module-a-web';
5
5
  import { Model<%=argv.detailResourceNameCapitalize%> } from '<%=argv.detailPackageName%>';
6
- import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
6
+ import { ZovaRender } from '<%=argv.restAdminNpm%>';
7
7
 
8
8
  import { Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%> } from './<%=argv.detailDtoBaseName%>.tsx';
9
9
 
10
10
  export interface IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoViewName)%> extends IDecoratorDtoOptions {}
11
11
 
12
12
  @Dto<IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoViewName)%>>({
13
- blocks: [ZovaRender.block('basic-details:blockForm')],
13
+ blocks: [ZovaRender.block('<%=argv.detailsModuleName%>:blockForm')],
14
14
  })
15
15
  export class Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoViewName)%> extends $Dto.get(() => Model<%=argv.detailResourceNameCapitalize%>, {
16
16
  dtoClass: Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%>,
package/dist/index.js CHANGED
@@ -2055,6 +2055,10 @@ class CliToolsMasterDetail extends BeanCliBase {
2055
2055
  argv.detailDtoResItemName = `detail${argv.detailResourceNameCapitalize}ResItem`;
2056
2056
  argv.detailFieldPrivateName = `_${argv.relationName}`;
2057
2057
  argv.detailDialogTitleCapitalize = argv.detailModuleCapitalize;
2058
+ const editionName = fs.existsSync(path.join(argv.projectPath, '__CABLOY_START__')) ? 'start' : 'basic';
2059
+ argv.restAdminNpm = `zova-rest-cabloy-${editionName}-admin`;
2060
+ argv.detailsModuleName = `${editionName}-details`;
2061
+ argv.detailCrudCommand = `:tools:crud${this._capitalize(editionName)}`;
2058
2062
  }
2059
2063
  async _ensureDetailModule() {
2060
2064
  const {
@@ -2339,7 +2343,7 @@ class CliToolsMasterDetail extends BeanCliBase {
2339
2343
  content = this._replaceStrict(content, "import { $Dto } from 'vona-module-a-orm';", "import { $makeMetadata, Api, v } from 'vona-module-a-openapiutils';\nimport { $Dto } from 'vona-module-a-orm';", fileName);
2340
2344
  }
2341
2345
  if (!content.includes("import { $locale } from '../.metadata/locales.ts';")) {
2342
- content = this._replaceStrict(content, "import { ZovaRender } from 'zova-rest-cabloy-basic-admin';\n", "import { ZovaRender } from 'zova-rest-cabloy-basic-admin';\n\nimport { $locale } from '../.metadata/locales.ts';\n", fileName);
2346
+ content = this._replaceStrict(content, `import { ZovaRender } from '${argv.restAdminNpm}';\n`, `import { ZovaRender } from '${argv.restAdminNpm}';\n\nimport { $locale } from '../.metadata/locales.ts';\n`, fileName);
2343
2347
  }
2344
2348
  const importMarker = `import { Model${argv.resourceNameCapitalize} } from '../model/${argv.resourceName}.ts';\n`;
2345
2349
  if (!content.includes(`import { Dto${detailDtoClassCapitalize} } from './`)) {
@@ -2375,7 +2379,7 @@ class CliToolsMasterDetail extends BeanCliBase {
2375
2379
  const {
2376
2380
  argv
2377
2381
  } = this.context;
2378
- return ` ${argv.relationName}: $makeMetadata(\n v.title($locale('${argv.relationNameCapitalize}')),\n ZovaRender.order(5),\n ZovaRender.field('basic-details:formFieldDetails'),\n${scene === 'Create' ? ' v.optional(),\n' : ''} ),\n`;
2382
+ return ` ${argv.relationName}: $makeMetadata(\n v.title($locale('${argv.relationNameCapitalize}')),\n ZovaRender.order(5),\n ZovaRender.field('${argv.detailsModuleName}:formFieldDetails'),\n${scene === 'Create' ? ' v.optional(),\n' : ''} ),\n`;
2379
2383
  }
2380
2384
  _masterDtoClassReplaceSource(scene) {
2381
2385
  const {
@@ -2410,7 +2414,7 @@ class CliToolsMasterDetail extends BeanCliBase {
2410
2414
  const {
2411
2415
  argv
2412
2416
  } = this.context;
2413
- await this.helper.invokeCli([':tools:crudBasic', argv.detailResourceName, `--module=${argv.detailModule}`, '--nometadata'], {
2417
+ await this.helper.invokeCli([argv.detailCrudCommand, argv.detailResourceName, `--module=${argv.detailModule}`, '--nometadata'], {
2414
2418
  cwd: argv.projectPath
2415
2419
  });
2416
2420
  }
@@ -27,6 +27,9 @@ declare module '@cabloy/cli' {
27
27
  detailDialogTitleCapitalize: string;
28
28
  createdDetailModule?: boolean;
29
29
  createdDetailResource?: boolean;
30
+ restAdminNpm: string;
31
+ detailsModuleName: string;
32
+ detailCrudCommand: string;
30
33
  }
31
34
  }
32
35
  export declare class CliToolsMasterDetail extends BeanCliBase {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-cli-set-api",
3
- "version": "1.1.130",
4
- "gitHead": "94b4f86ba6b9015d9add7de4e03e19db9a084fd2",
3
+ "version": "1.1.132",
4
+ "gitHead": "9484f7821a918a85978a38f82b9add77d503444f",
5
5
  "description": "vona cli-set-api",
6
6
  "keywords": [
7
7
  "framework",
@@ -73,7 +73,7 @@
73
73
  "ts-node-maintained": "^10.9.6",
74
74
  "urllib": "^4.9.0",
75
75
  "uuid": "^11.1.0",
76
- "vona-core": "^5.1.33",
76
+ "vona-core": "^5.1.35",
77
77
  "why-is-node-running": "^3.2.2",
78
78
  "yargs-parser": "^22.0.0"
79
79
  }