Contributing to Graph-It-Live
June 12, 2026 · View on GitHub
Thank you for your interest in contributing to Graph-It-Live! This document provides guidelines for contributing to the project.
Table of Contents
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Testing
- Submitting Changes
- Coding Standards
- Documentation
Code of Conduct
This project follows a standard code of conduct. Please be respectful and constructive in all interactions.
Getting Started
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/Graph-It-Live.git
cd Graph-It-Live
- Add upstream remote:
git remote add upstream https://github.com/magic5644/Graph-It-Live.git
- Install dependencies:
nvm use # optional, uses Node.js 22 when nvm is installed
npm install
- Build the extension:
npm run build # Build VS Code extension
npm run build:cli # Build standalone CLI (dist/graph-it.js)
For detailed development setup instructions, see DEVELOPMENT.md.
Development Setup
Prerequisites
- Node.js: v22 or higher
- VS Code: v1.96.0 or higher
- Git: For version control
Note: No build tools required! The extension uses WebAssembly (WASM) parsers.
Development Workflow
- Create a feature branch:
git checkout -b feature/your-feature-name
- Start development:
# Start watch mode for automatic rebuilds
npm run watch
# In VS Code, press F5 to launch Extension Development Host
-
Make your changes and test them in the Extension Development Host
-
Run tests:
npm test
npm run test:vscode
For complete development workflow details, see DEVELOPMENT.md.
Making Changes
Branch Naming
Use descriptive branch names:
feature/add-symbol-analysis- New featuresfix/parser-crash- Bug fixesrefactor/improve-caching- Code refactoringdocs/update-readme- Documentation updatestest/add-e2e-tests- Test additions
Commit Messages
Follow the Conventional Commits style:
feat:- New features or capabilitiesfix:- Bug fixes and correctionsrefactor:- Code restructuring without behavior changestest:- Adding or updating testsdocs:- Documentation updateschore:- Maintenance tasks, dependency updatesperf:- Performance improvementsstyle:- Code formatting, linting fixes
Examples:
feat: add symbol-level call hierarchy analysis
fix: resolve cross-platform path handling in tests
refactor: extract common analyzer utilities
test: add e2e tests for unused dependency filtering
docs: update WASM architecture documentation
Code Style
- TypeScript: Use strict mode, avoid
anytypes - ESLint: Run
npm run lintbefore committing - Formatting: Follow existing code style
- Naming: Use camelCase for variables/functions, PascalCase for classes/types
Testing
Test Requirements
All contributions must include appropriate tests:
-
Unit Tests: For new functions, classes, and modules
- Use mocked parsers (WASM doesn't work in Node.js)
- Located in
tests/with*.test.tsnaming - Run with:
npm test
-
E2E Tests: For new user-facing features (MANDATORY)
- Use real WASM parsers in VS Code's Electron environment
- Located in
tests/vscode-e2e/suite/ - Run with:
npm run test:vscodeornpm run test:vscode:vsix
-
Property-Based Tests: For universal properties
- Use fast-check library
- Minimum 100 iterations per test
- Include feature tag and property description
Running Tests
# Unit tests (fast, mocked parsers)
npm test
# CLI unit tests
npm run test:cli
# E2E tests from source (development mode)
npm run test:vscode
# E2E tests from packaged .vsix (production mode, required before release)
npm run test:vscode:vsix
# Coverage report
npm run test:coverage
Cross-Platform Testing
All tests must work on Windows, Linux, and macOS:
- Use
path.join()orpath.resolve()for file paths - Use
String.rawfor Windows path literals in test data - Normalize paths with
normalizePath()fromsrc/shared/path.ts
For complete testing guidelines, see DEVELOPMENT.md.
Submitting Changes
Before Submitting
- Lint and type check:
npm run lint
npm run check:types
- Run all tests:
npm test
npm run test:vscode
npm run test:vscode:vsix # required for user-facing changes
- Verify package (if build config changed):
npm run build -- --production
npm run package
npm run package:verify
- Update documentation if needed
Pull Request Process
- Update your branch with latest upstream changes:
git fetch upstream
git rebase upstream/main
- Push your changes to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub with:
- Clear title following commit message conventions
- Description of changes and motivation
- Test results (commands and outcomes)
- Screenshots/GIFs for UI changes
- Link to related issues if applicable
-
Address review feedback promptly
Pull Request Checklist
- Code follows project style and conventions
- All tests pass (
npm test,npm run test:vscode) - New tests added for new functionality
- E2E tests added for user-facing features
- Documentation updated if needed
- Commit messages follow Conventional Commits style
- Cross-platform compatibility verified
- Package verification passed (if build config changed)
Required PR Evidence
For all PRs, include command output (or CI links) for:
npm run lintnpm run check:typesnpm test
For user-facing changes, include:
npm run test:vscode:vsix
For build config or dependency changes (esbuild.js, .vscodeignore, package.json), include:
npm run package:verify(must print✅ No .map files in package)npx vsce ls graph-it-live-*.vsix | grep "\.wasm$"ls -lh graph-it-live-*.vsix(target ≤ 16 MB; warn if above)
Use .github/pull_request_template.md and complete all checkboxes before requesting review.
Coding Standards
TypeScript Guidelines
- Strict mode: TypeScript is strict, avoid
anytypes - No unused locals: Remove unused variables and parameters
- ESLint compliance: Run
npm run lintbefore committing - Type safety: Use proper types, avoid type assertions when possible
Code Quality
- Small functions: Keep functions focused and concise
- Nesting depth: Keep function nesting depth ≤ 4 levels
- Meaningful names: Use descriptive variable and function names
- JSDoc comments: Add JSDoc for public APIs
- Error handling: Use proper error types, provide meaningful messages
Cross-Platform Compatibility
CRITICAL: All code must work on Windows, Linux, and macOS.
Path Handling:
// ✅ Good - cross-platform
const filePath = path.join(baseDir, 'src', 'file.ts');
const testPath = String.raw`C:\Users\test\file.ts`; // Windows literal
// ❌ Bad - platform-specific
const filePath = baseDir + '/src/file.ts';
const testPath = 'C:\\Users\\test\\file.ts';
Documentation
When to Update Documentation
Update documentation when:
- Adding new features or commands
- Changing existing behavior
- Adding new configuration options
- Modifying build or test processes
- Fixing bugs that affect documented behavior
Documentation Files
- README.md: User-facing documentation, features, usage
- DEVELOPMENT.md: Development setup, build process, testing
- CONTRIBUTING.md: This file, contribution guidelines
- AGENTS.md: Repository guidelines for AI agents
- docs/: Detailed technical documentation
- Inline comments: Code documentation for complex logic
Documentation Style
- Use clear, concise language
- Include code examples where helpful
- Use proper markdown formatting
- Keep table of contents updated
- Add screenshots/GIFs for UI features
WASM Architecture
Graph-It-Live uses WebAssembly (WASM) parsers for improved installation reliability and cross-platform compatibility.
Key Points for Contributors
- Unit tests use mocked parsers - WASM doesn't work in Node.js
- E2E tests use real WASM parsers - Validate in Electron environment
- Extension path required - Parsers need extension path to locate WASM files
- Singleton pattern - Parser instances are cached and reused
- Async initialization - WASM loading is asynchronous
Testing with WASM
Unit Tests (mocked parsers):
import { vi } from 'vitest';
vi.mock('@/analyzer/languages/WasmParserFactory', () => ({
WasmParserFactory: {
getInstance: vi.fn().mockReturnValue({
init: vi.fn().mockResolvedValue(undefined),
getParser: vi.fn().mockResolvedValue({
parse: vi.fn().mockReturnValue({ rootNode: {} }),
}),
}),
},
}));
Integration Tests (real WASM):
const spider = new SpiderBuilder()
.withRootDir('/test/project')
.withExtensionPath('/path/to/extension')
.build();
For complete WASM architecture details, see DEVELOPMENT.md.
Package Verification
CRITICAL: After any change to esbuild.js, .vscodeignore, or dependencies in package.json:
npm run build -- --production
npm run package
npm run package:verify # Must show "✅ No .map files in package"
npx vsce ls | grep "\.wasm$" # Verify WASM files are included
For complete package verification details, see DEVELOPMENT.md.
Getting Help
- GitHub Issues: Report bugs or request features
- GitHub Discussions: Ask questions or share ideas
- Documentation: Check
docs/directory for detailed guides - DEVELOPMENT.md: Comprehensive development guide
License
By contributing to Graph-It-Live, you agree that your contributions will be licensed under the MIT License.
Thank You!
Thank you for contributing to Graph-It-Live! Your contributions help make dependency analysis better for everyone.