This document provides a comprehensive overview of the CommitWeave repository structure, explaining the purpose and responsibility of each file and directory.
commitweave/
├── 📄 LICENSE # MIT license file
├── 📄 README.md # Main project documentation and usage guide
├── 📄 PUBLISHING.md # Publishing and release documentation
├── 📄 RELEASE_CHECKLIST.md # Checklist for releases
├── 📄 package.json # NPM package configuration and dependencies
├── 📄 package-lock.json # Locked dependency versions
├── 📄 glinr-commit.json # Default commit configuration file
│
├── 🔧 TypeScript Configuration Files
│ ├── tsconfig.json # Main TypeScript configuration
│ ├── tsconfig.build.json # Build-specific TypeScript configuration
│ ├── tsconfig.cjs.json # CommonJS TypeScript configuration
│ ├── tsconfig.esm.json # ESM TypeScript configuration
│ └── tsconfig.types.json # Type definition configuration
│
├── 📂 bin/ # CLI Entry Points
│ ├── index.ts # Main CLI application entry point
│ └── index.cjs.ts # CommonJS CLI entry point
│
├── 📂 src/ # Source Code
│ ├── 📂 cli/ # Command Line Interface Logic
│ │ ├── createCommitFlow.ts # Interactive commit creation workflow
│ │ └── 📂 commands/ # Configuration Management Commands
│ │ ├── exportConfig.ts # Export configuration to file/stdout
│ │ ├── importConfig.ts # Import and merge configuration
│ │ ├── listConfig.ts # Display current configuration
│ │ ├── resetConfig.ts # Reset to default configuration
│ │ └── doctorConfig.ts # Configuration health validation
│ │
│ ├── 📂 config/ # Configuration Management
│ │ └── defaultConfig.ts # Default commit types and configuration
│ │
│ ├── 📂 core/ # Core Business Logic
│ │ └── commitBuilder.ts # Commit message building and validation
│ │
│ ├── 📂 types/ # TypeScript Type Definitions
│ │ ├── ai.ts # AI-related type definitions and error classes
│ │ ├── commit.ts # Commit message type definitions
│ │ ├── config.ts # Configuration type definitions and schemas
│ │ ├── git.ts # Git-related type definitions
│ │ └── index.ts # Re-exports all types
│ │
│ ├── 📂 ui/ # User Interface Components
│ │ └── banner.ts # CLI banner and branding utilities
│ │
│ ├── 📂 utils/ # Utility Functions
│ │ ├── ai.ts # AI integration utilities with enhanced error handling
│ │ ├── git.ts # Git operations and utilities
│ │ ├── configStore.ts # Configuration loading, saving, and management
│ │ ├── configDiff.ts # Configuration diffing, secret stripping, validation
│ │ └── errorHandler.ts # Centralized error handling and user messaging
│ │
│ └── index.ts # Main library exports
│
├── 📂 scripts/ # Development, Build, and Testing Scripts
│ ├── bench.ts # Performance benchmarking
│ ├── check-commit.ts # Commit message validation script
│ ├── prepare-dist.js # Distribution preparation script
│ ├── release.sh # Release automation script
│ ├── test-ai-fallback.ts # AI fallback behavior testing
│ ├── test-ai-functionality.ts # AI provider testing
│ ├── test-cli-functions.ts # CLI functionality tests
│ ├── test-cross-platform.ts # Cross-platform CLI testing
│ ├── test-init.ts # Initialization tests
│ ├── test-local.ts # Local testing utilities
│ ├── test-vscode-integration.ts # VS Code extension integration testing
│ └── test-*.ts # Various specialized testing utilities
│
├── 📂 tests/ # Test Suite
│ ├── anthropic.spec.ts # Anthropic/Claude provider tests
│ ├── config.spec.ts # Configuration management tests
│ └── perf.spec.ts # Performance utility tests
│
├── 📂 docs/ # Documentation
│ ├── README.md # Architecture documentation
│ ├── file-map.md # This file - complete repository map
│ ├── platform-compatibility.md # Cross-platform testing results
│ └── 📂 testing-reports/ # Generated test reports and artifacts
│ └── platform-test-*.json # Cross-platform test result data
│
├── 📂 vscode-extension/ # VS Code Extension
│ ├── 📄 package.json # Extension manifest and configuration
│ ├── 📄 README.md # Extension documentation
│ ├── 📄 LICENSE # Extension license
│ ├── 📄 tsconfig.json # TypeScript configuration for extension
│ ├── 📂 src/ # Extension source code
│ │ ├── extension.ts # Main extension entry point
│ │ ├── 📂 commands/ # VS Code command implementations
│ │ │ ├── createCommit.ts # "CommitWeave: Create Commit" command
│ │ │ ├── aiCommit.ts # "CommitWeave: AI Commit" command
│ │ │ └── configure.ts # "CommitWeave: Configure" command
│ │ └── 📂 webview/ # Settings webview panel
│ │ ├── panel.ts # Webview provider and logic
│ │ └── ui.html # Settings panel HTML/CSS/JS
│ └── 📂 test/ # Extension tests
│ ├── extension.test.ts # Main extension tests
│ ├── runTest.ts # Test runner configuration
│ └── 📂 suite/ # Test suite setup
│ └── index.ts # Mocha test configuration
│
├── 📂 dist/ # Built Distribution Files (generated)
└── 📂 node_modules/ # NPM Dependencies (generated)
- Purpose: Main CLI entry point and application orchestrator
- Responsibilities:
- Command-line argument parsing
- Interactive menu system
- Command routing (init, create, ai, check, help)
- User interface and branding
- Error handling and process management
- Key Features: Beautiful CLI interface with loading animations and branded output
- Purpose: Core commit message construction and validation
- Responsibilities:
- Fluent API for building commit messages
- Conventional commit format support
- Message validation and error handling
- Emoji integration
- Breaking change handling
- Key Classes:
CommitBuilderclass with method chaining
- Purpose: Interactive commit creation workflow
- Responsibilities:
- User input collection via prompts
- Configuration loading and validation
- Commit message preview and confirmation
- Integration with CommitBuilder
- Features: Multi-step interactive prompts with validation
- Purpose: Default configuration and commit types
- Contents:
- 11 predefined commit types with emojis
- Default configuration schema
- Commit type alias mapping
- Commit Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
- config.ts: Configuration schemas using Zod validation
- commit.ts: Commit message structure definitions
- git.ts: Git repository and operations types
- ai.ts: AI provider and configuration types
- index.ts: Centralized type exports
- Purpose: Git repository operations and utilities
- Key Classes:
GitUtilsclass - Features:
- Repository validation
- File staging and committing
- Status checking and diff generation
- Branch management
- Change summary formatting
- Purpose: AI integration for commit message generation
- Supported Providers: OpenAI, Anthropic, Mock
- Features: Automated commit message generation from diffs
- Purpose: CLI branding and visual elements
- Features:
- Animated loading screens
- Branded banners and colors
- Feature highlights
- Purpose: VS Code extension for seamless IDE integration
- Publisher:
typeweaver(maintained by GLINR STUDIOS) - Commands:
CommitWeave: Create Commit- Launch interactive CLI in integrated terminalCommitWeave: AI Commit- Generate AI-powered commit messagesCommitWeave: Configure- Open settings webview panel
- Purpose: Main extension entry point and activation logic
- Responsibilities:
- Extension activation/deactivation lifecycle
- Command registration and routing
- Welcome message and first-time setup
- Integration with VS Code APIs
- createCommit.ts: Executes CommitWeave CLI for interactive commit creation
- aiCommit.ts: Runs AI-powered commit generation with staged change validation
- configure.ts: Opens settings webview panel for extension configuration
- panel.ts: Webview provider with repository status monitoring and settings management
- ui.html: Complete settings UI with dark-mode support and GLINR STUDIOS branding
- Features:
- Repository status monitoring (git repo, staged files, CLI availability)
- Emoji toggle and AI provider selection
- VS Code theme integration
- Real-time status checking
- package.json: Extension manifest with commands, settings schema, and branding
- Settings:
commitweave.emojiEnabled: Toggle emoji in commit messagescommitweave.aiProvider: Select AI provider (OpenAI/Anthropic/Mock)
- Testing: Integration tests with @vscode/test-electron
- bench.ts: Performance benchmarking with 300ms cold-start target
- check-commit.ts: Validates commit messages against conventional standards
- test-cross-platform.ts: Cross-platform CLI compatibility testing
- test-ai-functionality.ts: AI provider and functionality testing
- test-ai-fallback.ts: Network failure and AI fallback behavior testing
- test-vscode-integration.ts: VS Code extension integration validation
- test-*.ts: Various specialized testing utilities
- prepare-dist.js: Prepares distribution files for publishing
- release.sh: Automates the release process
- Platform Compatibility: macOS, Linux, Windows shell testing
- AI Provider Testing: OpenAI, Claude, Mock AI with fallback scenarios
- Performance Validation: 24ms average startup (12x better than target)
- VS Code Integration: All extension commands and CLI integration
- Network Failure Simulation: Graceful degradation testing
- docs/platform-compatibility.md: Cross-platform test results documentation
- docs/testing-reports/: Generated test artifacts and JSON reports
- All tests achieve 100% pass rate with comprehensive error handling
- tsconfig.json: Main TypeScript configuration
- tsconfig.build.json: Production build settings
- tsconfig.cjs.json: CommonJS module configuration
- tsconfig.esm.json: ESM module configuration
- tsconfig.types.json: Type definition generation
- package.json: NPM package metadata, scripts, and dependencies
- Dependencies: chalk, enquirer, simple-git, zod, cosmiconfig
- Dev Dependencies: TypeScript, tsx, @types/node
- Builder Pattern:
CommitBuilderfor constructing commit messages - Factory Pattern: Git utilities and configuration loading
- Command Pattern: CLI command routing and execution
- Strategy Pattern: AI provider abstraction
- chalk: Terminal string styling and colors
- enquirer: Interactive CLI prompts
- simple-git: Git operations wrapper
- zod: Runtime type validation and schemas
- cosmiconfig: Configuration file loading
- Barrel Exports: Centralized exports from
src/index.ts - Type Safety: Comprehensive TypeScript coverage
- Configuration-Driven: Highly customizable via
glinr-commit.json - Plugin Architecture: Extensible commit types and AI providers
commitweave: Interactive commit creationcommitweave --ai: AI-powered commit generationcommitweave init: Configuration setupcommitweave check: Commit validationcommitweave --help: Help documentation
The package can also be used programmatically by importing from the main module:
CommitBuilderfor building commit messagesGitUtilsfor git operations- Configuration utilities and types
- ci.yml: Main CI pipeline with Node.js matrix testing and VS Code extension packaging
- vscode-publish.yml: Automated VS Code extension publishing to marketplace
- Features:
- Multi-version Node.js testing (18, 20, 22)
- Automated extension build and VSIX packaging
- Extension testing with xvfb (headless VS Code)
- Auto-publishing on
vscode-v*.*.*tags - GitHub release creation with VSIX artifacts
- Cold-start: ~23ms average (13x better than 300ms target)
- Lazy loading: Heavy dependencies loaded only when needed
- Build system: Optimized module resolution and path mapping
- Benchmarking:
npm run benchfor repeatable performance testing
- Total Files: ~40+ source files
- Languages: TypeScript (100%)
- Packages:
- Main CLI package (~25 files)
- VS Code extension (~15 files)
- Test Coverage: CLI functions, extension integration, and core logic
- Package Size: Minimal dependencies, focused scope
- Node.js: Requires Node.js >= 18.0.0
- VS Code: Requires VS Code >= 1.80.0