Skip to content

Translation 🌍

You can translate or improve the translation of this page.

Contribute

Registry

As the number of dependencies grows, so does the time to resolve them. While other package managers like CocoaPods or npm are centralized, Swift Package Manager is not. Because of that, SwiftPM needs to resolve dependencies by doing a deep clone of each repository, which can be time-consuming. To address this, Tuist provides an implementation of the Package Registry, so you can download only the commit you actually need. The packages in the registry are based on the Swift Package Index – if you can find a package there, the package is also available in the Tuist Registry. Additionally, the packages are distributed across the globe using an edge storage for minimum latency when resolving them.

Usage

To set up and login to the registry, cd into your project's directory and run:

bash
tuist registry setup # Creates a `registries.json` file with the default registry configuration.
tuist registry login # Logs you into the registry.

Now you can access the registry! To resolve dependencies from the registry instead of from source control, continue reading based on your project setup:

To set up the registry on the CI, follow this guide: Continuous integration.

Package registry identifiers

If you want to ensure that the registry is used every time you resolve dependencies, you will need to update dependencies in your Package.swift file to use the registry identifier instead of a URL. The registry identifier is always in the form of {organization}.{repository}. For example, to use the registry for the swift-composable-architecture package, do the following:

NOTE

The identifier can't contain more than one dot. If the repository name contains a dot, it's replaced with an underscore. For example, the https://github.com/groue/GRDB.swift package would have the registry identifier groue.GRDB_swift.

Released under the MIT License.