mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 03:01:16 +00:00
feat: generateTemplate fun support context
This commit is contained in:
parent
02a3361f41
commit
e875e33dc5
@ -111,8 +111,6 @@ export class ProjectBuilder implements IProjectBuilder {
|
|||||||
// Init
|
// Init
|
||||||
const { schemaParser } = this;
|
const { schemaParser } = this;
|
||||||
|
|
||||||
const projectRoot = await this.template.generateTemplate();
|
|
||||||
|
|
||||||
let schema: IPublicTypeProjectSchema =
|
let schema: IPublicTypeProjectSchema =
|
||||||
typeof originalSchema === 'string' ? JSON.parse(originalSchema) : originalSchema;
|
typeof originalSchema === 'string' ? JSON.parse(originalSchema) : originalSchema;
|
||||||
|
|
||||||
@ -131,6 +129,9 @@ export class ProjectBuilder implements IProjectBuilder {
|
|||||||
// Collect Deps
|
// Collect Deps
|
||||||
// Parse JSExpression
|
// Parse JSExpression
|
||||||
const parseResult: IParseResult = schemaParser.parse(schema);
|
const parseResult: IParseResult = schemaParser.parse(schema);
|
||||||
|
|
||||||
|
const projectRoot = await this.template.generateTemplate(parseResult);
|
||||||
|
|
||||||
let buildResult: IModuleInfo[] = [];
|
let buildResult: IModuleInfo[] = [];
|
||||||
|
|
||||||
const builders = this.createModuleBuilders({
|
const builders = this.createModuleBuilders({
|
||||||
|
|||||||
@ -127,7 +127,7 @@ export interface ISchemaParser {
|
|||||||
|
|
||||||
export interface IProjectTemplate {
|
export interface IProjectTemplate {
|
||||||
slots: Record<string, IProjectSlot>;
|
slots: Record<string, IProjectSlot>;
|
||||||
generateTemplate: () => ResultDir | Promise<ResultDir>;
|
generateTemplate: (data: IParseResult) => ResultDir | Promise<ResultDir>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IProjectSlot {
|
export interface IProjectSlot {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user