GitXplorerGitXplorer
a

dependencies-cli

public
42 stars
9 forks
0 issues

Commits

List of commits on branch master.
Verified
f098d5b584379a418981dbd9c762da12b95b002b

Update README.md

hhkache committed 5 years ago
Verified
73b4215e486f7d8e67e984313e32ab7b702e84f9

Update README.md

hhkache committed 5 years ago
Unverified
d0ddccb447979f0fb9bb20218c9b19f0b621d2f6

=Fixed NPE problem for package dependency graph

hhkache committed 5 years ago
Verified
1c660226b5a1d990e4a369a030502775dedf92f6

Merge pull request #29 from hkache/versions_and_drift

hhkache committed 6 years ago
Unverified
60e61a208feb8ef0dd86becfe2beb2a712b7a6b0

Package dependency graph

hhkache committed 6 years ago
Unverified
3ff733769a2ffce79c88f52e4b0b7de5794a8f10

Add package dependency graph

hhkache committed 6 years ago

README

The README file for this repository.

🔻🔻🔻DEPRECATED: dependencies-cli🔻🔻🔻


This project has moved to https://github.com/forcedotcom/dependencies-cli.


Sample command line utilities around the Salesforce Dependencies API. This API is currently in Pilot.

Introduction : Dependency Grapher

Graph

This command produces DOT formatted output for dependencies in an org allowing you visualize the dependencies in the org (see below for an example).

You can pass flags to it to filter down the output further, since in most orgs the output can be quite dense. You can then paste the output from this command into this website to see the results or install locally on your desktop one of the following.

Setup and Use

NOTE: This command will in due course be published to NPM and thus unless you wish to contribute to the code for this plugin you will not need to perform the following steps. Meanwhile if you want to give it a go please feel free to install the command as follows.

  1. Make sure you have the latest Salesforce CLI:
sfdx update
  1. Install the plugin via npm
sfdx plugins:install dependencies-cli
  1. Run the command:
sfdx dependency:components:report -u [alias|username]

Rendering graph output locally

We document two options to visualize the produced graph locally:

  1. Render the SVG as dependency graph in an image
  2. Render the SVG as d3-force graph in JavaScript

1. Render the SVG as dependency graph in an image

brew install graphviz
  • produce the DOT graph file output
sfdx dependency:components:report -u [alias|username] -r dot  | tee graph.dot

  • convert the DOT file to SVG
dot -T svg graph.dot > graph.svg
  • open the SVG directly in your browser (Google Chrome works best)
open -a "Google Chrome" graph.svg

2. Render the SVG as d3-force graph in JavaScript

npm install http-server
  • produce the graph in JSON format
sfdx dependency:components:report -u [alias|username] --json  | tee graph.json
  • start the http server
http-server -a localhost -p 8000 &
open -a "Google Chrome" http://localhost:8000

Example Output

  1. Raw DOT format output
