zova-cli-set-front 1.2.34 → 1.2.35

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,21 @@
1
+ import type { IJsxRenderContextPage, IResourceActionBulkOptionsBase } from 'zova-module-a-openapi';
2
+
3
+ import { BeanControllerBase, IComponentOptions, Use } from 'zova';
4
+ import { Controller } from 'zova-module-a-bean';
5
+
6
+ export interface Controller<%=argv.nameMeta.fullCapitalize%>Props extends IResourceActionBulkOptionsBase {}
7
+
8
+ @Controller()
9
+ export class Controller<%=argv.nameMeta.fullCapitalize%> extends BeanControllerBase {
10
+ static $propsDefault = {};
11
+ static $componentOptions: IComponentOptions = { inheritAttrs: false, deepExtendDefault: true };
12
+
13
+ @Use({ injectionScope: 'host' })
14
+ $$renderContext: IJsxRenderContextPage;
15
+
16
+ protected async __init__() {}
17
+
18
+ protected render() {
19
+ return null;
20
+ }
21
+ }
@@ -0,0 +1,21 @@
1
+ import type { IJsxRenderContextPageEntry, IResourceActionRowOptionsBase } from 'zova-module-a-openapi';
2
+
3
+ import { BeanControllerBase, IComponentOptions, Use } from 'zova';
4
+ import { Controller } from 'zova-module-a-bean';
5
+
6
+ export interface Controller<%=argv.nameMeta.fullCapitalize%>Props extends IResourceActionRowOptionsBase {}
7
+
8
+ @Controller()
9
+ export class Controller<%=argv.nameMeta.fullCapitalize%> extends BeanControllerBase {
10
+ static $propsDefault = {};
11
+ static $componentOptions: IComponentOptions = { inheritAttrs: false, deepExtendDefault: true };
12
+
13
+ @Use({ injectionScope: 'host' })
14
+ $$renderContext: IJsxRenderContextPageEntry;
15
+
16
+ protected async __init__() {}
17
+
18
+ protected render() {
19
+ return null;
20
+ }
21
+ }
@@ -0,0 +1,21 @@
1
+ import type { IResourceBlockOptionsBase, IJsxRenderContextPage } from 'zova-module-a-openapi';
2
+
3
+ import { BeanControllerBase, IComponentOptions, Use } from 'zova';
4
+ import { Controller } from 'zova-module-a-bean';
5
+
6
+ export interface Controller<%=argv.nameMeta.fullCapitalize%>Props extends IResourceBlockOptionsBase {}
7
+
8
+ @Controller()
9
+ export class Controller<%=argv.nameMeta.fullCapitalize%> extends BeanControllerBase {
10
+ static $propsDefault = {};
11
+ static $componentOptions: IComponentOptions = { inheritAttrs: false, deepExtendDefault: true };
12
+
13
+ @Use({ injectionScope: 'host' })
14
+ $$renderContext: IJsxRenderContextPage;
15
+
16
+ protected async __init__() {}
17
+
18
+ protected render() {
19
+ return null;
20
+ }
21
+ }
@@ -0,0 +1,21 @@
1
+ import type { IResourceBlockOptionsBase, IJsxRenderContextPageEntry } from 'zova-module-a-openapi';
2
+
3
+ import { BeanControllerBase, IComponentOptions, Use } from 'zova';
4
+ import { Controller } from 'zova-module-a-bean';
5
+
6
+ export interface Controller<%=argv.nameMeta.fullCapitalize%>Props extends IResourceBlockOptionsBase {}
7
+
8
+ @Controller()
9
+ export class Controller<%=argv.nameMeta.fullCapitalize%> extends BeanControllerBase {
10
+ static $propsDefault = {};
11
+ static $componentOptions: IComponentOptions = { inheritAttrs: false, deepExtendDefault: true };
12
+
13
+ @Use({ injectionScope: 'host' })
14
+ $$renderContext: IJsxRenderContextPageEntry;
15
+
16
+ protected async __init__() {}
17
+
18
+ protected render() {
19
+ return null;
20
+ }
21
+ }
@@ -1,15 +1,15 @@
1
1
  import type { IComponentOptions } from 'zova';
