This visualizer was cut out from a GitHub Action that creates an SVG diagram of your repo. Read more in the original writeup.
yarn build
A repo-visualizer.js
file should appear in your curren directory.
node repo-visualizer.js
bun dev
Now open localhost:3000
in your browser.
- add back interactive capabilities mentioned in the original post
- make it into a proper library - portable and working with any repo
- add back ability to generate static SVG
- modify the original action to use the library
- improve argument parsing
Please note these inputs may not work in the standalone version as they have not been tested. There is no reporting of wrong arguments etc.
A path (relative to the root of your repo) to where you would like the diagram to live.
For example: images/diagram.svg
Default: diagram.svg
A list of paths to folders to exclude from the diagram, separated by commas.
For example: dist,node_modules
Default: node_modules,bower_components,dist,out,build,eject,.next,.netlify,.yarn,.vscode,package-lock.json,yarn.lock
A semicolon-delimited array of file globs to exclude from the diagram, using micromatch syntax. Provided as an array.
For example:
excluded_globs: "frontend/*.spec.js;**/*.{png,jpg};**/!(*.module).ts"
# Guide:
# - 'frontend/*.spec.js' # exclude frontend tests
# - '**/*.{png,ico,md}' # all png, ico, md files in any directory
# - '**/!(*.module).ts' # all TS files except module files
The directory (and its children) that you want to visualize in the diagram, relative to the repository root.
For example: src/
Default: ''
(current directory)
The maximum number of nested folders to show files within. A higher number will take longer to render.
Default: 9
You can customize the colors for specific file extensions. Key/value pairs will extend the default colors.
For example: '{"js": "red","ts": "green"}' default: '{}'
The contents of the diagram as text. This can be used if you don't want to handle new files.