Skip to content

fix(repo): remove redundant inputs override for build-base target#34649

Merged
FrozenPandaz merged 3 commits into
masterfrom
fix/build-base-inputs
Mar 2, 2026
Merged

fix(repo): remove redundant inputs override for build-base target#34649
FrozenPandaz merged 3 commits into
masterfrom
fix/build-base-inputs

Conversation

@FrozenPandaz

@FrozenPandaz FrozenPandaz commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Current Behavior

The build-base target in nx.json has a manual inputs override of ["production", "^production"] which shadows the more accurate inputs inferred by the @nx/js/typescript plugin.

Expected Behavior

Let the @nx/js/typescript plugin infer the correct inputs for build-base tasks, providing more accurate cache invalidation based on the actual tsconfig project references.

Lint Rule Changes

Removing the broad inputs override causes the @nx/dependency-checks lint rule to flag a few dependencies as "unused" across three packages. This happens because the rule uses the build target's inputs to determine which files to scan for imports, and the narrower tsc-inferred inputs don't cover certain files:

  • packages/nx: @napi-rs/wasm-runtime — used in nx.wasi-browser.js, a .js file outside tsconfig scope
  • packages/angular: @angular-devkit/core — only referenced as a string (for ensurePackage(), migrations config) and is a peerDependency, not directly imported at runtime
  • packages/angular-rspack-compiler: semver — used in patch/patch-angular-build.js, a .js patch file outside tsconfig scope

These are all legitimate dependencies. Adding the .js files to tsconfig would require allowJs and pull non-TS scripts into the build pipeline unnecessarily. Adding them to ignoredDependencies in each package's .eslintrc.json is the correct fix.

The build-base target had a manual inputs override of
["production", "^production"] which shadows the more accurate inputs
inferred by the @nx/js/typescript plugin.
@netlify

netlify Bot commented Feb 27, 2026

Copy link
Copy Markdown

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 3d22f1e
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69a22110781862000913eeff
😎 Deploy Preview https://deploy-preview-34649--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.

@nx-cloud

nx-cloud Bot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 3d22f1e

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 41m 50s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3m 11s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 7s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-27 23:42:13 UTC

@netlify

netlify Bot commented Feb 27, 2026

Copy link
Copy Markdown

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 3d22f1e
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69a22110d48b970008f769a4
😎 Deploy Preview https://deploy-preview-34649--nx-dev.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.

nx-cloud[bot]

This comment was marked as outdated.

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ The fix from Nx Cloud was applied

These changes fix the lint failures by adding missing dependencies to the ignoredDependencies lists in the ESLint configurations. When we removed the manual inputs override for build-base in nx.json, the @nx/js/typescript plugin began inferring inputs differently, causing the @nx/dependency-checks rule to exclude certain files (particularly .js files) from its analysis and incorrectly flag legitimately-used dependencies as unused.

Tip

We verified this fix by re-running angular-rspack-compiler:lint, angular:lint, nx:lint.

Suggested Fix changes
diff --git a/packages/angular-rspack-compiler/.eslintrc.json b/packages/angular-rspack-compiler/.eslintrc.json
index eab5cc4b4f..f783908f7c 100644
--- a/packages/angular-rspack-compiler/.eslintrc.json
+++ b/packages/angular-rspack-compiler/.eslintrc.json
@@ -45,6 +45,7 @@
             "ignoredDependencies": [
               "@angular/core",
               "jsonc-eslint-parser",
+              "semver",
               "vitest",
               "memfs"
             ]
diff --git a/packages/angular/.eslintrc.json b/packages/angular/.eslintrc.json
index dde9a874c8..f71c7a4d04 100644
--- a/packages/angular/.eslintrc.json
+++ b/packages/angular/.eslintrc.json
@@ -52,6 +52,7 @@
             "buildTargets": ["build-base"],
             "ignoredDependencies": [
               "@angular-devkit/architect",
+              "@angular-devkit/core",
               "@angular-devkit/schematics",
               "@nx/cypress",
               "@nx/jest",
diff --git a/packages/nx/.eslintrc.json b/packages/nx/.eslintrc.json
index 44650fb785..8e12df20ef 100644
--- a/packages/nx/.eslintrc.json
+++ b/packages/nx/.eslintrc.json
@@ -145,7 +145,9 @@
               // Nx Docker plugin conditionally available dynamically at runtime
               "@nx/docker",
               // Only used in test-utils at the time of writing
-              "@ltd/j-toml"
+              "@ltd/j-toml",
+              // Used in WASI browser implementation (nx.wasi-browser.js)
+              "@napi-rs/wasm-runtime"
             ]
           }
         ]

🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.

Revert fix via Nx Cloud  

View interactive diff ↗

🎓 Learn more about Self-Healing CI on nx.dev

Co-authored-by: FrozenPandaz <FrozenPandaz@users.noreply.github.com>
@FrozenPandaz FrozenPandaz marked this pull request as ready for review February 28, 2026 02:10
@FrozenPandaz FrozenPandaz requested review from a team and vsavkin as code owners February 28, 2026 02:10
@FrozenPandaz FrozenPandaz requested a review from jaysoo February 28, 2026 02:10
@FrozenPandaz FrozenPandaz merged commit f48bf31 into master Mar 2, 2026
25 checks passed
@FrozenPandaz FrozenPandaz deleted the fix/build-base-inputs branch March 2, 2026 16:41
FrozenPandaz added a commit that referenced this pull request Mar 4, 2026
…4649)

## Current Behavior

The `build-base` target in `nx.json` has a manual `inputs` override of
`["production", "^production"]` which shadows the more accurate inputs
inferred by the `@nx/js/typescript` plugin.

## Expected Behavior

Let the `@nx/js/typescript` plugin infer the correct inputs for
`build-base` tasks, providing more accurate cache invalidation based on
the actual tsconfig project references.

## Lint Rule Changes

Removing the broad `inputs` override causes the `@nx/dependency-checks`
lint rule to flag a few dependencies as "unused" across three packages.
This happens because the rule uses the build target's inputs to
determine which files to scan for imports, and the narrower tsc-inferred
inputs don't cover certain files:

- **`packages/nx`**: `@napi-rs/wasm-runtime` — used in
`nx.wasi-browser.js`, a `.js` file outside tsconfig scope
- **`packages/angular`**: `@angular-devkit/core` — only referenced as a
string (for `ensurePackage()`, migrations config) and is a
`peerDependency`, not directly imported at runtime
- **`packages/angular-rspack-compiler`**: `semver` — used in
`patch/patch-angular-build.js`, a `.js` patch file outside tsconfig
scope

These are all legitimate dependencies. Adding the `.js` files to
tsconfig would require `allowJs` and pull non-TS scripts into the build
pipeline unnecessarily. Adding them to `ignoredDependencies` in each
package's `.eslintrc.json` is the correct fix.

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: FrozenPandaz <FrozenPandaz@users.noreply.github.com>
(cherry picked from commit f48bf31)
@github-actions

github-actions Bot commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants