Skip to content

Commit cf4bc1e

Browse files
committed
docs: enhance README with professional badges and links
- Add comprehensive badge collection (NPM, GitHub, CI, TypeScript) - Improve README structure with emoji sections and table of contents - Add extensive links section with NPM, GitHub, and documentation - Update package.json with keywords, funding, and better homepage - Add MIT LICENSE file - Create professional project presentation with clear navigation
1 parent b611464 commit cf4bc1e

File tree

3 files changed

+116
-19
lines changed

3 files changed

+116
-19
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 253eosam
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 75 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
# commit-from-branch
22

3-
Flexible commit message templating from branch name (ticket/segments) for Husky's `prepare-commit-msg` hook.
3+
<div align="center">
4+
5+
[![NPM Version](https://img.shields.io/npm/v/@253eosam/commit-from-branch?style=flat-square&color=blue)](https://www.npmjs.com/package/@253eosam/commit-from-branch)
6+
[![NPM Downloads](https://img.shields.io/npm/dm/@253eosam/commit-from-branch?style=flat-square&color=green)](https://www.npmjs.com/package/@253eosam/commit-from-branch)
7+
[![GitHub Release](https://img.shields.io/github/v/release/253eosam/commit-from-branch?style=flat-square&color=purple)](https://github.com/253eosam/commit-from-branch/releases)
8+
[![License](https://img.shields.io/npm/l/@253eosam/commit-from-branch?style=flat-square&color=orange)](https://github.com/253eosam/commit-from-branch/blob/main/LICENSE)
9+
10+
[![CI Status](https://img.shields.io/github/actions/workflow/status/253eosam/commit-from-branch/release.yml?style=flat-square&label=CI)](https://github.com/253eosam/commit-from-branch/actions)
11+
[![GitHub Pages](https://img.shields.io/github/deployments/253eosam/commit-from-branch/github-pages?style=flat-square&label=Demo)](https://253eosam.github.io/commit-from-branch/)
12+
[![Node.js](https://img.shields.io/node/v/@253eosam/commit-from-branch?style=flat-square&color=brightgreen)](https://nodejs.org/)
13+
[![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue?style=flat-square)](https://www.typescriptlang.org/)
14+
15+
</div>
16+
17+
**Flexible commit message templating from branch name (ticket/segments) for Husky's `prepare-commit-msg` hook.**
418

519
Automatically formats your commit messages based on your branch name, extracting Jira-style tickets (e.g., `ABC-123`) and supporting flexible templating with branch segments.
620

@@ -14,19 +28,35 @@ Automatically formats your commit messages based on your branch name, extracting
1428
- 🎨 **Pattern matching** - Include/exclude branches with glob patterns
1529
- 🏃 **Fast & lightweight** - Minimal dependencies, TypeScript-based
1630

17-
## Installation
31+
32+
## 📖 Table of Contents
33+
34+
- [Demo](#-demo)
35+
- [Installation](#-installation)
36+
- [Quick Start](#-quick-start)
37+
- [Configuration](#-configuration)
38+
- [Template Variables](#-template-variables)
39+
- [Examples](#-examples)
40+
- [Debug Mode](#-debug-mode)
41+
- [Programmatic Usage](#-programmatic-usage)
42+
- [How It Works](#-how-it-works)
43+
- [Requirements](#-requirements)
44+
- [Contributing](#-contributing)
45+
- [Links](#-links)
46+
47+
## 🌐 Demo
48+
49+
**[🚀 Live Demo](https://253eosam.github.io/commit-from-branch/)** - Try the interactive demo to see how commit message templating works!
50+
51+
## 📦 Installation
1852

1953
```bash
2054
npm install @253eosam/commit-from-branch --save-dev
2155
```
2256

2357
> **Note**: This package requires Husky v9 as a peer dependency. npm will automatically warn you if it's not installed.
2458
25-
## Demo
26-
27-
🌐 **[Live Demo](https://253eosam.github.io/commit-from-branch/)** - Try the interactive demo to see how commit message templating works!
28-
29-
## Quick Start
59+
## 🚀 Quick Start
3060

3161
1. **Install Husky v9** (if not already installed):
3262

@@ -62,7 +92,7 @@ git commit -m "implement user authentication"
6292
# Result: "[ABC-123] implement user authentication"
6393
```
6494

65-
## Configuration
95+
## ⚙️ Configuration
6696

6797
Add configuration to your `package.json`:
6898

@@ -86,7 +116,7 @@ Add configuration to your `package.json`:
86116
| `includePattern` | `string \| string[]` | `["*"]` | Glob patterns for branches to include |
87117
| `exclude` | `string[]` | `["merge", "squash", "revert"]` | Commit sources to exclude |
88118

89-
## Template Variables
119+
## 🔧 Template Variables
90120

91121
Use these placeholders in your format templates:
92122

@@ -100,7 +130,7 @@ Use these placeholders in your format templates:
100130
| `${msg}` | Original commit message | `implement user authentication` |
101131
| `${body}` | Full original commit body | Multi-line commit content |
102132

103-
## Examples
133+
## 💡 Examples
104134

105135
### Basic Ticket Extraction
106136

@@ -156,23 +186,23 @@ Use these placeholders in your format templates:
156186
}
157187
```
158188

159-
## Debug Mode
189+
## 🐛 Debug Mode
160190

161191
Enable debug logging:
162192

163193
```bash
164194
BRANCH_PREFIX_DEBUG=1 git commit -m "test message"
165195
```
166196

167-
## Dry Run Mode
197+
## 🧪 Dry Run Mode
168198

169199
Test without modifying commit messages:
170200

171201
```bash
172202
BRANCH_PREFIX_DRYRUN=1 git commit -m "test message"
173203
```
174204

175-
## Programmatic Usage
205+
## 🔌 Programmatic Usage
176206

177207
```typescript
178208
import { run } from "@253eosam/commit-from-branch";
@@ -192,7 +222,7 @@ import { initHusky } from "@253eosam/commit-from-branch/init";
192222
initHusky("/path/to/repo");
193223
```
194224

195-
## How It Works
225+
## How It Works
196226

197227
1. **Hook Integration**: Integrates with Husky's `prepare-commit-msg` hook
198228
2. **Branch Detection**: Gets current branch name using `git rev-parse --abbrev-ref HEAD`
@@ -201,13 +231,13 @@ initHusky("/path/to/repo");
201231
5. **Template Rendering**: Replaces placeholders with actual values
202232
6. **Message Formatting**: Updates commit message file with formatted result
203233

204-
## Requirements
234+
## 📋 Requirements
205235

206236
- Node.js >= 16
207237
- Git repository
208238
- Husky v9 (peer dependency)
209239

210-
## Contributing
240+
## 🤝 Contributing
211241

212242
1. Fork the repository
213243
2. Create a feature branch: `git checkout -b feature/my-feature`
@@ -217,6 +247,34 @@ initHusky("/path/to/repo");
217247
6. Push to the branch: `git push origin feature/my-feature`
218248
7. Submit a pull request
219249

220-
## License
250+
## 🔗 Links
251+
252+
### Package & Releases
253+
- **[📦 NPM Package](https://www.npmjs.com/package/@253eosam/commit-from-branch)** - Official NPM package
254+
- **[🚀 GitHub Releases](https://github.com/253eosam/commit-from-branch/releases)** - Release notes and downloads
255+
- **[🌐 Live Demo](https://253eosam.github.io/commit-from-branch/)** - Interactive demo
256+
257+
### Development & Community
258+
- **[💻 Source Code](https://github.com/253eosam/commit-from-branch)** - GitHub repository
259+
- **[🐛 Report Issues](https://github.com/253eosam/commit-from-branch/issues)** - Bug reports and feature requests
260+
- **[📊 CI/CD Pipeline](https://github.com/253eosam/commit-from-branch/actions)** - Build status and automation
261+
- **[📈 NPM Stats](https://npmcharts.com/compare/@253eosam/commit-from-branch)** - Download statistics
262+
263+
### Documentation
264+
- **[📚 API Documentation](https://github.com/253eosam/commit-from-branch#-programmatic-usage)** - Programmatic usage guide
265+
- **[⚙️ Configuration Guide](https://github.com/253eosam/commit-from-branch#%EF%B8%8F-configuration)** - Setup and customization
266+
- **[🔧 Template Variables](https://github.com/253eosam/commit-from-branch#-template-variables)** - Available placeholders
267+
268+
## 📄 License
221269

222270
MIT © [253eosam](https://github.com/253eosam)
271+
272+
---
273+
274+
<div align="center">
275+
276+
**[⬆ Back to Top](#commit-from-branch)**
277+
278+
Made with ❤️ by [253eosam](https://github.com/253eosam)
279+
280+
</div>

package.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
{
22
"name": "@253eosam/commit-from-branch",
33
"version": "0.2.4",
4-
"description": "Flexible commit message templating from branch name (ticket/segments) for Husky prepare-commit-msg",
4+
"description": "🚀 Flexible commit message templating from branch name (ticket/segments) for Husky's prepare-commit-msg hook. Automatically extracts Jira-style tickets and supports customizable templates.",
5+
"keywords": [
6+
"commit",
7+
"git",
8+
"husky",
9+
"commit-msg",
10+
"jira",
11+
"ticket",
12+
"branch",
13+
"template",
14+
"prepare-commit-msg",
15+
"automation",
16+
"typescript",
17+
"cli"
18+
],
519
"license": "MIT",
620
"repository": {
721
"type": "git",
@@ -10,7 +24,11 @@
1024
"bugs": {
1125
"url": "https://github.com/253eosam/commit-from-branch/issues"
1226
},
13-
"homepage": "https://github.com/253eosam/commit-from-branch#readme",
27+
"homepage": "https://253eosam.github.io/commit-from-branch/",
28+
"funding": {
29+
"type": "github",
30+
"url": "https://github.com/sponsors/253eosam"
31+
},
1432
"type": "module",
1533
"main": "./dist/core.cjs",
1634
"module": "./dist/core.js",

0 commit comments

Comments
 (0)