Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add ability to send announcements during package install #4184

Closed
tomlane opened this Issue · 17 comments

7 participants

@tomlane

Following a brief discussion on the Yeoman repo the idea was raised of the ability to add messages (announcements) to NPM.

These could contain information such as a request for a maintainer to take ownership of an unmaintained package or similar.

@tomlane tomlane referenced this issue in yeoman/yeoman
Closed

Using NPM to send announcement #1226

@sindresorhus

Could also include note about important breaking changes.

@rlidwka

what's wrong with existing deprecation notice?

@sindresorhus

@rlidwka this is not about deprecation, it's about being able to show some info to the user.

@rlidwka

Only thing npm deprecate does is showing some info to the user. So, what's the difference?

@sindresorhus

@rlidwka it shows DEPRECATED. This is about showing a MESSAGE.

@Zearin

:+1: Agreed!

@rlidwka

it shows DEPRECATED. This is about showing a MESSAGE.

Deprecation notice is a message, is it not?

@Zearin
// example for illustration purposes only
deprecation instanceof message
> true
message instanceof deprecation
> false

@rlidwka: Deprecation is a specific type of message. ☺

@rlidwka

@Zearin: Both messages can be shown in npmjs.org and during installation at the warn log level. So what is the suggested difference in npm behaviour?

If there's none, well fine just rename "deprecate" to "notice" or something and get it over with.

@Zearin

A deprecation should be a warn log level.

This Pull Request is asking for a generic message that should probably use a notice (or equivalent) log level.

This is exactly what different log levels are for.


…and get it over with.

What’s the rush? Are you bothered by the discussion?

@rlidwka

This Pull Request is asking for a generic message that should probably use a notice (or equivalent) log level.

Do you suggest to add another log level, or use existing one? If you suggest to use existing one, which one (trace/debug/info/http/warn/error/fatal) are you think about? If you suggest to add another log level, where it should be in the following list?

@Zearin

I’m not familiar with the code, but it seems to me that the info loglevel is the best fit.

@tomlane , @sindresorhus ? What are your thoughts?

@rlidwka

I’m not familiar with the code, but it seems to me that the info loglevel is the best fit.

By default npm displays http level messages and above. info is not displayed. As a package user I would want to read all announcements (otherwise what's the point if it is not displayed by default).

It certainly is not http level, so best fit would be warn. For example, missing README will cause warn-level message to occur.

But wait, warn is the exact loglevel deprecation notice is using now. So what's the difference? :-)

@Zearin

By default npm displays http level messages and above. info is not displayed. As a package user I would want to read all announcements (otherwise what's the point if it is not displayed by default).

It certainly is not http level, so best fit would be warn. For example, missing README will cause warn-level message to occur.

But wait, warn is the exact loglevel deprecation notice is using now. So what's the difference? :-)

TL;DR: Gotcha! warn it is. Go for it. :)


Ahh, now I see where you’re coming from!

You conceive of loglevels as nothing more than an ordered set of numbers, which just happen to be mapped to names like warn or info. So to you, the name itself is secondary; what is really important is number it maps to.

I come from a very different background, where name semantics are the most important thing, and elsewhere in code you can remap those names to whatever you want.

I love learning more about CLI applications, about Node.js, and about package management. But it’s a very different world from what I’m used to. I still have a lot to assimilate…

Thanks for the education! :)

@rlidwka

So to you, the name itself is secondary; what is really important is number it maps to. I come from a very different background, where name semantics are the most important thing, and elsewhere in code you can remap those names to whatever you want.

You can't remap those names. Their meaning and their order of importance are precisely defined, so user can limit logger to show only important messages.

It's kinda standard (see bunyan readme). And though npm doesn't follow bunyan spec exactly, ordering is the same.

@danielchatfield

To get back to the point, either renaming deprecate to notice or similar or adding a new warn level message would satisfy this request, it could be quite useful.

@othiym23 othiym23 changed the title from [Request] Add ability to send announcements during package install to Add ability to send announcements during package install
@othiym23
Owner

The functionality is in npm 2, but we haven't really figured out what to do with it on the registry side; this may be something that is made greater use of in the next public registry setup.

@othiym23 othiym23 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.