# The best registries for your Swift Package

As a Swift developer, you want people to discover your Swift Packages quickly. It is understandable if you struggle to find an answer for the how. The Swift Package Manager is a beautiful tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies. But at the end of the day, it is *just* a package manager.

There is no de-facto standard for a package registry related to Swift packages. Private and community projects are trying to fill the void for easier searching and discoverability of Swift Packages.

This blog post will
- give you an overview of the three most popular registries for Swift Packages out there (*as of December 2021*)
- compare their feature set and
- provide recommendations for package authors and users which one to use

The three most popular registries ordered based on the time I discovered them over time are

1. Swift Package Registry
2. Swift Package Index
3. Swiftpack

## Swift Package Registry

> Since the GitHub Swift Package Registry is not currently released and the IBM Swift Package Catalog is has been killed, the Swift Package Registry fills the current gap for easier searching and discoverability of Swift Packages.

![Start site of Swift Package Registry](https://cdn.hashnode.com/res/hashnode/image/upload/v1640800353836/B1nKvyBox.png)

You can access the Swift Package Registry via [swiftpackageregistry.com](https://www.swiftpackageregistry.com).

Here is an example of package information shown by this registry.

![Alamofire package shown on Swift Package Registry](https://cdn.hashnode.com/res/hashnode/image/upload/v1640800367062/PROfekXCf.png)

The project is [open-source](https://github.com/twodayslate/swift-package-registry)  and this GitHub App is a Node.js application built with Probot. It parses all Swift packages using Docker.

![Swift Package Registry is open-source](https://cdn.hashnode.com/res/hashnode/image/upload/v1640800752830/aB_VQlQdm.png)

It is easy to add a package to the registry.

![Adding a package to Swift Package Registry](https://cdn.hashnode.com/res/hashnode/image/upload/v1640800377366/pOOl0egeo.png)

My personal opinion: this registry was the first to add my Swift Packages. I was impressed by the GitHub integration through its GitHub app. The project has my deep most respect ✊ but the features are lacking compared to the other registries.

## Swift Package Index

> The Swift Package Index helps you make better decisions about the dependencies you use in your apps.

![Start site of Swift Package Index](https://cdn.hashnode.com/res/hashnode/image/upload/v1640800249437/9Y8Ia_l8I.png)

You can access the Swift Package Index via [swiftpackageindex.com]( https://swiftpackageindex.com/).

Here is an example of package information shown by this registry.

![Alamofire package shown on Swift Package Index](https://cdn.hashnode.com/res/hashnode/image/upload/v1640800409854/T_vx4jegD.png)

The project is [open-source](https://github.com/SwiftPackageIndex/SwiftPackageIndex-Server) and written in Swift using Vapor.

![Swift Package Index is open-source](https://cdn.hashnode.com/res/hashnode/image/upload/v1640800822736/CmA3CFyxC.png)

Basic Git / GitHub experience is needed to add a package to the registry.

![Adding a package to Swift Package Index](https://cdn.hashnode.com/res/hashnode/image/upload/v1640800432811/_0WE2bB0I.png)

Notable features are

- advanced search capabilities 
  ![Advanced Search Capabilities](https://cdn.hashnode.com/res/hashnode/image/upload/v1640800855748/tiixxUCBXg.png)
- automatically creates a Package Collection
  ![Package Collection Support](https://cdn.hashnode.com/res/hashnode/image/upload/v1640800418437/VgqC-an83.png)
- the ability to generate playground files with the dependency already inserted, ready to open with Xcode.
  ![spi_playground.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1640801867316/ElmLQ-X6T.png)
- Publishing package updates through a [Twitter account](https://twitter.com/SwiftPkgUpdates) 
  ![sp_updatesviatwitter.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1640801875544/tuFch7W6v.png)

My personal opinion: this registry seems to be the most active one and therefore it is no surprise it has the most features. 🌟🌟🌟

## Swiftpack

> We do our best to crawl github for new packages

![Start site of Swiftpack](https://cdn.hashnode.com/res/hashnode/image/upload/v1640800336386/X_99fD39O.png)

You can access Swiftpack via [swiftpack.co](https://swiftpack.co/).

Here is an example of package information shown by this registry.

![Alamofire package shown on Swift Pack](https://cdn.hashnode.com/res/hashnode/image/upload/v1640800297484/1zirpnDc0.png)

The project is closed-code.

This registry lists the most packages as it automatically crawls GitHub for new packages.

You can also register a package manually.

![Adding a package to Swift Pack](https://cdn.hashnode.com/res/hashnode/image/upload/v1640800323609/vAppP61ER.png)

You can easily search/find all packages for an author, but Package Collections are not supported.

![Packages listed by authors on Swift Pack](https://cdn.hashnode.com/res/hashnode/image/upload/v1640800648902/ZbTGie8Ou.png)

Swiftpack also publishes package updates through a  [Twitter account](https://twitter.com/swiftpackco) 

My personal opinion: this registry appears to be maintained by a single person. Therefore it is especially incredible that this registry has the unique feature of automatically crawling and adding a Swift Package to the registry 👍👍👍 
It is questionable if this registry can catch up with the feature richness of the Swift Package Index, considering it is a single-person project with no outside contributions.

# Comparison

| Criteria                      | [swiftpackageregistry.com](https://www.swiftpackageregistry.com) | [swiftpackageindex.com]( https://swiftpackageindex.com/) | [swiftpack.co](https://swiftpack.co/) |
| ----------------------------- | ------------------- | ---------------------- | ---------- |
| Number of Packages            | ~ 5 k                |      ~ 4k             | ~ 11.5k    |
| Shows Popular Packages        | ✅                 | ✅                    | ✅        |
| Shows Recently Added Packages | ✅                 | ✅                    | ❌         |
| Shows Recent Releases         | ✅                 | ✅                     | ✅          |
| Shows Related Packages        | ❌                  | ❌                     | ✅        |
| Compatibility Report          | ❌                 | ✅                     | ❌         |
| Playground Support            | ❌                 | ✅                     | ❌       |
| Advanced filter search        | ❌                 | ✅                     | ❌         |
| Registry API Support          | ❌                  | ❌                     | ✅        |
| Twitter updates for packages              | ❌                 | ✅                     | ✅         |
| Search by author | ✅                   | ✅                      | ✅          |
| Support of Package Collection | ❌                   | ✅                      | ❌          |
| Is Open-Source project        | ✅                 | ✅                    | ❌         |
| Easiness to add a new package | A-                  |     B-             | A          |

# Recommendation

As package author I recommend to make sure that your package is added in all of those registries.

As package consumer I primarily use **Swift Package Index** due to its feature richness.
