Skip to content

Add -orphans Flag to the list Command #1099

@AshokThangavel

Description

@AshokThangavel

When a primary module is uninstalled without -r, its dependencies are often left behind in the namespace. Currently, IPM/ZPM has no way to distinguish between a module you wanted (Direct Install) and a module you needed (Dependency). Consequently, these leftover dependencies appear as "root" modules in a standard list, creating a cluttered environment where it is impossible to tell which packages are safe to remove and which are still serving a purpose.

Proposed Solution

Introduce an -orphans flag (with the alias -u for unused) to the list command to identify unreferenced, non-primary modules.

  1. New Flag: list -orphans (Alias: list -u).
  2. Detection Criteria: The command identifies modules that meet two conditions:
  • Implicitly Installed: The module was originally brought in as a dependency, not via a direct user install command.
  • Unreferenced: No other currently installed module in the namespace lists this package as a dependency.
  1. Display: The command output will specifically list these "leftover" modules, allowing the user to see exactly what is no longer required by the system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions