Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NX does not list inferred task plugins as "local" in NX repo #29773

Open
4 tasks
comp615 opened this issue Jan 28, 2025 · 0 comments
Open
4 tasks

NX does not list inferred task plugins as "local" in NX repo #29773

comp615 opened this issue Jan 28, 2025 · 0 comments
Assignees
Labels
scope: core core nx functionality type: bug

Comments

@comp615
Copy link

comp615 commented Jan 28, 2025

Current Behavior

NOTE: This appears to be a minor bug since the code paths that use this only appear to be for reporting?

When using a local workspace plugin where it ONLY has exports to infer targets (i.e. createNodesV2, it will not show up in nx report under Local workspace plugins:.

Expected Behavior

Plugins that are locally defined should show up accurately with correct capabilities.

GitHub Repo

No response

Steps to Reproduce

  1. Create a plugin where the only export is export const createNodesV2
  2. In particular, this means deleting executors.json if you generated it, along with any generator definitions in package.json
  3. Include it as a plugin in nx.json
  4. run nx report and see that it's not included

Nx Report

NX   Report complete - copy this into the issue template

Node           : 22.9.0
OS             : darwin-arm64
Native Target  : aarch64-macos
pnpm           : 9.11.0

nx                     : 20.3.2
@nx/js                 : 20.3.2
@nx/jest               : 20.3.2
@nx/eslint             : 20.3.2
@nx/workspace          : 20.3.2
@nx/cypress            : 20.3.2
@nx/devkit             : 20.3.2
@nx/eslint-plugin      : 20.3.2
@nx/module-federation  : 20.3.2
@nx/plugin             : 20.3.2
@nx/react              : 20.3.2
@nx/storybook          : 20.3.2
@nx/vite               : 20.3.2
@nx/web                : 20.3.2
typescript             : 5.5.4
---------------------------------------
Registered Plugins:
@nx/vite/plugin
@nx/storybook/plugin

Failure Logs

Package Manager Version

9.11.0

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

This occurs because of faulty code in getPluginCapabilities (https://github.com/nrwl/nx/blob/master/packages/nx/src/utils/plugins/plugin-capabilities.ts#L51).

It will only try to get the modules if executor or generators are present. Since it skips this, it returns simply the name, despite needing the entire module to later on see if those inferred target function names are present

NOTE: this will work correctly if a generator or executor is present.

@FrozenPandaz FrozenPandaz added the scope: core core nx functionality label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: core core nx functionality type: bug
Projects
None yet
Development

No branches or pull requests

3 participants