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

NPM Notification #6

Closed
mikaelbr opened this issue Oct 13, 2016 · 10 comments
Closed

NPM Notification #6

mikaelbr opened this issue Oct 13, 2016 · 10 comments
Labels
Beginner Simple projects that can be done by people relatively new to programming. Joined This project has someone working on it. Little work This project takes little time to complete. (ETA couple of days)

Comments

@mikaelbr
Copy link
Collaborator

mikaelbr commented Oct 13, 2016

Project description

Just an idea I had earlier. A way to subscribe to push notifications on your computer when a major change occurs in a project you follow. I was thinking specifically on NPM packages. Let's say I use lodash or a test framework such as mocha or Jest. When a major change of that is updated I'd like to know that. So what better then to get a native notification on my computer the exact moment it updates?

You could have a CLI similar to:

# Add new package to listen to
npmn add lodash

# Remove package
npmn remove lodash

# Add several at once
npmn add mocha jest

# Show all packages we're listening to
npmn list
> mocha (current @3.1.2)
> jest (current @16.0.1)

# Listen for minor changes also
npmn add --minor lodash

This can use things like the NPM hooks in combination with node-notifier. This is not quite the same as https://gemnasium.com/ although it share some traits.

Relevant Technology

JavaScript, NPM, Node.js, CLI design, NPM Hooks

Who is this for

Anyone who is interested in digging more into NPM and want to test out how to design good CLI tools. Don't think this is too much work in terms of days of development.

@mikaelbr mikaelbr added Little work This project takes little time to complete. (ETA couple of days) First Contribute labels Oct 13, 2016
@phun-ky
Copy link

phun-ky commented Oct 13, 2016

Have you tried https://doppins.com/ ? It does what you want, sort of. I understand from your spec that you want something smaller. https://gemnasium.com/ is something else, not that obtrusive, but works.

@mikaelbr
Copy link
Collaborator Author

mikaelbr commented Oct 13, 2016

Thanks for the update! Yeah, I've seen both greenkeeper.io and doppins.com. But that's not really the same problem as this though. This is more for a person to keep updated on package/module progress, and not as much for a project to get updated to the latest version. You can call this "bigger picture stuff" in a sense.

A scenario I can envision: I get an update that Jest has a new major version released. I know this means an API breakage, so I can see the changelog and see what's changed. If there are any new features I really want I know I can update in some projects.

So it's more an immediate notification when something major happens. If that makes sense?

@mikaelbr mikaelbr added the Beginner Simple projects that can be done by people relatively new to programming. label Oct 14, 2016
@brankol
Copy link

brankol commented Oct 18, 2016

I'd be interested to work on this but I'm not sure how to go about it.
You mentioned npm hooks as a way of subscribing to changes but unless I'm missing something, there are a couple of issues there:

  1. npm hooks are only available to paid users
  2. there is a limit of 100 hooks per user account which might or might not be an issue depending on how many projects a user would like to track
  3. you need to give a callback URI when setting up a hook and given that most people are behind dynamic IPs, one would need a dynamic dns just for this
  4. if this is implemented as a hosted service, there would be a problem of running a long lived process on your computer which would listen for updates and trigger a notification

@mikaelbr
Copy link
Collaborator Author

Great! I haven't dived any deep into the new hooks API, so this might not even be possible using that. I thought that hooks would be for paid users only as a beta, but maybe I figured wrong.

If hooks aren't the way to go, maybe you could investigate doing some polling with caching. Have to confer with the licensing for NPM here, but doing something like npm show <package-name> version periodically (not too often) could be a fallback.

@mikaelbr mikaelbr added the Joined This project has someone working on it. label Oct 18, 2016
@bsonntag
Copy link

I've been playing around with this idea by following this guide: https://github.com/npm/registry-follower-tutorial

I have two working examples, one using node-notifier and another using Electron. I'll share the code soon.

@bsonntag
Copy link

As promised, here's the code: https://github.com/bsonntag/npm-notifier

@mikaelbr
Copy link
Collaborator Author

Cool! I get that it's probably still for experimenting and good idea to make an electron app from it. Didn't think of that 👍 I would suggest (and you are probably thinking this already) to split up the different user interfaces (electron and CLI) to two different packages both using a library for getting the data. Users interested in the CLI shouldn't have to install electron etc. But as I said, you are probably thinking this already.

@Haroenv
Copy link

Haroenv commented Nov 1, 2016

https://twitter.com/holman/status/793561589290979328 Libraries.io might have a similar feature now

@styfle
Copy link

styfle commented Aug 8, 2018

A scenario I can envision: I get an update that Jest has a new major version released. I know this means an API breakage, so I can see the changelog and see what's changed.

For anyone else running into this problem, I have been using https://dependabot.com and it works great for notifying any changes to a package.

Any time a new version is released, it creates a PR with the following:

  • Release notes from github
  • CHANGELOG.md (since previous release)
  • Commits (since previous release)
  • Compatibility (how many others updated from previous version and tests still pass)

See an example here: styfle/packagephobia#94

@FredrikAugust
Copy link
Collaborator

Closing as it is fixed by @bsonntag, and any further discussion should be moved there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Beginner Simple projects that can be done by people relatively new to programming. Joined This project has someone working on it. Little work This project takes little time to complete. (ETA couple of days)
Projects
None yet
Development

No branches or pull requests

7 participants