How do I nicely shut down a package?


#1

I wrote a package a while ago (mainly to see how to write packages, but also because I REALLY missed that functionality).

The code I wrote has now been ported (with my blessing) in to a more core/common package, so I’m happy to shut mine down.

However, I am unaware of any nice way of doing this? I can just delete the github repository, but I don’t know if there’s a way of posting a message in to people’s Atom to say that there’s no need to install the package any more (it’s part of bracket-matcher). It would be even nicer if it could auto-remove ruby-string-interpolation if they have the correct version of bracket-matcher installed…


#2

I don’t think there’s any feature to automatically remotely remove a package installed by a user (and I wouldn’t seeing one).

Maybe you can publish a last version that remove all functionalities and instead display a notice to the user that this package is now obsolete, should be removed and that you’ll unpublish it at some fixed point in the future. You can also test for the bracket-matcher version in the activate method, display that notice and deactivate your package immediately.


#3

I don’t suppose you have an example that comes to mind of a package that has done this (nice notice rather than just Javascript alert(), automatic deactivate if another package with a specific version or above is installed?).


#4

For the deactivation I do the following:

As I understand how a package activate, there’s no way to prevent the activation so that the package appears deactivated in the settings view:

https://github.com/atom/atom/blob/master/src/package.coffee#L129-L139

As for the notice, a simple div with an overlay from-top class should do the trick, you should either add a timeout to hide the overlay or add a button to close it (or both). Using the appropriate style (a warning icon for instance) it should be enough.


#5

You should be able to call atom.packages.disablePackage to disable it - and it seems to work, but the settings panel does not get updated automatically if it’s open when you call it.