-
Notifications
You must be signed in to change notification settings - Fork 0
Contributing
Arham-Qureshi edited this page Jul 21, 2026
·
1 revision
git clone https://github.com/Arham-Qureshi/codebase-vis
cd codebase-vis
npm installYou'll need a C++ compiler toolchain for tree-sitter native module compilation. See Installation for platform-specific instructions.
codebase-vis/
├── bin/codebase-vis.js # CLI entry
├── src/
│ ├── cli/ # Command handlers
│ │ ├── shared.js # Shared utilities
│ │ └── commands/ # 8 command modules
│ ├── parser/ # AST parsing
│ │ ├── index.js # Orchestrator
│ │ ├── languages.js # Language metadata
│ │ ├── parse-worker.js# Forked worker
│ │ └── {lang}.js # Per-language parsers
│ ├── graph/ # Graph construction
│ │ ├── builder.js # Build + dependency resolution
│ │ ├── enricher.js # Louvain + visual attrs
│ │ ├── formatter.js # JSON export
│ │ └── cycle-detector.js
│ ├── utils/ # Infrastructure
│ │ ├── file-system.js # Sandboxed I/O
│ │ ├── traversal.js # File discovery
│ │ ├── cache.js # Incremental cache
│ │ └── worker-pool.js # Fork pool
│ └── templates/
│ ├── graph-template.js
│ └── graph.html # Visualizer
└── test/ # Node.js test runner
npm testTests use Node.js built-in node --test runner (no Jest/Mocha needed). Run individual test files:
npx node --test test/parser/javascript.test.js-
ESM only — all files use
import/export. No CommonJS. - No JSDoc — prefer descriptive variable names over documentation comments
-
picocolorsfor terminal colors (notchalk) -
@clack/promptsfor interactive prompts (notinquirer) - No try-catch wrappers around validation — let meaningful errors surface
- Descriptive variable names over abbreviations
- Create
src/parser/{language}.js- Export
{ grammar, extractDependencies, extractEntities } - Supply tree-sitter S-expression queries for imports and entities
- Export
- Register it in
src/parser/index.js:- Add to
GRAMMAR_MAP - Ensure
KNOWN_EXTENSIONScovers your extensions
- Add to
- Add language metadata in
src/parser/languages.js:- Add entry to
LANGUAGESarray - Update
STACK_MARKERSif relevant (for init)
- Add entry to
- Create test in
test/parser/{language}.test.js - Add fixture files if needed
- Update the
Supported Languagestable inREADME.md
- One feature per PR
- Keep the visualizer self-contained (no external dependencies beyond vis-network CDN)
- Don't change
package-lock.jsonunless adding/modifying a dependency - Update tests for any behavior changes
npm version patch # or minor / major
git push --follow-tagsThen create a GitHub Release — the publish workflow automatically publishes to npm.