zova-cli-set-front 1.2.34 → 1.2.36
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/cli/templates/create/component/boilerplateActionBulk/controller.tsx_ +21 -0
- package/cli/templates/create/component/boilerplateActionRow/controller.tsx_ +21 -0
- package/cli/templates/create/component/boilerplateBlockPage/controller.tsx_ +21 -0
- package/cli/templates/create/component/boilerplateBlockPageEntry/controller.tsx_ +21 -0
- package/cli/templates/create/component/boilerplateFormField/controller.tsx_ +3 -3
- package/cli/templates/refactor/componentEmits/snippets/2-controller.ts +1 -1
- package/cli/templates/refactor/componentGeneric/snippets/2-controller.ts +9 -3
- package/cli/templates/refactor/componentModel/snippets/1-controller.ts +1 -1
- package/cli/templates/refactor/componentSlots/snippets/1-controller.ts +1 -1
- package/dist/index.js +30 -2
- package/dist/lib/bean/cli.bin.buildRest.d.ts +2 -1
- package/dist-cli/templates/refactor/componentEmits/snippets/2-controller.js +1 -1
- package/dist-cli/templates/refactor/componentGeneric/snippets/2-controller.js +3 -3
- package/dist-cli/templates/refactor/componentModel/snippets/1-controller.js +1 -1
- package/dist-cli/templates/refactor/componentSlots/snippets/1-controller.js +1 -1
- package/package.json +10 -10
|
@@ -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 {
|
|
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
|
|
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
|
|
|
@@ -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';/;
|
package/dist/index.js
CHANGED
|
@@ -364,16 +364,28 @@ 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
|
+
import type { IActionRecord, TypeActionOptions } from 'zova-module-a-action';
|
|
375
|
+
export type { IActionRecord } from 'zova-module-a-action';
|
|
376
|
+
export type {
|
|
377
|
+
IResourceComponentActionBulkRecord,
|
|
378
|
+
IResourceComponentActionRowRecord,
|
|
379
|
+
IResourceComponentBlockRecord,
|
|
380
|
+
IResourceComponentFormFieldRecord,
|
|
381
|
+
IResourceComponentTableCellRecord,
|
|
382
|
+
ISchemaRenderComponentLayoutOptions,
|
|
383
|
+
} from 'zova-module-a-openapi';
|
|
373
384
|
`;
|
|
374
385
|
indexContent += await this._prepareResourcesIndex_rest(srcDir);
|
|
375
386
|
indexContent += await this._prepareResourcesIndex_icons(srcDir);
|
|
376
387
|
indexContent += await this._prepareResourcesIndex_pages(srcDir);
|
|
388
|
+
indexContent += await this._prepareResourcesIndex_providers(srcDir, projectPath);
|
|
377
389
|
await fse.writeFile(path.join(srcDir, 'index.ts'), indexContent);
|
|
378
390
|
}
|
|
379
391
|
async _prepareResourcesIndex_rest(srcDir) {
|
|
@@ -401,6 +413,22 @@ export type { IPagePathRecord } from 'zova-module-a-router';
|
|
|
401
413
|
const content = `export function $iconName<K extends keyof IIconRecord>(name: K): any {
|
|
402
414
|
return name;
|
|
403
415
|
}
|
|
416
|
+
`;
|
|
417
|
+
return content;
|
|
418
|
+
}
|
|
419
|
+
async _prepareResourcesIndex_providers(_srcDir, projectPath) {
|
|
420
|
+
// openapi
|
|
421
|
+
const dirBasicOpenapi = path.join(projectPath, './src/suite/cabloy-basic/modules/basic-openapi');
|
|
422
|
+
const dirStartOpenapi = path.join(projectPath, './src/suite/cabloy-start/modules/start-openapi');
|
|
423
|
+
let content = '';
|
|
424
|
+
if (fse.existsSync(dirBasicOpenapi)) {
|
|
425
|
+
content += `import 'zova-module-basic-openapi';\n`;
|
|
426
|
+
} else if (fse.existsSync(dirStartOpenapi)) {
|
|
427
|
+
content += `import 'zova-module-start-openapi';\n`;
|
|
428
|
+
}
|
|
429
|
+
content += `export function Action<K extends keyof IActionRecord>(options: TypeActionOptions<K>) {
|
|
430
|
+
return options.name.replace(':','.tableCell.');
|
|
431
|
+
}
|
|
404
432
|
`;
|
|
405
433
|
return content;
|
|
406
434
|
}
|
|
@@ -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 __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';/;
|
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.36",
|
|
4
|
+
"gitHead": "9664b8fb5bcc3d8f2836fce8481d3c3a093f3aef",
|
|
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.
|
|
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.
|
|
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.
|
|
51
|
-
"babel-plugin-zova-bean-use": "^1.1.
|
|
52
|
-
"babel-plugin-zova-behavior": "^1.1.
|
|
53
|
-
"babel-plugin-zova-component": "^1.1.
|
|
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.
|
|
68
|
-
"zova-vite": "^1.1.
|
|
67
|
+
"zova-openapi": "^1.1.9",
|
|
68
|
+
"zova-vite": "^1.1.20"
|
|
69
69
|
}
|
|
70
70
|
}
|