Skip to content

Commit

Permalink
fix(misc): createNodesV2 plugins should show inference capabilities (n…
Browse files Browse the repository at this point in the history
…rwl#27896)

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
Plugins that export `createNodesV2` are not considered as having
inference capabilities

## Expected Behavior
`createNodesV2` is the future API replacing `createNodes`, so it should
show the same capability

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
  • Loading branch information
AgentEnder authored Sep 12, 2024
1 parent 7f7e4d0 commit 2e0f374
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/nx/src/utils/plugins/plugin-capabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,14 @@ export async function getPluginCapabilities(
pluginModule &&
('processProjectGraph' in pluginModule ||
'createNodes' in pluginModule ||
'createNodesV2' in pluginModule ||
'createMetadata' in pluginModule ||
'createDependencies' in pluginModule),
projectInference:
pluginModule &&
('projectFilePatterns' in pluginModule ||
'createNodes' in pluginModule),
'createNodes' in pluginModule ||
'createNodesV2' in pluginModule),
};
} catch {
return null;
Expand Down

0 comments on commit 2e0f374

Please sign in to comment.