Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattt/swift-registry
A reference implementation of the Swift Package Registry, written in Swift and using Git as a database / transparent log.
https://github.com/mattt/swift-registry
Last synced: about 1 month ago
JSON representation
A reference implementation of the Swift Package Registry, written in Swift and using Git as a database / transparent log.
- Host: GitHub
- URL: https://github.com/mattt/swift-registry
- Owner: mattt
- Archived: true
- Created: 2020-09-16T20:42:56.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-02-22T18:14:41.000Z (over 3 years ago)
- Last Synced: 2024-04-04T17:33:27.297Z (6 months ago)
- Language: Swift
- Size: 97.7 KB
- Stars: 37
- Watchers: 4
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Swift Package Registry - Reference Implementation
This is a reference implementation for a package registry service,
as described in [this proposal](https://github.com/apple/swift-evolution/pull/1179).## Requirements
- macOS 10.14+
- Swift 5.2+ (_install the latest version of Xcode_)
- [Homebrew](https://brew.sh)
- Docker* (_optional_)## Setup
Install the required system dependencies by running the following command:
```terminal
$ brew bundle
```## Usage
A command-line interface is provided in addition to the web server
for more convenient testing and debugging.### Server
Run the following command to spin up a package registry locally.
```terminal
$ swift run registry serve --index path/to/index
```A registry index (that is, a Git repository used as a database)
will be created at the specified path if one doesn't already exist there.You can interact with the registry using `curl` or your REST client of choice.
```terminal
$ curl -H "Accept: application/vnd.swift.registry.v1+json" \
"http://localhost:8080/@Alamofire/Alamofire"
```### Command Line Interface
```terminal
$ swift run registry --help
USAGE: registry-commandOPTIONS:
--version Show the version.
-h, --help Show help information.SUBCOMMANDS:
init Initializes a new registry at the specified path.
publish Creates a new release of a package.
serve Runs the registry web service locally.See 'registry-command help ' for detailed help.
$ swift run registry init --index path/to/index
$ swift run registry publish @Jounce/Surge 2.3.0 --index path/to/index
$ swift run registry publish @Flight-School/Money 1.2.0 --index path/to/index
$ swift run registry list --index path/to/index
@flight-school/Money - 1.2.0
@jounce/Surge - 2.3.0
```