Skip to content

Commit

Permalink
fix(core): run install tasks from convert-to-inferred generators
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Sep 12, 2024
1 parent 5ab7f1f commit 2b8154d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import {
createProjectGraphAsync,
formatFiles,
GeneratorCallback,
output,
readProjectsConfigurationFromProjectGraph,
runTasksInSerial,
Tree,
workspaceRoot,
} from '@nx/devkit';
Expand Down Expand Up @@ -67,6 +69,7 @@ export async function convertToInferredGenerator(tree: Tree, options: Schema) {
return;
}

const tasks: GeneratorCallback[] = [];
for (const generatorCollection of generatorsToRun) {
try {
const generator = generatorCollectionChoices.get(generatorCollection);
Expand All @@ -77,7 +80,8 @@ export async function convertToInferredGenerator(tree: Tree, options: Schema) {
skipFormat: options.skipFormat,
});
if (callback) {
await callback();
const task = await callback();
if (typeof task === 'function') tasks.push(task);
}
output.success({
title: `${generatorCollection}:convert-to-inferred - Success`,
Expand All @@ -100,6 +104,8 @@ export async function convertToInferredGenerator(tree: Tree, options: Schema) {
if (!options.skipFormat) {
await formatFiles(tree);
}

return runTasksInSerial(...tasks);
}

async function getPossibleConvertToInferredGenerators() {
Expand Down

0 comments on commit 2b8154d

Please sign in to comment.