Skip to content

Conversation

@MaxBlack-dev
Copy link
Contributor

Fixes #8850

Summary

Added a color legend to the
pm outdated\ command output to help users understand the meaning of the color-coded package names.

Changes

  • Modified \lib/commands/outdated.js\ to add a legend explaining color meanings
  • Updated test snapshots to include the new legend in expected output

Legend Details

The legend appears at the bottom of the
pm outdated\ output when terminal colors are enabled:

  • Red = Updateable within your version range
  • Yellow = Update available but requires semver-major bump

The legend only displays when colors are enabled (\chalk.level !== 0), ensuring it doesn't appear in CI environments or when --no-color\ is used.

Testing

  • 58 out of 59 tests pass (1 pre-existing local environment test failure unrelated to changes)
  • All snapshots updated correctly
  • Legend correctly shows/hides based on color support

@MaxBlack-dev MaxBlack-dev requested a review from a team as a code owner December 19, 2025 02:36
@MaxBlack-dev MaxBlack-dev force-pushed the feat/8850-add-outdated-color-legend branch 2 times, most recently from b2d63cb to 3bd8569 Compare December 19, 2025 05:58
@MaxBlack-dev MaxBlack-dev force-pushed the feat/8850-add-outdated-color-legend branch from 3bd8569 to 0098bfe Compare December 19, 2025 06:00
@wraithgar
Copy link
Member

this.npm.color is what we use to discover if we are outputting in color.

How does this affect --parseable and --json? If folks are expecting to parse this output those lines are going to cause errors.

Does this need to be on every invocation? Is it enough to explain things in the help output?

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.

npm outdate should state the meaning of the colors in the command output

2 participants