Hi @seddonym 👋
We recently started using import-linter in our team - it's awesome and has made our architecture tests much cleaner!
We'd like to visualise our import layers to share with colleagues in a centralised place (e.g. in our CLI tool).
Would it make sense to add this functionality to import-linter directly? I've already prepared a simple CLI command in a fork.
The idea is to provide a command like:
uv run show-import-layers
Which outputs ASCII art of the layer hierarchy (including the awesome logo!):
╔══╗─────────▶╔╗ ╔╗ ╔╗◀───┐
╚╣╠╝◀─────┐ ╔╝╚╗║║────▶╔╝╚╗ │
║║ ╔══╦══╦╩╗╔╝║║ ╔╦═╩╗╔╝╔═╦══╗
║║╔══╣╔╗║╔╗║╔╣║ ║║ ╔╬╣╔╗║║ ║│║╔═╝
╔╣╠╣║║║╚╝║╚╝║║║╚╗║╚═╝║║║║║╚╗║═╣║
╚══╩╩╩╣╔═╩══╩╝╚═╝╚═══╩╩╝╚╩═╩╩═╩╝
└──▶║║ ▲
╚╝────────────────────┘
--------------------
Layered architecture
--------------------
▲ higher level (can import from layers below)
│
┌────────────────────────────┐
│ cli │
├────────────────────────────┤
↓│ api │
├────────────────────────────┤
↓│ contracts │
├────────────────────────────┤
↓│ configuration │
├────────────────────────────┤
↓│ adapters │
├────────────────────────────┤
↓│ application ║ domain │
└────────────────────────────┘
│
▼ lower level (cannot import layers above)
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
Legend:
║ independent modules (cannot import each other)
Happy to talk about it in a PR if you're interested.
Hi @seddonym 👋
We recently started using import-linter in our team - it's awesome and has made our architecture tests much cleaner!
We'd like to visualise our import layers to share with colleagues in a centralised place (e.g. in our CLI tool).
Would it make sense to add this functionality to import-linter directly? I've already prepared a simple CLI command in a fork.
The idea is to provide a command like:
Which outputs ASCII art of the layer hierarchy (including the awesome logo!):
Happy to talk about it in a PR if you're interested.