Skip to content

Commit f48bf31

Browse files
fix(repo): remove redundant inputs override for build-base target (#34649)
## 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 <[email protected]>
1 parent 2c802ba commit f48bf31

4 files changed

Lines changed: 5 additions & 2 deletions

File tree

nx.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@
112112
},
113113
"build-base": {
114114
"dependsOn": ["^build-base", "build-native"],
115-
"inputs": ["production", "^production"],
116115
"cache": true
117116
},
118117
"test-native": {

packages/angular-rspack-compiler/.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"ignoredDependencies": [
4646
"@angular/core",
4747
"jsonc-eslint-parser",
48+
"semver",
4849
"vitest",
4950
"memfs"
5051
]

packages/angular/.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"buildTargets": ["build-base"],
5353
"ignoredDependencies": [
5454
"@angular-devkit/architect",
55+
"@angular-devkit/core",
5556
"@angular-devkit/schematics",
5657
"@nx/cypress",
5758
"@nx/jest",

packages/nx/.eslintrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@
145145
// Nx Docker plugin conditionally available dynamically at runtime
146146
"@nx/docker",
147147
// Only used in test-utils at the time of writing
148-
"@ltd/j-toml"
148+
"@ltd/j-toml",
149+
// Used in WASI browser implementation (nx.wasi-browser.js)
150+
"@napi-rs/wasm-runtime"
149151
]
150152
}
151153
]

0 commit comments

Comments
 (0)