GeezerVison is showing github.com — feat: generateTemplate fun support context · timeless1406/lowcode-engine@e875e33
File tree
Expand file treeCollapse file tree
Open diff view settings
modules/code-generator/src
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: modules/code-generator/src/generator/ProjectBuilder.ts +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -111,8 +111,6 @@ export class ProjectBuilder implements IProjectBuilder { |
111 | 111 | // Init |
112 | 112 | const { schemaParser } = this; |
113 | 113 |
|
114 | | - const projectRoot = await this.template.generateTemplate(); |
115 | | - |
116 | 114 | let schema: IPublicTypeProjectSchema = |
117 | 115 | typeof originalSchema === 'string' ? JSON.parse(originalSchema) : originalSchema; |
118 | 116 |
|
@@ -131,6 +129,9 @@ export class ProjectBuilder implements IProjectBuilder { |
131 | 129 | // Collect Deps |
132 | 130 | // Parse JSExpression |
133 | 131 | const parseResult: IParseResult = schemaParser.parse(schema); |
| 132 | + |
| 133 | + const projectRoot = await this.template.generateTemplate(parseResult); |
| 134 | + |
134 | 135 | let buildResult: IModuleInfo[] = []; |
135 | 136 |
|
136 | 137 | const builders = this.createModuleBuilders({ |
|
Collapse file
Copy file name to clipboardExpand all lines: modules/code-generator/src/types/core.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -127,7 +127,7 @@ export interface ISchemaParser { |
127 | 127 |
|
128 | 128 | export interface IProjectTemplate { |
129 | 129 | slots: Record<string, IProjectSlot>; |
130 | | - generateTemplate: () => ResultDir | Promise<ResultDir>; |
| 130 | + generateTemplate: (data: IParseResult) => ResultDir | Promise<ResultDir>; |
131 | 131 | } |
132 | 132 |
|
133 | 133 | export interface IProjectSlot { |
|