Skip to content

Outdated package detection#528

Merged
kentcdodds merged 3 commits intomainfrom
cursor/outdated-package-detection-3bdb
Jan 22, 2026
Merged

Outdated package detection#528
kentcdodds merged 3 commits intomainfrom
cursor/outdated-package-detection-3bdb

Conversation

@kentcdodds
Copy link
Copy Markdown
Member

@kentcdodds kentcdodds commented Jan 22, 2026

Refactor dependency installation check to use npm ls to accurately detect missing or invalid packages.

The previous custom logic for checking installed packages was flawed, leading to missed update notifications. Using npm ls provides a more robust and reliable way to determine if dependencies are correctly installed and satisfy their version ranges.


Open in Cursor Open in Web


Note

Refactors dependency installation checks to rely on npm|pnpm ls --json via execa, improving detection of missing/invalid packages.

  • Introduces parseNpmLsOutput and checkDependenciesWithNpmLs to parse ls output and map failing deps; removes filesystem-based node_modules scanning
  • Deduplicates expected deps; optional deps no longer trigger install requirement; continues to compute a stable dependency hash
  • Standardizes reasons by removing missing-node-modules and using missing-dependencies or up-to-date
  • Updates tests to mock execa, assert ls invocation, and cover package manager detection, scoped/dev/optional deps, and multi-root workspaces

Written by Cursor Bugbot for commit 5c7996d. This will update automatically on new commits. Configure here.

Co-authored-by: me <me@kentcdodds.com>
@cursor
Copy link
Copy Markdown
Contributor

cursor Bot commented Jan 22, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@kentcdodds kentcdodds marked this pull request as ready for review January 22, 2026 05:28
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Jan 22, 2026

View your CI Pipeline Execution ↗ for commit 5c7996d

Command Status Duration Result
nx run-many --target typecheck ✅ Succeeded 16s View ↗
nx lint ✅ Succeeded 49s View ↗
nx run-many --target build ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-22 05:49:04 UTC

cursor[bot]

This comment was marked as outdated.

- Use detected package manager (pnpm) instead of hardcoded npm for dependency checks
- Exclude optional dependencies from triggering install requirements
- Update test to correctly expect false for missing optional dependencies

Co-authored-by: me <me@kentcdodds.com>
@cursor
Copy link
Copy Markdown
Contributor

cursor Bot commented Jan 22, 2026

Bugbot Autofix resolved both bugs: package manager detection now uses pnpm instead of hardcoded npm, and optional dependencies no longer trigger install requirements.

  • ✅ Fixed: Always uses npm regardless of detected package manager
    • Modified checkDependenciesWithNpmLs to accept and use the detected package manager parameter, using pnpm when detected instead of hardcoded npm.
  • ✅ Fixed: Missing optional dependencies now incorrectly trigger install
    • Changed dependenciesNeedInstall to only consider missing regular and dev dependencies, excluding optional dependencies as intended by their semantic meaning.

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is ON. A Cloud Agent has been kicked off to fix the reported issue.

…llStatus

Co-authored-by: me <me@kentcdodds.com>
@cursor
Copy link
Copy Markdown
Contributor

cursor Bot commented Jan 22, 2026

Bugbot Autofix resolved the bug found in the latest run.

  • ✅ Fixed: Unused type value after refactor
    • Removed the unused 'missing-node-modules' value from the reason type union since it is never assigned in the current implementation.

@kentcdodds kentcdodds merged commit 73e001b into main Jan 22, 2026
10 checks passed
@kentcdodds kentcdodds deleted the cursor/outdated-package-detection-3bdb branch January 22, 2026 15:03
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.

2 participants