-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: customize grouping names and module names #692
Comments
Hi @danielo515 thanks for this interesting use case (and I'm interested what the reason has been to choose a naming convention over folders). It is indeed not yet possible with dependency-cruiser('s reporters) to do group files not in a folder as if they were in a folder. Thinking out loud it could be done in an addition to a (or copy of/ a generalisation of the dot) reporter - the grouping done there is just a function (call over here).
Generated with this command
.dependency-cruiser.js/** @type {import('dependency-cruiser').IConfiguration} */
module.exports = {
options: {
includeOnly: {
path: ["^src/", "^test/"],
},
exclude: {
path: ["mock", "fixture", "integration"],
},
doNotFollow: {
path: "node_modules",
},
reporterOptions: {
dot: {
collapsePattern: [
"\\.[^.]+\\.(c|m)?js$",
"\\.js$",
"\\.[^.]+\\.ts$",
],
theme: {
graph: {
splines: "ortho",
},
},
},
},
},
}; |
It is simpler than you think. We use a compile to js language (reasonML) where everything is in the same global namespace, and the only namespacing is at the file name (AKA module). |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Do you plan to try to add this or you don't have time? Which is perfectly
understandable
El vie., 9 dic. 2022 3:53, github-actions[bot] ***@***.***>
escribió:
… This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.
—
Reply to this email directly, view it on GitHub
<#692 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARKJWNGBGINTVKZBVMXQTLWMKNJDANCNFSM6AAAAAASJKJ6SQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi @danielo515 - this seems like a legit feature. I'll tame stale bot. |
Another use case, albeit maybe more specific (let me know if I should create a new issue). I want to group all built-in Node.js module dependencies. Right now, they end up as independent modules. When looking at the JSON output, I see they have |
It will be lovely to be able to specify a function or a regex to customize the way groups are named. I read the docs and I didn't found a way to do this, please forgive me if I overlooked something.
Context
We have a code base where, instead of using folders, we group files by using a naming convention. Something like Kind__Module.bs.js
I will like to be a able to specify a way to both group them and rename the visualization. So in one arch visualization I may want to see relations between all the kinds, and I want groups to be named after the Kind, and in another visualization I may want to see relations between modules and want to group them based on module name and only show the module name.
Expected Behavior
Ideally I want a function for maximum flexibility, but separated regex for grouping or renaming will be also fine.
Current Behavior
I think the current collapsing options are not enough to achieve this.
Possible Solution
Considered alternatives
Writing a new reporter? Not sure
The text was updated successfully, but these errors were encountered: