zova-module-a-bean 5.1.7 → 5.1.8
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.
|
@@ -154,7 +154,7 @@ async function generateRestComponent(
|
|
|
154
154
|
) {
|
|
155
155
|
const { cli, moduleName, modulePath } = options;
|
|
156
156
|
// const { className } = globFile;
|
|
157
|
-
const { name, nameCapitalize, hasProps, nameProps, hasModels, nameModels
|
|
157
|
+
const { name, nameCapitalize, hasProps, nameProps, hasModels, nameModels } = controllerInfo;
|
|
158
158
|
// TypeControllerPublicProps
|
|
159
159
|
const typeControllerPublicPropsName = `TypeController${nameCapitalize}PublicProps`;
|
|
160
160
|
let contentTypeControllerPublicProps = `type ${typeControllerPublicPropsName}${genericDeclare} = TypeRenderComponentJsxPropsPublic`;
|
|
@@ -180,21 +180,19 @@ async function generateRestComponent(
|
|
|
180
180
|
}
|
|
181
181
|
contentImports.push("import type { TypeRenderComponentJsxPropsPublic } from 'zova-jsx';");
|
|
182
182
|
if (_contentImportTypeController.length > 0) {
|
|
183
|
-
contentImports.push(
|
|
184
|
-
`import type { ${_contentImportTypeController.join(', ')} } from '../../src/component/${name}/controller${controllerExtJs}';`,
|
|
185
|
-
);
|
|
183
|
+
contentImports.push(`import type { ${_contentImportTypeController.join(', ')} } from 'zova-module-${moduleName}';`);
|
|
186
184
|
}
|
|
187
185
|
// component
|
|
188
186
|
let componentNamePrefix;
|
|
189
187
|
let componentName;
|
|
190
188
|
if (name !== 'formField' && name.startsWith('formField')) {
|
|
191
|
-
componentNamePrefix = '
|
|
189
|
+
componentNamePrefix = 'BBF';
|
|
192
190
|
componentName = toLowerCaseFirstChar(name.substring('formField'.length));
|
|
193
191
|
} else if (name.startsWith('restPage')) {
|
|
194
|
-
componentNamePrefix = '
|
|
192
|
+
componentNamePrefix = 'BBP';
|
|
195
193
|
componentName = toLowerCaseFirstChar(name.substring('restPage'.length));
|
|
196
194
|
} else {
|
|
197
|
-
componentNamePrefix = '
|
|
195
|
+
componentNamePrefix = 'BBZ';
|
|
198
196
|
componentName = name;
|
|
199
197
|
}
|
|
200
198
|
const componentNameFull = `${componentNamePrefix}${toUpperCaseFirstChar(combineResourceName(componentName, moduleName, true, true))}`;
|
|
@@ -8,6 +8,8 @@ import path from 'node:path';
|
|
|
8
8
|
|
|
9
9
|
import type { IControllerInfo } from './types.ts';
|
|
10
10
|
|
|
11
|
+
import { generateRestIndex } from './utils.ts';
|
|
12
|
+
|
|
11
13
|
export async function generateMetaPage(options: IMetadataCustomGenerateOptions, globFiles: [IGlobBeanFile, IControllerInfo][]) {
|
|
12
14
|
if (globFiles.length === 0) return '';
|
|
13
15
|
const { moduleName } = options;
|
|
@@ -113,15 +115,16 @@ declare module 'zova-module-${moduleName}' {
|
|
|
113
115
|
return content;
|
|
114
116
|
}
|
|
115
117
|
|
|
116
|
-
async function generateRestMetaPage(options: IMetadataCustomGenerateOptions,
|
|
118
|
+
async function generateRestMetaPage(options: IMetadataCustomGenerateOptions, _contentImportsRest: string[], contentPathRecordsRest: string[]) {
|
|
117
119
|
if (contentPathRecordsRest.length === 0) return;
|
|
118
|
-
const { modulePath } = options;
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
const { moduleName, modulePath } = options;
|
|
121
|
+
// pages
|
|
122
|
+
const contentPages = `import 'zova-module-${moduleName}';\n`;
|
|
123
|
+
const filePages = path.join(modulePath, 'rest/pages.ts');
|
|
124
|
+
await fse.outputFile(filePages, contentPages);
|
|
125
|
+
// index
|
|
126
|
+
const exportIndexContent = "export * from './pages.js';";
|
|
127
|
+
await generateRestIndex(options, modulePath, exportIndexContent);
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
function _combineModuleNameControllerName(moduleName: string, className: string) {
|
|
@@ -120,7 +120,7 @@ ${contentComponent}
|
|
|
120
120
|
async function generateRestComponent(options, _globFile, controllerInfo, genericDeclare, genericArguments, _contentImportTypeController) {
|
|
121
121
|
const { cli, moduleName, modulePath } = options;
|
|
122
122
|
// const { className } = globFile;
|
|
123
|
-
const { name, nameCapitalize, hasProps, nameProps, hasModels, nameModels
|
|
123
|
+
const { name, nameCapitalize, hasProps, nameProps, hasModels, nameModels } = controllerInfo;
|
|
124
124
|
// TypeControllerPublicProps
|
|
125
125
|
const typeControllerPublicPropsName = `TypeController${nameCapitalize}PublicProps`;
|
|
126
126
|
let contentTypeControllerPublicProps = `type ${typeControllerPublicPropsName}${genericDeclare} = TypeRenderComponentJsxPropsPublic`;
|
|
@@ -147,21 +147,21 @@ async function generateRestComponent(options, _globFile, controllerInfo, generic
|
|
|
147
147
|
}
|
|
148
148
|
contentImports.push("import type { TypeRenderComponentJsxPropsPublic } from 'zova-jsx';");
|
|
149
149
|
if (_contentImportTypeController.length > 0) {
|
|
150
|
-
contentImports.push(`import type { ${_contentImportTypeController.join(', ')} } from '
|
|
150
|
+
contentImports.push(`import type { ${_contentImportTypeController.join(', ')} } from 'zova-module-${moduleName}';`);
|
|
151
151
|
}
|
|
152
152
|
// component
|
|
153
153
|
let componentNamePrefix;
|
|
154
154
|
let componentName;
|
|
155
155
|
if (name !== 'formField' && name.startsWith('formField')) {
|
|
156
|
-
componentNamePrefix = '
|
|
156
|
+
componentNamePrefix = 'BBF';
|
|
157
157
|
componentName = toLowerCaseFirstChar(name.substring('formField'.length));
|
|
158
158
|
}
|
|
159
159
|
else if (name.startsWith('restPage')) {
|
|
160
|
-
componentNamePrefix = '
|
|
160
|
+
componentNamePrefix = 'BBP';
|
|
161
161
|
componentName = toLowerCaseFirstChar(name.substring('restPage'.length));
|
|
162
162
|
}
|
|
163
163
|
else {
|
|
164
|
-
componentNamePrefix = '
|
|
164
|
+
componentNamePrefix = 'BBZ';
|
|
165
165
|
componentName = name;
|
|
166
166
|
}
|
|
167
167
|
const componentNameFull = `${componentNamePrefix}${toUpperCaseFirstChar(combineResourceName(componentName, moduleName, true, true))}`;
|
|
@@ -2,6 +2,7 @@ import { combineResourceName } from '@cabloy/utils';
|
|
|
2
2
|
import { toUpperCaseFirstChar } from '@cabloy/word-utils';
|
|
3
3
|
import fse from 'fs-extra';
|
|
4
4
|
import path from 'node:path';
|
|
5
|
+
import { generateRestIndex } from "./utils.js";
|
|
5
6
|
export async function generateMetaPage(options, globFiles) {
|
|
6
7
|
if (globFiles.length === 0)
|
|
7
8
|
return '';
|
|
@@ -111,16 +112,17 @@ declare module 'zova-module-${moduleName}' {
|
|
|
111
112
|
await generateRestMetaPage(options, contentImportsRest, contentPathRecordsRest);
|
|
112
113
|
return content;
|
|
113
114
|
}
|
|
114
|
-
async function generateRestMetaPage(options,
|
|
115
|
+
async function generateRestMetaPage(options, _contentImportsRest, contentPathRecordsRest) {
|
|
115
116
|
if (contentPathRecordsRest.length === 0)
|
|
116
117
|
return;
|
|
117
|
-
const { modulePath } = options;
|
|
118
|
-
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
118
|
+
const { moduleName, modulePath } = options;
|
|
119
|
+
// pages
|
|
120
|
+
const contentPages = `import 'zova-module-${moduleName}';\n`;
|
|
121
|
+
const filePages = path.join(modulePath, 'rest/pages.ts');
|
|
122
|
+
await fse.outputFile(filePages, contentPages);
|
|
123
|
+
// index
|
|
124
|
+
const exportIndexContent = "export * from './pages.js';";
|
|
125
|
+
await generateRestIndex(options, modulePath, exportIndexContent);
|
|
124
126
|
}
|
|
125
127
|
function _combineModuleNameControllerName(moduleName, className) {
|
|
126
128
|
return `NS${toUpperCaseFirstChar(combineResourceName(className, moduleName, false, false))}`;
|
package/package.json
CHANGED