$ show dyatko/arkit
Arkit is a static analysis tool that generates architecture diagrams from JavaScript, TypeScript, Flow, Vue, and Nuxt codebases. It analyzes source code to extract component dependencies (imports/exports) and produces visual diagrams in PlantUML, SVG, or PNG formats. The tool is designed for CI/CD pipelines and local development, with a focus on producing meaningful, committable architecture documentation that stays in sync with the codebase. The architecture follows a pipeline pattern: CLI or programmatic entry point → configuration loading (merging CLI options, config files, and defaults) → file system scanning with ts-morph → parsing of imports/exports → component and dependency graph generation → PlantUML text generation → conversion to SVG/PNG via local Java PlantUML or an optional WASM GraphViz backend. The tool supports configurable component grouping, output paths, and diagram directions. Key features include automatic detection of module systems (ESM, CommonJS, TypeScript path aliases), support for Vue single-file components and Angular templates, configurable exclude patterns, and a JSON schema for editor autocomplete. The codebase is well-tested with Jest, includes CI/CD via GitHub Actions, and provides both a CLI and a programmatic API.
The LLM identified 3 files worth highlighting for reuse:
Provides reusable utility functions including getPaths (recursive file scanning with include/exclude globs and memory pressure guard), safeRequire (optional JSON/JS config loading with fallback), and convertToRelative (path conversion). These are self-contained and can be extracted for use in other static analysis or file-processing tools.
A standalone wrapper around @hpcc-js/wasm-graphviz that provides a drop-in replacement for the GraphViz dot binary. Uses a dynamic import workaround to handle ESM-only package from a CJS context. Demonstrates a reusable pattern for integrating WASM-based tools into Node.js applications.
Encapsulates ts-morph project creation and module path resolution using tsconfig-paths and resolve libraries. Provides a clean interface for discovering source files and resolving import paths, reusable in any TypeScript static analysis tool.