Skip to content

Instantly share code, notes, and snippets.

@mattt
Created December 23, 2020 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattt/803d52550800f8dbd2aeb8ef219953fe to your computer and use it in GitHub Desktop.
Save mattt/803d52550800f8dbd2aeb8ef219953fe to your computer and use it in GitHub Desktop.

Swift Package Discover Subcommand

A tool for understanding how an external package dependency is resolved with Swift Package Manager.

Alternative spellings:

  • $ swift package info
  • $ swift package dependency info

Usage

$ swift package discover github.com/mona/LinkedList
1 GET request to https://github.com/mona/LinkedList 
    - Redirected to https://swift.pkg.github.com/github.com/mona/LinkedList (20ms)
2 GET request to https://swift.pkg.github.com/github.com/mona/LinkedList 
    - Received list of available versions through package registry interface (100ms, 10kB)
    - Available versions: 1.0.0, 1.0.1, 1.1.0

$ swift package discover github.com/mona/LinkedList.git
1 GET request to https://github.com/mona/LinkedList.git 
    - Received Git repository payload (1.2s, 1MB)
    - Available versions: 1.0.0, 1.0.1, 1.1.0

Features

  • Check if a dependency can be resolved at a given URL
  • Determine how a dependency is resolved (repository or registry)
  • Get a list of available releases
  • Trace the requests and redirects
  • Get timings and payload sizes for network requests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment