mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-10 18:03:01 +00:00
refactor: moduleName of Component should not be converted
This commit is contained in:
parent
9a68f0f27c
commit
5b68b860ac
@ -32,7 +32,7 @@ import {
|
||||
import { SUPPORT_SCHEMA_VERSION_LIST } from '../const';
|
||||
|
||||
import { getErrorMessage } from '../utils/errors';
|
||||
import { handleSubNodes, isValidContainerType } from '../utils/schema';
|
||||
import { handleSubNodes, isValidContainerType, ContainerType } from '../utils/schema';
|
||||
import { uniqueArray } from '../utils/common';
|
||||
import { componentAnalyzer } from '../analyzer/componentAnalyzer';
|
||||
import { ensureValidClassName } from '../utils/validate';
|
||||
@ -161,7 +161,8 @@ export class SchemaParser implements ISchemaParser {
|
||||
...subRoot,
|
||||
componentName: getRootComponentName(subRoot.componentName, compDeps),
|
||||
containerType: subRoot.componentName,
|
||||
moduleName: ensureValidClassName(changeCase.pascalCase(subRoot.fileName)),
|
||||
moduleName: ensureValidClassName(subRoot.componentName === ContainerType.Component ?
|
||||
subRoot.fileName : changeCase.pascalCase(subRoot.fileName)),
|
||||
};
|
||||
return container;
|
||||
});
|
||||
|
||||
@ -48,7 +48,7 @@ const pluginFactory: BuilderComponentPluginFactory<unknown> = () => {
|
||||
type: ChunkType.STRING,
|
||||
fileType: FileType.JSX,
|
||||
name: CLASS_DEFINE_CHUNK_NAME.InsVar,
|
||||
content: `static displayName = '${changeCase.pascalCase(ir.moduleName)}';`,
|
||||
content: `static displayName = '${ir.moduleName}';`,
|
||||
linkAfter: [
|
||||
CLASS_DEFINE_CHUNK_NAME.Start,
|
||||
],
|
||||
|
||||
@ -147,4 +147,10 @@ export function isValidContainerType(schema: IPublicTypeNodeSchema) {
|
||||
'Component',
|
||||
'Block',
|
||||
].includes(schema.componentName);
|
||||
}
|
||||
|
||||
export const enum ContainerType {
|
||||
Page = 'Page',
|
||||
Component = 'Component',
|
||||
Block = 'Block',
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user