2
- import type { IFormFieldOptions } from 'zova-module-a-form';
2
+ import type { IFormFieldComponentOptions } from 'zova-module-a-form';
3
3
  import { BeanControllerBase } from 'zova';
4
4
  import { Controller } from 'zova-module-a-bean';
5
5
  import { ZFormField } from 'zova-module-a-form';
6
6
 
7
- export interface Controller<%=argv.nameMeta.fullCapitalize%>Props extends IFormFieldOptions {}
7
+ export interface Controller<%=argv.nameMeta.fullCapitalize%>Props extends IFormFieldComponentOptions {}
8
8
 
9
9
  @Controller()
10
10
  export class Controller<%=argv.nameMeta.fullCapitalize%> extends BeanControllerBase {
11
11
  static $propsDefault = {};
12
- static $componentOptions: IComponentOptions = { inheritAttrs: false };
12
+ static $componentOptions: IComponentOptions = { inheritAttrs: false, deepExtendDefault: true };
13
13
 
14
14
  protected async __init__() {}
15
15
 
@@ -7,7 +7,7 @@ declare module '@cabloy/cli' {
7
7
  }
8
8
  }
9
9
 
10
- const __regProps = /interface [^<]*Props<(.*?)> \{/;
10
+ const __regProps = /interface Controller[^<]*Props<(.*?)>/;
11
11
 
12
12
  export default metadataCustomSnippet({
13
13
  file: ({ argv }) => {
@@ -1,8 +1,14 @@
1
1
  import { metadataCustomSnippet } from '@cabloy/cli';
2
2
 
3
- const __regPropsReplace = /(interface [^<]*Props) \{/;
3
+ const __regPropsReplace = /(interface [^<]*Props) ([(extends)|{])/;
4
4
  const __regModelsReplace = /(interface [^<]*Models) \{/;
5
5
 
6
+ declare module '@cabloy/cli' {
7
+ export interface ICommandArgv {
8
+ controllerFileName: string;
9
+ }
10
+ }
11
+
6
12
  export default metadataCustomSnippet({
7
13
  file: ({ argv }) => {
8
14
  return argv.controllerFileName;
@@ -10,8 +16,8 @@ export default metadataCustomSnippet({
10
16
  language: 'plain',
11
17
  async transform({ ast }) {
12
18
  // Props
13
- ast = ast.replace(__regPropsReplace, (_, $1) => {
14
- return `${$1}<_T = unknown> {`;
19
+ ast = ast.replace(__regPropsReplace, (_, $1, $2) => {
20
+ return `${$1}<_T = unknown> ${$2}`;
15
21
  });
16
22
  // Models
17
23
  ast = ast.replace(__regModelsReplace, (_, $1) => {
@@ -6,7 +6,7 @@ declare module '@cabloy/cli' {
6
6
  }
7
7
  }
8
8
 
9
- const __regProps = /interface [^<]*Props<(.*?)> \{/;
9
+ const __regProps = /interface Controller[^<]*Props<(.*?)>/;
10
10
  const __regModelsReplace = /interface [^<]*Models([^{]*) \{/;
11
11
  const __regModelValue = /import \{[^}]*ModelValue[^}]*\} from 'zova';/;
12
12
  const __regModelValueReplace = /import \{ ([^}]*) \} from 'zova';/;
@@ -1,6 +1,6 @@
1
1
  import { metadataCustomSnippet } from '@cabloy/cli';
2
2
 
3
- const __regProps = /interface [^<]*Props<(.*?)> \{/;
3
+ const __regProps = /interface Controller[^<]*Props<(.*?)>/;
4
4
 
5
5
  export default metadataCustomSnippet({
6
6
  file: ({ argv }) => {
package/dist/index.js CHANGED
@@ -364,16 +364,25 @@ class CliBinBuildRest extends BeanCliBase {
364
364
  await fse.writeFile(path.join(srcDir, 'package.json'), pkgContent);
365
365
  }
366
366
  async _prepareResourcesIndex({
367
- srcDir
367
+ srcDir,
368
+ projectPath
368
369
  }) {
369
370
  let indexContent = `import type { IIconRecord } from 'zova-module-a-icon';
370
- import type { TypePagePathSchema } from 'zova-module-a-router';
371
371
  export type { IIconRecord } from 'zova-module-a-icon';
372
+ import type { TypePagePathSchema } from 'zova-module-a-router';
372
373
  export type { IPagePathRecord } from 'zova-module-a-router';
374
+ export type {
375
+ IResourceComponentActionBulkRecord,
376
+ IResourceComponentActionRowRecord,
377
+ IResourceComponentBlockRecord,
378
+ IResourceComponentFormFieldRecord,
379
+ IResourceComponentTableCellRecord,
380
+ } from 'zova-module-a-openapi';
373
381
  `;
374
382
  indexContent += await this._prepareResourcesIndex_rest(srcDir);
375
383
  indexContent += await this._prepareResourcesIndex_icons(srcDir);
376
384
  indexContent += await this._prepareResourcesIndex_pages(srcDir);
385
+ indexContent += await this._prepareResourcesIndex_providers(srcDir, projectPath);
377
386
  await fse.writeFile(path.join(srcDir, 'index.ts'), indexContent);
378
387
  }
379
388
  async _prepareResourcesIndex_rest(srcDir) {
@@ -404,6 +413,17 @@ export type { IPagePathRecord } from 'zova-module-a-router';
404
413
  `;
405
414
  return content;
406
415
  }
416
+ async _prepareResourcesIndex_providers(_srcDir, projectPath) {
417
+ const dirBasicOpenapi = path.join(projectPath, './src/suite/cabloy-basic/modules/basic-openapi');
418
+ const dirStartOpenapi = path.join(projectPath, './src/suite/cabloy-start/modules/start-openapi');
419
+ let content = '';
420
+ if (fse.existsSync(dirBasicOpenapi)) {
421
+ content += `import 'zova-module-basic-openapi';\n`;
422
+ } else if (fse.existsSync(dirStartOpenapi)) {
423
+ content += `import 'zova-module-start-openapi';\n`;
424
+ }
425
+ return content;
426
+ }
407
427
  async _prepareResourcesIndex_pages(_srcDir) {
408
428
  const content = `declare module 'zova-module-a-router' {
409
429
  export interface IPagePathRecord {
@@ -21,9 +21,10 @@ export declare class CliBinBuildRest extends BeanCliBase {
21
21
  _buildDts({ srcDir, outDir }: IBinBuildRestContext): Promise<void>;
22
22
  _build(buildContext: IBinBuildRestContext): Promise<void>;
23
23
  _prepareResourcesPackage({ projectPath, flavor, bundleName, srcDir }: IBinBuildRestContext): Promise<void>;
24
- _prepareResourcesIndex({ srcDir }: IBinBuildRestContext): Promise<void>;
24
+ _prepareResourcesIndex({ srcDir, projectPath }: IBinBuildRestContext): Promise<void>;
25
25
  _prepareResourcesIndex_rest(srcDir: string): Promise<string>;
26
26
  _prepareResourcesIndex_icons(_srcDir: string): Promise<string>;
27
+ _prepareResourcesIndex_providers(_srcDir: string, projectPath: string): Promise<string>;
27
28
  _prepareResourcesIndex_pages(_srcDir: string): Promise<string>;
28
29
  }
29
30
  export {};
@@ -1,5 +1,5 @@
1
1
  import { metadataCustomSnippet } from '@cabloy/cli';
2
- const __regProps = /interface [^<]*Props<(.*?)> \{/;
2
+ const __regProps = /interface Controller[^<]*Props<(.*?)>/;
3
3
  export default metadataCustomSnippet({
4
4
  file: ({ argv }) => {
5
5
  return argv.controllerFileName;
@@ -1,5 +1,5 @@
1
1
  import { metadataCustomSnippet } from '@cabloy/cli';
2
- const __regPropsReplace = /(interface [^<]*Props) \{/;
2
+ const __regPropsReplace = /(interface [^<]*Props) ([(extends)|{])/;
3
3
  const __regModelsReplace = /(interface [^<]*Models) \{/;
4
4
  export default metadataCustomSnippet({
5
5
  file: ({ argv }) => {
@@ -8,8 +8,8 @@ export default metadataCustomSnippet({
8
8
  language: 'plain',
9
9
  async transform({ ast }) {
10
10
  // Props
11
- ast = ast.replace(__regPropsReplace, (_, $1) => {
12
- return `${$1}<_T = unknown> {`;
11
+ ast = ast.replace(__regPropsReplace, (_, $1, $2) => {
12
+ return `${$1}<_T = unknown> ${$2}`;
13
13
  });
14
14
  // Models
15
15
  ast = ast.replace(__regModelsReplace, (_, $1) => {
@@ -1,5 +1,5 @@
1
1
  import { metadataCustomSnippet } from '@cabloy/cli';
2
- const __regProps = /interface [^<]*Props<(.*?)> \{/;
2
+ const __regProps = /interface Controller[^<]*Props<(.*?)>/;
3
3
  const __regModelsReplace = /interface [^<]*Models([^{]*) \{/;
4
4
  const __regModelValue = /import \{[^}]*ModelValue[^}]*\} from 'zova';/;
5
5
  const __regModelValueReplace = /import \{ ([^}]*) \} from 'zova';/;
@@ -1,5 +1,5 @@
1
1
  import { metadataCustomSnippet } from '@cabloy/cli';
2
- const __regProps = /interface [^<]*Props<(.*?)> \{/;
2
+ const __regProps = /interface Controller[^<]*Props<(.*?)>/;
3
3
  export default metadataCustomSnippet({
4
4
  file: ({ argv }) => {
5
5
  return argv.controllerFileName;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zova-cli-set-front",
3
- "version": "1.2.34",
4
- "gitHead": "8d42f31a8ee23be4564814a901d770307635c849",
3
+ "version": "1.2.35",
4
+ "gitHead": "a247f88a55c663d313296039f874560ee5a13e01",
5
5
  "description": "zova cli-set-front",
6
6
  "keywords": [
7
7
  "framework",
@@ -40,17 +40,17 @@
40
40
  "@cabloy/extend": "^3.1.0",
41
41
  "@cabloy/module-info": "^2.0.0",
42
42
  "@cabloy/openapi-typescript": "^7.9.2",
43
- "@cabloy/utils": "^2.1.9",
43
+ "@cabloy/utils": "^2.1.15",
44
44
  "@cabloy/vite-plugin-babel": "^1.3.3",
45
45
  "@cabloy/vue-babel-plugin-jsx": "^2.0.1",
46
- "@cabloy/word-utils": "^2.1.8",
46
+ "@cabloy/word-utils": "^2.1.9",
47
47
  "@typescript/native-preview": "^7.0.0-dev.20260320.1",
48
48
  "@vitejs/plugin-vue-jsx": "^5.1.5",
49
49
  "babel-plugin-transform-typescript-metadata": "^0.4.0",
50
- "babel-plugin-zova-bean-module": "^1.2.8",
51
- "babel-plugin-zova-bean-use": "^1.1.8",
52
- "babel-plugin-zova-behavior": "^1.1.8",
53
- "babel-plugin-zova-component": "^1.1.8",
50
+ "babel-plugin-zova-bean-module": "^1.2.9",
51
+ "babel-plugin-zova-bean-use": "^1.1.9",
52
+ "babel-plugin-zova-behavior": "^1.1.9",
53
+ "babel-plugin-zova-component": "^1.1.9",
54
54
  "compressing": "^1.10.0",
55
55
  "fs-extra": "^11.3.4",
56
56
  "globby": "^14.1.0",
@@ -64,7 +64,7 @@
64
64
  "urllib": "^4.6.11",
65
65
  "vite": "^8.0.2",
66
66
  "yaml": "^2.8.3",
67
- "zova-openapi": "^1.1.8",
68
- "zova-vite": "^1.1.19"
67
+ "zova-openapi": "^1.1.9",
68
+ "zova-vite": "^1.1.20"
69
69
  }
70
70
  }