Adding a Paclet to the Mathematica Paclet Server


This’ll be a short-and-sweet explanation of how to add a paclet to the Mathematica Paclet Server . The hope is that it shows how easy these things can be.

To showcase this I’ll add my Ems package that I showcased in my post Making a Blog in 30 Minutes . The first step is to install the interface paclet off the paclet server. To do this we’ll go to its page and copy the installation instructions given there:

PacletInstall[
  "PublicPacletServer",
  "Site"->
    "http://raw.githubusercontent.com/paclets/PacletServer/master"
  ]

(*Out:*)

post21-6722923238009970110

Now, we load this package

<<PublicPacletServer`

Then since Ems is already on my personal server I can just point the registration there:

PublicPacletServer["RegisterPaclet",
  <|
    "Name"->"Ems",
    "Author"->"b3m2a1 <b3m2a1@gmail.com>",
    "URL"->"http://www.wolframcloud.com/objects/b3m2a1.paclets/PacletServer",
    "Update"->"DownloadOnce"
    |>
  ]

(*Out:*)

post21-2385149726991367475

If I wanted it to download from GitHub, since I already have it on my GitHub instead I could also have just done:

PublicPacletServer["RegisterPaclet", "Ems"]

Which would have done the same.

Now we can look at the request that was made :

post21-4494400686262893646

And that’s basically all that needs to be done. At that point the ball is firmly in my court and so we’ll just go through what I do now to get the request fulfilled.

First I open up the IncludedPaclets.wl file that lists the paclets that are registered to download. Then I add an entry based odd the info provided:

post21-7329852412831181232

And then I open build.nb which handles all the builds of the server and find the line that says:

PublicPacletServerRebuild[];

And just run that. The server rebuilds, the paclets download, and in the end it pushes everything to GitHub. Simple as that.

Before rebuilding, though, we’ll have some actually do one more thing which is to submit a paclet update (as packages do, in fact, need updates!). For this to work, the paclet first had to have been registered, but after that all we need to do is make use of the "RequestPacletUpdate" method of the PublicPacletServer . I just recently decided to add some more object-oriented syntax for it, so we’ll make use of that to request the update that will get the new version of the paclet that supports that onto the server:

PublicPacletServer@"RequestPacletUpdate"["PublicPacletServer"]

(*Out:*)

post21-1211660871057209269

Looking at the old registration page we see that an update has been requested:

post21-8343592441183779473

And I handle this much like I handle all the others, except I go to the entry in the included paclets file and change the "DownloadNever" to a "DownloadOnce" :

post21-2905139062477497817

With that in place, I’ll go back to the build notebook and do a proper build:

post21-7732348920836887034

And a few seconds later the new content is on the paclet server

post21-5312486852621690036

Hopefully this was enough to give you the confidence to submit your own paclets too. And always feel free to open an issue or otherwise comment on the repo if there’s something you’d like further clarification on.