This is how I publish a PureScript package in the post-Bower, pre-Registry era. It’s a bit involved and I often make mistakes, which are apparent in the series of version numbers on my Pursuit packages which increment the patch version several times on the same day.
But I think I’m finally getting the hang of it, and here are my notes about what I do.
First I have a shell.nix
which gives me a nix-shell
with these tools on the PATH
:
purs
spago
pulp
node
bower
Then I issue the following commands.
-
git clean -xdff
Delete
.pulp-cache
,.spago
,bower_components
,output
,node_modules
, et cetera, for a totally clean build. -
spago bump-version --no-dry-run major
We don’t really want to
spago bump-version
yet, what we want is forspago
to generate a newbower.json
for us, and this is the only way to get that, it seems? Commit the newbower.json
. If it turns out that we didn’t need a newbower.json
then this command may actually succeed, in which case it will create a new git tag, which we may have to delete. -
bower install
pulp
will need the bower dependencies installed. -
pulp build
If this command succeeds, then we know that the
pulp publish
command
later will succeed. -
spago test
One last time to be sure.
-
spago bump-version --no-dry-run major
For real this time.
-
git push origin main
Push the main branch to Github. Make sure it passes CI.
-
pulp publish --no-push
This will publish our package to Pursuit. No README will appear because we haven’t pushed the new version tag to Github yet, which is fine.
This command often fails the first time, but run it again and it will always succeed, in my experience.
This is our last chance to change anything before we tag. Force-pushing main is less tacky than deleting a tag.
-
git push
the new tag.Now the README will appear on Pursuit.
Don’t forget to update package-sets. package-sets/CONTRIBUTING.md at master · purescript/package-sets · GitHub
Most of this advice is only applicable in the year 2021 and will be obsolete after the whole Bower and Registry situation is sorted out.
Probably other people have better publishing methods, and I would very much like to hear about them in this thread.