Skip to content

Conversation

Coly010
Copy link
Contributor

@Coly010 Coly010 commented Oct 2, 2025

Current Behavior

There is not currently a generator for creating an Inference Plugin in the @nx/plugin package.

Expected Behavior

Add a generator for creating an Inference Plugin.

It can be invoked with nx g @nx/plugin:create-nodes.
The @nx/plugin:plugin generator will also create an Inference Plugin by default.

@Coly010 Coly010 requested review from FrozenPandaz, jaysoo, AgentEnder and a team as code owners October 2, 2025 11:53
@Coly010 Coly010 self-assigned this Oct 2, 2025
Copy link

vercel bot commented Oct 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Oct 3, 2025 2:28pm

Copy link

netlify bot commented Oct 2, 2025

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit e80b18f
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/68dfd84603112200081fefe9
😎 Deploy Preview https://deploy-preview-32931--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

nx-cloud bot commented Oct 2, 2025

View your CI Pipeline Execution ↗ for commit e80b18f

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 10m 41s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 1m 51s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 6s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 5s View ↗
nx documentation ✅ Succeeded 2m 1s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-03 14:23:05 UTC

nx-cloud[bot]

This comment was marked as outdated.

@Coly010 Coly010 force-pushed the plugin/add-create-nodes branch 2 times, most recently from de72b3c to 4e91f12 Compare October 2, 2025 14:43
nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@Coly010 Coly010 force-pushed the plugin/add-create-nodes branch from 62bd430 to ac553c0 Compare October 2, 2025 17:49
nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

Copy link
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nx Cloud is proposing a fix for your failed CI:

Fixed a TypeScript error in the generated createNodes plugin template where the callback parameter options was shadowing the normalized outer scope variable. The callback now uses the pre-normalized normalizedOptions to ensure createNodesInternal always receives a defined options object.

We verified this fix by re-running e2e-plugin:e2e-ci--src/nx-plugin-ts-solution.test.ts.

Suggested Fix changes
diff --git a/packages/angular-rspack-compiler/package.json b/packages/angular-rspack-compiler/package.json
index 164423cb75..ae02aad3a1 100644
--- a/packages/angular-rspack-compiler/package.json
+++ b/packages/angular-rspack-compiler/package.json
@@ -1,7 +1,7 @@
 {
   "name": "@nx/angular-rspack-compiler",
   "private": false,
-  "version": "0.0.1",
+  "version": "22.0.0",
   "publishConfig": {
     "access": "public"
   },
diff --git a/packages/angular-rspack/package.json b/packages/angular-rspack/package.json
index bd24ec75b0..fc933a089e 100644
--- a/packages/angular-rspack/package.json
+++ b/packages/angular-rspack/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@nx/angular-rspack",
-  "version": "0.0.1",
+  "version": "22.0.0",
   "private": false,
   "publishConfig": {
     "access": "public"
@@ -49,8 +49,8 @@
     "@ampproject/remapping": "2.3.0",
     "@babel/core": "7.28.3",
     "@discoveryjs/json-ext": "0.6.3",
-    "@nx/angular-rspack-compiler": "workspace:*",
-    "@nx/devkit": "workspace:*",
+    "@nx/angular-rspack-compiler": "22.0.0",
+    "@nx/devkit": "22.0.0",
     "ansi-colors": "4.1.3",
     "autoprefixer": "10.4.21",
     "deepmerge": "^4.3.1",
diff --git a/packages/plugin/src/generators/create-nodes/files/plugin/__fileName__.ts.template b/packages/plugin/src/generators/create-nodes/files/plugin/__fileName__.ts.template
index cef5648355..c80145c087 100644
--- a/packages/plugin/src/generators/create-nodes/files/plugin/__fileName__.ts.template
+++ b/packages/plugin/src/generators/create-nodes/files/plugin/__fileName__.ts.template
@@ -70,8 +70,8 @@ const configGlob = '<%= configFile %>';
 export const createNodesV2: CreateNodesV2<<%= className %>PluginOptions> = [
   configGlob,
   async (configFilePaths, options, context) => {
-    options ??= {} as <%= className %>PluginOptions;
-    const optionsHash = hashObject(options);
+    const normalizedOptions = options ?? ({} as <%= className %>PluginOptions);
+    const optionsHash = hashObject(normalizedOptions);
     const cachePath = join(
       workspaceDataDirectory,
       `<%= fileName %>-${optionsHash}.hash`
@@ -80,10 +80,10 @@ export const createNodesV2: CreateNodesV2<<%= className %>PluginOptions> = [
 
     try {
       return await createNodesFromFiles(
-        (configFile, options, context) =>
-          createNodesInternal(configFile, options, context, targetsCache),
+        (configFile, _, context) =>
+          createNodesInternal(configFile, normalizedOptions, context, targetsCache),
         configFilePaths,
-        options,
+        normalizedOptions,
         context
       );
     } finally {

Apply fix via Nx Cloud  Reject fix via Nx Cloud

Nx CloudApply fix locally ↗  Nx CloudView interactive diff ↗


⚙️ An Nx Cloud workspace admin can disable these reviews in workspace settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant