Skip to content

Commit 32a47cd

Browse files
committed
init(project): setup complete project structure
0 parents  commit 32a47cd

30 files changed

+6123
-0
lines changed

.github/workflows/ci.yml

Lines changed: 424 additions & 0 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Node.js
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
lerna-debug.log*
7+
8+
# Coverage directory used by tools like istanbul
9+
coverage/
10+
*.lcov
11+
12+
# Dependency directories
13+
jspm_packages/
14+
15+
# Optional npm cache directory
16+
.npm
17+
18+
# Optional eslint cache
19+
.eslintcache
20+
21+
# Output of 'npm pack'
22+
*.tgz
23+
24+
# Yarn Integrity file
25+
.yarn-integrity
26+
27+
# dotenv environment variables file
28+
.env
29+
.env.test
30+
.env.production
31+
.env.local
32+
33+
# IDE files
34+
.vscode/
35+
.idea/
36+
*.swp
37+
*.swo
38+
*~
39+
40+
# OS generated files
41+
.DS_Store
42+
.DS_Store?
43+
._*
44+
.Spotlight-V100
45+
.Trashes
46+
ehthumbs.db
47+
Thumbs.db
48+
49+
# Build output
50+
dist/
51+
build/
52+
53+
# Logs
54+
logs
55+
*.log
56+
57+
# Runtime data
58+
pids
59+
*.pid
60+
*.seed
61+
*.pid.lock
62+
63+
# Coverage
64+
.nyc_output
65+
66+
# Temporary folders
67+
tmp/
68+
temp/
69+
70+
# Local development
71+
.local/
72+
73+
# Test output
74+
test-results/

.npmignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Development files
2+
tests/
3+
example-demo.js
4+
test-auth.js
5+
6+
# IDE files
7+
.vscode/
8+
.idea/
9+
*.swp
10+
*.swo
11+
12+
# OS files
13+
.DS_Store
14+
Thumbs.db
15+
16+
# Logs
17+
*.log
18+
npm-debug.log*
19+
20+
# Coverage
21+
coverage/
22+
.nyc_output/
23+
24+
# Environment
25+
.env
26+
.env.local
27+
.env.test
28+
29+
# Temporary files
30+
tmp/
31+
temp/
32+
33+
# Git
34+
.git/
35+
.gitignore
36+
37+
# Documentation (keep only essential)
38+
docs/development/
39+
CONTRIBUTING.md
40+
CHANGELOG.md
41+
42+
# Build artifacts
43+
dist/
44+
build/

API.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Git-Smart API Documentation
2+
3+
## Classes
4+
5+
### GitSmart
6+
7+
Main class for generating commit messages.
8+
9+
```javascript
10+
const { GitSmart } = require('git-smart')
11+
12+
const gitSmart = new GitSmart({
13+
interactive: false,
14+
verbose: false,
15+
dryRun: false
16+
})
17+
18+
await gitSmart.run()
19+
```
20+
21+
#### Options
22+
23+
- `interactive` (boolean): Enable interactive mode with multiple suggestions
24+
- `verbose` (boolean): Show detailed analysis information
25+
- `dryRun` (boolean): Show suggestions without committing
26+
27+
### MessageGenerator
28+
29+
Generates commit messages based on analysis.
30+
31+
```javascript
32+
const { MessageGenerator } = require('git-smart/src/generators/MessageGenerator')
33+
34+
const generator = new MessageGenerator()
35+
const messages = generator.generateMessages(analysis, styleGuide, options)
36+
```
37+
38+
#### Available Commit Types (18)
39+
40+
**Core**: feat, fix, refactor, docs, test, style, chore, perf
41+
**Extended**: build, ci, security, deps, revert, hotfix, wip, merge, init, release
42+
43+
#### Available Actions/Scopes (70+)
44+
45+
Categories include: api, ui, auth, database, config, security, build, ci, deploy, payment, etc.
46+
47+
### DiffAnalyzer
48+
49+
Analyzes git diff and staged files.
50+
51+
```javascript
52+
const { DiffAnalyzer } = require('git-smart/src/analyzers/DiffAnalyzer')
53+
54+
const analyzer = new DiffAnalyzer()
55+
const analysis = analyzer.analyze(diff, stagedFiles)
56+
```
57+
58+
### HistoryAnalyzer
59+
60+
Analyzes commit history for style patterns.
61+
62+
```javascript
63+
const { HistoryAnalyzer } = require('git-smart/src/analyzers/HistoryAnalyzer')
64+
65+
const historyAnalyzer = new HistoryAnalyzer()
66+
const styleGuide = historyAnalyzer.generateStyleGuide(commits)
67+
```
68+
69+
## CLI Usage
70+
71+
```bash
72+
# Basic usage
73+
git-smart
74+
75+
# Interactive mode
76+
git-smart --interactive
77+
78+
# Dry run
79+
git-smart --dry-run
80+
81+
# Verbose output
82+
git-smart --verbose
83+
84+
# Help
85+
git-smart --help
86+
```
87+
88+
## Analysis Object Structure
89+
90+
```javascript
91+
{
92+
changeType: 'feat',
93+
confidence: 85,
94+
fileChanges: {
95+
added: ['src/auth.js'],
96+
modified: [],
97+
deleted: [],
98+
renamed: [],
99+
categories: Set(['code']),
100+
fileTypes: Set(['JavaScript'])
101+
},
102+
codeChanges: {
103+
newFunctions: ['authenticate'],
104+
newClasses: [],
105+
imports: 1,
106+
exports: 1,
107+
apiCalls: 0,
108+
database: 0,
109+
tests: 0,
110+
keywords: ['auth']
111+
}
112+
}
113+
```
114+
115+
## Style Guide Object
116+
117+
```javascript
118+
{
119+
useConventional: true,
120+
preferredPrefix: 'feat',
121+
targetLength: 50,
122+
includeScope: true,
123+
useCapitalization: false,
124+
usePeriod: false,
125+
tone: 'casual'
126+
}
127+
```

