Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graphwerk

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphwerk

  • 1.2.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

graphwerk-logo

Graphwerk Gem Version CI Badge

Graphwerk is a small Ruby gem that can generate a diagram of dependencies between packages within an application that's using Packwerk to enforce boundaries.

The gem builds on top of Packwerk and Graphviz.

Here's an example application package dependency diagram:

example

Install

Add this line to your application's Gemfile and run bundle install:

gem 'graphwerk', group: %i[development test]

Usage

For Rails applications a Railtie automatically loads a rake task that makes it easy to generate a diagram for your root package and its dependencies. The diagram will be placed at the root of your application as packwerk.png.

bundle exec rake graphwerk:update

More advance usage is possible by passing a Packwerk::PackageSet directly to Graphwerk::Builders::Graph and calling #build returning a Graphviz instance:

graph = Graphwerk::Builders::Graph.new(
   Packwerk::PackageSet.load_all_from(".")
).build
graph.output(svg: 'packwerk.svg')

All Graphviz layouts are supported and options for the graph, nodes and edges can be set via an optional options argument:

graph = Graphwerk::Builders::Graph.new(
   Packwerk::PackageSet.load_all_from("."),
   options: {
     layout: Graphwerk::Layout::Twopi,
     deprecated_references_color: 'yellow',
     graph: { overlap: true },
     node: { fillcolor: '#000000' },
     edges: { len: '3.0' }
    }
).build
graph.output(svg: 'packwerk.svg')

FAQs

Package last updated on 22 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc