vona-cli-set-api 1.0.430 → 1.0.434
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/project/basic/boilerplate/package.original.json +1 -1
- package/cli/templates/create/project/basic/boilerplate/src/suite/a-home/modules/home-user/package.json +1 -1
- package/cli/templates/create/project/basic/boilerplate/src/suite/a-home/modules/home-user/src/bean/meta.index.ts +4 -7
- package/cli/templates/create/project/basic/boilerplate/src/suite/a-home/package.json +1 -1
- package/cli/templates/tools/crud/boilerplate/src/dto/{{resourceName}}Query.ts_ +2 -2
- package/cli/templates/tools/crud/snippets/2-meta.index.ts +3 -7
- package/dist-cli/templates/tools/crud/snippets/2-meta.index.js +3 -7
- package/package.json +3 -3
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import type { IMetaOptionsIndex } from 'vona-module-a-index';
|
|
2
2
|
import { BeanBase } from 'vona';
|
|
3
3
|
import { Meta } from 'vona-module-a-meta';
|
|
4
|
-
import { $tableColumns } from 'vona-module-a-
|
|
5
|
-
import { EntityRole } from '../entity/role.ts';
|
|
6
|
-
import { EntityRoleUser } from '../entity/roleUser.ts';
|
|
7
|
-
import { EntityUser } from '../entity/user.ts';
|
|
4
|
+
import { $tableColumns } from 'vona-module-a-ormutils';
|
|
8
5
|
|
|
9
6
|
@Meta<IMetaOptionsIndex>({
|
|
10
7
|
indexes: {
|
|
11
|
-
...$tableColumns(
|
|
12
|
-
...$tableColumns(
|
|
13
|
-
...$tableColumns(
|
|
8
|
+
...$tableColumns('homeUser', 'name'),
|
|
9
|
+
...$tableColumns('homeRole', 'name'),
|
|
10
|
+
...$tableColumns('homeRoleUser', ['userId', 'roleId']),
|
|
14
11
|
},
|
|
15
12
|
})
|
|
16
13
|
export class MetaIndex extends BeanBase {}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
2
|
import { Api, v } from 'vona-module-a-openapiutils';
|
|
3
|
-
import { $Dto
|
|
3
|
+
import { $Dto } from 'vona-module-a-orm';
|
|
4
4
|
import { Dto } from 'vona-module-a-web';
|
|
5
5
|
import { Entity<%=argv.resourceNameCapitalize%> } from '../entity/<%=argv.resourceName%>.ts';
|
|
6
6
|
|
|
7
7
|
export interface IDtoOptions<%=argv.resourceNameCapitalize%>Query extends IDecoratorDtoOptions {}
|
|
8
8
|
|
|
9
9
|
@Dto<IDtoOptions<%=argv.resourceNameCapitalize%>Query>({
|
|
10
|
-
openapi: { filter: { table:
|
|
10
|
+
openapi: { filter: { table: '<%=argv.moduleResourceName%>' } },
|
|
11
11
|
})
|
|
12
12
|
export class Dto<%=argv.resourceNameCapitalize%>Query extends $Dto.queryPage(Entity<%=argv.resourceNameCapitalize%>, ['name']) {
|
|
13
13
|
@Api.field(v.optional())
|
|
@@ -8,9 +8,8 @@ declare module '@cabloy/cli' {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
const __snippet_import1 = 'import { $tableColumns } from \'vona-module-a-
|
|
12
|
-
const
|
|
13
|
-
const __snippet_update = '...$tableColumns(() => Entity<%=argv.resourceNameCapitalize%>, \'name\'),';
|
|
11
|
+
const __snippet_import1 = 'import { $tableColumns } from \'vona-module-a-ormutils\';';
|
|
12
|
+
const __snippet_update = '...$tableColumns(\'<%=argv.moduleResourceName%>\', \'name\'),';
|
|
14
13
|
|
|
15
14
|
export default metadataCustomSnippet({
|
|
16
15
|
file: 'src/bean/meta.index.ts',
|
|
@@ -35,11 +34,8 @@ export default metadataCustomSnippet({
|
|
|
35
34
|
const code = await cli.template.renderContent({ content: __snippet_import1 });
|
|
36
35
|
ast = ast.replace('import { Meta } from \'vona-module-a-meta\';', `import { Meta } from 'vona-module-a-meta';\n${code}`);
|
|
37
36
|
}
|
|
38
|
-
// import2
|
|
39
|
-
let code = await cli.template.renderContent({ content: __snippet_import2 });
|
|
40
|
-
ast = ast.replace('import { $tableColumns } from \'vona-module-a-orm\';', `import { $tableColumns } from 'vona-module-a-orm';\n${code}`);
|
|
41
37
|
// update
|
|
42
|
-
code = await cli.template.renderContent({ content: __snippet_update });
|
|
38
|
+
const code = await cli.template.renderContent({ content: __snippet_update });
|
|
43
39
|
if (ast.includes('indexes: {}')) {
|
|
44
40
|
ast = ast.replace('indexes: {', `indexes: {\n ${code}\n `);
|
|
45
41
|
} else {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import { metadataCustomSnippet } from '@cabloy/cli';
|
|
3
3
|
import { catchError } from '@cabloy/utils';
|
|
4
|
-
const __snippet_import1 = 'import { $tableColumns } from \'vona-module-a-
|
|
5
|
-
const
|
|
6
|
-
const __snippet_update = '...$tableColumns(() => Entity<%=argv.resourceNameCapitalize%>, \'name\'),';
|
|
4
|
+
const __snippet_import1 = 'import { $tableColumns } from \'vona-module-a-ormutils\';';
|
|
5
|
+
const __snippet_update = '...$tableColumns(\'<%=argv.moduleResourceName%>\', \'name\'),';
|
|
7
6
|
export default metadataCustomSnippet({
|
|
8
7
|
file: 'src/bean/meta.index.ts',
|
|
9
8
|
language: 'plain',
|
|
@@ -27,11 +26,8 @@ export default metadataCustomSnippet({
|
|
|
27
26
|
const code = await cli.template.renderContent({ content: __snippet_import1 });
|
|
28
27
|
ast = ast.replace('import { Meta } from \'vona-module-a-meta\';', `import { Meta } from 'vona-module-a-meta';\n${code}`);
|
|
29
28
|
}
|
|
30
|
-
// import2
|
|
31
|
-
let code = await cli.template.renderContent({ content: __snippet_import2 });
|
|
32
|
-
ast = ast.replace('import { $tableColumns } from \'vona-module-a-orm\';', `import { $tableColumns } from 'vona-module-a-orm';\n${code}`);
|
|
33
29
|
// update
|
|
34
|
-
code = await cli.template.renderContent({ content: __snippet_update });
|
|
30
|
+
const code = await cli.template.renderContent({ content: __snippet_update });
|
|
35
31
|
if (ast.includes('indexes: {}')) {
|
|
36
32
|
ast = ast.replace('indexes: {', `indexes: {\n ${code}\n `);
|
|
37
33
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-cli-set-api",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.434",
|
|
5
5
|
"description": "vona cli-set-api",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@babel/plugin-proposal-decorators": "^7.25.9",
|
|
34
34
|
"@babel/plugin-transform-class-properties": "^7.25.9",
|
|
35
35
|
"@babel/plugin-transform-typescript": "^7.26.8",
|
|
36
|
-
"@cabloy/cli": "^3.0.
|
|
36
|
+
"@cabloy/cli": "^3.0.76",
|
|
37
37
|
"@cabloy/dotenv": "^1.1.12",
|
|
38
38
|
"@cabloy/extend": "^3.1.11",
|
|
39
39
|
"@cabloy/module-glob": "^5.2.35",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"ts-node-maintained": "^10.9.6",
|
|
65
65
|
"urllib": "^4.6.11",
|
|
66
66
|
"uuid": "^11.1.0",
|
|
67
|
-
"vona-core": "^5.0.
|
|
67
|
+
"vona-core": "^5.0.108",
|
|
68
68
|
"why-is-node-running": "^3.2.2",
|
|
69
69
|
"yargs-parser": "^22.0.0"
|
|
70
70
|
},
|