Created
February 1, 2023 14:38
-
-
Save s4ff0x/84c65308d2e335931627619593e20ccc to your computer and use it in GitHub Desktop.
dependency cruiser setup to generate html graph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @type {import('dependency-cruiser').IConfiguration} */ | |
module.exports = { | |
options: { | |
doNotFollow: { | |
dependencyTypes: [ | |
"npm", | |
"npm-dev", | |
"npm-optional", | |
"npm-peer", | |
"npm-bundled", | |
"npm-no-pkg", | |
], | |
}, | |
includeOnly: "^src", | |
tsPreCompilationDeps: false, | |
tsConfig: { | |
fileName: "./tsconfig.json", | |
}, | |
/* How to resolve external modules - use "yarn-pnp" if you're using yarn's Plug'n'Play. | |
otherwise leave it out (or set to the default, which is 'node_modules') | |
*/ | |
externalModuleResolutionStrategy: "yarn-pnp", | |
progress: { type: "performance-log" }, | |
reporterOptions: { | |
archi: { | |
collapsePattern: | |
"^src/app/[^/]+|^src/pages/[^/]+|^src/features/[^/]+|^src/ui-kit/[^/]+", | |
theme: { | |
modules: [ | |
{ | |
criteria: { collapsed: true }, | |
attributes: { shape: "tab" }, | |
}, | |
{ | |
criteria: { source: "^src/app/[^/]+" }, | |
attributes: { fillcolor: "#ffbdbd" }, | |
}, | |
{ | |
criteria: { source: "^src/pages/[^/]+" }, | |
attributes: { fillcolor: "#ffd9a3" }, | |
}, | |
{ | |
criteria: { source: "^src/features/[^/]+" }, | |
attributes: { fillcolor: "#aedaff" }, | |
}, | |
{ | |
criteria: { source: "^src/ui-kit/[^/]+" }, | |
attributes: { fillcolor: "#efefef" }, | |
}, | |
], | |
graph: { | |
splines: "ortho", | |
rankdir: "TB", | |
ranksep: "1", | |
}, | |
}, | |
}, | |
}, | |
}, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"depcruise:archi": "depcruise --version && depcruise --config depcruise-config.js --output-type archi src | dot -T svg | depcruise-wrap-stream-in-html > high-level-dependencies.html" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment