Skip to content

Commit

Permalink
fix(core): install not ran after generating a webapi with useNxPlugin…
Browse files Browse the repository at this point in the history
…OpenAPI (#601)
  • Loading branch information
AgentEnder authored Jan 26, 2023
1 parent 5de90c4 commit 15e4db5
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions packages/core/src/generators/utils/generate-project.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
addProjectConfiguration,
formatFiles,
GeneratorCallback,
getWorkspaceLayout,
joinPathFragments,
names,
Expand Down Expand Up @@ -164,7 +165,9 @@ export async function GenerateProject(
dotnetClient: DotNetClient,
projectType: ProjectType,
) {
const installTask = await initGenerator(host, null, dotnetClient);
const tasks: GeneratorCallback[] = [
await initGenerator(host, null, dotnetClient),
];

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

Expand Down Expand Up @@ -224,17 +227,22 @@ export async function GenerateProject(
normalizedOptions.projectTemplate === 'webapi' &&
!normalizedOptions.skipSwaggerLib
) {
await generateSwaggerSetup(host, {
project: normalizedOptions.projectName,
swaggerProject: `${normalizedOptions.projectName}-swagger`,
codegenProject: `${normalizedOptions.projectName}-types`,
useNxPluginOpenAPI: normalizedOptions.useNxPluginOpenAPI,
});
tasks.push(
await generateSwaggerSetup(host, {
project: normalizedOptions.projectName,
swaggerProject: `${normalizedOptions.projectName}-swagger`,
codegenProject: `${normalizedOptions.projectName}-types`,
useNxPluginOpenAPI: normalizedOptions.useNxPluginOpenAPI,
}),
);
}

await formatFiles(host);

return async () => {
installTask();
await formatFiles(host);
for (const task of tasks) {
await task();
}
};
}

Expand Down

0 comments on commit 15e4db5

Please sign in to comment.