digraph graphname {
  rankdir=RL;
  node[shape=Mrecord, bgcolor=black, fillcolor=lightblue, style=filled];
  // Nodes
  X00h11000000s7oIAAQ [label=<Case (Support) Layout<BR/><FONT POINT-SIZE="8">Layout</FONT>>]
  X00b11000000S28TAAS [label=<Up-sell / Cross-sell Opportunity<BR/><FONT POINT-SIZE="8">WebLink</FONT>>]
  X00h11000000s7oJAAQ [label=<Case Layout<BR/><FONT POINT-SIZE="8">Layout</FONT>>]
  X00h11000000s7oNAAQ [label=<Account (Marketing) Layout<BR/><FONT POINT-SIZE="8">Layout</FONT>>]
  X00b11000000S28SAAS [label=<Billing<BR/><FONT POINT-SIZE="8">WebLink</FONT>>]
  X00N11000002qGqQEAU [label=<Account.Contract<BR/><FONT POINT-SIZE="8">CustomField</FONT>>]
  X00N11000002q9aoEAA [label=<Account.formula1<BR/><FONT POINT-SIZE="8">CustomField</FONT>>]
  X00N11000002pkkvEAA [label=<Account.Red<BR/><FONT POINT-SIZE="8">CustomField</FONT>>]
  X00h11000000s7oOAAQ [label=<Account (Sales) Layout<BR/><FONT POINT-SIZE="8">Layout</FONT>>]
  X00h11000000s7oPAAQ [label=<Account (Support) Layout<BR/><FONT POINT-SIZE="8">Layout</FONT>>]
  X00h11000000s7oQAAQ [label=<Account Layout<BR/><FONT POINT-SIZE="8">Layout</FONT>>]
  X00h11000000s7oZAAQ [label=<Opportunity (Marketing) Layout<BR/><FONT POINT-SIZE="8">Layout</FONT>>]
  X00b11000000S28RAAS [label=<Delivery Status<BR/><FONT POINT-SIZE="8">WebLink</FONT>>]
  X00h11000000s7oaAAA [label=<Opportunity (Sales) Layout<BR/><FONT POINT-SIZE="8">Layout</FONT>>]
  X00h11000000s7obAAA [label=<Opportunity (Support) Layout<BR/><FONT POINT-SIZE="8">Layout</FONT>>]
  X00h11000000s7ocAAA [label=<Opportunity Layout<BR/><FONT POINT-SIZE="8">Layout</FONT>>]
  X00h11000000s7pfAAA [label=<Campaign Layout<BR/><FONT POINT-SIZE="8">Layout</FONT>>]
  X00b11000000S28QAAS [label=<View Campaign Influence Report<BR/><FONT POINT-SIZE="8">WebLink</FONT>>]
  X00h11000000s7phAAA [label=<Contract Layout<BR/><FONT POINT-SIZE="8">Layout</FONT>>]
  X00h11000000sB5RAAU [label=<CustomObject1 Layout<BR/><FONT POINT-SIZE="8">Layout</FONT>>]
  X00N11000002po9oEAA [label=<CustomObject1.Blue<BR/><FONT POINT-SIZE="8">CustomField</FONT>>]
  X03d110000006W4WAAU [label=<Contract.ContractRule<BR/><FONT POINT-SIZE="8">ValidationRule</FONT>>]
  X03d110000006W55AAE [label=<CustomObject1.IsBLueToo<BR/><FONT POINT-SIZE="8">ValidationRule</FONT>>]
  X03d110000006W50AAE [label=<Account.IsBLue<BR/><FONT POINT-SIZE="8">ValidationRule</FONT>>]
  X01I110000003zvLEAQ [label=<CustomObject1<BR/><FONT POINT-SIZE="8">CustomObject</FONT>>]
  // Paths
  X00h11000000s7oIAAQ->X00b11000000S28TAAS
  X00h11000000s7oJAAQ->X00b11000000S28TAAS
  X00h11000000s7oNAAQ->X00b11000000S28SAAS
  X00h11000000s7oNAAQ->X00N11000002qGqQEAU
  X00h11000000s7oNAAQ->X00N11000002q9aoEAA
  X00h11000000s7oNAAQ->X00N11000002pkkvEAA
  X00h11000000s7oOAAQ->X00N11000002q9aoEAA
  X00h11000000s7oOAAQ->X00N11000002pkkvEAA
  X00h11000000s7oOAAQ->X00N11000002qGqQEAU
  X00h11000000s7oOAAQ->X00b11000000S28SAAS
  X00h11000000s7oPAAQ->X00N11000002pkkvEAA
  X00h11000000s7oPAAQ->X00b11000000S28SAAS
  X00h11000000s7oPAAQ->X00N11000002qGqQEAU
  X00h11000000s7oPAAQ->X00N11000002q9aoEAA
  X00h11000000s7oQAAQ->X00b11000000S28SAAS
  X00h11000000s7oQAAQ->X00N11000002pkkvEAA
  X00h11000000s7oQAAQ->X00N11000002qGqQEAU
  X00h11000000s7oQAAQ->X00N11000002q9aoEAA
  X00h11000000s7oZAAQ->X00b11000000S28RAAS
  X00h11000000s7oaAAA->X00b11000000S28RAAS
  X00h11000000s7obAAA->X00b11000000S28RAAS
  X00h11000000s7ocAAA->X00b11000000S28RAAS
  X00h11000000s7pfAAA->X00b11000000S28QAAS
  X00h11000000s7phAAA->X00N11000002qGqQEAU
  X00h11000000sB5RAAU->X00N11000002po9oEAA
  X03d110000006W4WAAU->X00N11000002pkkvEAA
  X03d110000006W55AAE->X00N11000002po9oEAA
  X03d110000006W50AAE->X00N11000002po9oEAA
  X03d110000006W50AAE->X01I110000003zvLEAQ
  X00N11000002q9aoEAA->X00N11000002pkkvEAA
}
  1. SVG dependency graph output

Graph

  1. D3 force graph output

Graph