Skip to content

Commit f4697df

Browse files
authored
add module graph (#1232)
1 parent 9692bf8 commit f4697df

File tree

5 files changed

+213
-7
lines changed

5 files changed

+213
-7
lines changed

.github/workflows/codegen.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,19 @@ jobs:
2525
go-version: ${{ env.GO_VERSION }}
2626
- name: Display Go version
2727
run: go version
28+
- name: Tidy
29+
run: make gomodtidy
2830
- name: Install protoc
2931
run: make install-protoc
3032
- name: Re-Generate files
31-
run: |
32-
make generate
33-
- name: Tidy
34-
run: go mod tidy
33+
run: make generate
3534
- name: ensure no changes
3635
run: |
3736
set -e
3837
git_status=$(git status --porcelain=v1)
3938
if [ ! -z "$git_status" ]; then
4039
git status
4140
git diff
42-
echo "Error: modified files detected, run 'make generate' / 'go mod tidy'."
41+
echo "Error: modified files detected, run 'make gomodtidy' / 'make generate' / ."
4342
exit 1
4443
fi

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ build: ensure_go_version
2323

2424
# If you have a different version of protoc installed, you can use the following command to generate the protobuf files
2525
# make generate PROTOC_BIN=/path/to/protoc
26-
generate: ensure_go_version clean-generate proto-generate generate-mocks
26+
generate: ensure_go_version clean-generate proto-generate generate-mocks modgraph
2727

2828
generate-mocks: ensure_go_version
2929
go install github.com/vektra/mockery/[email protected]
@@ -104,3 +104,13 @@ install_buf:
104104

105105
ensure_buf_version:
106106
@$(BUF_BIN) --version | grep -q '1.50.0' || (echo "Please use buf 1.50.0" && exit 1)
107+
108+
gomods: ## Install gomods
109+
go install github.com/jmank88/[email protected]
110+
111+
gomodtidy: gomods
112+
gomods tidy
113+
114+
modgraph: gomods
115+
go install github.com/jmank88/[email protected]
116+
./modgraph > go.md

chains/solana/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ clippy:
1717

1818
.PHONY: gomods
1919
gomods: ## Install gomods
20-
go install github.com/jmank88/[email protected].3
20+
go install github.com/jmank88/[email protected].7
2121

2222
.PHONY: gomodtidy
2323
gomodtidy: gomods

go.md

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# smartcontractkit Go modules
2+
## Main module
3+
```mermaid
4+
flowchart LR
5+
6+
chain-selectors
7+
click chain-selectors href "https://github.com/smartcontractkit/chain-selectors"
8+
chainlink-ccip --> chainlink-common
9+
chainlink-ccip --> chainlink-protos/rmn/v1.6/go
10+
click chainlink-ccip href "https://github.com/smartcontractkit/chainlink-ccip"
11+
chainlink-common --> chain-selectors
12+
chainlink-common --> chainlink-common/pkg/chipingress
13+
chainlink-common --> chainlink-protos/billing/go
14+
chainlink-common --> chainlink-protos/cre/go
15+
chainlink-common --> chainlink-protos/storage-service
16+
chainlink-common --> chainlink-protos/workflows/go
17+
chainlink-common --> freeport
18+
chainlink-common --> grpc-proxy
19+
chainlink-common --> libocr
20+
click chainlink-common href "https://github.com/smartcontractkit/chainlink-common"
21+
chainlink-common/pkg/chipingress
22+
click chainlink-common/pkg/chipingress href "https://github.com/smartcontractkit/chainlink-common"
23+
chainlink-protos/billing/go
24+
click chainlink-protos/billing/go href "https://github.com/smartcontractkit/chainlink-protos"
25+
chainlink-protos/cre/go
26+
click chainlink-protos/cre/go href "https://github.com/smartcontractkit/chainlink-protos"
27+
chainlink-protos/rmn/v1.6/go
28+
click chainlink-protos/rmn/v1.6/go href "https://github.com/smartcontractkit/chainlink-protos"
29+
chainlink-protos/storage-service
30+
click chainlink-protos/storage-service href "https://github.com/smartcontractkit/chainlink-protos"
31+
chainlink-protos/workflows/go
32+
click chainlink-protos/workflows/go href "https://github.com/smartcontractkit/chainlink-protos"
33+
freeport
34+
click freeport href "https://github.com/smartcontractkit/freeport"
35+
grpc-proxy
36+
click grpc-proxy href "https://github.com/smartcontractkit/grpc-proxy"
37+
libocr
38+
click libocr href "https://github.com/smartcontractkit/libocr"
39+
40+
subgraph chainlink-common-repo[chainlink-common]
41+
chainlink-common
42+
chainlink-common/pkg/chipingress
43+
end
44+
click chainlink-common-repo href "https://github.com/smartcontractkit/chainlink-common"
45+
46+
subgraph chainlink-protos-repo[chainlink-protos]
47+
chainlink-protos/billing/go
48+
chainlink-protos/cre/go
49+
chainlink-protos/rmn/v1.6/go
50+
chainlink-protos/storage-service
51+
chainlink-protos/workflows/go
52+
end
53+
click chainlink-protos-repo href "https://github.com/smartcontractkit/chainlink-protos"
54+
55+
classDef outline stroke-dasharray:6,fill:none;
56+
class chainlink-common-repo,chainlink-protos-repo outline
57+
```
58+
## All modules
59+
```mermaid
60+
flowchart LR
61+
62+
ccip-owner-contracts
63+
click ccip-owner-contracts href "https://github.com/smartcontractkit/ccip-owner-contracts"
64+
chain-selectors
65+
click chain-selectors href "https://github.com/smartcontractkit/chain-selectors"
66+
chainlink-aptos --> chainlink-common
67+
click chainlink-aptos href "https://github.com/smartcontractkit/chainlink-aptos"
68+
chainlink-ccip --> chainlink-common
69+
chainlink-ccip --> chainlink-protos/rmn/v1.6/go
70+
click chainlink-ccip href "https://github.com/smartcontractkit/chainlink-ccip"
71+
chainlink-ccip/chains/evm/deployment --> chainlink-ccip/deployment
72+
chainlink-ccip/chains/evm/deployment --> chainlink-evm/gethwrappers
73+
click chainlink-ccip/chains/evm/deployment href "https://github.com/smartcontractkit/chainlink-ccip"
74+
chainlink-ccip/chains/solana --> chainlink-ccip
75+
chainlink-ccip/chains/solana --> chainlink-ccip/chains/solana/gobindings
76+
click chainlink-ccip/chains/solana href "https://github.com/smartcontractkit/chainlink-ccip"
77+
chainlink-ccip/chains/solana/deployment --> chainlink-ccip/deployment
78+
click chainlink-ccip/chains/solana/deployment href "https://github.com/smartcontractkit/chainlink-ccip"
79+
chainlink-ccip/chains/solana/gobindings
80+
click chainlink-ccip/chains/solana/gobindings href "https://github.com/smartcontractkit/chainlink-ccip"
81+
chainlink-ccip/cmd/carpenter --> chainlink-ccip
82+
click chainlink-ccip/cmd/carpenter href "https://github.com/smartcontractkit/chainlink-ccip"
83+
chainlink-ccip/deployment --> chainlink-deployments-framework
84+
click chainlink-ccip/deployment href "https://github.com/smartcontractkit/chainlink-ccip"
85+
chainlink-common --> chain-selectors
86+
chainlink-common --> chainlink-common/pkg/chipingress
87+
chainlink-common --> chainlink-protos/billing/go
88+
chainlink-common --> chainlink-protos/cre/go
89+
chainlink-common --> chainlink-protos/storage-service
90+
chainlink-common --> chainlink-protos/workflows/go
91+
chainlink-common --> freeport
92+
chainlink-common --> grpc-proxy
93+
chainlink-common --> libocr
94+
click chainlink-common href "https://github.com/smartcontractkit/chainlink-common"
95+
chainlink-common/pkg/chipingress
96+
click chainlink-common/pkg/chipingress href "https://github.com/smartcontractkit/chainlink-common"
97+
chainlink-common/pkg/values
98+
click chainlink-common/pkg/values href "https://github.com/smartcontractkit/chainlink-common"
99+
chainlink-deployments-framework --> ccip-owner-contracts
100+
chainlink-deployments-framework --> chainlink-protos/chainlink-catalog
101+
chainlink-deployments-framework --> chainlink-protos/job-distributor
102+
chainlink-deployments-framework --> chainlink-testing-framework/seth
103+
chainlink-deployments-framework --> chainlink-tron/relayer
104+
chainlink-deployments-framework --> mcms
105+
click chainlink-deployments-framework href "https://github.com/smartcontractkit/chainlink-deployments-framework"
106+
chainlink-evm/gethwrappers
107+
click chainlink-evm/gethwrappers href "https://github.com/smartcontractkit/chainlink-evm"
108+
chainlink-protos/billing/go
109+
click chainlink-protos/billing/go href "https://github.com/smartcontractkit/chainlink-protos"
110+
chainlink-protos/chainlink-catalog
111+
click chainlink-protos/chainlink-catalog href "https://github.com/smartcontractkit/chainlink-protos"
112+
chainlink-protos/cre/go
113+
click chainlink-protos/cre/go href "https://github.com/smartcontractkit/chainlink-protos"
114+
chainlink-protos/job-distributor
115+
click chainlink-protos/job-distributor href "https://github.com/smartcontractkit/chainlink-protos"
116+
chainlink-protos/rmn/v1.6/go
117+
click chainlink-protos/rmn/v1.6/go href "https://github.com/smartcontractkit/chainlink-protos"
118+
chainlink-protos/storage-service
119+
click chainlink-protos/storage-service href "https://github.com/smartcontractkit/chainlink-protos"
120+
chainlink-protos/workflows/go
121+
click chainlink-protos/workflows/go href "https://github.com/smartcontractkit/chainlink-protos"
122+
chainlink-testing-framework/framework
123+
click chainlink-testing-framework/framework href "https://github.com/smartcontractkit/chainlink-testing-framework"
124+
chainlink-testing-framework/seth
125+
click chainlink-testing-framework/seth href "https://github.com/smartcontractkit/chainlink-testing-framework"
126+
chainlink-tron/relayer --> chainlink-common
127+
chainlink-tron/relayer --> chainlink-common/pkg/values
128+
click chainlink-tron/relayer href "https://github.com/smartcontractkit/chainlink-tron"
129+
freeport
130+
click freeport href "https://github.com/smartcontractkit/freeport"
131+
grpc-proxy
132+
click grpc-proxy href "https://github.com/smartcontractkit/grpc-proxy"
133+
libocr
134+
click libocr href "https://github.com/smartcontractkit/libocr"
135+
mcms --> chainlink-aptos
136+
mcms --> chainlink-ccip/chains/solana
137+
mcms --> chainlink-testing-framework/framework
138+
click mcms href "https://github.com/smartcontractkit/mcms"
139+
140+
subgraph chainlink-ccip-repo[chainlink-ccip]
141+
chainlink-ccip
142+
chainlink-ccip/chains/evm/deployment
143+
chainlink-ccip/chains/solana
144+
chainlink-ccip/chains/solana/deployment
145+
chainlink-ccip/chains/solana/gobindings
146+
chainlink-ccip/cmd/carpenter
147+
chainlink-ccip/deployment
148+
end
149+
click chainlink-ccip-repo href "https://github.com/smartcontractkit/chainlink-ccip"
150+
151+
subgraph chainlink-common-repo[chainlink-common]
152+
chainlink-common
153+
chainlink-common/pkg/chipingress
154+
chainlink-common/pkg/values
155+
end
156+
click chainlink-common-repo href "https://github.com/smartcontractkit/chainlink-common"
157+
158+
subgraph chainlink-protos-repo[chainlink-protos]
159+
chainlink-protos/billing/go
160+
chainlink-protos/chainlink-catalog
161+
chainlink-protos/cre/go
162+
chainlink-protos/job-distributor
163+
chainlink-protos/rmn/v1.6/go
164+
chainlink-protos/storage-service
165+
chainlink-protos/workflows/go
166+
end
167+
click chainlink-protos-repo href "https://github.com/smartcontractkit/chainlink-protos"
168+
169+
subgraph chainlink-testing-framework-repo[chainlink-testing-framework]
170+
chainlink-testing-framework/framework
171+
chainlink-testing-framework/seth
172+
end
173+
click chainlink-testing-framework-repo href "https://github.com/smartcontractkit/chainlink-testing-framework"
174+
175+
classDef outline stroke-dasharray:6,fill:none;
176+
class chainlink-ccip-repo,chainlink-common-repo,chainlink-protos-repo,chainlink-testing-framework-repo outline
177+
```

modgraph

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
3+
# Generates go.md
4+
5+
set -e
6+
7+
echo "# smartcontractkit Go modules
8+
## Main module
9+
\`\`\`mermaid
10+
flowchart LR
11+
"
12+
go mod graph | modgraph -prefix github.com/smartcontractkit/
13+
echo "\`\`\`"
14+
15+
echo "## All modules
16+
\`\`\`mermaid
17+
flowchart LR
18+
"
19+
gomods graph | modgraph -prefix github.com/smartcontractkit/
20+
echo "\`\`\`"

0 commit comments

Comments
 (0)