-
Notifications
You must be signed in to change notification settings - Fork 239
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
RFC: Deprecated packages UX revamp #516
Conversation
What I'm concerned about here is, if someone is using my package X, and X happens to be using deprecated packages, the current behavior is that users will see X's transitive deprecations. However, it's not actionable for them, and to be frank it's none of their concern - it's only a concern for X's developers (me). It'd be great to by-default only show direct deprecations. |
note: add ability to opt out of the notification at the end of the install, similar to |
Action item from RFC meeting: let's reduce the scope here and avoid any ideas that augments the current commands initially proposed. Should focus only on the post-install notification and a command to provide the overview of current deprecation notices. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To summarize my understanding and confirm:
npm deprecations <...specifiers>
prints out each specifier that's deprecated, with its messagenpm deprecations
prints out direct deps that are deprecated, with its messagenpm deprecations --all
prints out direct and transitive deps that are deprecated, with its messagenpm deprecations --only=foo
filters like--only=foo
would do on any other npm command that supports "only"npm install
output now only contains a single line regarding deprecations, that summarizes direct vs transitive, and points the user towards thenpm deprecations
command
d9463ab
to
a4a45ea
Compare
Cleaned up and landed with all the points raised by @ljharb and @darcyclarke, thank you so much 🥳 |
Deprecated packages UX revamp
Summary
Add a new notification interface at the end of every
install
informing the user of how much packages are deprecated in their current installed tree, in replacement of warning messages printed to standard output during the install.Motivation
There are two main motivations for this change:
npm install
and this would be the final act to convert what used to be hundreds of lines printed in users interface during install into the notification system provided at the end that let users aware of audit issues, funding and now deprecations.Detailed Explanation
During
npm install
arborist should no longer print warnings lines for each package that is marked as deprecated and it should instead queue them up and provide metrics that can be printed at the end of the install, similar to how it works with audit today.A new command can be introduced to properly display the current deprecations.
Alternatives
Implementation
Install changes:
lib/audit-report.js
lib/utils/reify-output.js
in order to make sure we retrieve that info from arborist and properly display the deprecated packages notification.Install example:
Overview of all deprecated packages after an install
Creates a new
deprecations
subcommand in the cli.For the next few examples, assume an install such as:
$ npm ls project@1.0.0 $HOME/work/project ├── foo@0.4.0 ├─┬ lorem@0.4.0 │ └── ipsum@2.0.0 deprecated ├─┬ abbrev@3.0.9 │ └── bar@2.88.0 deprecated └── once@1.4.0 deprecated
1. Prints deprecated notices for direct dependencies in the current install, e.g:
2. Prints deprecated notices for all deprecated packages in the current install, e.g:
3. Print deprecation notices for a given package from the current install when using package name only, e.g:
3.1. Support different output types:
3.2. Support multiple positional arguments:
4. Support reaching to the registry when using qualified spec as positional argument, e.g:
5. Support other common arborist options, e.g:
Prior Art
npm install
will print a single warning line during install for each deprecated package found, e.g: