Skip to content
This repository was archived by the owner on Apr 27, 2026. It is now read-only.

Commit 15e4db5

Browse files
authored
fix(core): install not ran after generating a webapi with useNxPluginOpenAPI (#601)
1 parent 5de90c4 commit 15e4db5

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

packages/core/src/generators/utils/generate-project.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
addProjectConfiguration,
33
formatFiles,
4+
GeneratorCallback,
45
getWorkspaceLayout,
56
joinPathFragments,
67
names,
@@ -164,7 +165,9 @@ export async function GenerateProject(
164165
dotnetClient: DotNetClient,
165166
projectType: ProjectType,
166167
) {
167-
const installTask = await initGenerator(host, null, dotnetClient);
168+
const tasks: GeneratorCallback[] = [
169+
await initGenerator(host, null, dotnetClient),
170+
];
168171

169172
options.testTemplate = options.testTemplate ?? 'none';
170173

@@ -224,17 +227,22 @@ export async function GenerateProject(
224227
normalizedOptions.projectTemplate === 'webapi' &&
225228
!normalizedOptions.skipSwaggerLib
226229
) {
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+
);
233238
}
234239

240+
await formatFiles(host);
241+
235242
return async () => {
236-
installTask();
237-
await formatFiles(host);
243+
for (const task of tasks) {
244+
await task();
245+
}
238246
};
239247
}
240248

0 commit comments

Comments
 (0)