Publishing a package
A package on the registry is a GitHub repository, or a directory in one. Releases of the repository are the versions of the package.
Sign in
Sign in with GitHub. The registry only asks for your public profile.
Describe your dependencies
Add a
spice.tomlmanifest to the root of your repository, for example withspice-shaker init. It is optional, but needed for the dependency tree:[package] name = "my-package" version = "1.0.0" [dependencies] json-parser = "^1.2.0" http-client = { version = ">=2.0.0, <3.0.0" } [dev-dependencies] test-kit = "*"The registry lists the registry dependencies of
[dependencies]and[dev-dependencies]. GitHub and path dependencies ({ github = "owner/repo" },{ path = "../lib" }) are not shown.Tag a release
Create a GitHub release whose tag is a semantic version, for example
v1.0.0. The release notes become the changelog. Tags that are not semantic versions are ignored.Create the package
Open the dashboard, pick your repository and choose a name and a few tags. You need push access to the repository.
Keep it in sync
The registry re-reads README, releases and dependencies regularly. After a release you can also hit Sync now on the package management page.
Several packages in one repository
A repository can hold several packages, each in its own directory with its own spice.toml and README, for example packages/github. Enter that directory when you create the package (or paste the link of the directory on GitHub as repository).
The releases of the repository are shared, so the tag of a release names the package's directory, followed by -, / or @ and the version: github-v1.0.0, github/v1.0.0, github@1.0.0 or, with the full path, packages/github/v1.0.0. Each package only sees its own releases. The description comes from the description in the [package] table of the manifest instead of the repository.
Version constraints
| Constraint | Matches |
|---|---|
1.2.3 | exactly 1.2.3 |
^1.2.3 | 1.2.3 up to, but excluding 2.0.0 |
~1.2.3 | 1.2.3 up to, but excluding 1.3.0 |
1.2.x | any 1.2 release |
>=1.0.0, <2.0.0 | a range |
* | any version |
Using the registry API
Everything on this site is available as JSON, for tools that want to resolve and fetch packages:
GET /api/v1/packages?q=json&tag=parser&sort=downloadsGET /api/v1/packages/{name}GET /api/v1/packages/{name}/versions/{version}(uselatestfor the newest release)GET /api/v1/packages/{name}/versions/{version}/downloadcounts the download and redirects to the archive
The archive is the whole repository at the release tag. For a package in a directory, path in the package metadata says where it is inside the archive.