Skip to content
This repository was archived by the owner on Mar 23, 2021. It is now read-only.

endocrimes/swiftpm-dependency-fetcher

Repository files navigation

swiftpm-dependency-fetcher

Dependencies of your SwiftPM packages as a service.

Runs on http://swift-dependency-fetcher.endocrimes.com.

Frontend

You can take a peek at a package's dependencies by going to http://swift-dependency-fetcher.endocrimes.com and submitting the GitHub name of the package, e.g. vapor/vapor, to see the graph visualized.

Endpoints

If you want to pull the image of your dependencies directly (into your README, for instance), the following endpoint should be useful. You can also use different visualization methods, such as an interactive graph.

  • Get dependencies of a GitHub SwiftPM package:/dependencies/AUTHOR/REPO?format=FORMAT&tag=TAG
    • both format and tag are optional
    • if format is not specified, json is used
    • if tag is not specified, the latest tag found on GitHub is used
    • e.g. /dependencies/czechboy0/Jay?format=png&tag=0.19.0
    • available formats:
      • json - JSON of the dependency graph
      • png - png image of the rendered dependency graph
      • dot - dot/gv format (open in any graphing app, e.g. OmniGraffle)
      • d3deps a page with an interactive dependency graph 1 (experimental, will change)
      • d3graph a page with an interactive dependency graph 2 (experimental, will change)
      • d3tree a page with an interactive dependency tree 3 (experimental, will change)
      • d3depsjs dependencies in JavaScript format for a d3 graph 1 (experimental, will change)
      • d3treejson dependencies in JSON format for a d3 tree 3 (experimental, will change)

Example

http://swift-dependency-fetcher.endocrimes.com/dependencies/vapor/vapor?format=png&tag=0.16.2 returns the following rendered dependency tree

Adding dependency graph in your README

You can add an image of your dependency tree by just adding the following line

![](http://swift-dependency-fetcher.endocrimes.com/dependencies/AUTHOR/REPO?format=png), where you fill in your AUTHOR and REPO.

This is a live rendered dependency tree for this repository, swiftpm-dependency-fetcher:

Please note that it might take a few seconds to render the image for the first time (then it's cached for 24 hours), so if your README fails to pull the image, refresh in a few seconds. I'm working on making things faster, but this is a way to keep things mostly correct.

Requirements for running locally

  • a Redis server running on the port 6380 before booting the server (just redis-server ./Redis/redis.conf from the root folder to start the server with the desired config)
  • a GitHub personal token in the $GITHUB_TOKEN environment variable

Interactive D3 graphs

You can also view your dependencies in 3 interactive formats. Just adjust the format=... end of the URL to one of the following:

1. format=d3deps

2. format=d3tree

💝 Contributing

Please create an issue with a description of your problem or open a pull request with a fix.

✌️ License

MIT

👽 Author

Honza Dvorsky - https://honzadvorsky.com, @czechboy0

About

Dependencies of your SwiftPM packages as a service.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •