Last week I documented my bmark tool. Recall the to-do list from the last post:
TODO List
-
Clean up the code -
Configurable number of runs -
Use builtin Elixir server module for Bmark.Server? -
Look at the ExActor implementation to see how to implement `bmark :name, runs: 5 do` -
Add documentation -
Add a readme -
Add a contributing guide -
Add a license - Create a hex package
- Add installation instructions to readme.
- Test
- Release
In this post I’ll describe the end of the project and release. This post is earlier and shorter than usual. The Hex.pm team has made the publishing process so easy that there was less for me to do and write about than I expected. Thanks to the Hex.pm team for such an easy and wonderful process.
Create a Hex Package
I just followed the instructions.
Register with Hex.pm
I ran
$ mix hex.user register
and filled in my data.
Fill in mix.exs
I set the version to 1.0.0 and filled in a few other details.
I also had to fill in the package information.
-
Create a hex package
Test
Well, Travis CI does most of the testing for me. I just needed to install the package itself on a clean system. But, it didn’t look like I could test a package before release; I had to skip ahead.
I did want a simple test app to use Bmark as a Hex package and I wanted it to be ready for testing after publishing. This test was simple enough to write. I just created a brand new mix app with
$ mix new bmark_test
and then updated mix.exs with the bmark dependency:
def deps do
[ {:bmark, "~> 1.0.0"} ]
end
While I was at it, I added the same to the README.
-
Add installation instructions to readme.
Publish
I simply had to run
$ mix hex.publish
Test
After publishing, I had one hour in which to test and revert the publication if necessary. I had to test it quickly. I did this on a clean Linux VM to avoid any existing bmark intallations in my normal development environment. The test passes.
-
Test
Documentation
Hex reminds me to upload documentation with
$ mix hex.docs
It would have been nice if this was in the instructions but I gave it a try.
** (Mix) The task docs could not be found
Well, since I spent so much time last week getting the documentation put together I should figure out how to get this working.
I can use ex_doc to generate the documentation. I just need to install the depdendencies:
defp deps do
[
{:inch_ex, only: :docs},
{:earmark, "~> 0.1", only: :dev},
{:ex_doc, "~> 0.7", only: :dev}
]
end
Running mix doc turns up a couple of formatting issues which are easy enough to fix. But that means I should bump up the bmark version number to 1.0.1. I updated, published again, and then published the docs.
-
Release
And of course, I get a new badge:
Conclusion
The initial release is done. There are still more features I have in mind for Bmark but, for now I will wait on them. A better strategy is to wait for users to let me know what features they need or at the very least use Bmark in another project and see what other features I need. So, for now the to-do list is complete:
TODO List
-
Clean up the code -
Configurable number of runs -
Use builtin Elixir server module for Bmark.Server? -
Look at the ExActor implementation to see how to implement `bmark :name, runs: 5 do` -
Add documentation -
Add a readme -
Add a contributing guide -
Add a license -
Create a hex package -
Add installation instructions to readme. -
Test -
Release
Next week’s post will be on a new topic.
If there are topics you’d like to see in the future on Learning Elixir then leave me a note in the comments.