|
1 | 1 | import { |
2 | 2 | addProjectConfiguration, |
3 | 3 | formatFiles, |
| 4 | + GeneratorCallback, |
4 | 5 | getWorkspaceLayout, |
5 | 6 | joinPathFragments, |
6 | 7 | names, |
@@ -164,7 +165,9 @@ export async function GenerateProject( |
164 | 165 | dotnetClient: DotNetClient, |
165 | 166 | projectType: ProjectType, |
166 | 167 | ) { |
167 | | - const installTask = await initGenerator(host, null, dotnetClient); |
| 168 | + const tasks: GeneratorCallback[] = [ |
| 169 | + await initGenerator(host, null, dotnetClient), |
| 170 | + ]; |
168 | 171 |
|
169 | 172 | options.testTemplate = options.testTemplate ?? 'none'; |
170 | 173 |
|
@@ -224,17 +227,22 @@ export async function GenerateProject( |
224 | 227 | normalizedOptions.projectTemplate === 'webapi' && |
225 | 228 | !normalizedOptions.skipSwaggerLib |
226 | 229 | ) { |
227 | | - await generateSwaggerSetup(host, { |
228 | | - project: normalizedOptions.projectName, |
229 | | - swaggerProject: `${normalizedOptions.projectName}-swagger`, |
230 | | - codegenProject: `${normalizedOptions.projectName}-types`, |
231 | | - useNxPluginOpenAPI: normalizedOptions.useNxPluginOpenAPI, |
232 | | - }); |
| 230 | + tasks.push( |
| 231 | + await generateSwaggerSetup(host, { |
| 232 | + project: normalizedOptions.projectName, |
| 233 | + swaggerProject: `${normalizedOptions.projectName}-swagger`, |
| 234 | + codegenProject: `${normalizedOptions.projectName}-types`, |
| 235 | + useNxPluginOpenAPI: normalizedOptions.useNxPluginOpenAPI, |
| 236 | + }), |
| 237 | + ); |
233 | 238 | } |
234 | 239 |
|
| 240 | + await formatFiles(host); |
| 241 | + |
235 | 242 | return async () => { |
236 | | - installTask(); |
237 | | - await formatFiles(host); |
| 243 | + for (const task of tasks) { |
| 244 | + await task(); |
| 245 | + } |
238 | 246 | }; |
239 | 247 | } |
240 | 248 |
|
|
0 commit comments