npm / npme-installer

npm Enterprise installer
https://www.npmjs.com/enterprise
Other
35 stars 21 forks source link

feat: check for newer npme version via update-notifier #131

Closed nexdrew closed 8 years ago

nexdrew commented 8 years ago

A lot of changes due to refactoring commands into modules. Although the number of files has increased, I think the code duplication has been significantly reduced and command isolation should make for easier testing. With the refactor, I have cleaned up the CLI help text and expectations based on wrapped CLIs.

The new feature added is automatic checks for newer npme versions via update-notifier. This is gonna help keep the bin up-to-date for folks launching our AMI, so we can continue to build more integration features into npme and notify people of updates in a separate distribution channel from appliance releases (which are independent of this bin).

The way that update-notifier works is it checks for an update once a day via spawned process when the bin is run. When an update is found, it is stored in ~/.config/configstore/update-notifier-npme.json, and the next time the bin is run, the user will be notified of an available update, which looks like this:

screen shot 2016-04-27 at 12 04 41 pm

So I think it takes at least 2 runs of the bin to get the notification, once for the initial check and a subsequent run to notify the user.

To fake it for testing, you can modify the version in package.json, modify the timestamp in ~/.config/configstore/update-notifier-npme.json, and then run the bin a couple times.

A lot of projects use it, so I assume it works well enough for us.

Also took the chance to update other dependencies as well.

bcoe commented 8 years ago

@nexdrew this is wonderful; I really like the addition of update-notifier.

Assuming you've tested this a bit on an npm Enterprise instance (just publish to a @next tag), I say ship.

nexdrew commented 8 years ago

@bcoe I will go ahead and merge this, publish to next tag, test it in a real instance, then promote latest if everything looks good.