sindresorhus / project-ideas

Need a JavaScript module or looking for ideas? Welcome ✨
544 stars 9 forks source link

update-daemon #5

Open dylang opened 9 years ago

dylang commented 9 years ago

Take the logic of https://github.com/yeoman/update-notifier and just do the update behind the scenes.

Only meant for packages installed globally.

Options are to do the update when the program runs or auto-update as a background task so your globals are always up-to-date.

sindresorhus commented 9 years ago

Would you prefer a system daemon that runs once in a while and does it for all global packages or a module that is included as dependency of CLI apps and only does it for that app. Maybe both?

dylang commented 9 years ago

Great question @sindresorhus. Maybe both, but included as a dependency seems to me more likely it would be used, since it would just be automatic.

What do you think?

sindresorhus commented 9 years ago

Yeah, I like it. I would probably use the system daemon thing, but I imagine having it as a dependency could be useful for many CLIs.

Though I must note that it's going to get a lot of resistance. I actually implemented auto-update early on with Yeoman, but had to back down and make update-notifier instead as so many people were against auto-update.

icyflame commented 9 years ago

@sindresorhus Would it be something like apm update?

apm update is awesome, as it lets you see the updates available for all installed packages, and if required, update just some of them. It is especially helpful when there are a lot of packages to update.

forivall commented 9 years ago

As long as it's not as slow as apm update. Maybe, like apm update, but daemonize for the actual update process, and then a separate subcommand or another update should then show the update status.

dylang commented 9 years ago

Maybe showing a list of changes would make people more calm about auto-updating.

I have a package called changelog that guestimates changes based on git commits, but I haven't given it much attention in the last year or so:

screen shot 2015-09-23 at 10 40 18 am

dylang commented 9 years ago

Another option is to assume everything always auto-updates, but let users change this setting on a per-package basis with something like:

$ update ask trash
$ update auto trash
$ update never trash

And override all with something like

$ update ask *
$ update auto *
$ update never *

List the config

$ update ls
├── trash auto 2.0.0
├── npm never 2.5.15 -> 3.3.3
└── gulp ask 1.3.5 -> 1.3.6

configstore is a great package for storing settings like this.

Usability note: This adds more user-facing configuration, which can lead to more confusion and problems.