CHANGELOG.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Changelog
2+
3+
All notable changes to Git-Smart will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.0] - 2025-07-12
9+
10+
### Added
11+
- 🎉 Initial release of Git-Smart
12+
- AI-powered commit message generation that works completely offline
13+
- Intelligent analysis of staged changes and code patterns
14+
- Learning from existing commit history for personalized style
15+
- Interactive mode with multiple commit message suggestions
16+
- Support for conventional commit format with type(action): description
17+
- **18 commit types** including extended types (build, ci, security, deps, etc.)
18+
- **70+ actions/scopes** for precise categorization
19+
- Automatic detection of change types with high accuracy
20+
- Smart action detection based on file paths, extensions, and content
21+
- Zero configuration setup - works out of the box
22+
- Support for multiple programming languages and file types
23+
- Dry-run mode for testing suggestions without committing
24+
- Verbose mode for detailed analysis information
25+
- Command-line interface with intuitive options
26+
- Comprehensive test suite with unit and integration tests
27+
- Complete documentation and examples
28+
29+
### Commit Types (18 total)
30+
**Core Types**: feat, fix, refactor, docs, test, style, chore, perf
31+
**Extended Types**: build, ci, security, deps, revert, hotfix, wip, merge, init, release
32+
33+
### Actions/Scopes (70+ total)
34+
- **Architecture**: api, service, controller, model, data, middleware
35+
- **Security**: auth, security, permission, oauth, jwt, session
36+
- **DevOps**: build, ci, deploy, docker, k8s, monitoring
37+
- **Business**: payment, order, cart, product, notification, analytics
38+
- **Frontend**: ui, component, view, layout, style
39+
- **Backend**: database, migration, schema, query
40+
- **And many more...**
41+
42+
### Features
43+
- **Offline Operation**: No API keys or external services required
44+
- **Smart Analysis**: Understands code structure, functions, classes, and patterns
45+
- **Style Learning**: Adapts to your project's existing commit message style
46+
- **Conventional Commits**: Generates properly formatted conventional commit messages
47+
- **Multi-language Support**: Works with JavaScript, TypeScript, Python, Java, and more
48+
- **Interactive Prompts**: Choose from multiple suggestions or write custom messages
49+
- **Cross-platform**: Works on macOS, Linux, and Windows
50+
- **Comprehensive Detection**: File paths, extensions, keywords, and code analysis
51+
- **Zero Dependencies**: Completely self-contained package
52+
53+
### Technical Details
54+
- Built with Node.js (requires 14.0.0+)
55+
- Pure JavaScript implementation with no external dependencies
56+
- Modular architecture with separate analyzers and generators
57+
- Comprehensive error handling and user feedback
58+
- Extensive test coverage for reliability
59+
60+
---
61+
62+
## Future Releases
63+
64+
See [GitHub Issues](https://github.com/NeaDigitra/Git-Smart/issues) for planned features and improvements.

0 commit comments

Comments
 (0)