Skip to content

Commit

Permalink
working commit
Browse files Browse the repository at this point in the history
  • Loading branch information
prasadtalasila committed Sep 29, 2023
1 parent f682a27 commit 08d156d
Show file tree
Hide file tree
Showing 15 changed files with 1,425 additions and 7 deletions.
18 changes: 18 additions & 0 deletions client/.madgerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"fontSize": "10px",
"tsconfig": "tsconfig.json",
"fileExtensions": ["ts", "tsx", "js", "jsx"],
"backgroundColor": "#FFFFFF",
"textColor": "#FFFFFF",
"nodeColor": "black",
"noDependencyColor": "green",
"cyclicNodeColor": "red",
"edgeColor": "green",
"graphVizOptions": {
"G": {
"rankdir": "TB",
"layout": "neato",
"splines": "curved"
}
}
}
3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"configapp": "script/config.bash",
"start": "script/start.bash",
"clean": "script/clean.bash",
"format": "prettier --ignore-path ../.gitignore --write \"**/*.{ts,tsx,css,scss}\""
"format": "prettier --ignore-path ../.gitignore --write \"**/*.{ts,tsx,css,scss}\"",
"graph": "script/graph.bash"
},
"eslintConfig": {
"extends": [
Expand Down
3 changes: 2 additions & 1 deletion client/script/clean.bash
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/bash
rm -rf build/ node_modules/ coverage/ playwright-report/
rm -rf build/ node_modules/ coverage/ playwright-report/
rm src.svg test.svg
9 changes: 9 additions & 0 deletions client/script/graph.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
PATH="$(yarn bin):$PATH"
export PATH
printf "Generate dependency graph for code"

madge --image src.svg src
madge --image test.svg test
#eval madge --image src.svg "$TS_CONFIG" "$EXTENSIONS" src
#madge --image test.svg --ts-config tsconfig.json --extensions ts,tsx test
4 changes: 4 additions & 0 deletions docs/developer/client/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
The [Website](https://github.com/INTO-CPS-Association/DTaaS/tree/feature/distributed-demo/client#readme)
is how the end-users interact with the software platform. The website is
being developed as a React single page web application.

A dependency graph for the entire codebase of the react application is:

![React website dependency graph](client-dep-graph.svg)
565 changes: 565 additions & 0 deletions docs/developer/client/src.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
607 changes: 607 additions & 0 deletions docs/developer/client/test.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
193 changes: 193 additions & 0 deletions docs/developer/servers/lib/src-dep-graph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion script/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,8 @@ sudo -H pip3 install mkdocs-with-pdf
sudo -H pip3 install qrcode

# Install markdownlint
sudo gem install mdl
sudo gem install mdl

# Install madge for generating dependency graphs of typescript projects
sudo apt-get install graphviz
sudo npm install -g madge
3 changes: 2 additions & 1 deletion servers/execution/runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"syntax": "script/syntax.bash",
"test": "script/test.bash",
"test:nocov": "script/test.bash nocoverage",
"test:watchAll": "script/test.bash watchAll"
"test:watchAll": "script/test.bash watchAll",
"graph": "script/graph.bash"
},
"bin": {
"runner": "./dist/src/main.js"
Expand Down
3 changes: 2 additions & 1 deletion servers/execution/runner/script/clean.bash
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/bash
rm -rf build node_modules coverage dist
rm -rf build node_modules coverage dist
rm src.svg test.svg
6 changes: 6 additions & 0 deletions servers/execution/runner/script/graph.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
PATH="$(yarn bin):$PATH"
export PATH
printf "Generate graph for source code"
madge --image src.svg --ts-config tsconfig.json --extensions ts,tsx src
madge --image test.svg --ts-config tsconfig.json --extensions ts,tsx test
3 changes: 2 additions & 1 deletion servers/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"clean": "script/clean.bash",
"start": "script/start.bash",
"syntax": "script/syntax.bash",
"test": "script/test.bash"
"test": "script/test.bash",
"graph": "script/graph.bash"
},
"dependencies": {
"@apollo/client": "^3.7.10",
Expand Down
3 changes: 2 additions & 1 deletion servers/lib/script/clean.bash
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/bash
rm -rf build node_modules coverage dist
rm -rf build node_modules coverage dist
rm src.svg test.svg
6 changes: 6 additions & 0 deletions servers/lib/script/graph.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
PATH="$(yarn bin):$PATH"
export PATH
printf "Generate graph for source code"
madge --image src.svg --ts-config tsconfig.json --extensions ts,tsx src
madge --image test.svg --ts-config tsconfig.json --extensions ts,tsx test

0 comments on commit 08d156d

Please sign in to comment.