Created
October 15, 2022 10:07
-
-
Save s4ff0x/c0ebb0dcff5bcef0db6423ed1417fcb7 to your computer and use it in GitHub Desktop.
Dependency cruiser config for "Feature Sliced Design"
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", | |
// exclude: { | |
// path: "^src/shared", | |
// }, | |
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/processes/[^/]+|^src/pages/[^/]+|^src/widgets/[^/]+|^src/features/[^/]+|^src/entities/[^/]+|^src/shared/[^/]+", | |
theme: { | |
modules: [ | |
{ | |
criteria: { collapsed: true }, | |
attributes: { shape: "tab" }, | |
}, | |
{ | |
criteria: { source: "^src/app/[^/]+" }, | |
attributes: { fillcolor: "#ffbdbd" }, | |
}, | |
{ | |
criteria: { source: "^src/processes/[^/]+" }, | |
attributes: { fillcolor: "#da96ff" }, | |
}, | |
{ | |
criteria: { source: "^src/pages/[^/]+" }, | |
attributes: { fillcolor: "#ffd9a3" }, | |
}, | |
{ | |
criteria: { source: "^src/widgets/[^/]+" }, | |
attributes: { fillcolor: "#94fffa" }, | |
}, | |
{ | |
criteria: { source: "^src/features/[^/]+" }, | |
attributes: { fillcolor: "#aedaff" }, | |
}, | |
{ | |
criteria: { source: "^src/entities/[^/]+" }, | |
attributes: { fillcolor: "#d3ffc6" }, | |
}, | |
{ | |
criteria: { source: "^src/shared/[^/]+" }, | |
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 fsd-depcruise-config.js --output-type archi src | dot -T svg | tee fsd-high-level-dependencies.svg | depcruise-wrap-stream-in-html > fsd-high-level-dependencies.html" | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
don't forget to install graphviz