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

fix(outdated): add dependent location in long output #8110

Open
wants to merge 2 commits into
base: latest
Choose a base branch
from

Conversation

milaninfy
Copy link
Contributor

@milaninfy milaninfy commented Feb 14, 2025

Add dependent location details when using --long version of the output to identify who is the dependent of the outdated dependencies.
Fixes: #7736

Test output
image

Output of `npm outdated --json --long`
~/workarea/rep/outdated-test $ npm outdated --json --long
{
  "eslint": [
    {
      "current": "8.57.0",
      "wanted": "8.57.1",
      "latest": "9.21.0",
      "dependent": "a",
      "location": "/Users/milaninfy/workarea/rep/outdated-test/node_modules/eslint",
      "type": "devDependencies",
      "homepage": "https://eslint.org"
    },
    {
      "current": "8.57.0",
      "wanted": "8.57.1",
      "latest": "9.21.0",
      "dependent": "a",
      "location": "/Users/milaninfy/workarea/rep/outdated-test/node_modules/eslint",
      "type": "devDependencies",
      "homepage": "https://eslint.org"
    }
  ]
}
~/workarea/rep/outdated-test $ lnpm outdated --json --long
{
  "eslint": [
    {
      "current": "8.57.0",
      "wanted": "8.57.1",
      "latest": "9.21.0",
      "dependent": "a",
      "location": "/Users/milaninfy/workarea/rep/outdated-test/node_modules/eslint",
      "type": "devDependencies",
      "homepage": "https://eslint.org",
      "dependentLocation": "nest/a"
    },
    {
      "current": "8.57.0",
      "wanted": "8.57.1",
      "latest": "9.21.0",
      "dependent": "a",
      "location": "/Users/milaninfy/workarea/rep/outdated-test/node_modules/eslint",
      "type": "devDependencies",
      "homepage": "https://eslint.org",
      "dependentLocation": "a"
    }
  ]
}

@milaninfy milaninfy force-pushed the mm/outdated-include-dependent branch from 1a9409c to d0260b2 Compare February 27, 2025 18:54
@milaninfy milaninfy marked this pull request as ready for review February 28, 2025 14:29
@milaninfy milaninfy requested a review from a team as a code owner February 28, 2025 14:29
@wraithgar
Copy link
Member

I think "Dependent location" may not be the best phrasing, but don't know off the top of my head what we'd use instead. Dependent is usually the package that is required by another package, which is the opposite of what we want. "Depended by" is how we define it in the output already.

@wraithgar
Copy link
Member

We will also need to update https://docs.npmjs.com/cli/v11/commands/npm-outdated

@milaninfy
Copy link
Contributor Author

milaninfy commented Feb 28, 2025

Yeah... I completely missed that documentation part.. I am also rethinking whether in cli output it adds any value since we use package id format for DependedBy field which is much cleaner. Change might only makes sense in --json

@milaninfy milaninfy marked this pull request as draft February 28, 2025 15:19
@milaninfy milaninfy force-pushed the mm/outdated-include-dependent branch from d0260b2 to f759f47 Compare March 4, 2025 14:54
@milaninfy milaninfy marked this pull request as ready for review March 6, 2025 16:25
Co-authored-by: Gar <wraithgar@github.com>
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.

[BUG] npm outdated --json doesn't provide distinct workspace packages information
2 participants