In a previous post about including a changelog in your repo, me and many others tried to argue how good it is for your users to have a changelog available to them.
This post is about yet another improvement of user experience: displaying a small message when updating a major version.
By “definition”, updating a major number almost certainly comes with very big changes. However, it is not always the case that a user will check every updated version one by one. What you can do instead, is display an update message when the user is
using YourPackage for the first time. This message will be displayed only once, and now I will show you how to do it.
- In your gitignore add
- At the end of
YourPackage.jlfile, add a section like:
if !isfile(joinpath(@__DIR__, "update_v2.0.0")) printstyled(stdout, """ \nUpdate message: DynamicalBilliards v2.0 This is the update message of my package.\n """; color = :light_magenta) touch(joinpath(@__DIR__, "update_v2.0.0")) end
- At major updates, or noteworthy minor updates, change the
"update_v..."and the update text appropriately.
This approach does not depend on any “building” or “precompilation” process. It happens at
I suggest the following conventions for update messages:
- Start the update string with
\nUpdate message: YourPackage version.
- Use the color
:ligh_magenta: I think it is one of the least used at the moment, which would allow it to be established as “the update color standard”. I think it can be debated whether we want all the update string to be in magenta, or only the header (“update message…”). I don’t really know, go ahead and express your opinions!
\nafter your update message.
And that’s it. I hope this will be helpful for people like me that always wanted to display update messages in crucial releases!
This is how it looks when I first use my package:
This is how it looks the second time: